PageSourceSearch

https://socialabc.ai/_nuxt/BGNCjMq_.js

js socialabc.ai collected 2026-10-05 15:08:00 UTC 2,187,688 bytes, 7,925 lines download raw bytes

vendor: 4,480 bytes, line 1
1import{T as YT,l as Eh,aV as YF,aW as QF,g as QT,H as oy,n as ZF,Y as KF,c as JF,o as eU,q as ZT}from"./CDMIIqi7.js";import{O as Cd,P as tU,Q as Vc,R as nU,T as T_,U as P2,V as iU,W as rU,X as sU,z as RP,Y as oU,Z as aU,d as lU,p as cU,$ as uU}from"./Dy6_mvUu.js";import{n as oa,A as Pc,t as KT,k as ef,f as Oi,h as hr,r as Si,L as CP,g as pS,a as tf,j as sa,M as JT,N as hU,O as dU,d as Pl,P as fU,G as L2,Q as N2,e as AS,s as E_,R as pU,S as fm,T as e3,z as PP,U as AU,J as mU}from"./04aMsPUT.js";import{l as gU}from"./CDBz8eI9.js";import{g as t3}from"./C67Y_a5a.js";import"./ihpd6ZvD.js";import"./CLETTTpt.js";import"./GiPZ6Wfx.js";import"./Dp6xroGS.js";import"./DNlbjVTN.js";import"./DlAUqK2U.js";var R_=new Pc,n3=new Pc,LP,NP,D2,I2,B2,Ul={point:oa,lineStart:oa,lineEnd:oa,polygonStart:function(){R_=new Pc,Ul.lineStart=_U,Ul.lineEnd=vU},polygonEnd:function(){var i=+R_;n3.add(i<0?KT+i:i),this.lineStart=this.lineEnd=this.point=oa},sphere:function(){n3.add(KT)}};function _U(){Ul.point=yU}function vU(){DP(LP,NP)}function yU(i,e){Ul.point=DP,LP=i,NP=e,i*=Si,e*=Si,D2=i,I2=hr(e=e/2+CP),B2=Oi(e)}function DP(i,e){i*=Si,e*=Si,e=e/2+CP;var t=i-D2,n=t>=0?1:-1,r=n*t,s=hr(e),o=Oi(e),a=B2*o,l=I2*s+a*hr(r),c=a*n*Oi(r);R_.add(ef(c,l)),D2=i,I2=s,B2=o}var Ui,Bs,Wi,mo,Eu,IP,BP,qd,AA,xc,Ol,bl={point:F2,lineStart:i3,lineEnd:r3,polygonStart:function(){bl.point=UP,bl.lineStart=xU,bl.lineEnd=bU,AA=new Pc,Ul.polygonStart()},polygonEnd:function(){Ul.polygonEnd(),bl.point=F2,bl.lineStart=i3,bl.lineEnd=r3,R_<0?(Ui=-(Wi=180),Bs=-(mo=90)):AA>sa?mo=90:AA<-1e-6&&(Bs=-90),Ol[0]=Ui,Ol[1]=Wi},sphere:function(){Ui=-(Wi=180),Bs=-(mo=90)}};function F2(i,e){xc.push(Ol=[Ui=i,Wi=i]),e<Bs&&(Bs=e),e>mo&&(mo=e)}function FP(i,e){var t=fU([i*Si,e*Si]);if(qd){var n=JT(qd,t),r=[n[1],-n[0],0],s=JT(r,n);hU(s),s=dU(s);var o=i-Eu,a=o>0?1:-1,l=s[0]*Pl*a,c,u=tf(o)>180;u^(a*Eu<l&&l<a*i)?(c=s[1]*Pl,c>mo&&(mo=c)):(l=(l+360)%360-180,u^(a*Eu<l&&l<a*i)?(c=-s[1]*Pl,c<Bs&&(Bs=c)):(e<Bs&&(Bs=e),e>mo&&(mo=e))),u?i<Eu?ho(Ui,i)>ho(Ui,Wi)&&(Wi=i):ho(i,Wi)>ho(Ui,Wi)&&(Ui=i):Wi>=Ui?(i<Ui&&(Ui=i),i>Wi&&(Wi=i)):i>Eu?ho(Ui,i)>ho(Ui,Wi)&&(Wi=i):ho(i,Wi)>ho(Ui,Wi)&&(Ui=i)}else xc.push(Ol=[Ui=i,Wi=i]);e<Bs&&(Bs=e),e>mo&&(mo=e),qd=t,Eu=i}function i3(){bl.point=FP}function r3(){Ol[0]=Ui,Ol[1]=Wi,bl.point=F2,qd=null}function UP(i,e){if(qd){var t=i-Eu;AA.add(tf(t)>180?t+(t>0?360:-360):t)}else IP=i,BP=e;Ul.point(i,e),FP(i,e)}function xU(){Ul.lineStart()}function bU(){UP(IP,BP),Ul.lineEnd(),tf(AA)>sa&&(Ui=-(Wi=180)),Ol[0]=Ui,Ol[1]=Wi,qd=null}function ho(i,e){return(e-=i)<0?e+360:e}function SU(i,e){return i[0]-e[0]}function s3(i,e){return i[0]<=i[1]?i[0]<=e&&e<=i[1]:e<i[0]||i[1]<e}function OP(i){var e,t,n,r,s,o,a;if(mo=Wi=-(Ui=Bs=1/0),xc=[],pS(i,bl),t=xc.length){for(xc.sort(SU),e=1,n=xc[0],s=[n];e<t;++e)r=xc[e],s3(n,r[0])||s3(n,r[1])?(ho(n[0],r[1])>ho(n[0],n[1])&&(n[1]=r[1]),ho(r[0],n[1])>ho(n[0],n[1])&&(n[0]=r[0])):s.push(n=r);for(o=-1/0,t=s.length-1,e=0,n=s[t];e<=t;n=r,++e)r=s[e],(a=ho(n[1],r[0]))>o&&(o=a,Ui=r[0],Wi=n[1])}return xc=Ol=null,Ui===1/0||Bs===1/0?[[NaN,NaN],[NaN,NaN]]:[[Ui,Bs],[Wi,mo]]}var nA,C_,P_,L_,N_,D_,I_,B_,U2,O2,k2,kP,zP,ys,xs,bs,aa={sphere:oa,point:mS,lineStart:o3,lineEnd:a3,polygonStart:function(){aa.lineStart=TU,aa.lineEnd=EU},polygonEnd:function(){aa.lineStart=o3,aa.lineEnd=a3}};function mS(i,e){i*=Si,e*=Si;var t=hr(e);T0(t*hr(i),t*Oi(i),Oi(e))}function T0(i,e,t){++nA,P_+=(i-P_)/nA,L_+=(e-L_)/nA,N_+=(t-N_)/nA}function o3(){aa.point=MU}function MU(i,e){i*=Si,e*=Si;var t=hr(e);ys=t*hr(i),xs=t*Oi(i),bs=Oi(e),aa.point=wU,T0(ys,xs,bs)}function wU(i,e){i*=Si,e*=Si;var t=hr(e),n=t*hr(i),r=t*Oi(i),s=Oi(e),o=ef(E_((o=xs*s-bs*r)*o+(o=bs*n-ys*s)*o+(o=ys*r-xs*n)*o),ys*n+xs*r+bs*s);C_+=o,D_+=o*(ys+(ys=n)),I_+=o*(xs+(xs=r)),B_+=o*(bs+(bs=s)),T0(ys,xs,bs)}function a3(){aa.point=mS}function TU(){aa.point=RU}function EU(){VP(kP,zP),aa.point=mS}function RU(i,e){kP=i,zP=e,i*=Si,e*=Si,aa.point=VP;var t=hr(e);ys=t*hr(i),xs=t*Oi(i),bs=Oi(e),T0(ys,xs,bs)}function VP(i,e){i*=Si,e*=Si;var t=hr(e),n=t*hr(i),r=t*Oi(i),s=Oi(e),o=xs*s-bs*r,a=bs*n-ys*s,l=ys*r-xs*n,c=N2(o,a,l),u=AS(c),p=c&&-u/c;U2.add(p*o),O2.add(p*a),k2.add(p*l),C_+=u,D_+=u*(ys+(ys=n)),I_+=u*(xs+(xs=r)),B_+=u*(bs+(bs=s)),T0(ys,xs,bs)}function l3(i){nA=C_=P_=L_=N_=D_=I_=B_=0,U2=new Pc,O2=new Pc,k2=new Pc,pS(i,aa);var e=+U2,t=+O2,n=+k2,r=N2(e,t,n);return r<L2&&(e=D_,t=I_,n=B_,C_<sa&&(e=P_,t=L_,n=N_),r=N2(e,t,n),r<L2)?[NaN,NaN]:[ef(t,e)*Pl,AS(n/r)*Pl]}var z2,V2,s_,o_,nf={sphere:oa,point:oa,lineStart:CU,lineEnd:oa,polygonStart:
1oa,polygonEnd:oa};function CU(){nf.point=LU,nf.lineEnd=PU}function PU(){nf.point=nf.lineEnd=oa}function LU(i,e){i*=Si,e*=Si,V2=i,s_=Oi(e),o_=hr(e),nf.point=NU}function NU(i,e){i*=Si,e*=Si;var t=Oi(e),n=hr(e),r=tf(i-V2),s=hr(r),o=Oi(r),a=n*o,l=o_*t-s_*n*s,c=s_*t+o_*n*s;z2.add(ef(E_(a*a+l*l),c)),V2=i,s_=t,o_=n}function DU(i){return z2=new Pc,pS(i,nf),+z2}var G2=[null,null],IU={type:"LineString",coordinates:G2};function Gc(i,e){return G2[0]=i,G2[1]=e,DU(IU)}var c3={Feature:function(i,e){return F_(i.geometry,e)},FeatureCollection:function(i,e){for(var t=i.features,n=-1,r=t.length;++n<r;)if(F_(t[n].geometry,e))return!0;return!1}},u3={Sphere:function(){return!0},Point:function(i,e){return h3(i.coordinates,e)},MultiPoint:function(i,e){for(var t=i.coordinates,n=-1,r=t.length;++n<r;)if(h3(t[n],e))return!0;return!1},LineString:function(i,e){return d3(i.coordinates,e)},MultiLineString:function(i,e){for(var t=i.coordinates,n=-1,r=t.length;++n<r;)if(d3(t[n],e))return!0;return!1},Polygon:function(i,e){return f3(i.coordinates,e)},MultiPolygon:function(i,e){for(var t=i.coordinates,n=-1,r=t.length;++n<r;)if(f3(t[n],e))return!0;return!1},GeometryCollection:function(i,e){for(var t=i.geometries,n=-1,r=t.length;++n<r;)if(F_(t[n],e))return!0;return!1}};function F_(i,e){return i&&u3.hasOwnProperty(i.type)?u3[i.type](i,e):!1}function h3(i,e){return Gc(i,e)===0}function d3(i,e){for(var t,n,r,s=0,o=i.length;s<o;s++){if(n=Gc(i[s],e),n===0||s>0&&(r=Gc(i[s],i[s-1]),r>0&&t<=r&&n<=r&&(t+n-r)*(1-Math.pow((t-n)/r,2))<L2*r))return!0;t=n}return!1}function f3(i,e){return!!pU(i.map(BU),GP(e))}function BU(i){return i=i.map(GP),i.pop(),i}function GP(i){return[i[0]*Si,i[1]*Si]}function FU(i,e){return(i&&c3.hasOwnProperty(i.type)?c3[i.type]:F_)(i,e)}function p3(i,e,t){var n=Cd(i,e-sa,t).concat(e);return function(r){return n.map(function(s){return[r,s]})}}function A3(i,e,t){var n=Cd(i,e-sa,t).concat(e);return function(r){return n.map(function(s){return[s,r]})}}function UU(){var i,e,t,n,r,s,o,a,l=10,c=l,u=90,p=360,m,g,v,b,M=2.5;function x(){return{type:"MultiLineString",coordinates:w()}}function w(){return Cd(fm(n/u)*u,t,u).map(v).concat(Cd(fm(a/p)*p,o,p).map(b)).concat(Cd(fm(e/l)*l,i,l).filter(function(R){return tf(R%u)>sa}).map(m)).concat(Cd(fm(s/c)*c,r,c).filter(function(R){return tf(R%p)>sa}).map(g))}return x.lines=function(){return w().map(function(R){return{type:"LineString",coordinates:R}})},x.outline=function(){return{type:"Polygon",coordinates:[v(n).concat(b(o).slice(1),v(t).reverse().slice(1),b(a).reverse().slice(1))]}},x.extent=function(R){return arguments.length?x.extentMajor(R).extentMinor(R):x.extentMinor()},x.extentMajor=function(R){return arguments.length?(n=+R[0][0],t=+R[1][0],a=+R[0][1],o=+R[1][1],n>t&&(R=n,n=t,t=R),a>o&&(R=a,a=o,o=R),x.precision(M)):[[n,a],[t,o]]},x.extentMinor=function(R){return arguments.length?(e=+R[0][0],i=+R[1][0],s=+R[0][1],r=+R[1][1],e>i&&(R=e,e=i,i=R),s>r&&(R=s,s=r,r=R),x.precision(M)):[[e,s],[i,r]]},x.step=function(R){return arguments.length?x.stepMajor(R).stepMinor(R):x.stepMinor()},x.stepMajor=function(R){return arguments.length?(u=+R[0],p=+R[1],x):[u,p]},x.stepMinor=function(R){return arguments.length?(l=+R[0],c=+R[1],x):[l,c]},x.precision=function(R){return arguments.length?(M=+R,m=p3(s,r,90),g=A3(e,i,M),v=p3(a,o,90),b=A3(n,t,M),x):M},x.extentMajor([[-180,-90+sa],[180,90-sa]]).extentMinor([[-180,-80-sa],[180,80+sa]])}function OU(){return UU()()}function gS(i,e){var t=i[0]*Si,n=i[1]*Si,r=e[0]*Si,s=e[1]*Si,o=hr(n),a=Oi(n),l=hr(s),c=Oi(s),u=o*hr(t),p=o*Oi(t),m=l*hr(r),g=l*Oi(r),v=2*AS(E_(e3(s-n)+o*l*e3(r-t))),b=Oi(v),M=v?function(x){var w=Oi(x*=v)/b,R=Oi(v-x)/b,C=R*u+w*m,N=R*p+w*g,D=R*a+w*c;return[ef(N,C)*Pl,ef(D,E_(C*C+N*N))*Pl]}:function(){return[t*Pl,n*Pl]};return M.distance=v,M}var kU=typeof global=="object"&&global&&global.Object===Object&&global,zU=typeof self=="object"&&self&&self.Object===Object&&self,qP=kU||zU||Function("return this")(),U_=qP.Symbol,HP=Object.prototype,VU=HP.hasOwnProperty,GU=HP.toString,mp=U_?U_.toStringTag:void 0;function qU(i){var e=VU.call(i,mp),t=i[mp];try{i[mp]=void 0;var n=!0}catch{}var r=GU.call(i);return n&&(e?i[mp]=t:delete i[mp]),r}var HU=Object.prototype,WU=HU.toString;function $U(i){return WU.call(i)}
1var jU="[object Null]",XU="[object Undefined]",m3=U_?U_.toStringTag:void 0;function YU(i){return i==null?i===void 0?XU:jU:m3&&m3 in Object(i)?qU(i):$U(i)}function QU(i){return i!=null&&typeof i=="object"}function q2(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}var ZU="[object Symbol]";function KU(i){return typeof i=="symbol"||QU(i)&&YU(i)==ZU}var JU=/\s/;function eO(i){for(var e=i.length;e--&&JU.test(i.charAt(e)););return e}var tO=/^\s+/;function nO(i){return i&&i.slice(0,eO(i)+1).replace(tO,"")}var g3=NaN,iO=/^[-+]0x[0-9a-f]+$/i,rO=/^0b[01]+$/i,sO=/^0o[0-7]+$/i,oO=parseInt;function _3(i){if(typeof i=="number")return i;if(KU(i))return g3;if(q2(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=q2(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=nO(i);var t=rO.test(i);return t||sO.test(i)?oO(i.slice(2),t?2:8):iO.test(i)?g3:+i}var ay=function(){return qP.Date.now()};function aO(i){for(var e=i.length/6|0,t=new Array(e),n=0;n<e;)t[n]="#"+i.slice(n*6,++n*6);return t}const lO=i=>tU(i[i.length-1]);var cO=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(aO);const uO=lO(cO);function hO(i){return i=Math.max(0,Math.min(1,i)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+i*(1172.33-i*(10793.56-i*(33300.12-i*(38394.49-i*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+i*(557.33+i*(1225.33-i*(3574.96-i*(1073.77+i*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+i*(3211.1-i*(15327.97-i*(27814-i*(22569.18-i*6838.66)))))))+")"}/**
2 * @license
3 * Copyright 2010-2025 Three.js Authors
4 * SPDX-License-Identifier: MIT
5 */const zf="176",zo={ROTATE:0,DOLLY:1,PAN:2},Pd={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},WP=0,H2=1,$P=2,dO=0,_S=1,fO=2,fo=3,qs=0,oi=1,ur=2,Hs=0,ws=1,rf=2,sf=3,of=4,Hd=5,os=100,vS=101,yS=102,jP=103,XP=104,Sl=200,xS=201,bS=202,SS=203,NA=204,DA=205,MS=206,wS=207,TS=208,ES=209,RS=210,pO=211,AO=212,mO=213,gO=214,IA=0,BA=1,FA=2,qc=3,UA=4,OA=5,kA=6,zA=7,E0=0,YP=1,QP=2,Ws=0,ZP=1,KP=2,JP=3,eL=4,_O=5,tL=6,nL=7,CS=300,Aa=301,ma=302,eh=303,th=304,nh=306,ih=1e3,ka=1001,rh=1002,xi=1003,PS=1004,Ll=1005,xr=1006,Wd=1007,Os=1008,vO=1008,Gi=1009,Gu=1010,qu=1011,la=1012,Ir=1013,mi=1014,er=1015,dr=1016,M1=1017,w1=1018,xo=1020,T1=35902,LS=1021,R0=1022,Yi=1023,bo=1026,So=1027,C0=1028,Vf=1029,Nl=1030,Gf=1031,yO=1032,qf=1033,Hu=33776,Lc=33777,Nc=33778,Dc=33779,VA=35840,GA=35841,qA=35842,HA=35843,WA=36196,af=37492,lf=37496,cf=37808,uf=37809,hf=37810,df=37811,ff=37812,pf=37813,Af=37814,mf=37815,gf=37816,_f=37817,vf=37818,yf=37819,xf=37820,bf=37821,Wu=36492,W2=36494,$2=36495,NS=36283,$A=36284,jA=36285,XA=36286,xO=0,bO=1,v3=2,SO=3200,MO=3201,kl=0,iL=1,vo="",Xt="srgb",ha="srgb-linear",O_="linear",ei="srgb",wO=0,Ru=7680,TO=7681,EO=7682,RO=7683,CO=34055,PO=34056,LO=5386,NO=512,DO=513,IO=514,BO=515,FO=516,UO=517,OO=518,j2=519,DS=512,E1=513,IS=514,R1=515,BS=516,FS=517,US=518,OS=519,k_=35044,Ld=35048,y3="300 es",Ms=2e3,Xa=2001;let il=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const r=n[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e);e.target=null}}};const ts=["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","5
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 x3=1234567;const mA=Math.PI/180,sh=180/Math.PI;function Ga(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(ts[i&255]+ts[i>>8&255]+ts[i>>16&255]+ts[i>>24&255]+"-"+ts[e&255]+ts[e>>8&255]+"-"+ts[e>>16&15|64]+ts[e>>24&255]+"-"+ts[t&63|128]+ts[t>>8&255]+"-"+ts[t>>16&255]+ts[t>>24&255]+ts[n&255]+ts[n>>8&255]+ts[n>>16&255]+ts[n>>24&255]).toLowerCase()}function wn(i,e,t){return Math.max(e,Math.min(t,i))}function kS(i,e){return(i%e+e)%e}function kO(i,e,t,n,r){return n+(i-e)*(r-n)/(t-e)}function zO(i,e,t){return i!==e?(t-i)/(e-i):0}function gA(i,e,t){return(1-t)*i+t*e}function VO(i,e,t,n){return gA(i,e,1-Math.exp(-t*n))}function GO(i,e=1){return e-Math.abs(kS(i,e*2)-e)}function qO(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*(3-2*i))}function HO(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*i*(i*(i*6-15)+10))}function WO(i,e){return i+Math.floor(Math.random()*(e-i+1))}function $O(i,e){return i+Math.random()*(e-i)}function jO(i){return i*(.5-Math.random())}function XO(i){i!==void 0&&(x3=i);let e=x3+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function YO(i){return i*mA}function QO(i){return i*sh}function ZO(i){return(i&i-1)===0&&i!==0}function KO(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function JO(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function e9(i,e,t,n,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),u=o((e+n)/2),p=s((e-n)/2),m=o((e-n)/2),g=s((n-e)/2),v=o((n-e)/2);switch(r){case"XYX":i.set(a*u,l*p,l*m,a*c);break;case"YZY":i.set(l*m,a*u,l*p,a*c);break;case"ZXZ":i.set(l*p,l*m,a*u,a*c);break;case"XZX":i.set(a*u,l*v,l*g,a*c);break;case"YXY":i.set(l*g,a*u,l*v,a*c);break;case"ZYZ":i.set(l*v,l*g,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Ss(i,e){switch(e.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 Tn(i,e){switch(e.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 Sf={DEG2RAD:mA,RAD2DEG:sh,generateUUID:Ga,clamp:wn,euclideanModulo:kS,mapLinear:kO,inverseLerp:zO,lerp:gA,damp:VO,pingpong:GO,smoothstep:qO,smootherstep:HO,randInt:WO,randFloat:$O,randFloatSpread:jO,seededRandom:XO,degToRad:YO,radToDeg:QO,isPowerOfTwo:ZO,ceilPowerOfTwo:KO,floorPowerOfTwo:JO,setQuaternionFromProperEuler:e9,normalize:Tn,denormalize:Ss};let at=class rL{constructor(e=0,t=0){rL.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}
vendor: 12,151 bytes, line 5
5sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=wn(this.x,e.x,t.x),this.y=wn(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=wn(this.x,e,t),this.y=wn(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(wn(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(wn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*r+e.x,this.y=s*r+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Sn=class sL{constructor(e,t,n,r,s,o,a,l,c){sL.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,o,a,l,c)}set(e,t,n,r,s,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],p=n[7],m=n[2],g=n[5],v=n[8],b=r[0],M=r[3],x=r[6],w=r[1],R=r[4],C=r[7],N=r[2],D=r[5],P=r[8];return s[0]=o*b+a*w+l*N,s[3]=o*M+a*R+l*D,s[6]=o*x+a*C+l*P,s[1]=c*b+u*w+p*N,s[4]=c*M+u*R+p*D,s[7]=c*x+u*C+p*P,s[2]=m*b+g*w+v*N,s[5]=m*M+g*R+v*D,s[8]=m*x+g*C+v*P,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],p=u*o-a*c,m=a*l-u*s,g=c*s-o*l,v=t*p+n*m+r*g;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const b=1/v;return e[0]=p*b,e[1]=(r*c-u*n)*b,e[2]=(a*n-r*o)*b,e[3]=m*b,e[4]=(u*t-r*l)*b,e[5]=(r*s-a*t)*b,e[6]=g*b,e[7]=(n*l-c*t)*b,e[8]=(o*t-n*s)*b,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,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+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(ly.makeScale(e,t)),this}rotate(e){return this.premultiply(ly.makeRotation(-e)),this}translate(e,t){return this.premultiply(ly.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};const ly=new Sn;function zS(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}function YA(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function oL(){const i=YA("canvas");return i.style.display="block",i}const b3={};function da(i){i in b3||(b3[i]=!0,console.warn(i))}function t9(i,e,t){return new Promise(function(n,r){function s(){switch(i.clientWaitSync(e,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:r();break;case i.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}}setTimeout(s,t)})}function n9(i){const e=i.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function i9(i){const e=i.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const S3=new Sn().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),M3=new Sn().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function r9(){const i={enabled:!0,workingColorSpace:ha,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===ei&&(r.r=Dl(r.r),r.g=Dl(r.g),r.b=Dl(r.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===ei&&(r.r=$d(r.r),r.g=$d(r.g),r.b=$d(r.b))),r},fromWorkingColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},toWorkingColorSpace:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===vo?O_:this.spaces[r].transfer},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,o){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[ha]:{primaries:e,whitePoint:n,transfer:O_,toXYZ:S3,fromXYZ:M3,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Xt},outputColorSpaceConfig:{drawingBufferColorSpace:Xt}},[Xt]:{primaries:e,whitePoint:n,transfer:ei,toXYZ:S3,fromXYZ:M3,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Xt}}}),i}const En=r9();function Dl(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function $d(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let Rh,s9=class{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Rh===void 0&&(Rh=YA("canvas")),Rh.width=e.width,Rh.height=e.height;const r=Rh.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=Rh}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=YA("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o<s.length;o++)s[o]=Dl(s[o]/255)*255;return n.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(Dl(t[n]/255)*255):t[n]=Dl(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}},o9=0;class VS{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:o9++}),this.uuid=Ga(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.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(cy(r[o].image)):s.push(cy(r[o]))}else s=cy(r);n.url=s}return t||(e.images[this.uuid]=n),n}}function cy(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?s9.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 a9=0,Cs=class a_ extends il{constructor(e=a_.DEFAULT_IMAGE,t=a_.DEFAULT_MAPPING,n=ka,r=ka,s=xr,o=Os,a=Yi,l=Gi,c=a_.DEFAULT_ANISOTROPY,u=vo){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:a9++}),this.uuid=Ga(),this.name="",this.source=new VS(e),this.mipmaps=[],this.mapping=t,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 at(0,0),this.repeat=new at(1,1),this.center=new at(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Sn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isTextureArray=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace
vendor: 5,667 bytes, line 5
5=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isTextureArray=e.isTextureArray,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==CS)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ih:e.x=e.x-Math.floor(e.x);break;case ka:e.x=e.x<0?0:1;break;case rh:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case ih:e.y=e.y-Math.floor(e.y);break;case ka:e.y=e.y<0?0:1;break;case rh:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};Cs.DEFAULT_IMAGE=null;Cs.DEFAULT_MAPPING=CS;Cs.DEFAULT_ANISOTROPY=1;let Jt=class aL{constructor(e=0,t=0,n=0,r=1){aL.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*r+o[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,s;const l=e.elements,c=l[0],u=l[4],p=l[8],m=l[1],g=l[5],v=l[9],b=l[2],M=l[6],x=l[10];if(Math.abs(u-m)<.01&&Math.abs(p-b)<.01&&Math.abs(v-M)<.01){if(Math.abs(u+m)<.1&&Math.abs(p+b)<.1&&Math.abs(v+M)<.1&&Math.abs(c+g+x-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const R=(c+1)/2,C=(g+1)/2,N=(x+1)/2,D=(u+m)/4,P=(p+b)/4,O=(v+M)/4;return R>C&&R>N?R<.01?(n=0,r=.707106781,s=.707106781):(n=Math.sqrt(R),r=D/n,s=P/n):C>N?C<.01?(n=.707106781,r=0,s=.707106781):(r=Math.sqrt(C),n=D/r,s=O/r):N<.01?(n=.707106781,r=.707106781,s=0):(s=Math.sqrt(N),n=P/s,r=O/s),this.set(n,r,s,t),this}let w=Math.sqrt((M-v)*(M-v)+(p-b)*(p-b)+(m-u)*(m-u));return Math.abs(w)<.001&&(w=1),this.x=(M-v)/w,this.y=(p-b)/w,this.z=(m-u)/w,this.w=Math.acos((c+g+x-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=wn(this.x,e.x,t.x),this.y=wn(this.y,e.y,t.y),this.z=wn(this.z,e.z,t.z),this.w=wn(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=wn(this.x,e,t),this.y=wn(this.y,e,t),this.z=wn(this.z,e,t),this.w=wn(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(wn(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}
vendor: 5,355 bytes, line 5
5round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};class rl extends il{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth?n.depth:1,this.scissor=new Jt(0,0,e,t),this.scissorTest=!1,this.viewport=new Jt(0,0,e,t);const r={width:e,height:t,depth:this.depth};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:xr,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,multiview:!1},n);const s=new Cs(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.textures[a].renderTarget=this;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const r=Object.assign({},e.textures[t].image);this.textures[t].source=new VS(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}let Hc=class extends rl{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}};class C1 extends Cs{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=xi,this.minFilter=xi,this.wrapR=ka,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class l9 extends Cs{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=xi,this.minFilter=xi,this.wrapR=ka,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}let ga=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,s,o,a){let l=n[r+0],c=n[r+1],u=n[r+2],p=n[r+3];const m=s[o+0],g=s[o+1],v=s[o+2],b=s[o+3];if(a===0){e[t+0]=l,e[t+1]=c,e[t+2]=u,e[t+3]=p;return}if(a===1){e[t+0]=m,e[t+1]=g,e[t+2]=v,e[t+3]=b;return}if(p!==b||l!==m||c!==g||u!==v){let M=1-a;const x=l*m+c*g+u*v+p*b,w=x>=0?1:-1,R=1-x*x;if(R>Number.EPSILON){const N=Math.sqrt(R),D=Math.atan2(N,x*w);M=Math.sin(M*D)/N,a=Math.sin(a*D)/N}const C=a*w;if(l=l*M+m*C,c=c*M+g*C,u=u*M+v*C,p=p*M+b*C,M===1-a){const N=1/Math.sqrt(l*l+c*c+u*u+p*p);l*=N,c*=N,u*=N,p*=N}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=p}static multiplyQuaternionsFlat(e,t,n,r,s,o){const a=n[r],l=n[r+1
vendor: 4,413 bytes, line 5
5],c=n[r+2],u=n[r+3],p=s[o],m=s[o+1],g=s[o+2],v=s[o+3];return e[t]=a*v+u*p+l*g-c*m,e[t+1]=l*v+u*m+c*p-a*g,e[t+2]=c*v+u*g+a*m-l*p,e[t+3]=u*v-a*p-l*m-c*g,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(r/2),p=a(s/2),m=l(n/2),g=l(r/2),v=l(s/2);switch(o){case"XYZ":this._x=m*u*p+c*g*v,this._y=c*g*p-m*u*v,this._z=c*u*v+m*g*p,this._w=c*u*p-m*g*v;break;case"YXZ":this._x=m*u*p+c*g*v,this._y=c*g*p-m*u*v,this._z=c*u*v-m*g*p,this._w=c*u*p+m*g*v;break;case"ZXY":this._x=m*u*p-c*g*v,this._y=c*g*p+m*u*v,this._z=c*u*v+m*g*p,this._w=c*u*p-m*g*v;break;case"ZYX":this._x=m*u*p-c*g*v,this._y=c*g*p+m*u*v,this._z=c*u*v-m*g*p,this._w=c*u*p+m*g*v;break;case"YZX":this._x=m*u*p+c*g*v,this._y=c*g*p+m*u*v,this._z=c*u*v-m*g*p,this._w=c*u*p-m*g*v;break;case"XZY":this._x=m*u*p-c*g*v,this._y=c*g*p-m*u*v,this._z=c*u*v+m*g*p,this._w=c*u*p+m*g*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],p=t[10],m=n+a+p;if(m>0){const g=.5/Math.sqrt(m+1);this._w=.25/g,this._x=(u-l)*g,this._y=(s-c)*g,this._z=(o-r)*g}else if(n>a&&n>p){const g=2*Math.sqrt(1+n-a-p);this._w=(u-l)/g,this._x=.25*g,this._y=(r+o)/g,this._z=(s+c)/g}else if(a>p){const g=2*Math.sqrt(1+a-n-p);this._w=(s-c)/g,this._x=(r+o)/g,this._y=.25*g,this._z=(l+u)/g}else{const g=2*Math.sqrt(1+p-n-a);this._w=(o-r)/g,this._x=(s+c)/g,this._y=(l+u)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(wn(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+r*c-s*l,this._y=r*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-r*a,this._w=o*u-n*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+n*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),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 g=1-t;return this._w=g*o+t*this._w,this._x=g*n+t*this._x,this._y=g*r+t*this._y,this._z=g*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),p=Math.sin((1-t)*u)/c,m=Math.sin(t*u)/c;return this._w=o*p+this._w*m,this._x=n*p+this._x*m,this._y=r*p+this._y*m,this._z=s*p+this._z*m,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r
vendor: 4,699 bytes, line 5
5=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},re=class lL{constructor(e=0,t=0,n=0){lL.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(w3.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(w3.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*r,this.y=s[1]*t+s[4]*n+s[7]*r,this.z=s[2]*t+s[5]*n+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*n),u=2*(a*t-s*r),p=2*(s*n-o*t);return this.x=t+l*c+o*p-a*u,this.y=n+l*u+a*c-s*p,this.z=r+l*p+s*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r,this.y=s[1]*t+s[5]*n+s[9]*r,this.z=s[2]*t+s[6]*n+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=wn(this.x,e.x,t.x),this.y=wn(this.y,e.y,t.y),this.z=wn(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=wn(this.x,e,t),this.y=wn(this.y,e,t),this.z=wn(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(wn(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}
vendor: 4,302 bytes, line 5
5lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-n*l,this.z=n*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return uy.copy(this).projectOnVector(e),this.sub(uy)}reflect(e){return this.sub(uy.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(wn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};const uy=new re,w3=new ga;let Hl=class{constructor(e=new re(1/0,1/0,1/0),t=new re(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(jo.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(jo.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=jo.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,a=s.count;o<a;o++)e.isMesh===!0?e.getVertexPosition(o,jo):jo.fromBufferAttribute(s,o),jo.applyMatrix4(e.matrixWorld),this.expandByPoint(jo);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),pm.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),pm.copy(n.boundingBox)),pm.applyM
vendor: 4,442 bytes, line 5
5atrix4(e.matrixWorld),this.union(pm)}const r=e.children;for(let s=0,o=r.length;s<o;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,jo),jo.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(gp),Am.subVectors(this.max,gp),Ch.subVectors(e.a,gp),Ph.subVectors(e.b,gp),Lh.subVectors(e.c,gp),ec.subVectors(Ph,Ch),tc.subVectors(Lh,Ph),lu.subVectors(Ch,Lh);let t=[0,-ec.z,ec.y,0,-tc.z,tc.y,0,-lu.z,lu.y,ec.z,0,-ec.x,tc.z,0,-tc.x,lu.z,0,-lu.x,-ec.y,ec.x,0,-tc.y,tc.x,0,-lu.y,lu.x,0];return!hy(t,Ch,Ph,Lh,Am)||(t=[1,0,0,0,1,0,0,0,1],!hy(t,Ch,Ph,Lh,Am))?!1:(mm.crossVectors(ec,tc),t=[mm.x,mm.y,mm.z],hy(t,Ch,Ph,Lh,Am))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,jo).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(jo).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ul[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ul[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ul[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ul[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ul[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ul[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ul[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ul[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ul),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};const ul=[new re,new re,new re,new re,new re,new re,new re,new re],jo=new re,pm=new Hl,Ch=new re,Ph=new re,Lh=new re,ec=new re,tc=new re,lu=new re,gp=new re,Am=new re,mm=new re,cu=new re;function hy(i,e,t,n,r){for(let s=0,o=i.length-3;s<=o;s+=3){cu.fromArray(i,s);const a=r.x*Math.abs(cu.x)+r.y*Math.abs(cu.y)+r.z*Math.abs(cu.z),l=e.dot(cu),c=t.dot(cu),u=n.dot(cu);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const c9=new Hl,_p=new re,dy=new re;let Yc=class{constructor(e=new re,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):c9.setFromPoints(e).getCenter(n);let r=0;for(let s=0,o=e.length;s<o;s++)r=Math.max(r,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}
vendor: 16,263 bytes, line 5
5applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;_p.subVectors(e,this.center);const t=_p.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),r=(n-this.radius)*.5;this.center.addScaledVector(_p,r/n),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(dy.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(_p.copy(e.center).add(dy)),this.expandByPoint(_p.copy(e.center).sub(dy))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}};const hl=new re,fy=new re,gm=new re,nc=new re,py=new re,_m=new re,Ay=new re;let P0=class{constructor(e=new re,t=new re(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,hl)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=hl.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(hl.copy(this.origin).addScaledVector(this.direction,t),hl.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){fy.copy(e).add(t).multiplyScalar(.5),gm.copy(t).sub(e).normalize(),nc.copy(this.origin).sub(fy);const s=e.distanceTo(t)*.5,o=-this.direction.dot(gm),a=nc.dot(this.direction),l=-nc.dot(gm),c=nc.lengthSq(),u=Math.abs(1-o*o);let p,m,g,v;if(u>0)if(p=o*l-a,m=o*a-l,v=s*u,p>=0)if(m>=-v)if(m<=v){const b=1/u;p*=b,m*=b,g=p*(p+o*m+2*a)+m*(o*p+m+2*l)+c}else m=s,p=Math.max(0,-(o*m+a)),g=-p*p+m*(m+2*l)+c;else m=-s,p=Math.max(0,-(o*m+a)),g=-p*p+m*(m+2*l)+c;else m<=-v?(p=Math.max(0,-(-o*s+a)),m=p>0?-s:Math.min(Math.max(-s,-l),s),g=-p*p+m*(m+2*l)+c):m<=v?(p=0,m=Math.min(Math.max(-s,-l),s),g=m*(m+2*l)+c):(p=Math.max(0,-(o*s+a)),m=p>0?s:Math.min(Math.max(-s,-l),s),g=-p*p+m*(m+2*l)+c);else m=o>0?-s:s,p=Math.max(0,-(o*m+a)),g=-p*p+m*(m+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,p),r&&r.copy(fy).addScaledVector(gm,m),g}intersectSphere(e,t){hl.subVectors(e.center,this.origin);const n=hl.dot(this.direction),r=hl.dot(hl)-n*n,s=e.radius*e.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,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,p=1/this.direction.z,m=this.origin;return c>=0?(n=(e.min.x-m.x)*c,r=(e.max.x-m.x)*c):(n=(e.max.x-m.x)*c,r=(e.min.x-m.x)*c),u>=0?(s=(e.min.y-m.y)*u,o=(e.max.y-m.y)*u):(s=(e.max.y-m.y)*u,o=(e.min.y-m.y)*u),n>o||s>r||((s>n||isNaN(n))&&(n=s),(o<r||isNaN(r))&&(r=o),p>=0?(a=(e.min.z-m.z)*p,l=(e.max.z-m.z)*p):(a=(e.max.z-m.z)*p,l=(e.min.z-m.z)*p),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,t)}intersectsBox(e){return this.intersectBox(e,hl)!==null}intersectTriangle(e,t,n,r,s){py.subVectors(t,e),_m.subVectors(n,e),Ay.crossVectors(py,_m);let o=this.direction.dot(Ay),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;nc.subVectors(this.origin,e);const l=a*this.direction.dot(_m.crossVectors(nc,_m));if(l<0)return null;const c=a*this.direction.dot(py.cross(nc));if(c<0||l+c>o)return null;const u=-a*nc.dot(Ay);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},un=class X2{constructor(e,t,n,r,s,o,a,l,c,u,p,m,g,v,b,M){X2.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,o,a,l,c,u,p,m,g,v,b,M)}set(e,t,n,r,s,o,a,l,c,u,p,m,g,v,b,M){const x=this.elements;return x[0]=e,x[4]=t,x[8]=n,x[12]=r,x[1]=s,x[5]=o,x[9]=a,x[13]=l,x[2]=c,x[6]=u,x[10]=p,x[14]=m,x[3]=g,x[7]=v,x[11]=b,x[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 X2().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/Nh.setFromMatrixColumn(e,0).length(),s=1/Nh.setFromMatrixColumn(e,1).length(),o=1/Nh.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),p=Math.sin(s);if(e.order==="XYZ"){const m=o*u,g=o*p,v=a*u,b=a*p;t[0]=l*u,t[4]=-l*p,t[8]=c,t[1]=g+v*c,t[5]=m-b*c,t[9]=-a*l,t[2]=b-m*c,t[6]=v+g*c,t[10]=o*l}else if(e.order==="YXZ"){const m=l*u,g=l*p,v=c*u,b=c*p;t[0]=m+b*a,t[4]=v*a-g,t[8]=o*c,t[1]=o*p,t[5]=o*u,t[9]=-a,t[2]=g*a-v,t[6]=b+m*a,t[10]=o*l}else if(e.order==="ZXY"){const m=l*u,g=l*p,v=c*u,b=c*p;t[0]=m-b*a,t[4]=-o*p,t[8]=v+g*a,t[1]=g+v*a,t[5]=o*u,t[9]=b-m*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const m=o*u,g=o*p,v=a*u,b=a*p;t[0]=l*u,t[4]=v*c-g,t[8]=m*c+b,t[1]=l*p,t[5]=b*c+m,t[9]=g*c-v,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const m=o*l,g=o*c,v=a*l,b=a*c;t[0]=l*u,t[4]=b-m*p,t[8]=v*p+g,t[1]=p,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=g*p+v,t[10]=m-b*p}else if(e.order==="XZY"){const m=o*l,g=o*c,v=a*l,b=a*c;t[0]=l*u,t[4]=-p,t[8]=c*u,t[1]=m*p+b,t[5]=o*u,t[9]=g*p-v,t[2]=v*p-g,t[6]=a*u,t[10]=b*p+m}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(u9,e,h9)}lookAt(e,t,n){const r=this.elements;return ro.subVectors(e,t),ro.lengthSq()===0&&(ro.z=1),ro.normalize(),ic.crossVectors(n,ro),ic.lengthSq()===0&&(Math.abs(n.z)===1?ro.x+=1e-4:ro.z+=1e-4,ro.normalize(),ic.crossVectors(n,ro)),ic.normalize(),vm.crossVectors(ro,ic),r[0]=ic.x,r[4]=vm.x,r[8]=ro.x,r[1]=ic.y,r[5]=vm.y,r[9]=ro.y,r[2]=ic.z,r[6]=vm.z,r[10]=ro.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],p=n[5],m=n[9],g=n[13],v=n[2],b=n[6],M=n[10],x=n[14],w=n[3],R=n[7],C=n[11],N=n[15],D=r[0],P=r[4],O=r[8],I=r[12],F=r[1],k=r[5],Y=r[9],W=r[13],Q=r[2],J=r[6],H=r[10],$=r[14],K=r[3],he=r[7],ie=r[11],de=r[15];return s[0]=o*D+a*F+l*Q+c*K,s[4]=o*P+a*k+l*J+c*he,s[8]=o*O+a*Y+l*H+c*ie,s[12]=o*I+a*W+l*$+c*de,s[1]=u*D+p*F+m*Q+g*K,s[5]=u*P+p*k+m*J+g*he,s[9]=u*O+p*Y+m*H+g*ie,s[13]=u*I+p*W+m*$+g*de,s[2]=v*D+b*F+M*Q+x*K,s[6]=v*P+b*k+M*J+x*he,s[10]=v*O+b*Y+M*H+x*ie,s[14]=v*I+b*W+M*$+x*de,s[3]=w*D+R*F+C*Q+N*K,s[7]=w*P+R*k+C*J+N*he,s[11]=w*O+R*Y+C*H+N*ie,s[15]=w*I+R*W+C*$+N*de,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],p=e[6],m=e[10],g=e[14],v=e[3],b=e[7],M=e[11],x=e[15];return v*(+s*l*p-r*c*p-s*a*m+n*c*m+r*a*g-n*l*g)+b*(+t*l*g-t*c*m+s*o*m-r*o*g+r*c*u-s*l*u)+M*(+t*c*p-t*a*g-s*o*p+n*o*g+s*a*u-n*c*u)+x*(-r*a*u-t*l*p+t*a*m+r*o*p-n*o*m+n*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],p=e[9],m=e[10],g=e[11],v=e[12],b=e[13],M=e[14],x=e[15],w=p*M*c-b*m*c+b*l*g-a*M*g-p*l*x+a*m*x,R=v*m*c-u*M*c-v*l*g+o*M*g+u*l*x-o*m*x,C=u*b*c-v*p*c+v*a*g-o*b*g-u*a*x+o*p*x,N=v*p*l-u*b*l-v*a*m+o*b*m+u*a*M-o*p*M,D=t*w+n*R+r*C+s*N;if(D===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/D;return e[0]=w*P,e[1]=(b*m*s-p*M*s-b*r*g+n*M*g+p*r*x-n*m*x)*P,e[2]=(a*M*s-b*l*s+b*r*c-n*M*c-a*r*x+n*l*x)*P,e[3]=(p*l*s-a*m*s-p*r*c+n*m*c+a*r*g-n*l*g)*P,e[4]=R*P,e[5]=(u*M*s-v*m*s+v*r*g-t*M*g-u*r*x+t*m*x)*P,e[6]=(v*l*s-o*M*s-v*r*c+t*M*c+o*r*x-t*l*x)*P,e[7]=(o*m*s-u*l*s+u*r*c-t*m*c-o*r*g+t*l*g)*P,e[8]=C*P,e[9]=(v*p*s-u*b*s-v*n*g+t*b*g+u*n*x-t*p*x)*P,e[10]=(o*b*s-v*a*s+v*n*c-t*b*c-o*n*x+t*a*x)*P,e[11]=(u*a*s-o*p*s-u*n*c+t*p*c+o*n*g-t*a*g)*P,e[12]=N*P,e[13]=(u*b*r-v*p*r+v*n*m-t*b*m-u*n*M+t*p*M)*P,e[14]=(v*a*r-o*b*r-v*n*l+t*b*l+o*n*M-t*a*M)*P,e[15]=(o*p*r-u*a*r+u*n*l-t*p*l-o*n*m+t*a*m)*P,this}scale(e){const t=this.elements,n=e.x,r=e.y,s=e.z;return t[0]*=n,t[4]*=r,t[8]*=s,t[1]*=n,t[5]*=r,t[9]*=s,t[2]*=n,t[6]*=r,t[10]*=s,t[3]*=n,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-r*l,c*l+r*a,0,c*a+r*l,u*a+n,u*l-r*o,0,c*l-r*a,u*l+r*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,s,o){return this.set(1,n,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,p=a+a,m=s*c,g=s*u,v=s*p,b=o*u,M=o*p,x=a*p,w=l*c,R=l*u,C=l*p,N=n.x,D=n.y,P=n.z;return r[0]=(1-(b+x))*N,r[1]=(g+C)*N,r[2]=(v-R)*N,r[3]=0,r[4]=(g-C)*D,r[5]=(1-(m+x))*D,r[6]=(M+w)*D,r[7]=0,r[8]=(v+R)*P,r[9]=(M-w)*P,r[10]=(1-(m+b))*P,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let s=Nh.set(r[0],r[1],r[2]).length();const o=Nh.set(r[4],r[5],r[6]).length(),a=Nh.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],Xo.copy(this);const c=1/s,u=1/o,p=1/a;return Xo.elements[0]*=c,Xo.elements[1]*=c,Xo.elements[2]*=c,Xo.elements[4]*=u,Xo.elements[5]*=u,Xo.elements[6]*=u,Xo.elements[8]*=p,Xo.elements[9]*=p,Xo.elements[10]*=p,t.setFromRotationMatrix(Xo),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,r,s,o,a=Ms){const l=this.elements,c=2*s/(t-e),u=2*s/(n-r),p=(t+e)/(t-e),m=(n+r)/(n-r);let g,v;if(a===Ms)g=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===Xa)g=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=p,l[12]=0,l[1]=0,l[5]=u,l[9]=m,l[13]=0,l[2]=0,l[6]=0,l[10]=g,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,r,s,o,a=Ms){const l=this.elements,c=1/(t-e),u=1/(n-r),p=1/(o-s),m=(t+e)*c,g=(n+r)*u;let v,b;if(a===Ms)v=(o+s)*p,b=-2*p;else if(a===Xa)v=s*p,b=-1*p;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-m,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-g,l[2]=0,l[6]=0,l[10]=b,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};const Nh=new re,Xo=new un,u9=new re(0,0,0),h9=new re(1,1,1),ic=new re,vm=new re,ro=new re,T3=new un,E3=new ga;let Es=class cL{constructor(e=0,t=0,n=0,r=cL.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],u=r[9],p=r[2],m=r[6],g=r[10];switch(t){case"XYZ":this._y=Math.asin(wn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,g),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(m,c),this._z=0);break;case"YXZ":this._x=Math.asin(-wn(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,g),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-p,s),this._z=0);break;case"ZXY":this._x=Math.asin(wn(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-p,g),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-wn(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(m,g),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(wn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-p,s)):(this._x=0,this._y=Math.atan2(a,g));break;case"XZY":this._z=Math.asin(-wn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(m,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return T3.makeRotationFromQuaternion(e),this.setFromRotationMatrix(T3,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return E3.setFromEuler(this),this.setFromQuaternion(E3,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Es.DEFAULT_ORDER="XYZ";let GS=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}
vendor: 5,655 bytes, line 5
5isEnabled(e){return(this.mask&(1<<e|0))!==0}},d9=0;const R3=new re,Dh=new ga,dl=new un,ym=new re,vp=new re,f9=new re,p9=new ga,C3=new re(1,0,0),P3=new re(0,1,0),L3=new re(0,0,1),N3={type:"added"},A9={type:"removed"},Ih={type:"childadded",child:null},my={type:"childremoved",child:null};let ir=class l_ extends il{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:d9++}),this.uuid=Ga(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=l_.DEFAULT_UP.clone();const e=new re,t=new Es,n=new ga,r=new re(1,1,1);function s(){n.setFromEuler(t,!1)}function o(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new un},normalMatrix:{value:new Sn}}),this.matrix=new un,this.matrixWorld=new un,this.matrixAutoUpdate=l_.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=l_.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new GS,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Dh.setFromAxisAngle(e,t),this.quaternion.multiply(Dh),this}rotateOnWorldAxis(e,t){return Dh.setFromAxisAngle(e,t),this.quaternion.premultiply(Dh),this}rotateX(e){return this.rotateOnAxis(C3,e)}rotateY(e){return this.rotateOnAxis(P3,e)}rotateZ(e){return this.rotateOnAxis(L3,e)}translateOnAxis(e,t){return R3.copy(e).applyQuaternion(this.quaternion),this.position.add(R3.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(C3,e)}translateY(e){return this.translateOnAxis(P3,e)}translateZ(e){return this.translateOnAxis(L3,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(dl.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?ym.copy(e):ym.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),vp.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?dl.lookAt(vp,ym,this.up):dl.lookAt(ym,vp,this.up),this.quaternion.setFromRotationMatrix(dl),r&&(dl.extractRotation(r.matrixWorld),Dh.setFromRotationMatrix(dl),this.quaternion.premultiply(Dh.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(N3),Ih.child=e,this.dispatchEvent(Ih),Ih.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(A9),my.child=e,this.dispatchEvent(my),my.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),dl.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),dl.multiply(e.parent.matrixWorld)),e.applyMatrix4(dl),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(N3),Ih.child=e,this.dispatchEvent(Ih),Ih.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const o=this.children[n].getObjectByProperty(e,t);if(o!==void 0)return o}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(vp,e,f9),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(vp,p9,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix
vendor: 4,380 bytes, line 5
5):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={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.geometryInfo=this._geometryInfo.map(a=>({...a,boundingBox:a.boundingBox?{min:a.boundingBox.min.toArray(),max:a.boundingBox.max.toArray()}:void 0,boundingSphere:a.boundingSphere?{radius:a.boundingSphere.radius,center:a.boundingSphere.center.toArray()}:void 0})),r.instanceInfo=this._instanceInfo.map(a=>({...a})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere={center:this.boundingSphere.center.toArray(),radius:this.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:this.boundingBox.min.toArray(),max:this.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.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,u=l.length;c<u;c++){const p=l[c];s(e.shapes,p)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.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(e.materials,this.material[l]));r.material=a}else r.material=s(e.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(e).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(e.animations,l))}}if(t){const a=o(e.geometries),l=o(e.materials),c=o(e.textures),u=o(e.images),p=o(e.shapes),m=o(e.skeletons),g=o(e.animations),v=o(e.nodes);a.length>0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),p.length>
vendor: 7,925 bytes, line 5
50&&(n.shapes=p),m.length>0&&(n.skeletons=m),g.length>0&&(n.animations=g),v.length>0&&(n.nodes=v)}return n.object=r,n;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const r=e.children[n];this.add(r.clone())}return this}};ir.DEFAULT_UP=new re(0,1,0);ir.DEFAULT_MATRIX_AUTO_UPDATE=!0;ir.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Yo=new re,fl=new re,gy=new re,pl=new re,Bh=new re,Fh=new re,D3=new re,_y=new re,vy=new re,yy=new re,xy=new Jt,by=new Jt,Sy=new Jt;let yp=class wd{constructor(e=new re,t=new re,n=new re){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),Yo.subVectors(e,t),r.cross(Yo);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,n,r,s){Yo.subVectors(r,t),fl.subVectors(n,t),gy.subVectors(e,t);const o=Yo.dot(Yo),a=Yo.dot(fl),l=Yo.dot(gy),c=fl.dot(fl),u=fl.dot(gy),p=o*c-a*a;if(p===0)return s.set(0,0,0),null;const m=1/p,g=(c*l-a*u)*m,v=(o*u-a*l)*m;return s.set(1-g-v,v,g)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,pl)===null?!1:pl.x>=0&&pl.y>=0&&pl.x+pl.y<=1}static getInterpolation(e,t,n,r,s,o,a,l){return this.getBarycoord(e,t,n,r,pl)===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,pl.x),l.addScaledVector(o,pl.y),l.addScaledVector(a,pl.z),l)}static getInterpolatedAttribute(e,t,n,r,s,o){return xy.setScalar(0),by.setScalar(0),Sy.setScalar(0),xy.fromBufferAttribute(e,t),by.fromBufferAttribute(e,n),Sy.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(xy,s.x),o.addScaledVector(by,s.y),o.addScaledVector(Sy,s.z),o}static isFrontFacing(e,t,n,r){return Yo.subVectors(n,t),fl.subVectors(e,t),Yo.cross(fl).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Yo.subVectors(this.c,this.b),fl.subVectors(this.a,this.b),Yo.cross(fl).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return wd.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return wd.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,s){return wd.getInterpolation(e,this.a,this.b,this.c,t,n,r,s)}containsPoint(e){return wd.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return wd.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,s=this.c;let o,a;Bh.subVectors(r,n),Fh.subVectors(s,n),_y.subVectors(e,n);const l=Bh.dot(_y),c=Fh.dot(_y);if(l<=0&&c<=0)return t.copy(n);vy.subVectors(e,r);const u=Bh.dot(vy),p=Fh.dot(vy);if(u>=0&&p<=u)return t.copy(r);const m=l*p-u*c;if(m<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(Bh,o);yy.subVectors(e,s);const g=Bh.dot(yy),v=Fh.dot(yy);if(v>=0&&g<=v)return t.copy(s);const b=g*c-l*v;if(b<=0&&c>=0&&v<=0)return a=c/(c-v),t.copy(n).addScaledVector(Fh,a);const M=u*v-g*p;if(M<=0&&p-u>=0&&g-v>=0)return D3.subVectors(s,r),a=(p-u)/(p-u+(g-v)),t.copy(r).addScaledVector(D3,a);const x=1/(M+b+m);return o=b*x,a=m*x,t.copy(n).addScaledVector(Bh,o).addScaledVector(Fh,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}};const uL={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},rc={h:0,s:0,l:0},xm={h:0,s:0,l:0};function My(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}let qt=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Xt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,En.toWorkingColorSpace(this,t),this}setRGB(e,t,n,r=En.workingColorSpace){return this.r=e,this.g=t,this.b=n,En.toWorkingColorSpace(this,r),this}setHSL(e,t,n,r=En.workingColorSpace){if(e=kS(e,1),t=wn(t,0,1),n=wn(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,o=2*n-s;
vendor: 14,903 bytes, line 5
5this.r=My(o,s,e+1/3),this.g=My(o,s,e),this.b=My(o,s,e-1/3)}return En.toWorkingColorSpace(this,r),this}setStyle(e,t=Xt){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){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,t);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,t);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,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){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,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Xt){const n=uL[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Dl(e.r),this.g=Dl(e.g),this.b=Dl(e.b),this}copyLinearToSRGB(e){return this.r=$d(e.r),this.g=$d(e.g),this.b=$d(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Xt){return En.fromWorkingColorSpace(ns.copy(this),e),Math.round(wn(ns.r*255,0,255))*65536+Math.round(wn(ns.g*255,0,255))*256+Math.round(wn(ns.b*255,0,255))}getHexString(e=Xt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=En.workingColorSpace){En.fromWorkingColorSpace(ns.copy(this),t);const n=ns.r,r=ns.g,s=ns.b,o=Math.max(n,r,s),a=Math.min(n,r,s);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const p=o-a;switch(c=u<=.5?p/(o+a):p/(2-o-a),o){case n:l=(r-s)/p+(r<s?6:0);break;case r:l=(s-n)/p+2;break;case s:l=(n-r)/p+4;break}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,t=En.workingColorSpace){return En.fromWorkingColorSpace(ns.copy(this),t),e.r=ns.r,e.g=ns.g,e.b=ns.b,e}getStyle(e=Xt){En.fromWorkingColorSpace(ns.copy(this),e);const t=ns.r,n=ns.g,r=ns.b;return e!==Xt?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`}offsetHSL(e,t,n){return this.getHSL(rc),this.setHSL(rc.h+e,rc.s+t,rc.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(rc),e.getHSL(xm);const n=gA(rc.h,xm.h,t),r=gA(rc.s,xm.s,t),s=gA(rc.l,xm.l,t);return this.setHSL(n,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*r,this.g=s[1]*t+s[4]*n+s[7]*r,this.b=s[2]*t+s[5]*n+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const ns=new qt;qt.NAMES=uL;let m9=0,cs=class extends il{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:m9++}),this.uuid=Ga(),this.name="",this.type="Material",this.blending=ws,this.side=qs,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=NA,this.blendDst=DA,this.blendEquation=os,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new qt(0,0,0),this.blendAlpha=0,this.depthFunc=qc,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=j2,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ru,this.stencilZFail=Ru,this.stencilZPass=Ru,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={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(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==ws&&(n.blending=this.blending),this.side!==qs&&(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!==NA&&(n.blendSrc=this.blendSrc),this.blendDst!==DA&&(n.blendDst=this.blendDst),this.blendEquation!==os&&(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!==qc&&(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!==j2&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ru&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Ru&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Ru&&(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(t){const s=r(e.textures),o=r(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const r=t.length;n=new Array(r);for(let s=0;s!==r;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipSh
vendor: 4,105 bytes, line 5
5adows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}},Bo=class extends cs{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new qt(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 Es,this.combine=E0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}};const El=g9();function g9(){const i=new ArrayBuffer(4),e=new Float32Array(i),t=new Uint32Array(i),n=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(n[l]=0,n[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(n[l]=1024>>-c-14,n[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(n[l]=c+15<<10,n[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(n[l]=31744,n[l|256]=64512,r[l]=24,r[l|256]=24):(n[l]=31744,n[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;(c&8388608)===0;)c<<=1,u-=8388608;c&=-8388609,u+=947912704,s[l]=c|u}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function so(i){Math.abs(i)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),i=wn(i,-65504,65504),El.floatView[0]=i;const e=El.uint32View[0],t=e>>23&511;return El.baseTable[t]+((e&8388607)>>El.shiftTable[t])}function bm(i){const e=i>>10;return El.uint32View[0]=El.mantissaTable[El.offsetTable[e]+(i&1023)]+El.exponentTable[e],El.floatView[0]}const ar=new re,Sm=new at;let _9=0,Ii=class{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:_9++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=k_,this.updateRanges=[],this.gpuType=er,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;
vendor: 5,010 bytes, line 5
5t++)Sm.fromBufferAttribute(this,t),Sm.applyMatrix3(e),this.setXY(t,Sm.x,Sm.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)ar.fromBufferAttribute(this,t),ar.applyMatrix3(e),this.setXYZ(t,ar.x,ar.y,ar.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)ar.fromBufferAttribute(this,t),ar.applyMatrix4(e),this.setXYZ(t,ar.x,ar.y,ar.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)ar.fromBufferAttribute(this,t),ar.applyNormalMatrix(e),this.setXYZ(t,ar.x,ar.y,ar.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)ar.fromBufferAttribute(this,t),ar.transformDirection(e),this.setXYZ(t,ar.x,ar.y,ar.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Ss(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Tn(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Ss(t,this.array)),t}setX(e,t){return this.normalized&&(t=Tn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Ss(t,this.array)),t}setY(e,t){return this.normalized&&(t=Tn(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Ss(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Tn(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Ss(t,this.array)),t}setW(e,t){return this.normalized&&(t=Tn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Tn(t,this.array),n=Tn(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Tn(t,this.array),n=Tn(n,this.array),r=Tn(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,s){return e*=this.itemSize,this.normalized&&(t=Tn(t,this.array),n=Tn(n,this.array),r=Tn(r,this.array),s=Tn(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==k_&&(e.usage=this.usage),e}},qS=class extends Ii{constructor(e,t,n){super(new Uint16Array(e),t,n)}},HS=class extends Ii{constructor(e,t,n){super(new Uint32Array(e),t,n)}},hL=class extends Ii{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=bm(this.array[e*this.itemSize]);return this.normalized&&(t=Ss(t,this.array)),t}setX(e,t){return this.normalized&&(t=Tn(t,this.array)),this.array[e*this.itemSize]=so(t),this}getY(e){let t=bm(this.array[e*this.itemSize+1]);return this.normalized&&(t=Ss(t,this.array)),t}setY(e,t){return this.normalized&&(t=Tn(t,this.array)),this.array[e*this.itemSize+1]=so(t),this}getZ(e){let t=bm(this.array[e*this.itemSize+2]);return this.normalized&&(t=Ss(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Tn(t,this.array)),this.array[e*this.itemSize+2]=so(t),this}getW(e){let t=bm(this.array[e*this.itemSize+3]);return this.normalized&&(t=Ss(t,this.array)),t}setW(e,t){return this.normalized&&(t=Tn(t,this.array)),this.array[e*this.itemSize+3]=so(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Tn(t,this.array),n=Tn(n,this.array)),this.array[e+0]=so(t),this.array[e+1]=so(n),this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Tn(t,this.array),n=Tn(n,this.array),r=Tn(r,this.array)),this.array[e+0]=so(t),this.array[e+1]=so(n),this.array[e+2]=so(r),this}setXYZW(e,t,n,r,s){return e*=this.itemSize,this.normalized&&(t=Tn(t,this.array),n=Tn(n,this.array),r=Tn(r,this.array),s=Tn(s,this.array)),this.array[e+0]=so(t),this.array[e+1]=so(n),this.array[e+2]=so(r),this.array[e+3]=so(s),this}},Gn=class extends Ii{constructor(e,t,n){super(new Float32Array(e),t,n)}},v9=0;const Co=new un,wy=new ir,Uh=new re,oo=new Hl,xp=new Hl,Cr=new re;let vi=class dL extends il{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:v9++}),this.uuid=Ga(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=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(e){return Array.isArray(e)?this.index=new(zS(e)?HS:qS)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}
vendor: 5,284 bytes, line 5
5addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new Sn().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Co.makeRotationFromQuaternion(e),this.applyMatrix4(Co),this}rotateX(e){return Co.makeRotationX(e),this.applyMatrix4(Co),this}rotateY(e){return Co.makeRotationY(e),this.applyMatrix4(Co),this}rotateZ(e){return Co.makeRotationZ(e),this.applyMatrix4(Co),this}translate(e,t,n){return Co.makeTranslation(e,t,n),this.applyMatrix4(Co),this}scale(e,t,n){return Co.makeScale(e,t,n),this.applyMatrix4(Co),this}lookAt(e){return wy.lookAt(e),wy.updateMatrix(),this.applyMatrix4(wy.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Uh).negate(),this.translate(Uh.x,Uh.y,Uh.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let r=0,s=e.length;r<s;r++){const o=e[r];n.push(o.x,o.y,o.z||0)}this.setAttribute("position",new Gn(n,3))}else{const n=Math.min(e.length,t.count);for(let r=0;r<n;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Hl);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new re(-1/0,-1/0,-1/0),new re(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const s=t[n];oo.setFromBufferAttribute(s),this.morphTargetsRelative?(Cr.addVectors(this.boundingBox.min,oo.min),this.boundingBox.expandByPoint(Cr),Cr.addVectors(this.boundingBox.max,oo.max),this.boundingBox.expandByPoint(Cr)):(this.boundingBox.expandByPoint(oo.min),this.boundingBox.expandByPoint(oo.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 Yc);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new re,1/0);return}if(e){const n=this.boundingSphere.center;if(oo.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const a=t[s];xp.setFromBufferAttribute(a),this.morphTargetsRelative?(Cr.addVectors(oo.min,xp.min),oo.expandByPoint(Cr),Cr.addVectors(oo.max,xp.max),oo.expandByPoint(Cr)):(oo.expandByPoint(xp.min),oo.expandByPoint(xp.max))}oo.getCenter(n);let r=0;for(let s=0,o=e.count;s<o;s++)Cr.fromBufferAttribute(e,s),r=Math.max(r,n.distanceToSquared(Cr));if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s],l=this.morphTargetsRelative;for(let c=0,u=a.count;c<u;c++)Cr.fromBufferAttribute(a,c),l&&(Uh.fromBufferAttribute(e,c),Cr.add(Uh)),r=Math.max(r,n.distanceToSquared(Cr))}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 e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Ii(new Float32Array(4*n.count),4));const o=this.getAttribute("tangent"),a=[],l=[];for(let O=0;O<n.count;O++)a[O]=new re,l[O]=new re;const c=new re,u=new re,p=new re,m=new at,g=new at,v=new at,b=new re,M=new re;function x(O,I,F){c.fromBufferAttribute(n,O),u.fromBufferAttribute(n,I),p.fromBufferAttribute(n,F),m.fromBufferAttribute(s,O),g.fromBufferAttribute(s,I),v.fromBufferAttribute(s,F),u.sub(c),p.sub(c),g.sub(m),v.sub(m);const k=1/(g.x*v.y-v.x*g.y);isFinite(k)&&(b.copy(u).multiplyScalar(v.y).addScaledVector(p,-g.y).multiplyScalar(k),M.copy(p).multiplyScalar(g.x).addScaledVector(u,-v.x).multiplyScalar(k),a[O].add(b),a[I].add(b),a[F].add(b),l[O].add(M),l[I].add(M),l[F].add(M))}let w=this.groups;w.length===0&&(w=[{start:0,count:e.count}]);for(let O=0,I=w.length;O<I;++O){const F=w[O],k=F.start,Y=F.count;for(let W=k,Q=k+Y;W<Q;W+=3)x(e.getX(W+0),e.getX(W+1),e.getX(W+2))}const R=new re,C=new re,N=new re,D=new re;function P(O){N.fromBufferAttribute(r,O),D.copy(N);const I=a[O];
vendor: 7,330 bytes, line 5
5R.copy(I),R.sub(N.multiplyScalar(N.dot(I))).normalize(),C.crossVectors(D,I);const k=C.dot(l[O])<0?-1:1;o.setXYZW(O,R.x,R.y,R.z,k)}for(let O=0,I=w.length;O<I;++O){const F=w[O],k=F.start,Y=F.count;for(let W=k,Q=k+Y;W<Q;W+=3)P(e.getX(W+0)),P(e.getX(W+1)),P(e.getX(W+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Ii(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let m=0,g=n.count;m<g;m++)n.setXYZ(m,0,0,0);const r=new re,s=new re,o=new re,a=new re,l=new re,c=new re,u=new re,p=new re;if(e)for(let m=0,g=e.count;m<g;m+=3){const v=e.getX(m+0),b=e.getX(m+1),M=e.getX(m+2);r.fromBufferAttribute(t,v),s.fromBufferAttribute(t,b),o.fromBufferAttribute(t,M),u.subVectors(o,s),p.subVectors(r,s),u.cross(p),a.fromBufferAttribute(n,v),l.fromBufferAttribute(n,b),c.fromBufferAttribute(n,M),a.add(u),l.add(u),c.add(u),n.setXYZ(v,a.x,a.y,a.z),n.setXYZ(b,l.x,l.y,l.z),n.setXYZ(M,c.x,c.y,c.z)}else for(let m=0,g=t.count;m<g;m+=3)r.fromBufferAttribute(t,m+0),s.fromBufferAttribute(t,m+1),o.fromBufferAttribute(t,m+2),u.subVectors(o,s),p.subVectors(r,s),u.cross(p),n.setXYZ(m+0,u.x,u.y,u.z),n.setXYZ(m+1,u.x,u.y,u.z),n.setXYZ(m+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Cr.fromBufferAttribute(e,t),Cr.normalize(),e.setXYZ(t,Cr.x,Cr.y,Cr.z)}toNonIndexed(){function e(a,l){const c=a.array,u=a.itemSize,p=a.normalized,m=new c.constructor(l.length*u);let g=0,v=0;for(let b=0,M=l.length;b<M;b++){a.isInterleavedBufferAttribute?g=l[b]*a.data.stride+a.offset:g=l[b]*u;for(let x=0;x<u;x++)m[v++]=c[g++]}return new Ii(m,u,p)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new dL,n=this.index.array,r=this.attributes;for(const a in r){const l=r[a],c=e(l,n);t.setAttribute(a,c)}const s=this.morphAttributes;for(const a in s){const l=[],c=s[a];for(let u=0,p=c.length;u<p;u++){const m=c[u],g=e(m,n);l.push(g)}t.morphAttributes[a]=l}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,l=o.length;a<l;a++){const c=o[a];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let p=0,m=c.length;p<m;p++){const g=c[p];u.push(g.toJSON(e.data))}u.length>0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],p=s[c];for(let m=0,g=p.length;m<g;m++)u.push(p[m].clone(t));this.morphAttributes[c]=u}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let c=0,u=o.length;c<u;c++){const p=o[c];this.addGroup(p.start,p.count,p.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}};const I3=new un,uu=new P0,Mm=new Yc,B3=new re,wm=new re,Tm=new re,Em=new re,Ty=new re,Rm=new re,F3=new re,Cm=new re;let qn=class extends ir{constructor(e=new vi,t=new Bo){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[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(e,t){const n=this.geometry,r=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const a=this.morphTargetInfluences;if(s&&a){Rm.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const u=a[l],p=s[l];u!==0&&(Ty.fromBufferAttribute(p,e),o?Rm.addScaledVector(Ty,u):Rm.addScaledVector(Ty.sub(t),u))}t.add(Rm)}return t}raycast(e,t){const n=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Mm.copy(n.boundingSphere),Mm.applyMatrix4(s),uu.copy(e.ray).recast(e.near),!(Mm.containsPoint(uu.origin)===!1&&(uu.intersectSphere(Mm,B3)===null||uu.origin.distanceToSquared(B3)>(e.far-e.near)**2))&&(I3.copy(s).invert(),uu.copy(e.ray).applyMatrix4(I3),!(n.boundingBox!==null&&uu.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,uu)))}_computeIntersections(e,t,n){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,p=s.attributes.normal,m=s.groups,g=s.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,b=m.length;v<b;v++){const M=m[v],x=o[M.materialIndex],w=Math.max(M.start,g.start),R=Math.min(a.count,Math.min(M.start+M.count,g.start+g.count));for(let C=w,N=R;C<N;C+=3){const D=a.getX(C),P=a.getX(C+1),O=a.getX(C+2);r=Pm(this,x,e,n,c,u,p,D,P,O),r&&(r.faceIndex=Math.floor(C/3),r.face.materialIndex=M.materialIndex,t.push(r))}}else{const v=Math.max(0,g.start),b=Math.min(a.count,g.start+g.count);for(let M=v,x=b;M<x;M+=3){const w=a.getX(M),R=a.getX(M+1),C=a.getX(M+2);r=Pm(this,o,e,n,c,u,p,w,R,C),r&&(r.faceIndex=Math.floor(M/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(o))for(let v=0,b=m.length;v<b;v++){const M=m[v],x=o[M.materialIndex],w=Math.max(M.start,g.start),R=Math.min(l.count,Math.min(M.start+M.count,g.start+g.count));for(let C=w,N=R;C<N;C+=3){const D=C,P=C+1,O=C+2;r=Pm(this,x,e,n,c,u,p,D,P,O),r&&(r.faceIndex=Math.floor(C/3),r.face.materialIndex=M.materialIndex,t.push(r))}}else{const v=Math.max(0,g.start),b=Math.min(l.count,g.start+g.count);for(let M=v,x=b;M<x;M+=3){const w=M,R=M+1,C=M+2;
vendor: 6,575 bytes, lines 5-9
5r=Pm(this,o,e,n,c,u,p,w,R,C),r&&(r.faceIndex=Math.floor(M/3),t.push(r))}}}};function y9(i,e,t,n,r,s,o,a){let l;if(e.side===oi?l=n.intersectTriangle(o,s,r,!0,a):l=n.intersectTriangle(r,s,o,e.side===qs,a),l===null)return null;Cm.copy(a),Cm.applyMatrix4(i.matrixWorld);const c=t.ray.origin.distanceTo(Cm);return c<t.near||c>t.far?null:{distance:c,point:Cm.clone(),object:i}}function Pm(i,e,t,n,r,s,o,a,l,c){i.getVertexPosition(a,wm),i.getVertexPosition(l,Tm),i.getVertexPosition(c,Em);const u=y9(i,e,t,n,wm,Tm,Em,F3);if(u){const p=new re;yp.getBarycoord(F3,wm,Tm,Em,p),r&&(u.uv=yp.getInterpolatedAttribute(r,a,l,c,p,new at)),s&&(u.uv1=yp.getInterpolatedAttribute(s,a,l,c,p,new at)),o&&(u.normal=yp.getInterpolatedAttribute(o,a,l,c,p,new re),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const m={a,b:l,c,normal:new re,materialIndex:0};yp.getNormal(wm,Tm,Em,m.normal),u.face=m,u.barycoord=p}return u}let Hf=class fL extends vi{constructor(e=1,t=1,n=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,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=[],u=[],p=[];let m=0,g=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,r,o,2),v("x","z","y",1,-1,e,n,-t,r,o,3),v("x","y","z",1,-1,e,t,n,r,s,4),v("x","y","z",-1,-1,e,t,-n,r,s,5),this.setIndex(l),this.setAttribute("position",new Gn(c,3)),this.setAttribute("normal",new Gn(u,3)),this.setAttribute("uv",new Gn(p,2));function v(b,M,x,w,R,C,N,D,P,O,I){const F=C/P,k=N/O,Y=C/2,W=N/2,Q=D/2,J=P+1,H=O+1;let $=0,K=0;const he=new re;for(let ie=0;ie<H;ie++){const de=ie*k-W;for(let Ce=0;Ce<J;Ce++){const Fe=Ce*F-Y;he[b]=Fe*w,he[M]=de*R,he[x]=Q,c.push(he.x,he.y,he.z),he[b]=0,he[M]=0,he[x]=D>0?1:-1,u.push(he.x,he.y,he.z),p.push(Ce/P),p.push(1-ie/O),$+=1}}for(let ie=0;ie<O;ie++)for(let de=0;de<P;de++){const Ce=m+de+J*ie,Fe=m+de+J*(ie+1),ge=m+(de+1)+J*(ie+1),Ge=m+(de+1)+J*ie;l.push(Ce,Fe,Ge),l.push(Fe,ge,Ge),K+=6}a.addGroup(g,K,I),g+=K,m+=$}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new fL(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}};function Mf(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const r=i[t][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()."),e[t][n]=null):e[t][n]=r.clone():Array.isArray(r)?e[t][n]=r.slice():e[t][n]=r}}return e}function _s(i){const e={};for(let t=0;t<i.length;t++){const n=Mf(i[t]);for(const r in n)e[r]=n[r]}return e}function x9(i){const e=[];for(let t=0;t<i.length;t++)e.push(i[t].clone());return e}function pL(i){const e=i.getRenderTarget();return e===null?i.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:En.workingColorSpace}const P1={clone:Mf,merge:_s};var b9=`void main() {
6	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
7}`,S9=`void main() {
8	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
9}`;let Xs=class extends cs{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=b9,this.fragmentShader=S9,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Mf(e.uniforms),this.uniformsGroups=x9(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const o=this.uniforms[r].value;o&&o.isTexture?t.uniforms[r]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[r]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[r]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[r]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[r]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[r]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[r]={type:"m4",value:o.toArray()}:t.uniforms[r]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const r in this.extensions)this.extensions[r]===!0&&(n[r]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}},L0=class extends ir{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new un,this.projectionMatrix=new un,this.projectionMatrixInverse=new un,this.coordinateSystem=Ms}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};const sc=new re,U3=new at,O3=new at;let Br=class extends L0{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=sh*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(mA*.5*this.fov);return .5*this.getFilmHeight()/e}
vendor: 4,364 bytes, line 9
9getEffectiveFOV(){return sh*2*Math.atan(Math.tan(mA*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){sc.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(sc.x,sc.y).multiplyScalar(-e/sc.z),sc.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(sc.x,sc.y).multiplyScalar(-e/sc.z)}getViewSize(e,t){return this.getViewBounds(e,U3,O3),t.subVectors(O3,U3)}setViewOffset(e,t,n,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(mA*.5*this.fov)/this.zoom,n=2*t,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,t-=o.offsetY*n/c,r*=o.width/l,n*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};const Oh=-90,kh=1;let AL=class extends ir{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Br(Oh,kh,e,t);r.layers=this.layers,this.add(r);const s=new Br(Oh,kh,e,t);s.layers=this.layers,this.add(s);const o=new Br(Oh,kh,e,t);o.layers=this.layers,this.add(o);const a=new Br(Oh,kh,e,t);a.layers=this.layers,this.add(a);const l=new Br(Oh,kh,e,t);l.layers=this.layers,this.add(l);const c=new Br(Oh,kh,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,r,s,o,a,l]=t;for(const c of t)this.remove(c);if(e===Ms)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(e===Xa)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: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,u]=this.children,p=e.getRenderTarget(),m=e.getActiveCubeFace(),g=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const b=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,s),e.setRenderTarget(n,1,r),e.render(t,o),e.setRenderTarget(n,2,r),e.render(t,a),e.setRenderTarget(n,3,r),e.render(t,l),e.setRenderTarget(n,4,r),e.render(t,c),n.texture.generateMipmaps=b,e.setRenderTarget(n,5,r),e.render(t,u),e.setRenderTarget(p,m,g),e.xr.enabled=v,n.texture.needsPMREMUpdate=!0}},L1=class extends Cs{constructor(e=[],t=Aa,n,r,s,o,a,l,c,u){super(e,t,n,r,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},mL=class extends Hc{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new L1(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:xr}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace
vendor: 7,789 bytes, lines 9-44
9=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.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 Hf(5,5,5),s=new Xs({name:"CubemapFromEquirect",uniforms:Mf(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:oi,blending:Hs});s.uniforms.tEquirect.value=t;const o=new qn(r,s),a=t.minFilter;return t.minFilter===Os&&(t.minFilter=xr),new AL(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t=!0,n=!0,r=!0){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,r);e.setRenderTarget(s)}},ks=class extends ir{constructor(){super(),this.isGroup=!0,this.type="Group"}};const M9={type:"move"};let c_=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ks,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 ks,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new re,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new re),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ks,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new re,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new re),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const b of e.hand.values()){const M=t.getJointPose(b,n),x=this._getHandJoint(c,b);M!==null&&(x.matrix.fromArray(M.transform.matrix),x.matrix.decompose(x.position,x.rotation,x.scale),x.matrixWorldNeedsUpdate=!0,x.jointRadius=M.radius),x.visible=M!==null}const u=c.joints["index-finger-tip"],p=c.joints["thumb-tip"],m=u.position.distanceTo(p.position),g=.02,v=.005;c.inputState.pinching&&m>g+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&m<=g-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.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=t.getPose(e.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(M9)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new ks;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}},N1=class extends ir{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 Es,this.environmentIntensity=1,this.environmentRotation=new Es,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}},WS=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=k_,this.updateRanges=[],this.version=0,this.uuid=Ga()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ga()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ga()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}};const ms=new re;let Rc=class gL{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}
vendor: 4,126 bytes, line 44
44get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)ms.fromBufferAttribute(this,t),ms.applyMatrix4(e),this.setXYZ(t,ms.x,ms.y,ms.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)ms.fromBufferAttribute(this,t),ms.applyNormalMatrix(e),this.setXYZ(t,ms.x,ms.y,ms.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)ms.fromBufferAttribute(this,t),ms.transformDirection(e),this.setXYZ(t,ms.x,ms.y,ms.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Ss(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Tn(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Tn(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Tn(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Tn(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Tn(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Ss(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Ss(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Ss(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Ss(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Tn(t,this.array),n=Tn(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Tn(t,this.array),n=Tn(n,this.array),r=Tn(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Tn(t,this.array),n=Tn(n,this.array),r=Tn(r,this.array),s=Tn(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new Ii(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new gL(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},w9=class extends cs{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new qt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},T9=class extends Cs{constructor(e=null,t=1,n=1,r,s,o,a,l,c=xi,u=
vendor: 7,166 bytes, line 44
44xi,p,m){super(null,o,a,l,c,u,r,s,p,m),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},Ic=class extends Ii{constructor(e,t,n,r=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}};const Ey=new re,E9=new re,R9=new Sn;let Da=class{constructor(e=new re(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=Ey.subVectors(n,t).cross(E9.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(Ey),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||R9.getNormalMatrix(e),r=this.coplanarPoint(Ey).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};const hu=new Yc,Lm=new re;let Wf=class{constructor(e=new Da,t=new Da,n=new Da,r=new Da,s=new Da,o=new Da){this.planes=[e,t,n,r,s,o]}set(e,t,n,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=Ms){const n=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],u=r[5],p=r[6],m=r[7],g=r[8],v=r[9],b=r[10],M=r[11],x=r[12],w=r[13],R=r[14],C=r[15];if(n[0].setComponents(l-s,m-c,M-g,C-x).normalize(),n[1].setComponents(l+s,m+c,M+g,C+x).normalize(),n[2].setComponents(l+o,m+u,M+v,C+w).normalize(),n[3].setComponents(l-o,m-u,M-v,C-w).normalize(),n[4].setComponents(l-a,m-p,M-b,C-R).normalize(),t===Ms)n[5].setComponents(l+a,m+p,M+b,C+R).normalize();else if(t===Xa)n[5].setComponents(a,p,b,R).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),hu.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),hu.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(hu)}intersectsSprite(e){return hu.center.set(0,0,0),hu.radius=.7071067811865476,hu.applyMatrix4(e.matrixWorld),this.intersectsSphere(hu)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(Lm.x=r.normal.x>0?e.max.x:e.min.x,Lm.y=r.normal.y>0?e.max.y:e.min.y,Lm.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Lm)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};const wa=new un,Ta=new Wf;class $S{constructor(){this.coordinateSystem=Ms}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(wa.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Ta.setFromProjectionMatrix(wa,this.coordinateSystem),Ta.intersectsObject(e))return!0}return!1}intersectsSprite(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(wa.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Ta.setFromProjectionMatrix(wa,this.coordinateSystem),Ta.intersectsSprite(e))return!0}return!1}intersectsSphere(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(wa.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Ta.setFromProjectionMatrix(wa,this.coordinateSystem),Ta.intersectsSphere(e))return!0}return!1}intersectsBox(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(wa.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Ta.setFromProjectionMatrix(wa,this.coordinateSystem),Ta.intersectsBox(e))return!0}return!1}containsPoint(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(wa.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Ta.setFromProjectionMatrix(wa,this.coordinateSystem),Ta.containsPoint(e))return!0}return!1}clone(){return new $S}}let $f=class extends cs{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new qt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}};const z_=new re,V_=new re,k3=new un,bp=new P0,Nm=new Yc,Ry=new re,z3=new re;let D1=class extends ir{constructor(e=new vi,t=new $f){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let r=1,s=t.count;r<s;r++)z_.fromBufferAttribute(t,r-1),V_.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=z_.distanceTo(V_);e.setAttribute("lineDistance",new Gn(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Nm.copy(n.boundingSphere),Nm.applyM
vendor: 5,235 bytes, line 44
44atrix4(r),Nm.radius+=s,e.ray.intersectsSphere(Nm)===!1)return;k3.copy(r).invert(),bp.copy(e.ray).applyMatrix4(k3);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=this.isLineSegments?2:1,u=n.index,m=n.attributes.position;if(u!==null){const g=Math.max(0,o.start),v=Math.min(u.count,o.start+o.count);for(let b=g,M=v-1;b<M;b+=c){const x=u.getX(b),w=u.getX(b+1),R=Dm(this,e,bp,l,x,w,b);R&&t.push(R)}if(this.isLineLoop){const b=u.getX(v-1),M=u.getX(g),x=Dm(this,e,bp,l,b,M,v-1);x&&t.push(x)}}else{const g=Math.max(0,o.start),v=Math.min(m.count,o.start+o.count);for(let b=g,M=v-1;b<M;b+=c){const x=Dm(this,e,bp,l,b,b+1,b);x&&t.push(x)}if(this.isLineLoop){const b=Dm(this,e,bp,l,v-1,g,v-1);b&&t.push(b)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[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 Dm(i,e,t,n,r,s,o){const a=i.geometry.attributes.position;if(z_.fromBufferAttribute(a,r),V_.fromBufferAttribute(a,s),t.distanceSqToSegment(z_,V_,Ry,z3)>n)return;Ry.applyMatrix4(i.matrixWorld);const c=e.ray.origin.distanceTo(Ry);if(!(c<e.near||c>e.far))return{distance:c,point:z3.clone().applyMatrix4(i.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:i}}const V3=new re,G3=new re;let _L=class extends D1{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let r=0,s=t.count;r<s;r+=2)V3.fromBufferAttribute(t,r),G3.fromBufferAttribute(t,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+V3.distanceTo(G3);e.setAttribute("lineDistance",new Gn(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}},jS=class extends cs{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new qt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}};const q3=new un,Y2=new P0,Im=new Yc,Bm=new re;let C9=class extends ir{constructor(e=new vi,t=new jS){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Im.copy(n.boundingSphere),Im.applyMatrix4(r),Im.radius+=s,e.ray.intersectsSphere(Im)===!1)return;q3.copy(r).invert(),Y2.copy(e.ray).applyMatrix4(q3);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=n.index,p=n.attributes.position;if(c!==null){const m=Math.max(0,o.start),g=Math.min(c.count,o.start+o.count);for(let v=m,b=g;v<b;v++){const M=c.getX(v);Bm.fromBufferAttribute(p,M),H3(Bm,M,l,r,e,t,this)}}else{const m=Math.max(0,o.start),g=Math.min(p.count,o.start+o.count);for(let v=m,b=g;v<b;v++)Bm.fromBufferAttribute(p,v),H3(Bm,v,l,r,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[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 H3(i,e,t,n,r,s,o){const a=Y2.distanceSqToPoint(i);if(a<t){const l=new re;Y2.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:e,face:null,faceIndex:null,barycoord:null,object:o})}}class vL extends Cs{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=xi,this.minFilter=xi,this.generateMipmaps=!1,this.needsUpdate=!0}}let $s=class extends Cs{constructor(e,t,n=mi,r,s,o,a=xi,l=xi,c,u=bo){if(u!==bo&&u!==So)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super(null,r,s,o,a,l,u,n,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new VS(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}};class yL extends $s{constructor(e=1,t=1,n=1){super(e,t),this.isDepthArrayTexture=!0,this.image={width:e,height:t,depth:n},this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class I1 extends vi{constructor(e=1,t=32,n=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radiu
vendor: 4,912 bytes, line 44
44s:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const s=[],o=[],a=[],l=[],c=new re,u=new at;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let p=0,m=3;p<=t;p++,m+=3){const g=n+p/t*r;c.x=e*Math.cos(g),c.y=e*Math.sin(g),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[m]/e+1)/2,u.y=(o[m+1]/e+1)/2,l.push(u.x,u.y)}for(let p=1;p<=t;p++)s.push(p,p+1,0);this.setIndex(s),this.setAttribute("position",new Gn(o,3)),this.setAttribute("normal",new Gn(a,3)),this.setAttribute("uv",new Gn(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new I1(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class B1 extends vi{constructor(e=1,t=1,n=1,r=32,s=1,o=!1,a=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};const c=this;r=Math.floor(r),s=Math.floor(s);const u=[],p=[],m=[],g=[];let v=0;const b=[],M=n/2;let x=0;w(),o===!1&&(e>0&&R(!0),t>0&&R(!1)),this.setIndex(u),this.setAttribute("position",new Gn(p,3)),this.setAttribute("normal",new Gn(m,3)),this.setAttribute("uv",new Gn(g,2));function w(){const C=new re,N=new re;let D=0;const P=(t-e)/n;for(let O=0;O<=s;O++){const I=[],F=O/s,k=F*(t-e)+e;for(let Y=0;Y<=r;Y++){const W=Y/r,Q=W*l+a,J=Math.sin(Q),H=Math.cos(Q);N.x=k*J,N.y=-F*n+M,N.z=k*H,p.push(N.x,N.y,N.z),C.set(J,P,H).normalize(),m.push(C.x,C.y,C.z),g.push(W,1-F),I.push(v++)}b.push(I)}for(let O=0;O<r;O++)for(let I=0;I<s;I++){const F=b[I][O],k=b[I+1][O],Y=b[I+1][O+1],W=b[I][O+1];(e>0||I!==0)&&(u.push(F,k,W),D+=3),(t>0||I!==s-1)&&(u.push(k,Y,W),D+=3)}c.addGroup(x,D,0),x+=D}function R(C){const N=v,D=new at,P=new re;let O=0;const I=C===!0?e:t,F=C===!0?1:-1;for(let Y=1;Y<=r;Y++)p.push(0,M*F,0),m.push(0,F,0),g.push(.5,.5),v++;const k=v;for(let Y=0;Y<=r;Y++){const Q=Y/r*l+a,J=Math.cos(Q),H=Math.sin(Q);P.x=I*H,P.y=M*F,P.z=I*J,p.push(P.x,P.y,P.z),m.push(0,F,0),D.x=J*.5+.5,D.y=H*.5*F+.5,g.push(D.x,D.y),v++}for(let Y=0;Y<r;Y++){const W=N+Y,Q=k+Y;C===!0?u.push(Q,Q+1,W):u.push(Q+1,Q,W),O+=3}c.addGroup(x,O,C===!0?1:2),x+=O}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new B1(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}let ya=class{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.")}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)n=this.getPoint(o/e),s+=n.distanceTo(r),t.push(s),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const n=this.getLengths();let r=0;const s=n.length;let o;t?o=t:o=e*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 u=n[r],m=n[r+1]-u,g=(o-u)/m;return(r+g)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new at:new re);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){const n=new re,r=[],s=[],o=[],a=new re,l=new un;for(let g=0;g<=e;g++){const v=g/e;r[g]=this.getTangentAt(v,new re)}s[0]=new re,o[0]=new re;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),p=Math.abs(r[0].y),m=Math.abs(r[0].z);u<=c&&(c=u,n.set(1,0,0)),p<=c&&(c=p,n.set(0,1,0)),m<=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 g=1;g<=e;g++){if(s[g]=s[g-1].clone(),o[g]=o[g-1].clone(),a.crossVectors(r[g-1],r[g]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos(wn(r[g-1].dot(r[g]),-1,1));s[g].applyMatrix4(l.makeRotationAxis(a,v))}o[g].crossVectors(r[g],s[g])}if(t===!0){let g=Math.acos(wn(s[0].dot(s[e]),-1,1));g/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(g=-g);for(let v=1;v<=e;v++)s[v].applyMatrix4(l.makeRotationAxis(r[v],g*v)),o[v].crossVectors(r[v],s[v])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.t
vendor: 6,046 bytes, line 44
44ype,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},XS=class extends ya{constructor(e=0,t=0,n=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new at){const n=t,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+e*s;let l=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const u=Math.cos(this.aRotation),p=Math.sin(this.aRotation),m=l-this.aX,g=c-this.aY;l=m*u-g*p+this.aX,c=m*p+g*u+this.aY}return n.set(l,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}},P9=class extends XS{constructor(e,t,n,r,s,o){super(e,t,n,n,r,s,o),this.isArcCurve=!0,this.type="ArcCurve"}};function YS(){let i=0,e=0,t=0,n=0;function r(s,o,a,l){i=s,e=a,t=-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,u,p){let m=(o-s)/c-(a-s)/(c+u)+(a-o)/u,g=(a-o)/u-(l-o)/(u+p)+(l-a)/p;m*=u,g*=u,r(o,a,m,g)},calc:function(s){const o=s*s,a=o*s;return i+e*s+t*o+n*a}}}const Fm=new re,Cy=new YS,Py=new YS,Ly=new YS;let L9=class extends ya{constructor(e=[],t=!1,n="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new re){const n=t,r=this.points,s=r.length,o=(s-(this.closed?0:1))*e;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,u;this.closed||a>0?c=r[(a-1)%s]:(Fm.subVectors(r[0],r[1]).add(r[0]),c=Fm);const p=r[a%s],m=r[(a+1)%s];if(this.closed||a+2<s?u=r[(a+2)%s]:(Fm.subVectors(r[s-1],r[s-2]).add(r[s-1]),u=Fm),this.curveType==="centripetal"||this.curveType==="chordal"){const g=this.curveType==="chordal"?.5:.25;let v=Math.pow(c.distanceToSquared(p),g),b=Math.pow(p.distanceToSquared(m),g),M=Math.pow(m.distanceToSquared(u),g);b<1e-4&&(b=1),v<1e-4&&(v=b),M<1e-4&&(M=b),Cy.initNonuniformCatmullRom(c.x,p.x,m.x,u.x,v,b,M),Py.initNonuniformCatmullRom(c.y,p.y,m.y,u.y,v,b,M),Ly.initNonuniformCatmullRom(c.z,p.z,m.z,u.z,v,b,M)}else this.curveType==="catmullrom"&&(Cy.initCatmullRom(c.x,p.x,m.x,u.x,this.tension),Py.initCatmullRom(c.y,p.y,m.y,u.y,this.tension),Ly.initCatmullRom(c.z,p.z,m.z,u.z,this.tension));return n.set(Cy.calc(l),Py.calc(l),Ly.calc(l)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(new re().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}};function W3(i,e,t,n,r){const s=(n-e)*.5,o=(r-t)*.5,a=i*i,l=i*a;return(2*t-2*n+s+o)*l+(-3*t+3*n-2*s-o)*a+s*i+t}function N9(i,e){const t=1-i;return t*t*e}function D9(i,e){return 2*(1-i)*i*e}function I9(i,e){return i*i*e}function _A(i,e,t,n){return N9(i,e)+D9(i,t)+I9(i,n)}function B9(i,e){const t=1-i;return t*t*t*e}function F9(i,e){const t=1-i;return 3*t*t*i*e}function U9(i,e){return 3*(1-i)*i*i*e}function O9(i,e){return i*i*i*e}function vA(i,e,t,n,r){return B9(i,e)+F9(i,t)+U9(i,n)+O9(i,r)}let xL=class extends ya{constructor(e=new at,t=new at,n=new at,r=new at){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new at){const n=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return n.set(vA(e,r.x,s.x,o.x,a.x),vA(e,r.y,s.y,o.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}},bL=class extends ya{constructor(e=new re,t=new re,n=new re,r=new re){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new re){const n=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return n.set(vA(e,r.x,s.x,o.x,a.x),vA(e,r.y,s.y,o.y,a.y),vA(e,r.z,s.z,o.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}},SL=class extends ya{constructor(e=new at,t=new at){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new at){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}
vendor: 4,431 bytes, line 44
44getTangent(e,t=new at){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},k9=class extends ya{constructor(e=new re,t=new re){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new re){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new re){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},ML=class extends ya{constructor(e=new at,t=new at,n=new at){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new at){const n=t,r=this.v0,s=this.v1,o=this.v2;return n.set(_A(e,r.x,s.x,o.x),_A(e,r.y,s.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},wL=class extends ya{constructor(e=new re,t=new re,n=new re){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new re){const n=t,r=this.v0,s=this.v1,o=this.v2;return n.set(_A(e,r.x,s.x,o.x),_A(e,r.y,s.y,o.y),_A(e,r.z,s.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},TL=class extends ya{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new at){const n=t,r=this.points,s=(r.length-1)*e,o=Math.floor(s),a=s-o,l=r[o===0?o:o-1],c=r[o],u=r[o>r.length-2?r.length-1:o+1],p=r[o>r.length-3?r.length-1:o+2];return n.set(W3(a,l.x,c.x,u.x,p.x),W3(a,l.y,c.y,u.y,p.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(new at().fromArray(r))}return this}};var G_=Object.freeze({__proto__:null,ArcCurve:P9,CatmullRomCurve3:L9,CubicBezierCurve:xL,CubicBezierCurve3:bL,EllipseCurve:XS,LineCurve:SL,LineCurve3:k9,QuadraticBezierCurve:ML,QuadraticBezierCurve3:wL,SplineCurve:TL});let z9=class extends ya{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const n=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new G_[n](t,e))}return this}getPoint(e,t){const n=e*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,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],a=o.isEllipseCurve?e*2:o.isLineCurve||o.isLineCurve3?1:o.isS
vendor: 4,113 bytes, line 44
44plineCurve?e*o.points.length:e,l=o.getPoints(a);for(let c=0;c<l.length;c++){const u=l[c];n&&n.equals(u)||(t.push(u),n=u)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const r=e.curves[t];this.curves.push(new G_[r.type]().fromJSON(r))}return this}},Q2=class extends z9{constructor(e){super(),this.type="Path",this.currentPoint=new at,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new SL(this.currentPoint.clone(),new at(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){const s=new ML(this.currentPoint.clone(),new at(e,t),new at(n,r));return this.curves.push(s),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,s,o){const a=new xL(this.currentPoint.clone(),new at(e,t),new at(n,r),new at(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new TL(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,s,o){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+a,t+l,n,r,s,o),this}absarc(e,t,n,r,s,o){return this.absellipse(e,t,n,n,r,s,o),this}ellipse(e,t,n,r,s,o,a,l){const c=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(e+c,t+u,n,r,s,o,a,l),this}absellipse(e,t,n,r,s,o,a,l){const c=new XS(e,t,n,r,s,o,a,l);if(this.curves.length>0){const p=c.getPoint(0);p.equals(this.currentPoint)||this.lineTo(p.x,p.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},u_=class extends Q2{constructor(e){super(e),this.uuid=Ga(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const r=e.holes[t];this.holes.push(new Q2().fromJSON(r))}return this}};function V9(i,e,t=2){const n=e&&e.length,r=n?e[0]*t:i.length;let s=EL(i,0,r,t,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,c;if(n&&(s=$9(i,e,s,t)),i.length>80*t){a=1/0,l=1/0;let u=-1/0,p=-1/0;for(let m=t;m<r;m+=t){const g=i[m],v=i[m+1];g<a&&(a=g),v<l&&(l=v),g>u&&(u=g),v>p&&(p=v)}c=Math.max(u-a,p-l),c=c!==0?32767/c:0}return QA(s,o,t,a,l,c,0),o}function EL(i,e,t,n,r){let s;if(r===ik(i,e,t,n)>0)for(let o=e;o<t;o+=n)s=$3(o/n|0,i[o],i[o+1],s);else for(let o=t-n;o>=e;o-=n)s=$3(o/n|0,i[o],i[o+1],s);return s&&wf(s,s.next)&&(KA(s),s=s.next),s}function oh(i,e){if(!i)return i;e||(e=i);let t=i,n;do if(n=!1,!t.steiner&&(wf(t,t.next)||ki(t.prev,t,t.next)===0)){if(KA(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function QA(i,e,t,n,r,s,o){if(!i)return;!o&&s&&Z9(i,n,r,s);let a=i;for(;i.prev!==i.next;){const l=i.prev,c=i.next;if(s?q9(i,n,r,s):G9(i)){e.push(l.i,i.i,c.i),KA(i),i=c.next,a=c.next;continue}if(i=c,i===a){o?o===1?(i=H9(oh(i),e),QA(i,e,t,n,r,s,2)):o===2&&W9(i,e,t,n,r,s
vendor: 4,142 bytes, line 44
44):QA(oh(i),e,t,n,r,s,1);break}}}function G9(i){const e=i.prev,t=i,n=i.next;if(ki(e,t,n)>=0)return!1;const r=e.x,s=t.x,o=n.x,a=e.y,l=t.y,c=n.y,u=Math.min(r,s,o),p=Math.min(a,l,c),m=Math.max(r,s,o),g=Math.max(a,l,c);let v=n.next;for(;v!==e;){if(v.x>=u&&v.x<=m&&v.y>=p&&v.y<=g&&iA(r,a,s,l,o,c,v.x,v.y)&&ki(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function q9(i,e,t,n){const r=i.prev,s=i,o=i.next;if(ki(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,u=r.y,p=s.y,m=o.y,g=Math.min(a,l,c),v=Math.min(u,p,m),b=Math.max(a,l,c),M=Math.max(u,p,m),x=Z2(g,v,e,t,n),w=Z2(b,M,e,t,n);let R=i.prevZ,C=i.nextZ;for(;R&&R.z>=x&&C&&C.z<=w;){if(R.x>=g&&R.x<=b&&R.y>=v&&R.y<=M&&R!==r&&R!==o&&iA(a,u,l,p,c,m,R.x,R.y)&&ki(R.prev,R,R.next)>=0||(R=R.prevZ,C.x>=g&&C.x<=b&&C.y>=v&&C.y<=M&&C!==r&&C!==o&&iA(a,u,l,p,c,m,C.x,C.y)&&ki(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;R&&R.z>=x;){if(R.x>=g&&R.x<=b&&R.y>=v&&R.y<=M&&R!==r&&R!==o&&iA(a,u,l,p,c,m,R.x,R.y)&&ki(R.prev,R,R.next)>=0)return!1;R=R.prevZ}for(;C&&C.z<=w;){if(C.x>=g&&C.x<=b&&C.y>=v&&C.y<=M&&C!==r&&C!==o&&iA(a,u,l,p,c,m,C.x,C.y)&&ki(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function H9(i,e){let t=i;do{const n=t.prev,r=t.next.next;!wf(n,r)&&CL(n,t,t.next,r)&&ZA(n,r)&&ZA(r,n)&&(e.push(n.i,t.i,r.i),KA(t),KA(t.next),t=i=r),t=t.next}while(t!==i);return oh(t)}function W9(i,e,t,n,r,s){let o=i;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&ek(o,a)){let l=PL(o,a);o=oh(o,o.next),l=oh(l,l.next),QA(o,e,t,n,r,s,0),QA(l,e,t,n,r,s,0);return}a=a.next}o=o.next}while(o!==i)}function $9(i,e,t,n){const r=[];for(let s=0,o=e.length;s<o;s++){const a=e[s]*n,l=s<o-1?e[s+1]*n:i.length,c=EL(i,a,l,n,!1);c===c.next&&(c.steiner=!0),r.push(J9(c))}r.sort(j9);for(let s=0;s<r.length;s++)t=X9(r[s],t);return t}function j9(i,e){let t=i.x-e.x;if(t===0&&(t=i.y-e.y,t===0)){const n=(i.next.y-i.y)/(i.next.x-i.x),r=(e.next.y-e.y)/(e.next.x-e.x);t=n-r}return t}function X9(i,e){const t=Y9(i,e);if(!t)return e;const n=PL(t,i);return oh(n,n.next),oh(t,t.next)}function Y9(i,e){let t=e;const n=i.x,r=i.y;let s=-1/0,o;if(wf(i,t))return t;do{if(wf(i,t.next))return t.next;if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const p=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=n&&p>s&&(s=p,o=t.x<t.next.x?t:t.next,p===n))return o}t=t.next}while(t!==e);if(!o)return null;const a=o,l=o.x,c=o.y;let u=1/0;t=o;do{if(n>=t.x&&t.x>=l&&n!==t.x&&RL(r<c?n:s,r,l,c,r<c?s:n,r,t.x,t.y)){const p=Math.abs(r-t.y)/(n-t.x);ZA(t,i)&&(p<u||p===u&&(t.x>o.x||t.x===o.x&&Q9(o,t)))&&(o=t,u=p)}t=t.next}while(t!==a);return o}function Q9(i,e){return ki(i.prev,i,e.prev)<0&&ki(e.next,i,i.next)<0}function Z9(i,e,t,n){let r=i;do r.z===0&&(r.z=Z2(r.x,r.y,e,t,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==i);r.prevZ.nextZ=null,r.prevZ=null,K9(r)}function K9(i){let e,t=1;do{let n=i,r;i=null;let s=null;for(e=0;n;){e++;let o=n,a=0;for(let c=0;c<t&&(a++,o=o.nextZ,!!o);c++);let l=t;for(;a>0||l>0&&o;)a!==0&&(l===0||!o||n.z<=o.z)?(r=n,n=n.nextZ,a--):(r=o,o=o.nextZ,l--),s?s.nextZ=r:i=r,r.prevZ=s,s=r;n=o}s.nextZ=null,t*=2}while(e>1);return i}function Z2(i,e,t,n,r){return i=(i-t)*r|0,e=(e-n)*r|0,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,i|e<<1}function J9(i){let e=i,t=i;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==i);return t}function RL(i,e,t,n,r,s,o,a){return(r-o)*(e-a)>=(i-o)*(s-a)&&(i-o)*(n-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(n-a)}function iA(i,e,t,n,r,s,o,a){return!(i===o&&e===a)&&RL(i,e,t,n,r,s,o,a)}function ek(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!tk(i,e)&&(ZA(i,e)&&ZA(e,i)&&nk(i,e)&&(ki(i.prev,i,e.prev)||ki(i,e.prev,e))||wf(i,e)&&ki(i.prev,i,i.next)>0&&ki(e.prev,e,e.next)>0)}function ki(i,e,t){return(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y)}function wf(i,e){return i.x===e.x&&i.y===e.y}function CL(i,e,t,n){const r=Om(ki(i,e,t)),s=Om(ki(i,e,n)),o=Om(ki(t,n,i)),a=Om(ki(t,n,e));return!!(r!==s&&o!==a||r===0&&Um(i,t,e)||s===0&&Um(i,n,e)||o===0&&Um(t,i,n)||a===0&&Um(t,e,n))}function Um(i,e,t){return e.x<=Math.max(i.x,t.x)&&e.x>=Math.min(i.x,t.x)&&e.y<=Math.max(i.y,t.y)&&e.y>=Math.min(i.y,t.y)}
44function Om(i){return i>0?1:i<0?-1:0}function tk(i,e){let t=i;do{if(t.i!==i.i&&t.next.i!==i.i&&t.i!==e.i&&t.next.i!==e.i&&CL(t,t.next,i,e))return!0;t=t.next}while(t!==i);return!1}function ZA(i,e){return ki(i.prev,i,i.next)<0?ki(i,e,i.next)>=0&&ki(i,i.prev,e)>=0:ki(i,e,i.prev)<0||ki(i,i.next,e)<0}function nk(i,e){let t=i,n=!1;const r=(i.x+e.x)/2,s=(i.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==i);return n}function PL(i,e){const t=K2(i.i,i.x,i.y),n=K2(e.i,e.x,e.y),r=i.next,s=e.prev;return i.next=e,e.prev=i,t.next=r,r.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function $3(i,e,t,n){const r=K2(i,e,t);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function KA(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function K2(i,e,t){return{i,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function ik(i,e,t,n){let r=0;for(let s=e,o=t-n;s<t;s+=n)r+=(i[o]-i[s])*(i[s+1]+i[o+1]),o=s;return r}let rk=class{static triangulate(e,t,n=2){return V9(e,t,n)}},rA=class LL{static area(e){const t=e.length;let n=0;for(let r=t-1,s=0;s<t;r=s++)n+=e[r].x*e[s].y-e[s].x*e[r].y;return n*.5}static isClockWise(e){return LL.area(e)<0}static triangulateShape(e,t){const n=[],r=[],s=[];j3(e),X3(n,e);let o=e.length;t.forEach(j3);for(let l=0;l<t.length;l++)r.push(o),o+=t[l].length,X3(n,t[l]);const a=rk.triangulate(n,r);for(let l=0;l<a.length;l+=3)s.push(a.slice(l,l+3));return s}};function j3(i){const e=i.length;e>2&&i[e-1].equals(i[0])&&i.pop()}function X3(i,e){for(let t=0;t<e.length;t++)i.push(e[t].x),i.push(e[t].y)}let sk=class NL extends vi{constructor(e=new u_([new at(.5,.5),new at(-.5,.5),new at(-.5,-.5),new at(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,r=[],s=[];for(let a=0,l=e.length;a<l;a++){const c=e[a];o(c)}this.setAttribute("position",new Gn(r,3)),this.setAttribute("uv",new Gn(s,2)),this.computeVertexNormals();function o(a){const l=[],c=t.curveSegments!==void 0?t.curveSegments:12,u=t.steps!==void 0?t.steps:1,p=t.depth!==void 0?t.depth:1;let m=t.bevelEnabled!==void 0?t.bevelEnabled:!0,g=t.bevelThickness!==void 0?t.bevelThickness:.2,v=t.bevelSize!==void 0?t.bevelSize:g-.1,b=t.bevelOffset!==void 0?t.bevelOffset:0,M=t.bevelSegments!==void 0?t.bevelSegments:3;const x=t.extrudePath,w=t.UVGenerator!==void 0?t.UVGenerator:ok;let R,C=!1,N,D,P,O;x&&(R=x.getSpacedPoints(u),C=!0,m=!1,N=x.computeFrenetFrames(u,!1),D=new re,P=new re,O=new re),m||(M=0,g=0,v=0,b=0);const I=a.extractPoints(c);let F=I.shape;const k=I.holes;if(!rA.isClockWise(F)){F=F.reverse();for(let Z=0,We=k.length;Z<We;Z++){const Pe=k[Z];rA.isClockWise(Pe)&&(k[Z]=Pe.reverse())}}function W(Z){const Pe=10000000000000001e-36;let Qe=Z[0];for(let Oe=1;Oe<=Z.length;Oe++){const vt=Oe%Z.length,ot=Z[vt],q=ot.x-Qe.x,U=ot.y-Qe.y,ue=q*q+U*U,Ae=Math.max(Math.abs(ot.x),Math.abs(ot.y),Math.abs(Qe.x),Math.abs(Qe.y)),Be=Pe*Ae*Ae;if(ue<=Be){Z.splice(vt,1),Oe--;continue}Qe=ot}}W(F),k.forEach(W);const Q=k.length,J=F;for(let Z=0;Z<Q;Z++){const We=k[Z];F=F.concat(We)}function H(Z,We,Pe){return We||console.error("THREE.ExtrudeGeometry: vec does not exist"),Z.clone().addScaledVector(We,Pe)}const $=F.length;function K(Z,We,Pe){let Qe,Oe,vt;const ot=Z.x-We.x,q=Z.y-We.y,U=Pe.x-Z.x,ue=Pe.y-Z.y,Ae=ot*ot+q*q,Be=ot*ue-q*U;if(Math.abs(Be)>Number.EPSILON){const we=Math.sqrt(Ae),pe=Math.sqrt(U*U+ue*ue),qe=We.x-q/we,Ve=We.y+ot/we,st=Pe.x-ue/pe,Ie=Pe.y+U/pe,nt=((st-qe)*ue-(Ie-Ve)*U)/(ot*ue-q*U);Qe=qe+ot*nt-Z.x,Oe=Ve+q*nt-Z.y;const ft=Qe*Qe+Oe*Oe;if(ft<=2)return new at(Qe,Oe);vt=Math.sqrt(ft/2)}else{let we=!1;ot>Number.EPSILON?U>Number.EPSILON&&(we=!0):ot<-Number.EPSILON?U<-Number.EPSILON&&(we=!0):Math.sign(q)===Math.sign(ue)&&(we=!0),we?(Qe=-q,Oe=ot,vt=Math.sqrt(Ae)):(Qe=ot,Oe=q,vt=Math.sqrt(Ae/2))}return new at(Qe/vt,Oe/vt)}const he=[];for(let Z=0,We=J.length,Pe=We-1,Qe=Z+1;Z<We;Z++,Pe++,Qe++)Pe===We&&(Pe=0),Qe===We&&(Qe=0),he[Z]=K(J[Z],J[Pe],J[Qe]);const ie=[];let de,Ce=he.concat();for(let Z=0,We=Q;Z<We;Z++){const Pe=k[Z];de=[];for(let Qe=0,Oe=Pe.length,vt=Oe-1,ot=Qe+1;Qe<Oe;Qe++,vt++,ot++)vt===Oe&&(vt=0),ot===Oe&&(ot=0),de[Qe]=K(Pe[Qe],Pe[vt],Pe[ot]);ie.push(de),Ce=Ce.concat(de)}let Fe;if(M===0)Fe=rA.triangulateShape(J,k);else{const Z=[],We=[];for(let Pe=0;Pe<M;Pe++){const Qe=Pe/M,Oe=g*Math.cos(Qe*Math.PI/2),vt=v*Math.sin(Qe*Math.PI/2)+b;for(let ot=0,q=J.length;ot<q;ot++){const U=H(J[ot],he[ot],vt);Je(U.x,U.y,-Oe),Qe===0&&Z.push(U)}for(let ot=0,q=Q;ot<q;ot++){const U=k[ot];de=ie[ot];const ue=[];for(let Ae=0,Be=U.length;Ae<Be;Ae++){const we=H(U[Ae],de[Ae],vt);Je(we.x,we.y,-Oe),Qe===0&&ue.push(we)}Qe===0&&We.push(ue)}}Fe=rA.triangulateShape(Z,We)}const ge=Fe.length,Ge=v+b;for(let Z=0;Z<$;Z++){const We=m?H(F[Z],Ce[Z],Ge):F[Z];C?(P.copy(N.normals[0]).multiplyScalar(We.x),D.copy(N.binormals[0]).multiplyScalar(We.y),O.copy(R[0]).add(P).add(D),Je(O.x,O.y,O.z)):Je(We.x,We.y,0)}for(let Z=1;Z<=u;Z++)for(let We=0;We<$;We++){const Pe=m?H(F[We],Ce[We],Ge):F[We];C?(P.copy(N.normals[Z]).multiplyScalar(Pe.x),D.copy(N.binormals[Z]).multiplyScalar(Pe.y),O.copy(R[Z]).add(P).add(D),Je(O.x,O.y,O.z)):Je(Pe.x,Pe.y,p/u*Z)}for(let Z=M-1;Z>=0;Z--){const We=Z/M,Pe=g*Math.cos(We*Math.PI/2),Qe=v*Math.sin(We*Math.PI/2)+b;for(let Oe=0,vt=J.length;Oe<vt;Oe++){const ot=H(J[Oe],he[Oe],Qe);Je(ot.x,ot.y,p+Pe)}for(let Oe=0,vt=k.length;Oe<vt;Oe++){const ot=k[Oe];de=ie[Oe];for(let q=0,U=ot.length;q<U;q++){const ue=H(ot[q],de[q],Qe);C?Je(ue.x,ue.y+R[u-1].y,R[u-1].x+Pe):Je(ue.x,ue.y,p+Pe)}}}Me(),Ye();function Me(){const Z=r.length/3;if(m){let We=0,Pe=$*We;
vendor: 34,804 bytes, line 44
44for(let Qe=0;Qe<ge;Qe++){const Oe=Fe[Qe];Ke(Oe[2]+Pe,Oe[1]+Pe,Oe[0]+Pe)}We=u+M*2,Pe=$*We;for(let Qe=0;Qe<ge;Qe++){const Oe=Fe[Qe];Ke(Oe[0]+Pe,Oe[1]+Pe,Oe[2]+Pe)}}else{for(let We=0;We<ge;We++){const Pe=Fe[We];Ke(Pe[2],Pe[1],Pe[0])}for(let We=0;We<ge;We++){const Pe=Fe[We];Ke(Pe[0]+$*u,Pe[1]+$*u,Pe[2]+$*u)}}n.addGroup(Z,r.length/3-Z,0)}function Ye(){const Z=r.length/3;let We=0;ct(J,We),We+=J.length;for(let Pe=0,Qe=k.length;Pe<Qe;Pe++){const Oe=k[Pe];ct(Oe,We),We+=Oe.length}n.addGroup(Z,r.length/3-Z,1)}function ct(Z,We){let Pe=Z.length;for(;--Pe>=0;){const Qe=Pe;let Oe=Pe-1;Oe<0&&(Oe=Z.length-1);for(let vt=0,ot=u+M*2;vt<ot;vt++){const q=$*vt,U=$*(vt+1),ue=We+Qe+q,Ae=We+Oe+q,Be=We+Oe+U,we=We+Qe+U;Rt(ue,Ae,Be,we)}}}function Je(Z,We,Pe){l.push(Z),l.push(We),l.push(Pe)}function Ke(Z,We,Pe){Ue(Z),Ue(We),Ue(Pe);const Qe=r.length/3,Oe=w.generateTopUV(n,r,Qe-3,Qe-2,Qe-1);Xe(Oe[0]),Xe(Oe[1]),Xe(Oe[2])}function Rt(Z,We,Pe,Qe){Ue(Z),Ue(We),Ue(Qe),Ue(We),Ue(Pe),Ue(Qe);const Oe=r.length/3,vt=w.generateSideWallUV(n,r,Oe-6,Oe-3,Oe-2,Oe-1);Xe(vt[0]),Xe(vt[1]),Xe(vt[3]),Xe(vt[1]),Xe(vt[2]),Xe(vt[3])}function Ue(Z){r.push(l[Z*3+0]),r.push(l[Z*3+1]),r.push(l[Z*3+2])}function Xe(Z){s.push(Z.x),s.push(Z.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return ak(t,n,e)}static fromJSON(e,t){const n=[];for(let s=0,o=e.shapes.length;s<o;s++){const a=t[e.shapes[s]];n.push(a)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new G_[r.type]().fromJSON(r)),new NL(n,e.options)}};const ok={generateTopUV:function(i,e,t,n,r){const s=e[t*3],o=e[t*3+1],a=e[n*3],l=e[n*3+1],c=e[r*3],u=e[r*3+1];return[new at(s,o),new at(a,l),new at(c,u)]},generateSideWallUV:function(i,e,t,n,r,s){const o=e[t*3],a=e[t*3+1],l=e[t*3+2],c=e[n*3],u=e[n*3+1],p=e[n*3+2],m=e[r*3],g=e[r*3+1],v=e[r*3+2],b=e[s*3],M=e[s*3+1],x=e[s*3+2];return Math.abs(a-u)<Math.abs(o-c)?[new at(o,1-l),new at(c,1-p),new at(m,1-v),new at(b,1-x)]:[new at(a,1-l),new at(u,1-p),new at(g,1-v),new at(M,1-x)]}};function ak(i,e,t){if(t.shapes=[],Array.isArray(i))for(let n=0,r=i.length;n<r;n++){const s=i[n];t.shapes.push(s.uuid)}else t.shapes.push(i.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}let QS=class DL extends vi{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const s=e/2,o=t/2,a=Math.floor(n),l=Math.floor(r),c=a+1,u=l+1,p=e/a,m=t/l,g=[],v=[],b=[],M=[];for(let x=0;x<u;x++){const w=x*m-o;for(let R=0;R<c;R++){const C=R*p-s;v.push(C,-w,0),b.push(0,0,1),M.push(R/a),M.push(1-x/l)}}for(let x=0;x<l;x++)for(let w=0;w<a;w++){const R=w+c*x,C=w+c*(x+1),N=w+1+c*(x+1),D=w+1+c*x;g.push(R,C,D),g.push(C,N,D)}this.setIndex(g),this.setAttribute("position",new Gn(v,3)),this.setAttribute("normal",new Gn(b,3)),this.setAttribute("uv",new Gn(M,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new DL(e.width,e.height,e.widthSegments,e.heightSegments)}};class sl extends vi{constructor(e=1,t=32,n=16,r=0,s=Math.PI*2,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:s,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const l=Math.min(o+a,Math.PI);let c=0;const u=[],p=new re,m=new re,g=[],v=[],b=[],M=[];for(let x=0;x<=n;x++){const w=[],R=x/n;let C=0;x===0&&o===0?C=.5/t:x===n&&l===Math.PI&&(C=-.5/t);for(let N=0;N<=t;N++){const D=N/t;p.x=-e*Math.cos(r+D*s)*Math.sin(o+R*a),p.y=e*Math.cos(o+R*a),p.z=e*Math.sin(r+D*s)*Math.sin(o+R*a),v.push(p.x,p.y,p.z),m.copy(p).normalize(),b.push(m.x,m.y,m.z),M.push(D+C,1-R),w.push(c++)}u.push(w)}for(let x=0;x<n;x++)for(let w=0;w<t;w++){const R=u[x][w+1],C=u[x][w],N=u[x+1][w],D=u[x+1][w+1];(x!==0||o>0)&&g.push(R,C,D),(x!==n-1||l<Math.PI)&&g.push(C,N,D)}this.setIndex(g),this.setAttribute("position",new Gn(v,3)),this.setAttribute("normal",new Gn(b,3)),this.setAttribute("uv",new Gn(M,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new sl(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class ZS extends vi{constructor(e=new wL(new re(-1,-1,0),new re(-1,1,0),new re(1,1,0)),t=64,n=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const a=new re,l=new re,c=new at;let u=new re;const p=[],m=[],g=[],v=[];b(),this.setIndex(v),this.setAttribute("position",new Gn(p,3)),this.setAttribute("normal",new Gn(m,3)),this.setAttribute("uv",new Gn(g,2));function b(){for(let R=0;R<t;R++)M(R);M(s===!1?t:0),w(),x()}function M(R){u=e.getPointAt(R/t,u);const C=o.normals[R],N=o.binormals[R];for(let D=0;D<=r;D++){const P=D/r*Math.PI*2,O=Math.sin(P),I=-Math.cos(P);l.x=I*C.x+O*N.x,l.y=I*C.y+O*N.y,l.z=I*C.z+O*N.z,l.normalize(),m.push(l.x,l.y,l.z),a.x=u.x+n*l.x,a.y=u.y+n*l.y,a.z=u.z+n*l.z,p.push(a.x,a.y,a.z)}}function x(){for(let R=1;R<=t;R++)for(let C=1;C<=r;C++){const N=(r+1)*(R-1)+(C-1),D=(r+1)*R+(C-1),P=(r+1)*R+C,O=(r+1)*(R-1)+C;v.push(N,D,O),v.push(D,P,O)}}function w(){for(let R=0;R<=t;R++)for(let C=0;C<=r;C++)c.x=R/t,c.y=C/r,g.push(c.x,c.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new ZS(new G_[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class lk extends vi{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,r=new re,s=new re;if(e.index!==null){const o=e.attributes.position,a=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:a.count,materialIndex:0}]);for(let c=0,u=l.length;c<u;++c){const p=l[c],m=p.start,g=p.count;for(let v=m,b=m+g;v<b;v+=3)for(let M=0;M<3;M++){const x=a.getX(v+M),w=a.getX(v+(M+1)%3);r.fromBufferAttribute(o,x),s.fromBufferAttribute(o,w),Y3(r,s,n)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}}else{const o=e.attributes.position;for(let a=0,l=o.count/3;a<l;a++)for(let c=0;c<3;c++){const u=3*a+c,p=3*a+(c+1)%3;r.fromBufferAttribute(o,u),s.fromBufferAttribute(o,p),Y3(r,s,n)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new Gn(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function Y3(i,e,t){const n=`${i.x},${i.y},${i.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${i.x},${i.y},${i.z}`;return t.has(n)===!0||t.has(r)===!0?!1:(t.add(n),t.add(r),!0)}let ck=class extends cs{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new qt(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}},IL=class extends cs{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new qt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new qt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=kl,this.normalScale=new at(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Es,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},uk=class extends IL{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new at(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return wn(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new qt(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new qt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new qt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}},BL=class extends cs{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new qt(16777215),this.specular=new qt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new qt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=kl,this.normalScale=new at(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Es,this.combine=E0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},hk=class extends cs{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new qt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new qt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=kl,this.normalScale=new at(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},dk=class extends cs{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=kl,this.normalScale=new at(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}},Wl=class extends cs{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new qt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new qt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=kl,this.normalScale=new at(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Es,this.combine=E0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},fk=class extends cs{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=SO,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},pk=class extends cs{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}},Ak=class extends cs{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new qt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=kl,this.normalScale=new at(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}},mk=class extends $f{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}};const Q3={enabled:!1,files:{},add:function(i,e){this.enabled!==!1&&(this.files[i]=e)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};let gk=class{constructor(e,t,n){const r=this;let s=!1,o=0,a=0,l;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(u){a++,s===!1&&r.onStart!==void 0&&r.onStart(u,o,a),s=!0},this.itemEnd=function(u){o++,r.onProgress!==void 0&&r.onProgress(u,o,a),o===a&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(u){r.onError!==void 0&&r.onError(u)},this.resolveURL=function(u){return l?l(u):u},this.setURLModifier=function(u){return l=u,this},this.addHandler=function(u,p){return c.push(u,p),this},this.removeHandler=function(u){const p=c.indexOf(u);return p!==-1&&c.splice(p,2),this},this.getHandler=function(u){for(let p=0,m=c.length;p<m;p+=2){const g=c[p],v=c[p+1];if(g.global&&(g.lastIndex=0),g.test(u))return v}return null}}};const _k=new gk;let KS=class{constructor(e){this.manager=e!==void 0?e:_k,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(r,s){n.load(e,r,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}};KS.DEFAULT_MATERIAL_NAME="__DEFAULT";let vk=class extends KS{constructor(e){super(e)}load(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Q3.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a=YA("img");function l(){u(),Q3.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(p){u(),r&&r(p),s.manager.itemError(e),s.manager.itemEnd(e)}function u(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(e),a.src=e,a}},JS=class extends KS{constructor(e){super(e)}load(e,t,n,r){const s=new Cs,o=new vk(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){s.image=a,s.needsUpdate=!0,t!==void 0&&t(s)},n,r),s}},dh=class extends ir{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new qt(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}},yk=class extends dh{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(ir.DEFAULT_UP),this.updateMatrix(),this.groundColor=new qt(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}};const Ny=new un,Z3=new re,K3=new re;let eM=class{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new at(512,512),this.mapType=Gi,this.map=null,this.mapPass=null,this.matrix=new un,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Wf,this._frameExtents=new at(1,1),this._viewportCount=1,this._viewports=[new Jt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;Z3.setFromMatrixPosition(e.matrixWorld),t.position.copy(Z3),K3.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(K3),t.updateMatrixWorld(),Ny.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ny),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Ny)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}},xk=class extends eM{constructor(){super(new Br(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=sh*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(n!==t.fov||r!==t.aspect||s!==t.far)&&(t.fov=n,t.aspect=r,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}},FL=class extends dh{constructor(e,t,n=0,r=Math.PI/3,s=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(ir.DEFAULT_UP),this.updateMatrix(),this.target=new ir,this.distance=n,this.angle=r,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new xk}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}};const J3=new un,Sp=new re,Dy=new re;let bk=class extends eM{constructor(){super(new Br(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new at(4,2),this._viewportCount=6,this._viewports=[new Jt(2,1,1,1),new Jt(0,1,1,1),new Jt(3,1,1,1),new Jt(1,1,1,1),new Jt(3,0,1,1),new Jt(1,0,1,1)],this._cubeDirections=[new re(1,0,0),new re(-1,0,0),new re(0,0,1),new re(0,0,-1),new re(0,1,0),new re(0,-1,0)],this._cubeUps=[new re(0,1,0),new re(0,1,0),new re(0,1,0),new re(0,1,0),new re(0,0,1),new re(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,r=this.matrix,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),Sp.setFromMatrixPosition(e.matrixWorld),n.position.copy(Sp),Dy.copy(n.position),Dy.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(Dy),n.updateMatrixWorld(),r.makeTranslation(-Sp.x,-Sp.y,-Sp.z),J3.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(J3)}},Sk=class extends dh{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new bk}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}},N0=class extends L0{constructor(e=-1,t=1,n=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,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=e,this.view.fullHeight=t,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 e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=n-e,o=n+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}},Mk=class extends eM{constructor(){super(new N0(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},UL=class extends dh{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(ir.DEFAULT_UP),this.updateMatrix(),this.target=new ir,this.shadow=new Mk}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},OL=class extends dh{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}},wk=class extends dh{constructor(e,t,n=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}},Tk=class{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new re)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*n),t.addScaledVector(o[4],1.092548*(n*r)),t.addScaledVector(o[5],1.092548*(r*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(n*s)),t.addScaledVector(o[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){const n=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*r),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*n),t.addScaledVector(o[4],2*.429043*n*r),t.addScaledVector(o[5],2*.429043*r*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*n*s),t.addScaledVector(o[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const n=e.x,r=e.y,s=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*s,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*n*s,t[8]=.546274*(n*n-r*r)}},Ek=class extends dh{constructor(e=new Tk,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}},Rk=class extends vi{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}},kL=class extends Br{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}};class zL{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=eE(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=eE();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function eE(){return performance.now()}class Ck extends rl{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isRenderTargetArray=!0,this.depth=n,this.texture=new C1(null,e,t,n),this.texture.isRenderTargetTexture=!0}}let q_=class extends WS{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}};const tE=new un;class Pk{constructor(e,t,n=0,r=1/0){this.ray=new P0(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new GS,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: 
vendor: 11,640 bytes, lines 44-107
44Unsupported camera type: "+t.type)}setFromXRController(e){return tE.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(tE),this}intersectObject(e,t=!0,n=[]){return J2(e,this,n,t),n.sort(nE),n}intersectObjects(e,t=!0,n=[]){for(let r=0,s=e.length;r<s;r++)J2(e[r],this,n,t);return n.sort(nE),n}}function nE(i,e){return i.distance-e.distance}function J2(i,e,t,n){let r=!0;if(i.layers.test(e.layers)&&i.raycast(e,t)===!1&&(r=!1),r===!0&&n===!0){const s=i.children;for(let o=0,a=s.length;o<a;o++)J2(s[o],e,t,!0)}}class iE{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=wn(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(wn(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class F1{constructor(e,t,n,r){F1.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,r){const s=this.elements;return s[0]=e,s[2]=t,s[1]=n,s[3]=r,this}}const rE=new re,km=new re;class Lk{constructor(e=new re,t=new re){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){rE.subVectors(e,this.start),km.subVectors(this.end,this.start);const n=km.dot(km);let s=km.dot(rE)/n;return t&&(s=wn(s,0,1)),s}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class Nk{constructor(){this.type="ShapePath",this.color=new qt,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Q2,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,s,o){return this.currentPath.bezierCurveTo(e,t,n,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(x){const w=[];for(let R=0,C=x.length;R<C;R++){const N=x[R],D=new u_;D.curves=N.curves,w.push(D)}return w}function n(x,w){const R=w.length;let C=!1;for(let N=R-1,D=0;D<R;N=D++){let P=w[N],O=w[D],I=O.x-P.x,F=O.y-P.y;if(Math.abs(F)>Number.EPSILON){if(F<0&&(P=w[D],I=-I,O=w[N],F=-F),x.y<P.y||x.y>O.y)continue;if(x.y===P.y){if(x.x===P.x)return!0}else{const k=F*(x.x-P.x)-I*(x.y-P.y);if(k===0)return!0;if(k<0)continue;C=!C}}else{if(x.y!==P.y)continue;if(O.x<=x.x&&x.x<=P.x||P.x<=x.x&&x.x<=O.x)return!0}}return C}const r=rA.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const c=[];if(s.length===1)return a=s[0],l=new u_,l.curves=a.curves,c.push(l),c;let u=!r(s[0].getPoints());u=e?!u:u;const p=[],m=[];let g=[],v=0,b;m[v]=void 0,g[v]=[];for(let x=0,w=s.length;x<w;x++)a=s[x],b=a.getPoints(),o=r(b),o=e?!o:o,o?(!u&&m[v]&&v++,m[v]={s:new u_,p:b},m[v].s.curves=a.curves,u&&v++,g[v]=[]):g[v].push({h:a,p:b[0]});if(!m[0])return t(s);if(m.length>1){let x=!1,w=0;for(let R=0,C=m.length;R<C;R++)p[R]=[];for(let R=0,C=m.length;R<C;R++){const N=g[R];for(let D=0;D<N.length;D++){const P=N[D];let O=!0;for(let I=0;I<m.length;I++)n(P.p,m[I].p)&&(R!==I&&w++,O?(O=!1,p[I].push(P)):x=!0);O&&p[R].push(P)}}w>0&&x===!1&&(g=p)}let M;for(let x=0,w=m.length;x<w;x++){l=m[x].s,c.push(l),M=g[x];for(let R=0,C=M.length;R<C;R++)l.holes.push(M[R].h)}return c}}class tM extends il{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){console.warn("THREE.Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function sE(i,e,t,n){const r=Dk(n);switch(t){case LS:return i*e;case C0:return i*e/r.components*r.byteLength;case Vf:return i*e/r.components*r.byteLength;case Nl:return i*e*2/r.components*r.byteLength;case Gf:return i*e*2/r.components*r.byteLength;case R0:return i*e*3/r.components*r.byteLength;case Yi:return i*e*4/r.components*r.byteLength;case qf:return i*e*4/r.components*r.byteLength;case Hu:case Lc:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case Nc:case Dc:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case GA:case HA:return Math.max(i,16)*Math.max(e,8)/4;case VA:case qA:return Math.max(i,8)*Math.max(e,8)/2;case WA:case af:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case lf:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case cf:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case uf:return Math.floor((i+4)/5)*Math.floor((e+3)/4)*16;case hf:return Math.floor((i+4)/5)*Math.floor((e+4)/5)*16;case df:return Math.floor((i+5)/6)*Math.floor((e+4)/5)*16;case ff:return Math.floor((i+5)/6)*Math.floor((e+5)/6)*16;case pf:return Math.floor((i+7)/8)*Math.floor((e+4)/5)*16;case Af:return Math.floor((i+7)/8)*Math.floor((e+5)/6)*16;case mf:return Math.floor((i+7)/8)*Math.floor((e+7)/8)*16;case gf:return Math.floor((i+9)/10)*Math.floor((e+4)/5)*16;case _f:return Math.floor((i+9)/10)*Math.floor((e+5)/6)*16;case vf:return Math.floor((i+9)/10)*Math.floor((e+7)/8)*16;case yf:return Math.floor((i+9)/10)*Math.floor((e+9)/10)*16;case xf:return Math.floor((i+11)/12)*Math.floor((e+9)/10)*16;case bf:return Math.floor((i+11)/12)*Math.floor((e+11)/12)*16;case Wu:case W2:case $2:return Math.ceil(i/4)*Math.ceil(e/4)*16;case NS:case $A:return Math.ceil(i/4)*Math.ceil(e/4)*8;case jA:case XA:return Math.ceil(i/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function Dk(i){switch(i){case Gi:case Gu:return{byteLength:1,components:1};case la:case qu:case dr:return{byteLength:2,components:1};case M1:case w1:return{byteLength:2,components:4};case mi:case Ir:case er:return{byteLength:4,components:1};case T1:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${i}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:zf}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=zf);/**
45 * @license
46 * Copyright 2010-2025 Three.js Authors
47 * SPDX-License-Identifier: MIT
48 */function VL(){let i=null,e=!1,t=null,n=null;function r(s,o){t(s,o),n=i.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(n=i.requestAnimationFrame(r),e=!0)},stop:function(){i.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){i=s}}}function Ik(i){const e=new WeakMap;function t(a,l){const c=a.array,u=a.usage,p=c.byteLength,m=i.createBuffer();i.bindBuffer(l,m),i.bufferData(l,c,u),a.onUploadCallback();let g;if(c instanceof Float32Array)g=i.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?g=i.HALF_FLOAT:g=i.UNSIGNED_SHORT;else if(c instanceof Int16Array)g=i.SHORT;else if(c instanceof Uint32Array)g=i.UNSIGNED_INT;else if(c instanceof Int32Array)g=i.INT;else if(c instanceof Int8Array)g=i.BYTE;else if(c instanceof Uint8Array)g=i.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)g=i.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:m,type:g,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:p}}function n(a,l,c){const u=l.array,p=l.updateRanges;if(i.bindBuffer(c,a),p.length===0)i.bufferSubData(c,0,u);else{p.sort((g,v)=>g.start-v.start);let m=0;for(let g=1;g<p.length;g++){const v=p[m],b=p[g];b.start<=v.start+v.count+1?v.count=Math.max(v.count,b.start+b.count-v.start):(++m,p[m]=b)}p.length=m+1;for(let g=0,v=p.length;g<v;g++){const b=p[g];i.bufferSubData(c,b.start*u.BYTES_PER_ELEMENT,u,b.start,b.count)}l.clearUpdateRanges()}l.onUploadCallback()}function r(a){return a.isInterleavedBufferAttribute&&(a=a.data),e.get(a)}function s(a){a.isInterleavedBufferAttribute&&(a=a.data);const l=e.get(a);l&&(i.deleteBuffer(l.buffer),e.delete(a))}function o(a,l){if(a.isInterleavedBufferAttribute&&(a=a.data),a.isGLBufferAttribute){const u=e.get(a);(!u||u.version<a.version)&&e.set(a,{buffer:a.buffer,type:a.type,bytesPerElement:a.elementSize,version:a.version});return}const c=e.get(a);if(c===void 0)e.set(a,t(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}}var Bk=`#ifdef USE_ALPHAHASH
49	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
50#endif`,Fk=`#ifdef USE_ALPHAHASH
51	const float ALPHA_HASH_SCALE = 0.05;
52	float hash2D( vec2 value ) {
53		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
54	}
55	float hash3D( vec3 value ) {
56		return hash2D( vec2( hash2D( value.xy ), value.z ) );
57	}
58	float getAlphaHashThreshold( vec3 position ) {
59		float maxDeriv = max(
60			length( dFdx( position.xyz ) ),
61			length( dFdy( position.xyz ) )
62		);
63		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
64		vec2 pixScales = vec2(
65			exp2( floor( log2( pixScale ) ) ),
66			exp2( ceil( log2( pixScale ) ) )
67		);
68		vec2 alpha = vec2(
69			hash3D( floor( pixScales.x * position.xyz ) ),
70			hash3D( floor( pixScales.y * position.xyz ) )
71		);
72		float lerpFactor = fract( log2( pixScale ) );
73		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
74		float a = min( lerpFactor, 1.0 - lerpFactor );
75		vec3 cases = vec3(
76			x * x / ( 2.0 * a * ( 1.0 - a ) ),
77			( x - 0.5 * a ) / ( 1.0 - a ),
78			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
79		);
80		float threshold = ( x < ( 1.0 - a ) )
81			? ( ( x < a ) ? cases.x : cases.y )
82			: cases.z;
83		return clamp( threshold , 1.0e-6, 1.0 );
84	}
85#endif`,Uk=`#ifdef USE_ALPHAMAP
86	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
87#endif`,Ok=`#ifdef USE_ALPHAMAP
88	uniform sampler2D alphaMap;
89#endif`,kk=`#ifdef USE_ALPHATEST
90	#ifdef ALPHA_TO_COVERAGE
91	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
92	if ( diffuseColor.a == 0.0 ) discard;
93	#else
94	if ( diffuseColor.a < alphaTest ) discard;
95	#endif
96#endif`,zk=`#ifdef USE_ALPHATEST
97	uniform float alphaTest;
98#endif`,Vk=`#ifdef USE_AOMAP
99	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
100	reflectedLight.indirectDiffuse *= ambientOcclusion;
101	#if defined( USE_CLEARCOAT ) 
102		clearcoatSpecularIndirect *= ambientOcclusion;
103	#endif
104	#if defined( USE_SHEEN ) 
105		sheenSpecularIndirect *= ambientOcclusion;
106	#endif
107	#if defined( USE_ENVMAP ) && defined( STANDARD )
108		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
109		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
110	#endif
111#endif`,Gk=`#ifdef USE_AOMAP
112	uniform sampler2D aoMap;
113	uniform float aoMapIntensity;
114#endif`,qk=`#ifdef USE_BATCHING
115	#if ! defined( GL_ANGLE_multi_draw )
116	#define gl_DrawID _gl_DrawID
117	uniform int _gl_DrawID;
118	#endif
119	uniform highp sampler2D batchingTexture;
120	uniform highp usampler2D batchingIdTexture;
121	mat4 getBatchingMatrix( const in float i ) {
122		int size = textureSize( batchingTexture, 0 ).x;
123		int j = int( i ) * 4;
124		int x = j % size;
125		int y = j / size;
126		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
127		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
128		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
129		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
130		return mat4( v1, v2, v3, v4 );
131	}
132	float getIndirectIndex( const in int i ) {
133		int size = textureSize( batchingIdTexture, 0 ).x;
134		int x = i % size;
135		int y = i / size;
136		return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
137	}
138#endif
139#ifdef USE_BATCHING_COLOR
140	uniform sampler2D batchingColorTexture;
141	vec3 getBatchingColor( const in float i ) {
142		int size = textureSize( batchingColorTexture, 0 ).x;
143		int j = int( i );
144		int x = j % size;
145		int y = j / size;
146		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;
147	}
148#endif`,Hk=`#ifdef USE_BATCHING
149	mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
150#endif`,Wk=`vec3 transformed = vec3( position );
151#ifdef USE_ALPHAHASH
152	vPosition = vec3( position );
153#endif`,$k=`vec3 objectNormal = vec3( normal );
154#ifdef USE_TANGENT
155	vec3 objectTangent = vec3( tangent.xyz );
156#endif`,jk=`float G_BlinnPhong_Implicit( ) {
157	return 0.25;
158}
159float D_BlinnPhong( const in float shininess, const in float dotNH ) {
160	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
161}
162vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
163	vec3 halfDir = normalize( lightDir + viewDir );
164	float dotNH = saturate( dot( normal, halfDir ) );
165	float dotVH = saturate( dot( viewDir, halfDir ) );
166	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
167	float G = G_BlinnPhong_Implicit( );
168	float D = D_BlinnPhong( shininess, dotNH );
169	return F * ( G * D );
170} // validated`,Xk=`#ifdef USE_IRIDESCENCE
171	const mat3 XYZ_TO_REC709 = mat3(
172		 3.2404542, -0.9692660,  0.0556434,
173		-1.5371385,  1.8760108, -0.2040259,
174		-0.4985314,  0.0415560,  1.0572252
175	);
176	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
177		vec3 sqrtF0 = sqrt( fresnel0 );
178		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
179	}
180	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
181		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
182	}
183	float IorToFresnel0( float transmittedIor, float incidentIor ) {
184		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
185	}
186	vec3 evalSensitivity( float OPD, vec3 shift ) {
187		float phase = 2.0 * PI * OPD * 1.0e-9;
188		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
189		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
190		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
191		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
192		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 ) );
193		xyz /= 1.0685e-7;
194		vec3 rgb = XYZ_TO_REC709 * xyz;
195		return rgb;
196	}
197	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
198		vec3 I;
199		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
200		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
201		float cosTheta2Sq = 1.0 - sinTheta2Sq;
202		if ( cosTheta2Sq < 0.0 ) {
203			return vec3( 1.0 );
204		}
205		float cosTheta2 = sqrt( cosTheta2Sq );
206		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
207		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
208		float T121 = 1.0 - R12;
209		float phi12 = 0.0;
210		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
211		float phi21 = PI - phi12;
212		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
213		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
214		vec3 phi23 = vec3( 0.0 );
215		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
216		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
217		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
218		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
219		vec3 phi = vec3( phi21 ) + phi23;
220		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
221		vec3 r123 = sqrt( R123 );
222		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
223		vec3 C0 = R12 + Rs;
224		I = C0;
225		vec3 Cm = Rs - T121;
226		for ( int m = 1; m <= 2; ++ m ) {
227			Cm *= r123;
228			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
229			I += Cm * Sm;
230		}
231		return max( I, vec3( 0.0 ) );
232	}
233#endif`,Yk=`#ifdef USE_BUMPMAP
234	uniform sampler2D bumpMap;
235	uniform float bumpScale;
236	vec2 dHdxy_fwd() {
237		vec2 dSTdx = dFdx( vBumpMapUv );
238		vec2 dSTdy = dFdy( vBumpMapUv );
239		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
240		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
241		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
242		return vec2( dBx, dBy );
243	}
244	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
245		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
246		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
247		vec3 vN = surf_norm;
248		vec3 R1 = cross( vSigmaY, vN );
249		vec3 R2 = cross( vN, vSigmaX );
250		float fDet = dot( vSigmaX, R1 ) * faceDirection;
251		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
252		return normalize( abs( fDet ) * surf_norm - vGrad );
253	}
254#endif`,Qk=`#if NUM_CLIPPING_PLANES > 0
255	vec4 plane;
256	#ifdef ALPHA_TO_COVERAGE
257		float distanceToPlane, distanceGradient;
258		float clipOpacity = 1.0;
259		#pragma unroll_loop_start
260		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
261			plane = clippingPlanes[ i ];
262			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
263			distanceGradient = fwidth( distanceToPlane ) / 2.0;
264			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
265			if ( clipOpacity == 0.0 ) discard;
266		}
267		#pragma unroll_loop_end
268		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
269			float unionClipOpacity = 1.0;
270			#pragma unroll_loop_start
271			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
272				plane = clippingPlanes[ i ];
273				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
274				distanceGradient = fwidth( distanceToPlane ) / 2.0;
275				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
276			}
277			#pragma unroll_loop_end
278			clipOpacity *= 1.0 - unionClipOpacity;
279		#endif
280		diffuseColor.a *= clipOpacity;
281		if ( diffuseColor.a == 0.0 ) discard;
282	#else
283		#pragma unroll_loop_start
284		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
285			plane = clippingPlanes[ i ];
286			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
287		}
288		#pragma unroll_loop_end
289		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
290			bool clipped = true;
291			#pragma unroll_loop_start
292			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
293				plane = clippingPlanes[ i ];
294				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
295			}
296			#pragma unroll_loop_end
297			if ( clipped ) discard;
298		#endif
299	#endif
300#endif`,Zk=`#if NUM_CLIPPING_PLANES > 0
301	varying vec3 vClipPosition;
302	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
303#endif`,Kk=`#if NUM_CLIPPING_PLANES > 0
304	varying vec3 vClipPosition;
305#endif`,Jk=`#if NUM_CLIPPING_PLANES > 0
306	vClipPosition = - mvPosition.xyz;
307#endif`,ez=`#if defined( USE_COLOR_ALPHA )
308	diffuseColor *= vColor;
309#elif defined( USE_COLOR )
310	diffuseColor.rgb *= vColor;
311#endif`,tz=`#if defined( USE_COLOR_ALPHA )
312	varying vec4 vColor;
313#elif defined( USE_COLOR )
314	varying vec3 vColor;
315#endif`,nz=`#if defined( USE_COLOR_ALPHA )
316	varying vec4 vColor;
317#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
318	varying vec3 vColor;
319#endif`,iz=`#if defined( USE_COLOR_ALPHA )
320	vColor = vec4( 1.0 );
321#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
322	vColor = vec3( 1.0 );
323#endif
324#ifdef USE_COLOR
325	vColor *= color;
326#endif
327#ifdef USE_INSTANCING_COLOR
328	vColor.xyz *= instanceColor.xyz;
329#endif
330#ifdef USE_BATCHING_COLOR
331	vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );
332	vColor.xyz *= batchingColor.xyz;
333#endif`,rz=`#define PI 3.141592653589793
334#define PI2 6.283185307179586
335#define PI_HALF 1.5707963267948966
336#define RECIPROCAL_PI 0.3183098861837907
337#define RECIPROCAL_PI2 0.15915494309189535
338#define EPSILON 1e-6
339#ifndef saturate
340#define saturate( a ) clamp( a, 0.0, 1.0 )
341#endif
342#define whiteComplement( a ) ( 1.0 - saturate( a ) )
343float pow2( const in float x ) { return x*x; }
344vec3 pow2( const in vec3 x ) { return x*x; }
345float pow3( const in float x ) { return x*x*x; }
346float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
347float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
348float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
349highp float rand( const in vec2 uv ) {
350	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
351	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
352	return fract( sin( sn ) * c );
353}
354#ifdef HIGH_PRECISION
355	float precisionSafeLength( vec3 v ) { return length( v ); }
356#else
357	float precisionSafeLength( vec3 v ) {
358		float maxComponent = max3( abs( v ) );
359		return length( v / maxComponent ) * maxComponent;
360	}
361#endif
362struct IncidentLight {
363	vec3 color;
364	vec3 direction;
365	bool visible;
366};
367struct ReflectedLight {
368	vec3 directDiffuse;
369	vec3 directSpecular;
370	vec3 indirectDiffuse;
371	vec3 indirectSpecular;
372};
373#ifdef USE_ALPHAHASH
374	varying vec3 vPosition;
375#endif
376vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
377	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
378}
379vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
380	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
381}
382mat3 transposeMat3( const in mat3 m ) {
383	mat3 tmp;
384	tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
385	tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
386	tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
387	return tmp;
388}
389bool isPerspectiveMatrix( mat4 m ) {
390	return m[ 2 ][ 3 ] == - 1.0;
391}
392vec2 equirectUv( in vec3 dir ) {
393	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
394	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
395	return vec2( u, v );
396}
397vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
398	return RECIPROCAL_PI * diffuseColor;
399}
400vec3 F_Schlick( const in vec3 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}
404float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
405	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
406	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
407} // validated`,sz=`#ifdef ENVMAP_TYPE_CUBE_UV
408	#define cubeUV_minMipLevel 4.0
409	#define cubeUV_minTileSize 16.0
410	float getFace( vec3 direction ) {
411		vec3 absDirection = abs( direction );
412		float face = - 1.0;
413		if ( absDirection.x > absDirection.z ) {
414			if ( absDirection.x > absDirection.y )
415				face = direction.x > 0.0 ? 0.0 : 3.0;
416			else
417				face = direction.y > 0.0 ? 1.0 : 4.0;
418		} else {
419			if ( absDirection.z > absDirection.y )
420				face = direction.z > 0.0 ? 2.0 : 5.0;
421			else
422				face = direction.y > 0.0 ? 1.0 : 4.0;
423		}
424		return face;
425	}
426	vec2 getUV( vec3 direction, float face ) {
427		vec2 uv;
428		if ( face == 0.0 ) {
429			uv = vec2( direction.z, direction.y ) / abs( direction.x );
430		} else if ( face == 1.0 ) {
431			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
432		} else if ( face == 2.0 ) {
433			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
434		} else if ( face == 3.0 ) {
435			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
436		} else if ( face == 4.0 ) {
437			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
438		} else {
439			uv = vec2( direction.x, direction.y ) / abs( direction.z );
440		}
441		return 0.5 * ( uv + 1.0 );
442	}
443	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
444		float face = getFace( direction );
445		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
446		mipInt = max( mipInt, cubeUV_minMipLevel );
447		float faceSize = exp2( mipInt );
448		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
449		if ( face > 2.0 ) {
450			uv.y += faceSize;
451			face -= 3.0;
452		}
453		uv.x += face * faceSize;
454		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
455		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
456		uv.x *= CUBEUV_TEXEL_WIDTH;
457		uv.y *= CUBEUV_TEXEL_HEIGHT;
458		#ifdef texture2DGradEXT
459			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
460		#else
461			return texture2D( envMap, uv ).rgb;
462		#endif
463	}
464	#define cubeUV_r0 1.0
465	#define cubeUV_m0 - 2.0
466	#define cubeUV_r1 0.8
467	#define cubeUV_m1 - 1.0
468	#define cubeUV_r4 0.4
469	#define cubeUV_m4 2.0
470	#define cubeUV_r5 0.305
471	#define cubeUV_m5 3.0
472	#define cubeUV_r6 0.21
473	#define cubeUV_m6 4.0
474	float roughnessToMip( float roughness ) {
475		float mip = 0.0;
476		if ( roughness >= cubeUV_r1 ) {
477			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
478		} else if ( roughness >= cubeUV_r4 ) {
479			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
480		} else if ( roughness >= cubeUV_r5 ) {
481			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
482		} else if ( roughness >= cubeUV_r6 ) {
483			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
484		} else {
485			mip = - 2.0 * log2( 1.16 * roughness );		}
486		return mip;
487	}
488	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
489		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
490		float mipF = fract( mip );
491		float mipInt = floor( mip );
492		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
493		if ( mipF == 0.0 ) {
494			return vec4( color0, 1.0 );
495		} else {
496			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
497			return vec4( mix( color0, color1, mipF ), 1.0 );
498		}
499	}
500#endif`,oz=`vec3 transformedNormal = objectNormal;
501#ifdef USE_TANGENT
502	vec3 transformedTangent = objectTangent;
503#endif
504#ifdef USE_BATCHING
505	mat3 bm = mat3( batchingMatrix );
506	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
507	transformedNormal = bm * transformedNormal;
508	#ifdef USE_TANGENT
509		transformedTangent = bm * transformedTangent;
510	#endif
511#endif
512#ifdef USE_INSTANCING
513	mat3 im = mat3( instanceMatrix );
514	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
515	transformedNormal = im * transformedNormal;
516	#ifdef USE_TANGENT
517		transformedTangent = im * transformedTangent;
518	#endif
519#endif
520transformedNormal = normalMatrix * transformedNormal;
521#ifdef FLIP_SIDED
522	transformedNormal = - transformedNormal;
523#endif
524#ifdef USE_TANGENT
525	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
526	#ifdef FLIP_SIDED
527		transformedTangent = - transformedTangent;
528	#endif
529#endif`,az=`#ifdef USE_DISPLACEMENTMAP
530	uniform sampler2D displacementMap;
531	uniform float displacementScale;
532	uniform float displacementBias;
533#endif`,lz=`#ifdef USE_DISPLACEMENTMAP
534	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
534placementBias );
535#endif`,cz=`#ifdef USE_EMISSIVEMAP
536	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
537	#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
538		emissiveColor = sRGBTransferEOTF( emissiveColor );
539	#endif
540	totalEmissiveRadiance *= emissiveColor.rgb;
541#endif`,uz=`#ifdef USE_EMISSIVEMAP
542	uniform sampler2D emissiveMap;
543#endif`,hz="gl_FragColor = linearToOutputTexel( gl_FragColor );",dz=`vec4 LinearTransferOETF( in vec4 value ) {
544	return value;
545}
546vec4 sRGBTransferEOTF( in vec4 value ) {
547	return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
548}
549vec4 sRGBTransferOETF( in vec4 value ) {
550	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 );
551}`,fz=`#ifdef USE_ENVMAP
552	#ifdef ENV_WORLDPOS
553		vec3 cameraToFrag;
554		if ( isOrthographic ) {
555			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
556		} else {
557			cameraToFrag = normalize( vWorldPosition - cameraPosition );
558		}
559		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
560		#ifdef ENVMAP_MODE_REFLECTION
561			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
562		#else
563			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
564		#endif
565	#else
566		vec3 reflectVec = vReflect;
567	#endif
568	#ifdef ENVMAP_TYPE_CUBE
569		vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
570	#else
571		vec4 envColor = vec4( 0.0 );
572	#endif
573	#ifdef ENVMAP_BLENDING_MULTIPLY
574		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
575	#elif defined( ENVMAP_BLENDING_MIX )
576		outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
577	#elif defined( ENVMAP_BLENDING_ADD )
578		outgoingLight += envColor.xyz * specularStrength * reflectivity;
579	#endif
580#endif`,pz=`#ifdef USE_ENVMAP
581	uniform float envMapIntensity;
582	uniform float flipEnvMap;
583	uniform mat3 envMapRotation;
584	#ifdef ENVMAP_TYPE_CUBE
585		uniform samplerCube envMap;
586	#else
587		uniform sampler2D envMap;
588	#endif
589	
590#endif`,Az=`#ifdef USE_ENVMAP
591	uniform float reflectivity;
592	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
593		#define ENV_WORLDPOS
594	#endif
595	#ifdef ENV_WORLDPOS
596		varying vec3 vWorldPosition;
597		uniform float refractionRatio;
598	#else
599		varying vec3 vReflect;
600	#endif
601#endif`,mz=`#ifdef USE_ENVMAP
602	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
603		#define ENV_WORLDPOS
604	#endif
605	#ifdef ENV_WORLDPOS
606		
607		varying vec3 vWorldPosition;
608	#else
609		varying vec3 vReflect;
610		uniform float refractionRatio;
611	#endif
612#endif`,gz=`#ifdef USE_ENVMAP
613	#ifdef ENV_WORLDPOS
614		vWorldPosition = worldPosition.xyz;
615	#else
616		vec3 cameraToVertex;
617		if ( isOrthographic ) {
618			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
619		} else {
620			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
621		}
622		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
623		#ifdef ENVMAP_MODE_REFLECTION
624			vReflect = reflect( cameraToVertex, worldNormal );
625		#else
626			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
627		#endif
628	#endif
629#endif`,_z=`#ifdef USE_FOG
630	vFogDepth = - mvPosition.z;
631#endif`,vz=`#ifdef USE_FOG
632	varying float vFogDepth;
633#endif`,yz=`#ifdef USE_FOG
634	#ifdef FOG_EXP2
635		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
636	#else
637		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
638	#endif
639	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
640#endif`,xz=`#ifdef USE_FOG
641	uniform vec3 fogColor;
642	varying float vFogDepth;
643	#ifdef FOG_EXP2
644		uniform float fogDensity;
645	#else
646		uniform float fogNear;
647		uniform float fogFar;
648	#endif
649#endif`,bz=`#ifdef USE_GRADIENTMAP
650	uniform sampler2D gradientMap;
651#endif
652vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
653	float dotNL = dot( normal, lightDirection );
654	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
655	#ifdef USE_GRADIENTMAP
656		return vec3( texture2D( gradientMap, coord ).r );
657	#else
658		vec2 fw = fwidth( coord ) * 0.5;
659		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
660	#endif
661}`,Sz=`#ifdef USE_LIGHTMAP
662	uniform sampler2D lightMap;
663	uniform float lightMapIntensity;
664#endif`,Mz=`LambertMaterial material;
665material.diffuseColor = diffuseColor.rgb;
666material.specularStrength = specularStrength;`,wz=`varying vec3 vViewPosition;
667struct LambertMaterial {
668	vec3 diffuseColor;
669	float specularStrength;
670};
671void 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 ) {
672	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
673	vec3 irradiance = dotNL * directLight.color;
674	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
675}
676void 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 ) {
677	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
678}
679#define RE_Direct				RE_Direct_Lambert
680#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,Tz=`uniform bool receiveShadow;
681uniform vec3 ambientLightColor;
682#if defined( USE_LIGHT_PROBES )
683	uniform vec3 lightProbe[ 9 ];
684#endif
685vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
686	float x = normal.x, y = normal.y, z = normal.z;
687	vec3 result = shCoefficients[ 0 ] * 0.886227;
688	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
689	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
690	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
691	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
692	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
693	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
694	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
695	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
696	return result;
697}
698vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
699	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
700	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
701	return irradiance;
702}
703vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
704	vec3 irradiance = ambientLightColor;
705	return irradiance;
706}
707float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
708	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
709	if ( cutoffDistance > 0.0 ) {
710		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
711	}
712	return distanceFalloff;
713}
714float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
715	return smoothstep( coneCosine, penumbraCosine, angleCosine );
716}
717#if NUM_DIR_LIGHTS > 0
718	struct DirectionalLight {
719		vec3 direction;
720		vec3 color;
721	};
722	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
723	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
724		light.color = directionalLight.color;
725		light.direction = directionalLight.direction;
726		light.visible = true;
727	}
728#endif
729#if NUM_POINT_LIGHTS > 0
730	struct PointLight {
731		vec3 position;
732		vec3 color;
733		float distance;
734		float decay;
735	};
736	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
737	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
738		vec3 lVector = pointLight.position - geometryPosition;
739		light.direction = normalize( lVector );
740		float lightDistance = length( lVector );
741		light.color = pointLight.color;
742		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
743		light.visible = ( light.color != vec3( 0.0 ) );
744	}
745#endif
746#if NUM_SPOT_LIGHTS > 0
747	struct SpotLight {
748		vec3 position;
749		vec3 direction;
750		vec3 color;
751		float distance;
752		float decay;
753		float coneCos;
754		float penumbraCos;
755	};
756	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
757	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
758		vec3 lVector = spotLight.position - geometryPosition;
759		light.direction = normalize( lVector );
760		float angleCos = dot( light.direction, spotLight.direction );
761		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
762		if ( spotAttenuation > 0.0 ) {
763			float lightDistance = length( lVector );
764			light.color = spotLight.color * spotAttenuation;
765			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
766			light.visible = ( light.color != vec3( 0.0 ) );
767		} else {
768			light.color = vec3( 0.0 );
769			light.visible = false;
770		}
771	}
772#endif
773#if NUM_RECT_AREA_LIGHTS > 0
774	struct RectAreaLight {
775		vec3 color;
776		vec3 position;
777		vec3 halfWidth;
778		vec3 halfHeight;
779	};
780	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
781	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
782#endif
783#if NUM_HEMI_LIGHTS > 0
784	struct HemisphereLight {
785		vec3 direction;
786		vec3 skyColor;
787		vec3 groundColor;
788	};
789	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
790	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
791		float dotNL = dot( normal, hemiLight.direction );
792		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
793		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
794		return irradiance;
795	}
796#endif`,Ez=`#ifdef USE_ENVMAP
797	vec3 getIBLIrradiance( const in vec3 normal ) {
798		#ifdef ENVMAP_TYPE_CUBE_UV
799			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
800			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
801			return PI * envMapColor.rgb * envMapIntensity;
802		#else
803			return vec3( 0.0 );
804		#endif
805	}
806	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
807		#ifdef ENVMAP_TYPE_CUBE_UV
808			vec3 reflectVec = reflect( - viewDir, normal );
809			reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
810			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
811			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
812			return envMapColor.rgb * envMapIntensity;
813		#else
814			return vec3( 0.0 );
815		#endif
816	}
817	#ifdef USE_ANISOTROPY
818		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
819			#ifdef ENVMAP_TYPE_CUBE_UV
820				vec3 bentNormal = cross( bitangent, viewDir );
821				bentNormal = normalize( cross( bentNormal, bitangent ) );
822				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
823				return getIBLRadiance( viewDir, bentNormal, roughness );
824			#else
825				return vec3( 0.0 );
826			#endif
827		}
828	#endif
829#endif`,Rz=`ToonMaterial material;
830material.diffuseColor = diffuseColor.rgb;`,Cz=`varying vec3 vViewPosition;
831struct ToonMaterial {
832	vec3 diffuseColor;
833};
834void 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 ) {
835	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
836	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
837}
838void 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 ) {
839	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
840}
841#define RE_Direct				RE_Direct_Toon
842#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,Pz=`BlinnPhongMaterial material;
843material.diffuseColor = diffuseColor.rgb;
844material.specularColor = specular;
845material.specularShininess = shininess;
846material.specularStrength = specularStrength;`,Lz=`varying vec3 vViewPosition;
847struct BlinnPhongMaterial {
848	vec3 diffuseColor;
849	vec3 specularColor;
850	float specularShininess;
851	float specularStrength;
852};
853void 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 ) {
854	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
855	vec3 irradiance = dotNL * directLight.color;
856	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
857	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
858}
859void 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 ) {
860	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
861}
862#define RE_Direct				RE_Direct_BlinnPhong
863#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,Nz=`PhysicalMaterial material;
864material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
865vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
866float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
867material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
868material.roughness = min( material.roughness, 1.0 );
869#ifdef IOR
870	material.ior = ior;
871	#ifdef USE_SPECULAR
872		float specularIntensityFactor = specularIntensity;
873		vec3 specularColorFactor = specularColor;
874		#ifdef USE_SPECULAR_COLORMAP
875			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
876		#endif
877		#ifdef USE_SPECULAR_INTENSITYMAP
878			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
879		#endif
880		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
881	#else
882		float specularIntensityFactor = 1.0;
883		vec3 specularColorFactor = vec3( 1.0 );
884		material.specularF90 = 1.0;
885	#endif
886	material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
887#else
888	material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
889	material.specularF90 = 1.0;
890#endif
891#ifdef USE_CLEARCOAT
892	material.clearcoat = clearcoat;
893	material.clearcoatRoughness = clearcoatRoughness;
894	material.clearcoatF0 = vec3( 0.04 );
895	material.clearcoatF90 = 1.0;
896	#ifdef USE_CLEARCOATMAP
897		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
898	#endif
899	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
900		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
901	#endif
902	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
903	material.clearcoatRoughness += geometryRoughness;
904	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
905#endif
906#ifdef USE_DISPERSION
907	material.dispersion = dispersion;
908#endif
909#ifdef USE_IRIDESCENCE
910	material.iridescence = iridescence;
911	material.iridescenceIOR = iridescenceIOR;
912	#ifdef USE_IRIDESCENCEMAP
913		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
914	#endif
915	#ifdef USE_IRIDESCENCE_THICKNESSMAP
916		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
917	#else
918		material.iridescenceThickness = iridescenceThicknessMaximum;
919	#endif
920#endif
921#ifdef USE_SHEEN
922	material.sheenColor = sheenColor;
923	#ifdef USE_SHEEN_COLORMAP
924		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
925	#endif
926	material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
927	#ifdef USE_SHEEN_ROUGHNESSMAP
928		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
929	#endif
930#endif
931#ifdef USE_ANISOTROPY
932	#ifdef USE_ANISOTROPYMAP
933		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
934		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
935		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
936	#else
937		vec2 anisotropyV = anisotropyVector;
938	#endif
939	material.anisotropy = length( anisotropyV );
940	if( material.anisotropy == 0.0 ) {
941		anisotropyV = vec2( 1.0, 0.0 );
942	} else {
943		anisotropyV /= material.anisotropy;
944		material.anisotropy = saturate( material.anisotropy );
945	}
946	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
947	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
948	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
949#endif`,Dz
vendor: 14,687 bytes, lines 949-1250
949=`struct PhysicalMaterial {
950	vec3 diffuseColor;
951	float roughness;
952	vec3 specularColor;
953	float specularF90;
954	float dispersion;
955	#ifdef USE_CLEARCOAT
956		float clearcoat;
957		float clearcoatRoughness;
958		vec3 clearcoatF0;
959		float clearcoatF90;
960	#endif
961	#ifdef USE_IRIDESCENCE
962		float iridescence;
963		float iridescenceIOR;
964		float iridescenceThickness;
965		vec3 iridescenceFresnel;
966		vec3 iridescenceF0;
967	#endif
968	#ifdef USE_SHEEN
969		vec3 sheenColor;
970		float sheenRoughness;
971	#endif
972	#ifdef IOR
973		float ior;
974	#endif
975	#ifdef USE_TRANSMISSION
976		float transmission;
977		float transmissionAlpha;
978		float thickness;
979		float attenuationDistance;
980		vec3 attenuationColor;
981	#endif
982	#ifdef USE_ANISOTROPY
983		float anisotropy;
984		float alphaT;
985		vec3 anisotropyT;
986		vec3 anisotropyB;
987	#endif
988};
989vec3 clearcoatSpecularDirect = vec3( 0.0 );
990vec3 clearcoatSpecularIndirect = vec3( 0.0 );
991vec3 sheenSpecularDirect = vec3( 0.0 );
992vec3 sheenSpecularIndirect = vec3(0.0 );
993vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
994    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
995    float x2 = x * x;
996    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
997    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
998}
999float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
1000	float a2 = pow2( alpha );
1001	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
1002	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
1003	return 0.5 / max( gv + gl, EPSILON );
1004}
1005float D_GGX( const in float alpha, const in float dotNH ) {
1006	float a2 = pow2( alpha );
1007	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
1008	return RECIPROCAL_PI * a2 / pow2( denom );
1009}
1010#ifdef USE_ANISOTROPY
1011	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 ) {
1012		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
1013		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
1014		float v = 0.5 / ( gv + gl );
1015		return saturate(v);
1016	}
1017	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
1018		float a2 = alphaT * alphaB;
1019		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
1020		highp float v2 = dot( v, v );
1021		float w2 = a2 / v2;
1022		return RECIPROCAL_PI * a2 * pow2 ( w2 );
1023	}
1024#endif
1025#ifdef USE_CLEARCOAT
1026	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
1027		vec3 f0 = material.clearcoatF0;
1028		float f90 = material.clearcoatF90;
1029		float roughness = material.clearcoatRoughness;
1030		float alpha = pow2( roughness );
1031		vec3 halfDir = normalize( lightDir + viewDir );
1032		float dotNL = saturate( dot( normal, lightDir ) );
1033		float dotNV = saturate( dot( normal, viewDir ) );
1034		float dotNH = saturate( dot( normal, halfDir ) );
1035		float dotVH = saturate( dot( viewDir, halfDir ) );
1036		vec3 F = F_Schlick( f0, f90, dotVH );
1037		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1038		float D = D_GGX( alpha, dotNH );
1039		return F * ( V * D );
1040	}
1041#endif
1042vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1043	vec3 f0 = material.specularColor;
1044	float f90 = material.specularF90;
1045	float roughness = material.roughness;
1046	float alpha = pow2( roughness );
1047	vec3 halfDir = normalize( lightDir + viewDir );
1048	float dotNL = saturate( dot( normal, lightDir ) );
1049	float dotNV = saturate( dot( normal, viewDir ) );
1050	float dotNH = saturate( dot( normal, halfDir ) );
1051	float dotVH = saturate( dot( viewDir, halfDir ) );
1052	vec3 F = F_Schlick( f0, f90, dotVH );
1053	#ifdef USE_IRIDESCENCE
1054		F = mix( F, material.iridescenceFresnel, material.iridescence );
1055	#endif
1056	#ifdef USE_ANISOTROPY
1057		float dotTL = dot( material.anisotropyT, lightDir );
1058		float dotTV = dot( material.anisotropyT, viewDir );
1059		float dotTH = dot( material.anisotropyT, halfDir );
1060		float dotBL = dot( material.anisotropyB, lightDir );
1061		float dotBV = dot( material.anisotropyB, viewDir );
1062		float dotBH = dot( material.anisotropyB, halfDir );
1063		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
1064		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
1065	#else
1066		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1067		float D = D_GGX( alpha, dotNH );
1068	#endif
1069	return F * ( V * D );
1070}
1071vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
1072	const float LUT_SIZE = 64.0;
1073	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
1074	const float LUT_BIAS = 0.5 / LUT_SIZE;
1075	float dotNV = saturate( dot( N, V ) );
1076	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
1077	uv = uv * LUT_SCALE + LUT_BIAS;
1078	return uv;
1079}
1080float LTC_ClippedSphereFormFactor( const in vec3 f ) {
1081	float l = length( f );
1082	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
1083}
1084vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
1085	float x = dot( v1, v2 );
1086	float y = abs( x );
1087	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
1088	float b = 3.4175940 + ( 4.1616724 + y ) * y;
1089	float v = a / b;
1090	float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
1091	return cross( v1, v2 ) * theta_sintheta;
1092}
1093vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
1094	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
1095	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
1096	vec3 lightNormal = cross( v1, v2 );
1097	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
1098	vec3 T1, T2;
1099	T1 = normalize( V - N * dot( V, N ) );
1100	T2 = - cross( N, T1 );
1101	mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
1102	vec3 coords[ 4 ];
1103	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
1104	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
1105	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
1106	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
1107	coords[ 0 ] = normalize( coords[ 0 ] );
1108	coords[ 1 ] = normalize( coords[ 1 ] );
1109	coords[ 2 ] = normalize( coords[ 2 ] );
1110	coords[ 3 ] = normalize( coords[ 3 ] );
1111	vec3 vectorFormFactor = vec3( 0.0 );
1112	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
1113	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
1114	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
1115	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
1116	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
1117	return vec3( result );
1118}
1119#if defined( USE_SHEEN )
1120float D_Charlie( float roughness, float dotNH ) {
1121	float alpha = pow2( roughness );
1122	float invAlpha = 1.0 / alpha;
1123	float cos2h = dotNH * dotNH;
1124	float sin2h = max( 1.0 - cos2h, 0.0078125 );
1125	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
1126}
1127float V_Neubelt( float dotNV, float dotNL ) {
1128	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
1129}
1130vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
1131	vec3 halfDir = normalize( lightDir + viewDir );
1132	float dotNL = saturate( dot( normal, lightDir ) );
1133	float dotNV = saturate( dot( normal, viewDir ) );
1134	float dotNH = saturate( dot( normal, halfDir ) );
1135	float D = D_Charlie( sheenRoughness, dotNH );
1136	float V = V_Neubelt( dotNV, dotNL );
1137	return sheenColor * ( D * V );
1138}
1139#endif
1140float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
1141	float dotNV = saturate( dot( normal, viewDir ) );
1142	float r2 = roughness * roughness;
1143	float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
1144	float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
1145	float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
1146	return saturate( DG * RECIPROCAL_PI );
1147}
1148vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
1149	float dotNV = saturate( dot( normal, viewDir ) );
1150	const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
1151	const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
1152	vec4 r = roughness * c0 + c1;
1153	float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
1154	vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
1155	return fab;
1156}
1157vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
1158	vec2 fab = DFGApprox( normal, viewDir, roughness );
1159	return specularColor * fab.x + specularF90 * fab.y;
1160}
1161#ifdef USE_IRIDESCENCE
1162void 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 ) {
1163#else
1164void 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 ) {
1165#endif
1166	vec2 fab = DFGApprox( normal, viewDir, roughness );
1167	#ifdef USE_IRIDESCENCE
1168		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
1169	#else
1170		vec3 Fr = specularColor;
1171	#endif
1172	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
1173	float Ess = fab.x + fab.y;
1174	float Ems = 1.0 - Ess;
1175	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
1176	singleScatter += FssEss;
1177	multiScatter += Fms * Ems;
1178}
1179#if NUM_RECT_AREA_LIGHTS > 0
1180	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 ) {
1181		vec3 normal = geometryNormal;
1182		vec3 viewDir = geometryViewDir;
1183		vec3 position = geometryPosition;
1184		vec3 lightPos = rectAreaLight.position;
1185		vec3 halfWidth = rectAreaLight.halfWidth;
1186		vec3 halfHeight = rectAreaLight.halfHeight;
1187		vec3 lightColor = rectAreaLight.color;
1188		float roughness = material.roughness;
1189		vec3 rectCoords[ 4 ];
1190		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
1191		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
1192		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
1193		vec2 uv = LTC_Uv( normal, viewDir, roughness );
1194		vec4 t1 = texture2D( ltc_1, uv );
1195		vec4 t2 = texture2D( ltc_2, uv );
1196		mat3 mInv = mat3(
1197			vec3( t1.x, 0, t1.y ),
1198			vec3(    0, 1,    0 ),
1199			vec3( t1.z, 0, t1.w )
1200		);
1201		vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
1202		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
1203		reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
1204	}
1205#endif
1206void 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 ) {
1207	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
1208	vec3 irradiance = dotNL * directLight.color;
1209	#ifdef USE_CLEARCOAT
1210		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
1211		vec3 ccIrradiance = dotNLcc * directLight.color;
1212		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
1213	#endif
1214	#ifdef USE_SHEEN
1215		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
1216	#endif
1217	reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );
1218	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1219}
1220void 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 ) {
1221	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1222}
1223void 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) {
1224	#ifdef USE_CLEARCOAT
1225		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
1226	#endif
1227	#ifdef USE_SHEEN
1228		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1229	#endif
1230	vec3 singleScattering = vec3( 0.0 );
1231	vec3 multiScattering = vec3( 0.0 );
1232	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
1233	#ifdef USE_IRIDESCENCE
1234		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
1235	#else
1236		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
1237	#endif
1238	vec3 totalScattering = singleScattering + multiScattering;
1239	vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
1240	reflectedLight.indirectSpecular += radiance * singleScattering;
1241	reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
1242	reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
1243}
1244#define RE_Direct				RE_Direct_Physical
1245#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
1246#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
1247#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
1248float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
1249	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
1250}`,
1250Iz=`
1251vec3 geometryPosition = - vViewPosition;
1252vec3 geometryNormal = normal;
1253vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
1254vec3 geometryClearcoatNormal = vec3( 0.0 );
1255#ifdef USE_CLEARCOAT
1256	geometryClearcoatNormal = clearcoatNormal;
1257#endif
1258#ifdef USE_IRIDESCENCE
1259	float dotNVi = saturate( dot( normal, geometryViewDir ) );
1260	if ( material.iridescenceThickness == 0.0 ) {
1261		material.iridescence = 0.0;
1262	} else {
1263		material.iridescence = saturate( material.iridescence );
1264	}
1265	if ( material.iridescence > 0.0 ) {
1266		material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
1267		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
1268	}
1269#endif
1270IncidentLight directLight;
1271#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
1272	PointLight pointLight;
1273	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
1274	PointLightShadow pointLightShadow;
1275	#endif
1276	#pragma unroll_loop_start
1277	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
1278		pointLight = pointLights[ i ];
1279		getPointLightInfo( pointLight, geometryPosition, directLight );
1280		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
1281		pointLightShadow = pointLightShadows[ i ];
1282		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
1283		#endif
1284		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1285	}
1286	#pragma unroll_loop_end
1287#endif
1288#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
1289	SpotLight spotLight;
1290	vec4 spotColor;
1291	vec3 spotLightCoord;
1292	bool inSpotLightMap;
1293	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
1294	SpotLightShadow spotLightShadow;
1295	#endif
1296	#pragma unroll_loop_start
1297	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
1298		spotLight = spotLights[ i ];
1299		getSpotLightInfo( spotLight, geometryPosition, directLight );
1300		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1301		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
1302		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1303		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
1304		#else
1305		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1306		#endif
1307		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
1308			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
1309			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
1310			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
1311			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
1312		#endif
1313		#undef SPOT_LIGHT_MAP_INDEX
1314		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1315		spotLightShadow = spotLightShadows[ i ];
1316		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
1317		#endif
1318		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1319	}
1320	#pragma unroll_loop_end
1321#endif
1322#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
1323	DirectionalLight directionalLight;
1324	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
1325	DirectionalLightShadow directionalLightShadow;
1326	#endif
1327	#pragma unroll_loop_start
1328	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
1329		directionalLight = directionalLights[ i ];
1330		getDirectionalLightInfo( directionalLight, directLight );
1331		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
1332		directionalLightShadow = directionalLightShadows[ i ];
1333		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
1334		#endif
1335		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1336	}
1337	#pragma unroll_loop_end
1338#endif
1339#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
1340	RectAreaLight rectAreaLight;
1341	#pragma unroll_loop_start
1342	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
1343		rectAreaLight = rectAreaLights[ i ];
1344		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1345	}
1346	#pragma unroll_loop_end
1347#endif
1348#if defined( RE_IndirectDiffuse )
1349	vec3 iblIrradiance = vec3( 0.0 );
1350	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
1351	#if defined( USE_LIGHT_PROBES )
1352		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
1353	#endif
1354	#if ( NUM_HEMI_LIGHTS > 0 )
1355		#pragma unroll_loop_start
1356		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
1357			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
1358		}
1359		#pragma unroll_loop_end
1360	#endif
1361#endif
1362#if defined( RE_IndirectSpecular )
1363	vec3 radiance = vec3( 0.0 );
1364	vec3 clearcoatRadiance = vec3( 0.0 );
1365#endif`,Bz=`#if defined( RE_IndirectDiffuse )
1366	#ifdef USE_LIGHTMAP
1367		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
1368		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
1369		irradiance += lightMapIrradiance;
1370	#endif
1371	#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
1372		iblIrradiance += getIBLIrradiance( geometryNormal );
1373	#endif
1374#endif
1375#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
1376	#ifdef USE_ANISOTROPY
1377		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
1378	#else
1379		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
1380	#endif
1381	#ifdef USE_CLEARCOAT
1382		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
1383	#endif
1384#endif`,Fz=`#if defined( RE_IndirectDiffuse )
1385	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1386#endif
1387#if defined( RE_IndirectSpecular )
1388	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1389#endif`,Uz=`#if defined( USE_LOGDEPTHBUF )
1390	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1391#endif`,Oz=`#if defined( USE_LOGDEPTHBUF )
1392	uniform float logDepthBufFC;
1393	varying float vFragDepth;
1394	varying float vIsPerspective;
1395#endif`,kz=`#ifdef USE_LOGDEPTHBUF
1396	varying float vFragDepth;
1397	varying float vIsPerspective;
1398#endif`,zz=`#ifdef USE_LOGDEPTHBUF
1399	vFragDepth = 1.0 + gl_Position.w;
1400	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
1401#endif`,Vz=`#ifdef USE_MAP
1402	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
1403	#ifdef DECODE_VIDEO_TEXTURE
1404		sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
1405	#endif
1406	diffuseColor *= sampledDiffuseColor;
1407#endif`,Gz=`#ifdef USE_MAP
1408	uniform sampler2D map;
1409#endif`,qz=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1410	#if defined( USE_POINTS_UV )
1411		vec2 uv = vUv;
1412	#else
1413		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
1414	#endif
1415#endif
1416#ifdef USE_MAP
1417	diffuseColor *= texture2D( map, uv );
1418#endif
1419#ifdef USE_ALPHAMAP
1420	diffuseColor.a *= texture2D( alphaMap, uv ).g;
1421#endif`,Hz=`#if defined( USE_POINTS_UV )
1422	varying vec2 vUv;
1423#else
1424	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1425		uniform mat3 uvTransform;
1426	#endif
1427#endif
1428#ifdef USE_MAP
1429	uniform sampler2D map;
1430#endif
1431#ifdef USE_ALPHAMAP
1432	uniform sampler2D alphaMap;
1433#endif`,Wz=`float metalnessFactor = metalness;
1434#ifdef USE_METALNESSMAP
1435	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
1436	metalnessFactor *= texelMetalness.b;
1437#endif`,$z=`#ifdef USE_METALNESSMAP
1438	uniform sampler2D metalnessMap;
1439#endif`,jz=`#ifdef USE_INSTANCING_MORPH
1440	float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1441	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
1442	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1443		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
1444	}
1445#endif`,Xz=`#if defined( USE_MORPHCOLORS )
1446	vColor *= morphTargetBaseInfluence;
1447	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1448		#if defined( USE_COLOR_ALPHA )
1449			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
1450		#elif defined( USE_COLOR )
1451			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
1452		#endif
1453	}
1454#endif`,Yz=`#ifdef USE_MORPHNORMALS
1455	objectNormal *= morphTargetBaseInfluence;
1456	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1457		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
1458	}
1459#endif`,Qz=`#ifdef USE_MORPHTARGETS
1460	#ifndef USE_INSTANCING_MORPH
1461		uniform float morphTargetBaseInfluence;
1462		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1463	#endif
1464	uniform sampler2DArray morphTargetsTexture;
1465	uniform ivec2 morphTargetsTextureSize;
1466	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
1467		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
1468		int y = texelIndex / morphTargetsTextureSize.x;
1469		int x = texelIndex - y * morphTargetsTextureSize.x;
1470		ivec3 morphUV = ivec3( x, y, morphTargetIndex );
1471		return texelFetch( morphTargetsTexture, morphUV, 0 );
1472	}
1473#endif`,Zz=`#ifdef USE_MORPHTARGETS
1474	transformed *= morphTargetBaseInfluence;
1475	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1476		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
1477	}
1478#endif`,Kz=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1479#ifdef FLAT_SHADED
1480	vec3 fdx = dFdx( vViewPosition );
1481	vec3 fdy = dFdy( vViewPosition );
1482	vec3 normal = normalize( cross( fdx, fdy ) );
1483#else
1484	vec3 normal = normalize( vNormal );
1485	#ifdef DOUBLE_SIDED
1486		normal *= faceDirection;
1487	#endif
1488#endif
1489#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
1490	#ifdef USE_TANGENT
1491		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1492	#else
1493		mat3 tbn = getTangentFrame( - vViewPosition, normal,
1494		#if defined( USE_NORMALMAP )
1495			vNormalMapUv
1496		#elif defined( USE_CLEARCOAT_NORMALMAP )
1497			vClearcoatNormalMapUv
1498		#else
1499			vUv
1500		#endif
1501		);
1502	#endif
1503	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
1504		tbn[0] *= faceDirection;
1505		tbn[1] *= faceDirection;
1506	#endif
1507#endif
1508#ifdef USE_CLEARCOAT_NORMALMAP
1509	#ifdef USE_TANGENT
1510		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1511	#else
1512		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
1513	#endif
1514	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
1515		tbn2[0] *= faceDirection;
1516		tbn2[1] *= faceDirection;
1517	#endif
1518#endif
1519vec3 nonPerturbedNormal = normal;`,Jz=`#ifdef USE_NORMALMAP_OBJECTSPACE
1520	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1521	#ifdef FLIP_SIDED
1522		normal = - normal;
1523	#endif
1524	#ifdef DOUBLE_SIDED
1525		normal = normal * faceDirection;
1526	#endif
1527	normal = normalize( normalMatrix * normal );
1528#elif defined( USE_NORMALMAP_TANGENTSPACE )
1529	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1530	mapN.xy *= normalScale;
1531	normal = normalize( tbn * mapN );
1532#elif defined( USE_BUMPMAP )
1533	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
1534#endif`,eV=`#ifndef FLAT_SHADED
1535	varying vec3 vNormal;
1536	#ifdef USE_TANGENT
1537		varying vec3 vTangent;
1538		varying vec3 vBitangent;
1539	#endif
1540#endif`,tV=`#ifndef FLAT_SHADED
1541	varying vec3 vNormal;
1542	#ifdef USE_TANGENT
1543		varying vec3 vTangent;
1544		varying vec3 vBitangent;
1545	#endif
1546#endif`,nV=`#ifndef FLAT_SHADED
1547	vNormal = normalize( transformedNormal );
1548	#ifdef USE_TANGENT
1549		vTangent = normalize( transformedTangent );
1550		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
1551	#endif
1552#endif`,iV=`#ifdef USE_NORMALMAP
1553	uniform sampler2D normalMap;
1554	uniform vec2 normalScale;
1555#endif
1556#ifdef USE_NORMALMAP_OBJECTSPACE
1557	uniform mat3 normalMatrix;
1558#endif
1559#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
1560	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
1561		vec3 q0 = dFdx( eye_pos.xyz );
1562		vec3 q1 = dFdy( eye_pos.xyz );
1563		vec2 st0 = dFdx( uv.st );
1564		vec2 st1 = dFdy( uv.st );
1565		vec3 N = surf_norm;
1566		vec3 q1perp = cross( q1, N );
1567		vec3 q0perp = cross( N, q0 );
1568		vec3 T = q1perp * st0.x + q0perp * st1.x;
1569		vec3 B = q1perp * st0.y + q0perp * st1.y;
1570		float det = max( dot( T, T ), dot( B, B ) );
1571		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
1572		return mat3( T * scale, B * scale, N );
1573	}
1574#endif`,rV=`#ifdef USE_CLEARCOAT
1575	vec3 clearcoatNormal = nonPerturbedNormal;
1576#endif`,sV=`#ifdef USE_CLEARCOAT_NORMALMAP
1577	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
1578	clearcoatMapN.xy *= clearcoatNormalScale;
1579	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
1580#endif`,oV=`#ifdef USE_CLEARCOATMAP
1581	uniform sampler2D clearcoatMap;
1582#endif
1583#ifdef USE_CLEARCOAT_NORMALMAP
1584	uniform sampler2D clearcoatNormalMap;
1585	uniform vec2 clearcoatNormalScale;
1586#endif
1587#ifdef USE_CLEARCOAT_ROUGHNESSMAP
1588	uniform sampler2D clearcoatRoughnessMap;
1589#endif`,aV=`#ifdef USE_IRIDESCENCEMAP
1590	uniform sampler2D iridescenceMap;
1591#endif
1592#ifdef USE_IRIDESCENCE_THICKNESSMAP
1593	uniform sampler2D iridescenceThicknessMap;
1594#endif`,lV=`#ifdef OPAQUE
1595diffuseColor.a = 1.0;
1596#endif
1597#ifdef USE_TRANSMISSION
1598diffuseColor.a *= material.transmissionAlpha;
1599#endif
1600gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,cV=`vec3 packNormalToRGB( const in vec3 normal ) {
1601	return normalize( normal ) * 0.5 + 0.5;
1602}
1603vec3 unpackRGBToNormal( const in vec3 rgb ) {
1604	return 2.0 * rgb.xyz - 1.0;
1605}
1606const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
1607const float Inv255 = 1. / 255.;
1608const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
1609const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
1610const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
1611const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
1612vec4 packDepthToRGBA( const in float v ) {
1613	if( v <= 0.0 )
1614		return vec4( 0., 0., 0., 0. );
1615	if( v >= 1.0 )
1616		return vec4( 1., 1., 1., 1. );
1617	float vuf;
1618	float af = modf( v * PackFactors.a, vuf );
1619	float bf = modf( vuf * ShiftRight8, vuf );
1620	float gf = modf( vuf * ShiftRight8, vuf );
1621	return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
1622}
1623vec3 packDepthToRGB( const in float v ) {
1624	if( v <= 0.0 )
1625		return vec3( 0., 0., 0. );
1626	if( v >= 1.0 )
1627		return vec3( 1., 1., 1. );
1628	float vuf;
1629	float bf = modf( v * PackFactors.b, vuf );
1630	float gf = modf( vuf * ShiftRight8, vuf );
1631	return vec3( vuf * Inv255, gf * PackUpscale, bf );
1632}
1633vec2 packDepthToRG( const in float v ) {
1634	if( v <= 0.0 )
1635		return vec2( 0., 0. );
1636	if( v >= 1.0 )
1637		return vec2( 1., 1. );
1638	float vuf;
1639	float gf = modf( v * 256., vuf );
1640	return vec2( vuf * Inv255, gf );
1641}
1642float unpackRGBAToDepth( const in vec4 v ) {
1643	return dot( v, UnpackFactors4 );
1644}
1645float unpackRGBToDepth( const in vec3 v ) {
1646	return dot( v, UnpackFactors3 );
1647}
1648float unpackRGToDepth( const in vec2 v ) {
1649	return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
1650}
1651vec4 pack2HalfToRGBA( const in vec2 v ) {
1652	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
1653	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
1654}
1655vec2 unpackRGBATo2Half( const in vec4 v ) {
1656	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
1657}
1658float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
1659	return ( viewZ + near ) / ( near - far );
1660}
1661float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
1662	return depth * ( near - far ) - near;
1663}
1664float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
1665	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
1666}
1667float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
1668	return ( near * far ) / ( ( far - near ) * depth - far );
1669}`,uV=`#ifdef PREMULTIPLIED_ALPHA
1670	gl_FragColor.rgb *= gl_FragColor.a;
1671#endif`,hV=`vec4 mvPosition = vec4( transformed, 1.0 );
1672#ifdef USE_BATCHING
1673	mvPosition = batchingMatrix * mvPosition;
1674#endif
1675#ifdef USE_INSTANCING
1676	mvPosition = instanceMatrix * mvPosition;
1677#endif
1678mvPosition = modelViewMatrix * mvPosition;
1679gl_Position = projectionMatrix * mvPosition;`,dV=`#ifdef DITHERING
1680	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
1681#endif`,fV=`#ifdef DITHERING
1682	vec3 dithering( vec3 color ) {
1683		float grid_position = rand( gl_FragCoord.xy );
1684		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
1685		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
1686		return color + dither_shift_RGB;
1687	}
1688#endif`,pV=`float roughnessFactor = roughness;
1689#ifdef USE_ROUGHNESSMAP
1690	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
1691	roughnessFactor *= texelRoughness.g;
1692#endif`,AV=`#ifdef USE_ROUGHNESSMAP
1693	uniform sampler2D roughnessMap;
1694#endif`,mV=
vendor: 8,887 bytes, lines 1694-1880
1694`#if NUM_SPOT_LIGHT_COORDS > 0
1695	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1696#endif
1697#if NUM_SPOT_LIGHT_MAPS > 0
1698	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
1699#endif
1700#ifdef USE_SHADOWMAP
1701	#if NUM_DIR_LIGHT_SHADOWS > 0
1702		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
1703		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
1704		struct DirectionalLightShadow {
1705			float shadowIntensity;
1706			float shadowBias;
1707			float shadowNormalBias;
1708			float shadowRadius;
1709			vec2 shadowMapSize;
1710		};
1711		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1712	#endif
1713	#if NUM_SPOT_LIGHT_SHADOWS > 0
1714		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
1715		struct SpotLightShadow {
1716			float shadowIntensity;
1717			float shadowBias;
1718			float shadowNormalBias;
1719			float shadowRadius;
1720			vec2 shadowMapSize;
1721		};
1722		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
1723	#endif
1724	#if NUM_POINT_LIGHT_SHADOWS > 0
1725		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
1726		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
1727		struct PointLightShadow {
1728			float shadowIntensity;
1729			float shadowBias;
1730			float shadowNormalBias;
1731			float shadowRadius;
1732			vec2 shadowMapSize;
1733			float shadowCameraNear;
1734			float shadowCameraFar;
1735		};
1736		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
1737	#endif
1738	float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
1739		return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
1740	}
1741	vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
1742		return unpackRGBATo2Half( texture2D( shadow, uv ) );
1743	}
1744	float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
1745		float occlusion = 1.0;
1746		vec2 distribution = texture2DDistribution( shadow, uv );
1747		float hard_shadow = step( compare , distribution.x );
1748		if (hard_shadow != 1.0 ) {
1749			float distance = compare - distribution.x ;
1750			float variance = max( 0.00000, distribution.y * distribution.y );
1751			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 );
1752		}
1753		return occlusion;
1754	}
1755	float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1756		float shadow = 1.0;
1757		shadowCoord.xyz /= shadowCoord.w;
1758		shadowCoord.z += shadowBias;
1759		bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1760		bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1761		if ( frustumTest ) {
1762		#if defined( SHADOWMAP_TYPE_PCF )
1763			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
1764			float dx0 = - texelSize.x * shadowRadius;
1765			float dy0 = - texelSize.y * shadowRadius;
1766			float dx1 = + texelSize.x * shadowRadius;
1767			float dy1 = + texelSize.y * shadowRadius;
1768			float dx2 = dx0 / 2.0;
1769			float dy2 = dy0 / 2.0;
1770			float dx3 = dx1 / 2.0;
1771			float dy3 = dy1 / 2.0;
1772			shadow = (
1773				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
1774				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
1775				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
1776				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
1777				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
1778				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
1779				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
1780				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
1781				texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
1782				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
1783				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
1784				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
1785				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
1786				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
1787				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
1788				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
1789				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
1790			) * ( 1.0 / 17.0 );
1791		#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
1792			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
1793			float dx = texelSize.x;
1794			float dy = texelSize.y;
1795			vec2 uv = shadowCoord.xy;
1796			vec2 f = fract( uv * shadowMapSize + 0.5 );
1797			uv -= f * texelSize;
1798			shadow = (
1799				texture2DCompare( shadowMap, uv, shadowCoord.z ) +
1800				texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
1801				texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
1802				texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
1803				mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
1804					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
1805					 f.x ) +
1806				mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
1807					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
1808					 f.x ) +
1809				mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
1810					 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
1811					 f.y ) +
1812				mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
1813					 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
1814					 f.y ) +
1815				mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
1816						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
1817						  f.x ),
1818					 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
1819						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
1820						  f.x ),
1821					 f.y )
1822			) * ( 1.0 / 9.0 );
1823		#elif defined( SHADOWMAP_TYPE_VSM )
1824			shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
1825		#else
1826			shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
1827		#endif
1828		}
1829		return mix( 1.0, shadow, shadowIntensity );
1830	}
1831	vec2 cubeToUV( vec3 v, float texelSizeY ) {
1832		vec3 absV = abs( v );
1833		float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
1834		absV *= scaleToCube;
1835		v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
1836		vec2 planar = v.xy;
1837		float almostATexel = 1.5 * texelSizeY;
1838		float almostOne = 1.0 - almostATexel;
1839		if ( absV.z >= almostOne ) {
1840			if ( v.z > 0.0 )
1841				planar.x = 4.0 - v.x;
1842		} else if ( absV.x >= almostOne ) {
1843			float signX = sign( v.x );
1844			planar.x = v.z * signX + 2.0 * signX;
1845		} else if ( absV.y >= almostOne ) {
1846			float signY = sign( v.y );
1847			planar.x = v.x + 2.0 * signY + 2.0;
1848			planar.y = v.z * signY - 2.0;
1849		}
1850		return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
1851	}
1852	float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
1853		float shadow = 1.0;
1854		vec3 lightToPosition = shadowCoord.xyz;
1855		
1856		float lightToPositionLength = length( lightToPosition );
1857		if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {
1858			float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );			dp += shadowBias;
1859			vec3 bd3D = normalize( lightToPosition );
1860			vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
1861			#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
1862				vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
1863				shadow = (
1864					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
1865					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
1866					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
1867					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
1868					texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
1869					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
1870					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
1871					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
1872					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
1873				) * ( 1.0 / 9.0 );
1874			#else
1875				shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
1876			#endif
1877		}
1878		return mix( 1.0, shadow, shadowIntensity );
1879	}
1880#endif`,
1880gV=`#if NUM_SPOT_LIGHT_COORDS > 0
1881	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
1882	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1883#endif
1884#ifdef USE_SHADOWMAP
1885	#if NUM_DIR_LIGHT_SHADOWS > 0
1886		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
1887		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
1888		struct DirectionalLightShadow {
1889			float shadowIntensity;
1890			float shadowBias;
1891			float shadowNormalBias;
1892			float shadowRadius;
1893			vec2 shadowMapSize;
1894		};
1895		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1896	#endif
1897	#if NUM_SPOT_LIGHT_SHADOWS > 0
1898		struct SpotLightShadow {
1899			float shadowIntensity;
1900			float shadowBias;
1901			float shadowNormalBias;
1902			float shadowRadius;
1903			vec2 shadowMapSize;
1904		};
1905		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
1906	#endif
1907	#if NUM_POINT_LIGHT_SHADOWS > 0
1908		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
1909		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
1910		struct PointLightShadow {
1911			float shadowIntensity;
1912			float shadowBias;
1913			float shadowNormalBias;
1914			float shadowRadius;
1915			vec2 shadowMapSize;
1916			float shadowCameraNear;
1917			float shadowCameraFar;
1918		};
1919		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
1920	#endif
1921#endif`,_V=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
1922	vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
1923	vec4 shadowWorldPosition;
1924#endif
1925#if defined( USE_SHADOWMAP )
1926	#if NUM_DIR_LIGHT_SHADOWS > 0
1927		#pragma unroll_loop_start
1928		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
1929			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
1930			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
1931		}
1932		#pragma unroll_loop_end
1933	#endif
1934	#if NUM_POINT_LIGHT_SHADOWS > 0
1935		#pragma unroll_loop_start
1936		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
1937			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
1938			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
1939		}
1940		#pragma unroll_loop_end
1941	#endif
1942#endif
1943#if NUM_SPOT_LIGHT_COORDS > 0
1944	#pragma unroll_loop_start
1945	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
1946		shadowWorldPosition = worldPosition;
1947		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1948			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
1949		#endif
1950		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
1951	}
1952	#pragma unroll_loop_end
1953#endif`,vV=`float getShadowMask() {
1954	float shadow = 1.0;
1955	#ifdef USE_SHADOWMAP
1956	#if NUM_DIR_LIGHT_SHADOWS > 0
1957	DirectionalLightShadow directionalLight;
1958	#pragma unroll_loop_start
1959	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
1960		directionalLight = directionalLightShadows[ i ];
1961		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
1962	}
1963	#pragma unroll_loop_end
1964	#endif
1965	#if NUM_SPOT_LIGHT_SHADOWS > 0
1966	SpotLightShadow spotLight;
1967	#pragma unroll_loop_start
1968	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
1969		spotLight = spotLightShadows[ i ];
1970		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
1971	}
1972	#pragma unroll_loop_end
1973	#endif
1974	#if NUM_POINT_LIGHT_SHADOWS > 0
1975	PointLightShadow pointLight;
1976	#pragma unroll_loop_start
1977	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
1978		pointLight = pointLightShadows[ i ];
1979		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
1980	}
1981	#pragma unroll_loop_end
1982	#endif
1983	#endif
1984	return shadow;
1985}`,yV=`#ifdef USE_SKINNING
1986	mat4 boneMatX = getBoneMatrix( skinIndex.x );
1987	mat4 boneMatY = getBoneMatrix( skinIndex.y );
1988	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
1989	mat4 boneMatW = getBoneMatrix( skinIndex.w );
1990#endif`,xV=`#ifdef USE_SKINNING
1991	uniform mat4 bindMatrix;
1992	uniform mat4 bindMatrixInverse;
1993	uniform highp sampler2D boneTexture;
1994	mat4 getBoneMatrix( const in float i ) {
1995		int size = textureSize( boneTexture, 0 ).x;
1996		int j = int( i ) * 4;
1997		int x = j % size;
1998		int y = j / size;
1999		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
2000		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
2001		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
2002		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
2003		return mat4( v1, v2, v3, v4 );
2004	}
2005#endif`,bV=`#ifdef USE_SKINNING
2006	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
2007	vec4 skinned = vec4( 0.0 );
2008	skinned += boneMatX * skinVertex * skinWeight.x;
2009	skinned += boneMatY * skinVertex * skinWeight.y;
2010	skinned += boneMatZ * skinVertex * skinWeight.z;
2011	skinned += boneMatW * skinVertex * skinWeight.w;
2012	transformed = ( bindMatrixInverse * skinned ).xyz;
2013#endif`,SV=`#ifdef USE_SKINNING
2014	mat4 skinMatrix = mat4( 0.0 );
2015	skinMatrix += skinWeight.x * boneMatX;
2016	skinMatrix += skinWeight.y * boneMatY;
2017	skinMatrix += skinWeight.z * boneMatZ;
2018	skinMatrix += skinWeight.w * boneMatW;
2019	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
2020	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
2021	#ifdef USE_TANGENT
2022		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
2023	#endif
2024#endif`,MV=`float specularStrength;
2025#ifdef USE_SPECULARMAP
2026	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
2027	specularStrength = texelSpecular.r;
2028#else
2029	specularStrength = 1.0;
2030#endif`,wV=`#ifdef USE_SPECULARMAP
2031	uniform sampler2D specularMap;
2032#endif`,TV=`#if defined( TONE_MAPPING )
2033	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
2034#endif`,EV=`#ifndef saturate
2035#define saturate( a ) clamp( a, 0.0, 1.0 )
2036#endif
2037uniform float toneMappingExposure;
2038vec3 LinearToneMapping( vec3 color ) {
2039	return saturate( toneMappingExposure * color );
2040}
2041vec3 ReinhardToneMapping( vec3 color ) {
2042	color *= toneMappingExposure;
2043	return saturate( color / ( vec3( 1.0 ) + color ) );
2044}
2045vec3 CineonToneMapping( vec3 color ) {
2046	color *= toneMappingExposure;
2047	color = max( vec3( 0.0 ), color - 0.004 );
2048	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
2049}
2050vec3 RRTAndODTFit( vec3 v ) {
2051	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
2052	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
2053	return a / b;
2054}
2055vec3 ACESFilmicToneMapping( vec3 color ) {
2056	const mat3 ACESInputMat = mat3(
2057		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
2058		vec3( 0.04823, 0.01566, 0.83777 )
2059	);
2060	const mat3 ACESOutputMat = mat3(
2061		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
2062		vec3( -0.07367, -0.00605,  1.07602 )
2063	);
2064	color *= toneMappingExposure / 0.6;
2065	color = ACESInputMat * color;
2066	color = RRTAndODTFit( color );
2067	color = ACESOutputMat * color;
2068	return saturate( color );
2069}
2070const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
2071	vec3( 1.6605, - 0.1246, - 0.0182 ),
2072	vec3( - 0.5876, 1.1329, - 0.1006 ),
2073	vec3( - 0.0728, - 0.0083, 1.1187 )
2074);
2075const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
2076	vec3( 0.6274, 0.0691, 0.0164 ),
2077	vec3( 0.3293, 0.9195, 0.0880 ),
2078	vec3( 0.0433, 0.0113, 0.8956 )
2079);
2080vec3 agxDefaultContrastApprox( vec3 x ) {
2081	vec3 x2 = x * x;
2082	vec3 x4 = x2 * x2;
2083	return + 15.5 * x4 * x2
2084		- 40.14 * x4 * x
2085		+ 31.96 * x4
2086		- 6.868 * x2 * x
2087		+ 0.4298 * x2
2088		+ 0.1191 * x
2089		- 0.00232;
2090}
2091vec3 AgXToneMapping( vec3 color ) {
2092	const mat3 AgXInsetMatrix = mat3(
2093		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
2094		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
2095		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
2096	);
2097	const mat3 AgXOutsetMatrix = mat3(
2098		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
2099		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
2100		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
2101	);
2102	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
2103	color *= toneMappingExposure;
2104	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
2105	color = AgXInsetMatrix * color;
2106	color = max( color, 1e-10 );	color = log2( color );
2107	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
2108	color = clamp( color, 0.0, 1.0 );
2109	color = agxDefaultContrastApprox( color );
2110	color = AgXOutsetMatrix * color;
2111	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
2112	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
2113	color = clamp( color, 0.0, 1.0 );
2114	return color;
2115}
2116vec3 NeutralToneMapping( vec3 color ) {
2117	const float StartCompression = 0.8 - 0.04;
2118	const float Desaturation = 0.15;
2119	color *= toneMappingExposure;
2120	float x = min( color.r, min( color.g, color.b ) );
2121	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
2122	color -= offset;
2123	float peak = max( color.r, max( color.g, color.b ) );
2124	if ( peak < StartCompression ) return color;
2125	float d = 1. - StartCompression;
2126	float newPeak = 1. - d * d / ( peak + d - StartCompression );
2127	color *= newPeak / peak;
2128	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
2129	return mix( color, vec3( newPeak ), g );
2130}
2131vec3 CustomToneMapping( vec3 color ) { return color; }`,RV=`#ifdef USE_TRANSMISSION
2132	material.transmission = transmission;
2133	material.transmissionAlpha = 1.0;
2134	material.thickness = thickness;
2135	material.attenuationDistance = attenuationDistance;
2136	material.attenuationColor = attenuationColor;
2137	#ifdef USE_TRANSMISSIONMAP
2138		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
2139	#endif
2140	#ifdef USE_THICKNESSMAP
2141		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
2142	#endif
2143	vec3 pos = vWorldPosition;
2144	vec3 v = normalize( cameraPosition - pos );
2145	vec3 n = inverseTransformDirection( normal, viewMatrix );
2146	vec4 transmitted = getIBLVolumeRefraction(
2147		n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
2148		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
2149		material.attenuationColor, material.attenuationDistance );
2150	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
2151	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
2152#endif`,CV=`#ifdef USE_TRANSMISSION
2153	uniform float transmission;
2154	uniform float thickness;
2155	uniform float attenuationDistance;
2156	uniform vec3 attenuationColor;
2157	#ifdef USE_TRANSMISSIONMAP
2158		uniform sampler2D transmissionMap;
2159	#endif
2160	#ifdef USE_THICKNESSMAP
2161		uniform sampler2D thicknessMap;
2162	#endif
2163	uniform vec2 transmissionSamplerSize;
2164	uniform sampler2D transmissionSamplerMap;
2165	uniform mat4 modelMatrix;
2166	uniform mat4 projectionMatrix;
2167	varying vec3 vWorldPosition;
2168	float w0( float a ) {
2169		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
2170	}
2171	float w1( float a ) {
2172		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
2173	}
2174	float w2( float a ){
2175		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
2176	}
2177	float w3( float a ) {
2178		return ( 1.0 / 6.0 ) * ( a * a * a );
2179	}
2180	float g0( float a ) {
2181		return w0( a ) + w1( a );
2182	}
2183	float g1( float a ) {
2184		return w2( a ) + w3( a );
2185	}
2186	float h0( float a ) {
2187		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
2188	}
2189	float h1( float a ) {
2190		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
2191	}
2192	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
2193		uv = uv * texelSize.zw + 0.5;
2194		vec2 iuv = floor( uv );
2195		vec2 fuv = fract( uv );
2196		float g0x = g0( fuv.x );
2197		float g1x = g1( fuv.x );
2198		float h0x = h0( fuv.x );
2199		float h1x = h1( fuv.x );
2200		float h0y = h0( fuv.y );
2201		float h1y = h1( fuv.y );
2202		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2203		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2204		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2205		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2206		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
2207			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
2208	}
2209	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
2210		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
2211		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
2212		vec2 fLodSizeInv = 1.0 / fLodSize;
2213		vec2 cLodSizeInv = 1.0 / cLodSize;
2214		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
2215		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
2216		return mix( fSample, cSample, fract( lod ) );
2217	}
2218	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
2219		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
2220		vec3 modelScale;
2221		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
2222		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
2223		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
2224		return normalize( refractionVector ) * thickness * modelScale;
2225	}
2226	float applyIorToRoughness( const in float roughness, const in float ior ) {
2227		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
2228	}
2229	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
2230		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
2231		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
2232	}
2233	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
2234		if ( isinf( attenuationDistance ) ) {
2235			return vec3( 1.0 );
2236		} else {
2237			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
2238			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
2239		}
2240	}
2241	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
2242		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
2243		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
2244		const in vec3 attenuationColor, const in float attenuationDistance ) {
2245		vec4 transmittedLight;
2246		vec3 transmittance;
2247		#ifdef USE_DISPERSION
2248			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
2249			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
2250			for ( int i = 0; i < 3; i ++ ) {
2251				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
2252				vec3 refractedRayExit = position + transmissionRay;
2253				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2254				vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2255				refractionCoords += 1.0;
2256				refractionCoords /= 2.0;
2257				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
2258				transmittedLight[ i ] = transmissionSample[ i ];
2259				transmittedLight.a += transmissionSample.a;
2260				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
2261			}
2262			transmittedLight.a /= 3.0;
2263		#else
2264			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
2265			vec3 refractedRayExit = position + transmissionRay;
2266			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2267			vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2268			refractionCoords += 1.0;
2269			refractionCoords /= 2.0;
2270			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
2271			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
2272		#endif
2273		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
2274		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
2275		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
2276		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
2277	}
2278#endif`,PV=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2279	varying vec2 vUv;
2280#endif
2281#ifdef USE_MAP
2282	varying vec2 vMapUv;
2283#endif
2284#ifdef USE_ALPHAMAP
2285	varying vec2 vAlphaMapUv;
2286#endif
2287#ifdef USE_LIGHTMAP
2288	varying vec2 vLightMapUv;
2289#endif
2290#ifdef USE_AOMAP
2291	varying vec2 vAoMapUv;
2292#endif
2293#ifdef USE_BUMPMAP
2294	varying vec2 vBumpMapUv;
2295#endif
2296#ifdef USE_NORMALMAP
2297	varying vec2 vNormalMapUv;
2298#endif
2299#ifdef USE_EMISSIVEMAP
2300	varying vec2 vEmissiveMapUv;
2301#endif
2302#ifdef USE_METALNESSMAP
2303	varying vec2 vMetalnessMapUv;
2304#endif
2305#ifdef USE_ROUGHNESSMAP
2306	varying vec2 vRoughnessMapUv;
2307#endif
2308#ifdef USE_ANISOTROPYMAP
2309	varying vec2 vAnisotropyMapUv;
2310#endif
2311#ifdef USE_CLEARCOATMAP
2312	varying vec2 vClearcoatMapUv;
2313#endif
2314#ifdef USE_CLEARCOAT_NORMALMAP
2315	varying vec2 vClearcoatNormalMapUv;
2316#endif
2317#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2318	varying vec2 vClearcoatRoughnessMapUv;
2319#endif
2320#ifdef USE_IRIDESCENCEMAP
2321	varying vec2 vIridescenceMapUv;
2322#endif
2323#ifdef USE_IRIDESCENCE_THICKNESSMAP
2324	varying vec2 vIridescenceThicknessMapUv;
2325#endif
2326#ifdef USE_SHEEN_COLORMAP
2327	varying vec2 vSheenColorMapUv;
2328#endif
2329#ifdef USE_SHEEN_ROUGHNESSMAP
2330	varying vec2 vSheenRoughnessMapUv;
2331#endif
2332#ifdef USE_SPECULARMAP
2333	varying vec2 vSpecularMapUv;
2334#endif
2335#ifdef USE_SPECULAR_COLORMAP
2336	varying vec2 vSpecularColorMapUv;
2337#endif
2338#ifdef USE_SPECULAR_INTENSITYMAP
2339	varying vec2 vSpecularIntensityMapUv;
2340#endif
2341#ifdef USE_TRANSMISSIONMAP
2342	uniform mat3 transmissionMapTransform;
2343	varying vec2 vTransmissionMapUv;
2344#endif
2345#ifdef USE_THICKNESSMAP
2346	uniform mat3 thicknessMapTransform;
2347	varying vec2 vThicknessMapUv;
2348#endif`,LV=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2349	varying vec2 vUv;
2350#endif
2351#ifdef USE_MAP
2352	uniform mat3 mapTransform;
2353	varying vec2 vMapUv;
2354#endif
2355#ifdef USE_ALPHAMAP
2356	uniform mat3 alphaMapTransform;
2357	varying vec2 vAlphaMapUv;
2358#endif
2359#ifdef USE_LIGHTMAP
2360	uniform mat3 lightMapTransform;
2361	varying vec2 vLightMapUv;
2362#endif
2363#ifdef USE_AOMAP
2364	uniform mat3 aoMapTransform;
2365	varying vec2 vAoMapUv;
2366#endif
2367#ifdef USE_BUMPMAP
2368	uniform mat3 bumpMapTransform;
2369	varying vec2 vBumpMapUv;
2370#endif
2371#ifdef USE_NORMALMAP
2372	uniform mat3 normalMapTransform;
2373	varying vec2 vNormalMapUv;
2374#endif
2375#ifdef USE_DISPLACEMENTMAP
2376	uniform mat3 displacementMapTransform;
2377	varying vec2 vDisplacementMapUv;
2378#endif
2379#ifdef USE_EMISSIVEMAP
2380	uniform mat3 emissiveMapTransform;
2381	varying vec2 vEmissiveMapUv;
2382#endif
2383#ifdef USE_METALNESSMAP
2384	uniform mat3 metalnessMapTransform;
2385	varying vec2 vMetalnessMapUv;
2386#endif
2387#ifdef USE_ROUGHNESSMAP
2388	uniform mat3 roughnessMapTransform;
2389	varying vec2 vRoughnessMapUv;
2390#endif
2391#ifdef USE_ANISOTROPYMAP
2392	uniform mat3 anisotropyMapTransform;
2393	varying vec2 vAnisotropyMapUv;
2394#endif
2395#ifdef USE_CLEARCOATMAP
2396	uniform mat3 clearcoatMapTransform;
2397	varying vec2 vClearcoatMapUv;
2398#endif
2399#ifdef USE_CLEARCOAT_NORMALMAP
2400	uniform mat3 clearcoatNormalMapTransform;
2401	varying vec2 vClearcoatNormalMapUv;
2402#endif
2403#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2404	uniform mat3 clearcoatRoughnessMapTransform;
2405	varying vec2 vClearcoatRoughnessMapUv;
2406#endif
2407#ifdef USE_SHEEN_COLORMAP
2408	uniform mat3 sheenColorMapTransform;
2409	varying vec2 vSheenColorMapUv;
2410#endif
2411#ifdef USE_SHEEN_ROUGHNESSMAP
2412	uniform mat3 sheenRoughnessMapTransform;
2413	varying vec2 vSheenRoughnessMapUv;
2414#endif
2415#ifdef USE_IRIDESCENCEMAP
2416	uniform mat3 iridescenceMapTransform;
2417	varying vec2 vIridescenceMapUv;
2418#endif
2419#ifdef USE_IRIDESCENCE_THICKNESSMAP
2420	uniform mat3 iridescenceThicknessMapTransform;
2421	varying vec2 vIridescenceThicknessMapUv;
2422#endif
2423#ifdef USE_SPECULARMAP
2424	uniform mat3 specularMapTransform;
2425	varying vec2 vSpecularMapUv;
2426#endif
2427#ifdef USE_SPECULAR_COLORMAP
2428	uniform mat3 specularColorMapTransform;
2429	varying vec2 vSpecularColorMapUv;
2430#endif
2431#ifdef USE_SPECULAR_INTENSITYMAP
2432	uniform mat3 specularIntensityMapTransform;
2433	varying vec2 vSpecularIntensityMapUv;
2434#endif
2435#ifdef USE_TRANSMISSIONMAP
2436	uniform mat3 transmissionMapTransform;
2437	varying vec2 vTransmissionMapUv;
2438#endif
2439#ifdef USE_THICKNESSMAP
2440	uniform mat3 thicknessMapTransform;
2441	varying vec2 vThicknessMapUv;
2442#endif`,NV=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2443	vUv = vec3( uv, 1 ).xy;
2444#endif
2445#ifdef USE_MAP
2446	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
2447#endif
2448#ifdef USE_ALPHAMAP
2449	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
2450#endif
2451#ifdef USE_LIGHTMAP
2452	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
2453#endif
2454#ifdef USE_AOMAP
2455	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
2456#endif
2457#ifdef USE_BUMPMAP
2458	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
2459#endif
2460#ifdef USE_NORMALMAP
2461	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
2462#endif
2463#ifdef USE_DISPLACEMENTMAP
2464	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
2465#endif
2466#ifdef USE_EMISSIVEMAP
2467	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
2468#endif
2469#ifdef USE_METALNESSMAP
2470	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
2471#endif
2472#ifdef USE_ROUGHNESSMAP
2473	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
2474#endif
2475#ifdef USE_ANISOTROPYMAP
2476	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
2477#endif
2478#ifdef USE_CLEARCOATMAP
2479	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
2480#endif
2481#ifdef USE_CLEARCOAT_NORMALMAP
2482	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
2483#endif
2484#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2485	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
2486#endif
2487#ifdef USE_IRIDESCENCEMAP
2488	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
2489#endif
2490#ifdef USE_IRIDESCENCE_THICKNESSMAP
2491	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
2492#endif
2493#ifdef USE_SHEEN_COLORMAP
2494	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
2495#endif
2496#ifdef USE_SHEEN_ROUGHNESSMAP
2497	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
2498#endif
2499#ifdef USE_SPECULARMAP
2500	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
2501#endif
2502#ifdef USE_SPECULAR_COLORMAP
2503	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
2504#endif
2505#ifdef USE_SPECULAR_INTENSITYMAP
2506	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
2507#endif
2508#ifdef USE_TRANSMISSIONMAP
2509	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
2510#endif
2511#ifdef USE_THICKNESSMAP
2512	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
2513#endif`,DV=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2514	vec4 worldPosition = vec4( transformed, 1.0 );
2515	#ifdef USE_BATCHING
2516		worldPosition = batchingMatrix * worldPosition;
2517	#endif
2518	#ifdef USE_INSTANCING
2519		worldPosition = instanceMatrix * worldPosition;
2520	#endif
2521	worldPosition = modelMatrix * worldPosition;
2522#endif`;const IV=`varying vec2 vUv;
2523uniform mat3 uvTransform;
2524void main() {
2525	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
2526	gl_Position = vec4( position.xy, 1.0, 1.0 );
2527}`,BV=`uniform sampler2D t2D;
2528uniform float backgroundIntensity;
2529varying vec2 vUv;
2530void main() {
2531	vec4 texColor = texture2D( t2D, vUv );
2532	#ifdef DECODE_VIDEO_TEXTURE
2533		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 );
2534	#endif
2535	texColor.rgb *= backgroundIntensity;
2536	gl_FragColor = texColor;
2537	#include <tonemapping_fragment>
2538	#include <colorspace_fragment>
2539}`,FV=`varying vec3 vWorldDirection;
2540#include <common>
2541void main() {
2542	vWorldDirection = transformDirection( position, modelMatrix );
2543	#include <begin_vertex>
2544	#include <project_vertex>
2545	gl_Position.z = gl_Position.w;
2546}`,UV=`#ifdef ENVMAP_TYPE_CUBE
2547	uniform samplerCube envMap;
2548#elif defined( ENVMAP_TYPE_CUBE_UV )
2549	uniform sampler2D envMap;
2550#endif
2551uniform float flipEnvMap;
2552uniform float backgroundBlurriness;
2553uniform float backgroundIntensity;
2554uniform mat3 backgroundRotation;
2555varying vec3 vWorldDirection;
2556#include <cube_uv_reflection_fragment>
2557void main() {
2558	#ifdef ENVMAP_TYPE_CUBE
2559		vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
2560	#elif defined( ENVMAP_TYPE_CUBE_UV )
2561		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
2562	#else
2563		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
2564	#endif
2565	texColor.rgb *= backgroundIntensity;
2566	gl_FragColor = texColor;
2567	#include <tonemapping_fragment>
2568	#include <colorspace_fragment>
2569}`,OV=`varying vec3 vWorldDirection;
2570#include <common>
2571void main() {
2572	vWorldDirection = transformDirection( position, modelMatrix );
2573	#include <begin_vertex>
2574	#include <project_vertex>
2575	gl_Position.z = gl_Position.w;
2576}`,kV=`uniform samplerCube tCube;
2577uniform float tFlip;
2578uniform float opacity;
2579varying vec3 vWorldDirection;
2580void main() {
2581	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
2582	gl_FragColor = texColor;
2583	gl_FragColor.a *= opacity;
2584	#include <tonemapping_fragment>
2585	#include <colorspace_fragment>
2586}`,zV=`#include <common>
2587#include <batching_pars_vertex>
2588#include <uv_pars_vertex>
2589#include <displacementmap_pars_vertex>
2590#include <morphtarget_pars_vertex>
2591#include <skinning_pars_vertex>
2592#include <logdepthbuf_pars_vertex>
2593#include <clipping_planes_pars_vertex>
2594varying vec2 vHighPrecisionZW;
2595void main() {
2596	#include <uv_vertex>
2597	#include <batching_vertex>
2598	#include <skinbase_vertex>
2599	#include <morphinstance_vertex>
2600	#ifdef USE_DISPLACEMENTMAP
2601		#include <beginnormal_vertex>
2602		#include <morphnormal_vertex>
2603		#include <skinnormal_vertex>
2604	#endif
2605	#include <begin_vertex>
2606	#include <morphtarget_vertex>
2607	#include <skinning_vertex>
2608	#include <displacementmap_vertex>
2609	#include <project_vertex>
2610	#include <logdepthbuf_vertex>
2611	#include <clipping_planes_vertex>
2612	vHighPrecisionZW = gl_Position.zw;
2613}`,VV=`#if DEPTH_PACKING == 3200
2614	uniform float opacity;
2615#endif
2616#include <common>
2617#include <packing>
2618#include <uv_pars_fragment>
2619#include <map_pars_fragment>
2620#include <alphamap_pars_fragment>
2621#include <alphatest_pars_fragment>
2622#include <alphahash_pars_fragment>
2623#include <logdepthbuf_pars_fragment>
2624#include <clipping_planes_pars_fragment>
2625varying vec2 vHighPrecisionZW;
2626void main() {
2627	vec4 diffuseColor = vec4( 1.0 );
2628	#include <clipping_planes_fragment>
2629	#if DEPTH_PACKING == 3200
2630		diffuseColor.a = opacity;
2631	#endif
2632	#include <map_fragment>
2633	#include <alphamap_fragment>
2634	#include <alphatest_fragment>
2635	#include <alphahash_fragment>
2636	#include <logdepthbuf_fragment>
2637	float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
2638	#if DEPTH_PACKING == 3200
2639		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
2640	#elif DEPTH_PACKING == 3201
2641		gl_FragColor = packDepthToRGBA( fragCoordZ );
2642	#elif DEPTH_PACKING == 3202
2643		gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
2644	#elif DEPTH_PACKING == 3203
2645		gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
2646	#endif
2647}`,GV=`#define DISTANCE
2648varying vec3 vWorldPosition;
2649#include <common>
2650#include <batching_pars_vertex>
2651#include <uv_pars_vertex>
2652#include <displacementmap_pars_vertex>
2653#include <morphtarget_pars_vertex>
2654#include <skinning_pars_vertex>
2655#include <clipping_planes_pars_vertex>
2656void main() {
2657	#include <uv_vertex>
2658	#include <batching_vertex>
2659	#include <skinbase_vertex>
2660	#include <morphinstance_vertex>
2661	#ifdef USE_DISPLACEMENTMAP
2662		#include <beginnormal_vertex>
2663		#include <morphnormal_vertex>
2664		#include <skinnormal_vertex>
2665	#endif
2666	#include <begin_vertex>
2667	#include <morphtarget_vertex>
2668	#include <skinning_vertex>
2669	#include <displacementmap_vertex>
2670	#include <project_vertex>
2671	#include <worldpos_vertex>
2672	#include <clipping_planes_vertex>
2673	vWorldPosition = worldPosition.xyz;
2674}`,qV=`#define DISTANCE
2675uniform vec3 referencePosition;
2676uniform float nearDistance;
2677uniform float farDistance;
2678varying vec3 vWorldPosition;
2679#include <common>
2680#include <packing>
2681#include <uv_pars_fragment>
2682#include <map_pars_fragment>
2683#include <alphamap_pars_fragment>
2684#include <alphatest_pars_fragment>
2685#include <alphahash_pars_fragment>
2686#include <clipping_planes_pars_fragment>
2687void main () {
2688	vec4 diffuseColor = vec4( 1.0 );
2689	#include <clipping_planes_fragment>
2690	#include <map_fragment>
2691	#include <alphamap_fragment>
2692	#include <alphatest_fragment>
2693	#include <alphahash_fragment>
2694	float dist = length( vWorldPosition - referencePosition );
2695	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
2696	dist = saturate( dist );
2697	gl_FragColor = packDepthToRGBA( dist );
2698}`,HV=`varying vec3 vWorldDirection;
2699#include <common>
2700void main() {
2701	vWorldDirection = transformDirection( position, modelMatrix );
2702	#include <begin_vertex>
2703	#include <project_vertex>
2704}`,WV=`uniform sampler2D tEquirect;
2705varying vec3 vWorldDirection;
2706#include <common>
2707void main() {
2708	vec3 direction = normalize( vWorldDirection );
2709	vec2 sampleUV = equirectUv( direction );
2710	gl_FragColor = texture2D( tEquirect, sampleUV );
2711	#include <tonemapping_fragment>
2712	#include <colorspace_fragment>
2713}`,$V=`uniform float scale;
2714attribute float lineDistance;
2715varying float vLineDistance;
2716#include <common>
2717#include <uv_pars_vertex>
2718#include <color_pars_vertex>
2719#include <fog_pars_vertex>
2720#include <morphtarget_pars_vertex>
2721#include <logdepthbuf_pars_vertex>
2722#include <clipping_planes_pars_vertex>
2723void main() {
2724	vLineDistance = scale * lineDistance;
2725	#include <uv_vertex>
2726	#include <color_vertex>
2727	#include <morphinstance_vertex>
2728	#include <morphcolor_vertex>
2729	#include <begin_vertex>
2730	#include <morphtarget_vertex>
2731	#include <project_vertex>
2732	#include <logdepthbuf_vertex>
2733	#include <clipping_planes_vertex>
2734	#include <fog_vertex>
2735}`,jV=`uniform vec3 diffuse;
2736uniform float opacity;
2737uniform float dashSize;
2738uniform float totalSize;
2739varying float vLineDistance;
2740#include <common>
2741#include <color_pars_fragment>
2742#include <uv_pars_fragment>
2743#include <map_pars_fragment>
2744#include <fog_pars_fragment>
2745#include <logdepthbuf_pars_fragment>
2746#include <clipping_planes_pars_fragment>
2747void main() {
2748	vec4 diffuseColor = vec4( diffuse, opacity );
2749	#include <clipping_planes_fragment>
2750	if ( mod( vLineDistance, totalSize ) > dashSize ) {
2751		discard;
2752	}
2753	vec3 outgoingLight = vec3( 0.0 );
2754	#include <logdepthbuf_fragment>
2755	#include <map_fragment>
2756	#include <color_fragment>
2757	outgoingLight = diffuseColor.rgb;
2758	#include <opaque_fragment>
2759	#include <tonemapping_fragment>
2760	#include <colorspace_fragment>
2761	#include <fog_fragment>
2762	#include <premultiplied_alpha_fragment>
2763}`,XV=`#include <common>
2764#include <batching_pars_vertex>
2765#include <uv_pars_vertex>
2766#include <envmap_pars_vertex>
2767#include <color_pars_vertex>
2768#include <fog_pars_vertex>
2769#include <morphtarget_pars_vertex>
2770#include <skinning_pars_vertex>
2771#include <logdepthbuf_pars_vertex>
2772#include <clipping_planes_pars_vertex>
2773void main() {
2774	#include <uv_vertex>
2775	#include <color_vertex>
2776	#include <morphinstance_vertex>
2777	#include <morphcolor_vertex>
2778	#include <batching_vertex>
2779	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
2780		#include <beginnormal_vertex>
2781		#include <morphnormal_vertex>
2782		#include <skinbase_vertex>
2783		#include <skinnormal_vertex>
2784		#include <defaultnormal_vertex>
2785	#endif
2786	#include <begin_vertex>
2787	#include <morphtarget_vertex>
2788	#include <skinning_vertex>
2789	#include <project_vertex>
2790	#include <logdepthbuf_vertex>
2791	#include <clipping_planes_vertex>
2792	#include <worldpos_vertex>
2793	#include <envmap_vertex>
2794	#include <fog_vertex>
2795}`,YV=`uniform vec3 diffuse;
2796uniform float opacity;
2797#ifndef FLAT_SHADED
2798	varying vec3 vNormal;
2799#endif
2800#include <common>
2801#include <dithering_pars_fragment>
2802#include <color_pars_fragment>
2803#include <uv_pars_fragment>
2804#include <map_pars_fragment>
2805#include <alphamap_pars_fragment>
2806#include <alphatest_pars_fragment>
2807#include <alphahash_pars_fragment>
2808#include <aomap_pars_fragment>
2809#include <lightmap_pars_fragment>
2810#include <envmap_common_pars_fragment>
2811#include <envmap_pars_fragment>
2812#include <fog_pars_fragment>
2813#include <specularmap_pars_fragment>
2814#include <logdepthbuf_pars_fragment>
2815#include <clipping_planes_pars_fragment>
2816void main() {
2817	vec4 diffuseColor = vec4( diffuse, opacity );
2818	#include <clipping_planes_fragment>
2819	#include <logdepthbuf_fragment>
2820	#include <map_fragment>
2821	#include <color_fragment>
2822	#include <alphamap_fragment>
2823	#include <alphatest_fragment>
2824	#include <alphahash_fragment>
2825	#include <specularmap_fragment>
2826	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
2827	#ifdef USE_LIGHTMAP
2828		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
2829		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
2830	#else
2831		reflectedLight.indirectDiffuse += vec3( 1.0 );
2832	#endif
2833	#include <aomap_fragment>
2834	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
2835	vec3 outgoingLight = reflectedLight.indirectDiffuse;
2836	#include <envmap_fragment>
2837	#include <opaque_fragment>
2838	#include <tonemapping_fragment>
2839	#include <colorspace_fragment>
2840	#include <fog_fragment>
2841	#include <premultiplied_alpha_fragment>
2842	#include <dithering_fragment>
2843}`,QV=`#define LAMBERT
2844varying vec3 vViewPosition;
2845#include <common>
2846#include <batching_pars_vertex>
2847#include <uv_pars_vertex>
2848#include <displacementmap_pars_vertex>
2849#include <envmap_pars_vertex>
2850#include <color_pars_vertex>
2851#include <fog_pars_vertex>
2852#include <normal_pars_vertex>
2853#include <morphtarget_pars_vertex>
2854#include <skinning_pars_vertex>
2855#include <shadowmap_pars_vertex>
2856#include <logdepthbuf_pars_vertex>
2857#include <clipping_planes_pars_vertex>
2858void main() {
2859	#include <uv_vertex>
2860	#include <color_vertex>
2861	#include <morphinstance_vertex>
2862	#include <morphcolor_vertex>
2863	#include <batching_vertex>
2864	#include <beginnormal_vertex>
2865	#include <morphnormal_vertex>
2866	#include <skinbase_vertex>
2867	#include <skinnormal_vertex>
2868	#include <defaultnormal_vertex>
2869	#include <normal_vertex>
2870	#include <begin_vertex>
2871	#include <morphtarget_vertex>
2872	#include <skinning_vertex>
2873	#include <displacementmap_vertex>
2874	#include <project_vertex>
2875	#include <logdepthbuf_vertex>
2876	#include <clipping_planes_vertex>
2877	vViewPosition = - mvPosition.xyz;
2878	#include <worldpos_vertex>
2879	#include <envmap_vertex>
2880	#include <shadowmap_vertex>
2881	#include <fog_vertex>
2882}`,ZV=`#define LAMBERT
2883uniform vec3 diffuse;
2884uniform vec3 emissive;
2885uniform float opacity;
2886#include <common>
2887#include <packing>
2888#include <dithering_pars_fragment>
2889#include <color_pars_fragment>
2890#include <uv_pars_fragment>
2891#include <map_pars_fragment>
2892#include <alphamap_pars_fragment>
2893#include <alphatest_pars_fragment>
2894#include <alphahash_pars_fragment>
2895#include <aomap_pars_fragment>
2896#include <lightmap_pars_fragment>
2897#include <emissivemap_pars_fragment>
2898#include <envmap_common_pars_fragment>
2899#include <envmap_pars_fragment>
2900#include <fog_pars_fragment>
2901#include <bsdfs>
2902#include <lights_pars_begin>
2903#include <normal_pars_fragment>
2904#include <lights_lambert_pars_fragment>
2905#include <shadowmap_pars_fragment>
2906#include <bumpmap_pars_fragment>
2907#include <normalmap_pars_fragment>
2908#include <specularmap_pars_fragment>
2909#include <logdepthbuf_pars_fragment>
2910#include <clipping_planes_pars_fragment>
2911void main() {
2912	vec4 diffuseColor = vec4( diffuse, opacity );
2913	#include <clipping_planes_fragment>
2914	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
2915	vec3 totalEmissiveRadiance = emissive;
2916	#include <logdepthbuf_fragment>
2917	#include <map_fragment>
2918	#include <color_fragment>
2919	#include <alphamap_fragment>
2920	#include <alphatest_fragment>
2921	#include <alphahash_fragment>
2922	#include <specularmap_fragment>
2923	#include <normal_fragment_begin>
2924	#include <normal_fragment_maps>
2925	#include <emissivemap_fragment>
2926	#include <lights_lambert_fragment>
2927	#include <lights_fragment_begin>
2928	#include <lights_fragment_maps>
2929	#include <lights_fragment_end>
2930	#include <aomap_fragment>
2931	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
2932	#include <envmap_fragment>
2933	#include <opaque_fragment>
2934	#include <tonemapping_fragment>
2935	#include <colorspace_fragment>
2936	#include <fog_fragment>
2937	#include <premultiplied_alpha_fragment>
2938	#include <dithering_fragment>
2939}`,KV=`#define MATCAP
2940varying vec3 vViewPosition;
2941#include <common>
2942#include <batching_pars_vertex>
2943#include <uv_pars_vertex>
2944#include <color_pars_vertex>
2945#include <displacementmap_pars_vertex>
2946#include <fog_pars_vertex>
2947#include <normal_pars_vertex>
2948#include <morphtarget_pars_vertex>
2949#include <skinning_pars_vertex>
2950#include <logdepthbuf_pars_vertex>
2951#include <clipping_planes_pars_vertex>
2952void main() {
2953	#include <uv_vertex>
2954	#include <color_vertex>
2955	#include <morphinstance_vertex>
2956	#include <morphcolor_vertex>
2957	#include <batching_vertex>
2958	#include <beginnormal_vertex>
2959	#include <morphnormal_vertex>
2960	#include <skinbase_vertex>
2961	#include <skinnormal_vertex>
2962	#include <defaultnormal_vertex>
2963	#include <normal_vertex>
2964	#include <begin_vertex>
2965	#include <morphtarget_vertex>
2966	#include <skinning_vertex>
2967	#include <displacementmap_vertex>
2968	#include <project_vertex>
2969	#include <logdepthbuf_vertex>
2970	#include <clipping_planes_vertex>
2971	#include <fog_vertex>
2972	vViewPosition = - mvPosition.xyz;
2973}`,JV=`#define MATCAP
2974uniform vec3 diffuse;
2975uniform float opacity;
2976uniform sampler2D matcap;
2977varying vec3 vViewPosition;
2978#include <common>
2979#include <dithering_pars_fragment>
2980#include <color_pars_fragment>
2981#include <uv_pars_fragment>
2982#include <map_pars_fragment>
2983#include <alphamap_pars_fragment>
2984#include <alphatest_pars_fragment>
2985#include <alphahash_pars_fragment>
2986#include <fog_pars_fragment>
2987#include <normal_pars_fragment>
2988#include <bumpmap_pars_fragment>
2989#include <normalmap_pars_fragment>
2990#include <logdepthbuf_pars_fragment>
2991#include <clipping_planes_pars_fragment>
2992void main() {
2993	ve
2993c4 diffuseColor = vec4( diffuse, opacity );
2994	#include <clipping_planes_fragment>
2995	#include <logdepthbuf_fragment>
2996	#include <map_fragment>
2997	#include <color_fragment>
2998	#include <alphamap_fragment>
2999	#include <alphatest_fragment>
3000	#include <alphahash_fragment>
3001	#include <normal_fragment_begin>
3002	#include <normal_fragment_maps>
3003	vec3 viewDir = normalize( vViewPosition );
3004	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
3005	vec3 y = cross( viewDir, x );
3006	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
3007	#ifdef USE_MATCAP
3008		vec4 matcapColor = texture2D( matcap, uv );
3009	#else
3010		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
3011	#endif
3012	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
3013	#include <opaque_fragment>
3014	#include <tonemapping_fragment>
3015	#include <colorspace_fragment>
3016	#include <fog_fragment>
3017	#include <premultiplied_alpha_fragment>
3018	#include <dithering_fragment>
3019}`,eG=`#define NORMAL
3020#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3021	varying vec3 vViewPosition;
3022#endif
3023#include <common>
3024#include <batching_pars_vertex>
3025#include <uv_pars_vertex>
3026#include <displacementmap_pars_vertex>
3027#include <normal_pars_vertex>
3028#include <morphtarget_pars_vertex>
3029#include <skinning_pars_vertex>
3030#include <logdepthbuf_pars_vertex>
3031#include <clipping_planes_pars_vertex>
3032void main() {
3033	#include <uv_vertex>
3034	#include <batching_vertex>
3035	#include <beginnormal_vertex>
3036	#include <morphinstance_vertex>
3037	#include <morphnormal_vertex>
3038	#include <skinbase_vertex>
3039	#include <skinnormal_vertex>
3040	#include <defaultnormal_vertex>
3041	#include <normal_vertex>
3042	#include <begin_vertex>
3043	#include <morphtarget_vertex>
3044	#include <skinning_vertex>
3045	#include <displacementmap_vertex>
3046	#include <project_vertex>
3047	#include <logdepthbuf_vertex>
3048	#include <clipping_planes_vertex>
3049#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3050	vViewPosition = - mvPosition.xyz;
3051#endif
3052}`,tG=`#define NORMAL
3053uniform float opacity;
3054#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3055	varying vec3 vViewPosition;
3056#endif
3057#include <packing>
3058#include <uv_pars_fragment>
3059#include <normal_pars_fragment>
3060#include <bumpmap_pars_fragment>
3061#include <normalmap_pars_fragment>
3062#include <logdepthbuf_pars_fragment>
3063#include <clipping_planes_pars_fragment>
3064void main() {
3065	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
3066	#include <clipping_planes_fragment>
3067	#include <logdepthbuf_fragment>
3068	#include <normal_fragment_begin>
3069	#include <normal_fragment_maps>
3070	gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );
3071	#ifdef OPAQUE
3072		gl_FragColor.a = 1.0;
3073	#endif
3074}`,nG=`#define PHONG
3075varying vec3 vViewPosition;
3076#include <common>
3077#include <batching_pars_vertex>
3078#include <uv_pars_vertex>
3079#include <displacementmap_pars_vertex>
3080#include <envmap_pars_vertex>
3081#include <color_pars_vertex>
3082#include <fog_pars_vertex>
3083#include <normal_pars_vertex>
3084#include <morphtarget_pars_vertex>
3085#include <skinning_pars_vertex>
3086#include <shadowmap_pars_vertex>
3087#include <logdepthbuf_pars_vertex>
3088#include <clipping_planes_pars_vertex>
3089void main() {
3090	#include <uv_vertex>
3091	#include <color_vertex>
3092	#include <morphcolor_vertex>
3093	#include <batching_vertex>
3094	#include <beginnormal_vertex>
3095	#include <morphinstance_vertex>
3096	#include <morphnormal_vertex>
3097	#include <skinbase_vertex>
3098	#include <skinnormal_vertex>
3099	#include <defaultnormal_vertex>
3100	#include <normal_vertex>
3101	#include <begin_vertex>
3102	#include <morphtarget_vertex>
3103	#include <skinning_vertex>
3104	#include <displacementmap_vertex>
3105	#include <project_vertex>
3106	#include <logdepthbuf_vertex>
3107	#include <clipping_planes_vertex>
3108	vViewPosition = - mvPosition.xyz;
3109	#include <worldpos_vertex>
3110	#include <envmap_vertex>
3111	#include <shadowmap_vertex>
3112	#include <fog_vertex>
3113}`,iG=`#define PHONG
3114uniform vec3 diffuse;
3115uniform vec3 emissive;
3116uniform vec3 specular;
3117uniform float shininess;
3118uniform float opacity;
3119#include <common>
3120#include <packing>
3121#include <dithering_pars_fragment>
3122#include <color_pars_fragment>
3123#include <uv_pars_fragment>
3124#include <map_pars_fragment>
3125#include <alphamap_pars_fragment>
3126#include <alphatest_pars_fragment>
3127#include <alphahash_pars_fragment>
3128#include <aomap_pars_fragment>
3129#include <lightmap_pars_fragment>
3130#include <emissivemap_pars_fragment>
3131#include <envmap_common_pars_fragment>
3132#include <envmap_pars_fragment>
3133#include <fog_pars_fragment>
3134#include <bsdfs>
3135#include <lights_pars_begin>
3136#include <normal_pars_fragment>
3137#include <lights_phong_pars_fragment>
3138#include <shadowmap_pars_fragment>
3139#include <bumpmap_pars_fragment>
3140#include <normalmap_pars_fragment>
3141#include <specularmap_pars_fragment>
3142#include <logdepthbuf_pars_fragment>
3143#include <clipping_planes_pars_fragment>
3144void main() {
3145	vec4 diffuseColor = vec4( diffuse, opacity );
3146	#include <clipping_planes_fragment>
3147	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3148	vec3 totalEmissiveRadiance = emissive;
3149	#include <logdepthbuf_fragment>
3150	#include <map_fragment>
3151	#include <color_fragment>
3152	#include <alphamap_fragment>
3153	#include <alphatest_fragment>
3154	#include <alphahash_fragment>
3155	#include <specularmap_fragment>
3156	#include <normal_fragment_begin>
3157	#include <normal_fragment_maps>
3158	#include <emissivemap_fragment>
3159	#include <lights_phong_fragment>
3160	#include <lights_fragment_begin>
3161	#include <lights_fragment_maps>
3162	#include <lights_fragment_end>
3163	#include <aomap_fragment>
3164	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
3165	#include <envmap_fragment>
3166	#include <opaque_fragment>
3167	#include <tonemapping_fragment>
3168	#include <colorspace_fragment>
3169	#include <fog_fragment>
3170	#include <premultiplied_alpha_fragment>
3171	#include <dithering_fragment>
3172}`,rG=`#define STANDARD
3173varying vec3 vViewPosition;
3174#ifdef USE_TRANSMISSION
3175	varying vec3 vWorldPosition;
3176#endif
3177#include <common>
3178#include <batching_pars_vertex>
3179#include <uv_pars_vertex>
3180#include <displacementmap_pars_vertex>
3181#include <color_pars_vertex>
3182#include <fog_pars_vertex>
3183#include <normal_pars_vertex>
3184#include <morphtarget_pars_vertex>
3185#include <skinning_pars_vertex>
3186#include <shadowmap_pars_vertex>
3187#include <logdepthbuf_pars_vertex>
3188#include <clipping_planes_pars_vertex>
3189void main() {
3190	#include <uv_vertex>
3191	#include <color_vertex>
3192	#include <morphinstance_vertex>
3193	#include <morphcolor_vertex>
3194	#include <batching_vertex>
3195	#include <beginnormal_vertex>
3196	#include <morphnormal_vertex>
3197	#include <skinbase_vertex>
3198	#include <skinnormal_vertex>
3199	#include <defaultnormal_vertex>
3200	#include <normal_vertex>
3201	#include <begin_vertex>
3202	#include <morphtarget_vertex>
3203	#include <skinning_vertex>
3204	#include <displacementmap_vertex>
3205	#include <project_vertex>
3206	#include <logdepthbuf_vertex>
3207	#include <clipping_planes_vertex>
3208	vViewPosition = - mvPosition.xyz;
3209	#include <worldpos_vertex>
3210	#include <shadowmap_vertex>
3211	#include <fog_vertex>
3212#ifdef USE_TRANSMISSION
3213	vWorldPosition = worldPosition.xyz;
3214#endif
3215}`,sG=`#define STANDARD
3216#ifdef PHYSICAL
3217	#define IOR
3218	#define USE_SPECULAR
3219#endif
3220uniform vec3 diffuse;
3221uniform vec3 emissive;
3222uniform float roughness;
3223uniform float metalness;
3224uniform float opacity;
3225#ifdef IOR
3226	uniform float ior;
3227#endif
3228#ifdef USE_SPECULAR
3229	uniform float specularIntensity;
3230	uniform vec3 specularColor;
3231	#ifdef USE_SPECULAR_COLORMAP
3232		uniform sampler2D specularColorMap;
3233	#endif
3234	#ifdef USE_SPECULAR_INTENSITYMAP
3235		uniform sampler2D specularIntensityMap;
3236	#endif
3237#endif
3238#ifdef USE_CLEARCOAT
3239	uniform float clearcoat;
3240	uniform float clearcoatRoughness;
3241#endif
3242#ifdef USE_DISPERSION
3243	uniform float dispersion;
3244#endif
3245#ifdef USE_IRIDESCENCE
3246	uniform float iridescence;
3247	uniform float iridescenceIOR;
3248	uniform float iridescenceThicknessMinimum;
3249	uniform float iridescenceThicknessMaximum;
3250#endif
3251#ifdef USE_SHEEN
3252	uniform vec3 sheenColor;
3253	uniform float sheenRoughness;
3254	#ifdef USE_SHEEN_COLORMAP
3255		uniform sampler2D sheenColorMap;
3256	#endif
3257	#ifdef USE_SHEEN_ROUGHNESSMAP
3258		uniform sampler2D sheenRoughnessMap;
3259	#endif
3260#endif
3261#ifdef USE_ANISOTROPY
3262	uniform vec2 anisotropyVector;
3263	#ifdef USE_ANISOTROPYMAP
3264		uniform sampler2D anisotropyMap;
3265	#endif
3266#endif
3267varying vec3 vViewPosition;
3268#include <common>
3269#include <packing>
3270#include <dithering_pars_fragment>
3271#include <color_pars_fragment>
3272#include <uv_pars_fragment>
3273#include <map_pars_fragment>
3274#include <alphamap_pars_fragment>
3275#include <alphatest_pars_fragment>
3276#include <alphahash_pars_fragment>
3277#include <aomap_pars_fragment>
3278#include <lightmap_pars_fragment>
3279#include <emissivemap_pars_fragment>
3280#include <iridescence_fragment>
3281#include <cube_uv_reflection_fragment>
3282#include <envmap_common_pars_fragment>
3283#include <envmap_physical_pars_fragment>
3284#include <fog_pars_fragment>
3285#include <lights_pars_begin>
3286#include <normal_pars_fragment>
3287#include <lights_physical_pars_fragment>
3288#include <transmission_pars_fragment>
3289#include <shadowmap_pars_fragment>
3290#include <bumpmap_pars_fragment>
3291#include <normalmap_pars_fragment>
3292#include <clearcoat_pars_fragment>
3293#include <iridescence_pars_fragment>
3294#include <roughnessmap_pars_fragment>
3295#include <metalnessmap_pars_fragment>
3296#include <logdepthbuf_pars_fragment>
3297#include <clipping_planes_pars_fragment>
3298void main() {
3299	vec4 diffuseColor = vec4( diffuse, opacity );
3300	#include <clipping_planes_fragment>
3301	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3302	vec3 totalEmissiveRadiance = emissive;
3303	#include <logdepthbuf_fragment>
3304	#include <map_fragment>
3305	#include <color_fragment>
3306	#include <alphamap_fragment>
3307	#include <alphatest_fragment>
3308	#include <alphahash_fragment>
3309	#include <roughnessmap_fragment>
3310	#include <metalnessmap_fragment>
3311	#include <normal_fragment_begin>
3312	#include <normal_fragment_maps>
3313	#include <clearcoat_normal_fragment_begin>
3314	#include <clearcoat_normal_fragment_maps>
3315	#include <emissivemap_fragment>
3316	#include <lights_physical_fragment>
3317	#include <lights_fragment_begin>
3318	#include <lights_fragment_maps>
3319	#include <lights_fragment_end>
3320	#include <aomap_fragment>
3321	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
3322	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
3323	#include <transmission_fragment>
3324	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
3325	#ifdef USE_SHEEN
3326		float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
3327		outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
3328	#endif
3329	#ifdef USE_CLEARCOAT
3330		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
3331		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
3332		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
3333	#endif
3334	#include <opaque_fragment>
3335	#include <tonemapping_fragment>
3336	#include <colorspace_fragment>
3337	#include <fog_fragment>
3338	#include <premultiplied_alpha_fragment>
3339	#include <dithering_fragment>
3340}`,oG=`#define TOON
3341varying vec3 vViewPosition;
3342#include <common>
3343#include <batching_pars_vertex>
3344#include <uv_pars_vertex>
3345#include <displacementmap_pars_vertex>
3346#include <color_pars_vertex>
3347#include <fog_pars_vertex>
3348#include <normal_pars_vertex>
3349#include <morphtarget_pars_vertex>
3350#include <skinning_pars_vertex>
3351#include <shadowmap_pars_vertex>
3352#include <logdepthbuf_pars_vertex>
3353#include <clipping_planes_pars_vertex>
3354void main() {
3355	#include <uv_vertex>
3356	#include <color_vertex>
3357	#include <morphinstance_vertex>
3358	#include <morphcolor_vertex>
3359	#include <batching_vertex>
3360	#include <beginnormal_vertex>
3361	#include <morphnormal_vertex>
3362	#include <skinbase_vertex>
3363	#include <skinnormal_vertex>
3364	#include <defaultnormal_vertex>
3365	#include <normal_vertex>
3366	#include <begin_vertex>
3367	#include <morphtarget_vertex>
3368	#include <skinning_vertex>
3369	#include <displacementmap_vertex>
3370	#include <project_vertex>
3371	#include <logdepthbuf_vertex>
3372	#include <clipping_planes_vertex>
3373	vViewPosition = - mvPosition.xyz;
3374	#include <worldpos_vertex>
3375	#include <shadowmap_vertex>
3376	#include <fog_vertex>
3377}`,aG=`#define TOON
3378uniform vec3 diffuse;
3379uniform vec3 emissive;
3380uniform float opacity;
3381#include <common>
3382#include <packing>
3383#include <dithering_pars_fragment>
3384#include <color_pars_fragment>
3385#include <uv_pars_fragment>
3386#include <map_pars_fragment>
3387#include <alphamap_pars_fragment>
3388#include <alphatest_pars_fragment>
3389#include <alphahash_pars_fragment>
3390#include <aomap_pars_fragment>
3391#include <lightmap_pars_fragment>
3392#include <emissivemap_pars_fragment>
3393#include <gradientmap_pars_fragment>
3394#include <fog_pars_fragment>
3395#include <bsdfs>
3396#include <lights_pars_begin>
3397#include <normal_pars_fragment>
3398#include <lights_toon_pars_fragment>
3399#include <shadowmap_pars_fragment>
3400#include <bumpmap_pars_fragment>
3401#include <normalmap_pars_fragment>
3402#include <logdepthbuf_pars_fragment>
3403#include <clipping_planes_pars_fragment>
3404void main() {
3405	vec4 diffuseColor = vec4( diffuse, opacity );
3406	#include <clipping_planes_fragment>
3407	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3408	vec3 totalEmissiveRadiance = emissive;
3409	#include <logdepthbuf_fragment>
3410	#include <map_fragment>
3411	#include <color_fragment>
3412	#include <alphamap_fragment>
3413	#include <alphatest_fragment>
3414	#include <alphahash_fragment>
3415	#include <normal_fragment_begin>
3416	#include <normal_fragment_maps>
3417	#include <emissivemap_fragment>
3418	#include <lights_toon_fragment>
3419	#include <lights_fragment_begin>
3420	#include <lights_fragment_maps>
3421	#include <lights_fragment_end>
3422	#include <aomap_fragment>
3423	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3424	#include <opaque_fragment>
3425	#include <tonemapping_fragment>
3426	#include <colorspace_fragment>
3427	#include <fog_fragment>
3428	#include <premultiplied_alpha_fragment>
3429	#include <dithering_fragment>
3430}`,lG=`uniform float size;
3431uniform float scale;
3432#include <common>
3433#include <color_pars_vertex>
3434#include <fog_pars_vertex>
3435#include <morphtarget_pars_vertex>
3436#include <logdepthbuf_pars_vertex>
3437#include <clipping_planes_pars_vertex>
3438#ifdef USE_POINTS_UV
3439	varying vec2 vUv;
3440	uniform mat3 uvTransform;
3441#endif
3442void main() {
3443	#ifdef USE_POINTS_UV
3444		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
3445	#endif
3446	#include <color_vertex>
3447	#include <morphinstance_vertex>
3448	#include <morphcolor_vertex>
3449	#include <begin_vertex>
3450	#include <morphtarget_vertex>
3451	#include <project_vertex>
3452	gl_PointSize = size;
3453	#ifdef USE_SIZEATTENUATION
3454		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3455		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
3456	#endif
3457	#include <logdepthbuf_vertex>
3458	#include <clipping_planes_vertex>
3459	#include <worldpos_vertex>
3460	#include <fog_vertex>
3461}`,cG=`uniform vec3 diffuse;
3462uniform float opacity;
3463#include <common>
3464#include <color_pars_fragment>
3465#include <map_particle_pars_fragment>
3466#include <alphatest_pars_fragment>
3467#include <alphahash_pars_fragment>
3468#include <fog_pars_fragment>
3469#include <logdepthbuf_pars_fragment>
3470#include <clipping_planes_pars_fragment>
3471void main() {
3472	vec4 diffuseColor = vec4( diffuse, opacity );
3473	#include <clipping_planes_fragment>
3474	vec3 outgoingLight = vec3( 0.0 );
3475	#include <logdepthbuf_fragment>
3476	#include <map_particle_fragment>
3477	#include <color_fragment>
3478	#include <alphatest_fragment>
3479	#include <alphahash_fragment>
3480	outgoingLight = diffuseColor.rgb;
3481	#include <opaque_fragment>
3482	#include <tonemapping_fragment>
3483	#include <colorspace_fragment>
3484	#include <fog_fragment>
3485	#include <premultiplied_alpha_fragment>
3486}`,uG=`#include <common>
3487#include <batching_pars_vertex>
3488#include <fog_pars_vertex>
3489#include <morphtarget_pars_vertex>
3490#include <skinning_pars_vertex>
3491#include <logdepthbuf_pars_vertex>
3492#include <shadowmap_pars_vertex>
3493void main() {
3494	#include <batching_vertex>
3495	#include <beginnormal_vertex>
3496	#include <morphinstance_vertex>
3497	#include <morphnormal_vertex>
3498	#include <skinbase_vertex>
3499	#include <skinnormal_vertex>
3500	#include <defaultnormal_vertex>
3501	#include <begin_vertex>
3502	#include <morphtarget_vertex>
3503	#include <skinning_vertex>
3504	#include <project_vertex>
3505	#include <logdepthbuf_vertex>
3506	#include <worldpos_vertex>
3507	#include <shadowmap_vertex>
3508	#include <fog_vertex>
3509}`,hG=`uniform vec3 color;
3510uniform float opacity;
3511#include <common>
3512#include <packing>
3513#include <fog_pars_fragment>
3514#include <bsdfs>
3515#include <lights_pars_begin>
3516#include <logdepthbuf_pars_fragment>
3517#include <shadowmap_pars_fragment>
3518#include <shadowmask_pars_fragment>
3519void main() {
3520	#include <logdepthbuf_fragment>
3521	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
3522	#include <tonemapping_fragment>
3523	#include <colorspace_fragment>
3524	#include <fog_fragment>
3525}`,dG=`uniform float rotation;
3526uniform vec2 center;
3527#include <common>
3528#include <uv_pars_vertex>
3529#include <fog_pars_vertex>
3530#include <logdepthbuf_pars_vertex>
3531#include <clipping_planes_pars_vertex>
3532void main() {
3533	#include <uv_vertex>
3534	vec4 mvPosition = modelViewMatrix[ 3 ];
3535	vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
3536	#ifndef USE_SIZEATTENUATION
3537		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3538		if ( isPerspective ) scale *= - mvPosition.z;
3539	#endif
3540	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
3541	vec2 rotatedPosition;
3542	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
3543	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
3544	mvPosition.xy += rotatedPosition;
3545	gl_Position = projectionMatrix * mvPosition;
3546	#include <logdepthbuf_vertex>
3547	#include <clipping_planes_vertex>
3548	#include <fog_vertex>
3549}`,fG=`uniform vec3 diffuse;
3550uniform float opacity;
3551#include <common>
3552#include <uv_pars_fragment>
3553#include <map_pars_fragment>
3554#include <alphamap_pars_fragment>
3555#include <alphatest_pars_fragment>
3556#include <alphahash_pars_fragment>
3557#include <fog_pars_fragment>
3558#include <logdepthbuf_pars_fragment>
3559#include <clipping_planes_pars_fragment>
3560void main() {
3561	vec4 diffuseColor = vec4( diffuse, opacity );
3562	#include <clipping_planes_fragment>
3563	vec3 outgoingLight = vec3( 0.0 );
3564	#include <logdepthbuf_fragment>
3565	#include <map_fragment>
3566	#include <alphamap_fragment>
3567	#include <alphatest_fragment>
3568	#include <alphahash_fragment>
3569	outgoingLight = diffuseColor.rgb;
3570	#include <opaque_fragment>
3571	#include <tonemapping_fragment>
3572	#include <colorspace_fragment>
3573	#include <fog_fragment>
3574}`,Pn={alphahash_fragment:Bk,alphahash_pars_fragment:Fk,alphamap_fragment:Uk,alphamap_pars_fragment:Ok,alphatest_fragment:kk,alphatest_pars_fragment:zk,aomap_fragment:Vk,aomap_pars_fragment:Gk,batching_pars_vertex:qk,batching_vertex:Hk,begin_vertex:Wk,beginnormal_vertex:$k,bsdfs:jk,iridescence_fragment:Xk,bumpmap_pars_fragment:Yk,clipping_planes_fragment:Qk,clipping_planes_pars_fragment:Zk,clipping_planes_pars_vertex:Kk,clipping_planes_vertex:Jk,color_fragment:ez,color_pars_fragment:tz,color_pars_vertex:nz,color_vertex:iz,common:rz,cube_uv_reflection_fragment:sz,defaultnormal_vertex:oz,displacementmap_pars_vertex:az,displacementmap_vertex:lz,emissivemap_fragment:cz,emissivemap_pars_fragment:uz,colorspace_fragment:hz,colorspace_pars_fragment:dz,envmap_fragment:fz,envmap_common_pars_fragment:pz,envmap_pars_fragment:Az,envmap_pars_vertex:mz,envmap_physical_pars_fragment:Ez,envmap_vertex:gz,fog_vertex:_z,fog_pars_vertex:vz,fog_fragment:yz,fog_pars_fragment:xz,gradientmap_pars_fragment:bz,lightmap_pars_fragment:Sz,lights_lambert_fragment:Mz,lights_lambert_pars_fragment:wz,lights_pars_begin:Tz,lights_toon_fragment:Rz,lights_toon_pars_fragment:Cz,lights_phong_fragment:Pz,lights_phong_pars_fragment:Lz,lights_physical_fragment:Nz,lights_physical_pars_fragment:Dz,lights_fragment_begin:Iz,lights_fragment_maps:Bz,lights_fragment_end:Fz,logdepthbuf_fragment:Uz,logdepthbuf_pars_fragment:Oz,logdepthbuf_pars_vertex:kz,logdepthbuf_vertex:zz,map_fragment:Vz,map_pars_fragment:Gz,map_particle_fragment:qz,map_particle_pars_fragment:Hz,metalnessmap_fragment:Wz,metalnessmap_pars_fragment:$z,morphinstance_vertex:jz,morphcolor_vertex:Xz,morphnormal_vertex:Yz,morphtarget_pars_vertex:Qz,morphtarget_vertex:Zz,normal_fragment_begin:Kz,normal_fragment_maps:Jz,normal_pars_fragment:eV,normal_pars_vertex:tV,normal_vertex:nV,normalmap_pars_fragment:iV,clearcoat_normal_fragment_begin:rV,clearcoat_normal_fragment_maps:sV,clearcoat_pars_fragment:oV,iridescence_pars_fragment:aV,opaque_fragment:lV,packing:cV,premultiplied_alpha_fragment:uV,project_vertex:hV,dithering_fragment:dV,dithering_pars_fragment:fV,roughnessmap_fragment:pV,roughnessmap_pars_fragment:AV,shadowmap_pars_fragment:mV,shadowmap_pars_vertex:gV,shadowmap_vertex:_V,shadowmask_pars_fragment:vV,skinbase_vertex:yV,skinning_pars_vertex:xV,skinning_vertex:bV,skinnormal_vertex:SV,specularmap_fragment:MV,specularmap_pars_fragment:wV,tonemapping_fragment:TV,tonemapping_pars_fragment:EV,transmission_fragment:RV,transmission_pars_fragment:CV,uv_pars_fragment:PV,uv_pars_vertex:LV,uv_vertex:NV,worldpos_vertex:DV,background_vert:IV,background_frag:BV,backgroundCube_vert:FV,backgroundCube_frag:UV,cube_vert:OV,cube_frag:kV,depth_vert:zV,depth_frag:VV,distanceRGBA_vert:GV,distanceRGBA_frag:qV,equirect_vert:HV,equirect_frag:WV,linedashed_vert:$V,linedashed_frag:jV,meshbasic_vert:XV,meshbasic_frag:YV,meshlambert_vert:QV,meshlambert_frag:ZV,meshmatcap_vert:KV,meshmatcap_frag:JV,meshnormal_vert:eG,meshnormal_frag:tG,meshphong_vert:nG,meshphong_frag:iG,meshphysical_vert:rG,meshphysical_frag:sG,meshtoon_vert:oG,meshtoon_frag:aG,points_vert:lG,points_frag:cG,shadow_vert:uG,shadow_frag:hG,sprite_vert:dG,sprite_frag:fG},Lt={common:{diffuse:{value:new qt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Sn},alphaMap:{value:null},alphaMapTransform:{value:new Sn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Sn}},envmap:{envMap:{value:null},envMapRotation:{value:new Sn},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Sn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Sn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Sn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Sn},normalScale:{value:new at(1,1)}}
vendor: 7,501 bytes, line 3574
3574,displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Sn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Sn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Sn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Sn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new qt(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 qt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Sn},alphaTest:{value:0},uvTransform:{value:new Sn}},sprite:{diffuse:{value:new qt(16777215)},opacity:{value:1},center:{value:new at(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Sn},alphaMap:{value:null},alphaMapTransform:{value:new Sn},alphaTest:{value:0}}},Fs={basic:{uniforms:_s([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.fog]),vertexShader:Pn.meshbasic_vert,fragmentShader:Pn.meshbasic_frag},lambert:{uniforms:_s([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.fog,Lt.lights,{emissive:{value:new qt(0)}}]),vertexShader:Pn.meshlambert_vert,fragmentShader:Pn.meshlambert_frag},phong:{uniforms:_s([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.fog,Lt.lights,{emissive:{value:new qt(0)},specular:{value:new qt(1118481)},shininess:{value:30}}]),vertexShader:Pn.meshphong_vert,fragmentShader:Pn.meshphong_frag},standard:{uniforms:_s([Lt.common,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.roughnessmap,Lt.metalnessmap,Lt.fog,Lt.lights,{emissive:{value:new qt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Pn.meshphysical_vert,fragmentShader:Pn.meshphysical_frag},toon:{uniforms:_s([Lt.common,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.gradientmap,Lt.fog,Lt.lights,{emissive:{value:new qt(0)}}]),vertexShader:Pn.meshtoon_vert,fragmentShader:Pn.meshtoon_frag},matcap:{uniforms:_s([Lt.common,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.fog,{matcap:{value:null}}]),vertexShader:Pn.meshmatcap_vert,fragmentShader:Pn.meshmatcap_frag},points:{uniforms:_s([Lt.points,Lt.fog]),vertexShader:Pn.points_vert,fragmentShader:Pn.points_frag},dashed:{uniforms:_s([Lt.common,Lt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Pn.linedashed_vert,fragmentShader:Pn.linedashed_frag},depth:{uniforms:_s([Lt.common,Lt.displacementmap]),vertexShader:Pn.depth_vert,fragmentShader:Pn.depth_frag},normal:{uniforms:_s([Lt.common,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,{opacity:{value:1}}]),vertexShader:Pn.meshnormal_vert,fragmentShader:Pn.meshnormal_frag},sprite:{uniforms:_s([Lt.sprite,Lt.fog]),vertexShader:Pn.sprite_vert,fragmentShader:Pn.sprite_frag},background:{uniforms:{uvTransform:{value:new Sn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Pn.background_vert,fragmentShader:Pn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Sn}},vertexShader:Pn.backgroundCube_vert,fragmentShader:Pn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Pn.cube_vert,fragmentShader:Pn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Pn.equirect_vert,fragmentShader:Pn.equirect_frag},distanceRGBA:{uniforms:_s([Lt.common,Lt.displacementmap,{referencePosition:{value:new re},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Pn.distanceRGBA_vert,fragmentShader:Pn.distanceRGBA_frag},shadow:{uniforms:_s([Lt.lights,Lt.fog,{color:{value:new qt(0)},opacity:{value:1}}]),vertexShader:Pn.shadow_vert,fragmentShader:Pn.shadow_frag}};Fs.physical={uniforms:_s([Fs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Sn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Sn},clearcoatNormalScale:{value:new at(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Sn},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Sn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Sn},sheen:{value:0},sheenColor:{value:new qt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Sn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Sn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Sn},transmissionSamplerSize:{value:new at},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Sn},attenuationDistance:{value:0},attenuationColor:{value:new qt(0)},specularColor:{value:new qt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Sn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Sn},anisotropyVector:{value:new at},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Sn}}]),vertexShader:Pn.meshphysical_vert,fragmentShader:Pn.meshphysical_frag};const zm={r:0,b:0,g:0},du=new Es,pG=new un;function AG(i,e,t,n,r,s,o){const a=new qt(0);let l=s===!0?0:1,c,u,p=null,m=0,g=null;function v(R){let C=R.isScene===!0?R.background:null;return C&&C.isTexture&&(C=(R.backgroundBlurriness>0?t:e).get(C)),C}function b(R){let C=!1;const N=v(R);N===null?x(a,l):N&&N.isColor&&(x(N,1),C=!0);const D=i.xr.getEnvironmentBlendMode();D==="additive"?n.buffers.color.setClear(0,0,0,1,o):D==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(i.autoClear||C)&&(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(R,C){const N=v(C);N&&(N.isCubeTexture||N.mapping===nh)?(u===void 0&&(u=new qn(new Hf(1,1,1),new Xs({name:"Backgroun
3574dCubeMaterial",uniforms:Mf(Fs.backgroundCube.uniforms),vertexShader:Fs.backgroundCube.vertexShader,fragmentShader:Fs.backgroundCube.fragmentShader,side:oi,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(D,P,O){this.matrixWorld.copyPosition(O.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),du.copy(C.backgroundRotation),du.x*=-1,du.y*=-1,du.z*=-1,N.isCubeTexture&&N.isRenderTargetTexture===!1&&(du.y*=-1,du.z*=-1),u.material.uniforms.envMap.value=N,u.material.uniforms.flipEnvMap.value=N.isCubeTexture&&N.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=C.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=C.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(pG.makeRotationFromEuler(du)),u.material.toneMapped=En.getTransfer(N.colorSpace)!==ei,(p!==N||m!==N.version||g!==i.toneMapping)&&(u.material.needsUpdate=!0,p=N,m=N.version,g=i.toneMapping),u.layers.enableAll(),R.unshift(u,u.geometry,u.material,0,0,null)):N&&N.isTexture&&(c===void 0&&(c=new qn(new QS(2,2),new Xs({name:"BackgroundMaterial",uniforms:Mf(Fs.background.uniforms),vertexShader:Fs.background.vertexShader,fragmentShader:Fs.background.fragmentShader,side:qs,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=N,c.material.uniforms.backgroundIntensity.value=C.backgroundIntensity,c.material.toneMapped=En.getTransfer(N.colorSpace)!==ei,N.matrixAutoUpdate===!0&&N.updateMatrix(),c.material.uniforms.uvTransform.value.copy(N.matrix),(p!==N||m!==N.version||g!==i.toneMapping)&&(c.material.needsUpdate=!0,p=N,m=N.version,g=i.toneMapping),c.layers.enableAll(),R.unshift(c,c.geometry,c.material,0,0,null))}function x(R,C){R.getRGB(zm,pL(i)),n.buffers.color.setClear(zm.r,zm.g,zm.b,C,o)}function w(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return a},setClearColor:function(R,C=1){a.set(R),l=C,x(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(R){l=R,x(a,l)},render:b,addToRenderList:M,dispose:w}}function mG(i,e){const t=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},r=m(null);let s=r,o=!1;function a(F,k,Y,W,Q){let J=!1;const H=p(W,Y,k);s!==H&&(s=H,c(s.object)),J=g(F,W,Y,Q),J&&v(F,W,Y,Q),Q!==null&&e.update(Q,i.ELEMENT_ARRAY_BUFFER),(J||o)&&(o=!1,C(F,k,Y,W),Q!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.get(Q).buffer))}function l(){return i.createVertexArray()}function c(F){return i.bindVertexArray(F)}function u(F){return i.deleteVertexArray(F)}function p(F,k,Y){const W=Y.wireframe===!0;let Q=n[F.id];Q===void 0&&(Q={},n[F.id]=Q);let J=Q[k.id];J===void 0&&(J={},Q[k.id]=J);let H=J[W];return H===void 0&&(H=m(l()),J[W]=H),H}function m(F){const k=[],Y=[],W=[];for(let Q=0;Q<t;Q++)k[Q]=0,Y[Q]=0,W[Q]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:k,enabledAttributes:Y,attributeDivisors:W,object:F,attributes:{},index:null}}function g(F,k,Y,W){const Q=s.attributes,J=k.attributes;let H=0;const $=Y.getAttributes();for(const K in $)if($[K].location>=0){const ie=Q[K];let de=J[K];if(de===void 0&&(K==="instanceMatrix"&&F.instanceMatrix&&(de=F.instanceMatrix),K==="instanceColor"&&F.instanceColor&&(de=F.instanceColor)),ie===void 0||ie.attribute!==de||de&&ie.data!==de.data)return!0;H++}return s.attributesNum!==H||s.index!==W}function v(F,k,Y,W){const Q={},J=k.attributes;let H=0;const $=Y.getAttributes();for(const K in $)if($[K].location>=0){let ie=J[K];ie===void 0&&(K==="instanceMatrix"&&F.instanceMatrix&&(ie=F.instanceMatrix),K==="instanceColor"&&F.instanceColor&&(ie=F.instanceColor));const de={};de.attribute=ie,ie&&ie.data&&(de.data=ie.data),Q[K]=de,H++}s.attributes=Q,s.attributesNum=H,s.index=W}function b(){const F=s.newAttributes;for(let k=0,Y=F.length;k<Y;k++)F[k]=0}function M(F){x(F,0)}function x(F,k){const Y=s.newAttributes,W=s.enabledAttributes,Q=s.attributeDivisors;Y[F]=1,W[F]===0&&(i.enableVertexAttribArray(F),W[F]=1),Q[F]!==k&&(i.vertexAttribDivisor(F,k),Q[F]=k)}function w(){const F=s.newAttributes,k=s.enabledAttributes;for(let Y=0,W=k.length;Y<W;Y++)k[Y]!==F[Y]&&(i.disableVertexAttribArray(Y),k[Y]=0)}function R(F,k,Y,W,Q,J,H){H===!0?i.vertexAttribIPointer(F,k,Y,Q,J):i.vertexAttribPointer(F,k,Y,W,Q,J)}function C(F,k,Y,W){b();const Q=W.attributes,J=Y.getAttributes(),H=k.defaultAttributeValues;for(const $ in J){const K=J[$];if(K.location>=0){let he=Q[$];if(he===void 0&&($==="instanceMatrix"&&F.instanceMatrix&&(he=F.instanceMatrix),$==="instanceColor"&&F.instanceColor&&(he=F.instanceColor)),he!==void 0){const ie=he.normalized,de=he.itemSize,Ce=e.get(he);if(Ce===void 0)continue;const Fe=Ce.buffer,ge=Ce.type,Ge=Ce.bytesPerElement,Me=ge===i.INT||ge===i.UNSIGNED_INT||he.gpuType===Ir;if(he.isInterleavedBufferAttribute){const Ye=he.data,ct=Ye.stride,Je=he.offset;if(Ye.isInstancedInterleavedBuffer){for(let Ke=0;Ke<K.locationSize;Ke++)x(K.location+Ke,Ye.meshPerAttribute);F.isInstancedMesh!==!0&&W._maxInstanceCount===void 0&&(W._maxInstanceCount=Ye.meshPerAttribute*Ye.count)}else for(let Ke=0;Ke<K.locationSize;Ke++)M(K.location+Ke);i.bindBuffer(i.ARRAY_BUFFER,Fe);for(let Ke=0;Ke<K.locationSize;Ke++)R(K.location+Ke,de/K.locationSize,ge,ie,ct*Ge,(Je+de/K.locationSize*Ke)*Ge,Me)}else{if(he.isInstancedBufferAttribute){for(let Ye=0;Ye<K.locationSize;Ye++)x(K.location+Ye,he.meshPerAttribute);F.isInstancedMesh!==!0&&W._maxInstanceCount===void 0&&(W._maxInstanceCount=he.meshPerAttribute*he.count)}else for(let Ye=0;Ye<K.locationSize;Ye++)M(K.location+Ye);i.bindBuffer(i.ARRAY_BUFFER,Fe);for(let Ye=0;Ye<K.locationSize;Ye++)R(K.location+Ye,de/K.locationSize,ge,ie,de*Ge,de/K.locationSize*Ye*Ge,Me)}}else if(H!==void 0){const ie=H[$];if(ie!==void 0)switch(ie.length){case 2:i.vertexAttrib2fv(K.location,ie);break;case 3:i.vertexAttrib3fv(K.location,ie);break;case 4:i.vertexAttrib4fv(K.location,ie);break;default:i.vertexAttrib1fv(K.location,ie)}}}}w()}function N(){O();for(const F in n){const k=n[F];for(const Y in k){const W=k[Y];for(const Q in W)u(W[Q].object),delete W[Q];delete k[Y]}delete n[F]}}function D(F){if(n[F.id]===void 0)return;const k=n[F.id];for(const Y in k){const W=k[Y];for(const Q in W)u(W[Q].object),delete W[Q];delete k[Y]}delete n[F.id]}
vendor: 4,676 bytes, line 3574
3574function P(F){for(const k in n){const Y=n[k];if(Y[F.id]===void 0)continue;const W=Y[F.id];for(const Q in W)u(W[Q].object),delete W[Q];delete Y[F.id]}}function O(){I(),o=!0,s!==r&&(s=r,c(s.object))}function I(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:a,reset:O,resetDefaultState:I,dispose:N,releaseStatesOfGeometry:D,releaseStatesOfProgram:P,initAttributes:b,enableAttribute:M,disableUnusedAttributes:w}}function gG(i,e,t){let n;function r(c){n=c}function s(c,u){i.drawArrays(n,c,u),t.update(u,n,1)}function o(c,u,p){p!==0&&(i.drawArraysInstanced(n,c,u,p),t.update(u,n,p))}function a(c,u,p){if(p===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,c,0,u,0,p);let g=0;for(let v=0;v<p;v++)g+=u[v];t.update(g,n,1)}function l(c,u,p,m){if(p===0)return;const g=e.get("WEBGL_multi_draw");if(g===null)for(let v=0;v<c.length;v++)o(c[v],u[v],m[v]);else{g.multiDrawArraysInstancedWEBGL(n,c,0,u,0,m,0,p);let v=0;for(let b=0;b<p;b++)v+=u[b]*m[b];t.update(v,n,1)}}this.setMode=r,this.render=s,this.renderInstances=o,this.renderMultiDraw=a,this.renderMultiDrawInstances=l}function _G(i,e,t,n){let r;function s(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const P=e.get("EXT_texture_filter_anisotropic");r=i.getParameter(P.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function o(P){return!(P!==Yi&&n.convert(P)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT))}function a(P){const O=P===dr&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(P!==Gi&&n.convert(P)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_TYPE)&&P!==er&&!O)}function l(P){if(P==="highp"){if(i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.HIGH_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="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=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const p=t.logarithmicDepthBuffer===!0,m=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),g=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),v=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),b=i.getParameter(i.MAX_TEXTURE_SIZE),M=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),x=i.getParameter(i.MAX_VERTEX_ATTRIBS),w=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),R=i.getParameter(i.MAX_VARYING_VECTORS),C=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),N=v>0,D=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:p,reverseDepthBuffer:m,maxTextures:g,maxVertexTextures:v,maxTextureSize:b,maxCubemapSize:M,maxAttributes:x,maxVertexUniforms:w,maxVaryings:R,maxFragmentUniforms:C,vertexTextures:N,maxSamples:D}}function vG(i){const e=this;let t=null,n=0,r=!1,s=!1;const o=new Da,a=new Sn,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(p,m){const g=p.length!==0||m||n!==0||r;return r=m,n=p.length,g},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(p,m){t=u(p,m,0)},this.setState=function(p,m,g){const v=p.clippingPlanes,b=p.clipIntersection,M=p.clipShadows,x=i.get(p);if(!r||v===null||v.length===0||s&&!M)s?u(null):c();else{const w=s?0:n,R=w*4;let C=x.clippingState||null;l.value=C,C=u(v,m,R,g);for(let N=0;N!==R;++N)C[N]=t[N];x.clippingState=C,this.numIntersection=b?this.numPlanes:0,this.numPlanes+=w}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(p,m,g,v){const b=p!==null?p.length:0;let M=null;if(b!==0){if(M=l.value,v!==!0||M===null){const x=g+b*4,w=m.matrixWorldInverse;a.getNormalMatrix(w),(M===null||M.length<x)&&(M=new Float32Array(x));for(let R=0,C=g;R!==b;++R,C+=4)o.copy(p[R]).applyMatrix4(w,a),o.normal.toArray(M,C),M[C+3]=o.constant}l.value=M,l.needsUpdate=!0}return e.numPlanes=b,e.numIntersection=0,M}}function yG(i){let e=new WeakMap;function t(o,a){return a===eh?o.mapping=Aa:a===th&&(o.mapping=ma),o}function n(o){if(o&&o.isTexture){const a=o.mapping;if(a===eh||a===th)if(e.has(o)){const l=e.get(o).texture;return t(l,o.mapping)}else{const l=o.image;if(l&&l.height>0){const c=new mL(l.height);return c.fromEquirectangularTexture(i,o),e.set(o,c),o.addEventListener("dispose",r),t(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}
vendor: 8,772 bytes, lines 3574-3649
3574function s(){e=new WeakMap}return{get:n,dispose:s}}const Nd=4,oE=[.125,.215,.35,.446,.526,.582],Du=20,Iy=new N0,aE=new qt;let By=null,Fy=0,Uy=0,Oy=!1;const Cu=(1+Math.sqrt(5))/2,zh=1/Cu,lE=[new re(-Cu,zh,0),new re(Cu,zh,0),new re(-zh,0,Cu),new re(zh,0,Cu),new re(0,Cu,-zh),new re(0,Cu,zh),new re(-1,1,-1),new re(1,1,-1),new re(-1,1,1),new re(1,1,1)],xG=new re;let cE=class{constructor(e){this._renderer=e,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(e,t=0,n=.1,r=100,s={}){const{size:o=256,position:a=xG}=s;By=this._renderer.getRenderTarget(),Fy=this._renderer.getActiveCubeFace(),Uy=this._renderer.getActiveMipmapLevel(),Oy=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,n,r,l,a),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=dE(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=hE(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(By,Fy,Uy),this._renderer.xr.enabled=Oy,e.scissorTest=!1,Vm(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Aa||e.mapping===ma?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),By=this._renderer.getRenderTarget(),Fy=this._renderer.getActiveCubeFace(),Uy=this._renderer.getActiveMipmapLevel(),Oy=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:xr,minFilter:xr,generateMipmaps:!1,type:dr,format:Yi,colorSpace:ha,depthBuffer:!1},r=uE(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=uE(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=bG(s)),this._blurMaterial=SG(s,e,t)}return r}_compileMaterial(e){const t=new qn(this._lodPlanes[0],e);this._renderer.compile(t,Iy)}_sceneToCubeUV(e,t,n,r,s){const l=new Br(90,1,t,n),c=[1,-1,1,1,1,1],u=[1,1,1,-1,-1,-1],p=this._renderer,m=p.autoClear,g=p.toneMapping;p.getClearColor(aE),p.toneMapping=Ws,p.autoClear=!1;const v=new Bo({name:"PMREM.Background",side:oi,depthWrite:!1,depthTest:!1}),b=new qn(new Hf,v);let M=!1;const x=e.background;x?x.isColor&&(v.color.copy(x),e.background=null,M=!0):(v.color.copy(aE),M=!0);for(let w=0;w<6;w++){const R=w%3;R===0?(l.up.set(0,c[w],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x+u[w],s.y,s.z)):R===1?(l.up.set(0,0,c[w]),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y+u[w],s.z)):(l.up.set(0,c[w],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y,s.z+u[w]));const C=this._cubeSize;Vm(r,R*C,w>2?C:0,C,C),p.setRenderTarget(r),M&&p.render(b,l),p.render(e,l)}b.geometry.dispose(),b.material.dispose(),p.toneMapping=g,p.autoClear=m,e.background=x}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===Aa||e.mapping===ma;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=dE()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=hE());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new qn(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Vm(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(o,Iy)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.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=lE[(r-s-1)%lE.length];this._blur(e,s-1,s,o,a)}t.autoClear=n}_blur(e,t,n,r,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,r,"latitudinal",s),this._halfBlur(o,e,n,n,r,"longitudinal",s)}_halfBlur(e,t,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 u=3,p=new qn(this._lodPlanes[r],c),m=c.uniforms,g=this._sizeLods[n]-1,v=isFinite(s)?Math.PI/(2*g):2*Math.PI/(2*Du-1),b=s/v,M=isFinite(s)?1+Math.floor(u*b):Du;M>Du&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${M} samples when the maximum is set to ${Du}`);const x=[];let w=0;for(let P=0;P<Du;++P){const O=P/b,I=Math.exp(-O*O/2);x.push(I),P===0?w+=I:P<M&&(w+=2*I)}for(let P=0;P<x.length;P++)x[P]=x[P]/w;m.envMap.value=e.texture,m.samples.value=M,m.weights.value=x,m.latitudinal.value=o==="latitudinal",a&&(m.poleAxis.value=a);const{_lodMax:R}=this;m.dTheta.value=v,m.mipInt.value=R-n;const C=this._sizeLods[r],N=3*C*(r>R-Nd?r-R+Nd:0),D=4*(this._cubeSize-C);Vm(t,N,D,3*C,2*C),l.setRenderTarget(t),l.render(p,Iy)}};function bG(i){const e=[],t=[],n=[];let r=i;const s=i-Nd+1+oE.length;for(let o=0;o<s;o++){const a=Math.pow(2,r);t.push(a);let l=1/a;o>i-Nd?l=oE[o-i+Nd-1]:o===0&&(l=0),n.push(l);const c=1/(a-2),u=-c,p=1+c,m=[u,u,p,u,p,p,u,u,p,p,u,p],g=6,v=6,b=3,M=2,x=1,w=new Float32Array(b*v*g),R=new Float32Array(M*v*g),C=new Float32Array(x*v*g);for(let D=0;D<g;D++){const P=D%3*2/3-1,O=D>2?0:-1,I=[P,O,0,P+2/3,O,0,P+2/3,O+1,0,P,O,0,P+2/3,O+1,0,P,O+1,0];w.set(I,b*v*D),R.set(m,M*v*D);const F=[D,D,D,D,D,D];C.set(F,x*v*D)}const N=new vi;N.setAttribute("position",new Ii(w,b)),N.setAttribute("uv",new Ii(R,M)),N.setAttribute("faceIndex",new Ii(C,x)),e.push(N),r>Nd&&r--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function uE(i,e,t){const n=new Hc(i,e,t);return n.texture.mapping=nh,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Vm(i,e,t,n,r){i.viewport.set(e,t,n,r),i.scissor.set(e,t,n,r)}function SG(i,e,t){const n=new Float32Array(Du),r=new re(0,1,0);return new Xs({name:"SphericalGaussianBlur",defines:{n:Du,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,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:nM(),fragmentShader:`
3575
3576			precision mediump float;
3577			precision mediump int;
3578
3579			varying vec3 vOutputDirection;
3580
3581			uniform sampler2D envMap;
3582			uniform int samples;
3583			uniform float weights[ n ];
3584			uniform bool latitudinal;
3585			uniform float dTheta;
3586			uniform float mipInt;
3587			uniform vec3 poleAxis;
3588
3589			#define ENVMAP_TYPE_CUBE_UV
3590			#include <cube_uv_reflection_fragment>
3591
3592			vec3 getSample( float theta, vec3 axis ) {
3593
3594				float cosTheta = cos( theta );
3595				// Rodrigues' axis-angle rotation
3596				vec3 sampleDirection = vOutputDirection * cosTheta
3597					+ cross( axis, vOutputDirection ) * sin( theta )
3598					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
3599
3600				return bilinearCubeUV( envMap, sampleDirection, mipInt );
3601
3602			}
3603
3604			void main() {
3605
3606				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
3607
3608				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
3609
3610					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
3611
3612				}
3613
3614				axis = normalize( axis );
3615
3616				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
3617				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
3618
3619				for ( int i = 1; i < n; i++ ) {
3620
3621					if ( i >= samples ) {
3622
3623						break;
3624
3625					}
3626
3627					float theta = dTheta * float( i );
3628					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
3629					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
3630
3631				}
3632
3633			}
3634		`,blending:Hs,depthTest:!1,depthWrite:!1})}function hE(){return new Xs({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:nM(),fragmentShader:`
3635
3636			precision mediump float;
3637			precision mediump int;
3638
3639			varying vec3 vOutputDirection;
3640
3641			uniform sampler2D envMap;
3642
3643			#include <common>
3644
3645			void main() {
3646
3647				vec3 outputDirection = normalize( vOutputDirection );
3648				vec2 uv = equirectUv( outputDirection );
3649
3650				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
3651
3652			}
3653		`,blending:Hs,depthTest:!1,depthWrite:!1})}function dE(){return new Xs({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:nM(),fragmentShader:`
3654
3655			precision mediump float;
3656			precision mediump int;
3657
3658			uniform float flipEnvMap;
3659
3660			varying vec3 vOutputDirection;
3661
3662			uniform samplerCube envMap;
3663
3664			void main() {
3665
3666				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
3667
3668			}
3669		`,blending:Hs,depthTest:!1,depthWrite:!1})}function nM(){return`
3670
3671		precision mediump float;
3672		precision mediump int;
3673
3674		attribute float faceIndex;
3675
3676		varying vec3 vOutputDirection;
3677
3678		// RH coordinate system; PMREM face-indexing convention
3679		vec3 getDirection( vec2 uv, float face ) {
3680
3681			uv = 2.0 * uv - 1.0;
3682
3683			vec3 direction = vec3( uv, 1.0 );
3684
3685			if ( face == 0.0 ) {
3686
3687				direction = direction.zyx; // ( 1, v, u ) pos x
3688
3689			} else if ( face == 1.0 ) {
3690
3691				direction = direction.xzy;
3692				direction.xz *= -1.0; // ( -u, 1, -v ) pos y
3693
3694			} else if ( face == 2.0 ) {
3695
3696				direction.x *= -1.0; // ( -u, v, 1 ) pos z
3697
3698			} else if ( face == 3.0 ) {
3699
3700				direction = direction.zyx;
3701				direction.xz *= -1.0; // ( -1, v, -u ) neg x
3702
3703			} else if ( face == 4.0 ) {
3704
3705				direction = direction.xzy;
3706				direction.xy *= -1.0; // ( -u, -1, v ) neg y
3707
3708			} else if ( face == 5.0 ) {
3709
3710				direction.z *= -1.0; // ( u, v, -1 ) neg z
3711
3712			}
3713
3714			return direction;
3715
3716		}
3717
3718		void main() {
3719
3720			vOutputDirection = getDirection( uv, faceIndex );
3721			gl_Position = vec4( position, 1.0 );
3722
3723		}
3724	`}function MG(i){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture){const l=a.mapping,c=l===eh||l===th,u=l===Aa||l===ma;if(c||u){let p=e.get(a);const m=p!==void 0?p.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==m)return t===null&&(t=new cE(i)),p=c?t.fromEquirectangular(a,p):t.fromCubemap(a,p),p.texture.pmremVersion=a.pmremVersion,e.set(a,p),p.texture;if(p!==void 0)return p.texture;{const g=a.image;return c&&g&&g.height>0||u&&g&&r(g)?(t===null&&(t=new cE(i)),p=c?t.fromEquirectangular(a):t.fromCubemap(a),p.texture.pmremVersion=a.pmremVersion,e.set(a,p),a.addEventListener("dispose",s),p.texture):null}}}return a}function r(a){let l=0;const c=6;for(let u=0;u<c;u++)a[u]!==void 0&&l++;return l===c}function s(a){const l=a.target;l.removeEventListener("dispose",s);const c=e.get(l);c!==void 0&&(e.delete(l),c.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:o}}function wG(i){const e={};function t(n){if(e[n]!==void 0)return e[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 e[n]=r,r}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const r=t(n);return r===null&&da("THREE.WebGLRenderer: "+n+" extension not supported."),r}}}function TG(i,e,t,n){const r={},s=new WeakMap;function o(p){const m=p.target;m.index!==null&&e.remove(m.index);for(const v in m.attributes)e.remove(m.attributes[v]);m.removeEventListener("dispose",o),delete r[m.id];const g=s.get(m);g&&(e.remove(g),s.delete(m)),n.releaseStatesOfGeometry(m),m.isInstancedBufferGeometry===!0&&delete m._maxInstanceCount,t.memory.geometries--}function a(p,m){return r[m.id]===!0||(m.addEventListener("dispose",o),r[m.id]=!0,t.memory.geometries++),m}function l(p){const m=p.attributes;for(const g in m)e.update(m[g],i.ARRAY_BUFFER)}function c(p){const m=[],g=p.index,v=p.attributes.position;let b=0;if(g!==null){const w=g.array;b=g.version;for(let R=0,C=w.length;R<C;R+=3){const N=w[R+0],D=w[R+1],P=w[R+2];m.push(N,D,D,P,P,N)}}else if(v!==void 0){const w=v.array;b=v.version;for(let R=0,C=w.length/3-1;R<C;R+=3){const N=R+0,D=R+1,P=R+2;m.push(N,D,D,P,P,N)}}else return;const M=new(zS(m)?HS:qS)(m,1);M.version=b;const x=s.get(p);x&&e.remove(x),s.set(p,M)}function u(p){const m=s.get(p);if(m){const g=p.index;g!==null&&m.version<g.version&&c(p)}
vendor: 18,012 bytes, lines 3724-3759
3724else c(p);return s.get(p)}return{get:a,update:l,getWireframeAttribute:u}}function EG(i,e,t){let n;function r(m){n=m}let s,o;function a(m){s=m.type,o=m.bytesPerElement}function l(m,g){i.drawElements(n,g,s,m*o),t.update(g,n,1)}function c(m,g,v){v!==0&&(i.drawElementsInstanced(n,g,s,m*o,v),t.update(g,n,v))}function u(m,g,v){if(v===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,g,0,s,m,0,v);let M=0;for(let x=0;x<v;x++)M+=g[x];t.update(M,n,1)}function p(m,g,v,b){if(v===0)return;const M=e.get("WEBGL_multi_draw");if(M===null)for(let x=0;x<m.length;x++)c(m[x]/o,g[x],b[x]);else{M.multiDrawElementsInstancedWEBGL(n,g,0,s,m,0,b,0,v);let x=0;for(let w=0;w<v;w++)x+=g[w]*b[w];t.update(x,n,1)}}this.setMode=r,this.setIndex=a,this.render=l,this.renderInstances=c,this.renderMultiDraw=u,this.renderMultiDrawInstances=p}function RG(i){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,o,a){switch(t.calls++,o){case i.TRIANGLES:t.triangles+=a*(s/3);break;case i.LINES:t.lines+=a*(s/2);break;case i.LINE_STRIP:t.lines+=a*(s-1);break;case i.LINE_LOOP:t.lines+=a*s;break;case i.POINTS:t.points+=a*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function r(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:r,update:n}}function CG(i,e,t){const n=new WeakMap,r=new Jt;function s(o,a,l){const c=o.morphTargetInfluences,u=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,p=u!==void 0?u.length:0;let m=n.get(a);if(m===void 0||m.count!==p){let I=function(){P.dispose(),n.delete(a),a.removeEventListener("dispose",I)};m!==void 0&&m.texture.dispose();const g=a.morphAttributes.position!==void 0,v=a.morphAttributes.normal!==void 0,b=a.morphAttributes.color!==void 0,M=a.morphAttributes.position||[],x=a.morphAttributes.normal||[],w=a.morphAttributes.color||[];let R=0;g===!0&&(R=1),v===!0&&(R=2),b===!0&&(R=3);let C=a.attributes.position.count*R,N=1;C>e.maxTextureSize&&(N=Math.ceil(C/e.maxTextureSize),C=e.maxTextureSize);const D=new Float32Array(C*N*4*p),P=new C1(D,C,N,p);P.type=er,P.needsUpdate=!0;const O=R*4;for(let F=0;F<p;F++){const k=M[F],Y=x[F],W=w[F],Q=C*N*4*F;for(let J=0;J<k.count;J++){const H=J*O;g===!0&&(r.fromBufferAttribute(k,J),D[Q+H+0]=r.x,D[Q+H+1]=r.y,D[Q+H+2]=r.z,D[Q+H+3]=0),v===!0&&(r.fromBufferAttribute(Y,J),D[Q+H+4]=r.x,D[Q+H+5]=r.y,D[Q+H+6]=r.z,D[Q+H+7]=0),b===!0&&(r.fromBufferAttribute(W,J),D[Q+H+8]=r.x,D[Q+H+9]=r.y,D[Q+H+10]=r.z,D[Q+H+11]=W.itemSize===4?r.w:1)}}m={count:p,texture:P,size:new at(C,N)},n.set(a,m),a.addEventListener("dispose",I)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)l.getUniforms().setValue(i,"morphTexture",o.morphTexture,t);else{let g=0;for(let b=0;b<c.length;b++)g+=c[b];const v=a.morphTargetsRelative?1:1-g;l.getUniforms().setValue(i,"morphTargetBaseInfluence",v),l.getUniforms().setValue(i,"morphTargetInfluences",c)}l.getUniforms().setValue(i,"morphTargetsTexture",m.texture,t),l.getUniforms().setValue(i,"morphTargetsTextureSize",m.size)}return{update:s}}function PG(i,e,t,n){let r=new WeakMap;function s(l){const c=n.render.frame,u=l.geometry,p=e.get(l,u);if(r.get(p)!==c&&(e.update(p),r.set(p,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",a)===!1&&l.addEventListener("dispose",a),r.get(l)!==c&&(t.update(l.instanceMatrix,i.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,i.ARRAY_BUFFER),r.set(l,c))),l.isSkinnedMesh){const m=l.skeleton;r.get(m)!==c&&(m.update(),r.set(m,c))}return p}function o(){r=new WeakMap}function a(l){const c=l.target;c.removeEventListener("dispose",a),t.remove(c.instanceMatrix),c.instanceColor!==null&&t.remove(c.instanceColor)}return{update:s,dispose:o}}const GL=new Cs,fE=new $s(1,1),qL=new C1,HL=new l9,WL=new L1,pE=[],AE=[],mE=new Float32Array(16),gE=new Float32Array(9),_E=new Float32Array(4);function jf(i,e,t){const n=i[0];if(n<=0||n>0)return i;const r=e*t;let s=pE[r];if(s===void 0&&(s=new Float32Array(r),pE[r]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,i[o].toArray(s,a)}return s}function Sr(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t<n;t++)if(i[t]!==e[t])return!1;return!0}function Mr(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function U1(i,e){let t=AE[e];t===void 0&&(t=new Int32Array(e),AE[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function LG(i,e){const t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function NG(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Sr(t,e))return;i.uniform2fv(this.addr,e),Mr(t,e)}}function DG(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(i.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Sr(t,e))return;i.uniform3fv(this.addr,e),Mr(t,e)}}function IG(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Sr(t,e))return;i.uniform4fv(this.addr,e),Mr(t,e)}}function BG(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Sr(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),Mr(t,e)}else{if(Sr(t,n))return;_E.set(n),i.uniformMatrix2fv(this.addr,!1,_E),Mr(t,n)}}function FG(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Sr(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),Mr(t,e)}else{if(Sr(t,n))return;gE.set(n),i.uniformMatrix3fv(this.addr,!1,gE),Mr(t,n)}}function UG(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Sr(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),Mr(t,e)}else{if(Sr(t,n))return;mE.set(n),i.uniformMatrix4fv(this.addr,!1,mE),Mr(t,n)}}function OG(i,e){const t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function kG(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Sr(t,e))return;i.uniform2iv(this.addr,e),Mr(t,e)}}function zG(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Sr(t,e))return;i.uniform3iv(this.addr,e),Mr(t,e)}}function VG(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Sr(t,e))return;i.uniform4iv(this.addr,e),Mr(t,e)}}function GG(i,e){const t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function qG(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Sr(t,e))return;i.uniform2uiv(this.addr,e),Mr(t,e)}}function HG(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Sr(t,e))return;i.uniform3uiv(this.addr,e),Mr(t,e)}}function WG(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Sr(t,e))return;i.uniform4uiv(this.addr,e),Mr(t,e)}}function $G(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r);let s;this.type===i.SAMPLER_2D_SHADOW?(fE.compareFunction=R1,s=fE):s=GL,t.setTexture2D(e||s,r)}function jG(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture3D(e||HL,r)}function XG(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTextureCube(e||WL,r)}function YG(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture2DArray(e||qL,r)}function QG(i){switch(i){case 5126:return LG;case 35664:return NG;case 35665:return DG;case 35666:return IG;case 35674:return BG;case 35675:return FG;case 35676:return UG;case 5124:case 35670:return OG;case 35667:case 35671:return kG;case 35668:case 35672:return zG;case 35669:case 35673:return VG;case 5125:return GG;case 36294:return qG;case 36295:return HG;case 36296:return WG;case 35678:case 36198:case 36298:case 36306:case 35682:return $G;case 35679:case 36299:case 36307:return jG;case 35680:case 36300:case 36308:case 36293:return XG;case 36289:case 36303:case 36311:case 36292:return YG}}function ZG(i,e){i.uniform1fv(this.addr,e)}function KG(i,e){const t=jf(e,this.size,2);i.uniform2fv(this.addr,t)}function JG(i,e){const t=jf(e,this.size,3);i.uniform3fv(this.addr,t)}function eq(i,e){const t=jf(e,this.size,4);i.uniform4fv(this.addr,t)}function tq(i,e){const t=jf(e,this.size,4);i.uniformMatrix2fv(this.addr,!1,t)}function nq(i,e){const t=jf(e,this.size,9);i.uniformMatrix3fv(this.addr,!1,t)}function iq(i,e){const t=jf(e,this.size,16);i.uniformMatrix4fv(this.addr,!1,t)}function rq(i,e){i.uniform1iv(this.addr,e)}function sq(i,e){i.uniform2iv(this.addr,e)}function oq(i,e){i.uniform3iv(this.addr,e)}function aq(i,e){i.uniform4iv(this.addr,e)}function lq(i,e){i.uniform1uiv(this.addr,e)}function cq(i,e){i.uniform2uiv(this.addr,e)}function uq(i,e){i.uniform3uiv(this.addr,e)}function hq(i,e){i.uniform4uiv(this.addr,e)}function dq(i,e,t){const n=this.cache,r=e.length,s=U1(t,r);Sr(n,s)||(i.uniform1iv(this.addr,s),Mr(n,s));for(let o=0;o!==r;++o)t.setTexture2D(e[o]||GL,s[o])}function fq(i,e,t){const n=this.cache,r=e.length,s=U1(t,r);Sr(n,s)||(i.uniform1iv(this.addr,s),Mr(n,s));for(let o=0;o!==r;++o)t.setTexture3D(e[o]||HL,s[o])}function pq(i,e,t){const n=this.cache,r=e.length,s=U1(t,r);Sr(n,s)||(i.uniform1iv(this.addr,s),Mr(n,s));for(let o=0;o!==r;++o)t.setTextureCube(e[o]||WL,s[o])}function Aq(i,e,t){const n=this.cache,r=e.length,s=U1(t,r);Sr(n,s)||(i.uniform1iv(this.addr,s),Mr(n,s));for(let o=0;o!==r;++o)t.setTexture2DArray(e[o]||qL,s[o])}function mq(i){switch(i){case 5126:return ZG;case 35664:return KG;case 35665:return JG;case 35666:return eq;case 35674:return tq;case 35675:return nq;case 35676:return iq;case 5124:case 35670:return rq;case 35667:case 35671:return sq;case 35668:case 35672:return oq;case 35669:case 35673:return aq;case 5125:return lq;case 36294:return cq;case 36295:return uq;case 36296:return hq;case 35678:case 36198:case 36298:case 36306:case 35682:return dq;case 35679:case 36299:case 36307:return fq;case 35680:case 36300:case 36308:case 36293:return pq;case 36289:case 36303:case 36311:case 36292:return Aq}}let gq=class{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=QG(t.type)}},_q=class{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=mq(t.type)}},vq=class{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const r=this.seq;for(let s=0,o=r.length;s!==o;++s){const a=r[s];a.setValue(e,t[a.id],n)}}};const ky=/(\w+)(\])?(\[|\.)?/g;function vE(i,e){i.seq.push(e),i.map[e.id]=e}function yq(i,e,t){const n=i.name,r=n.length;for(ky.lastIndex=0;;){const s=ky.exec(n),o=ky.lastIndex;let a=s[1];const l=s[2]==="]",c=s[3];if(l&&(a=a|0),c===void 0||c==="["&&o+2===r){vE(t,c===void 0?new gq(a,i,e):new _q(a,i,e));break}else{let p=t.map[a];p===void 0&&(p=new vq(a),vE(t,p)),t=p}}}let h_=class{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const s=e.getActiveUniform(t,r),o=e.getUniformLocation(t,s.name);yq(s,o,this)}}setValue(e,t,n,r){const s=this.map[t];s!==void 0&&s.setValue(e,n,r)}setOptional(e,t,n){const r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let s=0,o=t.length;s!==o;++s){const a=t[s],l=n[a.id];l.needsUpdate!==!1&&a.setValue(e,l.value,r)}}static seqWithValue(e,t){const n=[];for(let r=0,s=e.length;r!==s;++r){const o=e[r];o.id in t&&n.push(o)}return n}};function yE(i,e,t){const n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}const xq=37297;let bq=0;function Sq(i,e){const t=i.split(`
3725`),n=[],r=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let o=r;o<s;o++){const a=o+1;n.push(`${a===e?">":" "} ${a}: ${t[o]}`)}return n.join(`
3726`)}const xE=new Sn;function Mq(i){En._getMatrix(xE,En.workingColorSpace,i);const e=`mat3( ${xE.elements.map(t=>t.toFixed(4))} )`;switch(En.getTransfer(i)){case O_:return[e,"LinearTransferOETF"];case ei:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",i),[e,"LinearTransferOETF"]}}function bE(i,e,t){const n=i.getShaderParameter(e,i.COMPILE_STATUS),r=i.getShaderInfoLog(e).trim();if(n&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+`
3727
3728`+r+`
3729
3730`+Sq(i.getShaderSource(e),o)}else return r}function wq(i,e){const t=Mq(e);return[`vec4 ${i}( vec4 value ) {`,`	return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(`
3731`)}function Tq(i,e){let t;switch(e){case ZP:t="Linear";break;case KP:t="Reinhard";break;case JP:t="Cineon";break;case eL:t="ACESFilmic";break;case tL:t="AgX";break;case nL:t="Neutral";break;case _O:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+i+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Gm=new re;function Eq(){En.getLuminanceCoefficients(Gm);const i=Gm.x.toFixed(4),e=Gm.y.toFixed(4),t=Gm.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",`	const vec3 weights = vec3( ${i}, ${e}, ${t} );`,"	return dot( weights, rgb );","}"].join(`
3732`)}function Rq(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(sA).join(`
3733`)}function Cq(i){const e=[];for(const t in i){const n=i[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`
3734`)}function Pq(i,e){const t={},n=i.getProgramParameter(e,i.ACTIVE_ATTRIBUTES);for(let r=0;r<n;r++){const s=i.getActiveAttrib(e,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),t[o]={type:s.type,location:i.getAttribLocation(e,o),locationSize:a}}return t}function sA(i){return i!==""}function SE(i,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return i.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function ME(i,e){return i.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Lq=/^[ \t]*#include +<([\w\d./]+)>/gm;function eb(i){return i.replace(Lq,Dq)}const Nq=new Map;function Dq(i,e){let t=Pn[e];if(t===void 0){const n=Nq.get(e);if(n!==void 0)t=Pn[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return eb(t)}const Iq=/#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 wE(i){return i.replace(Iq,Bq)}function Bq(i,e,t,n){let r="";for(let s=parseInt(e);s<parseInt(t);s++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return r}function TE(i){let e=`precision ${i.precision} float;
3735	precision ${i.precision} int;
3736	precision ${i.precision} sampler2D;
3737	precision ${i.precision} samplerCube;
3738	precision ${i.precision} sampler3D;
3739	precision ${i.precision} sampler2DArray;
3740	precision ${i.precision} sampler2DShadow;
3741	precision ${i.precision} samplerCubeShadow;
3742	precision ${i.precision} sampler2DArrayShadow;
3743	precision ${i.precision} isampler2D;
3744	precision ${i.precision} isampler3D;
3745	precision ${i.precision} isamplerCube;
3746	precision ${i.precision} isampler2DArray;
3747	precision ${i.precision} usampler2D;
3748	precision ${i.precision} usampler3D;
3749	precision ${i.precision} usamplerCube;
3750	precision ${i.precision} usampler2DArray;
3751	`;return i.precision==="highp"?e+=`
3752#define HIGH_PRECISION`:i.precision==="mediump"?e+=`
3753#define MEDIUM_PRECISION`:i.precision==="lowp"&&(e+=`
3754#define LOW_PRECISION`),e}function Fq(i){let e="SHADOWMAP_TYPE_BASIC";return i.shadowMapType===_S?e="SHADOWMAP_TYPE_PCF":i.shadowMapType===fO?e="SHADOWMAP_TYPE_PCF_SOFT":i.shadowMapType===fo&&(e="SHADOWMAP_TYPE_VSM"),e}function Uq(i){let e="ENVMAP_TYPE_CUBE";if(i.envMap)switch(i.envMapMode){case Aa:case ma:e="ENVMAP_TYPE_CUBE";break;case nh:e="ENVMAP_TYPE_CUBE_UV";break}return e}function Oq(i){let e="ENVMAP_MODE_REFLECTION";if(i.envMap)switch(i.envMapMode){case ma:e="ENVMAP_MODE_REFRACTION";break}return e}function kq(i){let e="ENVMAP_BLENDING_NONE";if(i.envMap)switch(i.combine){case E0:e="ENVMAP_BLENDING_MULTIPLY";break;case YP:e="ENVMAP_BLENDING_MIX";break;case QP:e="ENVMAP_BLENDING_ADD";break}return e}function zq(i){const e=i.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:n,maxMip:t}}function Vq(i,e,t,n){const r=i.getContext(),s=t.defines;let o=t.vertexShader,a=t.fragmentShader;const l=Fq(t),c=Uq(t),u=Oq(t),p=kq(t),m=zq(t),g=Rq(t),v=Cq(s),b=r.createProgram();let M,x,w=t.glslVersion?"#version "+t.glslVersion+`
3755`:"";t.isRawShaderMaterial?(M=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v].filter(sA).join(`
3756`),M.length>0&&(M+=`
3757`),x=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v].filter(sA).join(`
3758`),x.length>0&&(x+=`
3759`)):(M=[TE(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.extensionCl
vendor: 6,454 bytes, lines 3759-3761
3759ipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.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",`
3760`].filter(sA).join(`
3761`),x=[TE(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+p:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IR
3761IDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Ws?"#define TONE_MAPPING":"",t.toneMapping!==Ws?Pn.tonemapping_pars_fragment:"",t.toneMapping!==Ws?Tq("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Pn.colorspace_pars_fragment,wq("linearToOutputTexel",t.outputColorSpace),Eq(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
3762`].filter(sA).join(`
3763`)),o=eb(o),o=SE(o,t),o=ME(o,t),a=eb(a),a=SE(a,t),a=ME(a,t),o=wE(o),a=wE(a),t.isRawShaderMaterial!==!0&&(w=`#version 300 es
3764`,M=[g,"#define attribute in","#define varying out","#define texture2D texture"].join(`
3765`)+`
3766`+M,x=["#define varying in",t.glslVersion===y3?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===y3?"":"#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(`
3767`)+`
3768`+x);const R=w+M+o,C=w+x+a,N=yE(r,r.VERTEX_SHADER,R),D=yE(r,r.FRAGMENT_SHADER,C);r.attachShader(b,N),r.attachShader(b,D),t.index0AttributeName!==void 0?r.bindAttribLocation(b,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(b,0,"position"),r.linkProgram(b);function P(k){if(i.debug.checkShaderErrors){const Y=r.getProgramInfoLog(b).trim(),W=r.getShaderInfoLog(N).trim(),Q=r.getShaderInfoLog(D).trim();let J=!0,H=!0;if(r.getProgramParameter(b,r.LINK_STATUS)===!1)if(J=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(r,b,N,D);else{const $=bE(r,N,"vertex"),K=bE(r,D,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(b,r.VALIDATE_STATUS)+`
3769
3770Material Name: `+k.name+`
3771Material Type: `+k.type+`
3772
3773Program Info Log: `+Y+`
3774`+$+`
3775`+K)}else Y!==""?console.warn("THREE.WebGLProgram: Program Info Log:",Y):(W===""||Q==="")&&(H=!1);H&&(k.diagnostics={runnable:J,programLog:Y,vertexShader:{log:W,prefix:M},fragmentShader:{log:Q,prefix:x}})}r.deleteShader(N),r.deleteShader(D),O=new h_(r,b),I=Pq(r,b)}let O;this.getUniforms=function(){return O===void 0&&P(this),O};let I;this.getAttributes=function(){return I===void 0&&P(this),I};let F=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return F===!1&&(F=r.getProgramParameter(b,xq)),F},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(b),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=bq++,this.cacheKey=e,this.usedTimes=1,this.program=b,this.vertexShader=N,this.fragmentShader=D,this}let Gq=0;class qq{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new Hq(e),t.set(e,n)),n}}class Hq{constructor(e){this.id=Gq++,this.code=e,this.usedTimes=0}}function Wq(i,e,t,n,r,s,o){const a=new GS,l=new qq,c=new Set,u=[],p=r.logarithmicDepthBuffer,m=r.vertexTextures;let g=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 b(I){return c.add(I),I===0?"uv":`uv${I}`}function M(I,F,k,Y,W){const Q=Y.fog,J=W.geometry,H=I.isMeshStandardMaterial?Y.environment:null,$=(I.isMeshStandardMaterial?t:e).get(I.envMap||H),K=$&&$.mapping===nh?$.image.height:null,he=v[I.type];I.precision!==null&&(g=r.getMaxPrecision(I.precision),g!==I.precision&&console.warn("THREE.WebGLProgram.getParameters:",I.precision,"not supported, using",g,"instead."));const ie=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,de=ie!==void 0?ie.length:0;let Ce=0;J.morphAttributes.position!==void 0&&(Ce=1),J.morphAttributes.normal!==void 0&&(Ce=2),J.morphAttributes.color!==void 0&&(Ce=3);let Fe,ge,Ge,Me;if(he){const Nn=Fs[he];Fe=Nn.vertexShader,ge=Nn.fragmentShader}else Fe=I.vertexShader,ge=I.fragmentShader,l.update(I),Ge=l.getVertexShaderID(I),Me=l.getFragmentShaderID(I);const Ye=i.getRenderTarget(),ct=i.state.buffers.depth.getReversed(),Je=W.isInstancedMesh===!0,Ke=W.isBatchedMesh===!0,Rt=!!I.map,Ue=!!I.matcap,Xe=!!$,Z=!!I.aoMap,We=!!I.lightMap,Pe=!!I.bumpMap,Qe=!!I.normalMap,Oe=!!I.displacementMap,vt=!!I.emissiveMap,ot=!!I.metalnessMap,q=!!I.roughnessMap,U=I.anisotropy>0,ue=I.clearcoat>0,Ae=I.dispersion>0,Be=I.iridescence>0,we=I.sheen>0,pe=I.transmission>0,qe=U&&!!I.anisotropyMap,Ve=ue&&!!I.clearcoatMap,st=ue&&!!I.clearcoatNormalMap,Ie=ue&&!!I.clearcoatRoughnessMap,nt=Be&&!!I.iridescenceMap,ft=Be&&!!I.iridescenceThicknessMap,wt=we&&!!I.sheenColorMap,Tt=we&&!!I.sheenRoughnessMap,zt=!!I.specularMap,tn=!!I.specularColorMap,Rn=!!I.specularIntensityMap,le=pe&&!!I.transmissionMap,Bt=pe&&!!I.thicknessMap,tt=!!I.gradientMap,ut=!!I.alphaMap,Ut=I.alphaTest>0,Dt=!!I.alphaHash,An=!!I.extensions;let Jn=Ws;I.toneMapped&&(Ye===null||Ye.isXRRenderTarget===!0)&&(Jn=i.toneMapping);const Ki={shaderID:he,shaderType:I.type,shaderName:I.name,vertexShader:Fe,fragmentShader:ge,defines:I.defines,customVertexShaderID:Ge,customFragmentShaderID:Me,isRawShaderMaterial:I.isRawShaderMaterial===!0,glslVersion:I.glslVersion,precision:g,batching:Ke,batchingColor:Ke&&W._colorsTexture!==null,instancing:Je,instancingColor:Je&&W.instanceColor!==null,instancingMorph:Je&&W.morphTexture!==null,supportsVertexTextures:m,outputColorSpace:Ye===null?i.outputColorSpace:Ye.isXRRenderTarget===!0?Ye.texture.colorSpace:ha,alphaToCoverage:!!I.alphaToCoverage,map:Rt,matcap:Ue,envMap:Xe,envMapMode:Xe&&$.mapping,envMapCubeUVHeight:K,aoMap:Z,lightMap:We,bumpMap:Pe,normalMap:Qe,displacementMap:m&&Oe,emissiveMap:vt,normalMapObjectSpace:Qe&&I.normalMapType===iL,normalMapTangentSpace:Qe&&I.normalMapType===kl,metalnessMap:ot,roughnessMap:q,anisotropy:U,anisotropyMap:qe,clearcoat:ue,clearcoatMap:Ve,clearcoatNormalMap:st,clearcoatRoughnessMap:Ie,dispersion:Ae,iridescence:Be,iridescenceMap:nt,iridescenceThicknessMap:ft,sheen:we,sheenColorMap:wt,sheenRoughnessMap:Tt,specularMap:zt,specularColorMap:tn,specularIntensityMap:Rn,transmission:pe,transmissionMap:le,thicknessMap:Bt,gradientMap:tt,opaque:I.transparent===!1&&I.blending===ws&&I.alphaToCoverage===!1,alphaMap:ut,alphaTest:Ut,alphaHash:Dt,combine:I.combine,mapUv:Rt&&b(I.map.channel),aoMapUv:Z&&b(I.aoMap.channel),lightMapUv:We&&b(I.lightMap.channel),bumpMapUv:Pe&&b(I.bumpMap.channel),normalMapUv:Qe&&b(I.normalMap.channel),displacementMapUv:Oe&&b(I.displacementMap.channel),emissiveMapUv:vt&&b(I.emissiveMap.channel),metalnessMapUv:ot&&b(I.metalnessMap.channel),roughnessMapUv:q&&b(I.roughnessMap.channel),anisotropyMapUv:qe&&b(I.anisotropyMap.channel),clearcoatMapUv:Ve&&b(I.clearcoatMap.channel),clearcoatNormalMapUv:st&&b(I.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ie&&b(I.clearcoatRoughnessMap.channel),iridescenceMapUv:nt&&b(I.iridescenceMap.channel),iridescenceThicknessMapUv:ft&&b(I.iridescenceThicknessMap.channel),sheenColorMapUv:wt&&b(I.sheenColorMap.channel),sheenRoughnessMapUv:Tt&&b(I.sheenRoughnessMap.channel),specularMapUv:zt&&b(I.specularMap.channel),specularColorMapUv:tn&&b(I.specularColorMap.channel),specularIntensityMapUv:Rn&&b(I.specularIntensityMap.channel),transmissionMapUv:le&&b(I.transmissionMap.channel),thicknessMapUv:Bt&&b(I.thicknessMap.channel),alphaMapUv:ut&&b(I.alphaMap.channel),vertexTangents:!!J.attributes.tangent&&(Qe||U),vertexColors:I.vertexColors,vertexAlphas:I.vertexColors===!0&&!!J.attributes.color&&J.attributes.color.itemSize===4,pointsUvs:W.isPoints===!0&&!!J.attributes.uv&&(Rt||ut),fog:!!Q,useFog:I.fog===!0,fogExp2:!!Q&&Q.isFogExp2,flatShading:I.flatShading===!0,sizeAttenuation:I.sizeAttenuation===!0,logarithmicDepthBuffer:p,reverseDepthBuffer:ct,skinning:W.isSkinnedMesh===!0,morphTargets:J.morphAttributes.position!==void 0,morphNormals:J.morphAttributes.normal!==void 0,morphColors:J.morphAttributes.color!==void 0,morphTargetsCount:de,morphTextureStride:Ce,numDirLights:F.directional.length,numPointLights:F.point.length,numSpotLights:F.spot.length,numSpotLightMaps:F.spotLightMap.length,numRectAreaLights:F.rectArea.length,numHemiLights:F.hemi.length,numDirLightShadows:F.directionalShadowMap.length,numPointLightShadows:F.pointShadowMap.length,numSpotLightShadows:F.spotShadowMap.length,numSpotLightShadowsWithMaps:F.numSpotLightShadowsWithMaps,numLightProbes:F.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:I.dithering,shadowMapEnabled:i.shadowMap.enabled&&k.length>0,shadowMapType:i.shadowMap.type,toneMapping:Jn,decodeVideoTexture:Rt&&I.map.isVideoTexture===!0&&En.getTransfer(I.map.colorSpace)===ei,decodeVideoTextureEmissive:vt&&I.emissiveMap.isVideoTexture===!0&&En.getTransfer(I.emissiveMap.colorSpace)===ei,premultipliedAlpha:I.premultipliedAlpha,doubleSided:I.side===ur,flipSided:I.side===oi,useDepthPacking:I.depthPacking>=0,depthPacking:I.depthPacking||0,index0AttributeName:I.index0AttributeName,extensionCl
vendor: 16,152 bytes, lines 3775-3803
3775ipCullDistance:An&&I.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(An&&I.extensions.multiDraw===!0||Ke)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:I.customProgramCacheKey()};return Ki.vertexUv1s=c.has(1),Ki.vertexUv2s=c.has(2),Ki.vertexUv3s=c.has(3),c.clear(),Ki}function x(I){const F=[];if(I.shaderID?F.push(I.shaderID):(F.push(I.customVertexShaderID),F.push(I.customFragmentShaderID)),I.defines!==void 0)for(const k in I.defines)F.push(k),F.push(I.defines[k]);return I.isRawShaderMaterial===!1&&(w(F,I),R(F,I),F.push(i.outputColorSpace)),F.push(I.customProgramCacheKey),F.join()}function w(I,F){I.push(F.precision),I.push(F.outputColorSpace),I.push(F.envMapMode),I.push(F.envMapCubeUVHeight),I.push(F.mapUv),I.push(F.alphaMapUv),I.push(F.lightMapUv),I.push(F.aoMapUv),I.push(F.bumpMapUv),I.push(F.normalMapUv),I.push(F.displacementMapUv),I.push(F.emissiveMapUv),I.push(F.metalnessMapUv),I.push(F.roughnessMapUv),I.push(F.anisotropyMapUv),I.push(F.clearcoatMapUv),I.push(F.clearcoatNormalMapUv),I.push(F.clearcoatRoughnessMapUv),I.push(F.iridescenceMapUv),I.push(F.iridescenceThicknessMapUv),I.push(F.sheenColorMapUv),I.push(F.sheenRoughnessMapUv),I.push(F.specularMapUv),I.push(F.specularColorMapUv),I.push(F.specularIntensityMapUv),I.push(F.transmissionMapUv),I.push(F.thicknessMapUv),I.push(F.combine),I.push(F.fogExp2),I.push(F.sizeAttenuation),I.push(F.morphTargetsCount),I.push(F.morphAttributeCount),I.push(F.numDirLights),I.push(F.numPointLights),I.push(F.numSpotLights),I.push(F.numSpotLightMaps),I.push(F.numHemiLights),I.push(F.numRectAreaLights),I.push(F.numDirLightShadows),I.push(F.numPointLightShadows),I.push(F.numSpotLightShadows),I.push(F.numSpotLightShadowsWithMaps),I.push(F.numLightProbes),I.push(F.shadowMapType),I.push(F.toneMapping),I.push(F.numClippingPlanes),I.push(F.numClipIntersection),I.push(F.depthPacking)}function R(I,F){a.disableAll(),F.supportsVertexTextures&&a.enable(0),F.instancing&&a.enable(1),F.instancingColor&&a.enable(2),F.instancingMorph&&a.enable(3),F.matcap&&a.enable(4),F.envMap&&a.enable(5),F.normalMapObjectSpace&&a.enable(6),F.normalMapTangentSpace&&a.enable(7),F.clearcoat&&a.enable(8),F.iridescence&&a.enable(9),F.alphaTest&&a.enable(10),F.vertexColors&&a.enable(11),F.vertexAlphas&&a.enable(12),F.vertexUv1s&&a.enable(13),F.vertexUv2s&&a.enable(14),F.vertexUv3s&&a.enable(15),F.vertexTangents&&a.enable(16),F.anisotropy&&a.enable(17),F.alphaHash&&a.enable(18),F.batching&&a.enable(19),F.dispersion&&a.enable(20),F.batchingColor&&a.enable(21),I.push(a.mask),a.disableAll(),F.fog&&a.enable(0),F.useFog&&a.enable(1),F.flatShading&&a.enable(2),F.logarithmicDepthBuffer&&a.enable(3),F.reverseDepthBuffer&&a.enable(4),F.skinning&&a.enable(5),F.morphTargets&&a.enable(6),F.morphNormals&&a.enable(7),F.morphColors&&a.enable(8),F.premultipliedAlpha&&a.enable(9),F.shadowMapEnabled&&a.enable(10),F.doubleSided&&a.enable(11),F.flipSided&&a.enable(12),F.useDepthPacking&&a.enable(13),F.dithering&&a.enable(14),F.transmission&&a.enable(15),F.sheen&&a.enable(16),F.opaque&&a.enable(17),F.pointsUvs&&a.enable(18),F.decodeVideoTexture&&a.enable(19),F.decodeVideoTextureEmissive&&a.enable(20),F.alphaToCoverage&&a.enable(21),I.push(a.mask)}function C(I){const F=v[I.type];let k;if(F){const Y=Fs[F];k=P1.clone(Y.uniforms)}else k=I.uniforms;return k}function N(I,F){let k;for(let Y=0,W=u.length;Y<W;Y++){const Q=u[Y];if(Q.cacheKey===F){k=Q,++k.usedTimes;break}}return k===void 0&&(k=new Vq(i,F,I,s),u.push(k)),k}function D(I){if(--I.usedTimes===0){const F=u.indexOf(I);u[F]=u[u.length-1],u.pop(),I.destroy()}}function P(I){l.remove(I)}function O(){l.dispose()}return{getParameters:M,getProgramCacheKey:x,getUniforms:C,acquireProgram:N,releaseProgram:D,releaseShaderCache:P,programs:u,dispose:O}}function $q(){let i=new WeakMap;function e(o){return i.has(o)}function t(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:e,get:t,remove:n,update:r,dispose:s}}function jq(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.material.id!==e.material.id?i.material.id-e.material.id:i.z!==e.z?i.z-e.z:i.id-e.id}function EE(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.z!==e.z?e.z-i.z:i.id-e.id}function RE(){const i=[];let e=0;const t=[],n=[],r=[];function s(){e=0,t.length=0,n.length=0,r.length=0}function o(p,m,g,v,b,M){let x=i[e];return x===void 0?(x={id:p.id,object:p,geometry:m,material:g,groupOrder:v,renderOrder:p.renderOrder,z:b,group:M},i[e]=x):(x.id=p.id,x.object=p,x.geometry=m,x.material=g,x.groupOrder=v,x.renderOrder=p.renderOrder,x.z=b,x.group=M),e++,x}function a(p,m,g,v,b,M){const x=o(p,m,g,v,b,M);g.transmission>0?n.push(x):g.transparent===!0?r.push(x):t.push(x)}function l(p,m,g,v,b,M){const x=o(p,m,g,v,b,M);g.transmission>0?n.unshift(x):g.transparent===!0?r.unshift(x):t.unshift(x)}function c(p,m){t.length>1&&t.sort(p||jq),n.length>1&&n.sort(m||EE),r.length>1&&r.sort(m||EE)}function u(){for(let p=e,m=i.length;p<m;p++){const g=i[p];if(g.id===null)break;g.id=null,g.object=null,g.geometry=null,g.material=null,g.group=null}}return{opaque:t,transmissive:n,transparent:r,init:s,push:a,unshift:l,finish:u,sort:c}}function Xq(){let i=new WeakMap;function e(n,r){const s=i.get(n);let o;return s===void 0?(o=new RE,i.set(n,[o])):r>=s.length?(o=new RE,s.push(o)):o=s[r],o}function t(){i=new WeakMap}return{get:e,dispose:t}}function Yq(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new re,color:new qt};break;case"SpotLight":t={position:new re,direction:new re,color:new qt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new re,color:new qt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new re,skyColor:new qt,groundColor:new qt};break;case"RectAreaLight":t={color:new qt,position:new re,halfWidth:new re,halfHeight:new re};break}return i[e.id]=t,t}}}function Qq(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new at};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new at};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new at,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[e.id]=t,t}}}let Zq=0;function Kq(i,e){return(e.castShadow?2:0)-(i.castShadow?2:0)+(e.map?1:0)-(i.map?1:0)}function Jq(i){const e=new Yq,t=Qq(),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 re);const r=new re,s=new un,o=new un;function a(c){let u=0,p=0,m=0;for(let I=0;I<9;I++)n.probe[I].set(0,0,0);let g=0,v=0,b=0,M=0,x=0,w=0,R=0,C=0,N=0,D=0,P=0;c.sort(Kq);for(let I=0,F=c.length;I<F;I++){const k=c[I],Y=k.color,W=k.intensity,Q=k.distance,J=k.shadow&&k.shadow.map?k.shadow.map.texture:null;if(k.isAmbientLight)u+=Y.r*W,p+=Y.g*W,m+=Y.b*W;else if(k.isLightProbe){for(let H=0;H<9;H++)n.probe[H].addScaledVector(k.sh.coefficients[H],W);P++}else if(k.isDirectionalLight){const H=e.get(k);if(H.color.copy(k.color).multiplyScalar(k.intensity),k.castShadow){const $=k.shadow,K=t.get(k);K.shadowIntensity=$.intensity,K.shadowBias=$.bias,K.shadowNormalBias=$.normalBias,K.shadowRadius=$.radius,K.shadowMapSize=$.mapSize,n.directionalShadow[g]=K,n.directionalShadowMap[g]=J,n.directionalShadowMatrix[g]=k.shadow.matrix,w++}n.directional[g]=H,g++}else if(k.isSpotLight){const H=e.get(k);H.position.setFromMatrixPosition(k.matrixWorld),H.color.copy(Y).multiplyScalar(W),H.distance=Q,H.coneCos=Math.cos(k.angle),H.penumbraCos=Math.cos(k.angle*(1-k.penumbra)),H.decay=k.decay,n.spot[b]=H;const $=k.shadow;if(k.map&&(n.spotLightMap[N]=k.map,N++,$.updateMatrices(k),k.castShadow&&D++),n.spotLightMatrix[b]=$.matrix,k.castShadow){const K=t.get(k);K.shadowIntensity=$.intensity,K.shadowBias=$.bias,K.shadowNormalBias=$.normalBias,K.shadowRadius=$.radius,K.shadowMapSize=$.mapSize,n.spotShadow[b]=K,n.spotShadowMap[b]=J,C++}b++}else if(k.isRectAreaLight){const H=e.get(k);H.color.copy(Y).multiplyScalar(W),H.halfWidth.set(k.width*.5,0,0),H.halfHeight.set(0,k.height*.5,0),n.rectArea[M]=H,M++}else if(k.isPointLight){const H=e.get(k);if(H.color.copy(k.color).multiplyScalar(k.intensity),H.distance=k.distance,H.decay=k.decay,k.castShadow){const $=k.shadow,K=t.get(k);K.shadowIntensity=$.intensity,K.shadowBias=$.bias,K.shadowNormalBias=$.normalBias,K.shadowRadius=$.radius,K.shadowMapSize=$.mapSize,K.shadowCameraNear=$.camera.near,K.shadowCameraFar=$.camera.far,n.pointShadow[v]=K,n.pointShadowMap[v]=J,n.pointShadowMatrix[v]=k.shadow.matrix,R++}n.point[v]=H,v++}else if(k.isHemisphereLight){const H=e.get(k);H.skyColor.copy(k.color).multiplyScalar(W),H.groundColor.copy(k.groundColor).multiplyScalar(W),n.hemi[x]=H,x++}}M>0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Lt.LTC_FLOAT_1,n.rectAreaLTC2=Lt.LTC_FLOAT_2):(n.rectAreaLTC1=Lt.LTC_HALF_1,n.rectAreaLTC2=Lt.LTC_HALF_2)),n.ambient[0]=u,n.ambient[1]=p,n.ambient[2]=m;const O=n.hash;(O.directionalLength!==g||O.pointLength!==v||O.spotLength!==b||O.rectAreaLength!==M||O.hemiLength!==x||O.numDirectionalShadows!==w||O.numPointShadows!==R||O.numSpotShadows!==C||O.numSpotMaps!==N||O.numLightProbes!==P)&&(n.directional.length=g,n.spot.length=b,n.rectArea.length=M,n.point.length=v,n.hemi.length=x,n.directionalShadow.length=w,n.directionalShadowMap.length=w,n.pointShadow.length=R,n.pointShadowMap.length=R,n.spotShadow.length=C,n.spotShadowMap.length=C,n.directionalShadowMatrix.length=w,n.pointShadowMatrix.length=R,n.spotLightMatrix.length=C+N-D,n.spotLightMap.length=N,n.numSpotLightShadowsWithMaps=D,n.numLightProbes=P,O.directionalLength=g,O.pointLength=v,O.spotLength=b,O.rectAreaLength=M,O.hemiLength=x,O.numDirectionalShadows=w,O.numPointShadows=R,O.numSpotShadows=C,O.numSpotMaps=N,O.numLightProbes=P,n.version=Zq++)}function l(c,u){let p=0,m=0,g=0,v=0,b=0;const M=u.matrixWorldInverse;for(let x=0,w=c.length;x<w;x++){const R=c[x];if(R.isDirectionalLight){const C=n.directional[p];C.direction.setFromMatrixPosition(R.matrixWorld),r.setFromMatrixPosition(R.target.matrixWorld),C.direction.sub(r),C.direction.transformDirection(M),p++}else if(R.isSpotLight){const C=n.spot[g];C.position.setFromMatrixPosition(R.matrixWorld),C.position.applyMatrix4(M),C.direction.setFromMatrixPosition(R.matrixWorld),r.setFromMatrixPosition(R.target.matrixWorld),C.direction.sub(r),C.direction.transformDirection(M),g++}else if(R.isRectAreaLight){const C=n.rectArea[v];C.position.setFromMatrixPosition(R.matrixWorld),C.position.applyMatrix4(M),o.identity(),s.copy(R.matrixWorld),s.premultiply(M),o.extractRotation(s),C.halfWidth.set(R.width*.5,0,0),C.halfHeight.set(0,R.height*.5,0),C.halfWidth.applyMatrix4(o),C.halfHeight.applyMatrix4(o),v++}else if(R.isPointLight){const C=n.point[m];C.position.setFromMatrixPosition(R.matrixWorld),C.position.applyMatrix4(M),m++}else if(R.isHemisphereLight){const C=n.hemi[b];C.direction.setFromMatrixPosition(R.matrixWorld),C.direction.transformDirection(M),b++}}}return{setup:a,setupView:l,state:n}}function CE(i){const e=new Jq(i),t=[],n=[];function r(u){c.camera=u,t.length=0,n.length=0}function s(u){t.push(u)}function o(u){n.push(u)}function a(){e.setup(t)}function l(u){e.setupView(t,u)}const c={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:c,setupLights:a,setupLightsView:l,pushLight:s,pushShadow:o}}function eH(i){let e=new WeakMap;function t(r,s=0){const o=e.get(r);let a;return o===void 0?(a=new CE(i),e.set(r,[a])):s>=o.length?(a=new CE(i),o.push(a)):a=o[s],a}function n(){e=new WeakMap}return{get:t,dispose:n}}const tH=`void main() {
3776	gl_Position = vec4( position, 1.0 );
3777}`,nH=`uniform sampler2D shadow_pass;
3778uniform vec2 resolution;
3779uniform float radius;
3780#include <packing>
3781void main() {
3782	const float samples = float( VSM_SAMPLES );
3783	float mean = 0.0;
3784	float squared_mean = 0.0;
3785	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
3786	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
3787	for ( float i = 0.0; i < samples; i ++ ) {
3788		float uvOffset = uvStart + i * uvStride;
3789		#ifdef HORIZONTAL_PASS
3790			vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
3791			mean += distribution.x;
3792			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
3793		#else
3794			float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
3795			mean += depth;
3796			squared_mean += depth * depth;
3797		#endif
3798	}
3799	mean = mean / samples;
3800	squared_mean = squared_mean / samples;
3801	float std_dev = sqrt( squared_mean - mean * mean );
3802	gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
3803}`;function iH(i,e,t){let n=new Wf;const r=new at,s=new at,o=new Jt,a=new fk({depthPacking:MO}),l=new pk,c={},u=t.maxTextureSize,p={[qs]:oi,[oi]:qs,[ur]:ur},m=new Xs({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new at},radius:{value:4}},vertexShader:tH,fragmentShader:nH}),g=m.clone();g.defines.HORIZONTAL_PASS=1;const v=new vi;v.setAttribute("position",new Ii(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new qn(v,m),M=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=_S;let x=this.type;this.render=function(D,P,O){if(M.enabled===!1||M.autoUpdate===!1&&M.needsUpdate===!1||D.length===0)return;const I=i.getRenderTarget(),F=i.getActiveCubeFace(),k=i.getActiveMipmapLevel(),Y=i.state;Y.setBlending(Hs),Y.buffers.color.setClear(1,1,1,1),Y.buffers.depth.setTest(!0),Y.setScissorTest(!1);const W=x!==fo&&this.type===fo,Q=x===fo&&this.type!==fo;for(let J=0,H=D.length;J<H;J++){const $=D[J],K=$.shadow;if(K===void 0){console.warn("THREE.WebGLShadowMap:",$,"has no shadow.");continue}if(K.autoUpdate===!1&&K.needsUpdate===!1)continue;r.copy(K.mapSize);const he=K.getFrameExtents();if(r.multiply(he),s.copy(K.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/he.x),r.x=s.x*he.x,K.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/he.y),r.y=s.y*he.y,K.mapSize.y=s.y)),K.map===null||W===!0||Q===!0){const de=this.type!==fo?{minFilter:xi,magFilter:xi}:{};K.map!==null&&K.map.dispose(),K.map=new Hc(r.x,r.y,de),K.map.texture.name=$.name+".shadowMap",K.camera.updateProjectionMatrix()}i.setRenderTarget(K.map),i.clear();const ie=K.getViewportCount();for(let de=0;de<ie;de++){const Ce=K.getViewport(de);o.set(s.x*Ce.x,s.y*Ce.y,s.x*Ce.z,s.y*Ce.w),Y.viewport(o),K.updateMatrices($,de),n=K.getFrustum(),C(P,O,K.camera,$,this.type)}K.isPointLightShadow!==!0&&this.type===fo&&w(K,O),K.needsUpdate=!1}x=this.type,M.needsUpdate=!1,i.setRenderTarget(I,F,k)};function w(D,P){const O=e.update(b);m.defines.VSM_SAMPLES!==D.blurSamples&&(m.defines.VSM_SAMPLES=D.blurSamples,g.defines.VSM_SAMPLES=D.blurSamples,m.needsUpdate=!0,g.needsUpdate=!0),D.mapPass===null&&(D.mapPass=new Hc(r.x,r.y)),m.uniforms.shadow_pass.value=D.map.texture,m.uniforms.resolution.value=D.mapSize,m.uniforms.radius.value=D.radius,i.setRenderTarget(D.mapPass),i.clear(),i.renderBufferDirect(P,null,O,m,b,null),g.uniforms.shadow_pass.value=D.mapPass.texture,g.uniforms.resolution.value=D.mapSize,g.uniforms.radius.value=D.radius,i.setRenderTarget(D.map),i.clear(),i.renderBufferDirect(P,null,O,g,b,null)}function R(D,P,O,I){let F=null;
vendor: 4,685 bytes, line 3803
3803const k=O.isPointLight===!0?D.customDistanceMaterial:D.customDepthMaterial;if(k!==void 0)F=k;else if(F=O.isPointLight===!0?l:a,i.localClippingEnabled&&P.clipShadows===!0&&Array.isArray(P.clippingPlanes)&&P.clippingPlanes.length!==0||P.displacementMap&&P.displacementScale!==0||P.alphaMap&&P.alphaTest>0||P.map&&P.alphaTest>0||P.alphaToCoverage===!0){const Y=F.uuid,W=P.uuid;let Q=c[Y];Q===void 0&&(Q={},c[Y]=Q);let J=Q[W];J===void 0&&(J=F.clone(),Q[W]=J,P.addEventListener("dispose",N)),F=J}if(F.visible=P.visible,F.wireframe=P.wireframe,I===fo?F.side=P.shadowSide!==null?P.shadowSide:P.side:F.side=P.shadowSide!==null?P.shadowSide:p[P.side],F.alphaMap=P.alphaMap,F.alphaTest=P.alphaToCoverage===!0?.5:P.alphaTest,F.map=P.map,F.clipShadows=P.clipShadows,F.clippingPlanes=P.clippingPlanes,F.clipIntersection=P.clipIntersection,F.displacementMap=P.displacementMap,F.displacementScale=P.displacementScale,F.displacementBias=P.displacementBias,F.wireframeLinewidth=P.wireframeLinewidth,F.linewidth=P.linewidth,O.isPointLight===!0&&F.isMeshDistanceMaterial===!0){const Y=i.properties.get(F);Y.light=O}return F}function C(D,P,O,I,F){if(D.visible===!1)return;if(D.layers.test(P.layers)&&(D.isMesh||D.isLine||D.isPoints)&&(D.castShadow||D.receiveShadow&&F===fo)&&(!D.frustumCulled||n.intersectsObject(D))){D.modelViewMatrix.multiplyMatrices(O.matrixWorldInverse,D.matrixWorld);const W=e.update(D),Q=D.material;if(Array.isArray(Q)){const J=W.groups;for(let H=0,$=J.length;H<$;H++){const K=J[H],he=Q[K.materialIndex];if(he&&he.visible){const ie=R(D,he,I,F);D.onBeforeShadow(i,D,P,O,W,ie,K),i.renderBufferDirect(O,null,W,ie,D,K),D.onAfterShadow(i,D,P,O,W,ie,K)}}}else if(Q.visible){const J=R(D,Q,I,F);D.onBeforeShadow(i,D,P,O,W,J,null),i.renderBufferDirect(O,null,W,J,D,null),D.onAfterShadow(i,D,P,O,W,J,null)}}const Y=D.children;for(let W=0,Q=Y.length;W<Q;W++)C(Y[W],P,O,I,F)}function N(D){D.target.removeEventListener("dispose",N);for(const O in c){const I=c[O],F=D.target.uuid;F in I&&(I[F].dispose(),delete I[F])}}}const rH={[IA]:BA,[FA]:kA,[UA]:zA,[qc]:OA,[BA]:IA,[kA]:FA,[zA]:UA,[OA]:qc};function sH(i,e){function t(){let le=!1;const Bt=new Jt;let tt=null;const ut=new Jt(0,0,0,0);return{setMask:function(Ut){tt!==Ut&&!le&&(i.colorMask(Ut,Ut,Ut,Ut),tt=Ut)},setLocked:function(Ut){le=Ut},setClear:function(Ut,Dt,An,Jn,Ki){Ki===!0&&(Ut*=Jn,Dt*=Jn,An*=Jn),Bt.set(Ut,Dt,An,Jn),ut.equals(Bt)===!1&&(i.clearColor(Ut,Dt,An,Jn),ut.copy(Bt))},reset:function(){le=!1,tt=null,ut.set(-1,0,0,0)}}}function n(){let le=!1,Bt=!1,tt=null,ut=null,Ut=null;return{setReversed:function(Dt){if(Bt!==Dt){const An=e.get("EXT_clip_control");Dt?An.clipControlEXT(An.LOWER_LEFT_EXT,An.ZERO_TO_ONE_EXT):An.clipControlEXT(An.LOWER_LEFT_EXT,An.NEGATIVE_ONE_TO_ONE_EXT),Bt=Dt;const Jn=Ut;Ut=null,this.setClear(Jn)}},getReversed:function(){return Bt},setTest:function(Dt){Dt?Ye(i.DEPTH_TEST):ct(i.DEPTH_TEST)},setMask:function(Dt){tt!==Dt&&!le&&(i.depthMask(Dt),tt=Dt)},setFunc:function(Dt){if(Bt&&(Dt=rH[Dt]),ut!==Dt){switch(Dt){case IA:i.depthFunc(i.NEVER);break;case BA:i.depthFunc(i.ALWAYS);break;case FA:i.depthFunc(i.LESS);break;case qc:i.depthFunc(i.LEQUAL);break;case UA:i.depthFunc(i.EQUAL);break;case OA:i.depthFunc(i.GEQUAL);break;case kA:i.depthFunc(i.GREATER);break;case zA:i.depthFunc(i.NOTEQUAL);break;default:i.depthFunc(i.LEQUAL)}ut=Dt}},setLocked:function(Dt){le=Dt},setClear:function(Dt){Ut!==Dt&&(Bt&&(Dt=1-Dt),i.clearDepth(Dt),Ut=Dt)},reset:function(){le=!1,tt=null,ut=null,Ut=null,Bt=!1}}}function r(){let le=!1,Bt=null,tt=null,ut=null,Ut=null,Dt=null,An=null,Jn=null,Ki=null;return{setTest:function(Nn){le||(Nn?Ye(i.STENCIL_TEST):ct(i.STENCIL_TEST))},setMask:function(Nn){Bt!==Nn&&!le&&(i.stencilMask(Nn),Bt=Nn)},setFunc:function(Nn,Er,Rr){(tt!==Nn||ut!==Er||Ut!==Rr)&&(i.stencilFunc(Nn,Er,Rr),tt=Nn,ut=Er,Ut=Rr)},setOp:function(Nn,Er,Rr){(Dt!==Nn||An!==Er||Jn!==Rr)&&(i.stencilOp(Nn,Er,Rr),Dt=Nn,An=Er,Jn=Rr)},setLocked:function(Nn){le=Nn},setClear:function(Nn){Ki!==Nn&&(i.clearStencil(Nn),Ki=Nn)},reset:function(){le=!1,Bt=null,tt=null,ut=null,Ut=null,Dt=null,An=null,Jn=null,Ki=null}}}const s=new t,o=new n,a=new r,l=new WeakMap,c=new WeakMap;let u={},p={},m=new WeakMap,g=[],v=null,b=!1,M=null,x=null,w=null,R=null,C=null,N=null,D=null,P=new qt(0,0,0),O=0,I=!1,F=null,k=null,Y=null,W=null,Q=null;const J=i.getParameter(i.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let H=!1,$=0;const K=i.getParameter(i.VERSION);K.indexOf("WebGL")!==-1?($=parseFloat(/^WebGL (\d)/.exec(K)[1]),H=$>=1):K.indexOf("OpenGL ES")!==-1&&($=parseFloat(/^OpenGL ES (\d)/.exec(K)[1]),H=$>=2);let he=null,ie={};const de=i.getParameter(i.SCISSOR_BOX),Ce=i.getParameter(i.VIEWPORT),Fe=new Jt().fromArray(de),ge=new Jt().fromArray(Ce);
vendor: 4,184 bytes, line 3803
3803function Ge(le,Bt,tt,ut){const Ut=new Uint8Array(4),Dt=i.createTexture();i.bindTexture(le,Dt),i.texParameteri(le,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(le,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let An=0;An<tt;An++)le===i.TEXTURE_3D||le===i.TEXTURE_2D_ARRAY?i.texImage3D(Bt,0,i.RGBA,1,1,ut,0,i.RGBA,i.UNSIGNED_BYTE,Ut):i.texImage2D(Bt+An,0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,Ut);return Dt}const Me={};Me[i.TEXTURE_2D]=Ge(i.TEXTURE_2D,i.TEXTURE_2D,1),Me[i.TEXTURE_CUBE_MAP]=Ge(i.TEXTURE_CUBE_MAP,i.TEXTURE_CUBE_MAP_POSITIVE_X,6),Me[i.TEXTURE_2D_ARRAY]=Ge(i.TEXTURE_2D_ARRAY,i.TEXTURE_2D_ARRAY,1,1),Me[i.TEXTURE_3D]=Ge(i.TEXTURE_3D,i.TEXTURE_3D,1,1),s.setClear(0,0,0,1),o.setClear(1),a.setClear(0),Ye(i.DEPTH_TEST),o.setFunc(qc),Pe(!1),Qe(H2),Ye(i.CULL_FACE),Z(Hs);function Ye(le){u[le]!==!0&&(i.enable(le),u[le]=!0)}function ct(le){u[le]!==!1&&(i.disable(le),u[le]=!1)}function Je(le,Bt){return p[le]!==Bt?(i.bindFramebuffer(le,Bt),p[le]=Bt,le===i.DRAW_FRAMEBUFFER&&(p[i.FRAMEBUFFER]=Bt),le===i.FRAMEBUFFER&&(p[i.DRAW_FRAMEBUFFER]=Bt),!0):!1}function Ke(le,Bt){let tt=g,ut=!1;if(le){tt=m.get(Bt),tt===void 0&&(tt=[],m.set(Bt,tt));const Ut=le.textures;if(tt.length!==Ut.length||tt[0]!==i.COLOR_ATTACHMENT0){for(let Dt=0,An=Ut.length;Dt<An;Dt++)tt[Dt]=i.COLOR_ATTACHMENT0+Dt;tt.length=Ut.length,ut=!0}}else tt[0]!==i.BACK&&(tt[0]=i.BACK,ut=!0);ut&&i.drawBuffers(tt)}function Rt(le){return v!==le?(i.useProgram(le),v=le,!0):!1}const Ue={[os]:i.FUNC_ADD,[vS]:i.FUNC_SUBTRACT,[yS]:i.FUNC_REVERSE_SUBTRACT};Ue[jP]=i.MIN,Ue[XP]=i.MAX;const Xe={[Sl]:i.ZERO,[xS]:i.ONE,[bS]:i.SRC_COLOR,[NA]:i.SRC_ALPHA,[RS]:i.SRC_ALPHA_SATURATE,[TS]:i.DST_COLOR,[MS]:i.DST_ALPHA,[SS]:i.ONE_MINUS_SRC_COLOR,[DA]:i.ONE_MINUS_SRC_ALPHA,[ES]:i.ONE_MINUS_DST_COLOR,[wS]:i.ONE_MINUS_DST_ALPHA,[pO]:i.CONSTANT_COLOR,[AO]:i.ONE_MINUS_CONSTANT_COLOR,[mO]:i.CONSTANT_ALPHA,[gO]:i.ONE_MINUS_CONSTANT_ALPHA};function Z(le,Bt,tt,ut,Ut,Dt,An,Jn,Ki,Nn){if(le===Hs){b===!0&&(ct(i.BLEND),b=!1);return}if(b===!1&&(Ye(i.BLEND),b=!0),le!==Hd){if(le!==M||Nn!==I){if((x!==os||C!==os)&&(i.blendEquation(i.FUNC_ADD),x=os,C=os),Nn)switch(le){case ws:i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case rf:i.blendFunc(i.ONE,i.ONE);break;case sf:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case of:i.blendFuncSeparate(i.ZERO,i.SRC_COLOR,i.ZERO,i.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",le);break}else switch(le){case ws:i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case rf:i.blendFunc(i.SRC_ALPHA,i.ONE);break;case sf:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case of:i.blendFunc(i.ZERO,i.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",le);break}w=null,R=null,N=null,D=null,P.set(0,0,0),O=0,M=le,I=Nn}return}Ut=Ut||Bt,Dt=Dt||tt,An=An||ut,(Bt!==x||Ut!==C)&&(i.blendEquationSeparate(Ue[Bt],Ue[Ut]),x=Bt,C=Ut),(tt!==w||ut!==R||Dt!==N||An!==D)&&(i.blendFuncSeparate(Xe[tt],Xe[ut],Xe[Dt],Xe[An]),w=tt,R=ut,N=Dt,D=An),(Jn.equals(P)===!1||Ki!==O)&&(i.blendColor(Jn.r,Jn.g,Jn.b,Ki),P.copy(Jn),O=Ki),M=le,I=!1}function We(le,Bt){le.side===ur?ct(i.CULL_FACE):Ye(i.CULL_FACE);let tt=le.side===oi;Bt&&(tt=!tt),Pe(tt),le.blending===ws&&le.transparent===!1?Z(Hs):Z(le.blending,le.blendEquation,le.blendSrc,le.blendDst,le.blendEquationAlpha,le.blendSrcAlpha,le.blendDstAlpha,le.blendColor,le.blendAlpha,le.premultipliedAlpha),o.setFunc(le.depthFunc),o.setTest(le.depthTest),o.setMask(le.depthWrite),s.setMask(le.colorWrite);const ut=le.stencilWrite;a.setTest(ut),ut&&(a.setMask(le.stencilWriteMask),a.setFunc(le.stencilFunc,le.stencilRef,le.stencilFuncMask),a.setOp(le.stencilFail,le.stencilZFail,le.stencilZPass)),vt(le.polygonOffset,le.polygonOffsetFactor,le.polygonOffsetUnits),le.alphaToCoverage===!0?Ye(i.SAMPLE_ALPHA_TO_COVERAGE):ct(i.SAMPLE_ALPHA_TO_COVERAGE)}function Pe(le){F!==le&&(le?i.frontFace(i.CW):i.frontFace(i.CCW),F=le)}function Qe(le){le!==WP?(Ye(i.CULL_FACE),le!==k&&(le===H2?i.cullFace(i.BACK):le===$P?i.cullFace(i.FRONT):i.cullFace(i.FRONT_AND_BACK))):ct(i.CULL_FACE),k=le}function Oe(le){le!==Y&&(H&&i.lineWidth(le),Y=le)}
vendor: 2,433 bytes, line 3803
3803function vt(le,Bt,tt){le?(Ye(i.POLYGON_OFFSET_FILL),(W!==Bt||Q!==tt)&&(i.polygonOffset(Bt,tt),W=Bt,Q=tt)):ct(i.POLYGON_OFFSET_FILL)}function ot(le){le?Ye(i.SCISSOR_TEST):ct(i.SCISSOR_TEST)}function q(le){le===void 0&&(le=i.TEXTURE0+J-1),he!==le&&(i.activeTexture(le),he=le)}function U(le,Bt,tt){tt===void 0&&(he===null?tt=i.TEXTURE0+J-1:tt=he);let ut=ie[tt];ut===void 0&&(ut={type:void 0,texture:void 0},ie[tt]=ut),(ut.type!==le||ut.texture!==Bt)&&(he!==tt&&(i.activeTexture(tt),he=tt),i.bindTexture(le,Bt||Me[le]),ut.type=le,ut.texture=Bt)}function ue(){const le=ie[he];le!==void 0&&le.type!==void 0&&(i.bindTexture(le.type,null),le.type=void 0,le.texture=void 0)}function Ae(){try{i.compressedTexImage2D(...arguments)}catch(le){console.error("THREE.WebGLState:",le)}}function Be(){try{i.compressedTexImage3D(...arguments)}catch(le){console.error("THREE.WebGLState:",le)}}function we(){try{i.texSubImage2D(...arguments)}catch(le){console.error("THREE.WebGLState:",le)}}function pe(){try{i.texSubImage3D(...arguments)}catch(le){console.error("THREE.WebGLState:",le)}}function qe(){try{i.compressedTexSubImage2D(...arguments)}catch(le){console.error("THREE.WebGLState:",le)}}function Ve(){try{i.compressedTexSubImage3D(...arguments)}catch(le){console.error("THREE.WebGLState:",le)}}function st(){try{i.texStorage2D(...arguments)}catch(le){console.error("THREE.WebGLState:",le)}}function Ie(){try{i.texStorage3D(...arguments)}catch(le){console.error("THREE.WebGLState:",le)}}function nt(){try{i.texImage2D(...arguments)}catch(le){console.error("THREE.WebGLState:",le)}}function ft(){try{i.texImage3D(...arguments)}catch(le){console.error("THREE.WebGLState:",le)}}function wt(le){Fe.equals(le)===!1&&(i.scissor(le.x,le.y,le.z,le.w),Fe.copy(le))}function Tt(le){ge.equals(le)===!1&&(i.viewport(le.x,le.y,le.z,le.w),ge.copy(le))}function zt(le,Bt){let tt=c.get(Bt);tt===void 0&&(tt=new WeakMap,c.set(Bt,tt));let ut=tt.get(le);ut===void 0&&(ut=i.getUniformBlockIndex(Bt,le.name),tt.set(le,ut))}function tn(le,Bt){const ut=c.get(Bt).get(le);l.get(Bt)!==ut&&(i.uniformBlockBinding(Bt,ut,le.__bindingPointIndex),l.set(Bt,ut))}function Rn(){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: 32,868 bytes, line 3803
3803(0,0,0,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(i.LESS),o.setReversed(!1),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),u={},he=null,ie={},p={},m=new WeakMap,g=[],v=null,b=!1,M=null,x=null,w=null,R=null,C=null,N=null,D=null,P=new qt(0,0,0),O=0,I=!1,F=null,k=null,Y=null,W=null,Q=null,Fe.set(0,0,i.canvas.width,i.canvas.height),ge.set(0,0,i.canvas.width,i.canvas.height),s.reset(),o.reset(),a.reset()}return{buffers:{color:s,depth:o,stencil:a},enable:Ye,disable:ct,bindFramebuffer:Je,drawBuffers:Ke,useProgram:Rt,setBlending:Z,setMaterial:We,setFlipSided:Pe,setCullFace:Qe,setLineWidth:Oe,setPolygonOffset:vt,setScissorTest:ot,activeTexture:q,bindTexture:U,unbindTexture:ue,compressedTexImage2D:Ae,compressedTexImage3D:Be,texImage2D:nt,texImage3D:ft,updateUBOMapping:zt,uniformBlockBinding:tn,texStorage2D:st,texStorage3D:Ie,texSubImage2D:we,texSubImage3D:pe,compressedTexSubImage2D:qe,compressedTexSubImage3D:Ve,scissor:wt,viewport:Tt,reset:Rn}}function oH(i,e,t,n,r,s,o){const a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new at,u=new WeakMap;let p;const m=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(q,U){return g?new OffscreenCanvas(q,U):YA("canvas")}function b(q,U,ue){let Ae=1;const Be=ot(q);if((Be.width>ue||Be.height>ue)&&(Ae=ue/Math.max(Be.width,Be.height)),Ae<1)if(typeof HTMLImageElement<"u"&&q instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&q instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&q instanceof ImageBitmap||typeof VideoFrame<"u"&&q instanceof VideoFrame){const we=Math.floor(Ae*Be.width),pe=Math.floor(Ae*Be.height);p===void 0&&(p=v(we,pe));const qe=U?v(we,pe):p;return qe.width=we,qe.height=pe,qe.getContext("2d").drawImage(q,0,0,we,pe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Be.width+"x"+Be.height+") to ("+we+"x"+pe+")."),qe}else return"data"in q&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Be.width+"x"+Be.height+")."),q;return q}function M(q){return q.generateMipmaps}function x(q){i.generateMipmap(q)}function w(q){return q.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:q.isWebGL3DRenderTarget?i.TEXTURE_3D:q.isWebGLArrayRenderTarget||q.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function R(q,U,ue,Ae,Be=!1){if(q!==null){if(i[q]!==void 0)return i[q];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+q+"'")}let we=U;if(U===i.RED&&(ue===i.FLOAT&&(we=i.R32F),ue===i.HALF_FLOAT&&(we=i.R16F),ue===i.UNSIGNED_BYTE&&(we=i.R8)),U===i.RED_INTEGER&&(ue===i.UNSIGNED_BYTE&&(we=i.R8UI),ue===i.UNSIGNED_SHORT&&(we=i.R16UI),ue===i.UNSIGNED_INT&&(we=i.R32UI),ue===i.BYTE&&(we=i.R8I),ue===i.SHORT&&(we=i.R16I),ue===i.INT&&(we=i.R32I)),U===i.RG&&(ue===i.FLOAT&&(we=i.RG32F),ue===i.HALF_FLOAT&&(we=i.RG16F),ue===i.UNSIGNED_BYTE&&(we=i.RG8)),U===i.RG_INTEGER&&(ue===i.UNSIGNED_BYTE&&(we=i.RG8UI),ue===i.UNSIGNED_SHORT&&(we=i.RG16UI),ue===i.UNSIGNED_INT&&(we=i.RG32UI),ue===i.BYTE&&(we=i.RG8I),ue===i.SHORT&&(we=i.RG16I),ue===i.INT&&(we=i.RG32I)),U===i.RGB_INTEGER&&(ue===i.UNSIGNED_BYTE&&(we=i.RGB8UI),ue===i.UNSIGNED_SHORT&&(we=i.RGB16UI),ue===i.UNSIGNED_INT&&(we=i.RGB32UI),ue===i.BYTE&&(we=i.RGB8I),ue===i.SHORT&&(we=i.RGB16I),ue===i.INT&&(we=i.RGB32I)),U===i.RGBA_INTEGER&&(ue===i.UNSIGNED_BYTE&&(we=i.RGBA8UI),ue===i.UNSIGNED_SHORT&&(we=i.RGBA16UI),ue===i.UNSIGNED_INT&&(we=i.RGBA32UI),ue===i.BYTE&&(we=i.RGBA8I),ue===i.SHORT&&(we=i.RGBA16I),ue===i.INT&&(we=i.RGBA32I)),U===i.RGB&&ue===i.UNSIGNED_INT_5_9_9_9_REV&&(we=i.RGB9_E5),U===i.RGBA){const pe=Be?O_:En.getTransfer(Ae);ue===i.FLOAT&&(we=i.RGBA32F),ue===i.HALF_FLOAT&&(we=i.RGBA16F),ue===i.UNSIGNED_BYTE&&(we=pe===ei?i.SRGB8_ALPHA8:i.RGBA8),ue===i.UNSIGNED_SHORT_4_4_4_4&&(we=i.RGBA4),ue===i.UNSIGNED_SHORT_5_5_5_1&&(we=i.RGB5_A1)}return(we===i.R16F||we===i.R32F||we===i.RG16F||we===i.RG32F||we===i.RGBA16F||we===i.RGBA32F)&&e.get("EXT_color_buffer_float"),we}function C(q,U){let ue;return q?U===null||U===mi||U===xo?ue=i.DEPTH24_STENCIL8:U===er?ue=i.DEPTH32F_STENCIL8:U===la&&(ue=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):U===null||U===mi||U===xo?ue=i.DEPTH_COMPONENT24:U===er?ue=i.DEPTH_COMPONENT32F:U===la&&(ue=i.DEPTH_COMPONENT16),ue}function N(q,U){return M(q)===!0||q.isFramebufferTexture&&q.minFilter!==xi&&q.minFilter!==xr?Math.log2(Math.max(U.width,U.height))+1:q.mipmaps!==void 0&&q.mipmaps.length>0?q.mipmaps.length:q.isCompressedTexture&&Array.isArray(q.image)?U.mipmaps.length:1}function D(q){const U=q.target;U.removeEventListener("dispose",D),O(U),U.isVideoTexture&&u.delete(U)}function P(q){const U=q.target;U.removeEventListener("dispose",P),F(U)}function O(q){const U=n.get(q);if(U.__webglInit===void 0)return;const ue=q.source,Ae=m.get(ue);if(Ae){const Be=Ae[U.__cacheKey];Be.usedTimes--,Be.usedTimes===0&&I(q),Object.keys(Ae).length===0&&m.delete(ue)}n.remove(q)}function I(q){const U=n.get(q);i.deleteTexture(U.__webglTexture);const ue=q.source,Ae=m.get(ue);delete Ae[U.__cacheKey],o.memory.textures--}function F(q){const U=n.get(q);if(q.depthTexture&&(q.depthTexture.dispose(),n.remove(q.depthTexture)),q.isWebGLCubeRenderTarget)for(let Ae=0;Ae<6;Ae++){if(Array.isArray(U.__webglFramebuffer[Ae]))for(let Be=0;Be<U.__webglFramebuffer[Ae].length;Be++)i.deleteFramebuffer(U.__webglFramebuffer[Ae][Be]);else i.deleteFramebuffer(U.__webglFramebuffer[Ae]);U.__webglDepthbuffer&&i.deleteRenderbuffer(U.__webglDepthbuffer[Ae])}else{if(Array.isArray(U.__webglFramebuffer))for(let Ae=0;Ae<U.__webglFramebuffer.length;Ae++)i.deleteFramebuffer(U.__webglFramebuffer[Ae]);else i.deleteFramebuffer(U.__webglFramebuffer);if(U.__webglDepthbuffer&&i.deleteRenderbuffer(U.__webglDepthbuffer),U.__webglMultisampledFramebuffer&&i.deleteFramebuffer(U.__webglMultisampledFramebuffer),U.__webglColorRenderbuffer)for(let Ae=0;Ae<U.__webglColorRenderbuffer.length;Ae++)U.__webglColorRenderbuffer[Ae]&&i.deleteRenderbuffer(U.__webglColorRenderbuffer[Ae]);U.__webglDepthRenderbuffer&&i.deleteRenderbuffer(U.__webglDepthRenderbuffer)}const ue=q.textures;for(let Ae=0,Be=ue.length;Ae<Be;Ae++){const we=n.get(ue[Ae]);we.__webglTexture&&(i.deleteTexture(we.__webglTexture),o.memory.textures--),n.remove(ue[Ae])}n.remove(q)}let k=0;function Y(){k=0}function W(){const q=k;return q>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+q+" texture units while this GPU supports only "+r.maxTextures),k+=1,q}function Q(q){const U=[];return U.push(q.wrapS),U.push(q.wrapT),U.push(q.wrapR||0),U.push(q.magFilter),U.push(q.minFilter),U.push(q.anisotropy),U.push(q.internalFormat),U.push(q.format),U.push(q.type),U.push(q.generateMipmaps),U.push(q.premultiplyAlpha),U.push(q.flipY),U.push(q.unpackAlignment),U.push(q.colorSpace),U.join()}function J(q,U){const ue=n.get(q);if(q.isVideoTexture&&Oe(q),q.isRenderTargetTexture===!1&&q.version>0&&ue.__version!==q.version){const Ae=q.image;if(Ae===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Ae.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ge(ue,q,U);return}}t.bindTexture(i.TEXTURE_2D,ue.__webglTexture,i.TEXTURE0+U)}function H(q,U){const ue=n.get(q);if(q.version>0&&ue.__version!==q.version){ge(ue,q,U);return}t.bindTexture(i.TEXTURE_2D_ARRAY,ue.__webglTexture,i.TEXTURE0+U)}function $(q,U){const ue=n.get(q);if(q.version>0&&ue.__version!==q.version){ge(ue,q,U);return}t.bindTexture(i.TEXTURE_3D,ue.__webglTexture,i.TEXTURE0+U)}function K(q,U){const ue=n.get(q);if(q.version>0&&ue.__version!==q.version){Ge(ue,q,U);return}t.bindTexture(i.TEXTURE_CUBE_MAP,ue.__webglTexture,i.TEXTURE0+U)}const he={[ih]:i.REPEAT,[ka]:i.CLAMP_TO_EDGE,[rh]:i.MIRRORED_REPEAT},ie={[xi]:i.NEAREST,[PS]:i.NEAREST_MIPMAP_NEAREST,[Ll]:i.NEAREST_MIPMAP_LINEAR,[xr]:i.LINEAR,[Wd]:i.LINEAR_MIPMAP_NEAREST,[Os]:i.LINEAR_MIPMAP_LINEAR},de={[DS]:i.NEVER,[OS]:i.ALWAYS,[E1]:i.LESS,[R1]:i.LEQUAL,[IS]:i.EQUAL,[US]:i.GEQUAL,[BS]:i.GREATER,[FS]:i.NOTEQUAL};function Ce(q,U){if(U.type===er&&e.has("OES_texture_float_linear")===!1&&(U.magFilter===xr||U.magFilter===Wd||U.magFilter===Ll||U.magFilter===Os||U.minFilter===xr||U.minFilter===Wd||U.minFilter===Ll||U.minFilter===Os)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(q,i.TEXTURE_WRAP_S,he[U.wrapS]),i.texParameteri(q,i.TEXTURE_WRAP_T,he[U.wrapT]),(q===i.TEXTURE_3D||q===i.TEXTURE_2D_ARRAY)&&i.texParameteri(q,i.TEXTURE_WRAP_R,he[U.wrapR]),i.texParameteri(q,i.TEXTURE_MAG_FILTER,ie[U.magFilter]),i.texParameteri(q,i.TEXTURE_MIN_FILTER,ie[U.minFilter]),U.compareFunction&&(i.texParameteri(q,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(q,i.TEXTURE_COMPARE_FUNC,de[U.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(U.magFilter===xi||U.minFilter!==Ll&&U.minFilter!==Os||U.type===er&&e.has("OES_texture_float_linear")===!1)return;if(U.anisotropy>1||n.get(U).__currentAnisotropy){const ue=e.get("EXT_texture_filter_anisotropic");i.texParameterf(q,ue.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(U.anisotropy,r.getMaxAnisotropy())),n.get(U).__currentAnisotropy=U.anisotropy}}}function Fe(q,U){let ue=!1;q.__webglInit===void 0&&(q.__webglInit=!0,U.addEventListener("dispose",D));const Ae=U.source;let Be=m.get(Ae);Be===void 0&&(Be={},m.set(Ae,Be));const we=Q(U);if(we!==q.__cacheKey){Be[we]===void 0&&(Be[we]={texture:i.createTexture(),usedTimes:0},o.memory.textures++,ue=!0),Be[we].usedTimes++;const pe=Be[q.__cacheKey];pe!==void 0&&(Be[q.__cacheKey].usedTimes--,pe.usedTimes===0&&I(U)),q.__cacheKey=we,q.__webglTexture=Be[we].texture}return ue}function ge(q,U,ue){let Ae=i.TEXTURE_2D;(U.isDataArrayTexture||U.isCompressedArrayTexture)&&(Ae=i.TEXTURE_2D_ARRAY),U.isData3DTexture&&(Ae=i.TEXTURE_3D);const Be=Fe(q,U),we=U.source;t.bindTexture(Ae,q.__webglTexture,i.TEXTURE0+ue);const pe=n.get(we);if(we.version!==pe.__version||Be===!0){t.activeTexture(i.TEXTURE0+ue);const qe=En.getPrimaries(En.workingColorSpace),Ve=U.colorSpace===vo?null:En.getPrimaries(U.colorSpace),st=U.colorSpace===vo||qe===Ve?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,U.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,U.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,st);let Ie=b(U.image,!1,r.maxTextureSize);Ie=vt(U,Ie);const nt=s.convert(U.format,U.colorSpace),ft=s.convert(U.type);let wt=R(U.internalFormat,nt,ft,U.colorSpace,U.isVideoTexture);Ce(Ae,U);let Tt;const zt=U.mipmaps,tn=U.isVideoTexture!==!0,Rn=pe.__version===void 0||Be===!0,le=we.dataReady,Bt=N(U,Ie);if(U.isDepthTexture)wt=C(U.format===So,U.type),Rn&&(tn?t.texStorage2D(i.TEXTURE_2D,1,wt,Ie.width,Ie.height):t.texImage2D(i.TEXTURE_2D,0,wt,Ie.width,Ie.height,0,nt,ft,null));else if(U.isDataTexture)if(zt.length>0){tn&&Rn&&t.texStorage2D(i.TEXTURE_2D,Bt,wt,zt[0].width,zt[0].height);for(let tt=0,ut=zt.length;tt<ut;tt++)Tt=zt[tt],tn?le&&t.texSubImage2D(i.TEXTURE_2D,tt,0,0,Tt.width,Tt.height,nt,ft,Tt.data):t.texImage2D(i.TEXTURE_2D,tt,wt,Tt.width,Tt.height,0,nt,ft,Tt.data);U.generateMipmaps=!1}else tn?(Rn&&t.texStorage2D(i.TEXTURE_2D,Bt,wt,Ie.width,Ie.height),le&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,Ie.width,Ie.height,nt,ft,Ie.data)):t.texImage2D(i.TEXTURE_2D,0,wt,Ie.width,Ie.height,0,nt,ft,Ie.data);else if(U.isCompressedTexture)if(U.isCompressedArrayTexture){tn&&Rn&&t.texStorage3D(i.TEXTURE_2D_ARRAY,Bt,wt,zt[0].width,zt[0].height,Ie.depth);for(let tt=0,ut=zt.length;tt<ut;tt++)if(Tt=zt[tt],U.format!==Yi)if(nt!==null)if(tn){if(le)if(U.layerUpdates.size>0){const Ut=sE(Tt.width,Tt.height,U.format,U.type);for(const Dt of U.layerUpdates){const An=Tt.data.subarray(Dt*Ut/Tt.data.BYTES_PER_ELEMENT,(Dt+1)*Ut/Tt.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,tt,0,0,Dt,Tt.width,Tt.height,1,nt,An)}U.clearLayerUpdates()}else t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,tt,0,0,0,Tt.width,Tt.height,Ie.depth,nt,Tt.data)}else t.compressedTexImage3D(i.TEXTURE_2D_ARRAY,tt,wt,Tt.width,Tt.height,Ie.depth,0,Tt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else tn?le&&t.texSubImage3D(i.TEXTURE_2D_ARRAY,tt,0,0,0,Tt.width,Tt.height,Ie.depth,nt,ft,Tt.data):t.texImage3D(i.TEXTURE_2D_ARRAY,tt,wt,Tt.width,Tt.height,Ie.depth,0,nt,ft,Tt.data)}else{tn&&Rn&&t.texStorage2D(i.TEXTURE_2D,Bt,wt,zt[0].width,zt[0].height);for(let tt=0,ut=zt.length;tt<ut;tt++)Tt=zt[tt],U.format!==Yi?nt!==null?tn?le&&t.compressedTexSubImage2D(i.TEXTURE_2D,tt,0,0,Tt.width,Tt.height,nt,Tt.data):t.compressedTexImage2D(i.TEXTURE_2D,tt,wt,Tt.width,Tt.height,0,Tt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):tn?le&&t.texSubImage2D(i.TEXTURE_2D,tt,0,0,Tt.width,Tt.height,nt,ft,Tt.data):t.texImage2D(i.TEXTURE_2D,tt,wt,Tt.width,Tt.height,0,nt,ft,Tt.data)}else if(U.isDataArrayTexture)if(tn){if(Rn&&t.texStorage3D(i.TEXTURE_2D_ARRAY,Bt,wt,Ie.width,Ie.height,Ie.depth),le)if(U.layerUpdates.size>0){const tt=sE(Ie.width,Ie.height,U.format,U.type);for(const ut of U.layerUpdates){const Ut=Ie.data.subarray(ut*tt/Ie.data.BYTES_PER_ELEMENT,(ut+1)*tt/Ie.data.BYTES_PER_ELEMENT);t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,ut,Ie.width,Ie.height,1,nt,ft,Ut)}U.clearLayerUpdates()}else t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,Ie.width,Ie.height,Ie.depth,nt,ft,Ie.data)}else t.texImage3D(i.TEXTURE_2D_ARRAY,0,wt,Ie.width,Ie.height,Ie.depth,0,nt,ft,Ie.data);else if(U.isData3DTexture)tn?(Rn&&t.texStorage3D(i.TEXTURE_3D,Bt,wt,Ie.width,Ie.height,Ie.depth),le&&t.texSubImage3D(i.TEXTURE_3D,0,0,0,0,Ie.width,Ie.height,Ie.depth,nt,ft,Ie.data)):t.texImage3D(i.TEXTURE_3D,0,wt,Ie.width,Ie.height,Ie.depth,0,nt,ft,Ie.data);else if(U.isFramebufferTexture){if(Rn)if(tn)t.texStorage2D(i.TEXTURE_2D,Bt,wt,Ie.width,Ie.height);else{let tt=Ie.width,ut=Ie.height;for(let Ut=0;Ut<Bt;Ut++)t.texImage2D(i.TEXTURE_2D,Ut,wt,tt,ut,0,nt,ft,null),tt>>=1,ut>>=1}}else if(zt.length>0){if(tn&&Rn){const tt=ot(zt[0]);t.texStorage2D(i.TEXTURE_2D,Bt,wt,tt.width,tt.height)}for(let tt=0,ut=zt.length;tt<ut;tt++)Tt=zt[tt],tn?le&&t.texSubImage2D(i.TEXTURE_2D,tt,0,0,nt,ft,Tt):t.texImage2D(i.TEXTURE_2D,tt,wt,nt,ft,Tt);U.generateMipmaps=!1}else if(tn){if(Rn){const tt=ot(Ie);t.texStorage2D(i.TEXTURE_2D,Bt,wt,tt.width,tt.height)}le&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,nt,ft,Ie)}else t.texImage2D(i.TEXTURE_2D,0,wt,nt,ft,Ie);M(U)&&x(Ae),pe.__version=we.version,U.onUpdate&&U.onUpdate(U)}q.__version=U.version}function Ge(q,U,ue){if(U.image.length!==6)return;const Ae=Fe(q,U),Be=U.source;t.bindTexture(i.TEXTURE_CUBE_MAP,q.__webglTexture,i.TEXTURE0+ue);const we=n.get(Be);if(Be.version!==we.__version||Ae===!0){t.activeTexture(i.TEXTURE0+ue);const pe=En.getPrimaries(En.workingColorSpace),qe=U.colorSpace===vo?null:En.getPrimaries(U.colorSpace),Ve=U.colorSpace===vo||pe===qe?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,U.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,U.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ve);const st=U.isCompressedTexture||U.image[0].isCompressedTexture,Ie=U.image[0]&&U.image[0].isDataTexture,nt=[];for(let ut=0;ut<6;ut++)!st&&!Ie?nt[ut]=b(U.image[ut],!0,r.maxCubemapSize):nt[ut]=Ie?U.image[ut].image:U.image[ut],nt[ut]=vt(U,nt[ut]);const ft=nt[0],wt=s.convert(U.format,U.colorSpace),Tt=s.convert(U.type),zt=R(U.internalFormat,wt,Tt,U.colorSpace),tn=U.isVideoTexture!==!0,Rn=we.__version===void 0||Ae===!0,le=Be.dataReady;let Bt=N(U,ft);Ce(i.TEXTURE_CUBE_MAP,U);let tt;if(st){tn&&Rn&&t.texStorage2D(i.TEXTURE_CUBE_MAP,Bt,zt,ft.width,ft.height);for(let ut=0;ut<6;ut++){tt=nt[ut].mipmaps;for(let Ut=0;Ut<tt.length;Ut++){const Dt=tt[Ut];U.format!==Yi?wt!==null?tn?le&&t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Ut,0,0,Dt.width,Dt.height,wt,Dt.data):t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Ut,zt,Dt.width,Dt.height,0,Dt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):tn?le&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Ut,0,0,Dt.width,Dt.height,wt,Tt,Dt.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Ut,zt,Dt.width,Dt.height,0,wt,Tt,Dt.data)}}}else{if(tt=U.mipmaps,tn&&Rn){tt.length>0&&Bt++;const ut=ot(nt[0]);t.texStorage2D(i.TEXTURE_CUBE_MAP,Bt,zt,ut.width,ut.height)}for(let ut=0;ut<6;ut++)if(Ie){tn?le&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ut,0,0,0,nt[ut].width,nt[ut].height,wt,Tt,nt[ut].data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ut,0,zt,nt[ut].width,nt[ut].height,0,wt,Tt,nt[ut].data);for(let Ut=0;Ut<tt.length;Ut++){const An=tt[Ut].image[ut].image;tn?le&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Ut+1,0,0,An.width,An.height,wt,Tt,An.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Ut+1,zt,An.width,An.height,0,wt,Tt,An.data)}}else{tn?le&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ut,0,0,0,wt,Tt,nt[ut]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ut,0,zt,wt,Tt,nt[ut]);for(let Ut=0;Ut<tt.length;Ut++){const Dt=tt[Ut];tn?le&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Ut+1,0,0,wt,Tt,Dt.image[ut]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Ut+1,zt,wt,Tt,Dt.image[ut])}}}M(U)&&x(i.TEXTURE_CUBE_MAP),we.__version=Be.version,U.onUpdate&&U.onUpdate(U)}q.__version=U.version}function Me(q,U,ue,Ae,Be,we){const pe=s.convert(ue.format,ue.colorSpace),qe=s.convert(ue.type),Ve=R(ue.internalFormat,pe,qe,ue.colorSpace),st=n.get(U),Ie=n.get(ue);if(Ie.__renderTarget=U,!st.__hasExternalTextures){const nt=Math.max(1,U.width>>we),ft=Math.max(1,U.height>>we);Be===i.TEXTURE_3D||Be===i.TEXTURE_2D_ARRAY?t.texImage3D(Be,we,Ve,nt,ft,U.depth,0,pe,qe,null):t.texImage2D(Be,we,Ve,nt,ft,0,pe,qe,null)}t.bindFramebuffer(i.FRAMEBUFFER,q),Qe(U)?a.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,Ae,Be,Ie.__webglTexture,0,Pe(U)):(Be===i.TEXTURE_2D||Be>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&Be<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,Ae,Be,Ie.__webglTexture,we),t.bindFramebuffer(i.FRAMEBUFFER,null)}function Ye(q,U,ue){if(i.bindRenderbuffer(i.RENDERBUFFER,q),U.depthBuffer){const Ae=U.depthTexture,Be=Ae&&Ae.isDepthTexture?Ae.type:null,we=C(U.stencilBuffer,Be),pe=U.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,qe=Pe(U);Qe(U)?a.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,qe,we,U.width,U.height):ue?i.renderbufferStorageMultisample(i.RENDERBUFFER,qe,we,U.width,U.height):i.renderbufferStorage(i.RENDERBUFFER,we,U.width,U.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,pe,i.RENDERBUFFER,q)}else{const Ae=U.textures;for(let Be=0;Be<Ae.length;Be++){const we=Ae[Be],pe=s.convert(we.format,we.colorSpace),qe=s.convert(we.type),Ve=R(we.internalFormat,pe,qe,we.colorSpace),st=Pe(U);ue&&Qe(U)===!1?i.renderbufferStorageMultisample(i.RENDERBUFFER,st,Ve,U.width,U.height):Qe(U)?a.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,st,Ve,U.width,U.height):i.renderbufferStorage(i.RENDERBUFFER,Ve,U.width,U.height)}}i.bindRenderbuffer(i.RENDERBUFFER,null)}function ct(q,U){if(U&&U.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(i.FRAMEBUFFER,q),!(U.depthTexture&&U.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const Ae=n.get(U.depthTexture);Ae.__renderTarget=U,(!Ae.__webglTexture||U.depthTexture.image.width!==U.width||U.depthTexture.image.height!==U.height)&&(U.depthTexture.image.width=U.width,U.depthTexture.image.height=U.height,U.depthTexture.needsUpdate=!0),J(U.depthTexture,0);const Be=Ae.__webglTexture,we=Pe(U);if(U.depthTexture.format===bo)Qe(U)?a.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,Be,0,we):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,Be,0);else if(U.depthTexture.format===So)Qe(U)?a.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,Be,0,we):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,Be,0);else throw new Error("Unknown depthTexture format")}function Je(q){const U=n.get(q),ue=q.isWebGLCubeRenderTarget===!0;if(U.__boundDepthTexture!==q.depthTexture){const Ae=q.depthTexture;if(U.__depthDisposeCallback&&U.__depthDisposeCallback(),Ae){const Be=()=>{delete U.__boundDepthTexture,delete U.__depthDisposeCallback,Ae.removeEventListener("dispose",Be)};Ae.addEventListener("dispose",Be),U.__depthDisposeCallback=Be}U.__boundDepthTexture=Ae}if(q.depthTexture&&!U.__autoAllocateDepthBuffer){if(ue)throw new Error("target.depthTexture not supported in Cube render targets");const Ae=q.texture.mipmaps;Ae&&Ae.length>0?ct(U.__webglFramebuffer[0],q):ct(U.__webglFramebuffer,q)}else if(ue){U.__webglDepthbuffer=[];for(let Ae=0;Ae<6;Ae++)if(t.bindFramebuffer(i.FRAMEBUFFER,U.__webglFramebuffer[Ae]),U.__webglDepthbuffer[Ae]===void 0)U.__webglDepthbuffer[Ae]=i.createRenderbuffer(),Ye(U.__webglDepthbuffer[Ae],q,!1);else{const Be=q.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,we=U.__webglDepthbuffer[Ae];i.bindRenderbuffer(i.RENDERBUFFER,we),i.framebufferRenderbuffer(i.FRAMEBUFFER,Be,i.RENDERBUFFER,we)}}else{const Ae=q.texture.mipmaps;if(Ae&&Ae.length>0?t.bindFramebuffer(i.FRAMEBUFFER,U.__webglFramebuffer[0]):t.bindFramebuffer(i.FRAMEBUFFER,U.__webglFramebuffer),U.__webglDepthbuffer===void 0)U.__webglDepthbuffer=i.createRenderbuffer(),Ye(U.__webglDepthbuffer,q,!1);else{const Be=q.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,we=U.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,we),i.framebufferRenderbuffer(i.FRAMEBUFFER,Be,i.RENDERBUFFER,we)}}t.bindFramebuffer(i.FRAMEBUFFER,null)}function Ke(q,U,ue){const Ae=n.get(q);U!==void 0&&Me(Ae.__webglFramebuffer,q,q.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),ue!==void 0&&Je(q)}function Rt(q){const U=q.texture,ue=n.get(q),Ae=n.get(U);q.addEventListener("dispose",P);const Be=q.textures,we=q.isWebGLCubeRenderTarget===!0,pe=Be.length>1;if(pe||(Ae.__webglTexture===void 0&&(Ae.__webglTexture=i.createTexture()),Ae.__version=U.version,o.memory.textures++),we){ue.__webglFramebuffer=[];for(let qe=0;qe<6;qe++)if(U.mipmaps&&U.mipmaps.length>0){ue.__webglFramebuffer[qe]=[];for(let Ve=0;Ve<U.mipmaps.length;Ve++)ue.__webglFramebuffer[qe][Ve]=i.createFramebuffer()}else ue.__webglFramebuffer[qe]=i.createFramebuffer()}else{if(U.mipmaps&&U.mipmaps.length>0){ue.__webglFramebuffer=[];for(let qe=0;qe<U.mipmaps.length;qe++)ue.__webglFramebuffer[qe]=i.createFramebuffer()}else ue.__webglFramebuffer=i.createFramebuffer();if(pe)for(let qe=0,Ve=Be.length;qe<Ve;qe++){const st=n.get(Be[qe]);st.__webglTexture===void 0&&(st.__webglTexture=i.createTexture(),o.memory.textures++)}if(q.samples>0&&Qe(q)===!1){ue.__webglMultisampledFramebuffer=i.createFramebuffer(),ue.__webglColorRenderbuffer=[],t.bindFramebuffer(i.FRAMEBUFFER,ue.__webglMultisampledFramebuffer);for(let qe=0;qe<Be.length;qe++){const Ve=Be[qe];ue.__webglColorRenderbuffer[qe]=i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,ue.__webglColorRenderbuffer[qe]);const st=s.convert(Ve.format,Ve.colorSpace),Ie=s.convert(Ve.type),nt=R(Ve.internalFormat,st,Ie,Ve.colorSpace,q.isXRRenderTarget===!0),ft=Pe(q);i.renderbufferStorageMultisample(i.RENDERBUFFER,ft,nt,q.width,q.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+qe,i.RENDERBUFFER,ue.__webglColorRenderbuffer[qe])}i.bindRenderbuffer(i.RENDERBUFFER,null),q.depthBuffer&&(ue.__webglDepthRenderbuffer=i.createRenderbuffer(),Ye(ue.__webglDepthRenderbuffer,q,!0)),t.bindFramebuffer(i.FRAMEBUFFER,null)}}if(we){t.bindTexture(i.TEXTURE_CUBE_MAP,Ae.__webglTexture),Ce(i.TEXTURE_CUBE_MAP,U);for(let qe=0;qe<6;qe++)if(U.mipmaps&&U.mipmaps.length>0)for(let Ve=0;Ve<U.mipmaps.length;Ve++)Me(ue.__webglFramebuffer[qe][Ve],q,U,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+qe,Ve);else Me(ue.__webglFramebuffer[qe],q,U,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+qe,0);M(U)&&x(i.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(pe){for(let qe=0,Ve=Be.length;qe<Ve;qe++){const st=Be[qe],Ie=n.get(st);t.bindTexture(i.TEXTURE_2D,Ie.__webglTexture),Ce(i.TEXTURE_2D,st),Me(ue.__webglFramebuffer,q,st,i.COLOR_ATTACHMENT0+qe,i.TEXTURE_2D,0),M(st)&&x(i.TEXTURE_2D)}t.unbindTexture()}else{let qe=i.TEXTURE_2D;if((q.isWebGL3DRenderTarget||q.isWebGLArrayRenderTarget)&&(qe=q.isWebGL3DRenderTarget?i.TEXTURE_3D:i.TEXTURE_2D_ARRAY),t.bindTexture(qe,Ae.__webglTexture),Ce(qe,U),U.mipmaps&&U.mipmaps.length>0)for(let Ve=0;Ve<U.mipmaps.length;Ve++)Me(ue.__webglFramebuffer[Ve],q,U,i.COLOR_ATTACHMENT0,qe,Ve);else Me(ue.__webglFramebuffer,q,U,i.COLOR_ATTACHMENT0,qe,0);M(U)&&x(qe),t.unbindTexture()}q.depthBuffer&&Je(q)}function Ue(q){const U=q.textures;for(let ue=0,Ae=U.length;ue<Ae;ue++){const Be=U[ue];if(M(Be)){const we=w(q),pe=n.get(Be).__webglTexture;t.bindTexture(we,pe),x(we),t.unbindTexture()}}}const Xe=[],Z=[];function We(q){if(q.samples>0){if(Qe(q)===!1){const U=q.textures,ue=q.width,Ae=q.height;let Be=i.COLOR_BUFFER_BIT;const we=q.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,pe=n.get(q),qe=U.length>1;if(qe)for(let st=0;st<U.length;st++)t.bindFramebuffer(i.FRAMEBUFFER,pe.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+st,i.RENDERBUFFER,null),t.bindFramebuffer(i.FRAMEBUFFER,pe.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+st,i.TEXTURE_2D,null,0);t.bindFramebuffer(i.READ_FRAMEBUFFER,pe.__webglMultisampledFramebuffer);const Ve=q.texture.mipmaps;Ve&&Ve.length>0?t.bindFramebuffer(i.DRAW_FRAMEBUFFER,pe.__webglFramebuffer[0]):t.bindFramebuffer(i.DRAW_FRAMEBUFFER,pe.__webglFramebuffer);for(let st=0;st<U.length;st++){if(q.resolveDepthBuffer&&(q.depthBuffer&&(Be|=i.DEPTH_BUFFER_BIT),q.stencilBuffer&&q.resolveStencilBuffer&&(Be|=i.STENCIL_BUFFER_BIT)),qe){i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,pe.__webglColorRenderbuffer[st]);const Ie=n.get(U[st]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,Ie,0)}i.blitFramebuffer(0,0,ue,Ae,0,0,ue,Ae,Be,i.NEAREST),l===!0&&(Xe.length=0,Z.length=0,Xe.push(i.COLOR_ATTACHMENT0+st),q.depthBuffer&&q.resolveDepthBuffer===!1&&(Xe.push(we),Z.push(we),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,Z)),i.invalidateFramebuffer(i.READ_FRAMEBUFFER,Xe))}if(t.bindFramebuffer(i.READ_FRAMEBUFFER,null),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),qe)for(let st=0;st<U.length;st++){t.bindFramebuffer(i.FRAMEBUFFER,pe.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+st,i.RENDERBUFFER,pe.__webglColorRenderbuffer[st]);const Ie=n.get(U[st]).__webglTexture;t.bindFramebuffer(i.FRAMEBUFFER,pe.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+st,i.TEXTURE_2D,Ie,0)}t.bindFramebuffer(i.DRAW_FRAMEBUFFER,pe.__webglMultisampledFramebuffer)}else if(q.depthBuffer&&q.resolveDepthBuffer===!1&&l){const U=q.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[U])}}}function Pe(q){return Math.min(r.maxSamples,q.samples)}function Qe(q){const U=n.get(q);return q.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&U.__useRenderToTexture!==!1}function Oe(q){const U=o.render.frame;u.get(q)!==U&&(u.set(q,U),q.update())}function vt(q,U){const ue=q.colorSpace,Ae=q.format,Be=q.type;return q.isCompressedTexture===!0||q.isVideoTexture===!0||ue!==ha&&ue!==vo&&(En.getTransfer(ue)===ei?(Ae!==Yi||Be!==Gi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ue)),U}function ot(q){return typeof HTMLImageElement<"u"&&q instanceof HTMLImageElement?(c.width=q.naturalWidth||q.width,c.height=q.naturalHeight||q.height):typeof VideoFrame<"u"&&q instanceof VideoFrame?(c.width=q.displayWidth,c.height=q.displayHeight):(c.width=q.width,c.height=q.height),c}this.allocateTextureUnit=W,this.resetTextureUnits=Y,this.setTexture2D=J,this.setTexture2DArray=H,this.setTexture3D=$,this.setTextureCube=K,this.rebindTextures=Ke,this.setupRenderTarget=Rt,this.updateRenderTargetMipmap=Ue,this.updateMultisampleRenderTarget=We,this.setupDepthRenderbuffer=Je,this.setupFrameBufferTexture=Me,this.useMultisampledRTT=Qe}function aH(i,e){function t(n,r=vo){let s;const o=En.getTransfer(r);if(n===Gi)return i.UNSIGNED_BYTE;if(n===M1)return i.UNSIGNED_SHORT_4_4_4_4;if(n===w1)return i.UNSIGNED_SHORT_5_5_5_1;if(n===T1)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===Gu)return i.BYTE;if(n===qu)return i.SHORT;if(n===la)return i.UNSIGNED_SHORT;if(n===Ir)return i.INT;if(n===mi)return i.UNSIGNED_INT;if(n===er)return i.FLOAT;if(n===dr)return i.HALF_FLOAT;if(n===LS)return i.ALPHA;if(n===R0)return i.RGB;if(n===Yi)return i.RGBA;if(n===bo)return i.DEPTH_COMPONENT;if(n===So)return i.DEPTH_STENCIL;if(n===C0)return i.RED;if(n===Vf)return i.RED_INTEGER;if(n===Nl)return i.RG;if(n===Gf)return i.RG_INTEGER;if(n===qf)return i.RGBA_INTEGER;if(n===Hu||n===Lc||n===Nc||n===Dc)if(o===ei)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===Hu)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Lc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Nc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Dc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===Hu)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Lc)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Nc)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Dc)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===VA||n===GA||n===qA||n===HA)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===VA)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===GA)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===qA)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===HA)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===WA||n===af||n===lf)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===WA||n===af)return o===ei?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===lf)return o===ei?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===cf||n===uf||n===hf||n===df||n===ff||n===pf||n===Af||n===mf||n===gf||n===_f||n===vf||n===yf||n===xf||n===bf)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===cf)return o===ei?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===uf)return o===ei?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===hf)return o===ei?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===df)return o===ei?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===ff)return o===ei?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===pf)return o===ei?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Af)return o===ei?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===mf)return o===ei?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===gf)return o===ei?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===_f)return o===ei?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===vf)return o===ei?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===yf)return o===ei?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===xf)return o===ei?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===bf)return o===ei?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Wu||n===W2||n===$2)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===Wu)return o===ei?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===W2)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===$2)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===NS||n===$A||n===jA||n===XA)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===Wu)return s.COMPRESSED_RED_RGT
vendor: 20,069 bytes, lines 3803-3827
3803C1_EXT;if(n===$A)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===jA)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===XA)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===xo?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:t}}const lH=`
3804void main() {
3805
3806	gl_Position = vec4( position, 1.0 );
3807
3808}`,cH=`
3809uniform sampler2DArray depthColor;
3810uniform float depthWidth;
3811uniform float depthHeight;
3812
3813void main() {
3814
3815	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
3816
3817	if ( coord.x >= 1.0 ) {
3818
3819		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
3820
3821	} else {
3822
3823		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
3824
3825	}
3826
3827}`;class uH{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const r=new Cs,s=e.properties.get(r);s.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new Xs({vertexShader:lH,fragmentShader:cH,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new qn(new QS(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}let hH=class extends il{constructor(e,t){super();const n=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,p=null,m=null,g=null,v=null;const b=new uH,M=t.getContextAttributes();let x=null,w=null;const R=[],C=[],N=new at;let D=null;const P=new Br;P.viewport=new Jt;const O=new Br;O.viewport=new Jt;const I=[P,O],F=new kL;let k=null,Y=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ge){let Ge=R[ge];return Ge===void 0&&(Ge=new c_,R[ge]=Ge),Ge.getTargetRaySpace()},this.getControllerGrip=function(ge){let Ge=R[ge];return Ge===void 0&&(Ge=new c_,R[ge]=Ge),Ge.getGripSpace()},this.getHand=function(ge){let Ge=R[ge];return Ge===void 0&&(Ge=new c_,R[ge]=Ge),Ge.getHandSpace()};function W(ge){const Ge=C.indexOf(ge.inputSource);if(Ge===-1)return;const Me=R[Ge];Me!==void 0&&(Me.update(ge.inputSource,ge.frame,c||o),Me.dispatchEvent({type:ge.type,data:ge.inputSource}))}function Q(){r.removeEventListener("select",W),r.removeEventListener("selectstart",W),r.removeEventListener("selectend",W),r.removeEventListener("squeeze",W),r.removeEventListener("squeezestart",W),r.removeEventListener("squeezeend",W),r.removeEventListener("end",Q),r.removeEventListener("inputsourceschange",J);for(let ge=0;ge<R.length;ge++){const Ge=C[ge];Ge!==null&&(C[ge]=null,R[ge].disconnect(Ge))}k=null,Y=null,b.reset(),e.setRenderTarget(x),g=null,m=null,p=null,r=null,w=null,Fe.stop(),n.isPresenting=!1,e.setPixelRatio(D),e.setSize(N.width,N.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ge){s=ge,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ge){a=ge,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(ge){c=ge},this.getBaseLayer=function(){return m!==null?m:g},this.getBinding=function(){return p},this.getFrame=function(){return v},this.getSession=function(){return r},this.setSession=async function(ge){if(r=ge,r!==null){if(x=e.getRenderTarget(),r.addEventListener("select",W),r.addEventListener("selectstart",W),r.addEventListener("selectend",W),r.addEventListener("squeeze",W),r.addEventListener("squeezestart",W),r.addEventListener("squeezeend",W),r.addEventListener("end",Q),r.addEventListener("inputsourceschange",J),M.xrCompatible!==!0&&await t.makeXRCompatible(),D=e.getPixelRatio(),e.getSize(N),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let Me=null,Ye=null,ct=null;M.depth&&(ct=M.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,Me=M.stencil?So:bo,Ye=M.stencil?xo:mi);const Je={colorFormat:t.RGBA8,depthFormat:ct,scaleFactor:s};p=new XRWebGLBinding(r,t),m=p.createProjectionLayer(Je),r.updateRenderState({layers:[m]}),e.setPixelRatio(1),e.setSize(m.textureWidth,m.textureHeight,!1),w=new Hc(m.textureWidth,m.textureHeight,{format:Yi,type:Gi,depthTexture:new $s(m.textureWidth,m.textureHeight,Ye,void 0,void 0,void 0,void 0,void 0,void 0,Me),stencilBuffer:M.stencil,colorSpace:e.outputColorSpace,samples:M.antialias?4:0,resolveDepthBuffer:m.ignoreDepthValues===!1,resolveStencilBuffer:m.ignoreDepthValues===!1})}else{const Me={antialias:M.antialias,alpha:!0,depth:M.depth,stencil:M.stencil,framebufferScaleFactor:s};g=new XRWebGLLayer(r,t,Me),r.updateRenderState({baseLayer:g}),e.setPixelRatio(1),e.setSize(g.framebufferWidth,g.framebufferHeight,!1),w=new Hc(g.framebufferWidth,g.framebufferHeight,{format:Yi,type:Gi,colorSpace:e.outputColorSpace,stencilBuffer:M.stencil,resolveDepthBuffer:g.ignoreDepthValues===!1,resolveStencilBuffer:g.ignoreDepthValues===!1})}w.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await r.requestReferenceSpace(a),Fe.setContext(r),Fe.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return b.getDepthTexture()};function J(ge){for(let Ge=0;Ge<ge.removed.length;Ge++){const Me=ge.removed[Ge],Ye=C.indexOf(Me);Ye>=0&&(C[Ye]=null,R[Ye].disconnect(Me))}for(let Ge=0;Ge<ge.added.length;Ge++){const Me=ge.added[Ge];let Ye=C.indexOf(Me);if(Ye===-1){for(let Je=0;Je<R.length;Je++)if(Je>=C.length){C.push(Me),Ye=Je;break}else if(C[Je]===null){C[Je]=Me,Ye=Je;break}if(Ye===-1)break}const ct=R[Ye];ct&&ct.connect(Me)}}const H=new re,$=new re;function K(ge,Ge,Me){H.setFromMatrixPosition(Ge.matrixWorld),$.setFromMatrixPosition(Me.matrixWorld);const Ye=H.distanceTo($),ct=Ge.projectionMatrix.elements,Je=Me.projectionMatrix.elements,Ke=ct[14]/(ct[10]-1),Rt=ct[14]/(ct[10]+1),Ue=(ct[9]+1)/ct[5],Xe=(ct[9]-1)/ct[5],Z=(ct[8]-1)/ct[0],We=(Je[8]+1)/Je[0],Pe=Ke*Z,Qe=Ke*We,Oe=Ye/(-Z+We),vt=Oe*-Z;if(Ge.matrixWorld.decompose(ge.position,ge.quaternion,ge.scale),ge.translateX(vt),ge.translateZ(Oe),ge.matrixWorld.compose(ge.position,ge.quaternion,ge.scale),ge.matrixWorldInverse.copy(ge.matrixWorld).invert(),ct[10]===-1)ge.projectionMatrix.copy(Ge.projectionMatrix),ge.projectionMatrixInverse.copy(Ge.projectionMatrixInverse);else{const ot=Ke+Oe,q=Rt+Oe,U=Pe-vt,ue=Qe+(Ye-vt),Ae=Ue*Rt/q*ot,Be=Xe*Rt/q*ot;ge.projectionMatrix.makePerspective(U,ue,Ae,Be,ot,q),ge.projectionMatrixInverse.copy(ge.projectionMatrix).invert()}}function he(ge,Ge){Ge===null?ge.matrixWorld.copy(ge.matrix):ge.matrixWorld.multiplyMatrices(Ge.matrixWorld,ge.matrix),ge.matrixWorldInverse.copy(ge.matrixWorld).invert()}this.updateCamera=function(ge){if(r===null)return;let Ge=ge.near,Me=ge.far;b.texture!==null&&(b.depthNear>0&&(Ge=b.depthNear),b.depthFar>0&&(Me=b.depthFar)),F.near=O.near=P.near=Ge,F.far=O.far=P.far=Me,(k!==F.near||Y!==F.far)&&(r.updateRenderState({depthNear:F.near,depthFar:F.far}),k=F.near,Y=F.far),P.layers.mask=ge.layers.mask|2,O.layers.mask=ge.layers.mask|4,F.layers.mask=P.layers.mask|O.layers.mask;const Ye=ge.parent,ct=F.cameras;he(F,Ye);for(let Je=0;Je<ct.length;Je++)he(ct[Je],Ye);ct.length===2?K(F,P,O):F.projectionMatrix.copy(P.projectionMatrix),ie(ge,F,Ye)};function ie(ge,Ge,Me){Me===null?ge.matrix.copy(Ge.matrixWorld):(ge.matrix.copy(Me.matrixWorld),ge.matrix.invert(),ge.matrix.multiply(Ge.matrixWorld)),ge.matrix.decompose(ge.position,ge.quaternion,ge.scale),ge.updateMatrixWorld(!0),ge.projectionMatrix.copy(Ge.projectionMatrix),ge.projectionMatrixInverse.copy(Ge.projectionMatrixInverse),ge.isPerspectiveCamera&&(ge.fov=sh*2*Math.atan(1/ge.projectionMatrix.elements[5]),ge.zoom=1)}this.getCamera=function(){return F},this.getFoveation=function(){if(!(m===null&&g===null))return l},this.setFoveation=function(ge){l=ge,m!==null&&(m.fixedFoveation=ge),g!==null&&g.fixedFoveation!==void 0&&(g.fixedFoveation=ge)},this.hasDepthSensing=function(){return b.texture!==null},this.getDepthSensingMesh=function(){return b.getMesh(F)};let de=null;function Ce(ge,Ge){if(u=Ge.getViewerPose(c||o),v=Ge,u!==null){const Me=u.views;g!==null&&(e.setRenderTargetFramebuffer(w,g.framebuffer),e.setRenderTarget(w));let Ye=!1;Me.length!==F.cameras.length&&(F.cameras.length=0,Ye=!0);for(let Ke=0;Ke<Me.length;Ke++){const Rt=Me[Ke];let Ue=null;if(g!==null)Ue=g.getViewport(Rt);else{const Z=p.getViewSubImage(m,Rt);Ue=Z.viewport,Ke===0&&(e.setRenderTargetTextures(w,Z.colorTexture,Z.depthStencilTexture),e.setRenderTarget(w))}let Xe=I[Ke];Xe===void 0&&(Xe=new Br,Xe.layers.enable(Ke),Xe.viewport=new Jt,I[Ke]=Xe),Xe.matrix.fromArray(Rt.transform.matrix),Xe.matrix.decompose(Xe.position,Xe.quaternion,Xe.scale),Xe.projectionMatrix.fromArray(Rt.projectionMatrix),Xe.projectionMatrixInverse.copy(Xe.projectionMatrix).invert(),Xe.viewport.set(Ue.x,Ue.y,Ue.width,Ue.height),Ke===0&&(F.matrix.copy(Xe.matrix),F.matrix.decompose(F.position,F.quaternion,F.scale)),Ye===!0&&F.cameras.push(Xe)}const ct=r.enabledFeatures;if(ct&&ct.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&p){const Ke=p.getDepthInformation(Me[0]);Ke&&Ke.isValid&&Ke.texture&&b.init(e,Ke,r.renderState)}}for(let Me=0;Me<R.length;Me++){const Ye=C[Me],ct=R[Me];Ye!==null&&ct!==void 0&&ct.update(Ye,Ge,c||o)}de&&de(ge,Ge),Ge.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:Ge}),v=null}const Fe=new VL;Fe.setAnimationLoop(Ce),this.setAnimationLoop=function(ge){de=ge},this.dispose=function(){}}};const fu=new Es,dH=new un;function fH(i,e){function t(M,x){M.matrixAutoUpdate===!0&&M.updateMatrix(),x.value.copy(M.matrix)}function n(M,x){x.color.getRGB(M.fogColor.value,pL(i)),x.isFog?(M.fogNear.value=x.near,M.fogFar.value=x.far):x.isFogExp2&&(M.fogDensity.value=x.density)}function r(M,x,w,R,C){x.isMeshBasicMaterial||x.isMeshLambertMaterial?s(M,x):x.isMeshToonMaterial?(s(M,x),p(M,x)):x.isMeshPhongMaterial?(s(M,x),u(M,x)):x.isMeshStandardMaterial?(s(M,x),m(M,x),x.isMeshPhysicalMaterial&&g(M,x,C)):x.isMeshMatcapMaterial?(s(M,x),v(M,x)):x.isMeshDepthMaterial?s(M,x):x.isMeshDistanceMaterial?(s(M,x),b(M,x)):x.isMeshNormalMaterial?s(M,x):x.isLineBasicMaterial?(o(M,x),x.isLineDashedMaterial&&a(M,x)):x.isPointsMaterial?l(M,x,w,R):x.isSpriteMaterial?c(M,x):x.isShadowMaterial?(M.color.value.copy(x.color),M.opacity.value=x.opacity):x.isShaderMaterial&&(x.uniformsNeedUpdate=!1)}function s(M,x){M.opacity.value=x.opacity,x.color&&M.diffuse.value.copy(x.color),x.emissive&&M.emissive.value.copy(x.emissive).multiplyScalar(x.emissiveIntensity),x.map&&(M.map.value=x.map,t(x.map,M.mapTransform)),x.alphaMap&&(M.alphaMap.value=x.alphaMap,t(x.alphaMap,M.alphaMapTransform)),x.bumpMap&&(M.bumpMap.value=x.bumpMap,t(x.bumpMap,M.bumpMapTransform),M.bumpScale.value=x.bumpScale,x.side===oi&&(M.bumpScale.value*=-1)),x.normalMap&&(M.normalMap.value=x.normalMap,t(x.normalMap,M.normalMapTransform),M.normalScale.value.copy(x.normalScale),x.side===oi&&M.normalScale.value.negate()),x.displacementMap&&(M.displacementMap.value=x.displacementMap,t(x.displacementMap,M.displacementMapTransform),M.displacementScale.value=x.displacementScale,M.displacementBias.value=x.displacementBias),x.emissiveMap&&(M.emissiveMap.value=x.emissiveMap,t(x.emissiveMap,M.emissiveMapTransform)),x.specularMap&&(M.specularMap.value=x.specularMap,t(x.specularMap,M.specularMapTransform)),x.alphaTest>0&&(M.alphaTest.value=x.alphaTest);const w=e.get(x),R=w.envMap,C=w.envMapRotation;R&&(M.envMap.value=R,fu.copy(C),fu.x*=-1,fu.y*=-1,fu.z*=-1,R.isCubeTexture&&R.isRenderTargetTexture===!1&&(fu.y*=-1,fu.z*=-1),M.envMapRotation.value.setFromMatrix4(dH.makeRotationFromEuler(fu)),M.flipEnvMap.value=R.isCubeTexture&&R.isRenderTargetTexture===!1?-1:1,M.reflectivity.value=x.reflectivity,M.ior.value=x.ior,M.refractionRatio.value=x.refractionRatio),x.lightMap&&(M.lightMap.value=x.lightMap,M.lightMapIntensity.value=x.lightMapIntensity,t(x.lightMap,M.lightMapTransform)),x.aoMap&&(M.aoMap.value=x.aoMap,M.aoMapIntensity.value=x.aoMapIntensity,t(x.aoMap,M.aoMapTransform))}function o(M,x){M.diffuse.value.copy(x.color),M.opacity.value=x.opacity,x.map&&(M.map.value=x.map,t(x.map,M.mapTransform))}function a(M,x){M.dashSize.value=x.dashSize,M.totalSize.value=x.dashSize+x.gapSize,M.scale.value=x.scale}function l(M,x,w,R){M.diffuse.value.copy(x.color),M.opacity.value=x.opacity,M.size.value=x.size*w,M.scale.value=R*.5,x.map&&(M.map.value=x.map,t(x.map,M.uvTransform)),x.alphaMap&&(M.alphaMap.value=x.alphaMap,t(x.alphaMap,M.alphaMapTransform)),x.alphaTest>0&&(M.alphaTest.value=x.alphaTest)}function c(M,x){M.diffuse.value.copy(x.color),M.opacity.value=x.opacity,M.rotation.value=x.rotation,x.map&&(M.map.value=x.map,t(x.map,M.mapTransform)),x.alphaMap&&(M.alphaMap.value=x.alphaMap,t(x.alphaMap,M.alphaMapTransform)),x.alphaTest>0&&(M.alphaTest.value=x.alphaTest)}function u(M,x){M.specular.value.copy(x.specular),M.shininess.value=Math.max(x.shininess,1e-4)}function p(M,x){x.gradientMap&&(M.gradientMap.value=x.gradientMap)}function m(M,x){M.metalness.value=x.metalness,x.metalnessMap&&(M.metalnessMap.value=x.metalnessMap,t(x.metalnessMap,M.metalnessMapTransform)),M.roughness.value=x.roughness,x.roughnessMap&&(M.roughnessMap.value=x.roughnessMap,t(x.roughnessMap,M.roughnessMapTransform)),x.envMap&&(M.envMapIntensity.value=x.envMapIntensity)}function g(M,x,w){M.ior.value=x.ior,x.sheen>0&&(M.sheenColor.value.copy(x.sheenColor).multiplyScalar(x.sheen),M.sheenRoughness.value=x.sheenRoughness,x.sheenColorMap&&(M.sheenColorMap.value=x.sheenColorMap,t(x.sheenColorMap,M.sheenColorMapTransform)),x.sheenRoughnessMap&&(M.sheenRoughnessMap.value=x.sheenRoughnessMap,t(x.sheenRoughnessMap,M.sheenRoughnessMapTransform))),x.clearcoat>0&&(M.clearcoat.value=x.clearcoat,M.clearcoatRoughness.value=x.clearcoatRoughness,x.clearcoatMap&&(M.clearcoatMap.value=x.clearcoatMap,t(x.clearcoatMap,M.clearcoatMapTransform)),x.clearcoatRoughnessMap&&(M.clearcoatRoughnessMap.value=x.clearcoatRoughnessMap,t(x.clearcoatRoughnessMap,M.clearcoatRoughnessMapTransform)),x.clearcoatNormalMap&&(M.clearcoatNormalMap.value=x.clearcoatNormalMap,t(x.clearcoatNormalMap,M.clearcoatNormalMapTransform),M.clearcoatNormalScale.value.copy(x.clearcoatNormalScale),x.side===oi&&M.clearcoatNormalScale.value.negate())),x.dispersion>0&&(M.dispersion.value=x.dispersion),x.iridescence>0&&(M.iridescence.value=x.iridescence,M.iridescenceIOR.value=x.iridescenceIOR,M.iridescenceThicknessMinimum.value=x.iridescenceThicknessRange[0],M.iridescenceThicknessMaximum.value=x.iridescenceThicknessRange[1],x.iridescenceMap&&(M.iridescenceMap.value=x.iridescenceMap,t(x.iridescenceMap,M.iridescenceMapTransform)),x.iridescenceThicknessMap&&(M.iridescenceThicknessMap.value=x.iridescenceThicknessMap,t(x.iridescenceThicknessMap,M.iridescenceThicknessMapTransform))),x.transmission>0&&(M.transmission.value=x.transmission,M.transmissionSamplerMap.value=w.texture,M.transmissionSamplerSize.value.set(w.width,w.height),x.transmissionMap&&(M.transmissionMap.value=x.transmissionMap,t(x.transmissionMap,M.transmissionMapTransform)),M.thickness.value=x.thickness,x.thicknessMap&&(M.thicknessMap.value=x.thicknessMap,t(x.thicknessMap,M.thicknessMapTransform)),M.attenuationDistance.value=x.attenuationDistance,M.attenuationColor.value.copy(x.attenuationColor)),x.anisotropy>0&&(M.anisotropyVector.value.set(x.anisotropy*Math.cos(x.anisotropyRotation),x.anisotropy*Math.sin(x.anisotropyRotation)),x.anisotropyMap&&(M.anisotropyMap.value=x.anisotropyMap,t(x.anisotropyMap,M.anisotropyMapTransform))),M.specularIntensity.value=x.specularIntensity,M.specularColor.value.copy(x.specularColor),x.specularColorMap&&(M.specularColorMap.value=x.specularColorMap,t(x.specularColorMap,M.specularColorMapTransform)),x.specularIntensityMap&&(M.specularIntensityMap.value=x.specularIntensityMap,t(x.specularIntensityMap,M.specularIntensityMapTransform))}function v(M,x){x.matcap&&(M.matcap.value=x.matcap)}function b(M,x){const w=e.get(x).light;M.referencePosition.value.setFromMatrixPosition(w.matrixWorld),M.nearDistance.value=w.shadow.camera.near,M.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function pH(i,e,t,n){let r={},s={},o=[];const a=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function l(w,R){const C=R.program;n.uniformBlockBinding(w,C)}function c(w,R){let C=r[w.id];C===void 0&&(v(w),C=u(w),r[w.id]=C,w.addEventListener("dispose",M));const N=R.program;n.updateUBOMapping(w,N);const D=e.render.frame;s[w.id]!==D&&(m(w),s[w.id]=D)}function u(w){const R=p();w.__bindingPointIndex=R;const C=i.createBuffer(),N=w.__size,D=w.usage;return i.bindBuffer(i.UNIFORM_BUFFER,C),i.bufferData(i.UNIFORM_BUFFER,N,D),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,R,C),C}function p(){for(let w=0;w<a;w++)if(o.indexOf(w)===-1)return o.push(w),w;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function m(w){const R=r[w.id],C=w.uniforms,N=w.__cache;i.bindBuffer(i.UNIFORM_BUFFER,R);for(let D=0,P=C.length;D<P;D++){const O=Array.isArray(C[D])?C[D]:[C[D]];for(let I=0,F=O.length;I<F;I++){const k=O[I];if(g(k,D,I,N)===!0){const Y=k.__offset,W=Array.isArray(k.value)?k.value:[k.value];let Q=0;for(let J=0;J<W.length;J++){const H=W[J],$=b(H);typeof H=="number"||typeof H=="boolean"?(k.__data[0]=H,i.bufferSubData(i.UNIFORM_BUFFER,Y+Q,k.__data)):H.isMatrix3?(k.__data[0]=H.elements[0],k.__data[1]=H.elements[1],k.__data[2]=H.elements[2],k.__data[3]=0,k.__data[4]=H.elements[3],k.__data[5]=H.elements[4],k.__data[6]=H.elements[5],k.__data[7]=0,k.__data[8]=H.elements[6],k.__data[9]=H.elements[7],k.__data[10]=H.elements[8],k.__data[11]=0):(H.toArray(k.__data,Q),Q+=$.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,Y,k.__data)}}}i.bindBuffer(i.UNIFORM_BUFFER,null)}function g(w,R,C,N){const D=w.value,P=R+"_"+C;if(N[P]===void 0)return typeof D=="number"||typeof D=="boolean"?N[P]=D:N[P]=D.clone(),!0;{const O=N[P];if(typeof D=="number"||typeof D=="boolean"){if(O!==D)return N[P]=D,!0}else if(O.equals(D)===!1)return O.copy(D),!0}return!1}function v(w){const R=w.uniforms;let C=0;const N=16;for(let P=0,O=R.length;P<O;P++){const I=Array.isArray(R[P])?R[P]:[R[P]];for(let F=0,k=I.length;F<k;F++){const Y=I[F],W=Array.isArray(Y.value)?Y.value:[Y.value];for(let Q=0,J=W.length;Q<J;Q++){const H=W[Q],$=b(H),K=C%N,he=K%$.boundary,ie=K+he;C+=he,ie!==0&&N-ie<$.storage&&(C+=N-ie),Y.__data=new Float32Array($.storage/Float32Array.BYTES_PER_ELEMENT),Y.__offset=C,C+=$.storage}}}const D=C%N;return D>0&&(C+=N-D),w.__size=C,w.__cache={},this}function b(w){const R={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(R.boundary=4,R.storage=4):w.isVector2?(R.boundary=8,R.storage=8):w.isVector3||w.isColor?(R.boundary=16,R.storage=12):w.isVector4?(R.boundary=16,R.storage=16):w.isMatrix3?(R.boundary=48,R.storage=48):w.isMatrix4?(R.boundary=64,R.storage=64):w.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",w),R}function M(w){const R=w.target;R.removeEventListener("dispose",M);const C=o.indexOf(R.__bindingPointIndex);o.splice(C,1),i.deleteBuffer(r[R.id]),delete r[R.id],delete s[R.id]}function x(){for(const w in r)i.deleteBuffer(r[w]);o=[],r={},s={}}return{bind:l,update:c,dispose:x}}let AH=class{constructor(e={}){const{canvas:t=oL(),context:n=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:p=!1,reverseDepthBuffer:m=!1}=e;this.isWebGLRenderer=!0;let g;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");g=n.getContextAttributes().alpha}else g=o;const v=new Uint32Array(4),b=new Int32Array(4);let M=null,x=null;const w=[],R=[];
vendor: 1,932 bytes, line 3827
3827this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Ws,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const C=this;let N=!1;this._outputColorSpace=Xt;let D=0,P=0,O=null,I=-1,F=null;const k=new Jt,Y=new Jt;let W=null;const Q=new qt(0);let J=0,H=t.width,$=t.height,K=1,he=null,ie=null;const de=new Jt(0,0,H,$),Ce=new Jt(0,0,H,$);let Fe=!1;const ge=new Wf;let Ge=!1,Me=!1;const Ye=new un,ct=new un,Je=new re,Ke=new Jt,Rt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Ue=!1;function Xe(){return O===null?K:1}let Z=n;function We(ne,ye){return t.getContext(ne,ye)}try{const ne={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:p};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${zf}`),t.addEventListener("webglcontextlost",ut,!1),t.addEventListener("webglcontextrestored",Ut,!1),t.addEventListener("webglcontextcreationerror",Dt,!1),Z===null){const ye="webgl2";if(Z=We(ye,ne),Z===null)throw We(ye)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(ne){throw console.error("THREE.WebGLRenderer: "+ne.message),ne}let Pe,Qe,Oe,vt,ot,q,U,ue,Ae,Be,we,pe,qe,Ve,st,Ie,nt,ft,wt,Tt,zt,tn,Rn,le;function Bt(){Pe=new wG(Z),Pe.init(),tn=new aH(Z,Pe),Qe=new _G(Z,Pe,e,tn),Oe=new sH(Z,Pe),Qe.reverseDepthBuffer&&m&&Oe.buffers.depth.setReversed(!0),vt=new RG(Z),ot=new $q,q=new oH(Z,Pe,Oe,ot,Qe,tn,vt),U=new yG(C),ue=new MG(C),Ae=new Ik(Z),Rn=new mG(Z,Ae),Be=new TG(Z,Ae,vt,Rn),we=new PG(Z,Be,Ae,vt),wt=new CG(Z,Qe,q),Ie=new vG(ot),pe=new Wq(C,U,ue,Pe,Qe,Rn,Ie),qe=new fH(C,ot),Ve=new Xq,st=new eH(Pe),ft=new AG(C,U,ue,Oe,we,g,l),nt=ne
vendor: 9,219 bytes, line 3827
3827w iH(C,we,Qe),le=new pH(Z,vt,Qe,Oe),Tt=new gG(Z,Pe,vt),zt=new EG(Z,Pe,vt),vt.programs=pe.programs,C.capabilities=Qe,C.extensions=Pe,C.properties=ot,C.renderLists=Ve,C.shadowMap=nt,C.state=Oe,C.info=vt}Bt();const tt=new hH(C,Z);this.xr=tt,this.getContext=function(){return Z},this.getContextAttributes=function(){return Z.getContextAttributes()},this.forceContextLoss=function(){const ne=Pe.get("WEBGL_lose_context");ne&&ne.loseContext()},this.forceContextRestore=function(){const ne=Pe.get("WEBGL_lose_context");ne&&ne.restoreContext()},this.getPixelRatio=function(){return K},this.setPixelRatio=function(ne){ne!==void 0&&(K=ne,this.setSize(H,$,!1))},this.getSize=function(ne){return ne.set(H,$)},this.setSize=function(ne,ye,ze=!0){if(tt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}H=ne,$=ye,t.width=Math.floor(ne*K),t.height=Math.floor(ye*K),ze===!0&&(t.style.width=ne+"px",t.style.height=ye+"px"),this.setViewport(0,0,ne,ye)},this.getDrawingBufferSize=function(ne){return ne.set(H*K,$*K).floor()},this.setDrawingBufferSize=function(ne,ye,ze){H=ne,$=ye,K=ze,t.width=Math.floor(ne*ze),t.height=Math.floor(ye*ze),this.setViewport(0,0,ne,ye)},this.getCurrentViewport=function(ne){return ne.copy(k)},this.getViewport=function(ne){return ne.copy(de)},this.setViewport=function(ne,ye,ze,ke){ne.isVector4?de.set(ne.x,ne.y,ne.z,ne.w):de.set(ne,ye,ze,ke),Oe.viewport(k.copy(de).multiplyScalar(K).round())},this.getScissor=function(ne){return ne.copy(Ce)},this.setScissor=function(ne,ye,ze,ke){ne.isVector4?Ce.set(ne.x,ne.y,ne.z,ne.w):Ce.set(ne,ye,ze,ke),Oe.scissor(Y.copy(Ce).multiplyScalar(K).round())},this.getScissorTest=function(){return Fe},this.setScissorTest=function(ne){Oe.setScissorTest(Fe=ne)},this.setOpaqueSort=function(ne){he=ne},this.setTransparentSort=function(ne){ie=ne},this.getClearColor=function(ne){return ne.copy(ft.getClearColor())},this.setClearColor=function(){ft.setClearColor(...arguments)},this.getClearAlpha=function(){return ft.getClearAlpha()},this.setClearAlpha=function(){ft.setClearAlpha(...arguments)},this.clear=function(ne=!0,ye=!0,ze=!0){let ke=0;if(ne){let Re=!1;if(O!==null){const gt=O.texture.format;Re=gt===qf||gt===Gf||gt===Vf}if(Re){const gt=O.texture.type,mt=gt===Gi||gt===mi||gt===la||gt===xo||gt===M1||gt===w1,lt=ft.getClearColor(),X=ft.getClearAlpha(),xt=lt.r,cn=lt.g,nn=lt.b;mt?(v[0]=xt,v[1]=cn,v[2]=nn,v[3]=X,Z.clearBufferuiv(Z.COLOR,0,v)):(b[0]=xt,b[1]=cn,b[2]=nn,b[3]=X,Z.clearBufferiv(Z.COLOR,0,b))}else ke|=Z.COLOR_BUFFER_BIT}ye&&(ke|=Z.DEPTH_BUFFER_BIT),ze&&(ke|=Z.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Z.clear(ke)},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(){t.removeEventListener("webglcontextlost",ut,!1),t.removeEventListener("webglcontextrestored",Ut,!1),t.removeEventListener("webglcontextcreationerror",Dt,!1),ft.dispose(),Ve.dispose(),st.dispose(),ot.dispose(),U.dispose(),ue.dispose(),we.dispose(),Rn.dispose(),le.dispose(),pe.dispose(),tt.dispose(),tt.removeEventListener("sessionstart",$e),tt.removeEventListener("sessionend",ht),te.stop()};function ut(ne){ne.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),N=!0}function Ut(){console.log("THREE.WebGLRenderer: Context Restored."),N=!1;const ne=vt.autoReset,ye=nt.enabled,ze=nt.autoUpdate,ke=nt.needsUpdate,Re=nt.type;Bt(),vt.autoReset=ne,nt.enabled=ye,nt.autoUpdate=ze,nt.needsUpdate=ke,nt.type=Re}function Dt(ne){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",ne.statusMessage)}function An(ne){const ye=ne.target;ye.removeEventListener("dispose",An),Jn(ye)}function Jn(ne){Ki(ne),ot.remove(ne)}function Ki(ne){const ye=ot.get(ne).programs;ye!==void 0&&(ye.forEach(function(ze){pe.releaseProgram(ze)}),ne.isShaderMaterial&&pe.releaseShaderCache(ne))}this.renderBufferDirect=function(ne,ye,ze,ke,Re,gt){ye===null&&(ye=Rt);const mt=Re.isMesh&&Re.matrixWorld.determinant()<0,lt=bn(ne,ye,ze,ke,Re);Oe.setMaterial(ke,mt);let X=ze.index,xt=1;if(ke.wireframe===!0){if(X=Be.getWireframeAttribute(ze),X===void 0)return;xt=2}const cn=ze.drawRange,nn=ze.attributes.position;let zn=cn.start*xt,Hn=(cn.start+cn.count)*xt;gt!==null&&(zn=Math.max(zn,gt.start*xt),Hn=Math.min(Hn,(gt.start+gt.count)*xt)),X!==null?(zn=Math.max(zn,0),Hn=Math.min(Hn,X.count)):nn!=null&&(zn=Math.max(zn,0),Hn=Math.min(Hn,nn.count));const qi=Hn-zn;if(qi<0||qi===1/0)return;Rn.setup(Re,ke,lt,ze,X);let j,Vn=Tt;if(X!==null&&(j=Ae.get(X),Vn=zt,Vn.setIndex(j)),Re.isMesh)ke.wireframe===!0?(Oe.setLineWidth(ke.wireframeLinewidth*Xe()),Vn.setMode(Z.LINES)):Vn.setMode(Z.TRIANGLES);else if(Re.isLine){let rn=ke.linewidth;rn===void 0&&(rn=1),Oe.setLineWidth(rn*Xe()),Re.isLineSegments?Vn.setMode(Z.LINES):Re.isLineLoop?Vn.setMode(Z.LINE_LOOP):Vn.setMode(Z.LINE_STRIP)}else Re.isPoints?Vn.setMode(Z.POINTS):Re.isSprite&&Vn.setMode(Z.TRIANGLES);if(Re.isBatchedMesh)if(Re._multiDrawInstances!==null)da("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Vn.renderMultiDrawInstances(Re._multiDrawStarts,Re._multiDrawCounts,Re._multiDrawCount,Re._multiDrawInstances);else if(Pe.get("WEBGL_multi_draw"))Vn.renderMultiDraw(Re._multiDrawStarts,Re._multiDrawCounts,Re._multiDrawCount);else{const rn=Re._multiDrawStarts,Ar=Re._multiDrawCounts,Wn=Re._multiDrawCount,no=X?Ae.get(X).bytesPerElement:1,jl=ot.get(ke).currentProgram.getUniforms();for(let Zr=0;Zr<Wn;Zr++)jl.setValue(Z,"_gl_DrawID",Zr),Vn.render(rn[Zr]/no,Ar[Zr])}else if(Re.isInstancedMesh)Vn.renderInstances(zn,qi,Re.count);else if(ze.isInstancedBufferGeometry){const rn=ze._maxInstanceCount!==void 0?ze._maxInstanceCount:1/0,Ar=Math.min(ze.instanceCount,rn);Vn.renderInstances(zn,qi,Ar)}else Vn.render(zn,qi)};function Nn(ne,ye,ze){ne.transparent===!0&&ne.side===ur&&ne.forceSinglePass===!1?(ne.side=oi,ne.needsUpdate=!0,Ot(ne,ye,ze),ne.side=qs,ne.needsUpdate=!0,Ot(ne,ye,ze),ne.side=ur):Ot(ne,ye,ze)}this.compile=function(ne,ye,ze=null){ze===null&&(ze=ne),x=st.get(ze),x.init(ye),R.push(x),ze.traverseVisible(function(Re){Re.isLight&&Re.layers.test(ye.layers)&&(x.pushLight(Re),Re.castShadow&&x.pushShadow(Re))}),ne!==ze&&ne.traverseVisible(function(Re){Re.isLight&&Re.layers.test(ye.layers)&&(x.pushLight(Re),Re.castShadow&&x.pushShadow(Re))}),x.setupLights();const ke=new Set;return ne.traverse(function(Re){if(!(Re.isMesh||Re.isPoints||Re.isLine||Re.isSprite))return;const gt=Re.material;if(gt)if(Array.isArray(gt))for(let mt=0;mt<gt.length;mt++){const lt=gt[mt];Nn(lt,ze,Re),ke.add(lt)}else Nn(gt,ze,Re),ke.add(gt)}),x=R.pop(),ke},this.compileAsync=function(ne,ye,ze=null){const ke=this.compile(ne,ye,ze);return new Promise(Re=>{function gt(){if(ke.forEach(function(mt){ot.get(mt).currentProgram.isReady()&&ke.delete(mt)}),ke.size===0){Re(ne);return}setTimeout(gt,10)}Pe.get("KHR_parallel_shader_compile")!==null?gt():setTimeout(gt,10)})};let Er=null;function Rr(ne){Er&&Er(ne)}function $e(){te.stop()}function ht(){te.start()}const te=new VL;te.setAnimationLoop(Rr),typeof self<"u"&&te.setContext(self),this.setAnimationLoop=function(ne){Er=ne,tt.setAnimationLoop(ne),ne===null?te.stop():te.start()},tt.addEventListener("sessionstart",$e),tt.addEventListener("sessionend",ht),this.render=function(ne,ye){if(ye!==void 0&&ye.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(N===!0)return;if(ne.matrixWorldAutoUpdate===!0&&ne.updateMatrixWorld(),ye.parent===null&&ye.matrixWorldAutoUpdate===!0&&ye.updateMatrixWorld(),tt.enabled===!0&&tt.isPresenting===!0&&(tt.cameraAutoUpdate===!0&&tt.updateCamera(ye),ye=tt.getCamera()),ne.isScene===!0&&ne.onBeforeRender(C,ne,ye,O),x=st.get(ne,R.length),x.init(ye),R.push(x),ct.multiplyMatrices(ye.projectionMatrix,ye.matrixWorldInverse),ge.setFromProjectionMatrix(ct),Me=this.localClippingEnabled,Ge=Ie.init(this.clippingPlanes,Me),M=Ve.get(ne,w.length),M.init(),w.push(M),tt.enabled===!0&&tt.isPresenting===!0){const gt=C.xr.getDepthSensingMesh();gt!==null&&fe(gt,ye,-1/0,C.sortObjects)}fe(ne,ye,0,C.sortObjects),M.finish(),C.sortObjects===!0&&M.sort(he,ie),Ue=tt.enabled===!1||tt.isPresenting===!1||tt.hasDepthSensing()===!1,Ue&&ft.addToRenderList(M,ne),this.info.render.frame++,Ge===!0&&Ie.beginShadows();const ze=x.state.shadowsArray;nt.render(ze,ne,ye),Ge===!0&&Ie.endShadows(),this.info.autoReset===!0&&this.info.reset();const ke=M.opaque,Re=M.transmissive;if(x.setupLights(),ye.isArrayCamera){const gt=ye.cameras;if(Re.length>0)for(let mt=0,lt=gt.length;mt<lt;mt++){const X=gt[mt];V(ke,Re,ne,X)}Ue&&ft.render(ne);for(let mt=0,lt=gt.length;mt<lt;mt++){const X=gt[mt];h(M,ne,X,X.viewport)}}else Re.length>0&&V(ke,Re,ne,ye),Ue&&ft.render(ne),h(M,ne,ye);O!==null&&P===0&&(q.updateMultisampleRenderTarget(O),q.updateRenderTargetMipmap(O)),ne.isScene===!0&&ne.onAfterRender(C,ne,ye),Rn.resetDefaultState(),I=-1,F=null,R.pop(),R.length>0?(x=R[R.length-1],Ge===!0&&Ie.setGlobalState(C.clippingPlanes,x.state.camera)):x=null,w.pop(),w.length>0?M=w[w.length-1]:M=null};function fe(ne,ye,ze,ke){if(ne.visible===!1)return;
vendor: 20,962 bytes, line 3827
3827if(ne.layers.test(ye.layers)){if(ne.isGroup)ze=ne.renderOrder;else if(ne.isLOD)ne.autoUpdate===!0&&ne.update(ye);else if(ne.isLight)x.pushLight(ne),ne.castShadow&&x.pushShadow(ne);else if(ne.isSprite){if(!ne.frustumCulled||ge.intersectsSprite(ne)){ke&&Ke.setFromMatrixPosition(ne.matrixWorld).applyMatrix4(ct);const mt=we.update(ne),lt=ne.material;lt.visible&&M.push(ne,mt,lt,ze,Ke.z,null)}}else if((ne.isMesh||ne.isLine||ne.isPoints)&&(!ne.frustumCulled||ge.intersectsObject(ne))){const mt=we.update(ne),lt=ne.material;if(ke&&(ne.boundingSphere!==void 0?(ne.boundingSphere===null&&ne.computeBoundingSphere(),Ke.copy(ne.boundingSphere.center)):(mt.boundingSphere===null&&mt.computeBoundingSphere(),Ke.copy(mt.boundingSphere.center)),Ke.applyMatrix4(ne.matrixWorld).applyMatrix4(ct)),Array.isArray(lt)){const X=mt.groups;for(let xt=0,cn=X.length;xt<cn;xt++){const nn=X[xt],zn=lt[nn.materialIndex];zn&&zn.visible&&M.push(ne,mt,zn,ze,Ke.z,nn)}}else lt.visible&&M.push(ne,mt,lt,ze,Ke.z,null)}}const gt=ne.children;for(let mt=0,lt=gt.length;mt<lt;mt++)fe(gt[mt],ye,ze,ke)}function h(ne,ye,ze,ke){const Re=ne.opaque,gt=ne.transmissive,mt=ne.transparent;x.setupLightsView(ze),Ge===!0&&Ie.setGlobalState(C.clippingPlanes,ze),ke&&Oe.viewport(k.copy(ke)),Re.length>0&&je(Re,ye,ze),gt.length>0&&je(gt,ye,ze),mt.length>0&&je(mt,ye,ze),Oe.buffers.depth.setTest(!0),Oe.buffers.depth.setMask(!0),Oe.buffers.color.setMask(!0),Oe.setPolygonOffset(!1)}function V(ne,ye,ze,ke){if((ze.isScene===!0?ze.overrideMaterial:null)!==null)return;x.state.transmissionRenderTarget[ke.id]===void 0&&(x.state.transmissionRenderTarget[ke.id]=new Hc(1,1,{generateMipmaps:!0,type:Pe.has("EXT_color_buffer_half_float")||Pe.has("EXT_color_buffer_float")?dr:Gi,minFilter:Os,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:En.workingColorSpace}));const gt=x.state.transmissionRenderTarget[ke.id],mt=ke.viewport||k;gt.setSize(mt.z*C.transmissionResolutionScale,mt.w*C.transmissionResolutionScale);const lt=C.getRenderTarget();C.setRenderTarget(gt),C.getClearColor(Q),J=C.getClearAlpha(),J<1&&C.setClearColor(16777215,.5),C.clear(),Ue&&ft.render(ze);const X=C.toneMapping;C.toneMapping=Ws;const xt=ke.viewport;if(ke.viewport!==void 0&&(ke.viewport=void 0),x.setupLightsView(ke),Ge===!0&&Ie.setGlobalState(C.clippingPlanes,ke),je(ne,ze,ke),q.updateMultisampleRenderTarget(gt),q.updateRenderTargetMipmap(gt),Pe.has("WEBGL_multisampled_render_to_texture")===!1){let cn=!1;for(let nn=0,zn=ye.length;nn<zn;nn++){const Hn=ye[nn],qi=Hn.object,j=Hn.geometry,Vn=Hn.material,rn=Hn.group;if(Vn.side===ur&&qi.layers.test(ke.layers)){const Ar=Vn.side;Vn.side=oi,Vn.needsUpdate=!0,It(qi,ze,ke,j,Vn,rn),Vn.side=Ar,Vn.needsUpdate=!0,cn=!0}}cn===!0&&(q.updateMultisampleRenderTarget(gt),q.updateRenderTargetMipmap(gt))}C.setRenderTarget(lt),C.setClearColor(Q,J),xt!==void 0&&(ke.viewport=xt),C.toneMapping=X}function je(ne,ye,ze){const ke=ye.isScene===!0?ye.overrideMaterial:null;for(let Re=0,gt=ne.length;Re<gt;Re++){const mt=ne[Re],lt=mt.object,X=mt.geometry,xt=mt.group;let cn=mt.material;cn.allowOverride===!0&&ke!==null&&(cn=ke),lt.layers.test(ze.layers)&&It(lt,ye,ze,X,cn,xt)}}function It(ne,ye,ze,ke,Re,gt){ne.onBeforeRender(C,ye,ze,ke,Re,gt),ne.modelViewMatrix.multiplyMatrices(ze.matrixWorldInverse,ne.matrixWorld),ne.normalMatrix.getNormalMatrix(ne.modelViewMatrix),Re.onBeforeRender(C,ye,ze,ke,ne,gt),Re.transparent===!0&&Re.side===ur&&Re.forceSinglePass===!1?(Re.side=oi,Re.needsUpdate=!0,C.renderBufferDirect(ze,ye,ke,Re,ne,gt),Re.side=qs,Re.needsUpdate=!0,C.renderBufferDirect(ze,ye,ke,Re,ne,gt),Re.side=ur):C.renderBufferDirect(ze,ye,ke,Re,ne,gt),ne.onAfterRender(C,ye,ze,ke,Re,gt)}function Ot(ne,ye,ze){ye.isScene!==!0&&(ye=Rt);const ke=ot.get(ne),Re=x.state.lights,gt=x.state.shadowsArray,mt=Re.state.version,lt=pe.getParameters(ne,Re.state,gt,ye,ze),X=pe.getProgramCacheKey(lt);let xt=ke.programs;ke.environment=ne.isMeshStandardMaterial?ye.environment:null,ke.fog=ye.fog,ke.envMap=(ne.isMeshStandardMaterial?ue:U).get(ne.envMap||ke.environment),ke.envMapRotation=ke.environment!==null&&ne.envMap===null?ye.environmentRotation:ne.envMapRotation,xt===void 0&&(ne.addEventListener("dispose",An),xt=new Map,ke.programs=xt);let cn=xt.get(X);if(cn!==void 0){if(ke.currentProgram===cn&&ke.lightsStateVersion===mt)return Ct(ne,lt),cn}else lt.uniforms=pe.getUniforms(ne),ne.onBeforeCompile(lt,C),cn=pe.acquireProgram(lt,X),xt.set(X,cn),ke.uniforms=lt.uniforms;const nn=ke.uniforms;return(!ne.isShaderMaterial&&!ne.isRawShaderMaterial||ne.clipping===!0)&&(nn.clippingPlanes=Ie.uniform),Ct(ne,lt),ke.needsLights=Pt(ne),ke.lightsStateVersion=mt,ke.needsLights&&(nn.ambientLightColor.value=Re.state.ambient,nn.lightProbe.value=Re.state.probe,nn.directionalLights.value=Re.state.directional,nn.directionalLightShadows.value=Re.state.directionalShadow,nn.spotLights.value=Re.state.spot,nn.spotLightShadows.value=Re.state.spotShadow,nn.rectAreaLights.value=Re.state.rectArea,nn.ltc_1.value=Re.state.rectAreaLTC1,nn.ltc_2.value=Re.state.rectAreaLTC2,nn.pointLights.value=Re.state.point,nn.pointLightShadows.value=Re.state.pointShadow,nn.hemisphereLights.value=Re.state.hemi,nn.directionalShadowMap.value=Re.state.directionalShadowMap,nn.directionalShadowMatrix.value=Re.state.directionalShadowMatrix,nn.spotShadowMap.value=Re.state.spotShadowMap,nn.spotLightMatrix.value=Re.state.spotLightMatrix,nn.spotLightMap.value=Re.state.spotLightMap,nn.pointShadowMap.value=Re.state.pointShadowMap,nn.pointShadowMatrix.value=Re.state.pointShadowMatrix),ke.currentProgram=cn,ke.uniformsList=null,cn}function Et(ne){if(ne.uniformsList===null){const ye=ne.currentProgram.getUniforms();ne.uniformsList=h_.seqWithValue(ye.seq,ne.uniforms)}return ne.uniformsList}function Ct(ne,ye){const ze=ot.get(ne);ze.outputColorSpace=ye.outputColorSpace,ze.batching=ye.batching,ze.batchingColor=ye.batchingColor,ze.instancing=ye.instancing,ze.instancingColor=ye.instancingColor,ze.instancingMorph=ye.instancingMorph,ze.skinning=ye.skinning,ze.morphTargets=ye.morphTargets,ze.morphNormals=ye.morphNormals,ze.morphColors=ye.morphColors,ze.morphTargetsCount=ye.morphTargetsCount,ze.numClippingPlanes=ye.numClippingPlanes,ze.numIntersection=ye.numClipIntersection,ze.vertexAlphas=ye.vertexAlphas,ze.vertexTangents=ye.vertexTangents,ze.toneMapping=ye.toneMapping}function bn(ne,ye,ze,ke,Re){ye.isScene!==!0&&(ye=Rt),q.resetTextureUnits();const gt=ye.fog,mt=ke.isMeshStandardMaterial?ye.environment:null,lt=O===null?C.outputColorSpace:O.isXRRenderTarget===!0?O.texture.colorSpace:ha,X=(ke.isMeshStandardMaterial?ue:U).get(ke.envMap||mt),xt=ke.vertexColors===!0&&!!ze.attributes.color&&ze.attributes.color.itemSize===4,cn=!!ze.attributes.tangent&&(!!ke.normalMap||ke.anisotropy>0),nn=!!ze.morphAttributes.position,zn=!!ze.morphAttributes.normal,Hn=!!ze.morphAttributes.color;let qi=Ws;ke.toneMapped&&(O===null||O.isXRRenderTarget===!0)&&(qi=C.toneMapping);const j=ze.morphAttributes.position||ze.morphAttributes.normal||ze.morphAttributes.color,Vn=j!==void 0?j.length:0,rn=ot.get(ke),Ar=x.state.lights;if(Ge===!0&&(Me===!0||ne!==F)){const mr=ne===F&&ke.id===I;Ie.setState(ke,ne,mr)}let Wn=!1;ke.version===rn.__version?(rn.needsLights&&rn.lightsStateVersion!==Ar.state.version||rn.outputColorSpace!==lt||Re.isBatchedMesh&&rn.batching===!1||!Re.isBatchedMesh&&rn.batching===!0||Re.isBatchedMesh&&rn.batchingColor===!0&&Re.colorTexture===null||Re.isBatchedMesh&&rn.batchingColor===!1&&Re.colorTexture!==null||Re.isInstancedMesh&&rn.instancing===!1||!Re.isInstancedMesh&&rn.instancing===!0||Re.isSkinnedMesh&&rn.skinning===!1||!Re.isSkinnedMesh&&rn.skinning===!0||Re.isInstancedMesh&&rn.instancingColor===!0&&Re.instanceColor===null||Re.isInstancedMesh&&rn.instancingColor===!1&&Re.instanceColor!==null||Re.isInstancedMesh&&rn.instancingMorph===!0&&Re.morphTexture===null||Re.isInstancedMesh&&rn.instancingMorph===!1&&Re.morphTexture!==null||rn.envMap!==X||ke.fog===!0&&rn.fog!==gt||rn.numClippingPlanes!==void 0&&(rn.numClippingPlanes!==Ie.numPlanes||rn.numIntersection!==Ie.numIntersection)||rn.vertexAlphas!==xt||rn.vertexTangents!==cn||rn.morphTargets!==nn||rn.morphNormals!==zn||rn.morphColors!==Hn||rn.toneMapping!==qi||rn.morphTargetsCount!==Vn)&&(Wn=!0):(Wn=!0,rn.__version=ke.version);let no=rn.currentProgram;Wn===!0&&(no=Ot(ke,ye,Re));let jl=!1,Zr=!1,Xl=!1;const pi=no.getUniforms(),Hi=rn.uniforms;if(Oe.useProgram(no.program)&&(jl=!0,Zr=!0,Xl=!0),ke.id!==I&&(I=ke.id,Zr=!0),jl||F!==ne){Oe.buffers.depth.getReversed()?(Ye.copy(ne.projectionMatrix),n9(Ye),i9(Ye),pi.setValue(Z,"projectionMatrix",Ye)):pi.setValue(Z,"projectionMatrix",ne.projectionMatrix),pi.setValue(Z,"viewMatrix",ne.matrixWorldInverse);const Kr=pi.map.cameraPosition;Kr!==void 0&&Kr.setValue(Z,Je.setFromMatrixPosition(ne.matrixWorld)),Qe.logarithmicDepthBuffer&&pi.setValue(Z,"logDepthBufFC",2/(Math.log(ne.far+1)/Math.LN2)),(ke.isMeshPhongMaterial||ke.isMeshToonMaterial||ke.isMeshLambertMaterial||ke.isMeshBasicMaterial||ke.isMeshStandardMaterial||ke.isShaderMaterial)&&pi.setValue(Z,"isOrthographic",ne.isOrthographicCamera===!0),F!==ne&&(F=ne,Zr=!0,Xl=!0)}if(Re.isSkinnedMesh){pi.setOptional(Z,Re,"bindMatrix"),pi.setOptional(Z,Re,"bindMatrixInverse");const mr=Re.skeleton;mr&&(mr.boneTexture===null&&mr.computeBoneTexture(),pi.setValue(Z,"boneTexture",mr.boneTexture,q))}Re.isBatchedMesh&&(pi.setOptional(Z,Re,"batchingTexture"),pi.setValue(Z,"batchingTexture",Re._matricesTexture,q),pi.setOptional(Z,Re,"batchingIdTexture"),pi.setValue(Z,"batchingIdTexture",Re._indirectTexture,q),pi.setOptional(Z,Re,"batchingColorTexture"),Re._colorsTexture!==null&&pi.setValue(Z,"batchingColorTexture",Re._colorsTexture,q));const jn=ze.morphAttributes;if((jn.position!==void 0||jn.normal!==void 0||jn.color!==void 0)&&wt.update(Re,ze,no),(Zr||rn.receiveShadow!==Re.receiveShadow)&&(rn.receiveShadow=Re.receiveShadow,pi.setValue(Z,"receiveShadow",Re.receiveShadow)),ke.isMeshGouraudMaterial&&ke.envMap!==null&&(Hi.envMap.value=X,Hi.flipEnvMap.value=X.isCubeTexture&&X.isRenderTargetTexture===!1?-1:1),ke.isMeshStandardMaterial&&ke.envMap===null&&ye.environment!==null&&(Hi.envMapIntensity.value=ye.environmentIntensity),Zr&&(pi.setValue(Z,"toneMappingExposure",C.toneMappingExposure),rn.needsLights&&kt(Hi,Xl),gt&&ke.fog===!0&&qe.refreshFogUniforms(Hi,gt),qe.refreshMaterialUniforms(Hi,ke,K,$,x.state.transmissionRenderTarget[ne.id]),h_.upload(Z,Et(rn),Hi,q)),ke.isShaderMaterial&&ke.uniformsNeedUpdate===!0&&(h_.upload(Z,Et(rn),Hi,q),ke.uniformsNeedUpdate=!1),ke.isSpriteMaterial&&pi.setValue(Z,"center",Re.center),pi.setValue(Z,"modelViewMatrix",Re.modelViewMatrix),pi.setValue(Z,"normalMatrix",Re.normalMatrix),pi.setValue(Z,"modelMatrix",Re.matrixWorld),ke.isShaderMaterial||ke.isRawShaderMaterial){const mr=ke.uniformsGroups;for(let Kr=0,lp=mr.length;Kr<lp;Kr++){const Sa=mr[Kr];le.update(Sa,no),le.bind(Sa,no)}}return no}function kt(ne,ye){ne.ambientLightColor.needsUpdate=ye,ne.lightProbe.needsUpdate=ye,ne.directionalLights.needsUpdate=ye,ne.directionalLightShadows.needsUpdate=ye,ne.pointLights.needsUpdate=ye,ne.pointLightShadows.needsUpdate=ye,ne.spotLights.needsUpdate=ye,ne.spotLightShadows.needsUpdate=ye,ne.rectAreaLights.needsUpdate=ye,ne.hemisphereLights.needsUpdate=ye}function Pt(ne){return ne.isMeshLambertMaterial||ne.isMeshToonMaterial||ne.isMeshPhongMaterial||ne.isMeshStandardMaterial||ne.isShadowMaterial||ne.isShaderMaterial&&ne.lights===!0}this.getActiveCubeFace=function(){return D},this.getActiveMipmapLevel=function(){return P},this.getRenderTarget=function(){return O},this.setRenderTargetTextures=function(ne,ye,ze){const ke=ot.get(ne);ke.__autoAllocateDepthBuffer=ne.resolveDepthBuffer===!1,ke.__autoAllocateDepthBuffer===!1&&(ke.__useRenderToTexture=!1),ot.get(ne.texture).__webglTexture=ye,ot.get(ne.depthTexture).__webglTexture=ke.__autoAllocateDepthBuffer?void 0:ze,ke.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(ne,ye){const ze=ot.get(ne);ze.__webglFramebuffer=ye,ze.__useDefaultFramebuffer=ye===void 0};const Bn=Z.createFramebuffer();this.setRenderTarget=function(ne,ye=0,ze=0){O=ne,D=ye,P=ze;let ke=!0,Re=null,gt=!1,mt=!1;if(ne){const X=ot.get(ne);if(X.__useDefaultFramebuffer!==void 0)Oe.bindFramebuffer(Z.FRAMEBUFFER,null),ke=!1;else if(X.__webglFramebuffer===void 0)q.setupRenderTarget(ne);else if(X.__hasExternalTextures)q.rebindTextures(ne,ot.get(ne.texture).__webglTexture,ot.get(ne.depthTexture).__webglTexture);else if(ne.depthBuffer){const nn=ne.depthTexture;if(X.__boundDepthTexture!==nn){if(nn!==null&&ot.has(nn)&&(ne.width!==nn.image.width||ne.height!==nn.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");q.setupDepthRenderbuffer(ne)}}const xt=ne.texture;(xt.isData3DTexture||xt.isDataArrayTexture||xt.isCompressedArrayTexture)&&(mt=!0);const cn=ot.get(ne).__webglFramebuffer;ne.isWebGLCubeRenderTarget?(Array.isArray(cn[ye])?Re=cn[ye][ze]:Re=cn[ye],gt=!0):ne.samples>0&&q.useMultisampledRTT(ne)===!1?Re=ot.get(ne).__webglMultisampledFramebuffer:Array.isArray(cn)?Re=cn[ze]:Re=cn,k.copy(ne.viewport),Y.copy(ne.scissor),W=ne.scissorTest}else k.copy(de).multiplyScalar(K).floor(),Y.copy(Ce).multiplyScalar(K).floor(),W=Fe;if(ze!==0&&(Re=Bn),Oe.bindFramebuffer(Z.FRAMEBUFFER,Re)&&ke&&Oe.drawBuffers(ne,Re),Oe.viewport(k),Oe.scissor(Y),Oe.setScissorTest(W),gt){const X=ot.get(ne.texture);Z.framebufferTexture2D(Z.FRAMEBUFFER,Z.COLOR_ATTACHMENT0,Z.TEXTURE_CUBE_MAP_POSITIVE_X+ye,X.__webglTexture,ze)}else if(mt){const X=ot.get(ne.texture),xt=ye;Z.framebufferTextureLayer(Z.FRAMEBUFFER,Z.COLOR_ATTACHMENT0,X.__webglTexture,ze,xt)}else if(ne!==null&&ze!==0){const X=ot.get(ne.texture);Z.framebufferTexture2D(Z.FRAMEBUFFER,Z.COLOR_ATTACHMENT0,Z.TEXTURE_2D,X.__webglTexture,ze)}I=-1},this.readRenderTargetPixels=function(ne,ye,ze,ke,Re,gt,mt){if(!(ne&&ne.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let lt=ot.get(ne).__webglFramebuffer;if(ne.isWebGLCubeRenderTarget&&mt!==void 0&&(lt=lt[mt]),lt){Oe.bindFramebuffer(Z.FRAMEBUFFER,lt);try{const X=ne.texture,xt=X.format,cn=X.type;if(!Qe.textureFormatReadable(xt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Qe.textureTypeReadable(cn)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ye>=0&&ye<=ne.width-ke&&ze>=0&&ze<=ne.height-Re&&Z.readPixels(ye,ze,ke,Re,tn.convert(xt),tn.convert(cn),gt)}finally{const X=O!==null?ot.get(O).__webglFramebuffer:null;Oe.bindFramebuffer(Z.FRAMEBUFFER,X)}}},this.readRenderTargetPixelsAsync=async function(ne,ye,ze,ke,Re,gt,mt){if(!(ne&&ne.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let lt=ot.get(ne).__webglFramebuffer;if(ne.isWebGLCubeRenderTarget&&mt!==void 0&&(lt=lt[mt]),lt)if(ye>=0&&ye<=ne.width-ke&&ze>=0&&ze<=ne.height-Re){Oe.bindFramebuffer(Z.FRAMEBUFFER,lt);const X=ne.texture,xt=X.format,cn=X.type;if(!Qe.textureFormatReadable(xt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Qe.textureTypeReadable(cn))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const nn=Z.createBuffer();Z.bindBuffer(Z.PIXEL_PACK_BUFFER,nn),Z.bufferData(Z.PIXEL_PACK_BUFFER,gt.byteLength,Z.STREAM_READ),Z.readPixels(ye,ze,ke,Re,tn.convert(xt),tn.convert(cn),0);const zn=O!==null?ot.get(O).__webglFramebuffer:null;Oe.bindFramebuffer(Z.FRAMEBUFFER,zn);const Hn=Z.fenceSync(Z.SYNC_GPU_COMMANDS_COMPLETE,0);return Z.flush(),await t9(Z,Hn,4),Z.bindBuffer(Z.PIXEL_PACK_BUFFER,nn),Z.getBufferSubData(Z.PIXEL_PACK_BUFFER,0,gt),Z.deleteBuffer(nn),Z.deleteSync(Hn),gt}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(ne,ye=null,ze=0){const ke=Math.pow(2,-ze),Re=Math.floor(ne.image.width*ke),gt=Math.floor(ne.image.height*ke),mt=ye!==null?ye.x:0,lt=ye!==null?ye.y:0;q.setTexture2D(ne,0),Z.copyTexSubImage2D(Z.TEXTURE_2D,ze,0,0,mt,lt,Re,gt),Oe.unbindTexture()};const Ls=Z.createFramebuffer(),kn=Z.createFramebuffer();this.copyTextureToTexture=function(ne,ye,ze=null,ke=null,Re=0,gt=null){gt===null&&(Re!==0?(da("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),gt=Re,Re=0):gt=0);let mt,lt,X,xt,cn,nn,zn,Hn,qi;const j=ne.isCompressedTexture?ne.mipmaps[gt]:ne.image;if(ze!==null)mt=ze.max.x-ze.min.x,lt=ze.max.y-ze.min.y,X=ze.isBox3?ze.max.z-ze.min.z:1,xt=ze.min.x,cn=ze.min.y,nn=ze.isBox3?ze.min.z:0;else{const jn=Math.pow(2,-Re);mt=Math.floor(j.width*jn),lt=Math.floor(j.height*jn),ne.isDataArrayTexture?X=j.depth:ne.isData3DTexture?X=Math.floor(j.depth*jn):X=1,xt=0,cn=0,nn=0}ke!==null?(zn=ke.x,Hn=ke.y,qi=ke.z):(zn=0,Hn=0,qi=0);const Vn=tn.convert(ye.format),rn=tn.convert(ye.type);let Ar;ye.isData3DTexture?(q.setTexture3D(ye,0),Ar=Z.TEXTURE_3D):ye.isDataArrayTexture||ye.isCompressedArrayTexture?(q.setTexture2DArray(ye,0),Ar=Z.TEXTURE_2D_ARRAY):(q.setTexture2D(ye,0),Ar=Z.TEXTURE_2D),Z.pixelStorei(Z.UNPACK_FLIP_Y_WEBGL,ye.flipY),Z.pixelStorei(Z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ye.premultiplyAlpha),Z.pixelStorei(Z.UNPACK_ALIGNMENT,ye.unpackAlignment);const Wn=Z.getParameter(Z.UNPACK_ROW_LENGTH),no=Z.getParameter(Z.UNPACK_IMAGE_HEIGHT),jl=Z.getParameter(Z.UNPACK_SKIP_PIXELS),Zr=Z.getParameter(Z.UNPACK_SKIP_ROWS),Xl=Z.getParameter(Z.UNPACK_SKIP_IMAGES);Z.pixelStorei(Z.UNPACK_ROW_LENGTH,j.width),Z.pixelStorei(Z.UNPACK_IMAGE_HEIGHT,j.height),Z.pixelStorei(Z.UNPACK_SKIP_PIXELS,xt),Z.pixelStorei(Z.UNPACK_SKIP_ROWS,cn),Z.pixelStorei(Z.UNPACK_SKIP_IMAGES,nn);const pi=ne.isDataArrayTexture||ne.isData3DTexture,Hi=ye.isDataArrayTexture||ye.isData3DTexture;if(ne.isDepthTexture){const jn=ot.get(ne),mr=ot.get(ye),Kr=ot.get(jn.__renderTarget),lp=ot.get(mr.__renderTarget);Oe.bindFramebuffer(Z.READ_FRAMEBUFFER,Kr.__webglFramebuffer),Oe.bindFramebuffer(Z.DRAW_FRAMEBUFFER,lp.__webglFramebuffer);for(let Sa=0;Sa<X;Sa++)pi&&(Z.framebufferTextureLayer(Z.READ_FRAMEBUFFER,Z.COLOR_ATTACHMENT0,ot.get(ne).__webglTexture,Re,nn+Sa),Z.framebufferTextureLayer(Z.DRAW_FRAMEBUFFER,Z.COLOR_ATTACHMENT0,ot.get(ye).__webglTexture,gt,qi+Sa)),Z.blitFramebuffer(xt,cn,mt,lt,zn,Hn,mt,lt,Z.DEPTH_BUFFER_BIT,Z.NEAREST);Oe.bindFramebuffer(Z.READ_FRAMEBUFFER,null),Oe.bindFramebuffer(Z.DRAW_FRAMEBUFFER,null)}else if(Re!==0||ne.isRenderTargetTexture||ot.has(ne)){const jn=ot.get(ne),mr=ot.get(ye);Oe.bindFramebuffer(Z.READ_FRAMEBUFFER,Ls),Oe.bindFramebuffer(Z.DRAW_FRAMEBUFFER,kn);for(let Kr=0;Kr<X;Kr++)pi?Z.framebufferTextureLayer(Z.READ_FRAMEBUFFER,Z.COLOR_ATTACHMENT0,jn.__webglTexture,Re,nn+Kr):Z.framebufferTexture2D(Z.READ_FRAMEBUFFER,Z.COLOR_ATTACHMENT0,Z.TEXTURE_2D,jn.__webglTexture,Re),Hi?Z.framebufferTextureLayer(Z.DRAW_FRAMEBUFFER,Z.COLOR_ATTACHMENT0,mr.__webglTexture,gt,qi+Kr):Z.framebufferTexture2D(Z.DRAW_FRAMEBUFFER,Z.COLOR_ATTACHMENT0,Z.TEXTURE_2D,mr.__webglTexture,gt),Re!==0?Z.blitFramebuffer(xt,cn,mt,lt,zn,Hn,mt,lt,Z.COLOR_BUFFER_BIT,Z.NEAREST):Hi?Z.copyTexSubImage3D(Ar,gt,zn,Hn,qi+Kr,xt,cn,mt,lt):Z.copyTexSubImage2D(Ar,gt,zn,Hn,xt,cn,mt,lt);Oe.bindFramebuffer(Z.READ_FRAMEBUFFER,null),Oe.bindFramebuffer(Z.DRAW_FRAMEBUFFER,null)}else Hi?ne.isDataTexture||ne.isData3DTexture?Z.texSubImage3D(Ar,gt,zn,Hn,qi,mt,lt,X,Vn,rn,j.data):ye.isCompressedArrayTexture?Z.compressedTexSubImage3D(Ar,gt,zn,Hn,qi,mt,lt,X,Vn,j.data):Z.texSubImage3D(Ar,gt,zn,Hn,qi,mt,lt,X,Vn,rn,j):ne.isDataTexture?Z.texSubImage2D(Z.TEXTURE_2D,gt,zn,Hn,mt,lt,Vn,rn,j.data):ne.isCompressedTexture?Z.compressedTexSubImage2D(Z.TEXTURE_2D,gt,zn,Hn,j.width,j.height,Vn,j.data):Z.texSubImage2D(Z.TEXTURE_2D,gt,zn,Hn,mt,lt,Vn,rn,j);Z.pixelStorei(Z.UNPACK_ROW_LENGTH,Wn),Z.pixelStorei(Z.UNPACK_IMAGE_HEIGHT,no),Z.pixelStorei(Z.UNPACK_SKIP_PIXELS,jl),Z.pixelStorei(Z.UNPACK_SKIP_ROWS,Zr),Z.pixelStorei(Z.UNPACK_SKIP_IMAGES,Xl),gt===0&&ye.generateMipmaps&&Z.generateMipmap(Ar),Oe.unbindTexture()},this.copyTextureToTexture3D=function(ne,ye,ze=null,ke=null,Re=0){return da('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(ne,ye,ze,ke,Re)},this.initRenderTarget=function(ne){ot.get(ne).__webglFramebuffer===void 0&&q.setupRenderTarget(ne)},this.initTexture=function(ne){ne.isCubeTexture?q.setTextureCube(ne,0):ne.isData3DTexture?q.setTexture3D(ne,0):ne.isDataArrayTexture||ne.isCompressedArrayTexture?q.setTexture2DArray(ne,0):q.setTexture2D(ne,0),Oe.unbindTexture()},this.resetState=function(){D=0,P=0,O=null,Oe.reset(),Rn.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ms}get outputColorSpace(){return this._outputColorSpace}
3827set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=En._getDrawingBufferColorSpace(e),t.unpackColorSpace=En._getUnpackColorSpace()}};class mH extends ir{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new at(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof t.element.ownerDocument.defaultView.Element&&t.element.parentNode!==null&&t.element.remove()})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}const Vh=new re,PE=new un,LE=new un,NE=new re,DE=new re;class gH{constructor(e={}){const t=this;let n,r,s,o;const a={objects:new WeakMap},l=e.element!==void 0?e.element:document.createElement("div");l.style.overflow="hidden",this.domElement=l,this.getSize=function(){return{width:n,height:r}},this.render=function(v,b){v.matrixWorldAutoUpdate===!0&&v.updateMatrixWorld(),b.parent===null&&b.matrixWorldAutoUpdate===!0&&b.updateMatrixWorld(),PE.copy(b.matrixWorldInverse),LE.multiplyMatrices(b.projectionMatrix,PE),u(v,v,b),g(v)},this.setSize=function(v,b){n=v,r=b,s=n/2,o=r/2,l.style.width=v+"px",l.style.height=b+"px"};function c(v){v.isCSS2DObject&&(v.element.style.display="none");for(let b=0,M=v.children.length;b<M;b++)c(v.children[b])}function u(v,b,M){if(v.visible===!1){c(v);return}if(v.isCSS2DObject){Vh.setFromMatrixPosition(v.matrixWorld),Vh.applyMatrix4(LE);const x=Vh.z>=-1&&Vh.z<=1&&v.layers.test(M.layers)===!0,w=v.element;w.style.display=x===!0?"":"none",x===!0&&(v.onBeforeRender(t,b,M),w.style.transform="translate("+-100*v.center.x+"%,"+-100*v.center.y+"%)translate("+(Vh.x*s+s)+"px,"+(-Vh.y*o+o)+"px)",w.parentNode!==l&&l.appendChild(w),v.onAfterRender(t,b,M));const R={distanceToCameraSquared:p(M,v)};a.objects.set(v,R)}for(let x=0,w=v.children.length;x<w;x++)u(v.children[x],b,M)}function p(v,b){return NE.setFromMatrixPosition(v.matrixWorld),DE.setFromMatrixPosition(b.matrixWorld),NE.distanceToSquared(DE)}function m(v){const b=[];return v.traverseVisible(function(M){M.isCSS2DObject&&b.push(M)}),b}function g(v){const b=m(v).sort(function(x,w){if(x.renderOrder!==w.renderOrder)return w.renderOrder-x.renderOrder;const R=a.objects.get(x).distanceToCameraSquared,C=a.objects.get(w).distanceToCameraSquared;return R-C}),M=b.length;for(let x=0,w=b.length;x<w;x++)b[x].element.style.zIndex=M-x}}}var _H="Expected a function",vH=Math.max,yH=Math.min;function $L(i,e,t){var n,r,s,o,a,l,c=0,u=!1,p=!1,m=!0;if(typeof i!="function")throw new TypeError(_H);e=_3(e)||0,q2(t)&&(u=!!t.leading,p="maxWait"in t,s=p?vH(_3(t.maxWait)||0,e):s,m="trailing"in t?!!t.trailing:m);function g(D){var P=n,O=r;return n=r=void 0,c=D,o=i.apply(O,P),o}function v(D){return c=D,a=setTimeout(x,e),u?g(D):o}function b(D){var P=D-l,O=D-c,I=e-P;return p?yH(I,s-O):I}function M(D){var P=D-l,O=D-c;return l===void 0||P>=e||P<0||p&&O>=s}function x(){var D=ay();if(M(D))return w(D);a=setTimeout(x,b(D))}function w(D){return a=void 0,m&&n?g(D):(n=r=void 0,o)}function R(){a!==void 0&&clearTimeout(a),c=0,n=l=r=a=void 0}function C(){return a===void 0?o:w(ay())}function N(){var D=ay(),P=M(D);if(n=arguments,r=this,l=D,P){if(a===void 0)return v(l);if(p)return clearTimeout(a),a=setTimeout(x,e),g(l)}return a===void 0&&(a=setTimeout(x,e)),o}return N.cancel=R,N.flush=C,N}function IE(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}function xH(i){if(Array.isArray(i))return i}function bH(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function SH(i,e,t){return Object.defineProperty(i,"prototype",{writable:!1}),i}function MH(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,r,s,o,a=[],l=!0,c=!1;try{if(s=(t=t.call(i)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,r=u}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}
3827function wH(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3828In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TH(i,e){return xH(i)||MH(i,e)||EH(i,e)||wH()}function EH(i,e){if(i){if(typeof i=="string")return IE(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?IE(i,e):void 0}}var RH=SH(function i(e,t){var n=t.default,r=n===void 0?null:n,s=t.triggerUpdate,o=s===void 0?!0:s,a=t.onChange,l=a===void 0?function(c,u){}:a;bH(this,i),this.name=e,this.defaultVal=r,this.triggerUpdate=o,this.onChange=l});function wr(i){var e=i.stateInit,t=e===void 0?function(){return{}}:e,n=i.props,r=n===void 0?{}:n,s=i.methods,o=s===void 0?{}:s,a=i.aliases,l=a===void 0?{}:a,c=i.init,u=c===void 0?function(){}:c,p=i.update,m=p===void 0?function(){}:p,g=Object.keys(r).map(function(v){return new RH(v,r[v])});return function v(){for(var b=arguments.length,M=new Array(b),x=0;x<b;x++)M[x]=arguments[x];var w=!!(this instanceof v&&this.constructor),R=w?M.shift():void 0,C=M[0],N=C===void 0?{}:C,D=Object.assign({},t instanceof Function?t(N):t,{initialised:!1}),P={};function O(k){return I(k,N),F(),O}var I=function(Y,W){u.call(O,Y,D,W),D.initialised=!0},F=$L(function(){D.initialised&&(m.call(O,D,P),P={})},1);return g.forEach(function(k){O[k.name]=Y(k);function Y(W){var Q=W.name,J=W.triggerUpdate,H=J===void 0?!1:J,$=W.onChange,K=$===void 0?function(de,Ce){}:$,he=W.defaultVal,ie=he===void 0?null:he;return function(de){var Ce=D[Q];if(!arguments.length)return Ce;var Fe=de===void 0?ie:de;
3828return D[Q]=Fe,K.call(O,Fe,D,Ce),!P.hasOwnProperty(Q)&&(P[Q]=Ce),H&&F(),O}}}),Object.keys(o).forEach(function(k){O[k]=function(){for(var Y,W=arguments.length,Q=new Array(W),J=0;J<W;J++)Q[J]=arguments[J];return(Y=o[k]).call.apply(Y,[O,D].concat(Q))}}),Object.entries(l).forEach(function(k){var Y=TH(k,2),W=Y[0],Q=Y[1];return O[W]=O[Q]}),O.resetProps=function(){return g.forEach(function(k){O[k.name](k.defaultVal)}),O},O.resetProps(),D._rerender=F,w&&R&&O(R),O}}var fr=Object.freeze({Linear:Object.freeze({None:function(i){return i},In:function(i){return i},Out:function(i){return i},InOut:function(i){return i}}),Quadratic:Object.freeze({In:function(i){return i*i},Out:function(i){return i*(2-i)},InOut:function(i){return(i*=2)<1?.5*i*i:-.5*(--i*(i-2)-1)}}),Cubic:Object.freeze({In:function(i){return i*i*i},Out:function(i){return--i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i:.5*((i-=2)*i*i+2)}}),Quartic:Object.freeze({In:function(i){return i*i*i*i},Out:function(i){return 1- --i*i*i*i},InOut:function(i){return(i*=2)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2)}}),Quintic:Object.freeze({In:function(i){return i*i*i*i*i},Out:function(i){return--i*i*i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2)}}),Sinusoidal:Object.freeze({In:function(i){return 1-Math.sin((1-i)*Math.PI/2)},Out:function(i){return Math.sin(i*Math.PI/2)},InOut:function(i){return .5*(1-Math.sin(Math.PI*(.5-i)))}}),Exponential:Object.freeze({In:function(i){return i===0?0:Math.pow(1024,i-1)},Out:function(i){return i===1?1:1-Math.pow(2,-10*i)},InOut:function(i){return i===0?0:i===1?1:(i*=2)<1?.5*Math.pow(1024,i-1):.5*(-Math.pow(2,-10*(i-1))+2)}}),Circular:Object.freeze({In:function(i){return 1-Math.sqrt(1-i*i)},Out:function(i){return Math.sqrt(1- --i*i)},InOut:function(i){return(i*=2)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1)}}),Elastic:Object.freeze({In:function(i){return i===0?0:i===1?1:-Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI)},Out:function(i){return i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i-.1)*5*Math.PI)+1},InOut:function(i){return i===0?0:i===1?1:(i*=2,i<1?-.5*Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI):.5*Math.pow(2,-10*(i-1))*Math.sin((i-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(i){var e=1.70158;return i===1?1:i*i*((e+1)*i-e)},Out:function(i){var e=1.70158;return i===0?0:--i*i*((e+1)*i+e)+1},InOut:function(i){var e=2.5949095;return(i*=2)<1?.5*(i*i*((e+1)*i-e)):.5*((i-=2)*i*((e+1)*i+e)+2)}}),Bounce:Object.freeze({In:function(i){return 1-fr.Bounce.Out(1-i)},Out:function(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},InOut:function(i){return i<.5?fr.Bounce.In(i*2)*.5:fr.Bounce.Out(i*2-1)*.5+.5}}),generatePow:function(i){return i===void 0&&(i=4),i=i<Number.EPSILON?Number.EPSILON:i,i=i>1e4?1e4:i,{In:function(e){return Math.pow(e,i)},Out:function(e){return 1-Math.pow(1-e,i)},InOut:function(e){return e<.5?Math.pow(e*2,i)/2:(1-Math.pow(2-e*2,i))/2+.5}}}}),oA=function(){return performance.now()},O1=function(){function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return i.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(t){return e._tweens[t]})},i.prototype.removeAll=function(){this._tweens={}},i.prototype.add=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=0,s=t;r<s.length;r++){var o=s[r];(e=o._group)===null||e===void 0||e.remove(o),o._group=this,this._tweens[o.getId()]=o,this._tweensAddedDuringUpdate[o.getId()]=o}},i.prototype.remove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e;n<r.length;n++){var s=r[n];s._group=void 0,delete this._tweens[s.getId()],delete this._tweensAddedDuringUpdate[s.getId()]}},i.prototype.allStopped=function(){return this.getAll().every(function(e){return!e.isPlaying()})},i.prototype.update=function(e,t){e===void 0&&(e=oA()),t===void 0&&(t=!0);var n=Object.keys(this._tweens);if(n.length!==0)for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<n.length;r++){var s=this._tweens[n[r]],o=!t;s&&s.update(e,o)===!1&&!t&&this.remove(s)}n=Object.keys(this._tweensAddedDuringUpdate)}},i}(),tb={Linear:function(i,e){var t=i.length-1,n=t*e,r=Math.floor(n),s=tb.Utils.Linear;return e<0?s(i[0],i[1],n):e>1?s(i[t],i[t-1],t-n):s(i[r],i[r+1>t?t:r+1],n-r)},Utils:{Linear:function(i,e,t){return(e-i)*t+i}}},jL=function(){function i(){}return i.nextId=function(){return i._nextId++},i._nextId=0,i}(),nb=new O1,us=function(){function i(e,t){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=fr.Linear.None,this._interpolationFunction=tb.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=jL.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,typeof t=="object"?(this._group=t,t.add(this)):t===!0&&(this._group=nb,nb.add(this))}return i.prototype.getId=function(){return this._id},i.prototype.isPlaying=function(){return this._isPlaying},i.prototype.isPaused=function(){return this._isPaused},i.prototype.getDuration=function(){return this._duration},i.prototype.to=function(e,t){if(t===void 0&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},i.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},i.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},i.prototype.start=function(e,t){if(e===void 0&&(e=oA()),t===void 0&&(t=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var r={};for(var s in this._valuesEnd)r[s]=this._valuesEnd[s];this._valuesEnd=r}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},i.prototype.startFromCurrentValues=function(e){return this.start(e,!0)}
3828,i.prototype._setupProperties=function(e,t,n,r,s){for(var o in n){var a=e[o],l=Array.isArray(a),c=l?"array":typeof a,u=!l&&Array.isArray(n[o]);if(!(c==="undefined"||c==="function")){if(u){var p=n[o];if(p.length===0)continue;for(var m=[a],g=0,v=p.length;g<v;g+=1){var b=this._handleRelativeValue(a,p[g]);if(isNaN(b)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}m.push(b)}u&&(n[o]=m)}if((c==="object"||l)&&a&&!u){t[o]=l?[]:{};var M=a;for(var x in M)t[o][x]=M[x];r[o]=l?[]:{};var p=n[o];if(!this._isDynamic){var w={};for(var x in p)w[x]=p[x];n[o]=p=w}this._setupProperties(M,t[o],p,r[o],s)}else(typeof t[o]>"u"||s)&&(t[o]=a),l||(t[o]*=1),u?r[o]=n[o].slice().reverse():r[o]=t[o]||0}}},i.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},i.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},i.prototype.pause=function(e){return e===void 0&&(e=oA()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this)},i.prototype.resume=function(e){return e===void 0&&(e=oA()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this)},i.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},i.prototype.group=function(e){return e?(e.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},i.prototype.remove=function(){var e;return(e=this._group)===null||e===void 0||e.remove(this),this},i.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},i.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},i.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},i.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},i.prototype.easing=function(e){return e===void 0&&(e=fr.Linear.None),this._easingFunction=e,this},i.prototype.interpolation=function(e){return e===void 0&&(e=tb.Linear),this._interpolationFunction=e,this},i.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},i.prototype.onStart=function(e){return this._onStartCallback=e,this},i.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},i.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},i.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},i.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},i.prototype.onStop=function(e){return this._onStopCallback=e,this},i.prototype.update=function(e,t){var n=this,r;if(e===void 0&&(e=oA()),t===void 0&&(t=i.autoStartOnUpdate),this._isPaused)return!0;var s;if(!this._goToEnd&&!this._isPlaying)if(t)this.start(e,!0);else return!1;if(this._goToEnd=!1,e<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var o=e-this._startTime,a=this._duration+((r=this._repeatDelayTime)!==null&&r!==void 0?r:this._delayTime),l=this._duration+this._repeat*a,c=function(){if(n._duration===0||o>l)return 1;var b=Math.trunc(o/a),M=o-b*a,x=Math.min(M/n._duration,1);return x===0&&o===n._duration?1:x},u=c(),p=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,p),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||o>=this._duration)if(this._repeat>0){var m=Math.min(Math.trunc((o-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=m);for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])
3828),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*m,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,v=this._chainedTweens.length;g<v;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},i.prototype._updateProperties=function(e,t,n,r){for(var s in n)if(t[s]!==void 0){var o=t[s]||0,a=n[s],l=Array.isArray(e[s]),c=Array.isArray(a),u=!l&&c;u?e[s]=this._interpolationFunction(a,r):typeof a=="object"&&a?this._updateProperties(e[s],o,a,r):(a=this._handleRelativeValue(o,a),typeof a=="number"&&(e[s]=o+(a-o)*r))}},i.prototype._handleRelativeValue=function(e,t){return typeof t!="string"?t:t.charAt(0)==="+"||t.charAt(0)==="-"?e+parseFloat(t):parseFloat(t)},i.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],n=this._valuesEnd[e];typeof n=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(n):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=t},i.autoStartOnUpdate=!1,i}();jL.nextId;var Ya=nb;Ya.getAll.bind(Ya);Ya.removeAll.bind(Ya);Ya.add.bind(Ya);Ya.remove.bind(Ya);Ya.update.bind(Ya);function CH(i){const e=+this._x.call(null,i),t=+this._y.call(null,i),n=+this._z.call(null,i);return XL(this.cover(e,t,n),e,t,n,i)}function XL(i,e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n))return i;var s,o=i._root,a={data:r},l=i._x0,c=i._y0,u=i._z0,p=i._x1,m=i._y1,g=i._z1,v,b,M,x,w,R,C,N,D,P,O;if(!o)return i._root=a,i;for(;o.length;)if((C=e>=(v=(l+p)/2))?l=v:p=v,(N=t>=(b=(c+m)/2))?c=b:m=b,(D=n>=(M=(u+g)/2))?u=M:g=M,s=o,!(o=o[P=D<<2|N<<1|C]))return s[P]=a,i;if(x=+i._x.call(null,o.data),w=+i._y.call(null,o.data),R=+i._z.call(null,o.data),e===x&&t===w&&n===R)return a.next=o,s?s[P]=a:i._root=a,i;do s=s?s[P]=new Array(8):i._root=new Array(8),(C=e>=(v=(l+p)/2))?l=v:p=v,(N=t>=(b=(c+m)/2))?c=b:m=b,(D=n>=(M=(u+g)/2))?u=M:g=M;while((P=D<<2|N<<1|C)===(O=(R>=M)<<2|(w>=b)<<1|x>=v));return s[O]=o,s[P]=a,i}function PH(i){Array.isArray(i)||(i=Array.from(i));const e=i.length,t=new Float64Array(e),n=new Float64Array(e),r=new Float64Array(e);let s=1/0,o=1/0,a=1/0,l=-1/0,c=-1/0,u=-1/0;for(let p=0,m,g,v,b;p<e;++p)isNaN(g=+this._x.call(null,m=i[p]))||isNaN(v=+this._y.call(null,m))||isNaN(b=+this._z.call(null,m))||(t[p]=g,n[p]=v,r[p]=b,g<s&&(s=g),g>l&&(l=g),v<o&&(o=v),v>c&&(c=v),b<a&&(a=b),b>u&&(u=b));if(s>l||o>c||a>u)return this;this.cover(s,o,a).cover(l,c,u);for(let p=0;p<e;++p)XL(this,t[p],n[p],r[p],i[p]);return this}function LH(i,e,t){if(isNaN(i=+i)||isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,s=this._z0,o=this._x1,a=this._y1,l=this._z1;if(isNaN(n))o=(n=Math.floor(i))+1,a=(r=Math.floor(e))+1,l=(s=Math.floor(t))+1;else{for(var c=o-n||1,u=this._root,p,m;n>i||i>=o||r>e||e>=a||s>t||t>=l;)switch(m=(t<s)<<2|(e<r)<<1|i<n,p=new Array(8),p[m]=u,u=p,c*=2,m){case 0:o=n+c,a=r+c,l=s+c;break;case 1:n=o-c,a=r+c,l=s+c;break;case 2:o=n+c,r=a-c,l=s+c;break;case 3:n=o-c,r=a-c,l=s+c;break;case 4:o=n+c,a=r+c,s=l-c;break;case 5:n=o-c,a=r+c,s=l-c;break;case 6:o=n+c,r=a-c,s=l-c;break;case 7:n=o-c,r=a-c,s=l-c;break}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=r,this._z0=s,this._x1=o,this._y1=a,this._z1=l,this}function NH(){var i=[];return this.visit(function(e){if(!e.length)do i.push(e.data);while(e=e.next)}),i}function DH(i){return arguments.length?this.cover(+i[0][0],+i[0][1],+i[0][2]).cover(+i[1][0],+i[1][1],+i[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function Ai(i,e,t,n,r,s,o){this.node=i,this.x0=e,this.y0=t,this.z0=n,this.x1=r,this.y1=s,this.z1=o}function IH(i,e,t,n){var r,s=this._x0,o=this._y0,a=this._z0,l,c,u,p,m,g,v=this._x1,b=this._y1,M=this._z1,x=[],w=this._root,R,C;for(w&&x.push(new Ai(w,s,o,a,v,b,M)),n==null?n=1/0:(s=i-n,o=e-n,a=t-n,v=i+n,b=e+n,M=t+n,n*=n);R=x.pop();)if(!(!(w=R.node)||(l=R.x0)>v||(c=R.y0)>b||(u=R.z0)>M||(p=R.x1)<s||(m=R.y1)<o||(g=R.z1)<a))if(w.length){var N=(l+p)/2,D=(c+m)/2,P=(u+g)/2;x.push(new Ai(w[7],N,D,P,p,m,g),new Ai(w[6],l,D,P,N,m,g),new Ai(w[5],N,c,P,p,D,g),new Ai(w[4],l,c,P,N,D,g),new Ai(w[3],N,D,u,p,m,P),new Ai(w[2],l,D,u,N,m,P),new Ai(w[1],N,c,u,p,D,P),new Ai(w[0],l,c,u,N,D,P)),(C=(t>=P)<<2|(e>=D)<<1|i>=N)&&(R=x[x.length-1],x[x.length-1]=x[x.length-1-C],x[x.length-1-C]=R)}else{var O=i-+this._x.call(null,w.data),I=e-+this._y.call(null,w.data),F=t-+this._z.call(null,w.data),k=O*O+I*I+F*F;if(k<n){var Y=Math.sqrt(n=k);s=i-Y,o=e-Y,a=t-Y,v=i+Y,b=e+Y,M=t+Y,r=w.data}}return r}
3828const BH=(i,e,t,n,r,s)=>Math.sqrt((i-n)**2+(e-r)**2+(t-s)**2);function FH(i,e,t,n){const r=[],s=i-n,o=e-n,a=t-n,l=i+n,c=e+n,u=t+n;return this.visit((p,m,g,v,b,M,x)=>{if(!p.length)do{const w=p.data;BH(i,e,t,this._x(w),this._y(w),this._z(w))<=n&&r.push(w)}while(p=p.next);return m>l||g>c||v>u||b<s||M<o||x<a}),r}function UH(i){if(isNaN(m=+this._x.call(null,i))||isNaN(g=+this._y.call(null,i))||isNaN(v=+this._z.call(null,i)))return this;var e,t=this._root,n,r,s,o=this._x0,a=this._y0,l=this._z0,c=this._x1,u=this._y1,p=this._z1,m,g,v,b,M,x,w,R,C,N,D;if(!t)return this;if(t.length)for(;;){if((w=m>=(b=(o+c)/2))?o=b:c=b,(R=g>=(M=(a+u)/2))?a=M:u=M,(C=v>=(x=(l+p)/2))?l=x:p=x,e=t,!(t=t[N=C<<2|R<<1|w]))return this;if(!t.length)break;(e[N+1&7]||e[N+2&7]||e[N+3&7]||e[N+4&7]||e[N+5&7]||e[N+6&7]||e[N+7&7])&&(n=e,D=N)}for(;t.data!==i;)if(r=t,!(t=t.next))return this;return(s=t.next)&&delete t.next,r?(s?r.next=s:delete r.next,this):e?(s?e[N]=s:delete e[N],(t=e[0]||e[1]||e[2]||e[3]||e[4]||e[5]||e[6]||e[7])&&t===(e[7]||e[6]||e[5]||e[4]||e[3]||e[2]||e[1]||e[0])&&!t.length&&(n?n[D]=t:this._root=t),this):(this._root=s,this)}function OH(i){for(var e=0,t=i.length;e<t;++e)this.remove(i[e]);return this}function kH(){return this._root}function zH(){var i=0;return this.visit(function(e){if(!e.length)do++i;while(e=e.next)}),i}function VH(i){var e=[],t,n=this._root,r,s,o,a,l,c,u;for(n&&e.push(new Ai(n,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));t=e.pop();)if(!i(n=t.node,s=t.x0,o=t.y0,a=t.z0,l=t.x1,c=t.y1,u=t.z1)&&n.length){var p=(s+l)/2,m=(o+c)/2,g=(a+u)/2;(r=n[7])&&e.push(new Ai(r,p,m,g,l,c,u)),(r=n[6])&&e.push(new Ai(r,s,m,g,p,c,u)),(r=n[5])&&e.push(new Ai(r,p,o,g,l,m,u)),(r=n[4])&&e.push(new Ai(r,s,o,g,p,m,u)),(r=n[3])&&e.push(new Ai(r,p,m,a,l,c,g)),(r=n[2])&&e.push(new Ai(r,s,m,a,p,c,g)),(r=n[1])&&e.push(new Ai(r,p,o,a,l,m,g)),(r=n[0])&&e.push(new Ai(r,s,o,a,p,m,g))}return this}function GH(i){var e=[],t=[],n;for(this._root&&e.push(new Ai(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));n=e.pop();){var r=n.node;if(r.length){var s,o=n.x0,a=n.y0,l=n.z0,c=n.x1,u=n.y1,p=n.z1,m=(o+c)/2,g=(a+u)/2,v=(l+p)/2;(s=r[0])&&e.push(new Ai(s,o,a,l,m,g,v)),(s=r[1])&&e.push(new Ai(s,m,a,l,c,g,v)),(s=r[2])&&e.push(new Ai(s,o,g,l,m,u,v)),(s=r[3])&&e.push(new Ai(s,m,g,l,c,u,v)),(s=r[4])&&e.push(new Ai(s,o,a,v,m,g,p)),(s=r[5])&&e.push(new Ai(s,m,a,v,c,g,p)),(s=r[6])&&e.push(new Ai(s,o,g,v,m,u,p)),(s=r[7])&&e.push(new Ai(s,m,g,v,c,u,p))}t.push(n)}for(;n=t.pop();)i(n.node,n.x0,n.y0,n.z0,n.x1,n.y1,n.z1);return this}function qH(i){return i[0]}function HH(i){return arguments.length?(this._x=i,this):this._x}function WH(i){return i[1]}function $H(i){return arguments.length?(this._y=i,this):this._y}function jH(i){return i[2]}function XH(i){return arguments.length?(this._z=i,this):this._z}function YL(i,e,t,n){var r=new iM(e??qH,t??WH,n??jH,NaN,NaN,NaN,NaN,NaN,NaN);return i==null?r:r.addAll(i)}function iM(i,e,t,n,r,s,o,a,l){this._x=i,this._y=e,this._z=t,this._x0=n,this._y0=r,this._z0=s,this._x1=o,this._y1=a,this._z1=l,this._root=void 0}function BE(i){for(var e={data:i.data},t=e;i=i.next;)t=t.next={data:i.data};return e}var Xr=YL.prototype=iM.prototype;Xr.copy=function(){var i=new iM(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),e=this._root,t,n;if(!e)return i;if(!e.length)return i._root=BE(e),i;for(t=[{source:e,target:i._root=new Array(8)}];e=t.pop();)for(var r=0;r<8;++r)(n=e.source[r])&&(n.length?t.push({source:n,target:e.target[r]=new Array(8)}):e.target[r]=BE(n));return i};Xr.add=CH;Xr.addAll=PH;Xr.cover=LH;Xr.data=NH;Xr.extent=DH;Xr.find=IH;Xr.findAllWithinRadius=FH;Xr.remove=UH;Xr.removeAll=OH;Xr.root=kH;Xr.size=zH;Xr.visit=VH;Xr.visitAfter=GH;Xr.x=HH;Xr.y=$H;Xr.z=XH;function ib(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}function YH(i){if(Array.isArray(i))return i}function QH(i){if(Array.isArray(i))return ib(i)}function yA(i,e,t){if(typeof i=="function"?i===e:i.has(e))return arguments.length<3?e:t;throw new TypeError("Private element is not present on this object")}function ZH(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function KH(i,e,t){return e=H_(e),lW(i,ZL()?Reflect.construct(e,[],H_(i).constructor):e.apply(i,t))}function QL(i,e){if(e.has(i))throw new TypeError("Cannot initialize the same private elements twice on an object")}function JH(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Dn(i,e){return i.get(yA(i,e))}function oc(i,e,t){QL(i,e),e.set(i,t)}function ac(i,e,t){return i.set(yA(i,e),t),t}function eW(i,e){QL(i,e),e.add(i)}function tW(i,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,JL(n.key),n)}}function nW(i,e,t){return tW(i.prototype,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function Gh(i,e,t){return(e=JL(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function H_(i){return H_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},H_(i)}function iW(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),e&&rb(i,e)}function ZL(){try{var i=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZL=function(){return!!i})()}function rW(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function sW(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,r,s,o,a=[],l=!0,c=!1;try{if(s=(t=t.call(i)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,r=u}
3828finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}function oW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3829In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aW(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3830In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lW(i,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ZH(i)}function rb(i,e){return rb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},rb(i,e)}function d_(i,e){return YH(i)||sW(i,e)||e5(i,e)||oW()}function KL(i){return QH(i)||rW(i)||e5(i)||aW()}function cW(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}function JL(i){var e=cW(i,"string");return typeof e=="symbol"?e:e+""}function e5(i,e){if(i){if(typeof i=="string")return ib(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ib(i,e):void 0}}var t5=function(e){e instanceof Array?e.forEach(t5):(e.map&&e.map.dispose(),e.dispose())},n5=function(e){e.geometry&&e.geometry.dispose(),e.material&&t5(e.material),e.texture&&e.texture.dispose(),e.children&&e.children.forEach(n5)},FE=function(e){if(e&&e.children)for(;e.children.length;){var t=e.children[0];e.remove(t),n5(t)}};function i5(i,e,t){var n=(90-i)*Math.PI/180,r=(90-e)*Math.PI/180;return{x:t*Math.sin(n)*Math.cos(r),y:t*Math.cos(n),z:t*Math.sin(n)*Math.sin(r)}}function uW(i){var e=i.x,t=i.y,n=i.z,r=Math.sqrt(e*e+t*t+n*n),s=Math.acos(t/r),o=Math.atan2(n,e);return{lat:90-s*180/Math.PI,lng:90-o*180/Math.PI-(o<-Math.PI/2?360:0),r}}function pu(i){return i*Math.PI/180}var r5=function(e){return 1-(PP(0,(.5-e)*Math.PI)[1]/Math.PI+1)/2},zy=function(e){return Math.max(0,Math.min(1,r5(e)))},UE=function(e){return .5-PP.invert(0,(2*(1-e)-1)*Math.PI)[1]/Math.PI},hW=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=Vc().domain([1,0]).range([t,n]).clamp(!0),s=Vc().domain([zy(t),zy(n)]).range([1,0]).clamp(!0),o=function(p){return s(zy(r(p)))},a=e.array,l=0,c=a.length;l<c;l+=2)a[l+1]=o(a[l+1]);e.needsUpdate=!0},OE=function(e,t,n,r){var s=Math.pow(2,e),o=Math.max(0,Math.min(s-1,Math.floor((n+180)*s/360))),a=(90-r)/180;t&&(a=Math.max(0,Math.min(1,r5(a))));var l=Math.floor(a*s);return[o,l]},sb=function(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,a=[],l=Math.pow(2,e),c=360/l,u=180/l,p=s===void 0?l-1:s,m=o===void 0?l-1:o,g=n,v=Math.min(l-1,p);g<=v;g++)for(var b=r,M=Math.min(l-1,m);b<=M;b++){var x=b,w=u;if(t){x=b===0?b:UE(b/l)*l;var R=b+1===l?b+1:UE((b+1)/l)*l;w=(R-x)*180/l}var C=-180+(g+.5)*c,N=90-(x*180/l+w/2),D=w;a.push({x:g,y:b,lng:C,lat:N,latLen:D})}return a},dW=6,fW=7,pW=3,AW=90,Ia=new WeakMap,Sc=new WeakMap,Vy=new WeakMap,qm=new WeakMap,Lo=new WeakMap,W_=new WeakMap,jd=new WeakMap,Au=new WeakMap,Hm=new WeakSet,mW=function(i){function e(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.tileUrl,o=r.minLevel,a=o===void 0?0:o,l=r.maxLevel,c=l===void 0?17:l,u=r.mercatorProjection,p=u===void 0?!0:u;return JH(this,e),n=KH(this,e),eW(n,Hm),oc(n,Ia,void 0),oc(n,Sc,void 0),oc(n,Vy,void 0),oc(n,qm,void 0),oc(n,Lo,{}),oc(n,W_,void 0),oc(n,jd,void 0),oc(n,Au,void 0),Gh(n,"minLevel",void 0),Gh(n,"maxLevel",void 0),Gh(n,"thresholds",KL(new Array(30)).map(function(m,g){return 8/Math.pow(2,g)})),Gh(n,"curvatureResolution",5),Gh(n,"tileMargin",0),Gh(n,"clearTiles",function(){Object.values(Dn(Lo,n)).forEac
3830h(function(m){m.forEach(function(g){g.obj&&(n.remove(g.obj),FE(g.obj),delete g.obj)})}),ac(Lo,n,{})}),ac(Ia,n,t),n.tileUrl=s,ac(Sc,n,p),n.minLevel=a,n.maxLevel=c,n.level=0,n.add(ac(Au,n,new qn(new sl(Dn(Ia,n)*.99,180,90),new Bo({color:0})))),Dn(Au,n).visible=!1,Dn(Au,n).material.polygonOffset=!0,Dn(Au,n).material.polygonOffsetUnits=3,Dn(Au,n).material.polygonOffsetFactor=1,n}return iW(e,i),nW(e,[{key:"tileUrl",get:function(){return Dn(Vy,this)},set:function(n){ac(Vy,this,n),this.updatePov(Dn(jd,this))}},{key:"level",get:function(){return Dn(qm,this)},set:function(n){var r=this;Dn(Lo,this)[n]||yA(Hm,this,gW).call(this,n);var s=Dn(qm,this);if(ac(qm,this,n),!(n===s||s===void 0)){if(Dn(Au,this).visible=n>0,Dn(Lo,this)[n].forEach(function(a){return a.obj&&(a.obj.material.depthWrite=!0)}),s<n&&Dn(Lo,this)[s].forEach(function(a){return a.obj&&(a.obj.material.depthWrite=!1)}),s>n)for(var o=n+1;o<=s;o++)Dn(Lo,this)[o]&&Dn(Lo,this)[o].forEach(function(a){a.obj&&(r.remove(a.obj),FE(a.obj),delete a.obj)});yA(Hm,this,kE).call(this)}}},{key:"updatePov",value:function(n){var r=this;if(!(!n||!(n instanceof L0))){ac(jd,this,n);var s;if(ac(W_,this,function(u){if(!u.hullPnts){var p=360/Math.pow(2,r.level),m=u.lng,g=u.lat,v=u.latLen,b=m-p/2,M=m+p/2,x=g-v/2,w=g+v/2;u.hullPnts=[[g,m],[x,b],[w,b],[x,M],[w,M]].map(function(R){var C=d_(R,2),N=C[0],D=C[1];return i5(N,D,Dn(Ia,r))}).map(function(R){var C=R.x,N=R.y,D=R.z;return new re(C,N,D)})}return s||(s=new Wf,n.updateMatrix(),n.updateMatrixWorld(),s.setFromProjectionMatrix(new un().multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse))),u.hullPnts.some(function(R){return s.containsPoint(R.clone().applyMatrix4(r.matrixWorld))})}),this.tileUrl){var o=n.position.clone(),a=o.distanceTo(this.getWorldPosition(new re)),l=(a-Dn(Ia,this))/Dn(Ia,this),c=this.thresholds.findIndex(function(u){return u&&u<=l});this.level=Math.min(this.maxLevel,Math.max(this.minLevel,c<0?this.thresholds.length:c)),yA(Hm,this,kE).call(this)}}}}])}(ks);function gW(i){var e=this;if(i>fW){Dn(Lo,this)[i]=[];return}var t=Dn(Lo,this)[i]=sb(i,Dn(Sc,this));t.forEach(function(n){return n.centroid=i5(n.lat,n.lng,Dn(Ia,e))}),t.octree=YL().x(function(n){return n.centroid.x}).y(function(n){return n.centroid.y}).z(function(n){return n.centroid.z}).addAll(t)}function kE(){var i=this;if(!(!this.tileUrl||this.level===void 0||!Dn(Lo,this).hasOwnProperty(this.level))&&!(!Dn(W_,this)&&this.level>dW)){var e=Dn(Lo,this)[this.level];if(Dn(jd,this)){var t=this.worldToLocal(Dn(jd,this).position.clone());if(e.octree){var n,r=this.worldToLocal(Dn(jd,this).position.clone()),s=(r.length()-Dn(Ia,this))*pW;e=(n=e.octree).findAllWithinRadius.apply(n,KL(r).concat([s]))}else{var o=uW(t),a=(o.r/Dn(Ia,this)-1)*AW,l=a/Math.cos(pu(o.lat)),c=[o.lng-l,o.lng+l],u=[o.lat+a,o.lat-a],p=OE(this.level,Dn(Sc,this),c[0],u[0]),m=d_(p,2),g=m[0],v=m[1],b=OE(this.level,Dn(Sc,this),c[1],u[1]),M=d_(b,2),x=M[0],w=M[1];!e.record&&(e.record={});var R=e.record;if(!R.hasOwnProperty("".concat(Math.round((g+x)/2),"_").concat(Math.round((v+w)/2))))e=sb(this.level,Dn(Sc,this),g,v,x,w).map(function(O){var I="".concat(O.x,"_").concat(O.y);return R.hasOwnProperty(I)?R[I]:(R[I]=O,e.push(O),O)});else{for(var C=[],N=g;N<=x;N++)for(var D=v;D<=w;D++){var P="".concat(N,"_").concat(D);R.hasOwnProperty(P)||(R[P]=sb(this.level,Dn(Sc,this),N,D,N,D)[0],e.push(R[P])),C.push(R[P])}e=C}}}e.filter(function(O){return!O.obj}).filter(Dn(W_,this)||function(){return!0}).forEach(function(O){var I=O.x,F=O.y,k=O.lng,Y=O.lat,W=O.latLen,Q=360/Math.pow(2,i.level);if(!O.obj){var J=Q*(1-i.tileMargin),H=W*(1-i.tileMargin),$=pu(k),K=pu(-Y),he=new qn(new sl(Dn(Ia,i),Math.ceil(J/i.curvatureResolution),Math.ceil(H/i.curvatureResolution),pu(90-J/2)+$,pu(J),pu(90-H/2)+K,pu(H)),new Wl);if(Dn(Sc,i)){var ie=[Y+W/2,Y-W/2].map(function(ge){return .5-ge/180}),de=d_(ie,2),Ce=de[0],Fe=de[1];hW(he.geometry.attributes.uv,Ce,Fe)}O.obj=he}O.loading||(O.loading=!0,new JS().load(i.tileUrl(I,F,i.level),function(ge){var Ge=O.obj;Ge&&(ge.colorSpace=Xt,Ge.material.map=ge,Ge.material.color=null,Ge.material.needsUpdate=!0,i.add(Ge)),O.loading=!1}))})}}function _W(i,e,t=2){const n=e&&e.length,r=n?e[0]*t:i.length;let s=s5(i,0,r,t,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,c;if(n&&(s=SW(i,e,s,t)),i.length>80*t){a=1/0,l=1/0;let u=-1/0,p=-1/0;for(let m=t;m<r;m+=t){const g=i[m],v=i[m+1];g<a&&(a=g),v<l&&(l=v),g>u&&(u=g),v>p&&(p=v)}c=Math.max(u-a,p-l),c=c!==0?32767/c:0}
vendor: 4,985 bytes, line 3830
3830return JA(s,o,t,a,l,c,0),o}function s5(i,e,t,n,r){let s;if(r===IW(i,e,t,n)>0)for(let o=e;o<t;o+=n)s=zE(o/n|0,i[o],i[o+1],s);else for(let o=t-n;o>=e;o-=n)s=zE(o/n|0,i[o],i[o+1],s);return s&&Tf(s,s.next)&&(t0(s),s=s.next),s}function ah(i,e){if(!i)return i;e||(e=i);let t=i,n;do if(n=!1,!t.steiner&&(Tf(t,t.next)||zi(t.prev,t,t.next)===0)){if(t0(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function JA(i,e,t,n,r,s,o){if(!i)return;!o&&s&&RW(i,n,r,s);let a=i;for(;i.prev!==i.next;){const l=i.prev,c=i.next;if(s?yW(i,n,r,s):vW(i)){e.push(l.i,i.i,c.i),t0(i),i=c.next,a=c.next;continue}if(i=c,i===a){o?o===1?(i=xW(ah(i),e),JA(i,e,t,n,r,s,2)):o===2&&bW(i,e,t,n,r,s):JA(ah(i),e,t,n,r,s,1);break}}}function vW(i){const e=i.prev,t=i,n=i.next;if(zi(e,t,n)>=0)return!1;const r=e.x,s=t.x,o=n.x,a=e.y,l=t.y,c=n.y,u=Math.min(r,s,o),p=Math.min(a,l,c),m=Math.max(r,s,o),g=Math.max(a,l,c);let v=n.next;for(;v!==e;){if(v.x>=u&&v.x<=m&&v.y>=p&&v.y<=g&&aA(r,a,s,l,o,c,v.x,v.y)&&zi(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function yW(i,e,t,n){const r=i.prev,s=i,o=i.next;if(zi(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,u=r.y,p=s.y,m=o.y,g=Math.min(a,l,c),v=Math.min(u,p,m),b=Math.max(a,l,c),M=Math.max(u,p,m),x=ob(g,v,e,t,n),w=ob(b,M,e,t,n);let R=i.prevZ,C=i.nextZ;for(;R&&R.z>=x&&C&&C.z<=w;){if(R.x>=g&&R.x<=b&&R.y>=v&&R.y<=M&&R!==r&&R!==o&&aA(a,u,l,p,c,m,R.x,R.y)&&zi(R.prev,R,R.next)>=0||(R=R.prevZ,C.x>=g&&C.x<=b&&C.y>=v&&C.y<=M&&C!==r&&C!==o&&aA(a,u,l,p,c,m,C.x,C.y)&&zi(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;R&&R.z>=x;){if(R.x>=g&&R.x<=b&&R.y>=v&&R.y<=M&&R!==r&&R!==o&&aA(a,u,l,p,c,m,R.x,R.y)&&zi(R.prev,R,R.next)>=0)return!1;R=R.prevZ}for(;C&&C.z<=w;){if(C.x>=g&&C.x<=b&&C.y>=v&&C.y<=M&&C!==r&&C!==o&&aA(a,u,l,p,c,m,C.x,C.y)&&zi(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function xW(i,e){let t=i;do{const n=t.prev,r=t.next.next;!Tf(n,r)&&a5(n,t,t.next,r)&&e0(n,r)&&e0(r,n)&&(e.push(n.i,t.i,r.i),t0(t),t0(t.next),t=i=r),t=t.next}while(t!==i);return ah(t)}function bW(i,e,t,n,r,s){let o=i;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&LW(o,a)){let l=l5(o,a);o=ah(o,o.next),l=ah(l,l.next),JA(o,e,t,n,r,s,0),JA(l,e,t,n,r,s,0);return}a=a.next}o=o.next}while(o!==i)}function SW(i,e,t,n){const r=[];for(let s=0,o=e.length;s<o;s++){const a=e[s]*n,l=s<o-1?e[s+1]*n:i.length,c=s5(i,a,l,n,!1);c===c.next&&(c.steiner=!0),r.push(PW(c))}r.sort(MW);for(let s=0;s<r.length;s++)t=wW(r[s],t);return t}function MW(i,e){let t=i.x-e.x;if(t===0&&(t=i.y-e.y,t===0)){const n=(i.next.y-i.y)/(i.next.x-i.x),r=(e.next.y-e.y)/(e.next.x-e.x);t=n-r}return t}function wW(i,e){const t=TW(i,e);if(!t)return e;const n=l5(t,i);return ah(n,n.next),ah(t,t.next)}function TW(i,e){let t=e;const n=i.x,r=i.y;let s=-1/0,o;if(Tf(i,t))return t;do{if(Tf(i,t.next))return t.next;if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const p=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=n&&p>s&&(s=p,o=t.x<t.next.x?t:t.next,p===n))return o}t=t.next}while(t!==e);if(!o)return null;const a=o,l=o.x,c=o.y;let u=1/0;t=o;do{if(n>=t.x&&t.x>=l&&n!==t.x&&o5(r<c?n:s,r,l,c,r<c?s:n,r,t.x,t.y)){const p=Math.abs(r-t.y)/(n-t.x);e0(t,i)&&(p<u||p===u&&(t.x>o.x||t.x===o.x&&EW(o,t)))&&(o=t,u=p)}t=t.next}while(t!==a);return o}function EW(i,e){return zi(i.prev,i,e.prev)<0&&zi(e.next,i,i.next)<0}function RW(i,e,t,n){let r=i;do r.z===0&&(r.z=ob(r.x,r.y,e,t,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==i);r.prevZ.nextZ=null,r.prevZ=null,CW(r)}function CW(i){let e,t=1;do{let n=i,r;i=null;let s=null;for(e=0;n;){e++;let o=n,a=0;for(let c=0;c<t&&(a++,o=o.nextZ,!!o);c++);let l=t;for(;a>0||l>0&&o;)a!==0&&(l===0||!o||n.z<=o.z)?(r=n,n=n.nextZ,a--):(r=o,o=o.nextZ,l--),s?s.nextZ=r:i=r,r.prevZ=s,s=r;n=o}s.nextZ=null,t*=2}while(e>1);return i}function ob(i,e,t,n,r){return i=(i-t)*r|0,e=(e-n)*r|0,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,i|e<<1}function PW(i){let e=i,t=i;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==i);return t}function o5(i,e,t,n,r,s,o,a){return(r-o)*(e-a)>=(i-o)*(s-a)&&(i-o)*(n-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(n-a)}function aA(i,e,t,n,r,s,o,a){return!(i===o&&e===a)&&o5(i,e,t,n,r,s,o,a)}function LW(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!NW(i,e)&&(e0(i,e)&&e0(e,i)&&DW(i,e)&&(zi(i.prev,i,e.prev)||zi(i,e.prev,e))||Tf(i,e)&&zi(i.prev,i,i.next)>0&&zi(e.prev,e,e.next)>0)}function zi(i,e,t){return(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y)}function Tf(i,e){return i.x===e.x&&i.y===e.y}function a5(i,e,t,n){const r=$m(zi(i,e,t)),s=$m(zi(i,e,n)),o=$m(zi(t,n,i)),a=$m(zi(t,n,e));return!!(r!==s&&o!==a||r===0&&Wm(i,t,e)||s===0&&Wm(i,n,e)||o===0&&Wm(t,i,n)||a===0&&Wm(t,e,n))}function Wm(i,e,t){return e.x<=Math.max(i.x,t.x)&&e.x>=Math.min(i.x,t.x)&&e.y<=Math.max(i.y,t.y)&&e.y>=Math.min(i.y,t.y)}function $m(i){return i>0?1:i<0?-1:0}function NW(i,e){let t=i;do{if(t.i!==i.i&&t.next.i!==i.i&&t.i!==e.i&&t.next.i!==e.i&&a5(t,t.next,i,e))return!0;t=t.next}
3830while(t!==i);return!1}function e0(i,e){return zi(i.prev,i,i.next)<0?zi(i,e,i.next)>=0&&zi(i,i.prev,e)>=0:zi(i,e,i.prev)<0||zi(i,i.next,e)<0}function DW(i,e){let t=i,n=!1;const r=(i.x+e.x)/2,s=(i.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==i);return n}function l5(i,e){const t=ab(i.i,i.x,i.y),n=ab(e.i,e.x,e.y),r=i.next,s=e.prev;return i.next=e,e.prev=i,t.next=r,r.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function zE(i,e,t,n){const r=ab(i,e,t);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function t0(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function ab(i,e,t){return{i,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function IW(i,e,t,n){let r=0;for(let s=e,o=t-n;s<t;s+=n)r+=(i[o]-i[s])*(i[s+1]+i[o+1]),o=s;return r}function $_(i){const e=[],t=[],n=i[0][0].length;let r=0,s=0;for(const o of i){for(const a of o)for(let l=0;l<n;l++)e.push(a[l]);s&&(r+=s,t.push(r)),s=o.length}return{vertices:e,holes:t,dimensions:n}}function lb(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}function BW(i){if(Array.isArray(i))return i}function FW(i){if(Array.isArray(i))return lb(i)}function UW(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function OW(i,e,t){return e=j_(e),jW(i,c5()?Reflect.construct(e,[],j_(i).constructor):e.apply(i,t))}function kW(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function zW(i,e,t){return Object.defineProperty(i,"prototype",{writable:!1}),i}function VW(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=rM(i))||e){t&&(i=t);var n=0,r=function(){};return{s:r,n:function(){return n>=i.length?{done:!0}:{done:!1,value:i[n++]}},e:function(l){throw l},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3831In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){t=t.call(i)},n:function(){var l=t.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw s}}}}function j_(i){return j_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j_(i)}function GW(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),e&&cb(i,e)}function c5(){try{var i=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(c5=function(){return!!i})()}function qW(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function HW(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,r,s,o,a=[],l=!0,c=!1;try{if(s=(t=t.call(i)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,r=u}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}function WW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3832In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $W(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3833In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jW(i,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return UW(i)}function cb(i,e){return cb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},cb(i,e)}function Mp(i,e){return BW(i)||HW(i,e)||rM(i,e)||WW()}function XW(i){return FW(i)||qW(i)||rM(i)||$W()}function rM(i,e){if(i){if(typeof i=="string")return lb(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?lb(i,e):void 0}}var VE=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=[],r=null;return e.forEach(function(s){if(r){var o=Gc(s,r)*180/Math.PI;if(o>t)for(var a=gS(r,s),l=r.length>2||s.length>2?nU(r[2]||0,s[2]||0):null,c=l?function(m){return[].concat(XW(a(m)),[l(m)])}:a,u=1/Math.ceil(o/t),p=u;p<1;)n.push(c(p)),p+=u}n.push(r=s)}),n},ub=typeof window<"u"&&window.THREE?window.THREE:{BufferGeometry:vi,Float32BufferAttribute:Gn},YW=new ub.BufferGeometry().setAttribute?"setAttribute":"addAttribute",u5=function(i){function e(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:5;kW(this,e),n=OW(this,e),n.type="GeoJsonGeometry",n.parameters={geoJson:t,radius:r,resolution:s};var o=({Point:u,MultiPoint:p,LineString:m,MultiLineString:g,Polygon:v,MultiPolygon:b}[t.type]||function(){return[]})(t.coordinates,r),a=[],l=[],c=0;o.forEach(function(M){var x=a.length;wp({indices:a,vertices:l},M),n.addGroup(x,a.length-x,c++)}),a.length&&n.setIndex(a),l.length&&n[YW]("position",new ub.Float32BufferAttribute(l,3));function u(M,x){var w=Gy(M[1],M[0],x+(M[2]||0)),R=[];return[{vertices:w,indices:R}]}function p(M,x){var w={vertices:[],indices:[]};return M.map(function(R){return u(R,x)}
3833).forEach(function(R){var C=Mp(R,1),N=C[0];wp(w,N)}),[w]}function m(M,x){for(var w=VE(M,s).map(function(O){var I=Mp(O,3),F=I[0],k=I[1],Y=I[2],W=Y===void 0?0:Y;return Gy(k,F,x+W)}),R=$_([w]),C=R.vertices,N=Math.round(C.length/3),D=[],P=1;P<N;P++)D.push(P-1,P);return[{vertices:C,indices:D}]}function g(M,x){var w={vertices:[],indices:[]};return M.map(function(R){return m(R,x)}).forEach(function(R){var C=Mp(R,1),N=C[0];wp(w,N)}),[w]}function v(M,x){for(var w=M.map(function(J){return VE(J,s).map(function(H){var $=Mp(H,3),K=$[0],he=$[1],ie=$[2],de=ie===void 0?0:ie;return Gy(he,K,x+de)})}),R=$_(w),C=R.vertices,N=R.holes,D=N[0]||1/0,P=C.slice(0,D*3),O=C.slice(D*3),I=new Set(N),F=Math.round(C.length/3),k=[],Y=[],W=1;W<F;W++)I.has(W)||(W<D?k.push(W-1,W):Y.push(W-1-D,W-D));var Q=[{indices:k,vertices:P}];return N.length&&Q.push({indices:Y,vertices:O}),Q}function b(M,x){var w={vertices:[],indices:[]},R={vertices:[],indices:[]};M.map(function(N){return v(N,x)}).forEach(function(N){var D=Mp(N,2),P=D[0],O=D[1];wp(w,P),O&&wp(R,O)});var C=[w];return R.vertices.length&&C.push(R),C}return n}return GW(e,i),zW(e)}(ub.BufferGeometry);function wp(i,e){var t=Math.round(i.vertices.length/3);GE(i.vertices,e.vertices),GE(i.indices,e.indices.map(function(n){return n+t}))}function GE(i,e){var t=VW(e),n;try{for(t.s();!(n=t.n()).done;){var r=n.value;i.push(r)}}catch(s){t.e(s)}finally{t.f()}}function Gy(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,r=(90-e)*Math.PI/180;return[t*Math.sin(n)*Math.cos(r),t*Math.cos(n),t*Math.sin(n)*Math.sin(r)]}function QW(i,e,t=!0){if(!e||!e.isReady)throw new Error("BufferGeometryUtils: Initialized MikkTSpace library required.");if(!i.hasAttribute("position")||!i.hasAttribute("normal")||!i.hasAttribute("uv"))throw new Error('BufferGeometryUtils: Tangents require "position", "normal", and "uv" attributes.');function n(o){if(o.normalized||o.isInterleavedBufferAttribute){const a=new Float32Array(o.count*o.itemSize);for(let l=0,c=0;l<o.count;l++)a[c++]=o.getX(l),a[c++]=o.getY(l),o.itemSize>2&&(a[c++]=o.getZ(l));return a}return o.array instanceof Float32Array?o.array:new Float32Array(o.array)}const r=i.index?i.toNonIndexed():i,s=e.generateTangents(n(r.attributes.position),n(r.attributes.normal),n(r.attributes.uv));if(t)for(let o=3;o<s.length;o+=4)s[o]*=-1;return r.setAttribute("tangent",new Ii(s,4)),i!==r&&i.copy(r),i}function ZW(i,e=!1){const t=i[0].index!==null,n=new Set(Object.keys(i[0].attributes)),r=new Set(Object.keys(i[0].morphAttributes)),s={},o={},a=i[0].morphTargetsRelative,l=new vi;let c=0;for(let u=0;u<i.length;++u){const p=i[u];let m=0;if(t!==(p.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+u+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const g in p.attributes){if(!n.has(g))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+u+'. All geometries must have compatible attributes; make sure "'+g+'" attribute exists among all geometries, or in none of them.'),null;s[g]===void 0&&(s[g]=[]),s[g].push(p.attributes[g]),m++}if(m!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+u+". Make sure all geometries have the same number of attributes."),null;if(a!==p.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+u+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const g in p.morphAttributes){if(!r.has(g))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+u+".  .morphAttributes must be consistent throughout all geometries."),null;o[g]===void 0&&(o[g]=[]),o[g].push(p.morphAttributes[g])}if(e){let g;if(t)g=p.index.count;else if(p.attributes.position!==void 0)g=p.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+u+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,g,u),c+=g}}if(t){let u=0;const p=[];for(let m=0;m<i.length;++m){const g=i[m].index;for(let v=0;v<g.count;++v)p.push(g.getX(v)+u);u+=i[m].attributes.position.count}l.setIndex(p)}for(const u in s){const p=hb(s[u]);if(!p)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+u+" attribute."),null;l.setAttribute(u,p)}for(const u in o){const p=o[u][0].length;if(p===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[u]=[];for(let m=0;m<p;++m){const g=[];for(let b=0;b<o[u].length;++b)g.push(o[u][b][m]);const v=hb(g);if(!v)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+u+" morphAttribute."),null;l.morphAttributes[u].push(v)}}return l}function hb(i){let e,t,n,r=-1,s=0;for(let c=0;c<i.length;++c){const u=i[c];if(e===void 0&&(e=u.array.constructor),e!==u.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=u.itemSize),t!==u.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(n===void 0&&(n=u.normalized),n!==u.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(r===-1&&(r=u.gpuType),r!==u.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;s+=u.count*t}const o=new e(s),a=new Ii(o,t,n);let l=0;for(let c=0;c<i.length;++c){const u=i[c];if(u.isInterleavedBufferAttribute){const p=l/t;for(let m=0,g=u.count;m<g;m++)for(let v=0;v<t;v++){const b=u.getComponent(m,v);a.setComponent(m+p,v,b)}}else o.set(u.array,l);l+=u.count*t}return r!==void 0&&(a.gpuType=r),a}function KW(i){return i.isInstancedInterleavedBufferAttribute||i.isInterleavedBufferAttribute?X_(i):i.isInstancedBufferAttribute?new Ic().c
3833opy(i):new Ii().copy(i)}function JW(i){let e,t=0,n=0;for(let c=0,u=i.length;c<u;++c){const p=i[c];if(e===void 0&&(e=p.array.constructor),e!==p.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;t+=p.array.length,n+=p.itemSize}const r=new WS(new e(t),n);let s=0;const o=[],a=["getX","getY","getZ","getW"],l=["setX","setY","setZ","setW"];for(let c=0,u=i.length;c<u;c++){const p=i[c],m=p.itemSize,g=p.count,v=new Rc(r,m,s,p.normalized);o.push(v),s+=m;for(let b=0;b<g;b++)for(let M=0;M<m;M++)v[l[M]](b,p[a[M]](b))}return o}function X_(i){const e=i.data.array.constructor,t=i.count,n=i.itemSize,r=i.normalized,s=new e(t*n);let o;i.isInstancedInterleavedBufferAttribute?o=new Ic(s,n,r,i.meshPerAttribute):o=new Ii(s,n,r);for(let a=0;a<t;a++)o.setX(a,i.getX(a)),n>=2&&o.setY(a,i.getY(a)),n>=3&&o.setZ(a,i.getZ(a)),n>=4&&o.setW(a,i.getW(a));return o}function e$(i){const e=i.attributes,t=i.morphTargets,n=new Map;for(const r in e){const s=e[r];s.isInterleavedBufferAttribute&&(n.has(s)||n.set(s,X_(s)),e[r]=n.get(s))}for(const r in t){const s=t[r];s.isInterleavedBufferAttribute&&(n.has(s)||n.set(s,X_(s)),t[r]=n.get(s))}}function t$(i){let e=0;for(const n in i.attributes){const r=i.getAttribute(n);e+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}const t=i.getIndex();return e+=t?t.count*t.itemSize*t.array.BYTES_PER_ELEMENT:0,e}function n$(i,e=1e-4){e=Math.max(e,Number.EPSILON);const t={},n=i.getIndex(),r=i.getAttribute("position"),s=n?n.count:r.count;let o=0;const a=Object.keys(i.attributes),l={},c={},u=[],p=["getX","getY","getZ","getW"],m=["setX","setY","setZ","setW"];for(let w=0,R=a.length;w<R;w++){const C=a[w],N=i.attributes[C];l[C]=new N.constructor(new N.array.constructor(N.count*N.itemSize),N.itemSize,N.normalized);const D=i.morphAttributes[C];D&&(c[C]||(c[C]=[]),D.forEach((P,O)=>{const I=new P.array.constructor(P.count*P.itemSize);c[C][O]=new P.constructor(I,P.itemSize,P.normalized)}))}const g=e*.5,v=Math.log10(1/e),b=Math.pow(10,v),M=g*b;for(let w=0;w<s;w++){const R=n?n.getX(w):w;let C="";for(let N=0,D=a.length;N<D;N++){const P=a[N],O=i.getAttribute(P),I=O.itemSize;for(let F=0;F<I;F++)C+=`${~~(O[p[F]](R)*b+M)},`}if(C in t)u.push(t[C]);else{for(let N=0,D=a.length;N<D;N++){const P=a[N],O=i.getAttribute(P),I=i.morphAttributes[P],F=O.itemSize,k=l[P],Y=c[P];for(let W=0;W<F;W++){const Q=p[W],J=m[W];if(k[J](o,O[Q](R)),I)for(let H=0,$=I.length;H<$;H++)Y[H][J](o,I[H][Q](R))}}t[C]=o,u.push(o),o++}}const x=i.clone();for(const w in i.attributes){const R=l[w];if(x.setAttribute(w,new R.constructor(R.array.slice(0,o*R.itemSize),R.itemSize,R.normalized)),w in c)for(let C=0;C<c[w].length;C++){const N=c[w][C];x.morphAttributes[w][C]=new N.constructor(N.array.slice(0,o*N.itemSize),N.itemSize,N.normalized)}}return x.setIndex(u),x}function i$(i,e){if(e===xO)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===v3||e===bO){let t=i.getIndex();if(t===null){const o=[],a=i.getAttribute("position");if(a!==void 0){for(let l=0;l<a.count;l++)o.push(l);i.setIndex(o),t=i.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),i}const n=t.count-2,r=[];if(e===v3)for(let o=1;o<=n;o++)r.push(t.getX(0)),r.push(t.getX(o)),r.push(t.getX(o+1));else for(let o=0;o<n;o++)o%2===0?(r.push(t.getX(o)),r.push(t.getX(o+1)),r.push(t.getX(o+2))):(r.push(t.getX(o+2)),r.push(t.getX(o+1)),r.push(t.getX(o)));r.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=i.clone();return s.setIndex(r),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),i}function r$(i){const e=new re,t=new re,n=new re,r=new re,s=new re,o=new re,a=new re,l=new re,c=new re;function u(he,ie,de,Ce,Fe,ge,Ge,Me){e.fromBufferAttribute(ie,Fe),t.fromBufferAttribute(ie,ge),n.fromBufferAttribute(ie,Ge);const Ye=he.morphTargetInfluences;if(de&&Ye){a.set(0,0,0),l.set(0,0,0),c.set(0,0,0);for(let ct=0,Je=de.length;ct<Je;ct++){const Ke=Ye[ct],Rt=de[ct];Ke!==0&&(r.fromBufferAttribute(Rt,Fe),s.fromBufferAttribute(Rt,ge),o.fromBufferAttribute(Rt,Ge),Ce?(a.addScaledVector(r,Ke),l.addScaledVector(s,Ke),c.addScaledVector(o,Ke)):(a.addScaledVector(r.sub(e),Ke),l.addScaledVector(s.sub(t),Ke),c.addScaledVector(o.sub(n),Ke)))}e.add(a),t.add(l),n.add(c)}he.isSkinnedMesh&&(he.applyBoneTransform(Fe,e),he.applyBoneTransform(ge,t),he.applyBoneTransform(Ge,n)),Me[Fe*3+0]=e.x,Me[Fe*3+1
3833]=e.y,Me[Fe*3+2]=e.z,Me[ge*3+0]=t.x,Me[ge*3+1]=t.y,Me[ge*3+2]=t.z,Me[Ge*3+0]=n.x,Me[Ge*3+1]=n.y,Me[Ge*3+2]=n.z}const p=i.geometry,m=i.material;let g,v,b;const M=p.index,x=p.attributes.position,w=p.morphAttributes.position,R=p.morphTargetsRelative,C=p.attributes.normal,N=p.morphAttributes.position,D=p.groups,P=p.drawRange;let O,I,F,k,Y,W,Q;const J=new Float32Array(x.count*x.itemSize),H=new Float32Array(C.count*C.itemSize);if(M!==null)if(Array.isArray(m))for(O=0,F=D.length;O<F;O++)for(Y=D[O],W=Math.max(Y.start,P.start),Q=Math.min(Y.start+Y.count,P.start+P.count),I=W,k=Q;I<k;I+=3)g=M.getX(I),v=M.getX(I+1),b=M.getX(I+2),u(i,x,w,R,g,v,b,J),u(i,C,N,R,g,v,b,H);else for(W=Math.max(0,P.start),Q=Math.min(M.count,P.start+P.count),O=W,F=Q;O<F;O+=3)g=M.getX(O),v=M.getX(O+1),b=M.getX(O+2),u(i,x,w,R,g,v,b,J),u(i,C,N,R,g,v,b,H);else if(Array.isArray(m))for(O=0,F=D.length;O<F;O++)for(Y=D[O],W=Math.max(Y.start,P.start),Q=Math.min(Y.start+Y.count,P.start+P.count),I=W,k=Q;I<k;I+=3)g=I,v=I+1,b=I+2,u(i,x,w,R,g,v,b,J),u(i,C,N,R,g,v,b,H);else for(W=Math.max(0,P.start),Q=Math.min(x.count,P.start+P.count),O=W,F=Q;O<F;O+=3)g=O,v=O+1,b=O+2,u(i,x,w,R,g,v,b,J),u(i,C,N,R,g,v,b,H);const $=new Gn(J,3),K=new Gn(H,3);return{positionAttribute:x,normalAttribute:C,morphedPositionAttribute:$,morphedNormalAttribute:K}}function s$(i){if(i.groups.length===0)return console.warn("THREE.BufferGeometryUtils.mergeGroups(): No groups are defined. Nothing to merge."),i;let e=i.groups;if(e=e.sort((o,a)=>o.materialIndex!==a.materialIndex?o.materialIndex-a.materialIndex:o.start-a.start),i.getIndex()===null){const o=i.getAttribute("position"),a=[];for(let l=0;l<o.count;l+=3)a.push(l,l+1,l+2);i.setIndex(a)}const t=i.getIndex(),n=[];for(let o=0;o<e.length;o++){const a=e[o],l=a.start,c=l+a.count;for(let u=l;u<c;u++)n.push(t.getX(u))}i.dispose(),i.setIndex(n);let r=0;for(let o=0;o<e.length;o++){const a=e[o];a.start=r,r+=a.count}let s=e[0];i.groups=[s];for(let o=1;o<e.length;o++){const a=e[o];s.materialIndex===a.materialIndex?s.count+=a.count:(s=a,i.groups.push(s))}return i}function o$(i,e=Math.PI/3){const t=Math.cos(e),n=(1+1e-10)*100,r=[new re,new re,new re],s=new re,o=new re,a=new re,l=new re;function c(b){const M=~~(b.x*n),x=~~(b.y*n),w=~~(b.z*n);return`${M},${x},${w}`}const u=i.index?i.toNonIndexed():i,p=u.attributes.position,m={};for(let b=0,M=p.count/3;b<M;b++){const x=3*b,w=r[0].fromBufferAttribute(p,x+0),R=r[1].fromBufferAttribute(p,x+1),C=r[2].fromBufferAttribute(p,x+2);s.subVectors(C,R),o.subVectors(w,R);const N=new re().crossVectors(s,o).normalize();for(let D=0;D<3;D++){const P=r[D],O=c(P);O in m||(m[O]=[]),m[O].push(N)}}const g=new Float32Array(p.count*3),v=new Ii(g,3,!1);for(let b=0,M=p.count/3;b<M;b++){const x=3*b,w=r[0].fromBufferAttribute(p,x+0),R=r[1].fromBufferAttribute(p,x+1),C=r[2].fromBufferAttribute(p,x+2);s.subVectors(C,R),o.subVectors(w,R),a.crossVectors(s,o).normalize();for(let N=0;N<3;N++){const D=r[N],P=c(D),O=m[P];l.set(0,0,0);for(let I=0,F=O.length;I<F;I++){const k=O[I];a.dot(k)>t&&l.add(k)}l.normalize(),v.setXYZ(x+N,l.x,l.y,l.z)}}return u.setAttribute("normal",v),u}const sM=Object.freeze(Object.defineProperty({__proto__:null,computeMikkTSpaceTangents:QW,computeMorphedAttributes:r$,deepCloneAttribute:KW,deinterleaveAttribute:X_,deinterleaveGeometry:e$,estimateBytesUsed:t$,interleaveAttributes:JW,mergeAttributes:hb,mergeGeometries:ZW,mergeGroups:s$,mergeVertices:n$,toCreasedNormals:o$,toTrianglesDrawMode:i$},Symbol.toStringTag,{value:"Module"}));var At=function(i){return typeof i=="function"?i:typeof i=="string"?function(e){return e[i]}:function(e){return i}};function Y_(i){"@babel/helpers - typeof";return Y_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y_(i)}var a$=/^\s+/,l$=/\s+$/;function Yt(i,e){if(i=i||"",e=e||{},i instanceof Yt)return i;if(!(this instanceof Yt))return new Yt(i,e);var t=c$(i);this._originalInput=i,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||t.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=t.ok}Yt.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),t,n,r,s,o,a;return t=e.r/255,n=e.g/255,r=e.b/255,t<=.03928?s=t/12.92:s=Math.pow((t+.055)/1.055,2.4),n<=.03928?o=n/12.92:o=Math.pow((n+.055)/1.055,2.4),r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),.2126*s+.7152*o+.0722*a},setAlpha:function(e){return this._a=h5(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=HE(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=HE(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this._a==1?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=qE(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=qE(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this._a==1?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return WE(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return f$(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Ni(this._r,255)*100)+"%",g:Math.round(Ni(this._g,255)*100)+"%",b:Math.round(Ni(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Ni(this._r,255)*100)+"%, "+Math.round(Ni(this._g,255)*100)+"%, "+Math.round(Ni(this._b,255)*100)+"%)":"rgba("+Math.round(Ni(this._r,255)*100)+"%, "+Math.round(Ni(this._g,255)*100)+"%, "+Math.round(Ni(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:w$[WE(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var t="#"+$E(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var s=Yt(e);n="#"+$E(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0,s=!t&&r&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return s?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return Yt(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(g$,arguments)},brighten:function(){return this._applyModification(_$,arguments)},darken:function(){return this._applyModification(v$,arguments)},desaturate:function(){return this._applyModification(p$,arguments)},saturate:function(){return this._applyModification(A$,arguments)},greyscale:function(){return this._applyModification(m$,arguments)},spin:function(){return this._applyModification(y$,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(S$,arguments)},complement:function(){return this._applyCombination(x$,arguments)},monochromatic:function(){return this._applyCombination(M$,arguments)},splitcomplement:function(){return this._applyCombination(b$,arguments)},triad:function(){return this._applyCombination(jE,[3])},tetrad:function(){return this._applyCombination(jE,[4])}};Yt.fromRatio=function(i,e){if(Y_(i)=="object"){var t={};for(var n in i)i.hasOwnProperty(n)&&(n==="a"?t[n]=i[n]:t[n]=lA(i[n]));i=t}return Yt(i,e)};function c$(i){var e={r:0,g:0,b:0},t=1,n=null,r=null,s=null,o=!1,a=!1;return typeof i=="string"&&(i=C$(i)),Y_(i)=="object"&&(Al(i.r)&&Al(i.g)&&Al(i.b)?(e=u$(i.r,i.g,i.b),o=!0,a=String(i.r).substr(-1)==="%"?"prgb":"rgb"):Al(i.h)&&Al(i.s)&&Al(i.v)?(n=lA(i.s),r=lA(i.v),e=d$(i.h,n,r),o=!0,a="hsv"):Al(i.h)&&Al(i.s)&&Al(i.l)&&(n=lA(i.s),s=lA(i.l),e=h$(i.h,n,s),o=!0,a="hsl"),i.hasOwnProperty("a")&&(t=i.a)),t=h5(t),{ok:o,format:i.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}function u$(i,e,t){return{r:Ni(i,255)*255,g:Ni(e,255)*255,b:Ni(t,255)*255}}function qE(i,e,t){i=Ni(i,255),e=Ni(e,255),t=Ni(t,255);var n=Math.max(i,e,t),r=Math.min(i,e,t),s,o,a=(n+r)/2;if(n==r)s=o=0;else{var l=n-r;switch(o=a>.5?l/(2-n-r):l/(n+r),n){case i:s=(e-t)/l+(e<t?6:0);break;case e:s=(t-i)/l+2;break;case t:s=(i-e)/l+4;break}s/=6}return{h:s,s:o,l:a}}function h$(i,e,t){var n,r,s;i=Ni(i,360),e=Ni(e,100),t=Ni(t,100);function o(c,u,p){return p<0&&(p+=1),p>1&&(p-=1),p<1/6?c+(u-c)*6*p:p<1/2?u:p<2/3?c+(u-c)*(2/3-p)*6:c}if(e===0)n=r=s=t;else{var a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;n=o(l,a,i+1/3),r=o(l,a,i),s=o(l,a,i-1/3)}return{r:n*255,g:r*255,b:s*255}}function HE(i,e,t){i=Ni(i,255),e=Ni(e,255),t=Ni(t,255);var n=Math.max(i,e,t),r=Math.min(i,e,t),s,o,a=n,l=n-r;if(o=n===0?0:l/n,n==r)s=0;else{switch(n){case i:s=(e-t)/l+(e<t?6:0);break;case e:s=(t-i)/l+2;break;case t:s=(i-e)/l+4;break}s/=6}return{h:s,s:o,v:a}}function d$(i,e,t){i=Ni(i,360)*6,e=Ni(e,100),t=Ni(t,100);var n=Math.floor(i),r=i-n,s=t*(1-e),o=t*(1-r*e),a=t*(1-(1-r)*e),l=n%6,c=[t,o,s,s,a,t][l],u=[a,t,t,o,s,s][l],p=[s,s,a,t,t,o][l];return{r:c*255,g:u*255,b:p*255}}function WE(i,e,t,n){var r=[ca(Math.round(i).toString(16)),ca(Math.round(e).toString(16)),ca(Math.round(t).toString(16))];return n&&r[0].charAt(0)==r[0].charAt(1)&&r[1].charAt(0)==r[1].charAt(1)&&r[2].charAt(0)==r[2].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function f$(i,e,t,n,r){var s=[ca(Math.round(i).toString(16)),ca(Math.round(e).toString(16)),ca(Math.round(t).toString(16)),ca(d5(n))];return r&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function $E(i,e,t,n){var r=[ca(d5(n)),ca(Math.round(i).toString(16)),ca(Math.round(e).toString(16)),ca(Math.round(t).toString(16))];return r.join("")}Yt.equals=function(i,e){return!i||!e?!1:Yt(i).toRgbString()==Yt(e).toRgbString()};Yt.random=function(){return Yt.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function p$(i,e){e=e===0?0:e||10;var t=Yt(i).toHsl();return t.s-=e/100,t.s=k1(t.s),Yt(t)}function A$(i,e){e=e===0?0:e||10;var t=Yt(i).toHsl();return t.s+=e/100,t.s=k1(t.s),Yt(t)}function m$(i){return Yt(i).desaturate(100)}function g$(i,e){e=e===0?0:e||10;var t=Yt(i).toHsl();return t.l+=e/100,t.l=k1(t.l),Yt(t)}function _$(i,e){e=e===0?0:e||10;var t=Yt(i).toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),Yt(t)}function v$(i,e){e=e===0?0:e||10;var t=Yt(i).toHsl();return t.l-=e/100,t.l=k1(t.l),Yt(t)}function y$(i,e){var t=Yt(i).toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,Yt(t)}function x$(i){var e=Yt(i).toHsl();return e.h=(e.h+180)%360,Yt(e)}function jE(i,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var t=Yt(i).toHsl(),n=[Yt(i)],r=360/e,s=1;s<e;s++)n.push(Yt({h:(t.h+s*r)%360,s:t.s,l:t.l}));return n}function b$(i){var e=Yt(i).toHsl(),t=e.h;return[Yt(i),Yt({h:(t+72)%360,s:e.s,l:e.l}),Yt({h:(t+216)%360,s:e.s,l:e.l})]}function S$(i,e,t){e=e||6,t=t||30;var n=Yt(i).toHsl(),r=360/t,s=[Yt(i)];for(n.h=(n.h-(r*e>>1)+720)%360;--e;)n.h=(n.h+r)%360,s.push(Yt(n));return s}function M$(i,e){e=e||6;for(var t=Yt(i).toHsv(),n=t.h,r=t.s,s=t.v,o=[],a=1/e;e--;)o.push(Yt({h:n,s:r,v:s})),s=(s+a)%1;return o}Yt.mix=function(i,e,t){t=t===0?0:t||50;var n=Yt(i).toRgb(),r=Yt(e).toRgb(),s=t/100,o={r:(r.r-n.r)*s+n.r,g:(r.g-n.g)*s+n.g,b:(r.b-n.b)*s+n.b,a:(r.a-n.a)*s+n.a};return Yt(o)};Yt.readability=function(i,e){var t=Yt(i),n=Yt(e);return(Math.max(t.getLuminance(),n.getLuminance())+.05)/(Math.min(t.getLuminance(),n.getLuminance())+.05)};Yt.isReadable=function(i,e,t){var n=Yt.readability(i,e),r,s;switch(s=!1,r=P$(t),r.level+r.size){case"AAsmall":case"AAAlarge":s=n>=4.5;break;case"AAlarge":s=n>=3;break;case"AAAsmall":s=n>=7;break}return s};Yt.mostReadable=function(i,e,t){var n=null,r=0,s,o,a,l;t=t||{},o=t.includeFallbackColors,a=t.level,l=t.size;
3833for(var c=0;c<e.length;c++)s=Yt.readability(i,e[c]),s>r&&(r=s,n=Yt(e[c]));return Yt.isReadable(i,n,{level:a,size:l})||!o?n:(t.includeFallbackColors=!1,Yt.mostReadable(i,["#fff","#000"],t))};var db=Yt.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
38330",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},w$=Yt.hexNames=T$(db);function T$(i){var e={};for(var t in i)i.hasOwnProperty(t)&&(e[i[t]]=t);return e}function h5(i){return i=parseFloat(i),(isNaN(i)||i<0||i>1)&&(i=1),i}function Ni(i,e){E$(i)&&(i="100%");var t=R$(i);return i=Math.min(e,Math.max(0,parseFloat(i))),t&&(i=parseInt(i*e,10)/100),Math.abs(i-e)<1e-6?1:i%e/parseFloat(e)}function k1(i){return Math.min(1,Math.max(0,i))}function uo(i){return parseInt(i,16)}function E$(i){return typeof i=="string"&&i.indexOf(".")!=-1&&parseFloat(i)===1}function R$(i){return typeof i=="string"&&i.indexOf("%")!=-1}function ca(i){return i.length==1?"0"+i:""+i}function lA(i){return i<=1&&(i=i*100+"%"),i}function d5(i){return Math.round(parseFloat(i)*255).toString(16)}function XE(i){return uo(i)/255}var ia=function(){var i="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+i+")",n="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"
3833+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Al(i){return!!ia.CSS_UNIT.exec(i)}function C$(i){i=i.replace(a$,"").replace(l$,"").toLowerCase();var e=!1;if(db[i])i=db[i],e=!0;else if(i=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=ia.rgb.exec(i))?{r:t[1],g:t[2],b:t[3]}:(t=ia.rgba.exec(i))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=ia.hsl.exec(i))?{h:t[1],s:t[2],l:t[3]}:(t=ia.hsla.exec(i))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=ia.hsv.exec(i))?{h:t[1],s:t[2],v:t[3]}:(t=ia.hsva.exec(i))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=ia.hex8.exec(i))?{r:uo(t[1]),g:uo(t[2]),b:uo(t[3]),a:XE(t[4]),format:e?"name":"hex8"}:(t=ia.hex6.exec(i))?{r:uo(t[1]),g:uo(t[2]),b:uo(t[3]),format:e?"name":"hex"}:(t=ia.hex4.exec(i))?{r:uo(t[1]+""+t[1]),g:uo(t[2]+""+t[2]),b:uo(t[3]+""+t[3]),a:XE(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=ia.hex3.exec(i))?{r:uo(t[1]+""+t[1]),g:uo(t[2]+""+t[2]),b:uo(t[3]+""+t[3]),format:e?"name":"hex"}:!1}function P$(i){var e,t;return i=i||{level:"AA",size:"small"},e=(i.level||"AA").toUpperCase(),t=(i.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}function fb(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}function L$(i){if(Array.isArray(i))return i}function N$(i){if(Array.isArray(i))return fb(i)}function f5(i,e,t){if(typeof i=="function"?i===e:i.has(e))return arguments.length<3?e:t;throw new TypeError("Private element is not present on this object")}function D$(i,e){if(e.has(i))throw new TypeError("Cannot initialize the same private elements twice on an object")}function I$(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function is(i,e){return i.get(f5(i,e))}function qh(i,e,t){D$(i,e),e.set(i,t)}function jm(i,e,t){return i.set(f5(i,e),t),t}function B$(i,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,H$(n.key),n)}}function F$(i,e,t){return e&&B$(i.prototype,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function U$(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function O$(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,r,s,o,a=[],l=!0,c=!1;try{if(s=(t=t.call(i)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,r=u}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}function k$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3834In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z$(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3835In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V$(i,e){return L$(i)||O$(i,e)||p5(i,e)||k$()}function G$(i){return N$(i)||U$(i)||p5(i)||z$()}function q$(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}function H$(i){var e=q$(i,"string");return typeof e=="symbol"?e:e+""}function p5(i,e){if(i){if(typeof i=="string")return fb(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?fb(i,e):void 0}}var Hh=new WeakMap,Tp=new WeakMap,Wh=new WeakMap,qy=new WeakMap,Hy=new WeakMap,Wy=new WeakMap,W$=function(){function i(){I$(this,i),qh(this,Hh,new Map),qh(this,Tp,new Map),qh(this,Wh,function(e){return e}),qh(this,qy,function(){return{}}),qh(this,Hy,function(){}),qh(this,Wy,function(){})}return F$(i,[{key:"getObj",value:function(t){return is(Hh,this).get(is(Wh,this).call(this,t))}},{key:"getData",value:function(t){return is(Tp,this).get(t)}},{key:"entries",value:function(){return G$(is(Tp,this).entries()).map(function(t){var n=V$(t,2),r=n[0],s=n[1];return[s,r]})}},{key:"id",value:function(t){return jm(Wh,this,At(t)),this}},{key:"onCreateObj",value:function(t){return jm(qy,this,t),this}}
3835,{key:"onUpdateObj",value:function(t){return jm(Hy,this,t),this}},{key:"onRemoveObj",value:function(t){return jm(Wy,this,t),this}},{key:"digest",value:function(t){var n=this;t.filter(function(s){return!is(Hh,n).has(is(Wh,n).call(n,s))}).forEach(function(s){var o=is(qy,n).call(n,s);is(Hh,n).set(is(Wh,n).call(n,s),o),is(Tp,n).set(o,s)});var r=new Map(t.map(function(s){return[is(Wh,n).call(n,s),s]}));return is(Hh,this).forEach(function(s,o){r.has(o)?is(Hy,n).call(n,s,r.get(o)):(is(Wy,n).call(n,s,o),is(Hh,n).delete(o),is(Tp,n).delete(s))}),this}},{key:"clear",value:function(){return this.digest([]),this}}])}(),f_={exports:{}},$$=f_.exports,YE;function j$(){return YE||(YE=1,function(i,e){(function(t,n){i.exports=n()})($$,function(){return function(t){function n(s){if(r[s])return r[s].exports;var o=r[s]={exports:{},id:s,loaded:!1};return t[s].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){var s=r(1),o=function(){function a(l,c,u){l===void 0&&(l=NaN),c===void 0&&(c=NaN),u===void 0&&(u=!1),this._minFPS=c,this._maxFPS=l,this._timeScale=1,this._currentTick=0,this._currentTime=0,this._tickDeltaTime=0,this._isRunning=!1,this._maxInterval=isNaN(this._minFPS)?NaN:1e3/this._minFPS,this._minInterval=isNaN(this._maxFPS)?NaN:1e3/this._maxFPS,this._onResume=new s.default,this._onPause=new s.default,this._onTick=new s.default,this._onTickOncePerFrame=new s.default,u||this.resume()}return a.prototype.updateOnce=function(l){l(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},a.prototype.resume=function(){this._isRunning||(this._isRunning=!0,this._lastTimeUpdated=this.getTimer(),this._onResume.dispatch(),this.animateOnce())},a.prototype.pause=function(){this._isRunning&&(this._isRunning=!1,this._onPause.dispatch(),window.cancelAnimationFrame(this._animationFrameHandle))},a.prototype.dispose=function(){this.pause(),this._onResume.removeAll(),this._onPause.removeAll(),this._onTick.removeAll()},Object.defineProperty(a.prototype,"currentTick",{get:function(){return this._currentTick},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"currentTimeSeconds",{get:function(){return this._currentTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"tickDeltaTimeSeconds",{get:function(){return this._tickDeltaTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"timeScale",{get:function(){return this._timeScale},set:function(l){this._timeScale!==l&&(this._timeScale=l)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onResume",{get:function(){return this._onResume},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onPause",{get:function(){return this._onPause},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onTick",{get:function(){return this._onTick},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onTickOncePerFrame",{get:function(){return this._onTickOncePerFrame},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"isRunning",{get:function(){return this._isRunning},enumerable:!0,configurable:!0}),a.prototype.animateOnce=function(){var l=this;this._animationFrameHandle=window.requestAnimationFrame(function(){return l.onFrame()})},a.prototype.onFrame=function(){if(this._now=this.getTimer(),this._frameDeltaTime=this._now-this._lastTimeUpdated,isNaN(this._minInterval)||this._frameDeltaTime>=this._minInterval)if(isNaN(this._maxInterval))this.update(this._frameDeltaTime*this._timeScale,!0),this._lastTimeUpdated=this._now;else for(this._interval=Math.min(this._frameDeltaTime,this._maxInterval);this._now>=this._lastTimeUpdated+this._interval;)this.update(this._interval*this._timeScale,this._now<=this._lastTimeUpdated+2*this._maxInterval),this._lastTimeUpdated+=this._interval;this._isRunning&&this.animateOnce()},a.prototype.update=function(l,c){c===void 0&&(c=!0),this._currentTick++,this._currentTime+=l,this._tickDeltaTime=l,this._onTick.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick),c&&this._onTickOncePerFrame.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},a.prototype.getTimer=function(){return Date.now()},a}();Object.defineProperty(n,"__esModule",{value:!0}),n.default=o},function(t,n,r){(function(s,o){t.exports=o()})(this,function(){return function(s){function o(l){if(a[l])return a[l].exports;var c=a[l]={exports:{},id:l,loaded:!1};return s[l].call(c.exports,c,c.exports,o),c.loaded=!0,c.exports}var a={};return o.m=s,o.c=a,o.p="",o(0)}([function(s,o){var a=function(){function l(){this.functions=[]}return l.prototype.add=function(c){return this.functions.indexOf(c)===-1&&(this.functions.push(c),!0)},l.prototype.remove=function(c){var u=this.functions.indexOf(c);return u>-1&&(this.functions.splice(u,1),!0)},l.prototype.removeAll=function(){return this.functions.length>0&&(this.functions.length=0,!0)},l.prototype.dispatch=function(){for(var c=[],u=0;u<arguments.length;u++)c[u]=arguments[u];var p=this.functions.concat();p.forEach(function(m){m.apply(void 0,c)})},Object.defineProperty(l.prototype,"numItems",{get:function(){return this.functions.length},enumerable:!0,configurable:!0}),l}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=a}])})}])})}(f_)),f_.exports}var X$=j$();const Ef=gU(X$),Il=11102230246251565e-32,rs=134217729,Y$=(3+8*Il)*Il;function $y(i,e,t,n,r){let s,o,a,l,c=e[0],u=n[0],p=0,m=0;u>c==u>-c?(s=c,c=e[++p]):(s=u,u=n[++m]);let g=0;if(p<i&&m<t)for(u>c==u>-c?(o=c+s,a=s-(o-c),c=e[++p]):(o=u+s,a=s-(o-u),u=n[++m]),s=o,a!==0&&(r[g++]=a);p<i&&m<t;)u>c==u>-c?(o=s+c,l=o-s,a=s-(o-l)+(c-l),c=e[++p]):(o=s+u,l=o-s,a=s-(o-l)+(u-l),u=n[++m]),s=o,a!==0&&(r[g++]=a);for(;p<i;)o=s+c,l=o-s,a=s-(o-l)+(c-l),c=e[++p],s=o,a!==0&&(r[g++]=a);for(;m<t;)o=s+u,l=o-s,a=s-(o-l)+(u-l),u=n[++m],s=o,a!==0&&(r[g++]=a);return(s!==0||g===0)&&(r[g++]=s),g}function Q$(i,e){let t=e[0];for(let n=1;n<i;n++)t+=e[n];return t}function D0(i){return new Float64Array(i)}const Z$=(3+16*Il)*Il,K$=(2+12*Il)*Il,J$=(9+64*Il)*Il*Il,$h=D0(4),QE=D0(8),ZE=D0(12),KE=D0(16),gs=D0(4);function ej(i,e,t,n,r,s,o){let a,l,c,u,p,m,g,v,b,M,x,w,R,C,N,D,P,O;const I=i-r,F=t-r,k=e-s,Y=n-s;C=I*Y,m=rs*I,g=m-(m-I),v=I-g,m=rs*Y,b=m-(m-Y),M=Y-b,N=v*M-(C-g*b-v*b-g*M),D=k*F,m=rs*k,g=m-(m-k),v=k-g,m=rs*F,b=m-(m-F),M=F-b,P=v*M-(D-g*b-v*b-g*M),x=N-P,p=N-x,$h[0]=N-(x+p)+(p-P),w=C+x,p=w-C,R=C-(w-p)+(x-p),x=R-D,p=R-x,$h[1]=R-(x+p)+(p-D),O=w+x,p=O-w,$h[2]=w-(O-p)+(x-p),$h[3]=O;let W=Q$(4,$h),Q=K$*o;if(W>=Q||-W>=Q||(p=i-I,a=i-(I+p)+(p-r),p=t-F,c=t-(F+p)+(p-r),p=e-k,l=e-(k+p)+(p-s),p=n-Y,u=n-(Y+p)+(p-s),a===0&&l===0&&c===0&&u===0)||(Q=J$*o+Y$*Math.abs(W),W+=I*u+Y*a-(k*c+F*l),W>=Q||-W>=Q))return W;C=a*Y,m=rs*a,g=m-(m-a),v=a-g,m=rs*Y,b=m-(m-Y),M=Y-b,N=v*M-(C-g*b-v*b-g*M),D=l*F,m=rs*l,g=m-(m-l),v=l-g,m=rs*F,b=m-(m-F),M=F-b,P=v*M-(D-g*b-v*b-g*M),x=N-P,p=N-x,gs[0]=N-(x+p)+(p-P),w=C+x,p=w-C,R=C-(w-p)+(x-p),x=R-D,p=R-x,gs[1]=R-(x+p)+(p-D),O=w+x,p=O-w,gs[2]=w-(O-p)+(x-p),gs[3]=O;const J=$y(4,$h,4,gs,QE);C=I*u,m=rs*I,g=m-(m-I),v=I-g,m=rs*u,b=m-(m-u),M=u-b,N=v*M-(C-g*b-v*b-g*M),D=k*c,m=rs*k,g=m-(m-k),v=k-g,m=rs*c,b=m-(m-c),M=c-b,P=v*M-(D-g*b-v*b-g*M),x=N-P,p=N-x,gs[0]=N-(x+p)+(p-P),w=C+x,p=w-C,R=C-(w-p)+(x-p),x=R-D,p=R-x,gs[1]=R-(x+p)+(p-D),O=w+x,p=O-w,gs[2]=w-(O-p)+(x-p),gs[3]=O;const H=$y(J,QE,4,gs,ZE);C=a*u,m=rs*a,g=m-(m-a),v=a-g,m=rs*u,b=m-(m-u),M=u-b,N=v*M-(C-g*b-v*b-g*M),D=l*c,m=rs*l,g=m-(m-l),v=l-g,m=rs*c,b=m-(m-c),M=c-b,P=v*M-(D-g*b-v*b-g*M),x=N-P,p=N-x,gs[0]=N-(x+p)+(p-P),w=C+x,p=w-C,R=C-(w-p)+(x-p),x=R-D,p=R-x,gs[1]=R-(x+p)+(p-D),O=w+x,p=O-w,gs[2]=w-(O-p)+(x-p),gs[3]=O;const $=$y(H,ZE,4,gs,KE);return KE[$-1]}
vendor: 4,361 bytes, line 3835
3835function cA(i,e,t,n,r,s){const o=(e-s)*(t-r),a=(i-r)*(n-s),l=o-a,c=Math.abs(o+a);return Math.abs(l)>=Z$*c?l:-ej(i,e,t,n,r,s,c)}const JE=Math.pow(2,-52),Xm=new Uint32Array(512);class n0{static from(e,t=sj,n=oj){const r=e.length,s=new Float64Array(r*2);for(let o=0;o<r;o++){const a=e[o];s[2*o]=t(a),s[2*o+1]=n(a)}return new n0(s)}constructor(e){const t=e.length>>1;if(t>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;const n=Math.max(2*t-5,0);this._triangles=new Uint32Array(n*3),this._halfedges=new Int32Array(n*3),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:n,_hullTri:r,_hullHash:s}=this,o=e.length>>1;let a=1/0,l=1/0,c=-1/0,u=-1/0;for(let I=0;I<o;I++){const F=e[2*I],k=e[2*I+1];F<a&&(a=F),k<l&&(l=k),F>c&&(c=F),k>u&&(u=k),this._ids[I]=I}const p=(a+c)/2,m=(l+u)/2;let g,v,b;for(let I=0,F=1/0;I<o;I++){const k=jy(p,m,e[2*I],e[2*I+1]);k<F&&(g=I,F=k)}const M=e[2*g],x=e[2*g+1];for(let I=0,F=1/0;I<o;I++){if(I===g)continue;const k=jy(M,x,e[2*I],e[2*I+1]);k<F&&k>0&&(v=I,F=k)}let w=e[2*v],R=e[2*v+1],C=1/0;for(let I=0;I<o;I++){if(I===g||I===v)continue;const F=ij(M,x,w,R,e[2*I],e[2*I+1]);F<C&&(b=I,C=F)}let N=e[2*b],D=e[2*b+1];if(C===1/0){for(let k=0;k<o;k++)this._dists[k]=e[2*k]-e[0]||e[2*k+1]-e[1];Dd(this._ids,this._dists,0,o-1);const I=new Uint32Array(o);let F=0;for(let k=0,Y=-1/0;k<o;k++){const W=this._ids[k],Q=this._dists[W];Q>Y&&(I[F++]=W,Y=Q)}this.hull=I.subarray(0,F),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(cA(M,x,w,R,N,D)<0){const I=v,F=w,k=R;v=b,w=N,R=D,b=I,N=F,D=k}const P=rj(M,x,w,R,N,D);this._cx=P.x,this._cy=P.y;for(let I=0;I<o;I++)this._dists[I]=jy(e[2*I],e[2*I+1],P.x,P.y);Dd(this._ids,this._dists,0,o-1),this._hullStart=g;let O=3;n[g]=t[b]=v,n[v]=t[g]=b,n[b]=t[v]=g,r[g]=0,r[v]=1,r[b]=2,s.fill(-1),s[this._hashKey(M,x)]=g,s[this._hashKey(w,R)]=v,s[this._hashKey(N,D)]=b,this.trianglesLen=0,this._addTriangle(g,v,b,-1,-1,-1);for(let I=0,F,k;I<this._ids.length;I++){const Y=this._ids[I],W=e[2*Y],Q=e[2*Y+1];if(I>0&&Math.abs(W-F)<=JE&&Math.abs(Q-k)<=JE||(F=W,k=Q,Y===g||Y===v||Y===b))continue;let J=0;for(let ie=0,de=this._hashKey(W,Q);ie<this._hashSize&&(J=s[(de+ie)%this._hashSize],!(J!==-1&&J!==n[J]));ie++);J=t[J];let H=J,$;for(;$=n[H],cA(W,Q,e[2*H],e[2*H+1],e[2*$],e[2*$+1])>=0;)if(H=$,H===J){H=-1;break}if(H===-1)continue;let K=this._addTriangle(H,Y,n[H],-1,-1,r[H]);r[Y]=this._legalize(K+2),r[H]=K,O++;let he=n[H];for(;$=n[he],cA(W,Q,e[2*he],e[2*he+1],e[2*$],e[2*$+1])<0;)K=this._addTriangle(he,Y,$,r[Y],-1,r[he]),r[Y]=this._legalize(K+2),n[he]=he,O--,he=$;if(H===J)for(;$=t[H],cA(W,Q,e[2*$],e[2*$+1],e[2*H],e[2*H+1])<0;)K=this._addTriangle($,Y,H,-1,r[H],r[$]),this._legalize(K+2),r[$]=K,n[H]=H,O--,H=$;this._hullStart=t[Y]=H,n[H]=t[he]=Y,n[Y]=he,s[this._hashKey(W,Q)]=Y,s[this._hashKey(e[2*H],e[2*H+1])]=H}this.hull=new Uint32Array(O);for(let I=0,F=this._hullStart;I<O;I++)this.hull[I]=F,F=n[F];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,t){return Math.floor(tj(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:n,coords:r}=this;let s=0,o=0;for(;;){const a=n[e],l=e-e%3;if(o=l+(e+2)%3,a===-1){if(s===0)break;e=Xm[--s];continue}const c=a-a%3,u=l+(e+1)%3,p=c+(a+2)%3,m=t[o],g=t[e],v=t[u],b=t[p];if(nj(r[2*m],r[2*m+1],r[2*g],r[2*g+1],r[2*v],r[2*v+1],r[2*b],r[2*b+1])){t[e]=b,t[a]=m;const x=n[p];if(x===-1){let R=this._hullStart;do{if(this._hullTri[R]===p){this._hullTri[R]=e;break}R=this._hullPrev[R]}while(R!==this._hullStart)}this._link(e,x),this._link(a,n[o]),this._link(o,p);const w=c+(a+1)%3;s<Xm.length&&(Xm[s++]=w)}else{if(s===0)break;e=Xm[--s]}}return o}_link(e,t){this._halfedges[e]=t,t!==-1&&(this._halfedges[t]=e)}_addTriangle(e,t,n,r,s,o){const a=this.trianglesLen;return this._triangles[a]=e,this._triangles[a+1]=t,this._triangles[a+2]=n,this._link(a,r),this._link(a+1,s),this._link(a+2,o),this.trianglesLen+=3,a}}function tj(i,e){const t=i/(Math.abs(i)+Math.abs(e));return(e>0?3-t:1+t)/4}function jy(i,e,t,n){const r=i-t,s=e-n;return r*r+s*s}
3835function nj(i,e,t,n,r,s,o,a){const l=i-o,c=e-a,u=t-o,p=n-a,m=r-o,g=s-a,v=l*l+c*c,b=u*u+p*p,M=m*m+g*g;return l*(p*M-b*g)-c*(u*M-b*m)+v*(u*g-p*m)<0}function ij(i,e,t,n,r,s){const o=t-i,a=n-e,l=r-i,c=s-e,u=o*o+a*a,p=l*l+c*c,m=.5/(o*c-a*l),g=(c*u-a*p)*m,v=(o*p-l*u)*m;return g*g+v*v}function rj(i,e,t,n,r,s){const o=t-i,a=n-e,l=r-i,c=s-e,u=o*o+a*a,p=l*l+c*c,m=.5/(o*c-a*l),g=i+(c*u-a*p)*m,v=e+(o*p-l*u)*m;return{x:g,y:v}}function Dd(i,e,t,n){if(n-t<=20)for(let r=t+1;r<=n;r++){const s=i[r],o=e[s];let a=r-1;for(;a>=t&&e[i[a]]>o;)i[a+1]=i[a--];i[a+1]=s}else{const r=t+n>>1;let s=t+1,o=n;Ep(i,r,s),e[i[t]]>e[i[n]]&&Ep(i,t,n),e[i[s]]>e[i[n]]&&Ep(i,s,n),e[i[t]]>e[i[s]]&&Ep(i,t,s);const a=i[s],l=e[a];for(;;){do s++;while(e[i[s]]<l);do o--;while(e[i[o]]>l);if(o<s)break;Ep(i,s,o)}i[t+1]=i[o],i[o]=a,n-s+1>=o-t?(Dd(i,e,s,n),Dd(i,e,t,o-1)):(Dd(i,e,t,o-1),Dd(i,e,s,n))}}function Ep(i,e,t){const n=i[e];i[e]=i[t],i[t]=n}function sj(i){return i[0]}function oj(i){return i[1]}function aj(i,e){var t,n,r=0,s,o,a,l,c,u,p,m=i[0],g=i[1],v=e.length;for(t=0;t<v;t++){n=0;var b=e[t],M=b.length-1;if(u=b[0],u[0]!==b[M][0]&&u[1]!==b[M][1])throw new Error("First and last coordinates in a ring must be the same");for(o=u[0]-m,a=u[1]-g,n;n<M;n++){if(p=b[n+1],l=p[0]-m,c=p[1]-g,a===0&&c===0){if(l<=0&&o>=0||o<=0&&l>=0)return 0}else if(c>=0&&a<=0||c<=0&&a>=0){if(s=cA(o,l,a,c,0,0),s===0)return 0;(s>0&&c>0&&a<=0||s<0&&c<=0&&a>0)&&r++}u=p,a=c,o=l}}return r%2!==0}
vendor: 11,122 bytes, line 3835
3835function lj(i){if(!i)throw new Error("coord is required");if(!Array.isArray(i)){if(i.type==="Feature"&&i.geometry!==null&&i.geometry.type==="Point")return[...i.geometry.coordinates];if(i.type==="Point")return[...i.coordinates]}if(Array.isArray(i)&&i.length>=2&&!Array.isArray(i[0])&&!Array.isArray(i[1]))return[...i];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function cj(i){return i.type==="Feature"?i.geometry:i}function uj(i,e,t={}){if(!i)throw new Error("point is required");if(!e)throw new Error("polygon is required");const n=lj(i),r=cj(e),s=r.type,o=e.bbox;let a=r.coordinates;if(o&&hj(n,o)===!1)return!1;s==="Polygon"&&(a=[a]);let l=!1;for(var c=0;c<a.length;++c){const u=aj(n,a[c]);if(u===0)return!t.ignoreBoundary;u&&(l=!0)}return l}function hj(i,e){return e[0]<=i[0]&&e[1]<=i[1]&&e[2]>=i[0]&&e[3]>=i[1]}var dj=uj;const eR=1e-6;let ku=class{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,n){e=+e,t=+t,n=+n;const r=e+n,s=t;if(n<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${s}`:(Math.abs(this._x1-r)>eR||Math.abs(this._y1-s)>eR)&&(this._+="L"+r+","+s),n&&(this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=r},${this._y1=s}`)}rect(e,t,n,r){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+r}h${-n}Z`}value(){return this._||null}};class pb{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}}class fj{constructor(e,[t,n,r,s]=[0,0,960,500]){if(!((r=+r)>=(t=+t))||!((s=+s)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=r,this.xmin=t,this.ymax=s,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:t,triangles:n},vectors:r}=this;let s,o;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let b=0,M=0,x=n.length,w,R;b<x;b+=3,M+=2){const C=n[b]*2,N=n[b+1]*2,D=n[b+2]*2,P=e[C],O=e[C+1],I=e[N],F=e[N+1],k=e[D],Y=e[D+1],W=I-P,Q=F-O,J=k-P,H=Y-O,$=(W*H-Q*J)*2;if(Math.abs($)<1e-9){if(s===void 0){s=o=0;for(const he of t)s+=e[he*2],o+=e[he*2+1];s/=t.length,o/=t.length}const K=1e9*Math.sign((s-P)*H-(o-O)*J);w=(P+k)/2-K*H,R=(O+Y)/2+K*J}else{const K=1/$,he=W*W+Q*Q,ie=J*J+H*H;w=P+(H*he-Q*ie)*K,R=O+(W*ie-J*he)*K}a[M]=w,a[M+1]=R}let l=t[t.length-1],c,u=l*4,p,m=e[2*l],g,v=e[2*l+1];r.fill(0);for(let b=0;b<t.length;++b)l=t[b],c=u,p=m,g=v,u=l*4,m=e[2*l],v=e[2*l+1],r[c+2]=r[u]=g-v,r[c+3]=r[u+1]=m-p}render(e){const t=e==null?e=new ku:void 0,{delaunay:{halfedges:n,inedges:r,hull:s},circumcenters:o,vectors:a}=this;if(s.length<=1)return null;for(let u=0,p=n.length;u<p;++u){const m=n[u];if(m<u)continue;const g=Math.floor(u/3)*2,v=Math.floor(m/3)*2,b=o[g],M=o[g+1],x=o[v],w=o[v+1];this._renderSegment(b,M,x,w,e)}let l,c=s[s.length-1];for(let u=0;u<s.length;++u){l=c,c=s[u];const p=Math.floor(r[c]/3)*2,m=o[p],g=o[p+1],v=l*4,b=this._project(m,g,a[v+2],a[v+3]);b&&this._renderSegment(m,g,b[0],b[1],e)}return t&&t.value()}renderBounds(e){const t=e==null?e=new ku:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),t&&t.value()}renderCell(e,t){const n=t==null?t=new ku:void 0,r=this._clip(e);if(r===null||!r.length)return;t.moveTo(r[0],r[1]);let s=r.length;for(;r[0]===r[s-2]&&r[1]===r[s-1]&&s>1;)s-=2;for(let o=2;o<s;o+=2)(r[o]!==r[o-2]||r[o+1]!==r[o-1])&&t.lineTo(r[o],r[o+1]);return t.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:e}}=this;for(let t=0,n=e.length/2;t<n;++t){const r=this.cellPolygon(t);r&&(r.index=t,yield r)}}cellPolygon(e){const t=new pb;return this.renderCell(e,t),t.value()}_renderSegment(e,t,n,r,s){let o;const a=this._regioncode(e,t),l=this._regioncode(n,r);a===0&&l===0?(s.moveTo(e,t),s.lineTo(n,r)):(o=this._clipSegment(e,t,n,r,a,l))&&(s.moveTo(o[0],o[1]),s.lineTo(o[2],o[3]))}contains(e,t,n){return t=+t,t!==t||(n=+n,n!==n)?!1:this.delaunay._step(e,t,n)===e}*neighbors(e){const t=this._clip(e);if(t)for(const n of this.delaunay.neighbors(e)){const r=this._clip(n);if(r){e:for(let s=0,o=t.length;s<o;s+=2)for(let a=0,l=r.length;a<l;a+=2)if(t[s]===r[a]&&t[s+1]===r[a+1]&&t[(s+2)%o]===r[(a+l-2)%l]&&t[(s+3)%o]===r[(a+l-1)%l]){yield n;break e}}}}_cell(e){const{circumcenters:t,delaunay:{inedges:n,halfedges:r,triangles:s}}=this,o=n[e];if(o===-1)return null;const a=[];let l=o;do{const c=Math.floor(l/3);if(a.push(t[c*2],t[c*2+1]),l=l%3===2?l-2:l+1,s[l]!==e)break;l=r[l]}while(l!==o&&l!==-1);return a}_clip(e){if(e===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const t=this._cell(e);if(t===null)return null;const{vectors:n}=this,r=e*4;return this._simplify(n[r]||n[r+1]?this._clipInfinite(e,t,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(e,t))}_clipFinite(e,t){const n=t.length;let r=null,s,o,a=t[n-2],l=t[n-1],c,u=this._regioncode(a,l),p,m=0;for(let g=0;g<n;g+=2)if(s=a,o=l,a=t[g],l=t[g+1],c=u,u=this._regioncode(a,l),c===0&&u===0)p=m,m=0,r?r.push(a,l):r=[a,l];else{let v,b,M,x,w;if(c===0){if((v=this._clipSegment(s,o,a,l,c,u))===null)continue;[b,M,x,w]=v}else{if((v=this._clipSegment(a,l,s,o,u,c))===null)continue;[x,w,b,M]=v,p=m,m=this._edgecode(b,M),p&&m&&this._edge(e,p,m,r,r.length),r?r.push(b,M):r=[b,M]}p=m,m=this._edgecode(x,w),p&&m&&this._edge(e,p,m,r,r.length),r?r.push(x,w):r=[x,w]}if(r)p=m,m=this._edgecode(r[0],r[1]),p&&m&&this._edge(e,p,m,r,r.length);else if(this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return r}_clipSegment(e,t,n,r,s,o){const a=s<o;for(a&&([e,t,n,r,s,o]=[n,r,e,t,o,s]);;){if(s===0&&o===0)return a?[n,r,e,t]:[e,t,n,r];if(s&o)return null;let l,c,u=s||o;u&8?(l=e+(n-e)*(this.ymax-t)/(r-t),c=this.ymax):u&4?(l=e+(n-e)*(this.ymin-t)/(r-t),c=this.ymin):u&2?(c=t+(r-t)*(this.xmax-e)/(n-e),l=this.xmax):(c=t+(r-t)*(this.xmin-e)/(n-e),l=this.xmin),s?(e=l,t=c,s=this._regioncode(e,t)):(n=l,r=c,o=this._regioncode(n,r))}}_clipInfinite(e,t,n,r,s,o){let a=Array.from(t),l;if((l=this._project(a[0],a[1],n,r))&&a.unshift(l[0],l[1]),(l=this._project(a[a.length-2],a[a.length-1],s,o))&&a.push(l[0],l[1]),a=this._clipFinite(e,a))for(let c=0,u=a.length,p,m=this._edgecode(a[u-2],a[u-1]);c<u;c+=2)p=m,m=this._edgecode(a[c],a[c+1]),p&&m&&(c=this._edge(e,p,m,a,c),u=a.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(e,t,n,r,s){for(;t!==n;){let o,a;switch(t){case 5:t=4;continue;case 4:t=6,o=this.xmax,a=this.ymin;break;case 6:t=2;continue;case 2:t=10,o=this.xmax,a=this.ymax;break;case 10:t=8;continue;case 8:t=9,o=this.xmin,a=this.ymax;break;case 9:t=1;continue;case 1:t=5,o=this.xmin,a=this.ymin;break}(r[s]!==o||r[s+1]!==a)&&this.contains(e,o,a)&&(r.splice(s,0,o,a),s+=2)}return s}_project(e,t,n,r){let s=1/0,o,a,l;if(r<0){if(t<=this.ymin)return null;(o=(this.ymin-t)/r)<s&&(l=this.ymin,a=e+(s=o)*n)}else if(r>0){if(t>=this.ymax)return null;(o=(this.ymax-t)/r)<s&&(l=this.ymax,a=e+(s=o)*n)}if(n>0){if(e>=this.xmax)return null;(o=(this.xmax-e)/n)<s&&(a=this.xmax,l=t+(s=o)*r)}else if(n<0){if(e<=this.xmin)return null;(o=(this.xmin-e)/n)<s&&(a=this.xmin,l=t+(s=o)*r)}return[a,l]}_edgecode(e,t){return(e===this.xmin?1:e===this.xmax?2:0)|(t===this.ymin?4:t===this.ymax?8:0)}_regioncode(e,t){return(e<this.xmin?1:e>this.xmax?2:0)|(t<this.ymin?4:t>this.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let t=0;t<e.length;t+=2){const n=(t+2)%e.length,r=(t+4)%e.length;(e[t]===e[n]&&e[n]===e[r]||e[t+1]===e[n+1]&&e[n+1]===e[r+1])&&(e.splice(n,2),t-=2)}e.length||(e=null)}return e}}const pj=2*Math.PI,jh=Math.pow;function Aj(i){return i[0]}function mj(i){return i[1]}function gj(i){const{triangles:e,coords:t}=i;for(let n=0;n<e.length;n+=3){const r=2*e[n],s=2*e[n+1],o=2*e[n+2];if((t[o]-t[r])*(t[s+1]-t[r+1])-(t[s]-t[r])*(t[o+1]-t[r+1])>1e-10)return!1}return!0}function _j(i,e,t){return[i+Math.sin(i+e)*t,e+Math.cos(i-e)*t]}class oM{static from(e,t=Aj,n=mj,r){return new oM("length"in e?vj(e,t,n,r):Float64Array.from(yj(e,t,n,r)))}constructor(e){this._delaunator=new n0(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,t=this.points;if(e.hull&&e.hull.length>2&&gj(e)){this.collinear=Int32Array.from({length:t.length/2},(m,g)=>g).sort((m,g)=>t[2*m]-t[2*g]||t[2*m+1]-t[2*g+1]);const l=this.collinear[0],c=this.collinear[this.collinear.length-1],u=[t[2*l],t[2*l+1],t[2*c],t[2*c+1]],p=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let m=0,g=t.length/2;m<g;++m){const v=_j(t[2*m],t[2*m+1],p);t[2*m]=v[0],t[2*m+1]=v[1]}this._delaunator=new n0(t)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,s=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let l=0,c=n.length;l<c;++l){const u=s[l%3===2?l-2:l+1];(n[l]===-1||o[u]===-1)&&(o[u]=l)}for(let l=0,c=r.length;l<c;++l)a[r[l]]=l;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,r.length===2&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(e){return new fj(this,e)}*neighbors(e){const{inedges:t,hull:n,_hullIndex:r,halfedges:s,triangles:o,collinear:a}=this;if(a){const p=a.indexOf(e);p>0&&(yield a[p-1]),p<a.length-1&&(yield a[p+1]);return}const l=t[e];if(l===-1)return;let c=l,u=-1;do{if(yield u=o[c],c=c%3===2?c-2:c+1,o[c]!==e)return;if(c=s[c],c===-1){const p=n[(r[e]+1)%n.length];p!==u&&(yield p);return}}while(c!==l)}find(e,t,n=0){if(e=+e,e!==e||(t=+t,t!==t))return-1;const r=n;let s;for(;(s=this._step(n,e,t))>=0&&s!==n&&s!==r;)n=s;return s}_step(e,t,n){const{inedges:r,hull:s,_hullIndex:o,halfedges:a,triangles:l,points:c}=this;if(r[e]===-1||!c.length)return(e+1)%(c.length>>1);let u=e,p=jh(t-c[e*2],2)+jh(n-c[e*2+1],2);const m=r[e];let g=m;do{let v=l[g];const b=jh(t-c[v*2],2)+jh(n-c[v*2+1],2);if(b<p&&(p=b,u=v),g=g%3===2?g-2:g+1,l[g]!==e)break;if(g=a[g],g===-1){if(g=s[(o[e]+1)%s.length],g!==v&&jh(t-c[g*2],2)+jh(n-c[g*2+1],2)<p)return g;break}}while(g!==m);return u}render(e){const t=e==null?e=new ku:void 0,{points:n,halfedges:r,triangles:s}=this;for(let o=0,a=r.length;o<a;++o){const l=r[o];if(l<o)continue;const c=s[o]*2,u=s[l]*2;e.moveTo(n[c],n[c+1]),e.lineTo(n[u],n[u+1])}return this.renderHull(e),t&&t.value()}renderPoints(e,t){t===void 0&&(!e||typeof e.moveTo!="function")&&(t=e,e=null),t=t==null?2:+t;const n=e==null?e=new ku:void 0,{points:r}=this;for(let s=0,o=r.length;s<o;s+=2){const a=r[s],l=r[s+1];e.moveTo(a+t,l),e.arc(a,l,t,0,pj)}
3835return n&&n.value()}renderHull(e){const t=e==null?e=new ku:void 0,{hull:n,points:r}=this,s=n[0]*2,o=n.length;e.moveTo(r[s],r[s+1]);for(let a=1;a<o;++a){const l=2*n[a];e.lineTo(r[l],r[l+1])}return e.closePath(),t&&t.value()}hullPolygon(){const e=new pb;return this.renderHull(e),e.value()}renderTriangle(e,t){const n=t==null?t=new ku:void 0,{points:r,triangles:s}=this,o=s[e*=3]*2,a=s[e+1]*2,l=s[e+2]*2;return t.moveTo(r[o],r[o+1]),t.lineTo(r[a],r[a+1]),t.lineTo(r[l],r[l+1]),t.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:e}=this;for(let t=0,n=e.length/3;t<n;++t)yield this.trianglePolygon(t)}trianglePolygon(e){const t=new pb;return this.renderTriangle(e,t),t.value()}}function vj(i,e,t,n){const r=i.length,s=new Float64Array(r*2);for(let o=0;o<r;++o){const a=i[o];s[o*2]=e.call(n,a,o,i),s[o*2+1]=t.call(n,a,o,i)}return s}function*yj(i,e,t,n){let r=0;for(const s of i)yield e.call(n,s,r,i),yield t.call(n,s,r,i),++r}const aM=Math.PI,tR=aM/2,nR=180/aM,iR=aM/180,xj=Math.atan2,rR=Math.cos,bj=Math.max,Sj=Math.min,sR=Math.sin,Mj=Math.sign||function(i){return i>0?1:i<0?-1:0},A5=Math.sqrt;function wj(i){return i>1?tR:i<-1?-tR:Math.asin(i)}function m5(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function po(i,e){return[i[1]*e[2]-i[2]*e[1],i[2]*e[0]-i[0]*e[2],i[0]*e[1]-i[1]*e[0]]}function Q_(i,e){return[i[0]+e[0],i[1]+e[1],i[2]+e[2]]}function Z_(i){var e=A5(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);return[i[0]/e,i[1]/e,i[2]/e]}function lM(i){return[xj(i[1],i[0])*nR,wj(bj(-1,Sj(1,i[2])))*nR]}function qa(i){const e=i[0]*iR,t=i[1]*iR,n=rR(t);return[n*rR(e),n*sR(e),sR(t)]}function cM(i){return i=i.map(e=>qa(e)),m5(i[0],po(i[2],i[1]))}function Tj(i){const e=Rj(i),t=Pj(e),n=Cj(t,i),r=Nj(t,i.length),s=Ej(r,i),o=Lj(t,i),{polygons:a,centers:l}=Dj(o,t,i),c=Ij(a),u=Fj(t,i),p=Bj(n,t);return{delaunay:e,edges:n,triangles:t,centers:l,neighbors:r,polygons:a,mesh:c,hull:u,urquhart:p,find:s}}function Ej(i,e){function t(n,r){let s=n[0]-r[0],o=n[1]-r[1],a=n[2]-r[2];return s*s+o*o+a*a}return function(r,s,o){o===void 0&&(o=0);let a,l,c=o;const u=qa([r,s]);do a=o,o=null,l=t(u,qa(e[a])),i[a].forEach(p=>{let m=t(u,qa(e[p]));if(m<l){l=m,o=p,c=p;return}});while(o!==null);return c}}function Rj(i){if(i.length<2)return{};let e=0;for(;isNaN(i[e][0]+i[e][1])&&e++<i.length;);const t=AU(i[e]),n=mU().translate([0,0]).scale(1).rotate(t.invert([180,0]));i=i.map(n);const r=[];let s=1;for(let p=0,m=i.length;p<m;p++){let g=i[p][0]**2+i[p][1]**2;!isFinite(g)||g>1e32?r.push(p):g>s&&(s=g)}const o=1e6*A5(s);r.forEach(p=>i[p]=[o,0]),i.push([0,o]),i.push([-o,0]),i.push([0,-o]);const a=oM.from(i);a.projection=n;const{triangles:l,halfedges:c,inedges:u}=a;for(let p=0,m=c.length;p<m;p++)if(c[p]<0){const g=p%3==2?p-2:p+1,v=p%3==0?p+2:p-1,b=c[g],M=c[v];c[b]=M,c[M]=b,c[g]=c[v]=-1,l[p]=l[g]=l[v]=e,u[l[b]]=b%3==0?b+2:b-1,u[l[M]]=M%3==0?M+2:M-1,p+=2-p%3}else l[p]>i.length-3-1&&(l[p]=e);return a}function Cj(i,e){const t=new Set;return e.length===2?[[0,1]]:(i.forEach(n=>{if(n[0]!==n[1]&&!(cM(n.map(r=>e[r]))<0))for(let r=0,s;r<3;r++)s=(r+1)%3,t.add(T_([n[r],n[s]]).join("-"))}),Array.from(t,n=>n.split("-").map(Number)))}function Pj(i){const{triangles:e}=i;if(!e)return[];const t=[];for(let n=0,r=e.length/3;n<r;n++){const s=e[3*n],o=e[3*n+1],a=e[3*n+2];s!==o&&o!==a&&t.push([s,a,o])}return t}function Lj(i,e){return i.map(t=>{const n=t.map(s=>e[s]).map(qa),r=Q_(Q_(po(n[1],n[0]),po(n[2],n[1])),po(n[0],n[2]));return lM(Z_(r))})}function Nj(i,e){const t=[];return i.forEach(n=>{for(let r=0;r<3;r++){const s=n[r],o=n[(r+1)%3];t[s]=t[s]||[],t[s].push(o)}}),i.length===0&&(e===2?(t[0]=[1],t[1]=[0]):e===1&&(t[0]=[])),t}function Dj(i,e,t){const n=[],r=i.slice();if(e.length===0){if(t.length<2)return{polygons:n,centers:r};if(t.length===2){const a=qa(t[0]),l=qa(t[1]),c=Z_(Q_(a,l)),u=Z_(po(a,l)),p=po(c,u),m=[c,po(c,p),po(po(c,p),p),po(po(po(c,p),p),p)].map(lM).map(o);return n.push(m),n.push(m.slice().reverse()),{polygons:n,centers:r}}}e.forEach((a,l)=>{for(let c=0;c<3;c++){const u=a[c],p=a[(c+1)%3],m=a[(c+2)%3];n[u]=n[u]||[],n[u].push([p,m,l,[u,p,m]])}});const s=n.map(a=>{const l=[a[0][2]];let c=a[0][1];for(let u=1;u<a.length;u++)for(let p=0;p<a.length;p++)if(a[p][0]==c){c=a[p][1],l.push(a[p][2]);break}if(l.length>2)return l;if(l.length==2){const u=oR(t[a[0][3][0]],t[a[0][3][1]],r[l[0]]),p=oR(t[a[0][3][2]],t[a[0][3][0]],r[l[0]]),m=o(u),g=o(p);return[l[0],g,l[1],m]}});function o(a){let l=-1;
3835return r.slice(e.length,1/0).forEach((c,u)=>{c[0]===a[0]&&c[1]===a[1]&&(l=u+e.length)}),l<0&&(l=r.length,r.push(a)),l}return{polygons:s,centers:r}}function oR(i,e,t){i=qa(i),e=qa(e),t=qa(t);const n=Mj(m5(po(e,i),t));return lM(Z_(Q_(i,e)).map(r=>n*r))}function Ij(i){const e=[];return i.forEach(t=>{if(!t)return;let n=t[t.length-1];for(let r of t)r>n&&e.push([n,r]),n=r}),e}function Bj(i,e){return function(t){const n=new Map,r=new Map;return i.forEach((s,o)=>{const a=s.join("-");n.set(a,t[o]),r.set(a,!0)}),e.forEach(s=>{let o=0,a=-1;for(let l=0;l<3;l++){let c=T_([s[l],s[(l+1)%3]]).join("-");n.get(c)>o&&(o=n.get(c),a=c)}r.set(a,!1)}),i.map(s=>r.get(s.join("-")))}}function Fj(i,e){const t=new Set,n=[];i.map(a=>{if(!(cM(a.map(l=>e[l>e.length?0:l]))>1e-12))for(let l=0;l<3;l++){let c=[a[l],a[(l+1)%3]],u=`${c[0]}-${c[1]}`;t.has(u)?t.delete(u):t.add(`${c[1]}-${c[0]}`)}});const r=new Map;let s;if(t.forEach(a=>{a=a.split("-").map(Number),r.set(a[0],a[1]),s=a[0]}),s===void 0)return n;let o=s;do{n.push(o);let a=r.get(o);r.set(o,-1),o=a}while(o>-1&&o!==s);return n}function Uj(i){const e=function(t){if(e.delaunay=null,e._data=t,typeof e._data=="object"&&e._data.type==="FeatureCollection"&&(e._data=e._data.features),typeof e._data=="object"){const n=e._data.map(r=>[e._vx(r),e._vy(r),r]).filter(r=>isFinite(r[0]+r[1]));e.points=n.map(r=>[r[0],r[1]]),e.valid=n.map(r=>r[2]),e.delaunay=Tj(e.points)}return e};return e._vx=function(t){if(typeof t=="object"&&"type"in t)return l3(t)[0];if(0 in t)return t[0]},e._vy=function(t){if(typeof t=="object"&&"type"in t)return l3(t)[1];if(1 in t)return t[1]},e.x=function(t){return t?(e._vx=t,e):e._vx},e.y=function(t){return t?(e._vy=t,e):e._vy},e.polygons=function(t){if(t!==void 0&&e(t),!e.delaunay)return!1;const n={type:"FeatureCollection",features:[]};return e.valid.length===0||(e.delaunay.polygons.forEach((r,s)=>n.features.push({type:"Feature",geometry:r?{type:"Polygon",coordinates:[[...r,r[0]].map(o=>e.delaunay.centers[o])]}:null,properties:{site:e.valid[s],sitecoordinates:e.points[s],neighbours:e.delaunay.neighbors[s]}})),e.valid.length===1&&n.features.push({type:"Feature",geometry:{type:"Sphere"},properties:{site:e.valid[0],sitecoordinates:e.points[0],neighbours:[]}})),n},e.triangles=function(t){return t!==void 0&&e(t),e.delaunay?{type:"FeatureCollection",features:e.delaunay.triangles.map((n,r)=>(n=n.map(s=>e.points[s]),n.center=e.delaunay.centers[r],n)).filter(n=>cM(n)>0).map(n=>({type:"Feature",properties:{circumcenter:n.center},geometry:{type:"Polygon",coordinates:[[...n,n[0]]]}}))}:!1},e.links=function(t){if(t!==void 0&&e(t),!e.delaunay)return!1;const n=e.delaunay.edges.map(s=>Gc(e.points[s[0]],e.points[s[1]])),r=e.delaunay.urquhart(n);return{type:"FeatureCollection",features:e.delaunay.edges.map((s,o)=>({type:"Feature",properties:{source:e.valid[s[0]],target:e.valid[s[1]],length:n[o],urquhart:!!r[o]},geometry:{type:"LineString",coordinates:[e.points[s[0]],e.points[s[1]]]}}))}},e.mesh=function(t){return t!==void 0&&e(t),e.delaunay?{type:"MultiLineString",coordinates:e.delaunay.edges.map(n=>[e.points[n[0]],e.points[n[1]]])}:!1},e.cellMesh=function(t){if(t!==void 0&&e(t),!e.delaunay)return!1;const{centers:n,polygons:r}=e.delaunay,s=[];for(const o of r)if(o)for(let a=o.length,l=o[a-1],c=o[0],u=0;u<a;l=c,c=o[++u])c>l&&s.push([n[l],n[c]]);return{type:"MultiLineString",coordinates:s}},e._found=void 0,e.find=function(t,n,r){if(e._found=e.delaunay.find(t,n,e._found),!r||Gc([t,n],e.points[e._found])<r)return e._found},e.hull=function(t){t!==void 0&&e(t);const n=e.delaunay.hull,r=e.points;return n.length===0?null:{type:"Polygon",coordinates:[[...n.map(s=>r[s]),r[n[0]]]]}},i?e(i):e}function Ab(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}function Oj(i){if(Array.isArray(i))return i}function kj(i){if(Array.isArray(i))return Ab(i)}function zj(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Vj(i,e,t){return e=K_(e),Yj(i,g5()?Reflect.construct(e,[],K_(i).constructor):e.apply(i,t))}function Gj(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function qj(i,e,t){return Object.defineProperty(i,"prototype",{writable:!1}),i}function K_(i){return K_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},K_(i)}function Hj(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),e&&mb(i,e)}function g5(){try{var i=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(g5=function(){return!!i})()}function Wj(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function $j(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,r,s,o,a=[],l=!0,c=!1;try{if(s=(t=t.call(i)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,r=u}
3835finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}function jj(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3836In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xj(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3837In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yj(i,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zj(i)}function mb(i,e){return mb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},mb(i,e)}function Ba(i,e){return Oj(i)||$j(i,e)||_5(i,e)||jj()}function Xy(i){return kj(i)||Wj(i)||_5(i)||Xj()}function _5(i,e){if(i){if(typeof i=="string")return Ab(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ab(i,e):void 0}}function Qj(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.resolution,n=t===void 0?1/0:t,r=Zj(i,n),s=P2(r),o=Kj(i,n),a=[].concat(Xy(s),Xy(o)),l={type:"Polygon",coordinates:i},c=OP(l),u=Ba(c,2),p=Ba(u[0],2),m=p[0],g=p[1],v=Ba(u[1],2),b=v[0],M=v[1],x=m>b||M>=89||g<=-89,w=[];if(x){var R=Uj(a).triangles(),C=new Map(a.map(function($,K){var he=Ba($,2),ie=he[0],de=he[1];return["".concat(ie,"-").concat(de),K]}));R.features.forEach(function($){var K,he=$.geometry.coordinates[0].slice(0,3).reverse(),ie=[];if(he.forEach(function(Ce){var Fe=Ba(Ce,2),ge=Fe[0],Ge=Fe[1],Me="".concat(ge,"-").concat(Ge);C.has(Me)&&ie.push(C.get(Me))}),ie.length===3){if(ie.some(function(Ce){return Ce<s.length})){var de=$.properties.circumcenter;if(!gb(de,l,x))return}(K=w).push.apply(K,ie)}})}else if(o.length)for(var I=n0.from(a),F=function(K){var he,ie=[2,1,0].map(function(Fe){return I.triangles[K+Fe]}),de=ie.map(function(Fe){return a[Fe]});if(ie.some(function(Fe){return Fe<s.length})){var Ce=[0,1].map(function(Fe){return iU(de,function(ge){return ge[Fe]})});if(!gb(Ce,l,x))return 1}(he=w).push.apply(he,Xy(ie))},k=0,Y=I.triangles.length;k<Y;k+=3)F(k);else{var N=$_(r),D=N.vertices,P=N.holes,O=P===void 0?[]:P;w=_W(D,O,2)}var W=Vc(T_(a,function($){return $[0]}),[0,1]),Q=Vc(T_(a,function($){return $[1]}),[0,1]),J=a.map(function($){var K=Ba($,2),he=K[0],ie=K[1];return[W(he),Q(ie)]}),H={points:a,indices:w,uvs:J};return{contour:r,triangles:H}}function Zj(i,e){return i.map(function(t){var n=[],r;return t.forEach(function(s){if(r){var o=Gc(s,r)*180/Math.PI;if(o>e)for(var a=gS(r,s),l=1/Math.ceil(o/e),c=l;c<1;)n.push(a(c)),c+=l}n.push(r=s)}),n})}function Kj(i,e){var t={type:"Polygon",coordinates:i},n=OP(t),r=Ba(n,2),s=Ba(r[0],2),o=s[0],a=s[1],l=Ba(r[1],2),c=l[0],u=l[1];if(Math.min(Math.abs(c-o),Math.abs(u-a))<e)return[];var p=o>c||u>=89||a<=-89;return Jj(e,{minLng:o,maxLng:c,minLat:a,maxLat:u}).filter(function(m){return gb(m,t,p)})}function Jj(i){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.minLng,n=e.maxLng,r=e.minLat,s=e.maxLat,o=Math.round(Math.pow(360/i,2)/Math.PI),a=(1+Math.sqrt(5))/2,l=function(x){return x/a*360%360-180},c=function(x){return Math.acos(2*x/o-1)/Math.PI*180-90},u=function(x){return o*(Math.cos((x+90)*Math.PI/180)+1)/2},p=[s!==void 0?Math.ceil(u(s)):0,r!==void 0?Math.floor(u(r)):o-1],m=t===void 0&&n===void 0?function(){return!0}:t===void 0?function(M){return M<=n}:n===void 0?function(M){return M>=t}:n>=t?function(M){return M>=t&&M<=n}:function(M){return M>=t||M<=n},g=[],v=p[0];v<=p[1];v++){var b=l(v);m(b)&&g.push([b,c(v)])}return g}function gb(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return t?FU(e,i):dj(i,e)}var p_=window.THREE?window.THREE:{BufferGeometry:vi,Float32BufferAttribute:Gn},aR=new p_.BufferGeometry().setAttribute?"setAttribute":"addAttribute",uM=function(i){function e(t,n,r,s,o,a,l){var c;Gj(this,e),c=Vj(this,e),c.type="ConicPolygonGeometry",c.parameters={polygonGeoJson:t,bottomHeight:n,topHeight:r,closedBottom:s,closedTop:o,includeSides:a,curvatureResolution:l},n=n||0,r=r||1,s=s!==void 0?s:!0,o=o!==void 0?o:!0,a=a!==void 0?a:!0,l=l||5;var u=Qj(t,{resolution:l}),p=u.contour,m=u.triangles,g=P2(m.uvs),v=[],b=[],M=[],x=0,w=function(P){var O=Math.round(v.length/3),I=M.length;v=v.concat(P.vertices),b=b.concat(P.uvs),M=M.concat(O?P.indices.map(function(F){return F+O}):P.indices),c.addGroup(I,M.length-I,x++)};a&&w(C()),s&&w(N(n,!1)),o&&w(N(r,!0)),c.setIndex(M),c[aR]("position",new p_.Float32BufferAttribute(v,3)),c[aR]("uv",new p_.Float32BufferAttribute(b,2)),c.computeVertexNormals();function R(D,P){var O=typeof P=="function"?P:function(){return P},I=D.map(function(F){return F.map(function(k){var Y=Ba(k,2),W=Y[0],Q=Y[1];return eX(Q,W,O(W,Q))})});return $_(I)}function C(){for(var D=R(p,n),P=D.vertices,O=D.holes,I=R(p,r),F=I.vertices,k=P2([F,P]),Y=Math.round(F.length/3),W=new Set(O),Q=0,J=[],H=0;H<Y;H++){var $=H+1;if($===Y)$=Q;else if(W.has($)){var K=$;$=Q,Q=K}J.push(H,H+Y,$+Y),J.push($+Y,$,H)}for(var he=[],ie=1;ie>=0;ie--)for(var de=0;de<Y;de+=1)he.push(de/(Y-1),ie);return{indices:J,vertices:k,uvs:he}}function N(D){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return{indices:P?m.indices:m.indices.slice().reverse(),vertices:R([m.points],D).vertices,uvs:g}}return c}return Hj(e,i),qj(e)}(p_.BufferGeometry);function eX(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,r=(90-e)*Math.PI/180;return[t*Math.sin(n)*Math.cos(r),t*Math.cos(n),t*Math.sin(n)*Math.sin(r)]}function _b(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}
3837function tX(i){if(Array.isArray(i))return i}function nX(i){if(Array.isArray(i))return _b(i)}function iX(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function rX(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,r,s,o,a=[],l=!0,c=!1;try{if(s=(t=t.call(i)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,r=u}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}function sX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3838In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3839In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aX(i,e){if(i==null)return{};var t,n,r=lX(i,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(n=0;n<s.length;n++)t=s[n],e.includes(t)||{}.propertyIsEnumerable.call(i,t)&&(r[t]=i[t])}return r}function lX(i,e){if(i==null)return{};var t={};for(var n in i)if({}.hasOwnProperty.call(i,n)){if(e.includes(n))continue;t[n]=i[n]}return t}function cX(i,e){return tX(i)||rX(i,e)||v5(i,e)||sX()}function uX(i){return nX(i)||iX(i)||v5(i)||oX()}function hX(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}function dX(i){var e=hX(i,"string");return typeof e=="symbol"?e:e+""}function v5(i,e){if(i){if(typeof i=="string")return _b(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_b(i,e):void 0}}var fX=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,r=(e instanceof Array?e.length?e:[void 0]:[e]).map(function(a){return{keyAccessor:a,isProp:!(a instanceof Function)}}),s=i.reduce(function(a,l){var c=a,u=l;return r.forEach(function(p,m){var g=p.keyAccessor,v=p.isProp,b;if(v){var M=u,x=M[g],w=aX(M,[g].map(dX));b=x,u=w}else b=g(u,m);m+1<r.length?(c.hasOwnProperty(b)||(c[b]={}),c=c[b]):t?(c.hasOwnProperty(b)||(c[b]=[]),c[b].push(u)):c[b]=u}),a},{});t instanceof Function&&function a(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;c===r.length?Object.keys(l).forEach(function(u){return l[u]=t(l[u])}):Object.values(l).forEach(function(u){return a(u,c+1)})}(s);var o=s;return n&&(o=[],function a(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];c.length===r.length?o.push({keys:c,vals:l}):Object.entries(l).forEach(function(u){var p=cX(u,2),m=p[0],g=p[1];return a(g,[].concat(uX(c),[m]))})}(s),e instanceof Array&&e.length===0&&o.length===1&&(o[0].keys=[])),o},Un=function(i){i=i||{};var e=typeof i<"u"?i:{},t={},n;for(n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);var r="";function s($e){return e.locateFile?e.locateFile($e,r):r+$e}var o;typeof document<"u"&&document.currentScript&&(r=document.currentScript.src),r.indexOf("blob:")!==0?r=r.substr(0,r.lastIndexOf("/")+1):r="",o=function(ht,te,fe){var h=new XMLHttpRequest;h.open("GET",ht,!0),h.responseType="arraybuffer",h.onload=function(){if(h.status==200||h.status==0&&h.response){te(h.response);return}var je=zt(ht);if(je){te(je.buffer);return}fe()},h.onerror=fe,h.send(null)};var a=e.print||console.log.bind(console),l=e.printErr||console.warn.bind(console);for(n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);t=null,e.arguments&&e.arguments;var c=0,u=function($e){c=$e},p=function(){return c},m=8;function g($e,ht,te,fe){switch(te=te||"i8",te.charAt(te.length-1)==="*"&&(te="i32"),te){case"i1":Y[$e>>0]=ht;break;case"i8":Y[$e>>0]=ht;break;case"i16":Q[$e>>1]=ht;break;case"i32":J[$e>>2]=ht;break;case"i64":Be=[ht>>>0,(Ae=ht,+Xe(Ae)>=1?Ae>0?(Pe(+We(Ae/4294967296),4294967295)|0)>>>0:~~+Z((Ae-+(~~Ae>>>0))/4294967296)>>>0:0)],J[$e>>2]=Be[0],J[$e+4>>2]=Be[1];break;case"float":H[$e>>2]=ht;break;case"double":$[$e>>3]=ht;break;default:Rr("invalid type for setValue: "+te)}}function v($e,ht,te){switch(ht=ht||"i8",ht.charAt(ht.length-1)==="*"&&(ht="i32"),ht){case"i1":return Y[$e>>0];case"i8":return Y[$e>>0];case"i16":return Q[$e>>1];case"i32":return J[$e>>2];case"i64":return J[$e>>2];case"float":return H[$e>>2];case"double":return $[$e>>3];default:Rr("invalid type for getValue: "+ht)}return null}var b=!1;function M($e,ht){$e||Rr("Assertion failed: "+ht)}function x($e){var ht=e["_"+$e];return M(ht,"Cannot call unknown function "+$e+", make sure it is exported"),ht}function w($e,ht,te,fe,h){var V={string:function(Pt){var Bn=0;if(Pt!=null&&Pt!==0){var Ls=(Pt.length<<2)+1;Bn=tt(Ls),O(Pt,Bn,Ls)}return Bn},array:function(Pt){var Bn=tt(Pt.length);return I(Pt,Bn),Bn}};function je(Pt){return ht==="string"?D(Pt):ht==="boolean"?!!Pt:Pt}var It=x($e),Ot=[],Et=0;if(fe)for(var Ct=0;Ct<fe.length;Ct++){var bn=V[te[Ct]];bn?(Et===0&&(Et=Ut()),Ot[Ct]=bn(fe[Ct])):Ot[Ct]=fe[Ct]}var kt=It.apply(null,Ot);return kt=je(kt),Et!==0&&ut(Et),kt}function R($e,ht,te,fe){te=te||[];var h=te.every(function(je){return je==="number"}),V=ht!=="string";return V&&h&&!fe?x($e):function(){return w($e,ht,te,arguments)}}var C=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function N($e,ht,te){for(var fe=ht+te,h=ht;$e[h]&&!(h>=fe);)++h;if(h-ht>16&&$e.subarray&&C)return C.decode($e.subarray(ht,h));for(var V="";ht<h;){var je=$e[ht++];if(!(je&128)){V+=String.fromCharCode(je);continue}var It=$e[ht++]&63;if((je&224)==192){V+=String.fromCharCode((je&31)<<6|It);continue}var Ot=$e[ht++]&63;if((je&240)==224?je=(je&15)<<12|It<<6|Ot:je=(je&7)<<18|It<<12|Ot<<6|$e[ht++]&63,je<65536)V+=String.fromCharCode(je);else{var Et=je-65536;V+=String.fromCharCode(55296|Et>>10,56320|Et&1023)}}return V}function D($e,ht){return $e?N(W,$e,ht):""}function P($e,ht,te,fe){if(!(fe>0))return 0;for(var h=te,V=te+fe-1,je=0;je<$e.length;++je){var It=$e.charCodeAt(je);if(It>=55296&&It<=57343){var Ot=$e.charCodeAt(++je);It=65536+((It&1023)<<10)|Ot&1023}
3839if(It<=127){if(te>=V)break;ht[te++]=It}else if(It<=2047){if(te+1>=V)break;ht[te++]=192|It>>6,ht[te++]=128|It&63}else if(It<=65535){if(te+2>=V)break;ht[te++]=224|It>>12,ht[te++]=128|It>>6&63,ht[te++]=128|It&63}else{if(te+3>=V)break;ht[te++]=240|It>>18,ht[te++]=128|It>>12&63,ht[te++]=128|It>>6&63,ht[te++]=128|It&63}}return ht[te]=0,te-h}function O($e,ht,te){return P($e,W,ht,te)}typeof TextDecoder<"u"&&new TextDecoder("utf-16le");function I($e,ht){Y.set($e,ht)}function F($e,ht){return $e%ht>0&&($e+=ht-$e%ht),$e}var k,Y,W,Q,J,H,$;function K($e){k=$e,e.HEAP8=Y=new Int8Array($e),e.HEAP16=Q=new Int16Array($e),e.HEAP32=J=new Int32Array($e),e.HEAPU8=W=new Uint8Array($e),e.HEAPU16=new Uint16Array($e),e.HEAPU32=new Uint32Array($e),e.HEAPF32=H=new Float32Array($e),e.HEAPF64=$=new Float64Array($e)}var he=5271520,ie=28608,de=e.TOTAL_MEMORY||33554432;e.buffer?k=e.buffer:k=new ArrayBuffer(de),de=k.byteLength,K(k),J[ie>>2]=he;function Ce($e){for(;$e.length>0;){var ht=$e.shift();if(typeof ht=="function"){ht();continue}var te=ht.func;typeof te=="number"?ht.arg===void 0?e.dynCall_v(te):e.dynCall_vi(te,ht.arg):te(ht.arg===void 0?null:ht.arg)}}var Fe=[],ge=[],Ge=[],Me=[];function Ye(){if(e.preRun)for(typeof e.preRun=="function"&&(e.preRun=[e.preRun]);e.preRun.length;)Rt(e.preRun.shift());Ce(Fe)}function ct(){Ce(ge)}function Je(){Ce(Ge)}function Ke(){if(e.postRun)for(typeof e.postRun=="function"&&(e.postRun=[e.postRun]);e.postRun.length;)Ue(e.postRun.shift());Ce(Me)}function Rt($e){Fe.unshift($e)}function Ue($e){Me.unshift($e)}var Xe=Math.abs,Z=Math.ceil,We=Math.floor,Pe=Math.min,Qe=0,Oe=null;function vt($e){Qe++,e.monitorRunDependencies&&e.monitorRunDependencies(Qe)}function ot($e){if(Qe--,e.monitorRunDependencies&&e.monitorRunDependencies(Qe),Qe==0&&Oe){var ht=Oe;Oe=null,ht()}}e.preloadedImages={},e.preloadedAudios={};var q=null,U="data:application/octet-stream;base64,";function ue($e){return String.prototype.startsWith?$e.startsWith(U):$e.indexOf(U)===0}var Ae,Be;q
vendor: 19,357 bytes, line 3839
3839="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE
vendor: 4,160 bytes, line 3839
38394AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA//////
vendor: 13,586 bytes, line 3839
3839///////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAEAAAAAAQAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAA6B6FaUp9QQTPXMuL4myJBraiDfBwx9UBYJseitzTIQOL5if9jqZtAnXX+Z+ycb0C3pucbhRBCQG8wJBYqpRRAlWbDCzCY5z/eFWBUEve6P/+qo4Q50Y4/D9YM3iCcYT8fcA2QJSA0P4ADxu0qAAc/BNcGolVJ2j5d9FACqwquPh9z7MthtI9CSUSYJke/YUJQ/64OyjU0Qpi0+HCmFQdCm3GfIVdh2kHsJ11kAyauQYC3UDFJOoFBSJsFV1OwU0FK5fcxX4AmQWhy/zZIt/lACqaCPsBjzUDbdUNIScugQMYQlVJ4MXNANiuq8GTvRUDxTXnulxEZQFZ8QX5kpuw/qmG/JwYFlEAluh3Q6DB+QKn4vyNq0GZAKOXekas+UUB8xabXXhI6QG63C2pLtSNAdDBtyNfLDUDyOcu67ID2P0rCMvRXAeE/Ki2TSVyzyT9Dk+8Sz2uzP5J+w5ARWp0/NQAoOiMuhj9YnP+RyMJwPxgW7TvQVFk/KgsLYF0kQz9g5dAC6IwzQcgHPVvDex1B1XjppodHBkHJq3OMM9fwQNvcmJ7wddlAInGPpQs/w0BRobq5EBmtQJZ2ai7n+ZVAtv2G5E+bgECG+gIfKBlpQK5f8jdI91JAL39sL/WpPEB8rGxhDqklQK6yUf43XhBAxL9y/tK8+D86XyZpgrHiPwAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAP////8AAAAAAAAAAAAAAAABAAAAAAAAAAAAAAD/////AAAAAAAAAAABAAAAAQAAAAAAAAAAAAAA/////wAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAP////8FAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQAAAAAAAQABAAABAQAAAAAAAQAAAAEAAAABAAEAAAAAAAAAAAAAAAAAAAAAquJYWJZl+D9jaeZNtj/zPwwdI9KqaeO/qGefXwdHdz+q4lhYlmX4P+OrlPMN3PI/DB0j0qpp47+7SQLV4VIEQKriWFiWZfg/r2kma3tz8T82eQmLqNIGwMRIWXMqSvo/fcCszPux9j+jara6ozTwP6hnn18HR3c/MSoKLequ8r+SabgA2nj0P7jBLbDOHO8/1Ym/ICfH4T+6lxjvlFXHv73m373LRPU/0vXyDVxo7T+ToKRHJXMAQF/33578aPE/pAyy64tD9T8+U/hCvyruPwxv8Y7YYwLAuXYr8NAiCEB4+LDK0Sn0P1Qeuy4j+eo/OMx50n7K7L+TrGB/nyf8v5ehC2fbYPM/aXMKexiT6z8mFRIMjg/zP7yUVwGGBNw/E6opHERf8z/z0wR2g9DqPw4pBpcOhvu/NbA29uWAA8DMaTExyXzyP02biiQ+Ruk/S8jz2/FKBEB1pzZnpbb9P7pQU4wLfPI//7ZcQXeG6D9CqEQvAYoIwDB2VB6sSgRAVyv8H5We8T+EHWF8XNPmPzB2wT8Nrrg/SEi+cX+w4L8of+GtdSDxP1sjk5AdouU/6ZjOVru13r8K0obqI6bxvwVbdNXyhfA/w5GG024n5z+rwmtMzP8BwLw9pSX49QXABe/2uQxP8D+b6wCzCvXkP7uGT87fK+Q/pz/JWw4coj+qoBf2J0nwP/yE3PUo0+I/vFJeHcaC+D96luSIqvntP/bf8sHUYu8/gZNN41mL4z9bhOqVOF4FwO6lmAh1hQhAbCVxbdhk7z+1C8NdDcfiPwG36x/0OQBAx0WJ76c2+D9nlSHXANfuP2HlfZ3gqOE/EwnVlVPg9r96+oHzEH//v5bXzdT1Auw/DM3GwLsA4D9p/8uoKcr+v+U9x5DQVAPAehjSdghb7D9sc1IetODgP8MVwwB1pu6/azPk6OGe978W8t/TUc3rP+0QMvYfP+A/RsG/QpSE8D+l3uwScxzgPwQaifgujuw/k1Vti1I43z8MAwLnSh0GQH5nYnwwZgJAiGUzWC5s6j8WyyI/BbLgPw4iUapGeQJAB3W+imnp/j9BLWR4ssrpP2t+gG5Pstk/cpBsfm6DCMCOpU9dOZsFQEv8nFypHeo/ehJ6i+6S2D9jqlGEmarLv7STC5TRiOa/bC+x8WZD6D9H3yUkWpDZP8gZvmCMuQLAreY19/eRBsCoPOc8UzzpP6KI/QV+y9g/t/MoboyWzT+Hv5q3Zu3Mvy2xROCT4uY/9gQitMMg1T9abAqhWMDkv1oLTavoUfG/PMUJP9CD5j+fHRX3t6fSPz7W2gk6bvs/WRnuHwqN9D8YFturGCTmP1EZczv0b9I/5t4exabB5D/1ESLh5fTEP9X2z6SYweQ/6lv3I2zT0D9zkRGNUNMAQKoSvc4EIfs/Xggt8wQI5T+mJHHg/w/SP4lhT/9t8vQ/DrZ/DbwH7D+XlhbYZrjkP34LIpFt6c4/lwfp8fLX9L+j96CTTf76v3WdNhEv9uM/d8c3o4lV0D/vFdCHVcsFwAHeDq0F1QhApbYqcZiN5D9KoilqByXLPwX0/diA0vq/0fo0GxnxAMBbaTkvlCzjP/RrFrWXrMs/UYTrky7jA0DB9f4FiZYAQEGAk/3QzeE/r/TeqE8t0D/OqjlsnPbvvz8RKU8JOfW/smSEbK/O4T8MzuyPm3DDP/rFtctq9gZAfb1EVEaSA0Dts5dVInnhP18SFMc79MM/7y34cw6LAMDFrRJsZO0DwC2KLvLSYuA/hx5wcUHewz+49SnK/4ruPyeS0PX9a+E/ZxaaLvvZ3z8WPu5T2QS8Pygo4RIvMqa/BJ0Kqsd0279cKW4ay8jdP3b05bmZ364/10/qtdxk2r+Bcz6CDMvpv54qOw+Amdw/qLV71pW7sT/YKc80nIPUP8OfIaBJ77G/LyTuD1un2z+diYu8efWzP1wU7ACkfwjAZroyPL1yBkAmv3lKJJbbPysKSE4W+p0/dIgqY79TA8ATLTOQ3tsGwJ2zweD/Xdg/XO/jXeFUaL8VW2qLFKfov1cA9Aa6XfK/tIa7YGgI2T+f3hu/sxqPv2nXdPpf3Pc/jkw8Jbda8j+tT/z8tGPVP1yBHpJd35k/KYvYOy1s8j/yz+kCQjPrP9+agH7x59g/PZfJ9aBhpr/rDKzvYBb+PwtkiaGCt/c/vb1mVr+f1T/JIHwHc8Govw7aeF6+9vG/Xv7kD6fp979isYioQYHVP7AIQZuSFrG/3z1AdUTnAUDN3XY9O7f9P0AdQ9ljYNQ/dJANJPTOrb8kLECUiiPlP4yF7UgmStA/9xGmXxCG1T9qZzix4W2zv2SGJRJVrPe/Fh9a2M/B/b8IexzFCoPSP9y1QFD2bLe/Q86cWLJe/b+mOOfYm78BwOTjkPAGE9E/8aPCUKu/ub9pPZyLCiUGwBA7Mev/BQlALOmrlRi+0j+AMJ/dKULBv7iLtL6a6QRAEMDV/yajAUDa62dE3crJP1P70RgBUbq/38hVnR6esT/s1tG10Z/Ov/zLwalHPss/dTS9NKTXx78nMcRzCIEHQAabxDsAmQRA0tyLK3gSyT+Aui7nOhDGv5Gs58z3WgHATN3forJuBMCAui7nOhDGP9Lciyt4Esm/WAJyHQ4c7z8UP5HFIs3iP3U0vTSk18c//MvBqUc+y7+cvv8HLg/Kvy1I/mHsI+K/U/vRGAFRuj/a62dE3crJv8p+WV8KlQjAuQ/nOP43B0CAMJ/dKULBPyzpq5UYvtK/ZoU+VoLh4L9etLlRUfvtv/GjwlCrv7k/5OOQ8AYT0b9DfT9FhufXPwUX8hJp+4u/3LVAUPZstz8IexzFCoPSv9+L609E5fQ/q9Fz7X2J7T9qZzix4W2zP/cRpl8QhtW/vtNilqGX+j8MOy7QJoL0P3SQDST0zq0/QB1D2WNg1L8IIjSvGNkDwGB8Jou2GAfAsAhBm5IWsT9isYioQYHVvyS9D3zb6uy/gnwRa7uM9L/JIHwHc8GoP729Zla/n9W/CsAHJZwmAEDEW6OYT1r6Pz2XyfWgYaY/35qAfvHn2L83Tdy4lS30vxf2/gZ0jPq/XIEekl3fmb+tT/z8tGPVvybPr2zJ1/+/K7mJ0ypVAsCf3hu/sxqPPwCGu2BoCNm/5oITrpZn+r+UDUyDP+n/v1zv413hVGg/nbPB4P9d2L9MlmkxNvgCQMtZlKE85v8/KwpIThb6nb8mv3lKJJbbv8+SZsTvOOc/pQCIIOYw0j+diYu8efWzvy8k7g9bp9u/kxYDa+pKtD9XlYvA8HnVv6i1e9aVu7G/nio7D4CZ3L/WR6rNh5EGwCkgQweBkghAdvTluZnfrr9cKW4ay8jdvxbjhr1f1QVAR5C0MzivAkAWPu5T2QS8v2cWmi772d+/cKj4lzLJCEBx2QJfYrMFQIcecHFB3sO/LYou8tJi4L+jr7lhO38BwIcI0Nb7xgTAXxIUxzv0w7/ts5dVInnhv0T+l8DZLfE/MP3FoFvS5D8MzuyPm3DDv7JkhGyvzuG/tzhzRIRc0b9Ovv3/0z7mv6/03qhPLdC/m4CT/dDN4b9dwjU5VCQBQBBJX1ntCv0/9GsWtZesy79baTkvlCzjv1mjYgEz++S/oW6KnOQW8b9KoilqByXLv6W2KnGYjeS/SmaKz3Vx9z+BZB5yxGHwP3fHN6OJVdC/dZ02ES/2478PuaBjLrXaP4/JU81pPaO/fgsikW3pzr+XlhbYZrjkv4tSn7YDbP0/f2LnFKlF9z+mJHHg/w/Sv14ILfMECOW/mfg4qYhR/b+OP+RQDCACwOpb9yNs09C/1fbPpJjB5L9pN2WOVZ3wv3hHy9nxIve/URlzO/Rv0r8YFturGCTmv1d1/KKR8QPA8gsy9qzSB8CfHRX3t6fSvzzFCT/Qg+a/EYStnrzV9r/2QJqI7Lb9v/YEIrTDINW/LbFE4JPi5r/7kQEs5fEDQHunnf4GeQBAooj9BX7L2L+oPOc8Uzzpv+ydYY2SSAfAL4HK6CRTB0BH3yUkWpDZv2wvsfFmQ+i/Ik0Yzruh6T8fM3LoGoDUP3oSeovukti/S/ycXKkd6r9rEv+7UWcHQCRIQe/GfwNAa36Abk+y2b9BLWR4ssrpv9KT87qa0bM/FTyktw823L8WyyI/BbLgv4hlM1gubOq/DizMp9Ki6r8b5ckdjVrzv5NVbYtSON+/BBqJ+C6O7L/dUBFqgyXYv00Wh18r7+q/7RAy9h8/4L8W8t/TUc3rv4RM5DKx3wDAfvWIj94aBcBsc1IetODgv3oY0nYIW+y/oGcTFF54AUDkJqS/FKX6PwzNxsC7AOC/ltfN1PUC7L+5Wrz/zHnzP6688w2rNOc/YeV9neCo4b9nlSHXANfuvw9RsxKjY/s/1V8GteXE8j+1C8NdDcfiv2wlcW3YZO+/IOywaA7Q8b9bFP+4Tg36v4GTTeNZi+O/9t/ywdRi77+tRc3yFR7eP2bkcHXJkLO//ITc9SjT4r+qoBf2J0nwv2YHKoswwfm/iQcLspCjAcCb6wCzCvXkvwXv9rkMT/C/YkuwYAMXBMApCNUai9kIwMORhtNuJ+e/BVt01fKF8L+ZqWEfvIjsP6h693QZYNk/WyOTkB2i5b8of+GtdSDxvwpaaulDSwVADMQAX+lOAECEHWF8XNPmv1cr/B+VnvG/XyFG6opcCMD/mtR32/UEQP+2XEF3hui/ulBTjAt88r/imfCfRP+yP9zbvtc8XeO/TZuKJD5G6b/MaTExyXzyvxiTQeElXOO/rbJRQVGN9L/z0wR2g9DqvxOqKRxEX/O/FDGCEei99j9x8zV4VYTmP2lzCnsYk+u/l6ELZ9tg878pRXacaDT/v3k6GZRqoQXAVB67LiP56r94+LDK0Sn0vwO6pZ9b7wFAvK0nKVcc9j8+U/hCvyruv6QMsuuLQ/W/FPhKFYv46j8MyxaDTOW/v9L18g1caO2/vebfvctE9b/7GD8ZrF3xv3gx1AR9bQDAuMEtsM4c77+SabgA2nj0v5xKFIwxsATArKNSBaKsB0Cjara6ozTwv33ArMz7sfa/dF2U0FcWCcDxL357DJX/P69pJmt7c/G/quJYWJZl+L/YntVJlnrSP4sRLzXM+fe/46uU8w3c8r+q4lhYlmX4v85lu5+QRwRAsI0H/WU8479jaeZNtj/zv6riWFiWZfi/sI0H/WU847/OZbufkEcEQHAoPUBrnss/9exKzDtFtT88wM8kax+gP9OqeKeAYog/MW0ItiZvcj+ph+smvt5bP2lCaV5dEUU/StaUmQDaLz+kK9y22BMYP0O3whZuMwI/IIbgZGWE6z7UkjYaEM3UPuezxwa9cr8+LybxRMnFpz6E1N8DbPiRPsYjySMvK3s+//////8fAAj//////zMQCP////9/MiAI/////28yMAj/////YzJACP///z9iMlAI////N2IyYAj///8zYjJwCP//vzNiMoAI//+rM2IykAj/f6szYjKgCP8PqzNiMrAI/wOrM2IywAi/A6szYjLQCJ8DqzNiMuAImQOrM2Iy8Aj//////z8PCP//////Kx8I/////38pLwj/////Pyk/CP////85KU8I////PzgpXwj///8POClvCP///w44KX8I//8fDjgpjwj//w8OOCmfCP9/DQ44Ka8I/w8NDjgpvwj/DQ0OOCnPCP8MDQ44Kd8IxwwNDjgp7wjEDA0OOCn/CAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAABgtRFT7Ifk/GC1EVPsh+b8YLURU+yEJQBgtRFT7IQnAYWxnb3MuYwBoM05laWdoYm9yUm90YXRpb25zAGNvb3JkaWprLmMAX3VwQXA3Q2hlY2tlZABfdXBBcDdyQ2hlY2tlZABkaXJlY3RlZEVkZ2UuYwBkaXJlY3RlZEVkZ2VUb0JvdW5kYXJ5AGFkamFjZW50RmFjZURpclt0bXBGaWprLmZhY2VdW2ZpamsuZmFjZV0gPT0gS0kAZmFjZWlqay5jAF9mYWNlSWprUGVudFRvQ2VsbEJvdW5kYXJ5AGFkamFjZW50RmFjZURpcltjZW50ZXJJSksuZmFjZV1bZmFjZTJdID09IEtJAF9mYWNlSWprVG9DZWxsQm91bmRhcnkAaDNJbmRleC5jAGNvbXBhY3RDZWxscwBsYXRMbmdUb0NlbGwAY2VsbFRvQ2hpbGRQb3MAdmFsaWRhdGVDaGlsZFBvcwBsYXRMbmcuYwBjZWxsQXJlYVJhZHMyAHBvbHlnb24tPm5leHQgPT0gTlVMTABsaW5rZWRHZW8uYwBhZGROZXdMaW5rZWRQb2x5Z29uAG5leHQgIT0gTlVMTABsb29wICE9IE5VTEwAYWRkTmV3TGlua2VkTG9vcABwb2x5Z29uLT5maXJzdCA9PSBOVUxMAGFkZExpbmtlZExvb3AAY29vcmQgIT0gTlVMTABhZGRMaW5rZWRDb29yZABsb29wLT5maXJzdCA9PSBOVUxMAGlubmVyTG9vcHMgIT0gTlVMTABub3JtYWxpemVNdWx0aVBvbHlnb24AYmJveGVzICE9IE5VTEwAY2FuZGlkYXRlcyAhPSBOVUxMAGZpbmRQb2x5Z29uRm9ySG9sZQBjYW5kaWRhdGVCQm94ZXMgIT0gTlVMTAByZXZEaXIgIT0gSU5WQUxJRF9ESUdJVABsb2NhbGlqLmMAY2VsbFRvTG9jYWxJamsAYmFzZUNlbGwgIT0gb3JpZ2luQmFzZUNlbGwAIShvcmlnaW5PblBlbnQgJiYgaW5kZXhPblBlbnQpAGJhc2VDZWxsID09IG9yaWdpbkJhc2VDZWxsAGJhc2VDZWxsICE9IElOVkFMSURfQkFTRV9DRUxMAGxvY2FsSWprVG9DZWxsACFfaXNCYXNlQ2VsbFBlbnRhZ29uKGJhc2VDZWxsKQBiYXNlQ2VsbFJvdGF0aW9ucyA+PSAwAGdyaWRQYXRoQ2VsbHMAcG9seWZpbGwuYwBpdGVyU3RlcFBvbHlnb25Db21wYWN0ADAAdmVydGV4LmMA
3839Y2VsbFRvVmVydGV4AGdyYXBoLT5idWNrZXRzICE9IE5VTEwAdmVydGV4R3JhcGguYwBpbml0VmVydGV4R3JhcGgAbm9kZSAhPSBOVUxMAGFkZFZlcnRleE5vZGU=";var we=28624;function pe($e,ht,te,fe){Rr("Assertion failed: "+D($e)+", at: "+[ht?D(ht):"unknown filename",te,fe?D(fe):"unknown function"])}function qe(){return Y.length}function Ve($e,ht,te){W.set(W.subarray(ht,ht+te),$e)}function st($e){return e.___errno_location&&(J[e.___errno_location()>>2]=$e),$e}function Ie($e){Rr("OOM")}function nt($e){try{var ht=new ArrayBuffer($e);return ht.byteLength!=$e?void 0:(new Int8Array(ht).set(Y),Bt(ht),K(ht),1)}catch{}}function ft($e){var ht=qe(),te=16777216,fe=2147483648-te;if($e>fe)return!1;for(var h=16777216,V=Math.max(ht,h);V<$e;)V<=536870912?V=F(2*V,te):V=Math.min(F((3*V+2147483648)/4,te),fe);var je=nt(V);return!!je}var wt=typeof atob=="function"?atob:function($e){var ht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",te="",fe,h,V,je,It,Ot,Et,Ct=0;$e=$e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do je=ht.indexOf($e.charAt(Ct++)),It=ht.indexOf($e.charAt(Ct++)),Ot=ht.indexOf($e.charAt(Ct++)),Et=ht.indexOf($e.charAt(Ct++)),fe=je<<2|It>>4,h=(It&15)<<4|Ot>>2,V=(Ot&3)<<6|Et,te=te+String.fromCharCode(fe),Ot!==64&&(te=te+String.fromCharCode(h)),Et!==64&&(te=te+String.fromCharCode(V));while(Ct<$e.length);return te};function Tt($e){try{for(var ht=wt($e),te=new Uint8Array(ht.length),fe=0;fe<ht.length;++fe)te[fe]=ht.charCodeAt(fe);return te}catch{throw new Error("Converting base64 string to bytes failed.")}}function zt($e){if(ue($e))return Tt($e.slice(U.length))}var tn={Math,Int8Array,Int32Array,Uint8Array,Float32Array,Float64Array},Rn={b:u,c:p,d:pe,e:st,f:qe,g:Ve,h:ft,i:Ie,o:we,p:ie},le=function($e,ht,te){"almost asm";var fe=new $e.Int8Array(te),h=new $e.Int32Array(te);new $e.Uint8Array(te),new $e.Float32Array(te);var V=new $e.Float64Array(te),je=ht.o|0,It=ht.p|0,Ot=$e.Math.floor,Et=$e.Math.abs,Ct=$e.Math.sqrt,bn=$e.Math.pow,kt=$e.Math.cos,Pt=$e.Math.sin,Bn=$e.Math.tan,Ls=$e.Math.acos,kn=$e.Math.asin,ne=$e.Math.atan,ye=$e.Math.atan2,ze=$e.Math.ceil,ke=$e.Math.imul,Re=$e.Math.min,gt=$e.Math.max,mt=$e.Math.clz32,lt=ht.b,X=ht.c,xt=ht.d,cn=ht.e,nn=ht.f,zn=ht.g,Hn=ht.h,qi=ht.i,j=28640;function Vn(d){return fe=new Int8Array(d),h=new Int32Array(d),V=new Float64Array(d),te=d,!0}function rn(d){d=d|0;var f=0;return f=j,j=j+d|0,j=j+15&-16,f|0}function Ar(){return j|0}function Wn(d){d=d|0,j=d}function no(d,f){d=d|0,j=d}function jl(d,f){d=d|0,f=f|0;var A=0,_=0,y=0;return(d|0)<0?(f=2,f|0):(d|0)>13780509?(f=ey(15,f)|0,f|0):(A=((d|0)<0)<<31>>31,y=es(d|0,A|0,3,0)|0,_=X()|0,A=Kt(d|0,A|0,1,0)|0,A=es(y|0,_|0,A|0,X()|0)|0,A=Kt(A|0,X()|0,1,0)|0,d=X()|0,h[f>>2]=A,h[f+4>>2]=d,f=0,f|0)}function Zr(d,f,A,_){return d=d|0,f=f|0,A=A|0,_=_|0,Xl(d,f,A,_,0)|0}function Xl(d,f,A,_,y){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0;var S=0,T=0,E=0,L=0,B=0;if(L=j,j=j+16|0,T=L,!(pi(d,f,A,_,y)|0))return _=0,j=L,_|0;do if((A|0)>=0){if((A|0)>13780509){if(S=ey(15,T)|0,S|0)break;E=T,T=h[E>>2]|0,E=h[E+4>>2]|0}else S=((A|0)<0)<<31>>31,B=es(A|0,S|0,3,0)|0,E=X()|0,S=Kt(A|0,S|0,1,0)|0,S=es(B|0,E|0,S|0,X()|0)|0,S=Kt(S|0,X()|0,1,0)|0,E=X()|0,h[T>>2]=S,h[T+4>>2]=E,T=S;if(au(_|0,0,T<<3|0)|0,y|0){au(y|0,0,T<<2|0)|0,S=Hi(d,f,A,_,y,T,E,0)|0;break}S=Ro(T,4)|0,S?(B=Hi(d,f,A,_,S,T,E,0)|0,sn(S),S=B):S=13}else S=2;while(!1);return B=S,j=L,B|0}function pi(d,f,A,_,y){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0;var S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0;if(ve=j,j=j+16|0,oe=ve,ae=ve+8|0,ce=oe,h[ce>>2]=d,h[ce+4>>2]=f,(A|0)<0)return ae=2,j=ve,ae|0;if(S=_,h[S>>2]=d,h[S+4>>2]=f,S=(y|0)!=0,S&&(h[y>>2]=0),ci(d,f)|0)return ae=9,j=ve,ae|0;h[ae>>2]=0;e:do if((A|0)>=1)if(S)for(G=1,B=0,ee=0,ce=1,S=d;;){if(!(B|ee)){if(S=jn(S,f,4,ae,oe)|0,S|0)break e;if(f=oe,S=h[f>>2]|0,f=h[f+4>>2]|0,ci(S,f)|0){S=9;break e}}if(S=jn(S,f,h[26800+(ee<<2)>>2]|0,ae,oe)|0,S|0)break e;if(f=oe,S=h[f>>2]|0,f=h[f+4>>2]|0,d=_+(G<<3)|0,h[d>>2]=S,h[d+4>>2]=f,h[y+(G<<2)>>2]=ce,d=B+1|0,T=(d|0)==(ce|0),E=ee+1|0,L=(E|0)==6,ci(S,f)|0){S=9;break e}if(ce=ce+(L&T&1)|0,(ce|0)>(A|0)){S=0;break}else G=G+1|0,B=T?0:d,ee=T?L?0:E:ee}else for(G=1,B=0,ee=0,ce=1,S=d;;){if(!(B|ee)){if(S=jn(S,f,4,ae,oe)|0,S|0)break e;if(f=oe,S=h[f>>2]|0,f=h[f+4>>2]|0,ci(S,f)|0){S=9;break e}}if(S=jn(S,f,h[26800+(ee<<2)>>2]|0,ae,oe)|0,S|0)break e;if(f=oe,S=h[f>>2]|0,f=h[f+4>>2]|0,d=_+(G<<3)|0,h[d>>2]=S,h[d+4>>2]=f,d=B+1|0,T=(d|0)==(ce|0),E=ee+1|0,L=(E|0)==6,ci(S,f)|0){S=9;break e}if(ce=ce+(L&T&1)|0,(ce|0)>(A|0)){S=0;break}else G=G+1|0,B=T?0:d,ee=T?L?0:E:ee}else S=0;while(!1);return ae=S,j=ve,ae|0}function Hi(d,f,A,_,y,S,T,E){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0,S=S|0,T=T|0,E=E|0;var L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0,He=0;if(ve=j,j=j+16|0,oe=ve+8|0,ae=ve,L=wh(d|0,f|0,S|0,T|0)|0,G=X()|0,ee=_+(L<<3)|0,Te=ee,He=h[Te>>2]|0,Te=h[Te+4>>
38392]|0,B=(He|0)==(d|0)&(Te|0)==(f|0),!((He|0)==0&(Te|0)==0|B))do L=Kt(L|0,G|0,1,0)|0,L=Mh(L|0,X()|0,S|0,T|0)|0,G=X()|0,ee=_+(L<<3)|0,He=ee,Te=h[He>>2]|0,He=h[He+4>>2]|0,B=(Te|0)==(d|0)&(He|0)==(f|0);while(!((Te|0)==0&(He|0)==0|B));if(L=y+(L<<2)|0,B&&(h[L>>2]|0)<=(E|0)||(He=ee,h[He>>2]=d,h[He+4>>2]=f,h[L>>2]=E,(E|0)>=(A|0)))return He=0,j=ve,He|0;switch(B=E+1|0,h[oe>>2]=0,L=jn(d,f,2,oe,ae)|0,L|0){case 9:{ce=9;break}case 0:{L=ae,L=Hi(h[L>>2]|0,h[L+4>>2]|0,A,_,y,S,T,B)|0,L||(ce=9);break}}e:do if((ce|0)==9){switch(h[oe>>2]=0,L=jn(d,f,3,oe,ae)|0,L|0){case 9:break;case 0:{if(L=ae,L=Hi(h[L>>2]|0,h[L+4>>2]|0,A,_,y,S,T,B)|0,L|0)break e;break}default:break e}switch(h[oe>>2]=0,L=jn(d,f,1,oe,ae)|0,L|0){case 9:break;case 0:{if(L=ae,L=Hi(h[L>>2]|0,h[L+4>>2]|0,A,_,y,S,T,B)|0,L|0)break e;break}default:break e}switch(h[oe>>2]=0,L=jn(d,f,5,oe,ae)|0,L|0){case 9:break;case 0:{if(L=ae,L=Hi(h[L>>2]|0,h[L+4>>2]|0,A,_,y,S,T,B)|0,L|0)break e;break}default:break e}switch(h[oe>>2]=0,L=jn(d,f,4,oe,ae)|0,L|0){case 9:break;case 0:{if(L=ae,L=Hi(h[L>>2]|0,h[L+4>>2]|0,A,_,y,S,T,B)|0,L|0)break e;break}default:break e}switch(h[oe>>2]=0,L=jn(d,f,6,oe,ae)|0,L|0){case 9:break;case 0:{if(L=ae,L=Hi(h[L>>2]|0,h[L+4>>2]|0,A,_,y,S,T,B)|0,L|0)break e;break}default:break e}return He=0,j=ve,He|0}while(!1);return He=L,j=ve,He|0}function jn(d,f,A,_,y){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0;var S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0;if(A>>>0>6)return y=1,y|0;if(ee=(h[_>>2]|0)%6|0,h[_>>2]=ee,(ee|0)>0){S=0;do A=ru(A)|0,S=S+1|0;while((S|0)<(h[_>>2]|0))}if(ee=pt(d|0,f|0,45)|0,X()|0,G=ee&127,G>>>0>121)return y=5,y|0;L=Ns(d,f)|0,S=pt(d|0,f|0,52)|0,X()|0,S=S&15;e:do if(!S)B=8;else{for(;;){if(T=(15-S|0)*3|0,E=pt(d|0,f|0,T|0)|0,X()|0,E=E&7,(E|0)==7){f=5;break}if(ae=(To(S)|0)==0,S=S+-1|0,ce=bt(7,0,T|0)|0,f=f&~(X()|0),oe=bt(h[(ae?432:16)+(E*28|0)+(A<<2)>>2]|0,0,T|0)|0,T=X()|0,A=h[(ae?640:224)+(E*28|0)+(A<<2)>>2]|0,d=oe|d&~ce,f=T|f,!A){A=0;break e}if(!S){B=8;break e}}return f|0}while(!1);(B|0)==8&&(ae=h[848+(G*28|0)+(A<<2)>>2]|0,oe=bt(ae|0,0,45)|0,d=oe|d,f=X()|0|f&-1040385,A=h[4272+(G*28|0)+(A<<2)>>2]|0,(ae&127|0)==127&&(ae=bt(h[848+(G*28|0)+20>>2]|0,0,45)|0,f=X()|0|f&-1040385,A=h[4272+(G*28|0)+20>>2]|0,d=su(ae|d,f)|0,f=X()|0,h[_>>2]=(h[_>>2]|0)+1)),E=pt(d|0,f|0,45)|0,X()|0,E=E&127;e:do if(Mi(E)|0){t:do if((Ns(d,f)|0)==1){if((G|0)!=(E|0))if(cT(E,h[7696+(G*28|0)>>2]|0)|0){d=Xv(d,f)|0,T=1,f=X()|0;break}else xt(27795,26864,436,26872);switch(L|0){case 3:{d=su(d,f)|0,f=X()|0,h[_>>2]=(h[_>>2]|0)+1,T=0;break t}case 5:{d=Xv(d,f)|0,f=X()|0,h[_>>2]=(h[_>>2]|0)+5,T=0;break t}case 0:return ae=9,ae|0;default:return ae=1,ae|0}}else T=0;while(!1);if((A|0)>0){S=0;do d=jv(d,f)|0,f=X()|0,S=S+1|0;while((S|0)!=(A|0))}if((G|0)!=(E|0)){if(!(Bv(E)|0)){if((T|0)!=0|(Ns(d,f)|0)!=5)break;h[_>>2]=(h[_>>2]|0)+1;break}switch(ee&127){case 8:case 118:break e}(Ns(d,f)|0)!=3&&(h[_>>2]=(h[_>>2]|0)+1)}}else if((A|0)>0){S=0;do d=su(d,f)|0,f=X()|0,S=S+1|0;while((S|0)!=(A|0))}while(!1);return h[_>>2]=((h[_>>2]|0)+A|0)%6|0,ae=y,h[ae>>2]=d,h[ae+4>>2]=f,ae=0,ae|0}function mr(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0,B=0;for(E=j,j=j+16|0,S=E,T=E+8|0,y=(ci(d,f)|0)==0,y=y?1:2;;){if(h[T>>2]=0,B=(jn(d,f,y,T,S)|0)==0,L=S,B&((h[L>>2]|0)==(A|0)?(h[L+4>>2]|0)==(_|0):0)){d=4;break}if(y=y+1|0,y>>>0>=7){y=7,d=4;break}}return(d|0)==4?(j=E,y|0):0}function Kr(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0;if(ae=j,j=j+16|0,ce=ae,oe=ae+8|0,ee=ce,h[ee>>
38392]=d,h[ee+4>>2]=f,!A)return oe=_,h[oe>>2]=d,h[oe+4>>2]=f,oe=0,j=ae,oe|0;h[oe>>2]=0;e:do if(ci(d,f)|0)d=9;else{if(S=(A|0)>0,S){y=0,ee=d;do{if(d=jn(ee,f,4,oe,ce)|0,d|0)break e;if(f=ce,ee=h[f>>2]|0,f=h[f+4>>2]|0,y=y+1|0,ci(ee,f)|0){d=9;break e}}while((y|0)<(A|0));if(G=_,h[G>>2]=ee,h[G+4>>2]=f,G=A+-1|0,S){B=0,d=1;do{if(y=26800+(B<<2)|0,(B|0)==5)for(T=h[y>>2]|0,S=0,y=d;;){if(d=ce,d=jn(h[d>>2]|0,h[d+4>>2]|0,T,oe,ce)|0,d|0)break e;if((S|0)!=(G|0))if(L=ce,E=h[L>>2]|0,L=h[L+4>>2]|0,d=_+(y<<3)|0,h[d>>2]=E,h[d+4>>2]=L,!(ci(E,L)|0))d=y+1|0;else{d=9;break e}else d=y;if(S=S+1|0,(S|0)>=(A|0))break;y=d}else for(T=ce,L=h[y>>2]|0,E=0,y=d,S=h[T>>2]|0,T=h[T+4>>2]|0;;){if(d=jn(S,T,L,oe,ce)|0,d|0)break e;if(T=ce,S=h[T>>2]|0,T=h[T+4>>2]|0,d=_+(y<<3)|0,h[d>>2]=S,h[d+4>>2]=T,d=y+1|0,ci(S,T)|0){d=9;break e}if(E=E+1|0,(E|0)>=(A|0))break;y=d}B=B+1|0}while(B>>>0<6);d=ce,T=ee,y=h[d>>2]|0,S=f,d=h[d+4>>2]|0}else T=ee,y=ee,S=f,d=f}else T=_,h[T>>2]=d,h[T+4>>2]=f,T=d,y=d,S=f,d=f;d=(T|0)==(y|0)&(S|0)==(d|0)?0:9}while(!1);return oe=d,j=ae,oe|0}function lp(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0,B=0;if(E=j,j=j+48|0,y=E+16|0,S=E+8|0,T=E,A=pp(A)|0,A|0)return T=A,j=E,T|0;if(B=d,L=h[B+4>>2]|0,A=S,h[A>>2]=h[B>>2],h[A+4>>2]=L,IT(S,y),A=fT(y,f,T)|0,!A){if(f=h[S>>2]|0,S=h[d+8>>2]|0,(S|0)>0){y=h[d+12>>2]|0,A=0;do f=(h[y+(A<<3)>>2]|0)+f|0,A=A+1|0;while((A|0)<(S|0))}A=T,y=h[A>>2]|0,A=h[A+4>>2]|0,S=((f|0)<0)<<31>>31,(A|0)<(S|0)|(A|0)==(S|0)&y>>>0<f>>>0?(A=T,h[A>>2]=f,h[A+4>>2]=S,A=S):f=y,L=Kt(f|0,A|0,12,0)|0,B=X()|0,A=T,h[A>>2]=L,h[A+4>>2]=B,A=_,h[A>>2]=L,h[A+4>>2]=B,A=0}return B=A,j=E,B|0}function Sa(d,f,A,_,y,S,T){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0,S=S|0,T=T|0;var E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0,He=0,De=0,Le=0,xe=0,yt=0,Ht=0,Vt=0,hn=0,mn=0,Cn=0,on=0,Wt=0,_t=0,Mn=0,ii=0,vn=0,ri=0,As=0,XT=0;if(ii=j,j=j+64|0,on=ii+48|0,Wt=ii+32|0,_t=ii+24|0,yt=ii+8|0,Ht=ii,L=h[d>>2]|0,(L|0)<=0)return Mn=0,j=ii,Mn|0;for(Vt=d+4|0,hn=on+8|0,mn=Wt+8|0,Cn=yt+8|0,E=0,Le=0;;){B=h[Vt>>2]|0,De=B+(Le<<4)|0,h[on>>2]=h[De>>2],h[on+4>>2]=h[De+4>>2],h[on+8>>2]=h[De+8>>2],h[on+12>>2]=h[De+12>>2],(Le|0)==(L+-1|0)?(h[Wt>>2]=h[B>>2],h[Wt+4>>2]=h[B+4>>2],h[Wt+8>>2]=h[B+8>>2],h[Wt+12>>2]=h[B+12>>2]):(De=B+(Le+1<<4)|0,h[Wt>>2]=h[De>>2],h[Wt+4>>2]=h[De+4>>2],h[Wt+8>>2]=h[De+8>>2],h[Wt+12>>2]=h[De+12>>2]),L=EB(on,Wt,_,_t)|0;e:do if(L)B=0,E=L;else if(L=_t,B=h[L>>2]|0,L=h[L+4>>2]|0,(L|0)>0|(L|0)==0&B>>>0>0){He=0,De=0;t:for(;;){if(ri=1/(+(B>>>0)+4294967296*+(L|0)),XT=+V[on>>3],L=zr(B|0,L|0,He|0,De|0)|0,As=+(L>>>0)+4294967296*+(X()|0),vn=+(He>>>0)+4294967296*+(De|0),V[yt>>3]=ri*(XT*As)+ri*(+V[Wt>>3]*vn),V[Cn>>3]=ri*(+V[hn>>3]*As)+ri*(+V[mn>>3]*vn),L=Yv(yt,_,Ht)|0,L|0){E=L;break}Te=Ht,ve=h[Te>>2]|0,Te=h[Te+4>>2]|0,ce=wh(ve|0,Te|0,f|0,A|0)|0,G=X()|0,L=T+(ce<<3)|0,ee=L,B=h[ee>>2]|0,ee=h[ee+4>>2]|0;n:do if((B|0)==0&(ee|0)==0)xe=L,Mn=16;else for(oe=0,ae=0;;){if((oe|0)>(A|0)|(oe|0)==(A|0)&ae>>>0>f>>>0){E=1;break t}if((B|0)==(ve|0)&(ee|0)==(Te|0))break n;if(L=Kt(ce|0,G|0,1,0)|0,ce=Mh(L|0,X()|0,f|0,A|0)|0,G=X()|0,ae=Kt(ae|0,oe|0,1,0)|0,oe=X()|0,L=T+(ce<<3)|0,ee=L,B=h[ee>>2]|0,ee=h[ee+4>>2]|0,(B|0)==0&(ee|0)==0){xe=L,Mn=16;break}}while(!1);if((Mn|0)==16&&(Mn=0,!((ve|0)==0&(Te|0)==0))&&(ae=xe,h[ae>>2]=ve,h[ae+4>>2]=Te,ae=S+(h[y>>2]<<3)|0,h[ae>>2]=ve,h[ae+4>>2]=Te,ae=y,ae=Kt(h[ae>>2]|0,h[ae+4>>2]|0,1,0)|0,ve=X()|0,Te=y,h[Te>>2]=ae,h[Te+4>>2]=ve),He=Kt(He|0,De|0,1,0)|0,De=X()|0,L=_t,B=h[L>>2]|0,L=h[L+4>>2]|0,!((L|0)>(De|0)|(L|0)==(De|0)&B>>>0>He>>>0)){B=1;break e}}B=0}else B=1;while(!1);if(Le=Le+1|0,!B){Mn=21;break}if(L=h[d>>2]|0,(Le|0)>=(L|0)){E=0,Mn=21;break}}return(Mn|0)==21?(j=ii,E|0):0}function mB(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0,He=0,De=0,Le=0,xe=0,yt=0,Ht=0,Vt=0,hn=0,mn=0,Cn=0,on=0,Wt=0,_t=0,Mn=0,ii=0,vn=0,ri=0,As=0;if(As=j,j=j+112|0,Mn=As+80|0,L=As+72|0,ii=As,vn=As+56|0,y=pp(A)|0,y|0)return ri=y,j=As,ri|0;if(B=d+8|0,ri=Ma((h[B>>2]<<5)+32|0)|0,!ri)return ri=13,j=As,ri|0;if(iy(d,ri),y=pp(A)|0,!y){if(Wt=d,_t=h[Wt+4>>2]|0,y=L,h[y>>2]=h[Wt>>2],h[y+4>>2]=_t,IT(L,Mn),y=fT(Mn,f,ii)|0,y)Wt=0,_t=0;else{if(y=h[L>>2]|0,S=h[B>>2]|0,(S|0)>0){T=h[d+12>>2]|0,A=0;do y=(h[T+(A<<3)>>2]|0)+y|0,A=A+1|0;
3839while((A|0)!=(S|0));A=y}else A=y;y=ii,S=h[y>>2]|0,y=h[y+4>>2]|0,T=((A|0)<0)<<31>>31,(y|0)<(T|0)|(y|0)==(T|0)&S>>>0<A>>>0?(y=ii,h[y>>2]=A,h[y+4>>2]=T,y=T):A=S,Wt=Kt(A|0,y|0,12,0)|0,_t=X()|0,y=ii,h[y>>2]=Wt,h[y+4>>2]=_t,y=0}if(!y){if(A=Ro(Wt,8)|0,!A)return sn(ri),ri=13,j=As,ri|0;if(E=Ro(Wt,8)|0,!E)return sn(ri),sn(A),ri=13,j=As,ri|0;Cn=Mn,h[Cn>>2]=0,h[Cn+4>>2]=0,Cn=d,on=h[Cn+4>>2]|0,y=L,h[y>>2]=h[Cn>>2],h[y+4>>2]=on,y=Sa(L,Wt,_t,f,Mn,A,E)|0;e:do if(y)sn(A),sn(E),sn(ri);else{t:do if((h[B>>2]|0)>0){for(T=d+12|0,S=0;y=Sa((h[T>>2]|0)+(S<<3)|0,Wt,_t,f,Mn,A,E)|0,S=S+1|0,!(y|0);)if((S|0)>=(h[B>>2]|0))break t;sn(A),sn(E),sn(ri);break e}while(!1);(_t|0)>0|(_t|0)==0&Wt>>>0>0&&au(E|0,0,Wt<<3|0)|0,on=Mn,Cn=h[on+4>>2]|0;t:do if((Cn|0)>0|(Cn|0)==0&(h[on>>2]|0)>>>0>0){Vt=A,hn=E,mn=A,Cn=E,on=A,y=A,xe=A,yt=E,Ht=E,A=E;n:for(;;){for(Te=0,He=0,De=0,Le=0,S=0,T=0;;){E=ii,L=E+56|0;do h[E>>2]=0,E=E+4|0;while((E|0)<(L|0));if(f=Vt+(Te<<3)|0,B=h[f>>2]|0,f=h[f+4>>2]|0,pi(B,f,1,ii,0)|0){E=ii,L=E+56|0;do h[E>>2]=0,E=E+4|0;while((E|0)<(L|0));E=Ro(7,4)|0,E|0&&(Hi(B,f,1,ii,E,7,0,0)|0,sn(E))}for(ve=0;;){ae=ii+(ve<<3)|0,oe=h[ae>>2]|0,ae=h[ae+4>>2]|0;i:do if((oe|0)==0&(ae|0)==0)E=S,L=T;else{if(G=wh(oe|0,ae|0,Wt|0,_t|0)|0,B=X()|0,E=_+(G<<3)|0,f=E,L=h[f>>2]|0,f=h[f+4>>2]|0,!((L|0)==0&(f|0)==0)){ee=0,ce=0;do{if((ee|0)>(_t|0)|(ee|0)==(_t|0)&ce>>>0>Wt>>>0)break n;if((L|0)==(oe|0)&(f|0)==(ae|0)){E=S,L=T;break i}E=Kt(G|0,B|0,1,0)|0,G=Mh(E|0,X()|0,Wt|0,_t|0)|0,B=X()|0,ce=Kt(ce|0,ee|0,1,0)|0,ee=X()|0,E=_+(G<<3)|0,f=E,L=h[f>>2]|0,f=h[f+4>>2]|0}while(!((L|0)==0&(f|0)==0))}if((oe|0)==0&(ae|0)==0){E=S,L=T;break}ou(oe,ae,vn)|0,ry(d,ri,vn)|0&&(ce=Kt(S|0,T|0,1,0)|0,T=X()|0,ee=E,h[ee>>2]=oe,h[ee+4>>2]=ae,S=hn+(S<<3)|0,h[S>>2]=oe,h[S+4>>2]=ae,S=ce),E=S,L=T}while(!1);if(ve=ve+1|0,ve>>>0>=7)break;S=E,T=L}if(Te=Kt(Te|0,He|0,1,0)|0,He=X()|0,De=Kt(De|0,Le|0,1,0)|0,Le=X()|0,T=Mn,S=h[T>>2]|0,T=h[T+4>>2]|0,(Le|0)<(T|0)|(Le|0)==(T|0)&De>>>0<S>>>0)S=E,T=L;else break}if((T|0)>0|(T|0)==0&S>>>0>0){S=0,T=0;do Le=Vt+(S<<3)|0,h[Le>>2]=0,h[Le+4>>2]=0,S=Kt(S|0,T|0,1,0)|0,T=X()|0,Le=Mn,De=h[Le+4>>2]|0;while((T|0)<(De|0)|((T|0)==(De|0)?S>>>0<(h[Le>>2]|0)>>>0:0))}if(Le=Mn,h[Le>>2]=E,h[Le+4>>2]=L,(L|0)>0|(L|0)==0&E>>>0>0)ve=A,Te=Ht,He=on,De=yt,Le=hn,A=xe,Ht=y,yt=mn,xe=ve,y=Te,on=Cn,Cn=He,mn=De,hn=Vt,Vt=Le;else break t}sn(mn),sn(Cn),sn(ri),y=1;break e}else y=E;while(!1);sn(ri),sn(A),sn(y),y=0}while(!1);return ri=y,j=As,ri|0}}return sn(ri),ri=y,j=As,ri|0}function gB(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0;if(G=j,j=j+176|0,L=G,(f|0)<1)return kT(A,0,0),B=0,j=G,B|0;for(E=d,E=pt(h[E>>2]|0,h[E+4>>2]|0,52)|0,X()|0,kT(A,(f|0)>6?f:6,E&15),E=0;_=d+(E<<3)|0,_=bh(h[_>>2]|0,h[_+4>>2]|0,L)|0,!(_|0);){if(_=h[L>>2]|0,(_|0)>0){T=0;do S=L+8+(T<<4)|0,T=T+1|0,_=L+8+(((T|0)%(_|0)|0)<<4)|0,y=WF(A,_,S)|0,y?GT(A,y)|0:HF(A,S,_)|0,_=h[L>>2]|0;while((T|0)<(_|0))}if(E=E+1|0,(E|0)>=(f|0)){_=0,B=13;break}}return(B|0)==13?(j=G,_|0):(zT(A),B=_,j=G,B|0)}function _B(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0;if(S=j,j=j+32|0,_=S,y=S+16|0,d=gB(d,f,y)|0,d|0)return A=d,j=S,A|0;if(h[A>>2]=0,h[A+4>>2]=0,h[A+8>>2]=0,d=VT(y)|0,d|0)do{f=vF(A)|0;do yF(f,d)|0,T=d+16|0,h[_>>2]=h[T>>2],h[_+4>>2]=h[T+4>>2],h[_+8>>2]=h[T+8>>2],h[_+12>>2]=h[T+12>>2],GT(y,d)|0,d=$F(y,_)|0;while((d|0)!=0);d=VT(y)|0}while((d|0)!=0);return zT(y),d=xF(A)|0,d?(PT(A),T=d,j=S,T|0):(T=0,j=S,T|0)}function Mi(d){return d=d|0,d>>>0>121?(d=0,d|0):(d=h[7696+(d*28|0)+16>>2]|0,d|0)}function Bv(d){return d=d|0,(d|0)==4|(d|0)==117|0}function lT(d){return d=d|0,h[11120+((h[d>>2]|0)*216|0)+((h[d+4>>2]|0)*72|0)+((h[d+8>>2]|0)*24|0)+(h[d+12>>2]<<3)>>2]|0}function vB(d){return d=d|0,h[11120+((h[d>>2]|0)*216|0)+((h[d+4>>2]|0)*72|0)+((h[d+8>>2]|0)*24|0)+(h[d+12>>2]<<3)+4>>2]|0}function yB(d,f){d=d|0,f=f|0,d=7696+(d*28|0)|0,h[f>>2]=h[d>>2],h[f+4>>2]=h[d+4>>2],h[f+8>>2]=h[d+8>>2],h[f+12>>2]=h[d+12>>2]}function xB(d,f){d=d|0,f=f|0;var A=0,_=0;if(f>>>0>20)return f=-1,f|0;do if((h[11120+(f*216|0)>>2]|0)!=(d|0))if((h[11120+(f*216|0)+8>>2]|0)!=(d|0))if((h[11120+(f*216|0)+16>>2]|0)!=(d|0))if((h[11120+(f*216|0)+24>>2]|0)!=(d|0))if((h[11120+(f*216|0)+32>>
38392]|0)!=(d|0))if((h[11120+(f*216|0)+40>>2]|0)!=(d|0))if((h[11120+(f*216|0)+48>>2]|0)!=(d|0))if((h[11120+(f*216|0)+56>>2]|0)!=(d|0))if((h[11120+(f*216|0)+64>>2]|0)!=(d|0))if((h[11120+(f*216|0)+72>>2]|0)!=(d|0))if((h[11120+(f*216|0)+80>>2]|0)!=(d|0))if((h[11120+(f*216|0)+88>>2]|0)!=(d|0))if((h[11120+(f*216|0)+96>>2]|0)!=(d|0))if((h[11120+(f*216|0)+104>>2]|0)!=(d|0))if((h[11120+(f*216|0)+112>>2]|0)!=(d|0))if((h[11120+(f*216|0)+120>>2]|0)!=(d|0))if((h[11120+(f*216|0)+128>>2]|0)!=(d|0))if((h[11120+(f*216|0)+136>>2]|0)==(d|0))d=2,A=1,_=2;else{if((h[11120+(f*216|0)+144>>2]|0)==(d|0)){d=0,A=2,_=0;break}if((h[11120+(f*216|0)+152>>2]|0)==(d|0)){d=0,A=2,_=1;break}if((h[11120+(f*216|0)+160>>2]|0)==(d|0)){d=0,A=2,_=2;break}if((h[11120+(f*216|0)+168>>2]|0)==(d|0)){d=1,A=2,_=0;break}if((h[11120+(f*216|0)+176>>2]|0)==(d|0)){d=1,A=2,_=1;break}if((h[11120+(f*216|0)+184>>2]|0)==(d|0)){d=1,A=2,_=2;break}if((h[11120+(f*216|0)+192>>2]|0)==(d|0)){d=2,A=2,_=0;break}if((h[11120+(f*216|0)+200>>2]|0)==(d|0)){d=2,A=2,_=1;break}if((h[11120+(f*216|0)+208>>2]|0)==(d|0)){d=2,A=2,_=2;break}else d=-1;return d|0}else d=2,A=1,_=1;else d=2,A=1,_=0;else d=1,A=1,_=2;else d=1,A=1,_=1;else d=1,A=1,_=0;else d=0,A=1,_=2;else d=0,A=1,_=1;else d=0,A=1,_=0;else d=2,A=0,_=2;else d=2,A=0,_=1;else d=2,A=0,_=0;else d=1,A=0,_=2;else d=1,A=0,_=1;else d=1,A=0,_=0;else d=0,A=0,_=2;else d=0,A=0,_=1;else d=0,A=0,_=0;while(!1);return f=h[11120+(f*216|0)+(A*72|0)+(d*24|0)+(_<<3)+4>>2]|0,f|0}function cT(d,f){return d=d|0,f=f|0,(h[7696+(d*28|0)+20>>2]|0)==(f|0)?(f=1,f|0):(f=(h[7696+(d*28|0)+24>>2]|0)==(f|0),f|0)}function Fv(d,f){return d=d|0,f=f|0,h[848+(d*28|0)+(f<<2)>>2]|0}function Uv(d,f){return d=d|0,f=f|0,(h[848+(d*28|0)>>2]|0)==(f|0)?(f=0,f|0):(h[848+(d*28|0)+4>>2]|0)==(f|0)?(f=1,f|0):(h[848+(d*28|0)+8>>2]|0)==(f|0)?(f=2,f|0):(h[848+(d*28|0)+12>>2]|0)==(f|0)?(f=3,f|0):(h[848+(d*28|0)+16>>2]|0)==(f|0)?(f=4,f|0):(h[848+(d*28|0)+20>>2]|0)==(f|0)?(f=5,f|0):((h[848+(d*28|0)+24>>2]|0)==(f|0)?6:7)|0}function bB(){return 122}function SB(d){d=d|0;var f=0,A=0,_=0;f=0;do bt(f|0,0,45)|0,_=X()|0|134225919,A=d+(f<<3)|0,h[A>>2]=-1,h[A+4>>2]=_,f=f+1|0;while((f|0)!=122);return 0}function MB(d){d=d|0;var f=0,A=0,_=0;return _=+V[d+16>>3],A=+V[d+24>>3],f=_-A,+(_<A?f+6.283185307179586:f)}function uT(d){return d=d|0,+V[d+16>>3]<+V[d+24>>3]|0}function wB(d){return d=d|0,+(+V[d>>3]-+V[d+8>>3])}function Ov(d,f){d=d|0,f=f|0;var A=0,_=0,y=0;return A=+V[f>>3],!(A>=+V[d+8>>3])||!(A<=+V[d>>3])?(f=0,f|0):(_=+V[d+16>>3],A=+V[d+24>>3],y=+V[f+8>>3],f=y>=A,d=y<=_&1,_<A?f&&(d=1):f||(d=0),f=(d|0)!=0,f|0)}function kv(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0;return+V[d>>3]<+V[f+8>>3]||+V[d+8>>3]>+V[f>>3]?(_=0,_|0):(S=+V[d+16>>3],A=d+24|0,G=+V[A>>3],T=S<G,_=f+16|0,B=+V[_>>3],y=f+24|0,L=+V[y>>3],E=B<L,f=G-B<L-S,d=T?E|f?1:2:0,f=E?T?1:f?2:1:0,S=+io(S,d),S<+io(+V[y>>3],f)||(G=+io(+V[A>>3],d),G>+io(+V[_>>3],f))?(E=0,E|0):(E=1,E|0))}function TB(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0;S=+V[d+16>>3],L=+V[d+24>>3],d=S<L,E=+V[f+16>>3],T=+V[f+24>>3],y=E<T,f=L-E<T-S,h[A>>2]=d?y|f?1:2:0,h[_>>2]=y?d?1:f?2:1:0}function hT(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0;return+V[d>>3]<+V[f>>3]||+V[d+8>>3]>+V[f+8>>3]?(_=0,_|0):(_=d+16|0,L=+V[_>>3],S=+V[d+24>>3],T=L<S,A=f+16|0,G=+V[A>>3],y=f+24|0,B=+V[y>>3],E=G<B,f=S-G<B-L,d=T?E|f?1:2:0,f=E?T?1:f?2:1:0,S=+io(S,d),S<=+io(+V[y>>3],f)?(G=+io(+V[_>>3],d),E=G>=+io(+V[A>>3],f),E|0):(E=0,E|0))}function dT(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0,E=0;y=j,j=j+176|0,_=y,h[_>>2]=4,E=+V[f>>3],V[_+8>>3]=E,S=+V[f+16>>3],V[_+16>>3]=S,V[_+24>>3]=E,E=+V[f+24>>3],V[_+32>>3]=E,T=+V[f+8>>3],V[_+40>>3]=T,V[_+48>>3]=E,V[_+56>>3]=T,V[_+64>>3]=S,f=_+72|0,A=f+96|0;do h[f>>2]=0,f=f+4|0;while((f|0)<(A|0));Th(d|0,_|0,168)|0,j=y}function fT(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0;ae=j,j=j+288|0,G=ae+264|0,ee=ae+96|0,B=ae,E=B,L=E+96|0;do h[E>>2]=0,E=E+4|0;while((E|0)<(L|0));return f=Zv(f,B)|0,f|0?(oe=f,j=ae,oe|0):(L=B,B=h[L>>2]|0,L=h[L+4>>2]|0,ou(B,L,G)|0,bh(B,L,ee)|0,T=+dp(G,ee+8|0),V[G>>3]=+V[d>>3],L=G+8|0,V[L>>3]=+V[d+16>>3],V[ee>>3]=+V[d+8>>3],B=ee+8|0,V[B>>3]=+V[d+24>>3],y=+dp(G,ee),Te=+V[L>>3]-+V[B>>3],S=+Et(+Te),ve=+V[G>>3]-+V[ee>>3],_=+Et(+ve),!(Te==0|ve==0)&&(Te=+$T(+S,+_),Te=+ze(+(y*y/+hm(+(Te/+hm(+S,+_)),3)/(T*(T*2.59807621135)*.8))),V[je>>3]=Te,ce=~~Te>>>0,oe=+Et(Te)>=1?Te>0?~~+Re(+Ot(Te/4294967296),4294967295)>>>0:~~+ze((Te-+(~~Te>>>0))/4294967296)>>>0:0,(h[je+4>>2]&2146435072|0)!=2146435072)?(ee=(ce|0)==0&(oe|0)==0,f=A,h[f>>2]=ee?1:ce,h[f+4>>2]=ee?0:oe,f=0):f=1,oe=f,j=ae,oe|0)}function EB(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0,B=0,G=0;B=j,j=j+288|0,T=B+264|0,E=B+96|0,L=B,y=L,S=y+96|0;do h[y>>2]=0,y=y+4|0;
3839while((y|0)<(S|0));return A=Zv(A,L)|0,A|0?(_=A,j=B,_|0):(A=L,y=h[A>>2]|0,A=h[A+4>>2]|0,ou(y,A,T)|0,bh(y,A,E)|0,G=+dp(T,E+8|0),G=+ze(+(+dp(d,f)/(G*2))),V[je>>3]=G,A=~~G>>>0,y=+Et(G)>=1?G>0?~~+Re(+Ot(G/4294967296),4294967295)>>>0:~~+ze((G-+(~~G>>>0))/4294967296)>>>0:0,(h[je+4>>2]&2146435072|0)==2146435072?(_=1,j=B,_|0):(L=(A|0)==0&(y|0)==0,h[_>>2]=L?1:A,h[_+4>>2]=L?0:y,_=0,j=B,_|0))}function RB(d,f){d=d|0,f=+f;var A=0,_=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0;S=d+16|0,T=+V[S>>3],A=d+24|0,y=+V[A>>3],_=T-y,_=T<y?_+6.283185307179586:_,B=+V[d>>3],E=d+8|0,L=+V[E>>3],G=B-L,_=(_*f-_)*.5,f=(G*f-G)*.5,B=B+f,V[d>>3]=B>1.5707963267948966?1.5707963267948966:B,f=L-f,V[E>>3]=f<-1.5707963267948966?-1.5707963267948966:f,f=T+_,f=f>3.141592653589793?f+-6.283185307179586:f,V[S>>3]=f<-3.141592653589793?f+6.283185307179586:f,f=y-_,f=f>3.141592653589793?f+-6.283185307179586:f,V[A>>3]=f<-3.141592653589793?f+6.283185307179586:f}function CB(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0,h[d>>2]=f,h[d+4>>2]=A,h[d+8>>2]=_}function PB(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0;ee=f+8|0,h[ee>>2]=0,L=+V[d>>3],T=+Et(+L),B=+V[d+8>>3],E=+Et(+B)*1.1547005383792515,T=T+E*.5,A=~~T,d=~~E,T=T-+(A|0),E=E-+(d|0);do if(T<.5)if(T<.3333333333333333)if(h[f>>2]=A,E<(T+1)*.5){h[f+4>>2]=d;break}else{d=d+1|0,h[f+4>>2]=d;break}else if(ce=1-T,d=(!(E<ce)&1)+d|0,h[f+4>>2]=d,ce<=E&E<T*2){A=A+1|0,h[f>>2]=A;break}else{h[f>>2]=A;break}else{if(!(T<.6666666666666666))if(A=A+1|0,h[f>>2]=A,E<T*.5){h[f+4>>2]=d;break}else{d=d+1|0,h[f+4>>2]=d;break}if(E<1-T){if(h[f+4>>2]=d,T*2+-1<E){h[f>>2]=A;break}}else d=d+1|0,h[f+4>>2]=d;A=A+1|0,h[f>>2]=A}while(!1);do if(L<0)if(d&1){G=(d+1|0)/2|0,G=zr(A|0,((A|0)<0)<<31>>31|0,G|0,((G|0)<0)<<31>>31|0)|0,A=~~(+(A|0)-((+(G>>>0)+4294967296*+(X()|0))*2+1)),h[f>>2]=A;break}else{G=(d|0)/2|0,G=zr(A|0,((A|0)<0)<<31>>31|0,G|0,((G|0)<0)<<31>>31|0)|0,A=~~(+(A|0)-(+(G>>>0)+4294967296*+(X()|0))*2),h[f>>2]=A;break}while(!1);G=f+4|0,B<0&&(A=A-((d<<1|1|0)/2|0)|0,h[f>>2]=A,d=0-d|0,h[G>>2]=d),_=d-A|0,(A|0)<0?(y=0-A|0,h[G>>2]=_,h[ee>>2]=y,h[f>>2]=0,d=_,A=0):y=0,(d|0)<0&&(A=A-d|0,h[f>>2]=A,y=y-d|0,h[ee>>2]=y,h[G>>2]=0,d=0),S=A-y|0,_=d-y|0,(y|0)<0&&(h[f>>2]=S,h[G>>2]=_,h[ee>>2]=0,d=_,A=S,y=0),_=(d|0)<(A|0)?d:A,_=(y|0)<(_|0)?y:_,!((_|0)<=0)&&(h[f>>2]=A-_,h[G>>2]=d-_,h[ee>>2]=y-_)}function Jr(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0;f=h[d>>2]|0,T=d+4|0,A=h[T>>2]|0,(f|0)<0&&(A=A-f|0,h[T>>2]=A,S=d+8|0,h[S>>2]=(h[S>>2]|0)-f,h[d>>2]=0,f=0),(A|0)<0?(f=f-A|0,h[d>>2]=f,S=d+8|0,y=(h[S>>2]|0)-A|0,h[S>>2]=y,h[T>>2]=0,A=0):(y=d+8|0,S=y,y=h[y>>2]|0),(y|0)<0&&(f=f-y|0,h[d>>2]=f,A=A-y|0,h[T>>2]=A,h[S>>2]=0,y=0),_=(A|0)<(f|0)?A:f,_=(y|0)<(_|0)?y:_,!((_|0)<=0)&&(h[d>>2]=f-_,h[T>>2]=A-_,h[S>>2]=y-_)}function nu(d,f){d=d|0,f=f|0;var A=0,_=0;_=h[d+8>>2]|0,A=+((h[d+4>>2]|0)-_|0),V[f>>3]=+((h[d>>2]|0)-_|0)-A*.5,V[f+8>>3]=A*.8660254037844386}function ps(d,f,A){d=d|0,f=f|0,A=A|0,h[A>>2]=(h[f>>2]|0)+(h[d>>2]|0),h[A+4>>2]=(h[f+4>>2]|0)+(h[d+4>>2]|0),h[A+8>>2]=(h[f+8>>2]|0)+(h[d+8>>2]|0)}function zv(d,f,A){d=d|0,f=f|0,A=A|0,h[A>>2]=(h[d>>2]|0)-(h[f>>2]|0),h[A+4>>2]=(h[d+4>>2]|0)-(h[f+4>>2]|0),h[A+8>>2]=(h[d+8>>2]|0)-(h[f+8>>2]|0)}function pT(d,f){d=d|0,f=f|0;var A=0,_=0;A=ke(h[d>>2]|0,f)|0,h[d>>2]=A,A=d+4|0,_=ke(h[A>>2]|0,f)|0,h[A>>2]=_,d=d+8|0,f=ke(h[d>>2]|0,f)|0,h[d>>2]=f}function sm(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0;T=h[d>>2]|0,E=(T|0)<0,_=(h[d+4>>2]|0)-(E?T:0)|0,S=(_|0)<0,y=(S?0-_|0:0)+((h[d+8>>2]|0)-(E?T:0))|0,A=(y|0)<0,d=A?0:y,f=(S?0:_)-(A?y:0)|0,y=(E?0:T)-(S?_:0)-(A?y:0)|0,A=(f|0)<(y|0)?f:y,A=(d|0)<(A|0)?d:A,_=(A|0)>0,d=d-(_?A:0)|0,f=f-(_?A:0)|0;e:do switch(y-(_?A:0)|0){case 0:switch(f|0){case 0:return E=(d|0)==0?0:(d|0)==1?1:7,E|0;case 1:return E=(d|0)==0?2:(d|0)==1?3:7,E|0;default:break e}case 1:switch(f|0){case 0:return E=(d|0)==0?4:(d|0)==1?5:7,E|0;case 1:{if(!d)d=6;else break e;return d|0}default:break e}}while(!1);return E=7,E|0}function LB(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0,L=0,B=0;if(L=d+8|0,T=h[L>>2]|0,E=(h[d>>2]|0)-T|0,B=d+4|0,T=(h[B>>2]|0)-T|0,E>>>0>715827881|T>>>0>715827881){if(_=(E|0)>0,y=2147483647-E|0,S=-2147483648-E|0,(_?(y|0)<(E|0):(S|0)>(E|0))||(A=E<<1,_?(2147483647-A|0)<(E|0):(-2147483648-A|0)>
3839(E|0))||((T|0)>0?(2147483647-T|0)<(T|0):(-2147483648-T|0)>(T|0))||(f=E*3|0,A=T<<1,(_?(y|0)<(A|0):(S|0)>(A|0))||((E|0)>-1?(f|-2147483648|0)>=(T|0):(f^-2147483648|0)<(T|0))))return B=1,B|0}else A=T<<1,f=E*3|0;return _=Zl(+(f-T|0)*.14285714285714285)|0,h[d>>2]=_,y=Zl(+(A+E|0)*.14285714285714285)|0,h[B>>2]=y,h[L>>2]=0,A=(y|0)<(_|0),f=A?_:y,A=A?y:_,(A|0)<0&&(((A|0)==-2147483648||((f|0)>0?(2147483647-f|0)<(A|0):(-2147483648-f|0)>(A|0)))&&xt(27795,26892,354,26903),((f|0)>-1?(f|-2147483648|0)>=(A|0):(f^-2147483648|0)<(A|0))&&xt(27795,26892,354,26903)),f=y-_|0,(_|0)<0?(A=0-_|0,h[B>>2]=f,h[L>>2]=A,h[d>>2]=0,_=0):(f=y,A=0),(f|0)<0&&(_=_-f|0,h[d>>2]=_,A=A-f|0,h[L>>2]=A,h[B>>2]=0,f=0),S=_-A|0,y=f-A|0,(A|0)<0?(h[d>>2]=S,h[B>>2]=y,h[L>>2]=0,f=y,y=S,A=0):y=_,_=(f|0)<(y|0)?f:y,_=(A|0)<(_|0)?A:_,(_|0)<=0?(B=0,B|0):(h[d>>2]=y-_,h[B>>2]=f-_,h[L>>2]=A-_,B=0,B|0)}function NB(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0,L=0;if(T=d+8|0,y=h[T>>2]|0,S=(h[d>>2]|0)-y|0,E=d+4|0,y=(h[E>>2]|0)-y|0,S>>>0>715827881|y>>>0>715827881){if(A=(S|0)>0,(A?(2147483647-S|0)<(S|0):(-2147483648-S|0)>(S|0))||(f=S<<1,_=(y|0)>0,_?(2147483647-y|0)<(y|0):(-2147483648-y|0)>(y|0)))return E=1,E|0;if(L=y<<1,(_?(2147483647-L|0)<(y|0):(-2147483648-L|0)>(y|0))||(A?(2147483647-f|0)<(y|0):(-2147483648-f|0)>(y|0))||(A=y*3|0,(y|0)>-1?(A|-2147483648|0)>=(S|0):(A^-2147483648|0)<(S|0)))return L=1,L|0}else A=y*3|0,f=S<<1;return _=Zl(+(f+y|0)*.14285714285714285)|0,h[d>>2]=_,y=Zl(+(A-S|0)*.14285714285714285)|0,h[E>>2]=y,h[T>>2]=0,A=(y|0)<(_|0),f=A?_:y,A=A?y:_,(A|0)<0&&(((A|0)==-2147483648||((f|0)>0?(2147483647-f|0)<(A|0):(-2147483648-f|0)>(A|0)))&&xt(27795,26892,402,26917),((f|0)>-1?(f|-2147483648|0)>=(A|0):(f^-2147483648|0)<(A|0))&&xt(27795,26892,402,26917)),f=y-_|0,(_|0)<0?(A=0-_|0,h[E>>2]=f,h[T>>2]=A,h[d>>2]=0,_=0):(f=y,A=0),(f|0)<0&&(_=_-f|0,h[d>>2]=_,A=A-f|0,h[T>>2]=A,h[E>>2]=0,f=0),S=_-A|0,y=f-A|0,(A|0)<0?(h[d>>2]=S,h[E>>2]=y,h[T>>2]=0,f=y,y=S,A=0):y=_,_=(f|0)<(y|0)?f:y,_=(A|0)<(_|0)?A:_,(_|0)<=0?(L=0,L|0):(h[d>>2]=y-_,h[E>>2]=f-_,h[T>>2]=A-_,L=0,L|0)}function DB(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0;T=d+8|0,A=h[T>>2]|0,f=(h[d>>2]|0)-A|0,E=d+4|0,A=(h[E>>2]|0)-A|0,_=Zl(+((f*3|0)-A|0)*.14285714285714285)|0,h[d>>2]=_,f=Zl(+((A<<1)+f|0)*.14285714285714285)|0,h[E>>2]=f,h[T>>2]=0,A=f-_|0,(_|0)<0?(S=0-_|0,h[E>>2]=A,h[T>>2]=S,h[d>>2]=0,f=A,_=0,A=S):A=0,(f|0)<0&&(_=_-f|0,h[d>>2]=_,A=A-f|0,h[T>>2]=A,h[E>>2]=0,f=0),S=_-A|0,y=f-A|0,(A|0)<0?(h[d>>2]=S,h[E>>2]=y,h[T>>2]=0,f=y,y=S,A=0):y=_,_=(f|0)<(y|0)?f:y,_=(A|0)<(_|0)?A:_,!((_|0)<=0)&&(h[d>>2]=y-_,h[E>>2]=f-_,h[T>>2]=A-_)}function AT(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0;T=d+8|0,A=h[T>>2]|0,f=(h[d>>2]|0)-A|0,E=d+4|0,A=(h[E>>2]|0)-A|0,_=Zl(+((f<<1)+A|0)*.14285714285714285)|0,h[d>>2]=_,f=Zl(+((A*3|0)-f|0)*.14285714285714285)|0,h[E>>2]=f,h[T>>2]=0,A=f-_|0,(_|0)<0?(S=0-_|0,h[E>>2]=A,h[T>>2]=S,h[d>>2]=0,f=A,_=0,A=S):A=0,(f|0)<0&&(_=_-f|0,h[d>>2]=_,A=A-f|0,h[T>>2]=A,h[E>>2]=0,f=0),S=_-A|0,y=f-A|0,(A|0)<0?(h[d>>2]=S,h[E>>2]=y,h[T>>2]=0,f=y,y=S,A=0):y=_,_=(f|0)<(y|0)?f:y,_=(A|0)<(_|0)?A:_,!((_|0)<=0)&&(h[d>>2]=y-_,h[E>>2]=f-_,h[T>>2]=A-_)}function om(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0;f=h[d>>2]|0,T=d+4|0,A=h[T>>2]|0,E=d+8|0,_=h[E>>2]|0,y=A+(f*3|0)|0,h[d>>2]=y,A=_+(A*3|0)|0,h[T>>2]=A,f=(_*3|0)+f|0,h[E>>2]=f,_=A-y|0,(y|0)<0?(f=f-y|0,h[T>>2]=_,h[E>>2]=f,h[d>>2]=0,A=_,_=0):_=y,(A|0)<0&&(_=_-A|0,h[d>>2]=_,f=f-A|0,h[E>>2]=f,h[T>>2]=0,A=0),S=_-f|0,y=A-f|0,(f|0)<0?(h[d>>2]=S,h[T>>2]=y,h[E>>2]=0,_=S,f=0):y=A,A=(y|0)<(_|0)?y:_,A=(f|0)<(A|0)?f:A,!((A|0)<=0)&&(h[d>>2]=_-A,h[T>>2]=y-A,h[E>>2]=f-A)}function iu(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0;y=h[d>>2]|0,T=d+4|0,f=h[T>>2]|0,E=d+8|0,A=h[E>>2]|0,_=(f*3|0)+y|0,y=A+(y*3|0)|0,h[d>>2]=y,h[T>>2]=_,f=(A*3|0)+f|0,h[E>>2]=f,A=_-y|0,(y|0)<0?(f=f-y|0,h[T>>2]=A,h[E>>2]=f,h[d>>2]=0,y=0):A=_,(A|0)<0&&(y=y-A|0,h[d>>2]=y,f=f-A|0,h[E>>2]=f,h[T>>2]=0,A=0),S=y-f|0,_=A-f|0,(f|0)<0?(h[d>>2]=S,h[T>>2]=_,h[E>>2]=0,y=S,f=0):_=A,A=(_|0)<(y|0)?_:y,A=(f|0)<(A|0)?f:A,!((A|0)<=0)&&(h[d>>2]=y-A,h[T>>2]=_-A,h[E>>2]=f-A)}function mT(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0,E=0;(f+-1|0)>>>0>=6||(y=(h[15440+(f*12|0)>>2]|0)+(h[d>>2]|0)|0,h[d>>2]=y,E=d+4|0,_=(h[15440+(f*12|0)+4>>2]|0)+(h[E>>2]|0)|0,h[E>>2]=_,T=d+8|0,f=(h[15440+(f*12|0)+8>>2]|0)+(h[T>>2]|0)|0,h[T>>2]=f,A=_-y|0,(y|0)<0?(f=f-y|0,h[E>>2]=A,h[T>>2]=f,h[d>>2]=0,_=0):(A=_,_=y),(A|0)<0&&(_=_-A|0,h[d>>2]=_,f=f-A|0,h[T>>2]=f,h[E>>2]=0,A=0),S=_-f|0,y=A-f|0,(f|0)<0?(h[d>>2]=S,h[E>>2]=y,h[T>>2]=0,_=S,f=0):y=A,A=(y|0)<(_|0)?y:_,A=(f|0)<(A|0)?f:A,!((A|0)<=0)&&(h[d>>2]=_-A,h[E>>2]=y-A,h[T>>2]=f-A))}function gT(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0;y=h[d>>2]|0,T=d+4|0,f=h[T>>2]|0,E=d+8|0,A=h[E>>2]|0,_=f+y|0,y=A+y|0,h[d>>2]=y,h[T>>2]=_,f=A+f|0,h[E>>2]=f,A=_-y|0,(y|0)<0?(f=f-y|0,h[T>>2]=A,h[E>>2]=f,h[d>>2]=0,_=0):(A=_,_=y),(A|0)<0&&(_=_-A|0,h[d>>2]=_,f=f-A|0,h[E>>2]=f,h[T>>2]=0,A=0),S=_-f|0,y=A-f|0,(f|0)<0?(h[d>>2]=S,h[T>>2]=y,h[E>>2]=0,_=S,f=0):y=A,A=(y|0)<(_|0)?y:_,A=(f|0)<(A|0)?f:A,!((A|0)<=0)&&(h[d>>2]=_-A,h[T>>2]=y-A,h[E>>2]=f-A)}function am(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0;f=h[d>>2]|0,T=d+4|0,_=h[T>>2]|0,E=d+8|0,A=h[E>>2]|0,y=_+f|0,h[d>>2]=y,_=A+_|0,h[T>>2]=_,f=A+f|0,h[E>>2]=f,A=_-y|0,(y|0)<0?(f=f-y|0,h[T>>2]=A,h[E>>2]=f,h[d>>2]=0,_=0):(A=_,_=y),(A|0)<0&&(_=_-A|0,h[d>>2]=_,f=f-A|0,h[E>>2]=f,h[T>>2]=0,A=0),S=_-f|0,y=A-f|0,(f|0)<0?(h[d>>2]=S,h[T>>2]=y,h[E>>2]=0,_=S,f=0):y=A,A=(y|0)<(_|0)?y:_,A=(f|0)<(A|0)?f:A,!((A|0)<=0)&&(h[d>>2]=_-A,h[T>>2]=y-A,h[E>>2]=f-A)}function ru(d){switch(d=d|0,d|0){case 1:{d=5;break}case 5:{d=4;break}case 4:{d=6;break}case 6:{d=2;break}case 2:{d=3;break}case 3:{d=1;break}}return d|0}
3839function Yl(d){switch(d=d|0,d|0){case 1:{d=3;break}case 3:{d=2;break}case 2:{d=6;break}case 6:{d=4;break}case 4:{d=5;break}case 5:{d=1;break}}return d|0}function _T(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0;f=h[d>>2]|0,T=d+4|0,A=h[T>>2]|0,E=d+8|0,_=h[E>>2]|0,y=A+(f<<1)|0,h[d>>2]=y,A=_+(A<<1)|0,h[T>>2]=A,f=(_<<1)+f|0,h[E>>2]=f,_=A-y|0,(y|0)<0?(f=f-y|0,h[T>>2]=_,h[E>>2]=f,h[d>>2]=0,A=_,_=0):_=y,(A|0)<0&&(_=_-A|0,h[d>>2]=_,f=f-A|0,h[E>>2]=f,h[T>>2]=0,A=0),S=_-f|0,y=A-f|0,(f|0)<0?(h[d>>2]=S,h[T>>2]=y,h[E>>2]=0,_=S,f=0):y=A,A=(y|0)<(_|0)?y:_,A=(f|0)<(A|0)?f:A,!((A|0)<=0)&&(h[d>>2]=_-A,h[T>>2]=y-A,h[E>>2]=f-A)}function vT(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0;y=h[d>>2]|0,T=d+4|0,f=h[T>>2]|0,E=d+8|0,A=h[E>>2]|0,_=(f<<1)+y|0,y=A+(y<<1)|0,h[d>>2]=y,h[T>>2]=_,f=(A<<1)+f|0,h[E>>2]=f,A=_-y|0,(y|0)<0?(f=f-y|0,h[T>>2]=A,h[E>>2]=f,h[d>>2]=0,y=0):A=_,(A|0)<0&&(y=y-A|0,h[d>>2]=y,f=f-A|0,h[E>>2]=f,h[T>>2]=0,A=0),S=y-f|0,_=A-f|0,(f|0)<0?(h[d>>2]=S,h[T>>2]=_,h[E>>2]=0,y=S,f=0):_=A,A=(_|0)<(y|0)?_:y,A=(f|0)<(A|0)?f:A,!((A|0)<=0)&&(h[d>>2]=y-A,h[T>>2]=_-A,h[E>>2]=f-A)}function Vv(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0,E=0;return T=(h[d>>2]|0)-(h[f>>2]|0)|0,E=(T|0)<0,_=(h[d+4>>2]|0)-(h[f+4>>2]|0)-(E?T:0)|0,S=(_|0)<0,y=(E?0-T|0:0)+(h[d+8>>2]|0)-(h[f+8>>2]|0)+(S?0-_|0:0)|0,d=(y|0)<0,f=d?0:y,A=(S?0:_)-(d?y:0)|0,y=(E?0:T)-(S?_:0)-(d?y:0)|0,d=(A|0)<(y|0)?A:y,d=(f|0)<(d|0)?f:d,_=(d|0)>0,f=f-(_?d:0)|0,A=A-(_?d:0)|0,d=y-(_?d:0)|0,d=(d|0)>-1?d:0-d|0,A=(A|0)>-1?A:0-A|0,f=(f|0)>-1?f:0-f|0,f=(A|0)>(f|0)?A:f,((d|0)>(f|0)?d:f)|0}function IB(d,f){d=d|0,f=f|0;var A=0;A=h[d+8>>2]|0,h[f>>2]=(h[d>>2]|0)-A,h[f+4>>2]=(h[d+4>>2]|0)-A}function BB(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0,E=0;return _=h[d>>2]|0,h[f>>2]=_,y=h[d+4>>2]|0,T=f+4|0,h[T>>2]=y,E=f+8|0,h[E>>2]=0,A=(y|0)<(_|0),d=A?_:y,A=A?y:_,(A|0)<0&&((A|0)==-2147483648||((d|0)>0?(2147483647-d|0)<(A|0):(-2147483648-d|0)>(A|0))||((d|0)>-1?(d|-2147483648|0)>=(A|0):(d^-2147483648|0)<(A|0)))?(f=1,f|0):(d=y-_|0,(_|0)<0?(A=0-_|0,h[T>>2]=d,h[E>>2]=A,h[f>>2]=0,_=0):(d=y,A=0),(d|0)<0&&(_=_-d|0,h[f>>2]=_,A=A-d|0,h[E>>2]=A,h[T>>2]=0,d=0),S=_-A|0,y=d-A|0,(A|0)<0?(h[f>>2]=S,h[T>>2]=y,h[E>>2]=0,d=y,y=S,A=0):y=_,_=(d|0)<(y|0)?d:y,_=(A|0)<(_|0)?A:_,(_|0)<=0?(f=0,f|0):(h[f>>2]=y-_,h[T>>2]=d-_,h[E>>2]=A-_,f=0,f|0))}function yT(d){d=d|0;var f=0,A=0,_=0,y=0;f=d+8|0,y=h[f>>2]|0,A=y-(h[d>>2]|0)|0,h[d>>2]=A,_=d+4|0,d=(h[_>>2]|0)-y|0,h[_>>2]=d,h[f>>2]=0-(d+A)}function FB(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0;A=h[d>>2]|0,f=0-A|0,h[d>>2]=f,T=d+8|0,h[T>>2]=0,E=d+4|0,_=h[E>>2]|0,y=_+A|0,(A|0)>0?(h[E>>2]=y,h[T>>2]=A,h[d>>2]=0,f=0,_=y):A=0,(_|0)<0?(S=f-_|0,h[d>>2]=S,A=A-_|0,h[T>>2]=A,h[E>>2]=0,y=S-A|0,f=0-A|0,(A|0)<0?(h[d>>2]=y,h[E>>2]=f,h[T>>2]=0,_=f,A=0):(_=0,y=S)):y=f,f=(_|0)<(y|0)?_:y,f=(A|0)<(f|0)?A:f,!((f|0)<=0)&&(h[d>>2]=y-f,h[E>>2]=_-f,h[T>>2]=A-f)}function UB(d,f,A,_,y){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0;var S=0,T=0,E=0,L=0,B=0,G=0,ee=0;if(ee=j,j=j+64|0,G=ee,E=ee+56|0,!(!0&(f&2013265920|0)==134217728&(!0&(_&2013265920|0)==134217728)))return y=5,j=ee,y|0;if((d|0)==(A|0)&(f|0)==(_|0))return h[y>>2]=0,y=0,j=ee,y|0;if(T=pt(d|0,f|0,52)|0,X()|0,T=T&15,B=pt(A|0,_|0,52)|0,X()|0,(T|0)!=(B&15|0))return y=12,j=ee,y|0;if(S=T+-1|0,T>>>0>1){$v(d,f,S,G)|0,$v(A,_,S,E)|0,B=G,L=h[B>>2]|0,B=h[B+4>>2]|0;e:do if((L|0)==(h[E>>2]|0)&&(B|0)==(h[E+4>>2]|0)){T=(T^15)*3|0,S=pt(d|0,f|0,T|0)|0,X()|0,S=S&7,T=pt(A|0,_|0,T|0)|0,X()|0,T=T&7;do if((S|0)==0|(T|0)==0)h[y>>2]=1,S=0;else if((S|0)==7)S=5;else{if((S|0)==1|(T|0)==1&&ci(L,B)|0){S=5;break}if((h[15536+(S<<2)>>2]|0)!=(T|0)&&(h[15568+(S<<2)>>2]|0)!=(T|0))break e;h[y>>2]=1,S=0}while(!1);return y=S,j=ee,y|0}while(!1)}S=G,T=S+56|0;do h[S>>2]=0,S=S+4|0;while((S|0)<(T|0));return Zr(d,f,1,G)|0,f=G,!((h[f>>2]|0)==(A|0)&&(h[f+4>>2]|0)==(_|0))&&(f=G+8|0,!((h[f>>2]|0)==(A|0)&&(h[f+4>>2]|0)==(_|0)))&&(f=G+16|0,!((h[f>>2]|0)==(A|0)&&(h[f+4>>2]|0)==(_|0)))&&(f=G+24|0,!((h[f>>2]|0)==(A|0)&&(h[f+4>>2]|0)==(_|0)))&&(f=G+32|0,!((h[f>>2]|0)==(A|0)&&(h[f+4>>2]|0)==(_|0)))&&(f=G+40|0,!((h[f>>2]|0)==(A|0)&&(h[f+4>>2]|0)==(_|0)))?(S=G+48|0,S=((h[S>>2]|0)==(A|0)?(h[S+4>>2]|0)==(_|0):0)&1):S=1,h[y>>2]=S,y=0,j=ee,y|0}function OB(d,f,A,_,y){return d=d|0,f=f|0,A=A|0,_=_|0,y=y|0,A=mr(d,f,A,_)|0,(A|0)==7?(y=11,y|0):(_=bt(A|0,0,56)|0,f=f&-2130706433|(X()|0)|268435456,h[y>>2]=d|_,h[y+4>>2]=f,y=0,y|0)}function kB(d,f,A){return d=d|0,f=f|0,A=A|0,!0&(f&2013265920|0)==268435456?(h[A>>2]=d,h[A+4>>2]=f&-2130706433|134217728,A=0,A|0):(A=6,A|0)}function zB(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0;return y=j,j=j+16|0,_=y,h[_>>2]=0,!0&(f&2013265920|0)==268435456?(S=pt(d|0,f|0,56)|0,X()|0,_=jn(d,f&-2130706433|134217728,S&7,_,A)|0,j=y,_|0):(_=6,j=y,_|0)}function VB(d,f){d=d|0,f=f|0;var A=0;switch(A=pt(d|0,f|0,56)|0,X()|0,A&7){case 0:case 7:return A=0,A|0}return A=f&-2130706433|134217728,!(!0&(f&2013265920|0)==268435456)||!0&(f&117440512|0)==16777216&(ci(d,A)|0)!=0?(A=0,A|0):(A=Hv(d,A)|0,A|0)}function GB(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0;return y=j,j=j+16|0,_=y,!0&(f&2013265920|0)==268435456?(S=f&-2130706433|134217728,T=A,h[T>>2]=d,h[T+4>>2]=S,h[_>>2]=0,f=pt(d|0,f|0,56)|0,X()|0,_=jn(d,S,f&7,_,A+8|0)|0,j=y,_|0):(_=6,j=y,_|0)}function qB(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0;return y=(ci(d,f)|0)==0,f=f&-2130706433,_=A,h[_>>2]=y?d:0,h[_+4>>2]=y?f|285212672:0,_=A+8|0,h[_>>2]=d,h[_+4>>2]=f|301989888,_=A+16|0,h[_>>
38392]=d,h[_+4>>2]=f|318767104,_=A+24|0,h[_>>2]=d,h[_+4>>2]=f|335544320,_=A+32|0,h[_>>2]=d,h[_+4>>2]=f|352321536,A=A+40|0,h[A>>2]=d,h[A+4>>2]=f|369098752,0}function lm(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0;return T=j,j=j+16|0,y=T,S=f&-2130706433|134217728,!0&(f&2013265920|0)==268435456?(_=pt(d|0,f|0,56)|0,X()|0,_=zF(d,S,_&7)|0,(_|0)==-1?(h[A>>2]=0,S=6,j=T,S|0):(xh(d,S,y)|0&&xt(27795,26932,282,26947),f=pt(d|0,f|0,52)|0,X()|0,f=f&15,ci(d,S)|0?Gv(y,f,_,2,A):qv(y,f,_,2,A),S=0,j=T,S|0)):(S=6,j=T,S|0)}function HB(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0;_=j,j=j+16|0,y=_,WB(d,f,A,y),PB(y,A+4|0),j=_}function WB(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0;if(E=j,j=j+16|0,L=E,$B(d,A,L),S=+Ls(+(1-+V[L>>3]*.5)),S<1e-16){h[_>>2]=0,h[_+4>>2]=0,h[_+8>>2]=0,h[_+12>>2]=0,j=E;return}if(L=h[A>>2]|0,y=+V[15920+(L*24|0)>>3],y=+hp(y-+hp(+cF(15600+(L<<4)|0,d))),To(f)|0?T=+hp(y+-.3334731722518321):T=y,y=+Bn(+S)*2.618033988749896,(f|0)>0){d=0;do y=y*2.6457513110645907,d=d+1|0;while((d|0)!=(f|0))}S=+kt(+T)*y,V[_>>3]=S,T=+Pt(+T)*y,V[_+8>>3]=T,j=E}function $B(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0;if(S=j,j=j+32|0,y=S,kF(d,y),h[f>>2]=0,V[A>>3]=5,_=+or(16400,y),_<+V[A>>3]&&(h[f>>2]=0,V[A>>3]=_),_=+or(16424,y),_<+V[A>>3]&&(h[f>>2]=1,V[A>>3]=_),_=+or(16448,y),_<+V[A>>3]&&(h[f>>2]=2,V[A>>3]=_),_=+or(16472,y),_<+V[A>>3]&&(h[f>>2]=3,V[A>>3]=_),_=+or(16496,y),_<+V[A>>3]&&(h[f>>2]=4,V[A>>3]=_),_=+or(16520,y),_<+V[A>>3]&&(h[f>>2]=5,V[A>>3]=_),_=+or(16544,y),_<+V[A>>3]&&(h[f>>2]=6,V[A>>3]=_),_=+or(16568,y),_<+V[A>>3]&&(h[f>>2]=7,V[A>>3]=_),_=+or(16592,y),_<+V[A>>3]&&(h[f>>2]=8,V[A>>3]=_),_=+or(16616,y),_<+V[A>>3]&&(h[f>>2]=9,V[A>>3]=_),_=+or(16640,y),_<+V[A>>3]&&(h[f>>2]=10,V[A>>3]=_),_=+or(16664,y),_<+V[A>>3]&&(h[f>>2]=11,V[A>>3]=_),_=+or(16688,y),_<+V[A>>3]&&(h[f>>2]=12,V[A>>3]=_),_=+or(16712,y),_<+V[A>>3]&&(h[f>>2]=13,V[A>>3]=_),_=+or(16736,y),_<+V[A>>3]&&(h[f>>2]=14,V[A>>3]=_),_=+or(16760,y),_<+V[A>>3]&&(h[f>>2]=15,V[A>>3]=_),_=+or(16784,y),_<+V[A>>3]&&(h[f>>2]=16,V[A>>3]=_),_=+or(16808,y),_<+V[A>>3]&&(h[f>>2]=17,V[A>>3]=_),_=+or(16832,y),_<+V[A>>3]&&(h[f>>2]=18,V[A>>
38393]=_),_=+or(16856,y),!(_<+V[A>>3])){j=S;return}h[f>>2]=19,V[A>>3]=_,j=S}function cp(d,f,A,_,y){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0;var S=0,T=0,E=0;if(S=+OF(d),S<1e-16){f=15600+(f<<4)|0,h[y>>2]=h[f>>2],h[y+4>>2]=h[f+4>>2],h[y+8>>2]=h[f+8>>2],h[y+12>>2]=h[f+12>>2];return}if(T=+ye(+ +V[d+8>>3],+ +V[d>>3]),(A|0)>0){d=0;do S=S*.37796447300922725,d=d+1|0;while((d|0)!=(A|0))}E=S*.3333333333333333,_?(A=(To(A)|0)==0,S=+ne(+((A?E:E*.37796447300922725)*.381966011250105))):(S=+ne(+(S*.381966011250105)),To(A)|0&&(T=+hp(T+.3334731722518321))),uF(15600+(f<<4)|0,+hp(+V[15920+(f*24|0)>>3]-T),S,y)}function jB(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0;_=j,j=j+16|0,y=_,nu(d+4|0,y),cp(y,h[d>>2]|0,f,0,A),j=_}function Gv(d,f,A,_,y){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0;var S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0,He=0,De=0,Le=0,xe=0,yt=0,Ht=0,Vt=0,hn=0,mn=0,Cn=0,on=0,Wt=0,_t=0,Mn=0,ii=0,vn=0;if(Mn=j,j=j+272|0,S=Mn+256|0,De=Mn+240|0,on=Mn,Wt=Mn+224|0,_t=Mn+208|0,Le=Mn+176|0,xe=Mn+160|0,yt=Mn+192|0,Ht=Mn+144|0,Vt=Mn+128|0,hn=Mn+112|0,mn=Mn+96|0,Cn=Mn+80|0,h[S>>2]=f,h[De>>2]=h[d>>2],h[De+4>>2]=h[d+4>>2],h[De+8>>2]=h[d+8>>2],h[De+12>>2]=h[d+12>>2],xT(De,S,on),h[y>>2]=0,De=_+A+((_|0)==5&1)|0,(De|0)<=(A|0)){j=Mn;return}L=h[S>>2]|0,B=Wt+4|0,G=Le+4|0,ee=A+5|0,ce=16880+(L<<2)|0,oe=16960+(L<<2)|0,ae=Vt+8|0,ve=hn+8|0,Te=mn+8|0,He=_t+4|0,E=A;e:for(;;){T=on+(((E|0)%5|0)<<4)|0,h[_t>>2]=h[T>>2],h[_t+4>>2]=h[T+4>>2],h[_t+8>>2]=h[T+8>>2],h[_t+12>>2]=h[T+12>>2];do;while((yh(_t,L,0,1)|0)==2);if((E|0)>(A|0)&(To(f)|0)!=0){if(h[Le>>2]=h[_t>>2],h[Le+4>>2]=h[_t+4>>2],h[Le+8>>2]=h[_t+8>>2],h[Le+12>>2]=h[_t+12>>2],nu(B,xe),_=h[Le>>2]|0,S=h[17040+(_*80|0)+(h[Wt>>2]<<2)>>2]|0,h[Le>>2]=h[18640+(_*80|0)+(S*20|0)>>2],T=h[18640+(_*80|0)+(S*20|0)+16>>2]|0,(T|0)>0){d=0;do gT(G),d=d+1|0;while((d|0)<(T|0))}switch(T=18640+(_*80|0)+(S*20|0)+4|0,h[yt>>2]=h[T>>2],h[yt+4>>2]=h[T+4>>2],h[yt+8>>2]=h[T+8>>2],pT(yt,(h[ce>>2]|0)*3|0),ps(G,yt,G),Jr(G),nu(G,Ht),ii=+(h[oe>>2]|0),V[Vt>>3]=ii*3,V[ae>>3]=0,vn=ii*-1.5,V[hn>>3]=vn,V[ve>>3]=ii*2.598076211353316,V[mn>>3]=vn,V[Te>>3]=ii*-2.598076211353316,h[17040+((h[Le>>2]|0)*80|0)+(h[_t>>2]<<2)>>2]|0){case 1:{d=hn,_=Vt;break}case 3:{d=mn,_=hn;break}case 2:{d=Vt,_=mn;break}default:{d=12;break e}}UT(xe,Ht,_,d,Cn),cp(Cn,h[Le>>2]|0,L,1,y+8+(h[y>>2]<<4)|0),h[y>>2]=(h[y>>2]|0)+1}if((E|0)<(ee|0)&&(nu(He,Le),cp(Le,h[_t>>2]|0,L,1,y+8+(h[y>>2]<<4)|0),h[y>>2]=(h[y>>2]|0)+1),h[Wt>>2]=h[_t>>2],h[Wt+4>>2]=h[_t+4>>2],h[Wt+8>>2]=h[_t+8>>2],h[Wt+12>>2]=h[_t+12>>2],E=E+1|0,(E|0)>=(De|0)){d=3;break}}if((d|0)==3){j=Mn;return}else(d|0)==12&&xt(26970,27017,572,27027)}function xT(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0,E=0,L=0;L=j,j=j+128|0,_=L+64|0,y=L,S=_,T=20240,E=S+60|0;do h[S>>2]=h[T>>2],S=S+4|0,T=T+4|0;while((S|0)<(E|0));S=y,T=20304,E=S+60|0;do h[S>>2]=h[T>>2],S=S+4|0,T=T+4|0;while((S|0)<(E|0));E=(To(h[f>>2]|0)|0)==0,_=E?_:y,y=d+4|0,_T(y),vT(y),To(h[f>>2]|0)|0&&(iu(y),h[f>>2]=(h[f>>2]|0)+1),h[A>>2]=h[d>>2],f=A+4|0,ps(y,_,f),Jr(f),h[A+16>>2]=h[d>>2],f=A+20|0,ps(y,_+12|0,f),Jr(f),h[A+32>>2]=h[d>>2],f=A+36|0,ps(y,_+24|0,f),Jr(f),h[A+48>>2]=h[d>>2],f=A+52|0,ps(y,_+36|0,f),Jr(f),h[A+64>>2]=h[d>>2],A=A+68|0,ps(y,_+48|0,A),Jr(A),j=L}function yh(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0;if(ae=j,j=j+32|0,ce=ae+12|0,E=ae,oe=d+4|0,ee=h[16960+(f<<2)>>2]|0,G=(_|0)!=0,ee=G?ee*3|0:ee,y=h[oe>>2]|0,B=d+8|0,T=h[B>>2]|0,G){if(S=d+12|0,_=h[S>>2]|0,y=T+y+_|0,(y|0)==(ee|0))return oe=1,j=ae,oe|0;L=S}else L=d+12|0,_=h[L>>2]|0,y=T+y+_|0;if((y|0)<=(ee|0))return oe=0,j=ae,oe|0;do if((_|0)>0){if(_=h[d>>2]|0,(T|0)>0){S=18640+(_*80|0)+60|0,_=d;break}_=18640+(_*80|0)+40|0,A?(CB(ce,ee,0,0),zv(oe,ce,E),am(E),ps(E,ce,oe),S=_,_=d):(S=_,_=d)}else S=18640+((h[d>>2]|0)*80|0)+20|0,_=d;while(!1);if(h[_>>2]=h[S>>2],y=S+16|0,(h[y>>2]|0)>0){_=0;do gT(oe),_=_+1|0;while((_|0)<(h[y>>2]|0))}return d=S+4|0,h[ce>>2]=h[d>>2],h[ce+4>>2]=h[d+4>>2],h[ce+8>>2]=h[d+8>>2],f=h[16880+(f<<2)>>2]|0,pT(ce,G?f*3|0:f),ps(oe,ce,oe),Jr(oe),G?_=((h[B>>2]|0)+(h[oe>>2]|0)+(h[L>>2]|0)|0)==(ee|0)?1:2:_=2,oe=_,j=ae,oe|0}function XB(d,f){d=d|0,f=f|0;var A=0;do A=yh(d,f,0,1)|0;while((A|0)==2);return A|0}function qv(d,f,A,_,y){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0;var S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0,He=0,De=0,Le=0,xe=0,yt=0,Ht=0,Vt=0,hn=0,mn=0,Cn=0,on=0;if(mn=j,j=j+240|0,S=mn+224|0,yt=mn+208|0,Ht=mn,Vt=mn+192|0,hn=mn+176|0,Te=mn+160|0,He=mn+144|0,De=mn+128|0,Le=mn+112|0,xe=mn+96|0,h[S>>2]=f,h[yt>>2]=h[d>>2],h[yt+4>>2]=h[d+4>>2],h[yt+8>>2]=h[d+8>>2],h[yt+12>>2]=h[d+12>>2],bT(yt,S,Ht),h[y>>2]=0,ve=_+A+((_|0)==6&1)|0,(ve|0)<=(A|0)){j=mn;return}L=h[S>>2]|0,B=A+6|0,G=16960+(L<<2)|0,ee=He+8|0,ce=De+8|0,oe=Le+8|0,ae=Vt+4|0,T=0,E=A,_=-1;e:for(;;){if(S=(E|0)%6|0,d=Ht+(S<<4)|0,h[Vt>>2]=h[d>>2],h[Vt+4>>2]=h[d+4>>2],h[Vt+8>>2]=h[d+8>>2],h[Vt+12>>2]=h[d+12>>2],d=T,T=yh(Vt,L,0,1)|0,(E|0)>
3839(A|0)&(To(f)|0)!=0&&(d|0)!=1&&(h[Vt>>2]|0)!=(_|0)){switch(nu(Ht+(((S+5|0)%6|0)<<4)+4|0,hn),nu(Ht+(S<<4)+4|0,Te),Cn=+(h[G>>2]|0),V[He>>3]=Cn*3,V[ee>>3]=0,on=Cn*-1.5,V[De>>3]=on,V[ce>>3]=Cn*2.598076211353316,V[Le>>3]=on,V[oe>>3]=Cn*-2.598076211353316,S=h[yt>>2]|0,h[17040+(S*80|0)+(((_|0)==(S|0)?h[Vt>>2]|0:_)<<2)>>2]|0){case 1:{d=De,_=He;break}case 3:{d=Le,_=De;break}case 2:{d=He,_=Le;break}default:{d=8;break e}}UT(hn,Te,_,d,xe),!(OT(hn,xe)|0)&&!(OT(Te,xe)|0)&&(cp(xe,h[yt>>2]|0,L,1,y+8+(h[y>>2]<<4)|0),h[y>>2]=(h[y>>2]|0)+1)}if((E|0)<(B|0)&&(nu(ae,hn),cp(hn,h[Vt>>2]|0,L,1,y+8+(h[y>>2]<<4)|0),h[y>>2]=(h[y>>2]|0)+1),E=E+1|0,(E|0)>=(ve|0)){d=3;break}else _=h[Vt>>2]|0}if((d|0)==3){j=mn;return}else(d|0)==8&&xt(27054,27017,737,27099)}function bT(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0,E=0,L=0;L=j,j=j+160|0,_=L+80|0,y=L,S=_,T=20368,E=S+72|0;do h[S>>2]=h[T>>2],S=S+4|0,T=T+4|0;while((S|0)<(E|0));S=y,T=20448,E=S+72|0;do h[S>>2]=h[T>>2],S=S+4|0,T=T+4|0;while((S|0)<(E|0));E=(To(h[f>>2]|0)|0)==0,_=E?_:y,y=d+4|0,_T(y),vT(y),To(h[f>>2]|0)|0&&(iu(y),h[f>>2]=(h[f>>2]|0)+1),h[A>>2]=h[d>>2],f=A+4|0,ps(y,_,f),Jr(f),h[A+16>>2]=h[d>>2],f=A+20|0,ps(y,_+12|0,f),Jr(f),h[A+32>>2]=h[d>>2],f=A+36|0,ps(y,_+24|0,f),Jr(f),h[A+48>>2]=h[d>>2],f=A+52|0,ps(y,_+36|0,f),Jr(f),h[A+64>>2]=h[d>>2],f=A+68|0,ps(y,_+48|0,f),Jr(f),h[A+80>>2]=h[d>>2],A=A+84|0,ps(y,_+60|0,A),Jr(A),j=L}function YB(d,f){return d=d|0,f=f|0,f=pt(d|0,f|0,52)|0,X()|0,f&15|0}function ST(d,f){return d=d|0,f=f|0,f=pt(d|0,f|0,45)|0,X()|0,f&127|0}function Hv(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0;return!(!0&(f&-16777216|0)==134217728)||(_=pt(d|0,f|0,52)|0,X()|0,_=_&15,A=pt(d|0,f|0,45)|0,X()|0,A=A&127,A>>>0>121)?(d=0,d|0):(T=(_^15)*3|0,y=pt(d|0,f|0,T|0)|0,T=bt(y|0,X()|0,T|0)|0,y=X()|0,S=zr(-1227133514,-1171,T|0,y|0)|0,!((T&613566756&S|0)==0&(y&4681&(X()|0)|0)==0)||(T=(_*3|0)+19|0,S=bt(~d|0,~f|0,T|0)|0,T=pt(S|0,X()|0,T|0)|0,!((_|0)==15|(T|0)==0&(X()|0)==0))?(T=0,T|0):!(fe[20528+A>>0]|0)||(f=f&8191,(d|0)==0&(f|0)==0)?(T=1,T|0):(T=WT(d|0,f|0)|0,X()|0,((63-T|0)%3|0|0)!=0|0))}function Wv(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0;if(y=bt(f|0,0,52)|0,S=X()|0,A=bt(A|0,0,45)|0,A=S|(X()|0)|134225919,(f|0)<1){S=-1,_=A,f=d,h[f>>2]=S,d=d+4|0,h[d>>2]=_;return}for(S=1,y=-1;T=(15-S|0)*3|0,E=bt(7,0,T|0)|0,A=A&~(X()|0),T=bt(_|0,0,T|0)|0,y=y&~E|T,A=A|(X()|0),(S|0)!=(f|0);)S=S+1|0;E=d,T=E,h[T>>2]=y,E=E+4|0,h[E>>2]=A}function $v(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0;if(S=pt(d|0,f|0,52)|0,X()|0,S=S&15,A>>>0>15)return _=4,_|0;if((S|0)<(A|0))return _=12,_|0;if((S|0)==(A|0))return h[_>>2]=d,h[_+4>>2]=f,_=0,_|0;if(y=bt(A|0,0,52)|0,y=y|d,d=X()|0|f&-15728641,(S|0)>(A|0))do f=bt(7,0,(14-A|0)*3|0)|0,A=A+1|0,y=f|y,d=X()|0|d;while((A|0)<(S|0));return h[_>>2]=y,h[_+4>>2]=d,_=0,_|0}function up(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0;if(S=pt(d|0,f|0,52)|0,X()|0,S=S&15,!((A|0)<16&(S|0)<=(A|0)))return _=4,_|0;y=A-S|0,A=pt(d|0,f|0,45)|0,X()|0;e:do if(!(Mi(A&127)|0))A=Ql(7,0,y,((y|0)<0)<<31>>31)|0,y=X()|0;else{t:do if(S|0){for(A=1;T=bt(7,0,(15-A|0)*3|0)|0,!!((T&d|0)==0&((X()|0)&f|0)==0);)if(A>>>0<S>>>0)A=A+1|0;else break t;A=Ql(7,0,y,((y|0)<0)<<31>>31)|0,y=X()|0;break e}while(!1);A=Ql(7,0,y,((y|0)<0)<<31>>31)|0,A=es(A|0,X()|0,5,0)|0,A=Kt(A|0,X()|0,-5,-1)|0,A=Kl(A|0,X()|0,6,0)|0,A=Kt(A|0,X()|0,1,0)|0,y=X()|0}while(!1);return T=_,h[T>>2]=A,h[T+4>>2]=y,T=0,T|0}function ci(d,f){d=d|0,f=f|0;var A=0,_=0,y=0;if(y=pt(d|0,f|0,45)|0,X()|0,!(Mi(y&127)|0))return y=0,y|0;y=pt(d|0,f|0,52)|0,X()|0,y=y&15;e:do if(!y)A=0;else for(_=1;;){if(A=pt(d|0,f|0,(15-_|0)*3|0)|0,X()|0,A=A&7,A|0)break e;if(_>>>0<y>>>0)_=_+1|0;else{A=0;break}}while(!1);return y=(A|0)==0&1,y|0}function QB(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0;if(T=j,j=j+16|0,S=T,Kv(S,d,f,A),f=S,d=h[f>>2]|0,f=h[f+4>>2]|0,(d|0)==0&(f|0)==0)return j=T,0;y=0,A=0;do E=_+(y<<3)|0,h[E>>2]=d,h[E+4>>2]=f,y=Kt(y|0,A|0,1,0)|0,A=X()|0,Jv(S),E=S,d=h[E>>2]|0,f=h[E+4>>2]|0;while(!((d|0)==0&(f|0)==0));return j=T,0}function MT(d,f,A,_){return d=d|0,f=f|0,A=A|0,_=_|0,(_|0)<(A|0)?(A=f,_=d,lt(A|0),_|0):(A=bt(-1,-1,((_-A|0)*3|0)+3|0)|0,_=bt(~A|0,~(X()|0)|0,(15-_|0)*3|0)|0,A=~(X()|0)&f,_=~_&d,lt(A|0),_|0)}function wT(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0;return y=pt(d|0,f|0,52)|0,X()|0,y=y&15,(A|0)<16&(y|0)<=(A|0)?((y|0)<(A|0)&&(y=bt(-1,-1,((A+-1-y|0)*3|0)+3|0)|0,y=bt(~y|0,~(X()|0)|0,(15-A|0)*3|0)|0,f=~(X()|0)&f,d=~y&d),y=bt(A|0,0,52)|0,A=f&-15728641|(X()|0),h[_>>2]=d|y,h[_+4>>2]=A,_=0,_|0):(_=4,_|0)}function ZB(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0,He=0,De=0,Le=0,xe=0,yt=0,Ht=0,Vt=0,hn=0,mn=0,Cn=0,on=0,Wt=0,_t=0;if((A|0)==0&(_|0)==0)return _t=0,_t|0;if(y=d,S=h[y>>2]|0,y=h[y+4>>2]|0,!0&(y&15728640|0)==0){if(!((_|0)>0|(_|0)==0&A>>>0>0)||(_t=f,h[_t>>2]=S,h[_t+4>>2]=y,(A|0)==1&(_|0)==0))return _t=0,_t|0;y=1,S=0;do on=d+(y<<3)|0,Wt=h[on+4>>2]|0,_t=f+(y<<3)|0,h[_t>>2]=h[on>>2],h[_t+4>>2]=Wt,y=Kt(y|0,S|0,1,0)|0,S=X()|0;while((S|0)<(_|0)|(S|0)==(_|0)&y>>>0<A>>>0);return y=0,y|0}if(Cn=A<<3,Wt=Ma(Cn)|0,!Wt)return _t=13,_t|0;if(Th(Wt|0,d|0,Cn|0)|0,on=Ro(A,8)|0,!on)return sn(Wt),_t=13,_t|0;e:for(;;){y=Wt,B=h[y>>2]|0,y=h[y+4>>2]|0,hn=pt(B|0,y|0,52)|0,X()|0,hn=hn&15,mn=hn+-1|0,Vt=(hn|0)!=0,Ht=(_|0)>0|(_|0)==0&A>>>0>0;t:do if(Vt&Ht){if(De=bt(mn|0,0,52)|0,Le=X()|0,mn>>>0>15){if(!((B|0)==0&(y|0)==0)){_t=16;break e}for(S=0,d=0;;){if(S=Kt(S|0,d|0,1,0)|0,d=X()|0,!((d|0)<(_|0)|(d|0)==(_|0)&S>>>0<A>>>0))break t;if(T=Wt+(S<<3)|0,yt=h[T>>2]|0,T=h[T+4>>2]|0,!((yt|0)==0&(T|0)==0)){y=T,_t=16;break e}}}for(E=B,d=y,S=0,T=0;;){if(!((E|0)==0&(d|0)==0)){if(!(!0&(d&117440512|0)==0)){_t=21;break e}if(G=pt(E|0,d|0,52)|0,X()|0,G=G&15,(G|0)<(mn|0)){y=12,_t=27;break e}if((G|0)!=(mn|0)&&(E=E|De,d=d&-15728641|Le,G>>>0>=hn>>>0)){L=mn;do yt=bt(7,0,(14-L|0)*3|0)|0,L=L+1|0,E=yt|E,d=X()|0|d;while(L>>>0<G>>>0)}if(ce=wh(E|0,d|0,A|0,_|0)|0,oe=X()|0,L=on+(ce<<3)|0,G=L,ee=h[G>>2]|0,G=h[G+4>>2]|0,!((ee|0)==0&(G|0)==0)){Te=0,He=0;do{if((Te|0)>(_|0)|(Te|0)==(_|0)&He>>>0>A>>>0){_t=31;break e}
3839if((ee|0)==(E|0)&(G&-117440513|0)==(d|0)){ae=pt(ee|0,G|0,56)|0,X()|0,ae=ae&7,ve=ae+1|0,yt=pt(ee|0,G|0,45)|0,X()|0;n:do if(!(Mi(yt&127)|0))G=7;else{if(ee=pt(ee|0,G|0,52)|0,X()|0,ee=ee&15,!ee){G=6;break}for(G=1;;){if(yt=bt(7,0,(15-G|0)*3|0)|0,!((yt&E|0)==0&((X()|0)&d|0)==0)){G=7;break n}if(G>>>0<ee>>>0)G=G+1|0;else{G=6;break}}}while(!1);if((ae+2|0)>>>0>G>>>0){_t=41;break e}yt=bt(ve|0,0,56)|0,d=X()|0|d&-117440513,xe=L,h[xe>>2]=0,h[xe+4>>2]=0,E=yt|E}else ce=Kt(ce|0,oe|0,1,0)|0,ce=Mh(ce|0,X()|0,A|0,_|0)|0,oe=X()|0;He=Kt(He|0,Te|0,1,0)|0,Te=X()|0,L=on+(ce<<3)|0,G=L,ee=h[G>>2]|0,G=h[G+4>>2]|0}while(!((ee|0)==0&(G|0)==0))}yt=L,h[yt>>2]=E,h[yt+4>>2]=d}if(S=Kt(S|0,T|0,1,0)|0,T=X()|0,!((T|0)<(_|0)|(T|0)==(_|0)&S>>>0<A>>>0))break t;d=Wt+(S<<3)|0,E=h[d>>2]|0,d=h[d+4>>2]|0}}while(!1);if(yt=Kt(A|0,_|0,5,0)|0,xe=X()|0,xe>>>0<0|(xe|0)==0&yt>>>0<11){_t=85;break}if(yt=Kl(A|0,_|0,6,0)|0,X()|0,yt=Ro(yt,8)|0,!yt){_t=48;break}do if(Ht){for(ve=0,d=0,ae=0,Te=0;;){if(G=on+(ve<<3)|0,T=G,S=h[T>>2]|0,T=h[T+4>>2]|0,(S|0)==0&(T|0)==0)xe=ae;else{ee=pt(S|0,T|0,56)|0,X()|0,ee=ee&7,E=ee+1|0,ce=T&-117440513,xe=pt(S|0,T|0,45)|0,X()|0;t:do if(Mi(xe&127)|0){if(oe=pt(S|0,T|0,52)|0,X()|0,oe=oe&15,oe|0)for(L=1;;){if(xe=bt(7,0,(15-L|0)*3|0)|0,!((S&xe|0)==0&(ce&(X()|0)|0)==0))break t;if(L>>>0<oe>>>0)L=L+1|0;else break}T=bt(E|0,0,56)|0,S=T|S,T=X()|0|ce,E=G,h[E>>2]=S,h[E+4>>2]=T,E=ee+2|0}while(!1);(E|0)==7?(xe=yt+(d<<3)|0,h[xe>>2]=S,h[xe+4>>2]=T&-117440513,d=Kt(d|0,ae|0,1,0)|0,xe=X()|0):xe=ae}if(ve=Kt(ve|0,Te|0,1,0)|0,Te=X()|0,(Te|0)<(_|0)|(Te|0)==(_|0)&ve>>>0<A>>>0)ae=xe;else break}if(Ht){if(He=mn>>>0>15,De=bt(mn|0,0,52)|0,Le=X()|0,!Vt){for(S=0,L=0,E=0,T=0;(B|0)==0&(y|0)==0||(mn=f+(S<<3)|0,h[mn>>2]=B,h[mn+4>>2]=y,S=Kt(S|0,L|0,1,0)|0,L=X()|0),E=Kt(E|0,T|0,1,0)|0,T=X()|0,!!((T|0)<(_|0)|(T|0)==(_|0)&E>>>0<A>>>0);)y=Wt+(E<<3)|0,B=h[y>>2]|0,y=h[y+4>>2]|0;y=xe;break}for(S=0,L=0,T=0,E=0;;){do if(!((B|0)==0&(y|0)==0)){if(oe=pt(B|0,y|0,52)|0,X()|0,oe=oe&15,He|(oe|0)<(mn|0)){_t=80;break e}if((oe|0)!=(mn|0)){if(G=B|De,ee=y&-15728641|Le,oe>>>0>=hn>>>0){ce=mn;do Vt=bt(7,0,(14-ce|0)*3|0)|0,ce=ce+1|0,G=Vt|G,ee=X()|0|ee;while(ce>>>0<oe>>>0)}}else G=B,ee=y;ae=wh(G|0,ee|0,A|0,_|0)|0,ce=0,oe=0,Te=X()|0;do{if((ce|0)>(_|0)|(ce|0)==(_|0)&oe>>>0>A>>>0){_t=81;break e}if(Vt=on+(ae<<3)|0,ve=h[Vt+4>>2]|0,(ve&-117440513|0)==(ee|0)&&(h[Vt>>2]|0)==(G|0)){_t=65;break}Vt=Kt(ae|0,Te|0,1,0)|0,ae=Mh(Vt|0,X()|0,A|0,_|0)|0,Te=X()|0,oe=Kt(oe|0,ce|0,1,0)|0,ce=X()|0,Vt=on+(ae<<3)|0}while(!((h[Vt>>2]|0)==(G|0)&&(h[Vt+4>>2]|0)==(ee|0)));if((_t|0)==65&&(_t=0,!0&(ve&117440512|0)==100663296))break;Vt=f+(S<<3)|0,h[Vt>>2]=B,h[Vt+4>>2]=y,S=Kt(S|0,L|0,1,0)|0,L=X()|0}while(!1);if(T=Kt(T|0,E|0,1,0)|0,E=X()|0,!((E|0)<(_|0)|(E|0)==(_|0)&T>>>0<A>>>0))break;y=Wt+(T<<3)|0,B=h[y>>2]|0,y=h[y+4>>2]|0}y=xe}else S=0,y=xe}else S=0,d=0,y=0;while(!1);if(au(on|0,0,Cn|0)|0,Th(Wt|0,yt|0,d<<3|0)|0,sn(yt),(d|0)==0&(y|0)==0){_t=89;break}else f=f+(S<<3)|0,_=y,A=d}if((_t|0)==16)!0&(y&117440512|0)==0?(y=4,_t=27):_t=21;else if((_t|0)==31)xt(27795,27122,529,27132);else{if((_t|0)==41)return sn(Wt),sn(on),_t=10,_t|0;if((_t|0)==48)return sn(Wt),sn(on),_t=13,_t|0;(_t|0)==80?xt(27795,27122,620,27132):(_t|0)==81?xt(27795,27122,632,27132):(_t|0)==85&&(Th(f|0,Wt|0,A<<3|0)|0,_t=89)}return(_t|0)==21?(sn(Wt),sn(on),_t=5,_t|0):(_t|0)==27?(sn(Wt),sn(on),_t=y,_t|0):(_t|0)==89?(sn(Wt),sn(on),_t=0,_t|0):0}function KB(d,f,A,_,y,S,T){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0,S=S|0,T=T|0;var E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0;if(ve=j,j=j+16|0,ae=ve,!((A|0)>0|(A|0)==0&f>>>0>0))return ae=0,j=ve,ae|0;if((T|0)>=16)return ae=12,j=ve,ae|0;ce=0,oe=0,ee=0,E=0;e:for(;;){if(B=d+(ce<<3)|0,L=h[B>>2]|0,B=h[B+4>>2]|0,G=pt(L|0,B|0,52)|0,X()|0,(G&15|0)>(T|0)){E=12,L=11;break}if(Kv(ae,L,B,T),G=ae,B=h[G>>2]|0,G=h[G+4>>2]|0,(B|0)==0&(G|0)==0)L=ee;else{L=ee;do{if(!((E|0)<(S|0)|(E|0)==(S|0)&L>>>0<y>>>0)){L=10;break e}ee=_+(L<<3)|0,h[ee>>2]=B,h[ee+4>>2]=G,L=Kt(L|0,E|0,1,0)|0,E=X()|0,Jv(ae),ee=ae,B=h[ee>>2]|0,G=h[ee+4>>2]|0}while(!((B|0)==0&(G|0)==0))}
3839if(ce=Kt(ce|0,oe|0,1,0)|0,oe=X()|0,(oe|0)<(A|0)|(oe|0)==(A|0)&ce>>>0<f>>>0)ee=L;else{E=0,L=11;break}}return(L|0)==10?(ae=14,j=ve,ae|0):(L|0)==11?(j=ve,E|0):0}function JB(d,f,A,_,y){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0;var S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0;ce=j,j=j+16|0,ee=ce;e:do if((A|0)>0|(A|0)==0&f>>>0>0){for(B=0,T=0,S=0,G=0;;){if(L=d+(B<<3)|0,E=h[L>>2]|0,L=h[L+4>>2]|0,!((E|0)==0&(L|0)==0)&&(L=(up(E,L,_,ee)|0)==0,E=ee,T=Kt(h[E>>2]|0,h[E+4>>2]|0,T|0,S|0)|0,S=X()|0,!L)){S=12;break}if(B=Kt(B|0,G|0,1,0)|0,G=X()|0,!((G|0)<(A|0)|(G|0)==(A|0)&B>>>0<f>>>0))break e}return j=ce,S|0}else T=0,S=0;while(!1);return h[y>>2]=T,h[y+4>>2]=S,y=0,j=ce,y|0}function eF(d,f){return d=d|0,f=f|0,f=pt(d|0,f|0,52)|0,X()|0,f&1|0}function Ns(d,f){d=d|0,f=f|0;var A=0,_=0,y=0;if(y=pt(d|0,f|0,52)|0,X()|0,y=y&15,!y)return y=0,y|0;for(_=1;;){if(A=pt(d|0,f|0,(15-_|0)*3|0)|0,X()|0,A=A&7,A|0){_=5;break}if(_>>>0<y>>>0)_=_+1|0;else{A=0,_=5;break}}return(_|0)==5?A|0:0}function jv(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0,E=0,L=0;if(L=pt(d|0,f|0,52)|0,X()|0,L=L&15,!L)return E=f,L=d,lt(E|0),L|0;for(E=1,A=0;;){S=(15-E|0)*3|0,_=bt(7,0,S|0)|0,y=X()|0,T=pt(d|0,f|0,S|0)|0,X()|0,S=bt(ru(T&7)|0,0,S|0)|0,T=X()|0,d=S|d&~_,f=T|f&~y;e:do if(!A)if((S&_|0)==0&(T&y|0)==0)A=0;else if(_=pt(d|0,f|0,52)|0,X()|0,_=_&15,!_)A=1;else{A=1;t:for(;;){switch(T=pt(d|0,f|0,(15-A|0)*3|0)|0,X()|0,T&7){case 1:break t;case 0:break;default:{A=1;break e}}if(A>>>0<_>>>0)A=A+1|0;else{A=1;break e}}for(A=1;;)if(T=(15-A|0)*3|0,y=pt(d|0,f|0,T|0)|0,X()|0,S=bt(7,0,T|0)|0,f=f&~(X()|0),T=bt(ru(y&7)|0,0,T|0)|0,d=d&~S|T,f=f|(X()|0),A>>>0<_>>>0)A=A+1|0;else{A=1;break}}while(!1);if(E>>>0<L>>>0)E=E+1|0;else break}return lt(f|0),d|0}function su(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0;if(_=pt(d|0,f|0,52)|0,X()|0,_=_&15,!_)return A=f,_=d,lt(A|0),_|0;for(A=1;S=(15-A|0)*3|0,T=pt(d|0,f|0,S|0)|0,X()|0,y=bt(7,0,S|0)|0,f=f&~(X()|0),S=bt(ru(T&7)|0,0,S|0)|0,d=S|d&~y,f=X()|0|f,A>>>0<_>>>0;)A=A+1|0;return lt(f|0),d|0}function tF(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0,E=0,L=0;if(L=pt(d|0,f|0,52)|0,X()|0,L=L&15,!L)return E=f,L=d,lt(E|0),L|0;for(E=1,A=0;;){S=(15-E|0)*3|0,_=bt(7,0,S|0)|0,y=X()|0,T=pt(d|0,f|0,S|0)|0,X()|0,S=bt(Yl(T&7)|0,0,S|0)|0,T=X()|0,d=S|d&~_,f=T|f&~y;e:do if(!A)if((S&_|0)==0&(T&y|0)==0)A=0;else if(_=pt(d|0,f|0,52)|0,X()|0,_=_&15,!_)A=1;else{A=1;t:for(;;){switch(T=pt(d|0,f|0,(15-A|0)*3|0)|0,X()|0,T&7){case 1:break t;case 0:break;default:{A=1;break e}}if(A>>>0<_>>>0)A=A+1|0;else{A=1;break e}}for(A=1;;)if(y=(15-A|0)*3|0,S=bt(7,0,y|0)|0,T=f&~(X()|0),f=pt(d|0,f|0,y|0)|0,X()|0,f=bt(Yl(f&7)|0,0,y|0)|0,d=d&~S|f,f=T|(X()|0),A>>>0<_>>>0)A=A+1|0;else{A=1;break}}while(!1);if(E>>>0<L>>>0)E=E+1|0;else break}return lt(f|0),d|0}function Xv(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0;if(_=pt(d|0,f|0,52)|0,X()|0,_=_&15,!_)return A=f,_=d,lt(A|0),_|0;for(A=1;T=(15-A|0)*3|0,S=bt(7,0,T|0)|0,y=f&~(X()|0),f=pt(d|0,f|0,T|0)|0,X()|0,f=bt(Yl(f&7)|0,0,T|0)|0,d=f|d&~S,f=X()|0|y,A>>>0<_>>>0;)A=A+1|0;return lt(f|0),d|0}function nF(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0;if(L=j,j=j+64|0,E=L+40|0,_=L+24|0,y=L+12|0,S=L,bt(f|0,0,52)|0,A=X()|0|134225919,!f)return(h[d+4>>2]|0)>2||(h[d+8>>2]|0)>2||(h[d+12>>2]|0)>2?(T=0,E=0,lt(T|0),j=L,E|0):(bt(lT(d)|0,0,45)|0,T=X()|0|A,E=-1,lt(T|0),j=L,E|0);if(h[E>>2]=h[d>>2],h[E+4>>2]=h[d+4>>2],h[E+8>>2]=h[d+8>>2],h[E+12>>
38392]=h[d+12>>2],T=E+4|0,(f|0)>0)for(d=-1;h[_>>2]=h[T>>2],h[_+4>>2]=h[T+4>>2],h[_+8>>2]=h[T+8>>2],f&1?(DB(T),h[y>>2]=h[T>>2],h[y+4>>2]=h[T+4>>2],h[y+8>>2]=h[T+8>>2],om(y)):(AT(T),h[y>>2]=h[T>>2],h[y+4>>2]=h[T+4>>2],h[y+8>>2]=h[T+8>>2],iu(y)),zv(_,y,S),Jr(S),G=(15-f|0)*3|0,B=bt(7,0,G|0)|0,A=A&~(X()|0),G=bt(sm(S)|0,0,G|0)|0,d=G|d&~B,A=X()|0|A,(f|0)>1;)f=f+-1|0;else d=-1;e:do if((h[T>>2]|0)<=2&&(h[E+8>>2]|0)<=2&&(h[E+12>>2]|0)<=2){if(_=lT(E)|0,f=bt(_|0,0,45)|0,f=f|d,d=X()|0|A&-1040385,S=vB(E)|0,!(Mi(_)|0)){if((S|0)<=0)break;for(y=0;;){if(_=pt(f|0,d|0,52)|0,X()|0,_=_&15,_)for(A=1;G=(15-A|0)*3|0,E=pt(f|0,d|0,G|0)|0,X()|0,B=bt(7,0,G|0)|0,d=d&~(X()|0),G=bt(ru(E&7)|0,0,G|0)|0,f=f&~B|G,d=d|(X()|0),A>>>0<_>>>0;)A=A+1|0;if(y=y+1|0,(y|0)==(S|0))break e}}y=pt(f|0,d|0,52)|0,X()|0,y=y&15;t:do if(y){A=1;n:for(;;){switch(G=pt(f|0,d|0,(15-A|0)*3|0)|0,X()|0,G&7){case 1:break n;case 0:break;default:break t}if(A>>>0<y>>>0)A=A+1|0;else break t}if(cT(_,h[E>>2]|0)|0)for(A=1;E=(15-A|0)*3|0,B=bt(7,0,E|0)|0,G=d&~(X()|0),d=pt(f|0,d|0,E|0)|0,X()|0,d=bt(Yl(d&7)|0,0,E|0)|0,f=f&~B|d,d=G|(X()|0),A>>>0<y>>>0;)A=A+1|0;else for(A=1;G=(15-A|0)*3|0,E=pt(f|0,d|0,G|0)|0,X()|0,B=bt(7,0,G|0)|0,d=d&~(X()|0),G=bt(ru(E&7)|0,0,G|0)|0,f=f&~B|G,d=d|(X()|0),A>>>0<y>>>0;)A=A+1|0}while(!1);if((S|0)>0){A=0;do f=jv(f,d)|0,d=X()|0,A=A+1|0;while((A|0)!=(S|0))}}else f=0,d=0;while(!1);return B=d,G=f,lt(B|0),j=L,G|0}function To(d){return d=d|0,(d|0)%2|0|0}function Yv(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0;return y=j,j=j+16|0,_=y,f>>>0>15?(_=4,j=y,_|0):(h[d+4>>2]&2146435072|0)==2146435072||(h[d+8+4>>2]&2146435072|0)==2146435072?(_=3,j=y,_|0):(HB(d,f,_),f=nF(_,f)|0,_=X()|0,h[A>>2]=f,h[A+4>>2]=_,(f|0)==0&(_|0)==0&&xt(27795,27122,959,27145),_=0,j=y,_|0)}function Qv(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0;if(y=A+4|0,S=pt(d|0,f|0,52)|0,X()|0,S=S&15,T=pt(d|0,f|0,45)|0,X()|0,_=(S|0)==0,Mi(T&127)|0){if(_)return T=1,T|0;_=1}else{if(_)return T=0,T|0;(h[y>>2]|0)==0&&(h[A+8>>2]|0)==0?_=(h[A+12>>2]|0)!=0&1:_=1}for(A=1;A&1?om(y):iu(y),T=pt(d|0,f|0,(15-A|0)*3|0)|0,X()|0,mT(y,T&7),A>>>0<S>>>0;)A=A+1|0;return _|0}function xh(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0;if(G=j,j=j+16|0,L=G,B=pt(d|0,f|0,45)|0,X()|0,B=B&127,B>>>0>121)return h[A>>2]=0,h[A+4>>2]=0,h[A+8>>2]=0,h[A+12>>2]=0,B=5,j=G,B|0;e:do if((Mi(B)|0)!=0&&(S=pt(d|0,f|0,52)|0,X()|0,S=S&15,(S|0)!=0)){_=1;t:for(;;){switch(E=pt(d|0,f|0,(15-_|0)*3|0)|0,X()|0,E&7){case 5:break t;case 0:break;default:{_=f;break e}}if(_>>>0<S>>>0)_=_+1|0;else{_=f;break e}}for(y=1,_=f;f=(15-y|0)*3|0,T=bt(7,0,f|0)|0,E=_&~(X()|0),_=pt(d|0,_|0,f|0)|0,X()|0,_=bt(Yl(_&7)|0,0,f|0)|0,d=d&~T|_,_=E|(X()|0),y>>>0<S>>>0;)y=y+1|0}else _=f;while(!1);if(E=7696+(B*28|0)|0,h[A>>2]=h[E>>2],h[A+4>>2]=h[E+4>>2],h[A+8>>2]=h[E+8>>2],h[A+12>>2]=h[E+12>>2],!(Qv(d,_,A)|0))return B=0,j=G,B|0;if(T=A+4|0,h[L>>2]=h[T>>2],h[L+4>>2]=h[T+4>>2],h[L+8>>2]=h[T+8>>2],S=pt(d|0,_|0,52)|0,X()|0,E=S&15,S&1?(iu(T),S=E+1|0):S=E,!(Mi(B)|0))_=0;else{e:do if(!E)_=0;else for(f=1;;){if(y=pt(d|0,_|0,(15-f|0)*3|0)|0,X()|0,y=y&7,y|0){_=y;break e}if(f>>>0<E>>>0)f=f+1|0;else{_=0;break}}while(!1);_=(_|0)==4&1}if(!(yh(A,S,_,0)|0))(S|0)!=(E|0)&&(h[T>>2]=h[L>>2],h[T+4>>2]=h[L+4>>2],h[T+8>>2]=h[L+8>>2]);else{if(Mi(B)|0)do;while((yh(A,S,0,0)|0)!=0);(S|0)!=(E|0)&&AT(T)}return B=0,j=G,B|0}function ou(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0;return S=j,j=j+16|0,_=S,y=xh(d,f,_)|0,y|0?(j=S,y|0):(y=pt(d|0,f|0,52)|0,X()|0,jB(_,y&15,A),y=0,j=S,y|0)}function bh(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0,E=0;if(T=j,j=j+16|0,S=T,_=xh(d,f,S)|0,_|0)return S=_,j=T,S|0;_=pt(d|0,f|0,45)|0,X()|0,_=(Mi(_&127)|0)==0,y=pt(d|0,f|0,52)|0,X()|0,y=y&15;e:do if(!_){if(y|0)for(_=1;;){if(E=bt(7,0,(15-_|0)*3|0)|0,!((E&d|0)==0&((X()|0)&f|0)==0))break e;if(_>>>0<y>>>0)_=_+1|0;else break}return Gv(S,y,0,5,A),E=0,j=T,E|0}while(!1);return qv(S,y,0,6,A),E=0,j=T,E|0}function iF(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0;if(y=pt(d|0,f|0,45)|0,X()|0,!(Mi(y&127)|0))return y=2,h[A>>2]=y,0;if(y=pt(d|0,f|0,52)|0,X()|0,y=y&15,!y)return y=5,h[A>>2]=y,0;for(_=1;;){if(S=bt(7,0,(15-_|0)*3|0)|0,!((S&d|0)==0&((X()|0)&f|0)==0)){_=2,d=6;break}if(_>>>0<y>>>0)_=_+1|0;else{_=5,d=6;break}}return(d|0)==6&&(h[A>>
38392]=_),0}function TT(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0;ee=j,j=j+128|0,B=ee+112|0,S=ee+96|0,G=ee,y=pt(d|0,f|0,52)|0,X()|0,E=y&15,h[B>>2]=E,T=pt(d|0,f|0,45)|0,X()|0,T=T&127;e:do if(Mi(T)|0){if(E|0)for(_=1;;){if(L=bt(7,0,(15-_|0)*3|0)|0,!((L&d|0)==0&((X()|0)&f|0)==0)){y=0;break e}if(_>>>0<E>>>0)_=_+1|0;else break}if(y&1)y=1;else return L=bt(E+1|0,0,52)|0,G=X()|0|f&-15728641,B=bt(7,0,(14-E|0)*3|0)|0,G=TT((L|d)&~B,G&~(X()|0),A)|0,j=ee,G|0}else y=0;while(!1);if(_=xh(d,f,S)|0,!_){y?(xT(S,B,G),L=5):(bT(S,B,G),L=6);e:do if(Mi(T)|0)if(!E)d=5;else for(_=1;;){if(T=bt(7,0,(15-_|0)*3|0)|0,!((T&d|0)==0&((X()|0)&f|0)==0)){d=2;break e}if(_>>>0<E>>>0)_=_+1|0;else{d=5;break}}else d=2;while(!1);au(A|0,-1,d<<2|0)|0;e:do if(y)for(S=0;;){if(T=G+(S<<4)|0,XB(T,h[B>>2]|0)|0,T=h[T>>2]|0,E=h[A>>2]|0,(E|0)==-1|(E|0)==(T|0))_=A;else{y=0;do{if(y=y+1|0,y>>>0>=d>>>0){_=1;break e}_=A+(y<<2)|0,E=h[_>>2]|0}while(!((E|0)==-1|(E|0)==(T|0)))}if(h[_>>2]=T,S=S+1|0,S>>>0>=L>>>0){_=0;break}}else for(S=0;;){if(T=G+(S<<4)|0,yh(T,h[B>>2]|0,0,1)|0,T=h[T>>2]|0,E=h[A>>2]|0,(E|0)==-1|(E|0)==(T|0))_=A;else{y=0;do{if(y=y+1|0,y>>>0>=d>>>0){_=1;break e}_=A+(y<<2)|0,E=h[_>>2]|0}while(!((E|0)==-1|(E|0)==(T|0)))}if(h[_>>2]=T,S=S+1|0,S>>>0>=L>>>0){_=0;break}}while(!1)}return G=_,j=ee,G|0}function rF(){return 12}function Zv(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0,E=0,L=0;if(d>>>0>15)return E=4,E|0;if(bt(d|0,0,52)|0,E=X()|0|134225919,!d){A=0,_=0;do Mi(_)|0&&(bt(_|0,0,45)|0,T=E|(X()|0),d=f+(A<<3)|0,h[d>>2]=-1,h[d+4>>2]=T,A=A+1|0),_=_+1|0;while((_|0)!=122);return A=0,A|0}A=0,T=0;do{if(Mi(T)|0){for(bt(T|0,0,45)|0,_=1,y=-1,S=E|(X()|0);L=bt(7,0,(15-_|0)*3|0)|0,y=y&~L,S=S&~(X()|0),(_|0)!=(d|0);)_=_+1|0;L=f+(A<<3)|0,h[L>>2]=y,h[L+4>>2]=S,A=A+1|0}T=T+1|0}while((T|0)!=122);return A=0,A|0}function sF(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0,He=0,De=0;if(De=j,j=j+16|0,Te=De,He=pt(d|0,f|0,52)|0,X()|0,He=He&15,A>>>0>15)return He=4,j=De,He|0;if((He|0)<(A|0))return He=12,j=De,He|0;if((He|0)!=(A|0))if(S=bt(A|0,0,52)|0,S=S|d,E=X()|0|f&-15728641,(He|0)>
3839(A|0)){L=A;do ve=bt(7,0,(14-L|0)*3|0)|0,L=L+1|0,S=ve|S,E=X()|0|E;while((L|0)<(He|0));ve=S}else ve=S;else ve=d,E=f;ae=pt(ve|0,E|0,45)|0,X()|0;e:do if(Mi(ae&127)|0){if(L=pt(ve|0,E|0,52)|0,X()|0,L=L&15,L|0)for(S=1;;){if(ae=bt(7,0,(15-S|0)*3|0)|0,!((ae&ve|0)==0&((X()|0)&E|0)==0)){B=33;break e}if(S>>>0<L>>>0)S=S+1|0;else break}if(ae=_,h[ae>>2]=0,h[ae+4>>2]=0,(He|0)>(A|0)){for(ae=f&-15728641,oe=He;;){if(ce=oe,oe=oe+-1|0,oe>>>0>15|(He|0)<(oe|0)){B=19;break}if((He|0)!=(oe|0))if(S=bt(oe|0,0,52)|0,S=S|d,L=X()|0|ae,(He|0)<(ce|0))ee=S;else{B=oe;do ee=bt(7,0,(14-B|0)*3|0)|0,B=B+1|0,S=ee|S,L=X()|0|L;while((B|0)<(He|0));ee=S}else ee=d,L=f;if(G=pt(ee|0,L|0,45)|0,X()|0,!(Mi(G&127)|0))S=0;else{G=pt(ee|0,L|0,52)|0,X()|0,G=G&15;t:do if(!G)S=0;else for(B=1;;){if(S=pt(ee|0,L|0,(15-B|0)*3|0)|0,X()|0,S=S&7,S|0)break t;if(B>>>0<G>>>0)B=B+1|0;else{S=0;break}}while(!1);S=(S|0)==0&1}if(L=pt(d|0,f|0,(15-ce|0)*3|0)|0,X()|0,L=L&7,(L|0)==7){y=5,B=42;break}if(S=(S|0)!=0,(L|0)==1&S){y=5,B=42;break}if(ee=L+(((L|0)!=0&S)<<31>>31)|0,ee|0&&(B=He-ce|0,B=Ql(7,0,B,((B|0)<0)<<31>>31)|0,G=X()|0,S?(S=es(B|0,G|0,5,0)|0,S=Kt(S|0,X()|0,-5,-1)|0,S=Kl(S|0,X()|0,6,0)|0,S=Kt(S|0,X()|0,1,0)|0,L=X()|0):(S=B,L=G),ce=ee+-1|0,ce=es(B|0,G|0,ce|0,((ce|0)<0)<<31>>31|0)|0,ce=Kt(S|0,L|0,ce|0,X()|0)|0,ee=X()|0,G=_,G=Kt(ce|0,ee|0,h[G>>2]|0,h[G+4>>2]|0)|0,ee=X()|0,ce=_,h[ce>>2]=G,h[ce+4>>2]=ee),(oe|0)<=(A|0)){B=37;break}}if((B|0)==19)xt(27795,27122,1276,27158);else if((B|0)==37){T=_,y=h[T+4>>2]|0,T=h[T>>2]|0;break}else if((B|0)==42)return j=De,y|0}else y=0,T=0}else B=33;while(!1);e:do if((B|0)==33)if(ae=_,h[ae>>2]=0,h[ae+4>>2]=0,(He|0)>(A|0)){for(S=He;;){if(y=pt(d|0,f|0,(15-S|0)*3|0)|0,X()|0,y=y&7,(y|0)==7){y=5;break}if(T=He-S|0,T=Ql(7,0,T,((T|0)<0)<<31>>31)|0,y=es(T|0,X()|0,y|0,0)|0,T=X()|0,ae=_,T=Kt(h[ae>>2]|0,h[ae+4>>2]|0,y|0,T|0)|0,y=X()|0,ae=_,h[ae>>2]=T,h[ae+4>>2]=y,S=S+-1|0,(S|0)<=(A|0))break e}return j=De,y|0}else y=0,T=0;while(!1);return up(ve,E,He,Te)|0&&xt(27795,27122,1236,27173),He=Te,Te=h[He+4>>2]|0,((y|0)>-1|(y|0)==-1&T>>>0>4294967295)&((Te|0)>(y|0)|((Te|0)==(y|0)?(h[He>>2]|0)>>>0>T>>>0:0))?(He=0,j=De,He|0):(xt(27795,27122,1316,27158),0)}function oF(d,f,A,_,y,S){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0,S=S|0;var T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0;if(ee=j,j=j+16|0,T=ee,y>>>0>15)return S=4,j=ee,S|0;if(E=pt(A|0,_|0,52)|0,X()|0,E=E&15,(E|0)>(y|0))return S=12,j=ee,S|0;if(up(A,_,y,T)|0&&xt(27795,27122,1236,27173),G=T,B=h[G+4>>2]|0,!(((f|0)>-1|(f|0)==-1&d>>>0>4294967295)&((B|0)>(f|0)|((B|0)==(f|0)?(h[G>>2]|0)>>>0>d>>>0:0))))return S=2,j=ee,S|0;G=y-E|0,y=bt(y|0,0,52)|0,L=X()|0|_&-15728641,B=S,h[B>>2]=y|A,h[B+4>>2]=L,B=pt(A|0,_|0,45)|0,X()|0;e:do if(Mi(B&127)|0){if(E|0)for(T=1;;){if(B=bt(7,0,(15-T|0)*3|0)|0,!((B&A|0)==0&((X()|0)&_|0)==0))break e;if(T>>>0<E>>>0)T=T+1|0;else break}if((G|0)<1)return S=0,j=ee,S|0;for(B=E^15,_=-1,L=1,T=1;;){E=G-L|0,E=Ql(7,0,E,((E|0)<0)<<31>>31)|0,A=X()|0;do if(T)if(T=es(E|0,A|0,5,0)|0,T=Kt(T|0,X()|0,-5,-1)|0,T=Kl(T|0,X()|0,6,0)|0,y=X()|0,(f|0)>(y|0)|(f|0)==(y|0)&d>>>0>T>>>0){f=Kt(d|0,f|0,-1,-1)|0,f=zr(f|0,X()|0,T|0,y|0)|0,T=X()|0,ce=S,ae=h[ce>>2]|0,ce=h[ce+4>>2]|0,ve=(B+_|0)*3|0,oe=bt(7,0,ve|0)|0,ce=ce&~(X()|0),_=Kl(f|0,T|0,E|0,A|0)|0,d=X()|0,y=Kt(_|0,d|0,2,0)|0,ve=bt(y|0,X()|0,ve|0)|0,ce=X()|0|ce,y=S,h[y>>2]=ve|ae&~oe,h[y+4>>2]=ce,d=es(_|0,d|0,E|0,A|0)|0,d=zr(f|0,T|0,d|0,X()|0)|0,T=0,f=X()|0;break}else{ve=S,oe=h[ve>>2]|0,ve=h[ve+4>>2]|0,ae=bt(7,0,(B+_|0)*3|0)|0,ve=ve&~(X()|0),T=S,h[T>>2]=oe&~ae,h[T+4>>2]=ve,T=1;break}else oe=S,y=h[oe>>2]|0,oe=h[oe+4>>2]|0,_=(B+_|0)*3|0,ce=bt(7,0,_|0)|0,oe=oe&~(X()|0),ve=Kl(d|0,f|0,E|0,A|0)|0,T=X()|0,_=bt(ve|0,T|0,_|0)|0,oe=X()|0|oe,ae=S,h[ae>>2]=_|y&~ce,h[ae+4>>2]=oe,T=es(ve|0,T|0,E|0,A|0)|0,d=zr(d|0,f|0,T|0,X()|0)|0,T=0,f=X()|0;while(!1);if((G|0)>(L|0))_=~L,L=L+1|0;else{f=0;break}}return j=ee,f|0}while(!1);if((G|0)<1)return ve=0,j=ee,ve|0;for(y=E^15,T=1;;)if(ae=G-T|0,ae=Ql(7,0,ae,((ae|0)<0)<<31>>31)|0,ve=X()|0,L=S,A=h[L>>2]|0,L=h[L+4>>2]|0,E=(y-T|0)*3|0,_=bt(7,0,E|0)|0,L=L&~(X()|0),ce=Kl(d|0,f|0,ae|0,ve|0)|0,oe=X()|0,E=bt(ce|0,oe|0,E|0)|0,L=X()|0|L,B=S,h[B>>2]=E|A&~_,h[B+4>>2]=L,ve=es(ce|0,oe|0,ae|0,ve|0)|0,d=zr(d|0,f|0,ve|0,X()|0)|0,f=X()|0,(G|0)<=(T|0)){f=0;break}else T=T+1|0;return j=ee,f|0}function Kv(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0;y=pt(f|0,A|0,52)|0,X()|0,y=y&15,(f|0)==0&(A|0)==0|((_|0)>15|(y|0)>(_|0))?(S=-1,f=-1,A=0,y=0):(f=MT(f,A,y+1|0,_)|0,T=(X()|0)&-15728641,A=bt(_|0,0,52)|0,A=f|A,T=T|(X()|0),f=(ci(A,T)|0)==0,S=y,f=f?-1:_,y=T),T=d,h[T>>2]=A,h[T+4>>2]=y,h[d+8>>2]=S,h[d+12>>2]=f}function ET(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0;if(y=pt(d|0,f|0,52)|0,X()|0,y=y&15,S=_+8|0,h[S>>2]=y,(d|0)==0&(f|0)==0|((A|0)>15|(y|0)>(A|0))){A=_,h[A>>2]=0,h[A+4>>2]=0,h[S>>2]=-1,h[_+12>>2]=-1;return}if(d=MT(d,f,y+1|0,A)|0,S=(X()|0)&-15728641,y=bt(A|0,0,52)|0,y=d|y,S=S|(X()|0),d=_,h[d>>2]=y,h[d+4>>2]=S,d=_+12|0,ci(y,S)|0){h[d>>2]=A;return}else{h[d>>2]=-1;return}}function Jv(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0,L=0,B=0;if(A=d,f=h[A>>2]|0,A=h[A+4>>2]|0,!((f|0)==0&(A|0)==0)&&(_=pt(f|0,A|0,52)|0,X()|0,_=_&15,E=bt(1,0,(_^15)*3|0)|0,f=Kt(E|0,X()|0,f|0,A|0)|0,A=X()|0,E=d,h[E>>2]=f,h[E+4>>2]=A,E=d+8|0,T=h[E>>2]|0,!((_|0)<(T|0)))){for(L=d+12|0,S=_;;){if((S|0)==(T|0)){_=5;break}if(B=(S|0)==(h[L>>2]|0),y=(15-S|0)*3|0,_=pt(f|0,A|0,y|0)|0,X()|0,_=_&7,B&((_|0)==1&!0)){_=7;break}if(!((_|0)==7&!0)){_=10;break}if(B=bt(1,0,y|0)|0,f=Kt(f|0,A|0,B|0,X()|0)|0,A=X()|0,B=d,h[B>>2]=f,h[B+4>>2]=A,(S|0)>(T|0))S=S+-1|0;else{_=10;break}}if((_|0)==5){B=d,h[B>>2]=0,h[B+4>>2]=0,h[E>>2]=-1,h[L>>2]=-1;return}else if((_|0)==7){T=bt(1,0,y|0)|0,T=Kt(f|0,A|0,T|0,X()|0)|0,E=X()|0,B=d,h[B>>2]=T,h[B+4>>2]=E,h[L>>2]=S+-1;return}else if((_|0)==10)return}}function hp(d){d=+d;var f=0;return f=d<0?d+6.283185307179586:d,+(d>=6.283185307179586?f+-6.283185307179586:f)}function Sh(d,f){return d=d|0,f=f|0,+Et(+(+V[d>>3]-+V[f>>3]))<17453292519943298e-27?(f=+Et(+(+V[d+8>>3]-+V[f+8>>3]))<17453292519943298e-27,f|0):(f=0,f|0)}function io(d,f){switch(d=+d,f=f|0,f|0){case 1:{d=d<0?d+6.283185307179586:d;break}case 2:{d=d>0?d+-6.283185307179586:d;break}}return+d}function aF(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0;return y=+V[f>>3],_=+V[d>>3],S=+Pt(+((y-_)*.5)),A=+Pt(+((+V[f+8>>3]-+V[d+8>>3])*.5)),A=S*S+A*(+kt(+y)*+kt(+_)*A),+(+ye(+ +Ct(+A),+ +Ct(+(1-A)))*2)}function dp(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0;return y=+V[f>>3],_=+V[d>>3],S=+Pt(+((y-_)*.5)),A=+Pt(+((+V[f+8>>3]-+V[d+8>>3])*.5)),A=S*S+A*(+kt(+y)*+kt(+_)*A),+(+ye(+ +Ct(+A),+ +Ct(+(1-A)))*2*6371.007180918475)}function lF(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0;return y=+V[f>>3],_=+V[d>>3],S=+Pt(+((y-_)*.5)),A=+Pt(+((+V[f+8>>3]-+V[d+8>>3])*.5)),A=S*S+A*(+kt(+y)*+kt(+_)*A),+(+ye(+ +Ct(+A),+ +Ct(+(1-A)))*2*6371.007180918475*1e3)}function cF(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0;return S=+V[f>>3],_=+kt(+S),y=+V[f+8>>3]-+V[d+8>>3],T=_*+Pt(+y),A=+V[d>>3],+ +ye(+T,+(+Pt(+S)*+kt(+A)-+kt(+y)*(_*+Pt(+A))))}function uF(d,f,A,_){d=d|0,f=+f,A=+A,_=_|0;var y=0,S=0,T=0,E=0;if(A<1e-16){h[_>>2]=h[d>>2],h[_+4>>2]=h[d+4>>2],h[_+8>>2]=h[d+8>>2],h[_+12>>2]=h[d+12>>2];return}S=f<0?f+6.283185307179586:f,S=f>=6.283185307179586?S+-6.283185307179586:S;do if(S<1e-16)f=+V[d>>3]+A,V[_>>3]=f,y=_;else{if(y=+Et(+(S+-3.141592653589793))<1e-16,f=+V[d>>3],y){f=f-A,V[_>>3]=f,y=_;break}if(T=+kt(+A),A=+Pt(+A),f=T*+Pt(+f)+ +kt(+S)*(A*+kt(+f)),f=f>1?1:f,f=+kn(+(f<-1?-1:f)),V[_>>3]=f,+Et(+(f+-1.5707963267948966))<1e-16){V[_>>3]=1.5707963267948966,V[_+8>>3]=0;return}if(+Et(+(f+1.5707963267948966))<1e-16){V[_>>3]=-1.5707963267948966,V[_+8>>3]=0;return}if(E=1/+kt(+f),S=A*+Pt(+S)*E,A=+V[d>>3],f=E*((T-+Pt(+f)*+Pt(+A))/+kt(+A)),T=S>1?1:S,f=f>1?1:f,f=+V[d+8>>3]+ +ye(+(T<-1?-1:T),+(f<-1?-1:f)),f>3.141592653589793)do f=f+-6.283185307179586;while(f>3.141592653589793);if(f<-3.141592653589793)do f=f+6.283185307179586;while(f<-3.141592653589793);V[_+8>>3]=f;return}while(!1);if(+Et(+(f+-1.5707963267948966))<1e-16){V[y>>3]=1.5707963267948966,V[_+8>>3]=0;return}if(+Et(+(f+1.5707963267948966))<1e-16){V[y>>3]=-1.5707963267948966,V[_+8>>3]=0;return}if(f=+V[d+8>>3],f>3.141592653589793)do f=f+-6.283185307179586;while(f>3.141592653589793);if(f<-3.141592653589793)do f=f+6.283185307179586;while(f<-3.141592653589793);V[_+8>>3]=f}function RT(d,f){return d=d|0,f=f|0,d>>>0>15?(f=4,f|0):(V[f>>3]=+V[20656+(d<<3)>>3],f=0,f|0)}function hF(d,f){return d=d|0,f=f|0,d>>>0>15?(f=4,f|0):(V[f>>3]=+V[20784+(d<<3)>>3],f=0,f|0)}function dF(d,f){return d=d|0,f=f|0,d>>>0>15?(f=4,f|0):(V[f>>3]=+V[20912+(d<<3)>
3839>3],f=0,f|0)}function fF(d,f){return d=d|0,f=f|0,d>>>0>15?(f=4,f|0):(V[f>>3]=+V[21040+(d<<3)>>3],f=0,f|0)}function ey(d,f){d=d|0,f=f|0;var A=0;return d>>>0>15?(f=4,f|0):(A=Ql(7,0,d,((d|0)<0)<<31>>31)|0,A=es(A|0,X()|0,120,0)|0,d=X()|0,h[f>>2]=A|2,h[f+4>>2]=d,f=0,f|0)}function CT(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0;return ce=+V[f>>3],G=+V[d>>3],L=+Pt(+((ce-G)*.5)),S=+V[f+8>>3],B=+V[d+8>>3],T=+Pt(+((S-B)*.5)),E=+kt(+G),ee=+kt(+ce),T=L*L+T*(ee*E*T),T=+ye(+ +Ct(+T),+ +Ct(+(1-T)))*2,L=+V[A>>3],ce=+Pt(+((L-ce)*.5)),_=+V[A+8>>3],S=+Pt(+((_-S)*.5)),y=+kt(+L),S=ce*ce+S*(ee*y*S),S=+ye(+ +Ct(+S),+ +Ct(+(1-S)))*2,L=+Pt(+((G-L)*.5)),_=+Pt(+((B-_)*.5)),_=L*L+_*(E*y*_),_=+ye(+ +Ct(+_),+ +Ct(+(1-_)))*2,y=(T+S+_)*.5,+(+ne(+ +Ct(+(+Bn(+(y*.5))*+Bn(+((y-T)*.5))*+Bn(+((y-S)*.5))*+Bn(+((y-_)*.5)))))*4)}function ty(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0,E=0;if(E=j,j=j+192|0,S=E+168|0,T=E,y=ou(d,f,S)|0,y|0)return A=y,j=E,A|0;if(bh(d,f,T)|0&&xt(27795,27190,415,27199),f=h[T>>2]|0,(f|0)>0){if(_=+CT(T+8|0,T+8+(((f|0)!=1&1)<<4)|0,S)+0,(f|0)!=1){d=1;do y=d,d=d+1|0,_=_+ +CT(T+8+(y<<4)|0,T+8+(((d|0)%(f|0)|0)<<4)|0,S);while((d|0)<(f|0))}}else _=0;return V[A>>3]=_,A=0,j=E,A|0}function pF(d,f,A){return d=d|0,f=f|0,A=A|0,d=ty(d,f,A)|0,d|0||(V[A>>3]=+V[A>>3]*6371.007180918475*6371.007180918475),d|0}function AF(d,f,A){return d=d|0,f=f|0,A=A|0,d=ty(d,f,A)|0,d|0||(V[A>>3]=+V[A>>3]*6371.007180918475*6371.007180918475*1e3*1e3),d|0}function mF(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0;if(E=j,j=j+176|0,T=E,d=lm(d,f,T)|0,d|0)return T=d,j=E,T|0;if(V[A>>3]=0,d=h[T>>2]|0,(d|0)<=1)return T=0,j=E,T|0;f=d+-1|0,d=0,_=+V[T+8>>3],y=+V[T+16>>3],S=0;do d=d+1|0,B=_,_=+V[T+8+(d<<4)>>3],G=+Pt(+((_-B)*.5)),L=y,y=+V[T+8+(d<<4)+8>>3],L=+Pt(+((y-L)*.5)),L=G*G+L*(+kt(+_)*+kt(+B)*L),S=S+ +ye(+ +Ct(+L),+ +Ct(+(1-L)))*2;while((d|0)<(f|0));return V[A>>3]=S,T=0,j=E,T|0}function gF(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0;if(E=j,j=j+176|0,T=E,d=lm(d,f,T)|0,d|0)return T=d,S=+V[A>>3],S=S*6371.007180918475,V[A>>3]=S,j=E,T|0;if(V[A>>3]=0,d=h[T>>2]|0,(d|0)<=1)return T=0,S=0,S=S*6371.007180918475,V[A>>3]=S,j=E,T|0;f=d+-1|0,d=0,_=+V[T+8>>3],y=+V[T+16>>3],S=0;do d=d+1|0,B=_,_=+V[T+8+(d<<4)>>3],G=+Pt(+((_-B)*.5)),L=y,y=+V[T+8+(d<<4)+8>>3],L=+Pt(+((y-L)*.5)),L=G*G+L*(+kt(+B)*+kt(+_)*L),S=S+ +ye(+ +Ct(+L),+ +Ct(+(1-L)))*2;while((d|0)!=(f|0));return V[A>>3]=S,T=0,G=S,G=G*6371.007180918475,V[A>>3]=G,j=E,T|0}function _F(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0;if(E=j,j=j+176|0,T=E,d=lm(d,f,T)|0,d|0)return T=d,S=+V[A>>3],S=S*6371.007180918475,S=S*1e3,V[A>>3]=S,j=E,T|0;if(V[A>>3]=0,d=h[T>>2]|0,(d|0)<=1)return T=0,S=0,S=S*6371.007180918475,S=S*1e3,V[A>>3]=S,j=E,T|0;f=d+-1|0,d=0,_=+V[T+8>>3],y=+V[T+16>>3],S=0;do d=d+1|0,B=_,_=+V[T+8+(d<<4)>>3],G=+Pt(+((_-B)*.5)),L=y,y=+V[T+8+(d<<4)+8>>3],L=+Pt(+((y-L)*.5)),L=G*G+L*(+kt(+B)*+kt(+_)*L),S=S+ +ye(+ +Ct(+L),+ +Ct(+(1-L)))*2;while((d|0)!=(f|0));return V[A>>3]=S,T=0,G=S,G=G*6371.007180918475,G=G*1e3,V[A>>3]=G,j=E,T|0}function vF(d){d=d|0;var f=0,A=0,_=0;return f=Ro(1,12)|0,f||xt(27280,27235,49,27293),A=d+4|0,_=h[A>>2]|0,_|0?(_=_+8|0,h[_>>2]=f,h[A>>2]=f,f|0):(h[d>>2]|0&&xt(27310,27235,61,27333),_=d,h[_>>2]=f,h[A>>2]=f,f|0)}function yF(d,f){d=d|0,f=f|0;var A=0,_=0;return _=Ma(24)|0,_||xt(27347,27235,78,27361),h[_>>2]=h[f>>2],h[_+4>>2]=h[f+4>>2],h[_+8>>2]=h[f+8>>2],h[_+12>>2]=h[f+12>>2],h[_+16>>2]=0,f=d+4|0,A=h[f>>2]|0,A|0?(h[A+16>>2]=_,h[f>>2]=_,_|0):(h[d>>2]|0&&xt(27376,27235,82,27361),h[d>>2]=_,h[f>>2]=_,_|0)}function PT(d){d=d|0;var f=0,A=0,_=0,y=0;if(d)for(_=1;;){if(f=h[d>>2]|0,f|0)do{if(A=h[f>>2]|0,A|0)do y=A,A=h[A+16>>2]|0,sn(y);while((A|0)!=0);y=f,f=h[f+8>>2]|0,sn(y)}while((f|0)!=0);if(f=d,d=h[d+8>>2]|0,_||sn(f),d)_=0;else break}}function xF(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0,He=0,De=0,Le=0,xe=0,yt=0,Ht=0,Vt=0,hn=0,mn=0,Cn=0,on=0,Wt=0,_t=0,Mn=0,ii=0,vn=0;if(y=d+8|0,h[y>>2]|0)return vn=1,vn|0;if(_=h[d>>2]|0,!_)return vn=0,vn|0;f=_,A=0;do A=A+1|0,f=h[f+8>>2]|0;while((f|0)!=0);if(A>>>0<2)return vn=0,vn|0;Mn=Ma(A<<2)|0,Mn||xt(27396,27235,317,27415),_t=Ma(A<<5)|0,_t||xt(27437,27235,321,27415),h[d>>2]=0,Ht=d+4|0,h[Ht>>2]=0,h[y>>2]=0,A=0,Wt=0,yt=0,ee=0;e:for(;;){if(G=h[_>>2]|0,G){S=0,T=G;do{if(L=+V[T+8>>3],f=T,T=h[T+16>>2]|0,B=(T|0)==0,y=B?G:T,E=+V[y+8>>3],+Et(+(L-E))>3.141592653589793){vn=14;break}S=S+(E-L)*(+V[f>>3]+ +V[y>>3])}while(!B);if((vn|0)==14){vn=0,S=0,f=G;do xe=+V[f+8>>3],on=f+16|0,Cn=h[on>>2]|0,Cn=(Cn|0)==0?G:Cn,Le=+V[Cn+8>>3],S=S+(+V[f>>3]+ +V[Cn>>3])*((Le<0?Le+6.283185307179586:Le)-(xe<0?xe+6.283185307179586:xe)),f=h[((f|0)==0?_:on)>>2]|0;while((f|0)!=0)}S>0?(h[Mn+(Wt<<2)>>2]=_,Wt=Wt+1|0,y=yt,f=ee):vn=19}else vn=19;
3839if((vn|0)==19){vn=0;do if(A){if(f=A+8|0,h[f>>2]|0){vn=21;break e}if(A=Ro(1,12)|0,!A){vn=23;break e}h[f>>2]=A,y=A+4|0,T=A,f=ee}else if(ee){y=Ht,T=ee+8|0,f=_,A=d;break}else if(h[d>>2]|0){vn=27;break e}else{y=Ht,T=d,f=_,A=d;break}while(!1);if(h[T>>2]=_,h[y>>2]=_,T=_t+(yt<<5)|0,B=h[_>>2]|0,B){for(G=_t+(yt<<5)+8|0,V[G>>3]=17976931348623157e292,ee=_t+(yt<<5)+24|0,V[ee>>3]=17976931348623157e292,V[T>>3]=-17976931348623157e292,ce=_t+(yt<<5)+16|0,V[ce>>3]=-17976931348623157e292,He=17976931348623157e292,De=-17976931348623157e292,y=0,oe=B,L=17976931348623157e292,ve=17976931348623157e292,Te=-17976931348623157e292,E=-17976931348623157e292;S=+V[oe>>3],xe=+V[oe+8>>3],oe=h[oe+16>>2]|0,ae=(oe|0)==0,Le=+V[(ae?B:oe)+8>>3],S<L&&(V[G>>3]=S,L=S),xe<ve&&(V[ee>>3]=xe,ve=xe),S>Te?V[T>>3]=S:S=Te,xe>E&&(V[ce>>3]=xe,E=xe),He=xe>0&xe<He?xe:He,De=xe<0&xe>De?xe:De,y=y|+Et(+(xe-Le))>3.141592653589793,!ae;)Te=S;y&&(V[ce>>3]=De,V[ee>>3]=He)}else h[T>>2]=0,h[T+4>>2]=0,h[T+8>>2]=0,h[T+12>>2]=0,h[T+16>>2]=0,h[T+20>>2]=0,h[T+24>>2]=0,h[T+28>>2]=0;y=yt+1|0}if(on=_+8|0,_=h[on>>2]|0,h[on>>2]=0,_)yt=y,ee=f;else{vn=45;break}}if((vn|0)==21)xt(27213,27235,35,27247);else if((vn|0)==23)xt(27267,27235,37,27247);else if((vn|0)==27)xt(27310,27235,61,27333);else if((vn|0)==45){e:do if((Wt|0)>0){for(on=(y|0)==0,mn=y<<2,Cn=(d|0)==0,hn=0,f=0;;){if(Vt=h[Mn+(hn<<2)>>2]|0,on)vn=73;else{if(yt=Ma(mn)|0,!yt){vn=50;break}if(Ht=Ma(mn)|0,!Ht){vn=52;break}t:do if(Cn)A=0;else{for(y=0,A=0,T=d;_=_t+(y<<5)|0,LT(h[T>>2]|0,_,h[Vt>>2]|0)|0?(h[yt+(A<<2)>>2]=T,h[Ht+(A<<2)>>2]=_,ae=A+1|0):ae=A,T=h[T+8>>2]|0,T;)y=y+1|0,A=ae;if((ae|0)>0)if(_=h[yt>>2]|0,(ae|0)==1)A=_;else for(ce=0,oe=-1,A=_,ee=_;;){for(B=h[ee>>2]|0,_=0,T=0;y=h[h[yt+(T<<2)>>2]>>2]|0,(y|0)==(B|0)?G=_:G=_+((LT(y,h[Ht+(T<<2)>>2]|0,h[B>>2]|0)|0)&1)|0,T=T+1|0,(T|0)!=(ae|0);)_=G;if(y=(G|0)>(oe|0),A=y?ee:A,_=ce+1|0,(_|0)==(ae|0))break t;ce=_,oe=y?G:oe,ee=h[yt+(_<<2)>>2]|0}else A=0}while(!1);if(sn(yt),sn(Ht),A){if(y=A+4|0,_=h[y>>2]|0,_)A=_+8|0;else if(h[A>>2]|0){vn=70;break}h[A>>2]=Vt,h[y>>2]=Vt}else vn=73}if((vn|0)==73){if(vn=0,f=h[Vt>>2]|0,f|0)do Ht=f,f=h[f+16>>2]|0,sn(Ht);while((f|0)!=0);sn(Vt),f=1}if(hn=hn+1|0,(hn|0)>=(Wt|0)){ii=f;break e}}(vn|0)==50?xt(27452,27235,249,27471):(vn|0)==52?xt(27490,27235,252,27471):(vn|0)==70&&xt(27310,27235,61,27333)}else ii=0;while(!1);return sn(Mn),sn(_t),vn=ii,vn|0}return 0}function LT(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0;if(!(Ov(f,A)|0)||(f=uT(f)|0,_=+V[A>>3],y=+V[A+8>>3],y=f&y<0?y+6.283185307179586:y,d=h[d>>2]|0,!d))return d=0,d|0;if(f){f=0,B=y,A=d;e:for(;;){for(;T=+V[A>>3],y=+V[A+8>>3],A=A+16|0,G=h[A>>2]|0,G=(G|0)==0?d:G,S=+V[G>>3],E=+V[G+8>>3],T>S?(L=T,T=E):(L=S,S=T,T=y,y=E),_=_==S|_==L?_+2220446049250313e-31:_,!!(_<S|_>L);)if(A=h[A>>2]|0,!A){A=22;break e}if(E=T<0?T+6.283185307179586:T,T=y<0?y+6.283185307179586:y,B=E==B|T==B?B+-2220446049250313e-31:B,L=E+(T-E)*((_-S)/(L-S)),(L<0?L+6.283185307179586:L)>B&&(f=f^1),A=h[A>>2]|0,!A){A=22;break}}if((A|0)==22)return f|0}else{f=0,B=y,A=d;e:for(;;){for(;T=+V[A>>3],y=+V[A+8>>3],A=A+16|0,G=h[A>>2]|0,G=(G|0)==0?d:G,S=+V[G>>3],E=+V[G+8>>3],T>S?(L=T,T=E):(L=S,S=T,T=y,y=E),_=_==S|_==L?_+2220446049250313e-31:_,!!(_<S|_>L);)if(A=h[A>>2]|0,!A){A=22;break e}if(B=T==B|y==B?B+-2220446049250313e-31:B,T+(y-T)*((_-S)/(L-S))>B&&(f=f^1),A=h[A>>2]|0,!A){A=22;break}}if((A|0)==22)return f|0}return 0}function cl(d,f,A,_,y){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0;var S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0,He=0,De=0;if(De=j,j=j+32|0,He=De+16|0,Te=De,S=pt(d|0,f|0,52)|0,X()|0,S=S&15,oe=pt(A|0,_|0,52)|0,X()|0,(S|0)!=(oe&15|0))return He=12,j=De,He|0;if(B=pt(d|0,f|0,45)|0,X()|0,B=B&127,G=pt(A|0,_|0,45)|0,X()|0,G=G&127,B>>>0>121|G>>>0>121)return He=5,j=De,He|0;if(oe=(B|0)!=(G|0),oe){if(E=Uv(B,G)|0,(E|0)==7)return He=1,j=De,He|0;L=Uv(G,B)|0,(L|0)==7?xt(27514,27538,161,27548):(ae=E,T=L)}else ae=0,T=0;ee=Mi(B)|0,ce=Mi(G)|0,h[He>>2]=0,h[He+4>>2]=0,h[He+8>>2]=0,h[He+12>>2]=0;do if(ae){if(G=h[4272+(B*28|0)+(ae<<2)>>2]|0,E=(G|0)>0,ce)if(E){B=0,L=A,E=_;do L=tF(L,E)|0,E=X()|0,T=Yl(T)|0,(T|0)==1&&(T=Yl(1)|0),B=B+1|0;while((B|0)!=(G|0));G=T,B=L,L=E}else G=T,B=A,L=_;else if(E){B=0,L=A,E=_;do L=Xv(L,E)|0,E=X()|0,T=Yl(T)|0,B=B+1|0;while((B|0)!=(G|0));G=T,B=L,L=E}else G=T,B=A,L=_;if(Qv(B,L,He)|0,oe||xt(27563,27538,191,27548),E=(ee|0)!=0,T=(ce|0)!=0,E&T&&xt(27590,27538,192,27548),E){if(T=Ns(d,f)|0,(T|0)==7){S=5;break}if(fe[22e3+(T*7|0)+ae>>0]|0){S=1;break}L=h[21168+(T*28|0)+(ae<<2)>>2]|0,B=L}else if(T){if(T=Ns(B,L)|0,(T|0)==7){S=5;break}if(fe[22e3+(T*7|0)+G>>0]|0){S=1;break}B=0,L=h[21168+(G*28|0)+(T<<2)>>2]|0}else B=0,L=0;if((B|L|0)<0)S=5;else{if((L|0)>0){E=He+4|0,T=0;do am(E),T=T+1|0;while((T|0)!=(L|0))}if(h[Te>>2]=0,h[Te+4>>2]=0,h[Te+8>>2]=0,mT(Te,ae),S|0)for(;To(S)|0?om(Te):iu(Te),(S|0)>1;)S=S+-1|0;if((B|0)>0){S=0;do am(Te),S=S+1|0;while((S|0)!=(B|0))}ve=He+4|0,ps(ve,Te,ve),Jr(ve),ve=51}}else if(Qv(A,_,He)|0,(ee|0)!=0&(ce|0)!=0)if((G|0)!=(B|0)&&xt(27621,27538,261,27548),T=Ns(d,f)|0,S=Ns(A,_)|0,(T|0)==7|(S|0)==7)S=5;else if(fe[22e3+(T*7|0)+S>>0]|0)S=1;else if(T=h[21168+(T*28|0)+(S<<2)>>2]|0,(T|0)>0){E=He+4|0,S=0;do am(E),S=S+1|0;while((S|0)!=(T|0));ve=51}else ve=51;else ve=51;while(!1);
3839return(ve|0)==51&&(S=He+4|0,h[y>>2]=h[S>>2],h[y+4>>2]=h[S+4>>2],h[y+8>>2]=h[S+8>>2],S=0),He=S,j=De,He|0}function NT(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0,He=0,De=0,Le=0;if(ve=j,j=j+48|0,B=ve+36|0,T=ve+24|0,E=ve+12|0,L=ve,y=pt(d|0,f|0,52)|0,X()|0,y=y&15,ce=pt(d|0,f|0,45)|0,X()|0,ce=ce&127,ce>>>0>121)return _=5,j=ve,_|0;if(G=Mi(ce)|0,bt(y|0,0,52)|0,Te=X()|0|134225919,S=_,h[S>>2]=-1,h[S+4>>2]=Te,!y)return y=sm(A)|0,(y|0)==7||(y=Fv(ce,y)|0,(y|0)==127)?(Te=1,j=ve,Te|0):(oe=bt(y|0,0,45)|0,ae=X()|0,ce=_,ae=h[ce+4>>2]&-1040385|ae,Te=_,h[Te>>2]=h[ce>>2]|oe,h[Te+4>>2]=ae,Te=0,j=ve,Te|0);for(h[B>>2]=h[A>>2],h[B+4>>2]=h[A+4>>2],h[B+8>>2]=h[A+8>>2],A=y;;){if(S=A,A=A+-1|0,h[T>>2]=h[B>>2],h[T+4>>2]=h[B+4>>2],h[T+8>>2]=h[B+8>>2],To(S)|0){if(y=LB(B)|0,y|0){A=13;break}h[E>>2]=h[B>>2],h[E+4>>2]=h[B+4>>2],h[E+8>>2]=h[B+8>>2],om(E)}else{if(y=NB(B)|0,y|0){A=13;break}h[E>>2]=h[B>>2],h[E+4>>2]=h[B+4>>2],h[E+8>>2]=h[B+8>>2],iu(E)}if(zv(T,E,L),Jr(L),y=_,De=h[y>>2]|0,y=h[y+4>>2]|0,Le=(15-S|0)*3|0,He=bt(7,0,Le|0)|0,y=y&~(X()|0),Le=bt(sm(L)|0,0,Le|0)|0,y=X()|0|y,Te=_,h[Te>>2]=Le|De&~He,h[Te+4>>2]=y,(S|0)<=1){A=14;break}}e:do if((A|0)!=13&&(A|0)==14)if((h[B>>2]|0)<=1&&(h[B+4>>2]|0)<=1&&(h[B+8>>2]|0)<=1){A=sm(B)|0,y=Fv(ce,A)|0,(y|0)==127?L=0:L=Mi(y)|0;t:do if(A){if(G){if(y=Ns(d,f)|0,(y|0)==7){y=5;break e}if(S=h[21376+(y*28|0)+(A<<2)>>2]|0,(S|0)>0){y=A,A=0;do y=ru(y)|0,A=A+1|0;while((A|0)!=(S|0))}else y=A;if((y|0)==1){y=9;break e}A=Fv(ce,y)|0,(A|0)==127&&xt(27648,27538,411,27678),Mi(A)|0?xt(27693,27538,412,27678):(ae=A,oe=S,ee=y)}else ae=y,oe=0,ee=A;if(E=h[4272+(ce*28|0)+(ee<<2)>>2]|0,(E|0)<=-1&&xt(27724,27538,419,27678),!L){if((oe|0)<0){y=5;break e}if(oe|0){S=_,y=0,A=h[S>>2]|0,S=h[S+4>>2]|0;do A=su(A,S)|0,S=X()|0,Le=_,h[Le>>2]=A,h[Le+4>>2]=S,y=y+1|0;while((y|0)<(oe|0))}if((E|0)<=0){y=ae,A=58;break}for(S=_,y=0,A=h[S>>2]|0,S=h[S+4>>2]|0;;)if(A=su(A,S)|0,S=X()|0,Le=_,h[Le>>2]=A,h[Le+4>>2]=S,y=y+1|0,(y|0)==(E|0)){y=ae,A=58;break t}}if(T=Uv(ae,ce)|0,(T|0)==7&&xt(27514,27538,428,27678),y=_,A=h[y>>2]|0,y=h[y+4>>2]|0,(E|0)>0){S=0;do A=su(A,y)|0,y=X()|0,Le=_,h[Le>>2]=A,h[Le+4>>2]=y,S=S+1|0;while((S|0)!=(E|0))}if(y=Ns(A,y)|0,(y|0)==7&&xt(27795,27538,440,27678),A=Bv(ae)|0,A=h[(A?21792:21584)+(T*28|0)+(y<<2)>>2]|0,(A|0)<0&&xt(27795,27538,454,27678),!A)y=ae,A=58;else{T=_,y=0,S=h[T>>2]|0,T=h[T+4>>2]|0;do S=jv(S,T)|0,T=X()|0,Le=_,h[Le>>2]=S,h[Le+4>>2]=T,y=y+1|0;while((y|0)<(A|0));y=ae,A=58}}else if((G|0)!=0&(L|0)!=0){if(A=Ns(d,f)|0,S=_,S=Ns(h[S>>2]|0,h[S+4>>2]|0)|0,(A|0)==7|(S|0)==7){y=5;break e}if(S=h[21376+(A*28|0)+(S<<2)>>2]|0,(S|0)<0){y=5;break e}if(!S)A=59;else{E=_,A=0,T=h[E>>2]|0,E=h[E+4>>2]|0;do T=su(T,E)|0,E=X()|0,Le=_,h[Le>>2]=T,h[Le+4>>2]=E,A=A+1|0;while((A|0)<(S|0));A=58}}else A=58;while(!1);if((A|0)==58&&L&&(A=59),(A|0)==59&&(Le=_,(Ns(h[Le>>2]|0,h[Le+4>>2]|0)|0)==1)){y=9;break}Le=_,He=h[Le>>2]|0,Le=h[Le+4>>2]&-1040385,De=bt(y|0,0,45)|0,Le=Le|(X()|0),y=_,h[y>>2]=He|De,h[y+4>>2]=Le,y=0}else y=1;while(!1);return Le=y,j=ve,Le|0}function bF(d,f,A,_,y,S){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0,S=S|0;var T=0,E=0;return E=j,j=j+16|0,T=E,y?d=15:(d=cl(d,f,A,_,T)|0,d||(IB(T,S),d=0)),j=E,d|0}function SF(d,f,A,_,y){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0;var S=0,T=0;return T=j,j=j+16|0,S=T,_?A=15:(A=BB(A,S)|0,A||(A=NT(d,f,S,y)|0)),j=T,A|0}function MF(d,f,A,_,y){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0;var S=0,T=0,E=0,L=0;return L=j,j=j+32|0,T=L+12|0,E=L,S=cl(d,f,d,f,T)|0,S|0?(E=S,j=L,E|0):(d=cl(d,f,A,_,E)|0,d|0?(E=d,j=L,E|0):(T=Vv(T,E)|0,E=y,h[E>>2]=T,h[E+4>>2]=((T|0)<0)<<31>>31,E=0,j=L,E|0))}function wF(d,f,A,_,y){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0;var S=0,T=0,E=0,L=0;return L=j,j=j+32|0,T=L+12|0,E=L,S=cl(d,f,d,f,T)|0,!S&&(S=cl(d,f,A,_,E)|0,!S)?(_=Vv(T,E)|0,_=Kt(_|0,((_|0)<0)<<31>>31|0,1,0)|0,T=X()|0,E=y,h[E>>2]=_,h[E+4>>2]=T,E=0,j=L,E|0):(E=S,j=L,E|0)}function TF(d,f,A,_,y){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0;var S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0,He=0,De=0,Le=0,xe=0,yt=0,Ht=0,Vt=0,hn=0;if(Vt=j,j=j+48|0,yt=Vt+24|0,T=Vt+12|0,Ht=Vt,S=cl(d,f,d,f,yt)|0,!S&&(S=cl(d,f,A,_,T)|0,!S)){Le=Vv(yt,T)|0,xe=((Le|0)<0)<<31>>31,h[yt>>2]=0,h[yt+4>>2]=0,h[yt+8>>2]=0,h[T>>2]=0,h[T+4>>2]=0,h[T+8>>2]=0,cl(d,f,d,f,yt)|0&&xt(27795,27538,692,27747),cl(d,f,A,_,T)|0&&xt(27795,27538,697,27747),yT(yt),yT(T),G=(Le|0)==0?0:1/+(Le|0),A=h[yt>>2]|0,ve=G*+((h[T>>2]|0)-A|0),Te=yt+4|0,_=h[Te>>2]|0,He=G*+((h[T+4>>2]|0)-_|0),De=yt+8|0,S=h[De>>2]|0,G=G*+((h[T+8>>2]|0)-S|0),h[Ht>>2]=A,ee=Ht+4|0,h[ee>>2]=_,ce=Ht+8|0,h[ce>>2]=S;e:do if((Le|0)<0)S=0;else for(oe=0,ae=0;;){L=+(ae>>>0)+4294967296*+(oe|0),hn=ve*L+ +(A|0),E=He*L+ +(_|0),L=G*L+ +(S|0),A=~~+dm(+hn),T=~~+dm(+E),S=~~+dm(+L),hn=+Et(+(+(A|0)-hn)),E=+Et(+(+(T|0)-E)),L=+Et(+(+(S|0)-L));do if(hn>E&hn>L)A=0-(T+S)|0,_=T;else if(B=0-A|0,E>L){_=B-S|0;break}else{_=T,S=B-T|0;break}while(!1);if(h[Ht>>2]=A,h[ee>>2]=_,h[ce>>2]=S,FB(Ht),S=NT(d,f,Ht,y+(ae<<3)|0)|0,S|0)break e;if(!((oe|0)<(xe|0)|(oe|0)==(xe|0)&ae>>>0<Le>>>0)){S=0;break e}A=Kt(ae|0,oe|0,1,0)|0,_=X()|0,oe=_,ae=A,A=h[yt>>2]|0,_=h[Te>>2]|0,S=h[De>>2]|0}while(!1);return Ht=S,j=Vt,Ht|0}return Ht=S,j=Vt,Ht|0}function Ql(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0;if((A|0)==0&(_|0)==0)return y=0,S=1,lt(y|0),S|0;S=d,y=f,d=1,f=0;do T=(A&1|0)==0&!0,d=es((T?1:S)|0,(T?0:y)|0,d|0,f|0)|0,f=X()|0,A=HT(A|0,_|0,1)|0,_=X()|0,S=es(S|0,y|0,S|0,y|0)|0,y=X()|0;while(!((A|0)==0&(_|0)==0));return lt(f|0),d|0}function ny(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0,B=0,G=0;E=j,j=j+16|0,S=E,T=pt(d|0,f|0,52)|0,X()|0,T=T&15;do if(T){if(y=ou(d,f,S)|0,!y){B=+V[S>>3],L=1/+kt(+B),G=+V[25968+(T<<3)>>3],V[A>>3]=B+G,V[A+8>>3]=B-G,B=+V[S+8>>3],L=G*L,V[A+16>>3]=L+B,V[A+24>>3]=B-L;break}return T=y,j=E,T|0}else{if(y=pt(d|0,f|0,45)|0,X()|0,y=y&127,y>>>0>121)return T=5,j=E,T|0;S=22064+(y<<5)|0,h[A>>2]=h[S>>2],h[A+4>>2]=h[S+4>>2],h[A+8>>2]=h[S+8>>2],h[A+12>>2]=h[S+12>>
38392],h[A+16>>2]=h[S+16>>2],h[A+20>>2]=h[S+20>>2],h[A+24>>2]=h[S+24>>2],h[A+28>>2]=h[S+28>>2];break}while(!1);return RB(A,_?1.4:1.1),_=26096+(T<<3)|0,(h[_>>2]|0)==(d|0)&&(h[_+4>>2]|0)==(f|0)&&(V[A>>3]=1.5707963267948966),T=26224+(T<<3)|0,(h[T>>2]|0)==(d|0)&&(h[T+4>>2]|0)==(f|0)&&(V[A+8>>3]=-1.5707963267948966),+V[A>>3]!=1.5707963267948966&&+V[A+8>>3]!=-1.5707963267948966?(T=0,j=E,T|0):(V[A+16>>3]=3.141592653589793,V[A+24>>3]=-3.141592653589793,T=0,j=E,T|0)}function EF(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0,B=0,G=0;B=j,j=j+48|0,T=B+32|0,S=B+40|0,E=B,Wv(T,0,0,0),L=h[T>>2]|0,T=h[T+4>>2]|0;do if(A>>>0<=15){if(y=pp(_)|0,y|0){_=E,h[_>>2]=0,h[_+4>>2]=0,h[E+8>>2]=y,h[E+12>>2]=-1,_=E+16|0,L=E+29|0,h[_>>2]=0,h[_+4>>2]=0,h[_+8>>2]=0,fe[_+12>>0]=0,fe[L>>0]=fe[S>>0]|0,fe[L+1>>0]=fe[S+1>>0]|0,fe[L+2>>0]=fe[S+2>>0]|0;break}if(y=Ro((h[f+8>>2]|0)+1|0,32)|0,y){iy(f,y),G=E,h[G>>2]=L,h[G+4>>2]=T,h[E+8>>2]=0,h[E+12>>2]=A,h[E+16>>2]=_,h[E+20>>2]=f,h[E+24>>2]=y,fe[E+28>>0]=0,L=E+29|0,fe[L>>0]=fe[S>>0]|0,fe[L+1>>0]=fe[S+1>>0]|0,fe[L+2>>0]=fe[S+2>>0]|0;break}else{_=E,h[_>>2]=0,h[_+4>>2]=0,h[E+8>>2]=13,h[E+12>>2]=-1,_=E+16|0,L=E+29|0,h[_>>2]=0,h[_+4>>2]=0,h[_+8>>2]=0,fe[_+12>>0]=0,fe[L>>0]=fe[S>>0]|0,fe[L+1>>0]=fe[S+1>>0]|0,fe[L+2>>0]=fe[S+2>>0]|0;break}}else L=E,h[L>>2]=0,h[L+4>>2]=0,h[E+8>>2]=4,h[E+12>>2]=-1,L=E+16|0,G=E+29|0,h[L>>2]=0,h[L+4>>2]=0,h[L+8>>2]=0,fe[L+12>>0]=0,fe[G>>0]=fe[S>>0]|0,fe[G+1>>0]=fe[S+1>>0]|0,fe[G+2>>0]=fe[S+2>>0]|0;while(!1);cm(E),h[d>>2]=h[E>>2],h[d+4>>2]=h[E+4>>2],h[d+8>>2]=h[E+8>>2],h[d+12>>2]=h[E+12>>2],h[d+16>>2]=h[E+16>>2],h[d+20>>2]=h[E+20>>2],h[d+24>>2]=h[E+24>>2],h[d+28>>2]=h[E+28>>2],j=B}function cm(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0,He=0,De=0,Le=0,xe=0;if(xe=j,j=j+336|0,oe=xe+168|0,ae=xe,_=d,A=h[_>>2]|0,_=h[_+4>>2]|0,(A|0)==0&(_|0)==0){j=xe;return}if(f=d+28|0,fe[f>>0]|0?(A=DT(A,_)|0,_=X()|0):fe[f>>0]=1,Le=d+20|0,!(h[h[Le>>2]>>2]|0)){f=d+24|0,A=h[f>>2]|0,A|0&&sn(A),De=d,h[De>>2]=0,h[De+4>>2]=0,h[d+8>>2]=0,h[Le>>2]=0,h[d+12>>2]=-1,h[d+16>>2]=0,h[f>>2]=0,j=xe;return}De=d+16|0,f=h[De>>2]|0,y=f&15;e:do if((A|0)==0&(_|0)==0)He=d+24|0;else{ve=d+12|0,ee=(y|0)==3,G=f&255,L=(y|1|0)==3,ce=d+24|0,B=(y+-1|0)>>>0<3,T=(y|2|0)==3,E=ae+8|0;t:for(;;){if(S=pt(A|0,_|0,52)|0,X()|0,S=S&15,(S|0)==(h[ve>>2]|0)){switch(G&15){case 0:case 2:case 3:{if(y=ou(A,_,oe)|0,y|0){Te=15;break t}if(ry(h[Le>>2]|0,h[ce>>2]|0,oe)|0){Te=19;break t}break}}if(L&&(y=h[(h[Le>>2]|0)+4>>2]|0,h[oe>>2]=h[y>>2],h[oe+4>>2]=h[y+4>>2],h[oe+8>>2]=h[y+8>>2],h[oe+12>>2]=h[y+12>>
38392],Ov(26832,oe)|0)){if(Yv(h[(h[Le>>2]|0)+4>>2]|0,S,ae)|0){Te=25;break}if(y=ae,(h[y>>2]|0)==(A|0)&&(h[y+4>>2]|0)==(_|0)){Te=29;break}}if(B){if(y=bh(A,_,oe)|0,y|0){Te=32;break}if(ny(A,_,ae,0)|0){Te=36;break}if(T&&BT(h[Le>>2]|0,h[ce>>2]|0,oe,ae)|0){Te=42;break}if(L&&FT(h[Le>>2]|0,h[ce>>2]|0,oe,ae)|0){Te=42;break}}if(ee){if(f=ny(A,_,oe,1)|0,y=h[ce>>2]|0,f|0){Te=45;break}if(kv(y,oe)|0){if(dT(ae,oe),hT(oe,h[ce>>2]|0)|0){Te=53;break}if(ry(h[Le>>2]|0,h[ce>>2]|0,E)|0){Te=53;break}if(FT(h[Le>>2]|0,h[ce>>2]|0,ae,oe)|0){Te=53;break}}}}do if((S|0)<(h[ve>>2]|0)){if(f=ny(A,_,oe,1)|0,y=h[ce>>2]|0,f|0){Te=58;break t}if(!(kv(y,oe)|0)){Te=73;break}if(hT(h[ce>>2]|0,oe)|0&&(dT(ae,oe),BT(h[Le>>2]|0,h[ce>>2]|0,ae,oe)|0)){Te=65;break t}if(A=wT(A,_,S+1|0,ae)|0,A|0){Te=67;break t}_=ae,A=h[_>>2]|0,_=h[_+4>>2]|0}else Te=73;while(!1);if((Te|0)==73&&(Te=0,A=DT(A,_)|0,_=X()|0),(A|0)==0&(_|0)==0){He=ce;break e}}switch(Te|0){case 15:{f=h[ce>>2]|0,f|0&&sn(f),Te=d,h[Te>>2]=0,h[Te+4>>2]=0,h[Le>>2]=0,h[ve>>2]=-1,h[De>>2]=0,h[ce>>2]=0,h[d+8>>2]=y,Te=20;break}case 19:{h[d>>2]=A,h[d+4>>2]=_,Te=20;break}case 25:{xt(27795,27761,470,27772);break}case 29:{h[d>>2]=A,h[d+4>>2]=_,j=xe;return}case 32:{f=h[ce>>2]|0,f|0&&sn(f),He=d,h[He>>2]=0,h[He+4>>2]=0,h[Le>>2]=0,h[ve>>2]=-1,h[De>>2]=0,h[ce>>2]=0,h[d+8>>2]=y,j=xe;return}case 36:{xt(27795,27761,493,27772);break}case 42:{h[d>>2]=A,h[d+4>>2]=_,j=xe;return}case 45:{y|0&&sn(y),Te=d,h[Te>>2]=0,h[Te+4>>2]=0,h[Le>>2]=0,h[ve>>2]=-1,h[De>>2]=0,h[ce>>2]=0,h[d+8>>2]=f,Te=55;break}case 53:{h[d>>2]=A,h[d+4>>2]=_,Te=55;break}case 58:{y|0&&sn(y),Te=d,h[Te>>2]=0,h[Te+4>>2]=0,h[Le>>2]=0,h[ve>>2]=-1,h[De>>2]=0,h[ce>>2]=0,h[d+8>>2]=f,Te=71;break}case 65:{h[d>>2]=A,h[d+4>>2]=_,Te=71;break}case 67:{f=h[ce>>2]|0,f|0&&sn(f),He=d,h[He>>2]=0,h[He+4>>2]=0,h[Le>>2]=0,h[ve>>2]=-1,h[De>>2]=0,h[ce>>2]=0,h[d+8>>2]=A,j=xe;return}}if((Te|0)==20){j=xe;return}else if((Te|0)==55){j=xe;return}else if((Te|0)==71){j=xe;return}}while(!1);f=h[He>>2]|0,f|0&&sn(f),Te=d,h[Te>>2]=0,h[Te+4>>2]=0,h[d+8>>2]=0,h[Le>>2]=0,h[d+12>>2]=-1,h[De>>2]=0,h[He>>2]=0,j=xe}function DT(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0;ee=j,j=j+16|0,G=ee,_=pt(d|0,f|0,52)|0,X()|0,_=_&15,A=pt(d|0,f|0,45)|0,X()|0;do if(_){for(;A=bt(_+4095|0,0,52)|0,y=X()|0|f&-15728641,S=(15-_|0)*3|0,T=bt(7,0,S|0)|0,E=X()|0,A=A|d|T,y=y|E,L=pt(d|0,f|0,S|0)|0,X()|0,L=L&7,_=_+-1|0,!(L>>>0<6);)if(_)f=y,d=A;else{B=4;break}if((B|0)==4){A=pt(A|0,y|0,45)|0,X()|0;break}return G=(L|0)==0&(ci(A,y)|0)!=0,G=bt((G?2:1)+L|0,0,S|0)|0,B=X()|0|f&~E,G=G|d&~T,lt(B|0),j=ee,G|0}while(!1);return A=A&127,A>>>0>120?(B=0,G=0,lt(B|0),j=ee,G|0):(Wv(G,0,A+1|0,0),B=h[G+4>>2]|0,G=h[G>>2]|0,lt(B|0),j=ee,G|0)}function RF(d,f,A,_,y,S){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0,S=S|0;var T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0;Te=j,j=j+160|0,ee=Te+80|0,E=Te+64|0,ce=Te+112|0,ve=Te,EF(ee,d,f,A),B=ee,Kv(E,h[B>>2]|0,h[B+4>>2]|0,f),B=E,L=h[B>>2]|0,B=h[B+4>>2]|0,T=h[ee+8>>2]|0,oe=ce+4|0,h[oe>>2]=h[ee>>2],h[oe+4>>2]=h[ee+4>>2],h[oe+8>>2]=h[ee+8>>2],h[oe+12>>2]=h[ee+12>>2],h[oe+16>>2]=h[ee+16>>2],h[oe+20>>2]=h[ee+20>>2],h[oe+24>>2]=h[ee+24>>2],h[oe+28>>2]=h[ee+28>>2],oe=ve,h[oe>>2]=L,h[oe+4>>2]=B,oe=ve+8|0,h[oe>>2]=T,d=ve+12|0,f=ce,A=d+36|0;do h[d>>2]=h[f>>2],d=d+4|0,f=f+4|0;while((d|0)<(A|0));if(ce=ve+48|0,h[ce>>2]=h[E>>2],h[ce+4>>2]=h[E+4>>2],h[ce+8>>2]=h[E+8>>2],h[ce+12>>2]=h[E+12>>2],(L|0)==0&(B|0)==0)return ve=T,j=Te,ve|0;A=ve+16|0,G=ve+24|0,ee=ve+28|0,T=0,E=0,f=L,d=B;do{if(!((T|0)<(y|0)|(T|0)==(y|0)&E>>>0<_>>>0)){ae=4;break}if(B=E,E=Kt(E|0,T|0,1,0)|0,T=X()|0,B=S+(B<<3)|0,h[B>>2]=f,h[B+4>>2]=d,Jv(ce),d=ce,f=h[d>>2]|0,d=h[d+4>>2]|0,(f|0)==0&(d|0)==0){if(cm(A),f=A,d=h[f>>2]|0,f=h[f+4>>2]|0,(d|0)==0&(f|0)==0){ae=10;break}ET(d,f,h[ee>>2]|0,ce),d=ce,f=h[d>>2]|0,d=h[d+4>>2]|0}B=ve,h[B>>2]=f,h[B+4>>2]=d}while(!((f|0)==0&(d|0)==0));return(ae|0)==4?(d=ve+40|0,f=h[d>>2]|0,f|0&&sn(f),ae=ve+16|0,h[ae>>2]=0,h[ae+4>>2]=0,h[G>>2]=0,h[ve+36>>2]=0,h[ee>>2]=-1,h[ve+32>>2]=0,h[d>>2]=0,ET(0,0,0,ce),h[ve>>2]=0,h[ve+4>>2]=0,h[oe>>2]=0,ve=14,j=Te,ve|0):((ae|0)==10&&(h[ve>>2]=0,h[ve+4>>2]=0,h[oe>>2]=h[G>>2]),ve=h[oe>>2]|0,j=Te,ve|0)}function CF(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0;if(ee=j,j=j+48|0,L=ee+32|0,E=ee+40|0,B=ee,!(h[d>>2]|0))return G=_,h[G>>2]=0,h[G+4>>2]=0,G=0,j=ee,G|0;Wv(L,0,0,0),T=L,y=h[T>>2]|0,T=h[T+4>>2]|0;do if(f>>>0>15)G=B,h[G>>2]=0,h[G+4>>2]=0,h[B+8>>2]=4,h[B+12>>2]=-1,G=B+16|0,A=B+29|0,h[G>>2]=0,h[G+4>>2]=0,h[G+8>>2]=0,fe[G+12>>0]=0,fe[A>>0]=fe[E>>0]|0,fe[A+1>>0]=fe[E+1>>
38390]|0,fe[A+2>>0]=fe[E+2>>0]|0,A=4,G=9;else{if(A=pp(A)|0,A|0){L=B,h[L>>2]=0,h[L+4>>2]=0,h[B+8>>2]=A,h[B+12>>2]=-1,L=B+16|0,G=B+29|0,h[L>>2]=0,h[L+4>>2]=0,h[L+8>>2]=0,fe[L+12>>0]=0,fe[G>>0]=fe[E>>0]|0,fe[G+1>>0]=fe[E+1>>0]|0,fe[G+2>>0]=fe[E+2>>0]|0,G=9;break}if(A=Ro((h[d+8>>2]|0)+1|0,32)|0,!A){G=B,h[G>>2]=0,h[G+4>>2]=0,h[B+8>>2]=13,h[B+12>>2]=-1,G=B+16|0,A=B+29|0,h[G>>2]=0,h[G+4>>2]=0,h[G+8>>2]=0,fe[G+12>>0]=0,fe[A>>0]=fe[E>>0]|0,fe[A+1>>0]=fe[E+1>>0]|0,fe[A+2>>0]=fe[E+2>>0]|0,A=13,G=9;break}iy(d,A),oe=B,h[oe>>2]=y,h[oe+4>>2]=T,T=B+8|0,h[T>>2]=0,h[B+12>>2]=f,h[B+20>>2]=d,h[B+24>>2]=A,fe[B+28>>0]=0,y=B+29|0,fe[y>>0]=fe[E>>0]|0,fe[y+1>>0]=fe[E+1>>0]|0,fe[y+2>>0]=fe[E+2>>0]|0,h[B+16>>2]=3,ce=+wB(A),ce=ce*+MB(A),S=+Et(+ +V[A>>3]),S=ce/+kt(+ +hm(+S,+ +Et(+ +V[A+8>>3])))*6371.007180918475*6371.007180918475,y=B+12|0,A=h[y>>2]|0;e:do if((A|0)>0)do{if(RT(A+-1|0,L)|0,!(S/+V[L>>3]>10))break e;oe=h[y>>2]|0,A=oe+-1|0,h[y>>2]=A}while((oe|0)>1);while(!1);if(cm(B),y=_,h[y>>2]=0,h[y+4>>2]=0,y=B,A=h[y>>2]|0,y=h[y+4>>2]|0,!((A|0)==0&(y|0)==0))do up(A,y,f,L)|0,E=L,d=_,E=Kt(h[d>>2]|0,h[d+4>>2]|0,h[E>>2]|0,h[E+4>>2]|0)|0,d=X()|0,oe=_,h[oe>>2]=E,h[oe+4>>2]=d,cm(B),oe=B,A=h[oe>>2]|0,y=h[oe+4>>2]|0;while(!((A|0)==0&(y|0)==0));A=h[T>>2]|0}while(!1);return oe=A,j=ee,oe|0}function fp(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0;if(!(Ov(f,A)|0)||(f=uT(f)|0,_=+V[A>>3],y=+V[A+8>>3],y=f&y<0?y+6.283185307179586:y,ce=h[d>>2]|0,(ce|0)<=0))return ce=0,ce|0;if(ee=h[d+4>>2]|0,f){f=0,G=y,A=-1,d=0;e:for(;;){for(B=d;T=+V[ee+(B<<4)>>3],y=+V[ee+(B<<4)+8>>3],d=(A+2|0)%(ce|0)|0,S=+V[ee+(d<<4)>>3],E=+V[ee+(d<<4)+8>>3],T>S?(L=T,T=E):(L=S,S=T,T=y,y=E),_=_==S|_==L?_+2220446049250313e-31:_,!!(_<S|_>L);)if(A=B+1|0,(A|0)>=(ce|0)){A=22;break e}else d=B,B=A,A=d;if(E=T<0?T+6.283185307179586:T,T=y<0?y+6.283185307179586:y,G=E==G|T==G?G+-2220446049250313e-31:G,L=E+(T-E)*((_-S)/(L-S)),(L<0?L+6.283185307179586:L)>G&&(f=f^1),d=B+1|0,(d|0)>=(ce|0)){A=22;break}else A=B}if((A|0)==22)return f|0}else{f=0,G=y,A=-1,d=0;e:for(;;){for(B=d;T=+V[ee+(B<<4)>>3],y=+V[ee+(B<<4)+8>>3],d=(A+2|0)%(ce|0)|0,S=+V[ee+(d<<4)>>3],E=+V[ee+(d<<4)+8>>3],T>S?(L=T,T=E):(L=S,S=T,T=y,y=E),_=_==S|_==L?_+2220446049250313e-31:_,!!(_<S|_>L);)if(A=B+1|0,(A|0)>=(ce|0)){A=22;break e}else d=B,B=A,A=d;if(G=T==G|y==G?G+-2220446049250313e-31:G,T+(y-T)*((_-S)/(L-S))>G&&(f=f^1),d=B+1|0,(d|0)>=(ce|0)){A=22;break}else A=B}if((A|0)==22)return f|0}return 0}function IT(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0,He=0,De=0;if(ae=h[d>>2]|0,!ae){h[f>>2]=0,h[f+4>>2]=0,h[f+8>>2]=0,h[f+12>>2]=0,h[f+16>>2]=0,h[f+20>>2]=0,h[f+24>>2]=0,h[f+28>>2]=0;return}if(ve=f+8|0,V[ve>>3]=17976931348623157e292,Te=f+24|0,V[Te>>3]=17976931348623157e292,V[f>>3]=-17976931348623157e292,He=f+16|0,V[He>>3]=-17976931348623157e292,!((ae|0)<=0)){for(ce=h[d+4>>2]|0,B=17976931348623157e292,G=-17976931348623157e292,ee=0,d=-1,S=17976931348623157e292,T=17976931348623157e292,L=-17976931348623157e292,_=-17976931348623157e292,oe=0;A=+V[ce+(oe<<4)>>3],E=+V[ce+(oe<<4)+8>>3],d=d+2|0,y=+V[ce+(((d|0)==(ae|0)?0:d)<<4)+8>>3],A<S&&(V[ve>>3]=A,S=A),E<T&&(V[Te>>3]=E,T=E),A>L?V[f>>3]=A:A=L,E>_&&(V[He>>3]=E,_=E),B=E>0&E<B?E:B,G=E<0&E>G?E:G,ee=ee|+Et(+(E-y))>3.141592653589793,d=oe+1|0,(d|0)!=(ae|0);)De=oe,L=A,oe=d,d=De;ee&&(V[He>>3]=G,V[Te>>3]=B)}}function pp(d){return d=d|0,(d>>>0<4?0:15)|0}function iy(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0,He=0,De=0,Le=0,xe=0,yt=0,Ht=0,Vt=0;if(ae=h[d>>2]|0,ae){if(ve=f+8|0,V[ve>>3]=17976931348623157e292,Te=f+24|0,V[Te>>3]=17976931348623157e292,V[f>>3]=-17976931348623157e292,He=f+16|0,V[He>>3]=-17976931348623157e292,(ae|0)>0){for(y=h[d+4>>2]|0,ce=17976931348623157e292,oe=-17976931348623157e292,_=0,A=-1,L=17976931348623157e292,B=17976931348623157e292,ee=-17976931348623157e292,T=-17976931348623157e292,De=0;S=+V[y+(De<<4)>>3],G=+V[y+(De<<4)+8>>3],Ht=A+2|0,E=+V[y+(((Ht|0)==(ae|0)?0:Ht)<<4)+8>>3],S<L&&(V[ve>>3]=S,L=S),G<B&&(V[Te>>3]=G,B=G),S>ee?V[f>>3]=S:S=ee,G>T&&(V[He>>3]=G,T=G),ce=G>0&G<ce?G:ce,oe=G<0&G>oe?G:oe,_=_|+Et(+(G-E))>3.141592653589793,A=De+1|0,(A|0)!=(ae|0);)Ht=De,ee=S,De=A,A=Ht;_&&(V[He>>3]=oe,V[Te>>3]=ce)}}else h[f>>2]=0,h[f+4>>2]=0,h[f+8>>2]=0,h[f+12>>2]=0,h[f+16>>2]=0,h[f+20>>2]=0,h[f+24>>2]=0,h[f+28>>2]=0;if(Ht=d+8|0,A=h[Ht>>2]|0,!((A|0)<=0)){yt=d+12|0,xe=0;do if(y=h[yt>>2]|0,_=xe,xe=xe+1|0,Te=f+(xe<<5)|0,He=h[y+(_<<3)>>2]|0,He){if(De=f+(xe<<5)+8|0,V[De>>3]=17976931348623157e292,d=f+(xe<<5)+24|0,V[d>>3]=17976931348623157e292,V[Te>>3]=-17976931348623157e292,Le=f+(xe<<5)+16|0,V[Le>>3]=-17976931348623157e292,(He|0)>0){for(ae=h[y+(_<<3)+4>>2]|0,ce=17976931348623157e292,oe=-17976931348623157e292,y=0,_=-1,ve=0,L=17976931348623157e292,B=17976931348623157e292,G=-17976931348623157e292,T=-17976931348623157e292;S=+V[ae+(ve<<4)>>3],ee=+V[ae+(ve<<4)+8>>3],_=_+2|0,E=+V[ae+(((_|0)==(He|0)?0:_)<<4)+8>>3],S<L&&(V[De>>3]=S,L=S),ee<B&&(V[d>>3]=ee,B=ee),S>G?V[Te>>3]=S:S=G,ee>T&&(V[Le>>3]=ee,T=ee),ce=ee>0&ee<ce?ee:ce,oe=ee<0&ee>oe?ee:oe,y=y|+Et(+(ee-E))>3.141592653589793,_=ve+1|0,(_|0)!=(He|0);)Vt=ve,ve=_,G=S,_=Vt;y&&(V[Le>>3]=oe,V[d>>3]=ce)}}else h[Te>>2]=0,h[Te+4>>2]=0,h[Te+8>>2]=0,h[Te+12>>2]=0,h[Te+16>>2]=0,h[Te+20>>2]=0,h[Te+24>>2]=0,h[Te+28>>2]=0,A=h[Ht>>2]|0;while((xe|0)<(A|0))}}function ry(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0;if(!(fp(d,f,A)|0))return y=0,y|0;if(y=d+8|0,(h[y>>2]|0)<=0)return y=1,y|0;for(_=d+12|0,d=0;;){if(S=d,d=d+1|0,fp((h[_>>2]|0)+(S<<3)|0,f+(d<<5)|0,A)|0){d=0,_=6;break}if((d|0)>=(h[y>>2]|0)){d=1,_=6;break}}return(_|0)==6?d|0:0}function BT(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0,B=0,G=0;if(B=j,j=j+16|0,E=B,T=A+8|0,!(fp(d,f,T)|0))return L=0,j=B,L|0;L=d+8|0;e:do if((h[L>>2]|0)>0){for(S=d+12|0,y=0;;){if(G=y,y=y+1|0,fp((h[S>>2]|0)+(G<<3)|0,f+(y<<5)|0,T)|0){y=0;break}if((y|0)>=(h[L>>2]|0))break e}return j=B,y|0}while(!1);if(um(d,f,A,_)|0)return G=0,j=B,G|0;h[E>>2]=h[A>>2],h[E+4>>2]=T,y=h[L>>2]|0;e:do if((y|0)>0)for(d=d+12|0,T=0,S=y;;){if(y=h[d>>2]|0,(h[y+(T<<3)>>2]|0)>0){if(fp(E,_,h[y+(T<<3)+4>>2]|0)|0){y=0;break e}if(y=T+1|0,um((h[d>>2]|0)+(T<<3)|0,f+(y<<5)|0,A,_)|0){y=0;break e}S=h[L>>2]|0}else y=T+1|0;
3839if((y|0)<(S|0))T=y;else{y=1;break}}else y=1;while(!1);return G=y,j=B,G|0}function um(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0,He=0,De=0,Le=0,xe=0,yt=0,Ht=0,Vt=0,hn=0;if(Ht=j,j=j+176|0,De=Ht+172|0,y=Ht+168|0,Le=Ht,!(kv(f,_)|0))return d=0,j=Ht,d|0;if(TB(f,_,De,y),Th(Le|0,A|0,168)|0,(h[A>>2]|0)>0){f=0;do Vt=Le+8+(f<<4)+8|0,He=+io(+V[Vt>>3],h[y>>2]|0),V[Vt>>3]=He,f=f+1|0;while((f|0)<(h[A>>2]|0))}ve=+V[_>>3],Te=+V[_+8>>3],He=+io(+V[_+16>>3],h[y>>2]|0),oe=+io(+V[_+24>>3],h[y>>2]|0);e:do if((h[d>>2]|0)>0){if(_=d+4|0,y=h[Le>>2]|0,(y|0)<=0){for(f=0;;)if(f=f+1|0,(f|0)>=(h[d>>2]|0)){f=0;break e}}for(A=0;;){if(f=h[_>>2]|0,ce=+V[f+(A<<4)>>3],ae=+io(+V[f+(A<<4)+8>>3],h[De>>2]|0),f=h[_>>2]|0,A=A+1|0,Vt=(A|0)%(h[d>>2]|0)|0,S=+V[f+(Vt<<4)>>3],T=+io(+V[f+(Vt<<4)+8>>3],h[De>>2]|0),!(ce>=ve)|!(S>=ve)&&!(ce<=Te)|!(S<=Te)&&!(ae<=oe)|!(T<=oe)&&!(ae>=He)|!(T>=He)){ee=S-ce,B=T-ae,f=0;do if(hn=f,f=f+1|0,Vt=(f|0)==(y|0)?0:f,S=+V[Le+8+(hn<<4)+8>>3],T=+V[Le+8+(Vt<<4)+8>>3]-S,E=+V[Le+8+(hn<<4)>>3],L=+V[Le+8+(Vt<<4)>>3]-E,G=ee*T-B*L,G!=0&&(xe=ae-S,yt=ce-E,L=(xe*L-T*yt)/G,!(L<0|L>1))&&(G=(ee*xe-B*yt)/G,G>=0&G<=1)){f=1;break e}while((f|0)<(y|0))}if((A|0)>=(h[d>>2]|0)){f=0;break}}}else f=0;while(!1);return hn=f,j=Ht,hn|0}function FT(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0;if(um(d,f,A,_)|0)return S=1,S|0;if(S=d+8|0,(h[S>>2]|0)<=0)return S=0,S|0;for(y=d+12|0,d=0;;){if(T=d,d=d+1|0,um((h[y>>2]|0)+(T<<3)|0,f+(d<<5)|0,A,_)|0){d=1,y=6;break}if((d|0)>=(h[S>>2]|0)){d=0,y=6;break}}return(y|0)==6?d|0:0}function PF(){return 8}function LF(){return 16}function NF(){return 168}function DF(){return 8}function IF(){return 16}function BF(){return 12}function FF(){return 8}function UF(d){return d=d|0,+(+((h[d>>2]|0)>>>0)+4294967296*+(h[d+4>>2]|0))}function OF(d){d=d|0;var f=0,A=0;return A=+V[d>>3],f=+V[d+8>>3],+ +Ct(+(A*A+f*f))}function UT(d,f,A,_,y){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0;var S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0;B=+V[d>>3],L=+V[f>>3]-B,E=+V[d+8>>3],T=+V[f+8>>3]-E,ee=+V[A>>3],S=+V[_>>3]-ee,ce=+V[A+8>>3],G=+V[_+8>>3]-ce,S=(S*(E-ce)-(B-ee)*G)/(L*G-T*S),V[y>>3]=B+L*S,V[y+8>>3]=E+T*S}function OT(d,f){return d=d|0,f=f|0,+Et(+(+V[d>>3]-+V[f>>3]))<11920928955078125e-23?(f=+Et(+(+V[d+8>>3]-+V[f+8>>3]))<11920928955078125e-23,f|0):(f=0,f|0)}function or(d,f){d=d|0,f=f|0;var A=0,_=0,y=0;return y=+V[d>>3]-+V[f>>3],_=+V[d+8>>3]-+V[f+8>>3],A=+V[d+16>>3]-+V[f+16>>3],+(y*y+_*_+A*A)}function kF(d,f){d=d|0,f=f|0;var A=0,_=0,y=0;A=+V[d>>3],_=+kt(+A),A=+Pt(+A),V[f+16>>3]=A,A=+V[d+8>>3],y=_*+kt(+A),V[f>>3]=y,A=_*+Pt(+A),V[f+8>>3]=A}function zF(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0;if(S=j,j=j+16|0,y=S,_=ci(d,f)|0,(A+-1|0)>>>0>5||(_=(_|0)!=0,(A|0)==1&_))return y=-1,j=S,y|0;do if(Ap(d,f,y)|0)_=-1;else if(_){_=((h[26352+(A<<2)>>2]|0)+5-(h[y>>2]|0)|0)%5|0;break}else{_=((h[26384+(A<<2)>>2]|0)+6-(h[y>>2]|0)|0)%6|0;break}while(!1);return y=_,j=S,y|0}function Ap(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0,E=0,L=0,B=0;if(B=j,j=j+32|0,T=B+16|0,E=B,_=xh(d,f,T)|0,_|0)return A=_,j=B,A|0;S=ST(d,f)|0,L=Ns(d,f)|0,yB(S,E),_=xB(S,h[T>>2]|0)|0;e:do if(Mi(S)|0){do switch(S|0){case 4:{d=0;break}case 14:{d=1;break}case 24:{d=2;break}case 38:{d=3;break}case 49:{d=4;break}case 58:{d=5;break}case 63:{d=6;break}case 72:{d=7;break}case 83:{d=8;break}case 97:{d=9;break}case 107:{d=10;break}case 117:{d=11;break}default:{_=1;break e}}while(!1);if(y=h[26416+(d*24|0)+8>>2]|0,f=h[26416+(d*24|0)+16>>2]|0,d=h[T>>2]|0,(d|0)!=(h[E>>2]|0)&&(E=Bv(S)|0,d=h[T>>2]|0,E|(d|0)==(f|0)&&(_=(_+1|0)%6|0)),(L|0)==3&(d|0)==(f|0)){_=(_+5|0)%6|0,y=22;break}(L|0)==5&(d|0)==(y|0)&&(_=(_+1|0)%6|0),y=22}else y=22;while(!1);return(y|0)==22&&(h[A>>2]=_,_=0),A=_,j=B,A|0}function Eo(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0,He=0,De=0,Le=0;if(Le=j,j=j+32|0,De=Le+24|0,Te=Le+20|0,ae=Le+8|0,oe=Le+16|0,ce=Le,L=(ci(d,f)|0)==0,L=L?6:5,G=pt(d|0,f|0,52)|0,X()|0,G=G&15,L>>>0<=A>>>0)return _=2,j=Le,_|0;ee=(G|0)==0,!ee&&(ve=bt(7,0,(G^15)*3|0)|0,(ve&d|0)==0&((X()|0)&f|0)==0)?y=A:S=4;e:do if((S|0)==4){if(y=(ci(d,f)|0)!=0,((y?4:5)|0)<(A|0)||Ap(d,f,De)|0||(S=(h[De>>2]|0)+A|0,y?y=26704+(((S|0)%5|0)<<2)|0:y=26736+(((S|0)%6|0)<<2)|0,ve=h[y>>2]|0,(ve|0)==7))return _=1,j=Le,_|0;h[Te>>2]=0,y=jn(d,f,ve,Te,ae)|0;do if(!y){if(E=ae,B=h[E>>2]|0,E=h[E+4>>2]|0,T=E>>>0<f>>>0|(E|0)==(f|0)&B>>>0<d>>>0,S=T?B:d,T=T?E:f,!ee&&(ee=bt(7,0,(G^15)*3|0)|0,(B&ee|0)==0&(E&(X()|0)|0)==0))y=A;else{if(E=(A+-1+L|0)%(L|0)|0,y=ci(d,f)|0,(E|0)<0&&xt(27795,27797,246,27806),L=(y|0)!=0,((L?4:5)|0)<(E|0)&&xt(27795,27797,246,27806),Ap(d,f,De)|0&&xt(27795,27797,246,27806),y=(h[De>>2]|0)+E|0,L?y=26704+(((y|0)%5|0)<<2)|0:y=26736+(((y|0)%6|0)<<2)|0,E=h[y>>2]|0,(E|0)==7&&xt(27795,27797,246,27806),h[oe>>2]=0,y=jn(d,f,E,oe,ce)|0,y|0)break;B=ce,L=h[B>>2]|0,B=h[B+4>>2]|0;do if(B>>>0<T>>>0|(B|0)==(T|0)&L>>>0<S>>>0){if(ci(L,B)|0?S=mr(L,B,d,f)|0:S=h[26800+((((h[oe>>2]|0)+(h[26768+(E<<2)>>2]|0)|0)%6|0)<<2)>>2]|0,y=ci(L,B)|0,(S+-1|0)>>>0>5){y=-1,S=L,T=B;break}if(y=(y|0)!=0,(S|0)==1&y){y=-1,S=L,T=B;break}do if(Ap(L,B,De)|0)y=-1;else if(y){y=((h[26352+(S<<2)>>2]|0)+5-(h[De>>2]|0)|0)%5|0;break}else{y=((h[26384+(S<<2)>>2]|0)+6-(h[De>>2]|0)|0)%6|0;break}while(!1);S=L,T=B}else y=A;while(!1);E=ae,B=h[E>>2]|0,E=h[E+4>>2]|0}if((S|0)==(B|0)&(T|0)==(E|0)){if(L=(ci(B,E)|0)!=0,L?d=mr(B,E,d,f)|0:d=h[26800+((((h[Te>>2]|0)+(h[26768+(ve<<2)>>2]|0)|0)%6|0)<<2)>>2]|0,y=ci(B,E)|0,(d+-1|0)>>>0<=5&&(He=(y|0)!=0,!((d|0)==1&He)))do if(Ap(B,E,De)|0)y=-1;else if(He){y=((h[26352+(d<<2)>>2]|0)+5-(h[De>>2]|0)|0)%5|0;break}else{y=((h[26384+(d<<2)>>2]|0)+6-(h[De>>2]|0)|0)%6|0;break}while(!1);else y=-1;y=y+1|0,y=(y|0)==6|L&(y|0)==5?0:y}f=T,d=S;break e}while(!1);return _=y,j=Le,_|0}while(!1);return He=bt(y|0,0,56)|0,De=X()|0|f&-2130706433|536870912,h[_>>2]=He|d,h[_+4>>2]=De,_=0,j=Le,_|0}function VF(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0;return S=(ci(d,f)|0)==0,_=Eo(d,f,0,A)|0,y=(_|0)==0,S?!y||(_=Eo(d,f,1,A+8|0)|0,_|0)||(_=Eo(d,f,2,A+16|0)|0,_|0)||(_=Eo(d,f,3,A+24|0)|0,_|0)||(_=Eo(d,f,4,A+32|0)|0,_)?(S=_,S|0):Eo(d,f,5,A+40|0)|0:!y||(_=Eo(d,f,1,A+8|0)|0,_|0)||(_=Eo(d,f,2,A+16|0)|0,_|0)||(_=Eo(d,f,3,A+24|0)|0,_|0)||(_=Eo(d,f,4,A+32|0)|0,_|0)?(S=_,S|0):(S=A+40|0,h[S>>2]=0,h[S+4>>2]=0,S=0,S|0)}function GF(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0,E=0,L=0;return L=j,j=j+192|0,y=L,S=L+168|0,T=pt(d|0,f|0,56)|0,X()|0,T=T&7,E=f&-2130706433|134217728,_=xh(d,E,S)|0,_|0?(E=_,j=L,E|0):(f=pt(d|0,f|0,52)|0,X()|0,f=f&15,ci(d,E)|0?Gv(S,f,T,1,y):qv(S,f,T,1,y),E=y+8|0,h[A>>2]=h[E>>2],h[A+4>>2]=h[E+4>>2],h[A+8>>2]=h[E+8>>2],h[A+12>>2]=h[E+12>>2],E=0,j=L,E|0)}function qF(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0;return y=j,j=j+16|0,A=y,!(!0&(f&2013265920|0)==536870912)||(_=f&-2130706433|134217728,!(Hv(d,_)|0))?(_=0,j=y,_|0):(S=pt(d|0,f|0,56)|0,X()|0,S=(Eo(d,_,S&7,A)|0)==0,_=A,_=S&((h[_>>2]|0)==(d|0)?(h[_+4>>2]|0)==(f|0):0)&1,j=y,_|0)}function kT(d,f,A){d=d|0,f=f|0,A=A|0;var _=0;(f|0)>0?(_=Ro(f,4)|0,h[d>>2]=_,_||xt(27819,27842,40,27856)):h[d>>2]=0,h[d+4>>2]=f,h[d+8>>2]=0,h[d+12>>2]=A}function zT(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0;y=d+4|0,S=d+12|0,T=d+8|0;e:for(;;){for(A=h[y>>2]|0,f=0;;){if((f|0)>=(A|0))break e;if(_=h[d>>2]|0,E=h[_+(f<<2)>>2]|0,!E)f=f+1|0;else break}f=_+(~~(+Et(+(+bn(10,+ +(15-(h[S>>2]|0)|0))*(+V[E>>3]+ +V[E+8>>3])))%+(A|0))>>>0<<2)|0,A=h[f>>2]|0;
3839t:do if(A|0){if(_=E+32|0,(A|0)==(E|0))h[f>>2]=h[_>>2];else{if(A=A+32|0,f=h[A>>2]|0,!f)break;for(;(f|0)!=(E|0);)if(A=f+32|0,f=h[A>>2]|0,!f)break t;h[A>>2]=h[_>>2]}sn(E),h[T>>2]=(h[T>>2]|0)+-1}while(!1)}sn(h[d>>2]|0)}function VT(d){d=d|0;var f=0,A=0,_=0;for(_=h[d+4>>2]|0,A=0;;){if((A|0)>=(_|0)){f=0,A=4;break}if(f=h[(h[d>>2]|0)+(A<<2)>>2]|0,!f)A=A+1|0;else{A=4;break}}return(A|0)==4?f|0:0}function GT(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0;if(A=~~(+Et(+(+bn(10,+ +(15-(h[d+12>>2]|0)|0))*(+V[f>>3]+ +V[f+8>>3])))%+(h[d+4>>2]|0))>>>0,A=(h[d>>2]|0)+(A<<2)|0,_=h[A>>2]|0,!_)return S=1,S|0;S=f+32|0;do if((_|0)!=(f|0)){if(A=h[_+32>>2]|0,!A)return S=1,S|0;for(y=A;;){if((y|0)==(f|0)){y=8;break}if(A=h[y+32>>2]|0,A)_=y,y=A;else{A=1,y=10;break}}if((y|0)==8){h[_+32>>2]=h[S>>2];break}else if((y|0)==10)return A|0}else h[A>>2]=h[S>>2];while(!1);return sn(f),S=d+8|0,h[S>>2]=(h[S>>2]|0)+-1,S=0,S|0}function HF(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0;S=Ma(40)|0,S||xt(27872,27842,98,27885),h[S>>2]=h[f>>2],h[S+4>>2]=h[f+4>>2],h[S+8>>2]=h[f+8>>2],h[S+12>>2]=h[f+12>>2],y=S+16|0,h[y>>2]=h[A>>2],h[y+4>>2]=h[A+4>>
38392],h[y+8>>2]=h[A+8>>2],h[y+12>>2]=h[A+12>>2],h[S+32>>2]=0,y=~~(+Et(+(+bn(10,+ +(15-(h[d+12>>2]|0)|0))*(+V[f>>3]+ +V[f+8>>3])))%+(h[d+4>>2]|0))>>>0,y=(h[d>>2]|0)+(y<<2)|0,_=h[y>>2]|0;do if(!_)h[y>>2]=S;else{for(;!(Sh(_,f)|0&&Sh(_+16|0,A)|0);)if(y=h[_+32>>2]|0,_=(y|0)==0?_:y,!(h[_+32>>2]|0)){T=10;break}if((T|0)==10){h[_+32>>2]=S;break}return sn(S),T=_,T|0}while(!1);return T=d+8|0,h[T>>2]=(h[T>>2]|0)+1,T=S,T|0}function WF(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0;if(y=~~(+Et(+(+bn(10,+ +(15-(h[d+12>>2]|0)|0))*(+V[f>>3]+ +V[f+8>>3])))%+(h[d+4>>2]|0))>>>0,y=h[(h[d>>2]|0)+(y<<2)>>2]|0,!y)return A=0,A|0;if(!A){for(d=y;;){if(Sh(d,f)|0){_=10;break}if(d=h[d+32>>2]|0,!d){d=0,_=10;break}}if((_|0)==10)return d|0}for(d=y;;){if(Sh(d,f)|0&&Sh(d+16|0,A)|0){_=10;break}if(d=h[d+32>>2]|0,!d){d=0,_=10;break}}return(_|0)==10?d|0:0}function $F(d,f){d=d|0,f=f|0;var A=0;if(A=~~(+Et(+(+bn(10,+ +(15-(h[d+12>>2]|0)|0))*(+V[f>>3]+ +V[f+8>>3])))%+(h[d+4>>2]|0))>>>0,d=h[(h[d>>2]|0)+(A<<2)>>2]|0,!d)return A=0,A|0;for(;;){if(Sh(d,f)|0){f=5;break}if(d=h[d+32>>2]|0,!d){d=0,f=5;break}}return(f|0)==5?d|0:0}function jF(){return 27904}function Zl(d){return d=+d,~~+jT(+d)|0}function Ma(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0,ve=0,Te=0,He=0,De=0,Le=0,xe=0,yt=0;yt=j,j=j+16|0,ce=yt;do if(d>>>0<245){if(B=d>>>0<11?16:d+11&-8,d=B>>>3,ee=h[6977]|0,A=ee>>>d,A&3|0)return f=(A&1^1)+d|0,d=27948+(f<<1<<2)|0,A=d+8|0,_=h[A>>2]|0,y=_+8|0,S=h[y>>2]|0,(S|0)==(d|0)?h[6977]=ee&~(1<<f):(h[S+12>>2]=d,h[A>>2]=S),xe=f<<3,h[_+4>>2]=xe|3,xe=_+xe+4|0,h[xe>>2]=h[xe>>2]|1,xe=y,j=yt,xe|0;if(G=h[6979]|0,B>>>0>G>>>0){if(A|0)return f=2<<d,f=A<<d&(f|0-f),f=(f&0-f)+-1|0,E=f>>>12&16,f=f>>>E,A=f>>>5&8,f=f>>>A,S=f>>>2&4,f=f>>>S,d=f>>>1&2,f=f>>>d,_=f>>>1&1,_=(A|E|S|d|_)+(f>>>_)|0,f=27948+(_<<1<<2)|0,d=f+8|0,S=h[d>>2]|0,E=S+8|0,A=h[E>>2]|0,(A|0)==(f|0)?(d=ee&~(1<<_),h[6977]=d):(h[A+12>>2]=f,h[d>>2]=A,d=ee),xe=_<<3,T=xe-B|0,h[S+4>>2]=B|3,y=S+B|0,h[y+4>>2]=T|1,h[S+xe>>2]=T,G|0&&(_=h[6982]|0,f=G>>>3,A=27948+(f<<1<<2)|0,f=1<<f,d&f?(d=A+8|0,f=h[d>>2]|0):(h[6977]=d|f,f=A,d=A+8|0),h[d>>2]=_,h[f+12>>2]=_,h[_+8>>2]=f,h[_+12>>2]=A),h[6979]=T,h[6982]=y,xe=E,j=yt,xe|0;if(S=h[6978]|0,S){for(A=(S&0-S)+-1|0,y=A>>>12&16,A=A>>>y,_=A>>>5&8,A=A>>>_,T=A>>>2&4,A=A>>>T,E=A>>>1&2,A=A>>>E,L=A>>>1&1,L=h[28212+((_|y|T|E|L)+(A>>>L)<<2)>>2]|0,A=L,E=L,L=(h[L+4>>2]&-8)-B|0;d=h[A+16>>2]|0,!(!d&&(d=h[A+20>>2]|0,!d));)T=(h[d+4>>2]&-8)-B|0,y=T>>>0<L>>>0,A=d,E=y?d:E,L=y?T:L;if(T=E+B|0,T>>>0>E>>>0){y=h[E+24>>2]|0,f=h[E+12>>2]|0;do if((f|0)==(E|0)){if(d=E+20|0,f=h[d>>2]|0,!f&&(d=E+16|0,f=h[d>>2]|0,!f)){A=0;break}for(;;)if(_=f+20|0,A=h[_>>2]|0,A)f=A,d=_;else if(_=f+16|0,A=h[_>>2]|0,A)f=A,d=_;else break;h[d>>2]=0,A=f}else A=h[E+8>>2]|0,h[A+12>>2]=f,h[f+8>>2]=A,A=f;while(!1);do if(y|0){if(f=h[E+28>>2]|0,d=28212+(f<<2)|0,(E|0)==(h[d>>2]|0)){if(h[d>>2]=A,!A){h[6978]=S&~(1<<f);break}}else if(xe=y+16|0,h[((h[xe>>2]|0)==(E|0)?xe:y+20|0)>>2]=A,!A)break;h[A+24>>2]=y,f=h[E+16>>2]|0,f|0&&(h[A+16>>2]=f,h[f+24>>2]=A),f=h[E+20>>2]|0,f|0&&(h[A+20>>2]=f,h[f+24>>2]=A)}while(!1);return L>>>0<16?(xe=L+B|0,h[E+4>>2]=xe|3,xe=E+xe+4|0,h[xe>>2]=h[xe>>2]|1):(h[E+4>>2]=B|3,h[T+4>>2]=L|1,h[T+L>>2]=L,G|0&&(_=h[6982]|0,f=G>>>3,A=27948+(f<<1<<2)|0,f=1<<f,f&ee?(d=A+8|0,f=h[d>>2]|0):(h[6977]=f|ee,f=A,d=A+8|0),h[d>>2]=_,h[f+12>>2]=_,h[_+8>>2]=f,h[_+12>>2]=A),h[6979]=L,h[6982]=T),xe=E+8|0,j=yt,xe|0}else ee=B}else ee=B}else ee=B}else if(d>>>0<=4294967231)if(d=d+11|0,B=d&-8,_=h[6978]|0,_){y=0-B|0,d=d>>>8,d?B>>>0>16777215?L=31:(ee=(d+1048320|0)>>>16&8,ve=d<<ee,E=(ve+520192|0)>>>16&4,ve=ve<<E,L=(ve+245760|0)>>>16&2,L=14-(E|ee|L)+(ve<<L>>>15)|0,L=B>>>(L+7|0)&1|L<<1):L=0,A=h[28212+(L<<2)>>2]|0;e:do if(!A)A=0,d=0,ve=61;else for(d=0,E=B<<((L|0)==31?0:25-(L>>>1)|0),S=0;;){if(T=(h[A+4>>2]&-8)-B|0,T>>>0<y>>>0)if(T)d=A,y=T;else{d=A,y=0,ve=65;break e}if(ve=h[A+20>>2]|0,A=h[A+16+(E>>>31<<2)>>2]|0,S=(ve|0)==0|(ve|0)==(A|0)?S:ve,A)E=E<<1;else{A=S,ve=61;break}}while(!1);if((ve|0)==61){if((A|0)==0&(d|0)==0){if(d=2<<L,d=(d|0-d)&_,!d){ee=B;break}ee=(d&0-d)+-1|0,T=ee>>>12&16,ee=ee>>>T,S=ee>>>5&8,ee=ee>>>S,E=ee>>>2&4,ee=ee>>>E,L=ee>>>1&2,ee=ee>>>L,A=ee>>>1&1,d=0,A=h[28212+((S|T|E|L|A)+(ee>>>A)<<2)>>2]|0}A?ve=65:(E=d,T=y)}if((ve|0)==65)for(S=A;;)if(ee=(h[S+4>>2]&-8)-B|0,A=ee>>>0<y>>>0,y=A?ee:y,d=A?S:d,A=h[S+16>>2]|0,A||(A=h[S+20>>2]|0),A)S=A;else{E=d,T=y;break}if((E|0)!=0&&T>>>0<((h[6979]|0)-B|0)>>>0&&(G=E+B|0,G>>>0>E>>>0)){S=h[E+24>>2]|0,f=h[E+12>>2]|0;do if((f|0)==(E|0)){if(d=E+20|0,f=h[d>>2]|0,!f&&(d=E+16|0,f=h[d>>2]|0,!f)){f=0;break}for(;;)if(y=f+20|0,A=h[y>>2]|0,A)f=A,d=y;else if(y=f+16|0,A=h[y>>2]|0,A)f=A,d=y;else break;h[d>>2]=0}else xe=h[E+8>>2]|0,h[xe+12>>2]=f,h[f+8>>2]=xe;while(!1);do if(S){if(d=h[E+28>>2]|0,A=28212+(d<<2)|0,(E|0)==(h[A>>2]|0)){if(h[A>>2]=f,!f){_=_&~(1<<d),h[6978]=_;break}}else if(xe=S+16|0,h[((h[xe>>2]|0)==(E|0)?xe:S+20|0)>>2]=f,!f)break;h[f+24>>2]=S,d=h[E+16>>2]|0,d|0&&(h[f+16>>2]=d,h[d+24>>2]=f),d=h[E+20>>2]|0,d&&(h[f+20>>2]=d,h[d+24>>2]=f)}while(!1);e:do if(T>>>0<16)xe=T+B|0,h[E+4>>2]=xe|3,xe=E+xe+4|0,h[xe>>2]=h[xe>>2]|1;else{if(h[E+4>>2]=B|3,h[G+4>>2]=T|1,h[G+T>>2]=T,f=T>>>3,T>>>0<256){A=27948+(f<<1<<2)|0,d=h[6977]|0,f=1<<f,d&f?(d=A+8|0,f=h[d>>2]|0):(h[6977]=d|f,f=A,d=A+8|0),h[d>>2]=G,h[f+12>>2]=G,h[G+8>>2]=f,h[G+12>>2]=A;break}if(f=T>>>8,f?T>>>0>16777215?A=31:(Le=(f+1048320|0)>>>16&8,xe=f<<Le,De=(xe+520192|0)>>>16&4,xe=xe<<De,A=(xe+245760|0)>>>16&2,A=14-(De|Le|A)+(xe<<A>>>15)|0,A=T>>>(A+7|0)&1|A<<1):A=0,f=28212+(A<<2)|0,h[G+28>>2]=A,d=G+16|0,h[d+4>>2]=0,h[d>>2]=0,d=1<<A,!(_&d)){h[6978]=_|d,h[f>>2]=G,h[G+24>>2]=f,h[G+12>>2]=G,h[G+8>>2]=G;break}f=h[f>>2]|0;
3839t:do if((h[f+4>>2]&-8|0)!=(T|0)){for(_=T<<((A|0)==31?0:25-(A>>>1)|0);A=f+16+(_>>>31<<2)|0,d=h[A>>2]|0,!!d;)if((h[d+4>>2]&-8|0)==(T|0)){f=d;break t}else _=_<<1,f=d;h[A>>2]=G,h[G+24>>2]=f,h[G+12>>2]=G,h[G+8>>2]=G;break e}while(!1);Le=f+8|0,xe=h[Le>>2]|0,h[xe+12>>2]=G,h[Le>>2]=G,h[G+8>>2]=xe,h[G+12>>2]=f,h[G+24>>2]=0}while(!1);return xe=E+8|0,j=yt,xe|0}else ee=B}else ee=B;else ee=-1;while(!1);if(A=h[6979]|0,A>>>0>=ee>>>0)return f=A-ee|0,d=h[6982]|0,f>>>0>15?(xe=d+ee|0,h[6982]=xe,h[6979]=f,h[xe+4>>2]=f|1,h[d+A>>2]=f,h[d+4>>2]=ee|3):(h[6979]=0,h[6982]=0,h[d+4>>2]=A|3,xe=d+A+4|0,h[xe>>2]=h[xe>>2]|1),xe=d+8|0,j=yt,xe|0;if(T=h[6980]|0,T>>>0>ee>>>0)return De=T-ee|0,h[6980]=De,xe=h[6983]|0,Le=xe+ee|0,h[6983]=Le,h[Le+4>>2]=De|1,h[xe+4>>2]=ee|3,xe=xe+8|0,j=yt,xe|0;if(h[7095]|0?d=h[7097]|0:(h[7097]=4096,h[7096]=4096,h[7098]=-1,h[7099]=-1,h[7100]=0,h[7088]=0,h[7095]=ce&-16^1431655768,d=4096),E=ee+48|0,L=ee+47|0,S=d+L|0,y=0-d|0,B=S&y,B>>>0<=ee>>>0||(d=h[7087]|0,d|0&&(G=h[7085]|0,ce=G+B|0,ce>>>0<=G>>>0|ce>>>0>d>>>0)))return xe=0,j=yt,xe|0;e:do if(h[7088]&4)f=0,ve=143;else{A=h[6983]|0;t:do if(A){for(_=28356;ce=h[_>>2]|0,!(ce>>>0<=A>>>0&&(ce+(h[_+4>>2]|0)|0)>>>0>A>>>0);)if(d=h[_+8>>2]|0,d)_=d;else{ve=128;break t}if(f=S-T&y,f>>>0<2147483647)if(d=Jl(f|0)|0,(d|0)==((h[_>>2]|0)+(h[_+4>>2]|0)|0)){if((d|0)!=-1){T=f,S=d,ve=145;break e}}else _=d,ve=136;else f=0}else ve=128;while(!1);do if((ve|0)==128)if(A=Jl(0)|0,(A|0)!=-1&&(f=A,oe=h[7096]|0,ae=oe+-1|0,f=((ae&f|0)==0?0:(ae+f&0-oe)-f|0)+B|0,oe=h[7085]|0,ae=f+oe|0,f>>>0>ee>>>0&f>>>0<2147483647)){if(ce=h[7087]|0,ce|0&&ae>>>0<=oe>>>0|ae>>>0>ce>>>0){f=0;break}if(d=Jl(f|0)|0,(d|0)==(A|0)){T=f,S=A,ve=145;break e}else _=d,ve=136}else f=0;while(!1);do if((ve|0)==136){if(A=0-f|0,!(E>>>0>f>>>0&(f>>>0<2147483647&(_|0)!=-1)))if((_|0)==-1){f=0;break}else{T=f,S=_,ve=145;break e}if(d=h[7097]|0,d=L-f+d&0-d,d>>>0>=2147483647){T=f,S=_,ve=145;break e}if((Jl(d|0)|0)==-1){Jl(A|0)|0,f=0;break}else{T=d+f|0,S=_,ve=145;break e}}while(!1);h[7088]=h[7088]|4,ve=143}while(!1);if((ve|0)==143&&B>>>0<2147483647&&(De=Jl(B|0)|0,ae=Jl(0)|0,Te=ae-De|0,He=Te>>>0>(ee+40|0)>>>0,!((De|0)==-1|He^1|De>>>0<ae>>>0&((De|0)!=-1&(ae|0)!=-1)^1))&&(T=He?Te:f,S=De,ve=145),(ve|0)==145){f=(h[7085]|0)+T|0,h[7085]=f,f>>>0>(h[7086]|0)>>>0&&(h[7086]=f),L=h[6983]|0;e:do if(L){for(f=28356;;){if(d=h[f>>2]|0,A=h[f+4>>2]|0,(S|0)==(d+A|0)){ve=154;break}if(_=h[f+8>>2]|0,_)f=_;else break}if((ve|0)==154&&(Le=f+4|0,(h[f+12>>2]&8|0)==0)&&S>>>0>L>>>0&d>>>0<=L>>>0){h[Le>>2]=A+T,xe=(h[6980]|0)+T|0,De=L+8|0,De=(De&7|0)==0?0:0-De&7,Le=L+De|0,De=xe-De|0,h[6983]=Le,h[6980]=De,h[Le+4>>2]=De|1,h[L+xe+4>>2]=40,h[6984]=h[7099];break}for(S>>>0<(h[6981]|0)>>>0&&(h[6981]=S),A=S+T|0,f=28356;;){if((h[f>>2]|0)==(A|0)){ve=162;break}if(d=h[f+8>>2]|0,d)f=d;else break}if((ve|0)==162&&(h[f+12>>2]&8|0)==0){h[f>>2]=S,G=f+4|0,h[G>>2]=(h[G>>2]|0)+T,G=S+8|0,G=S+((G&7|0)==0?0:0-G&7)|0,f=A+8|0,f=A+((f&7|0)==0?0:0-f&7)|0,B=G+ee|0,E=f-G-ee|0,h[G+4>>2]=ee|3;t:do if((L|0)==(f|0))xe=(h[6980]|0)+E|0,h[6980]=xe,h[6983]=B,h[B+4>>2]=xe|1;else{if((h[6982]|0)==(f|0)){xe=(h[6979]|0)+E|0,h[6979]=xe,h[6982]=B,h[B+4>>2]=xe|1,h[B+xe>>2]=xe;break}if(d=h[f+4>>2]|0,(d&3|0)==1){T=d&-8,_=d>>>3;n:do if(d>>>0<256)if(d=h[f+8>>2]|0,A=h[f+12>>2]|0,(A|0)==(d|0)){h[6977]=h[6977]&~(1<<_);break}else{h[d+12>>2]=A,h[A+8>>2]=d;break}else{S=h[f+24>>2]|0,d=h[f+12>>2]|0;do if((d|0)==(f|0)){if(A=f+16|0,_=A+4|0,d=h[_>>2]|0,d)A=_;else if(d=h[A>>2]|0,!d){d=0;break}for(;;)if(y=d+20|0,_=h[y>>2]|0,_)d=_,A=y;else if(y=d+16|0,_=h[y>>2]|0,_)d=_,A=y;else break;h[A>>2]=0}else xe=h[f+8>>2]|0,h[xe+12>>2]=d,h[d+8>>2]=xe;while(!1);if(!S)break;A=h[f+28>>2]|0,_=28212+(A<<2)|0;do if((h[_>>2]|0)!=(f|0)){if(xe=S+16|0,h[((h[xe>>2]|0)==(f|0)?xe:S+20|0)>>2]=d,!d)break n}else{if(h[_>>2]=d,d|0)break;h[6978]=h[6978]&~(1<<A);break n}while(!1);if(h[d+24>>2]=S,A=f+16|0,_=h[A>>2]|0,_|0&&(h[d+16>>2]=_,h[_+24>>2]=d),A=h[A+4>>2]|0,!A)break;h[d+20>>2]=A,h[A+24>>2]=d}while(!1);f=f+T|0,y=T+E|0}else y=E;if(f=f+4|0,h[f>>2]=h[f>>2]&-2,h[B+4>>2]=y|1,h[B+y>>2]=y,f=y>>>3,y>>>0<256){A=27948+(f<<1<<2)|0,d=h[6977]|0,f=1<<f,d&f?(d=A+8|0,f=h[d>>2]|0):(h[6977]=d|f,f=A,d=A+8|0),h[d>>2]=B,h[f+12>>2]=B,h[B+8>>2]=f,h[B+12>>2]=A;break}f=y>>>8;do if(!f)_=0;else{if(y>>>0>16777215){_=31;break}Le=(f+1048320|0)>>>16&8,xe=f<<Le,De=(xe+520192|0)>>>16&4,xe=xe<<De,_=(xe+245760|0)>>>16&2,_=14-(De|Le|_)+(xe<<_>>>15)|0,_=y>>>(_+7|0)&1|_<<1}while(!1);if(f=28212+(_<<2)|0,h[B+28>>2]=_,d=B+16|0,h[d+4>>2]=0,h[d>>2]=0,d=h[6978]|0,A=1<<_,!(d&A)){h[6978]=d|A,h[f>>2]=B,h[B+24>>2]=f,h[B+12>>2]=B,h[B+8>>2]=B;break}f=h[f>>2]|0;n:do if((h[f+4>>
38392]&-8|0)!=(y|0)){for(_=y<<((_|0)==31?0:25-(_>>>1)|0);A=f+16+(_>>>31<<2)|0,d=h[A>>2]|0,!!d;)if((h[d+4>>2]&-8|0)==(y|0)){f=d;break n}else _=_<<1,f=d;h[A>>2]=B,h[B+24>>2]=f,h[B+12>>2]=B,h[B+8>>2]=B;break t}while(!1);Le=f+8|0,xe=h[Le>>2]|0,h[xe+12>>2]=B,h[Le>>2]=B,h[B+8>>2]=xe,h[B+12>>2]=f,h[B+24>>2]=0}while(!1);return xe=G+8|0,j=yt,xe|0}for(f=28356;d=h[f>>2]|0,!(d>>>0<=L>>>0&&(xe=d+(h[f+4>>2]|0)|0,xe>>>0>L>>>0));)f=h[f+8>>2]|0;y=xe+-47|0,d=y+8|0,d=y+((d&7|0)==0?0:0-d&7)|0,y=L+16|0,d=d>>>0<y>>>0?L:d,f=d+8|0,A=T+-40|0,De=S+8|0,De=(De&7|0)==0?0:0-De&7,Le=S+De|0,De=A-De|0,h[6983]=Le,h[6980]=De,h[Le+4>>2]=De|1,h[S+A+4>>2]=40,h[6984]=h[7099],A=d+4|0,h[A>>2]=27,h[f>>2]=h[7089],h[f+4>>2]=h[7090],h[f+8>>2]=h[7091],h[f+12>>2]=h[7092],h[7089]=S,h[7090]=T,h[7092]=0,h[7091]=f,f=d+24|0;do Le=f,f=f+4|0,h[f>>2]=7;while((Le+8|0)>>>0<xe>>>0);if((d|0)!=(L|0)){if(S=d-L|0,h[A>>2]=h[A>>2]&-2,h[L+4>>2]=S|1,h[d>>2]=S,f=S>>>3,S>>>0<256){A=27948+(f<<1<<2)|0,d=h[6977]|0,f=1<<f,d&f?(d=A+8|0,f=h[d>>2]|0):(h[6977]=d|f,f=A,d=A+8|0),h[d>>2]=L,h[f+12>>2]=L,h[L+8>>2]=f,h[L+12>>2]=A;break}if(f=S>>>8,f?S>>>0>16777215?_=31:(Le=(f+1048320|0)>>>16&8,xe=f<<Le,De=(xe+520192|0)>>>16&4,xe=xe<<De,_=(xe+245760|0)>>>16&2,_=14-(De|Le|_)+(xe<<_>>>15)|0,_=S>>>(_+7|0)&1|_<<1):_=0,A=28212+(_<<2)|0,h[L+28>>2]=_,h[L+20>>2]=0,h[y>>2]=0,f=h[6978]|0,d=1<<_,!(f&d)){h[6978]=f|d,h[A>>2]=L,h[L+24>>2]=A,h[L+12>>2]=L,h[L+8>>2]=L;break}f=h[A>>2]|0;t:do if((h[f+4>>2]&-8|0)!=(S|0)){for(_=S<<((_|0)==31?0:25-(_>>>1)|0);A=f+16+(_>>>31<<2)|0,d=h[A>>2]|0,!!d;)if((h[d+4>>2]&-8|0)==(S|0)){f=d;break t}else _=_<<1,f=d;h[A>>2]=L,h[L+24>>2]=f,h[L+12>>2]=L,h[L+8>>2]=L;break e}while(!1);Le=f+8|0,xe=h[Le>>2]|0,h[xe+12>>2]=L,h[Le>>2]=L,h[L+8>>2]=xe,h[L+12>>2]=f,h[L+24>>2]=0}}else xe=h[6981]|0,(xe|0)==0|S>>>0<xe>>>0&&(h[6981]=S),h[7089]=S,h[7090]=T,h[7092]=0,h[6986]=h[7095],h[6985]=-1,h[6990]=27948,h[6989]=27948,h[6992]=27956,h[6991]=27956,h[6994]=27964,h[6993]=27964,h[6996]=27972,h[6995]=27972,h[6998]=27980,h[6997]=27980,h[7e3]=27988,h[6999]=27988,h[7002]=27996,h[7001]=27996,h[7004]=28004,h[7003]=28004,h[7006]=28012,h[7005]=28012,h[7008]=28020,h[7007]=28020,h[7010]=28028,h[7009]=28028,h[7012]=28036,h[7011]=28036,h[7014]=28044,h[7013]=28044,h[7016]=28052,h[7015]=28052,h[7018]=28060,h[7017]=28060,h[7020]=28068,h[7019]=28068,h[7022]=28076,h[7021]=28076,h[7024]=28084,h[7023]=28084,h[7026]=28092,h[7025]=28092,h[7028]=28100,h[7027]=28100,h[7030]=28108,h[7029]=28108,h[7032]=28116,h[7031]=28116,h[7034]=28124,h[7033]=28124,h[7036]=28132,h[7035]=28132,h[7038]=28140,h[7037]=28140,h[7040]=28148,h[7039]=28148,h[7042]=28156,h[7041]=28156,h[7044]=28164,h[7043]=28164,h[7046]=28172,h[7045]=28172,h[7048]=28180,h[7047]=28180,h[7050]=28188,h[7049]=28188,h[7052]=28196,h[7051]=28196,xe=T+-40|0,De=S+8|0,De=(De&7|0)==0?0:0-De&7,Le=S+De|0,De=xe-De|0,h[6983]=Le,h[6980]=De,h[Le+4>>2]=De|1,h[S+xe+4>>2]=40,h[6984]=h[7099];while(!1);if(f=h[6980]|0,f>>>0>ee>>>0)return De=f-ee|0,h[6980]=De,xe=h[6983]|0,Le=xe+ee|0,h[6983]=Le,h[Le+4>>2]=De|1,h[xe+4>>2]=ee|3,xe=xe+8|0,j=yt,xe|0}return xe=jF()|0,h[xe>>2]=12,xe=0,j=yt,xe|0}function sn(d){d=d|0;var f=0,A=0,_=0,y=0,S=0,T=0,E=0,L=0;if(d){A=d+-8|0,y=h[6981]|0,d=h[d+-4>>2]|0,f=d&-8,L=A+f|0;do if(d&1)E=A,T=A;else{if(_=h[A>>2]|0,!(d&3)||(T=A+(0-_)|0,S=_+f|0,T>>>0<y>>>0))return;if((h[6982]|0)==(T|0)){if(d=L+4|0,f=h[d>>2]|0,(f&3|0)!=3){E=T,f=S;break}h[6979]=S,h[d>>2]=f&-2,h[T+4>>2]=S|1,h[T+S>>2]=S;return}if(A=_>>>3,_>>>0<256)if(d=h[T+8>>2]|0,f=h[T+12>>2]|0,(f|0)==(d|0)){h[6977]=h[6977]&~(1<<A),E=T,f=S;break}else{h[d+12>>2]=f,h[f+8>>2]=d,E=T,f=S;break}y=h[T+24>>2]|0,d=h[T+12>>2]|0;do if((d|0)==(T|0)){if(f=T+16|0,A=f+4|0,d=h[A>>2]|0,d)f=A;else if(d=h[f>>2]|0,!d){d=0;break}for(;;)if(_=d+20|0,A=h[_>>2]|0,A)d=A,f=_;else if(_=d+16|0,A=h[_>>2]|0,A)d=A,f=_;else break;h[f>>2]=0}else E=h[T+8>>2]|0,h[E+12>>2]=d,h[d+8>>2]=E;while(!1);if(y){if(f=h[T+28>>2]|0,A=28212+(f<<2)|0,(h[A>>2]|0)==(T|0)){if(h[A>>2]=d,!d){h[6978]=h[6978]&~(1<<f),E=T,f=S;break}}else if(E=y+16|0,h[((h[E>>2]|0)==(T|0)?E:y+20|0)>>2]=d,!d){E=T,f=S;break}h[d+24>>2]=y,f=T+16|0,A=h[f>>2]|0,A|0&&(h[d+16>>2]=A,h[A+24>>2]=d),f=h[f+4>>2]|0,f?(h[d+20>>2]=f,h[f+24>>2]=d,E=T,f=S):(E=T,f=S)}else E=T,f=S}while(!1);if(!(T>>>0>=L>>>0)&&(d=L+4|0,_=h[d>>2]|0,!!(_&1))){if(_&2)h[d>>2]=_&-2,h[E+4>>2]=f|1,h[T+f>>2]=f,y=f;
vendor: 16,384 bytes, line 3839
3839else{if((h[6983]|0)==(L|0)){if(L=(h[6980]|0)+f|0,h[6980]=L,h[6983]=E,h[E+4>>2]=L|1,(E|0)!=(h[6982]|0))return;h[6982]=0,h[6979]=0;return}if((h[6982]|0)==(L|0)){L=(h[6979]|0)+f|0,h[6979]=L,h[6982]=T,h[E+4>>2]=L|1,h[T+L>>2]=L;return}y=(_&-8)+f|0,A=_>>>3;do if(_>>>0<256)if(f=h[L+8>>2]|0,d=h[L+12>>2]|0,(d|0)==(f|0)){h[6977]=h[6977]&~(1<<A);break}else{h[f+12>>2]=d,h[d+8>>2]=f;break}else{S=h[L+24>>2]|0,d=h[L+12>>2]|0;do if((d|0)==(L|0)){if(f=L+16|0,A=f+4|0,d=h[A>>2]|0,d)f=A;else if(d=h[f>>2]|0,!d){A=0;break}for(;;)if(_=d+20|0,A=h[_>>2]|0,A)d=A,f=_;else if(_=d+16|0,A=h[_>>2]|0,A)d=A,f=_;else break;h[f>>2]=0,A=d}else A=h[L+8>>2]|0,h[A+12>>2]=d,h[d+8>>2]=A,A=d;while(!1);if(S|0){if(d=h[L+28>>2]|0,f=28212+(d<<2)|0,(h[f>>2]|0)==(L|0)){if(h[f>>2]=A,!A){h[6978]=h[6978]&~(1<<d);break}}else if(_=S+16|0,h[((h[_>>2]|0)==(L|0)?_:S+20|0)>>2]=A,!A)break;h[A+24>>2]=S,d=L+16|0,f=h[d>>2]|0,f|0&&(h[A+16>>2]=f,h[f+24>>2]=A),d=h[d+4>>2]|0,d|0&&(h[A+20>>2]=d,h[d+24>>2]=A)}}while(!1);if(h[E+4>>2]=y|1,h[T+y>>2]=y,(E|0)==(h[6982]|0)){h[6979]=y;return}}if(d=y>>>3,y>>>0<256){A=27948+(d<<1<<2)|0,f=h[6977]|0,d=1<<d,f&d?(f=A+8|0,d=h[f>>2]|0):(h[6977]=f|d,d=A,f=A+8|0),h[f>>2]=E,h[d+12>>2]=E,h[E+8>>2]=d,h[E+12>>2]=A;return}d=y>>>8,d?y>>>0>16777215?_=31:(T=(d+1048320|0)>>>16&8,L=d<<T,S=(L+520192|0)>>>16&4,L=L<<S,_=(L+245760|0)>>>16&2,_=14-(S|T|_)+(L<<_>>>15)|0,_=y>>>(_+7|0)&1|_<<1):_=0,d=28212+(_<<2)|0,h[E+28>>2]=_,h[E+20>>2]=0,h[E+16>>2]=0,f=h[6978]|0,A=1<<_;e:do if(!(f&A))h[6978]=f|A,h[d>>2]=E,h[E+24>>2]=d,h[E+12>>2]=E,h[E+8>>2]=E;else{d=h[d>>2]|0;t:do if((h[d+4>>2]&-8|0)!=(y|0)){for(_=y<<((_|0)==31?0:25-(_>>>1)|0);A=d+16+(_>>>31<<2)|0,f=h[A>>2]|0,!!f;)if((h[f+4>>2]&-8|0)==(y|0)){d=f;break t}else _=_<<1,d=f;h[A>>2]=E,h[E+24>>2]=d,h[E+12>>2]=E,h[E+8>>2]=E;break e}while(!1);T=d+8|0,L=h[T>>2]|0,h[L+12>>2]=E,h[T>>2]=E,h[E+8>>2]=L,h[E+12>>2]=d,h[E+24>>2]=0}while(!1);if(L=(h[6985]|0)+-1|0,h[6985]=L,!(L|0)){for(d=28364;d=h[d>>2]|0,d;)d=d+8|0;h[6985]=-1}}}}function Ro(d,f){d=d|0,f=f|0;var A=0;return d?(A=ke(f,d)|0,(f|d)>>>0>65535&&(A=((A>>>0)/(d>>>0)|0|0)==(f|0)?A:-1)):A=0,d=Ma(A)|0,!d||!(h[d+-4>>2]&3)||au(d|0,0,A|0)|0,d|0}function Kt(d,f,A,_){return d=d|0,f=f|0,A=A|0,_=_|0,A=d+A>>>0,lt(f+_+(A>>>0<d>>>0|0)>>>0|0),A|0|0}function zr(d,f,A,_){return d=d|0,f=f|0,A=A|0,_=_|0,_=f-_-(A>>>0>d>>>0|0)>>>0,lt(_|0),d-A>>>0|0|0}function qT(d){return d=d|0,(d?31-(mt(d^d-1)|0)|0:32)|0}function sy(d,f,A,_,y){d=d|0,f=f|0,A=A|0,_=_|0,y=y|0;var S=0,T=0,E=0,L=0,B=0,G=0,ee=0,ce=0,oe=0,ae=0;if(G=d,L=f,B=L,T=A,ce=_,E=ce,!B)return S=(y|0)!=0,E?S?(h[y>>2]=d|0,h[y+4>>2]=f&0,ce=0,y=0,lt(ce|0),y|0):(ce=0,y=0,lt(ce|0),y|0):(S&&(h[y>>2]=(G>>>0)%(T>>>0),h[y+4>>2]=0),ce=0,y=(G>>>0)/(T>>>0)>>>0,lt(ce|0),y|0);S=(E|0)==0;do if(T){if(!S){if(S=(mt(E|0)|0)-(mt(B|0)|0)|0,S>>>0<=31){ee=S+1|0,E=31-S|0,f=S-31>>31,T=ee,d=G>>>(ee>>>0)&f|B<<E,f=B>>>(ee>>>0)&f,S=0,E=G<<E;break}return y?(h[y>>2]=d|0,h[y+4>>2]=L|f&0,ce=0,y=0,lt(ce|0),y|0):(ce=0,y=0,lt(ce|0),y|0)}if(S=T-1|0,S&T|0){E=(mt(T|0)|0)+33-(mt(B|0)|0)|0,ae=64-E|0,ee=32-E|0,L=ee>>31,oe=E-32|0,f=oe>>31,T=E,d=ee-1>>31&B>>>(oe>>>0)|(B<<ee|G>>>(E>>>0))&f,f=f&B>>>(E>>>0),S=G<<ae&L,E=(B<<ae|G>>>(oe>>>0))&L|G<<ee&E-33>>31;break}return y|0&&(h[y>>2]=S&G,h[y+4>>2]=0),(T|0)==1?(oe=L|f&0,ae=d|0|0,lt(oe|0),ae|0):(ae=qT(T|0)|0,oe=B>>>(ae>>>0)|0,ae=B<<32-ae|G>>>(ae>>>0)|0,lt(oe|0),ae|0)}else{if(S)return y|0&&(h[y>>2]=(B>>>0)%(T>>>0),h[y+4>>2]=0),oe=0,ae=(B>>>0)/(T>>>0)>>>0,lt(oe|0),ae|0;if(!G)return y|0&&(h[y>>2]=0,h[y+4>>2]=(B>>>0)%(E>>>0)),oe=0,ae=(B>>>0)/(E>>>0)>>>0,lt(oe|0),ae|0;if(S=E-1|0,!(S&E))return y|0&&(h[y>>2]=d|0,h[y+4>>2]=S&B|f&0),oe=0,ae=B>>>((qT(E|0)|0)>>>0),lt(oe|0),ae|0;if(S=(mt(E|0)|0)-(mt(B|0)|0)|0,S>>>0<=30){f=S+1|0,E=31-S|0,T=f,d=B<<E|G>>>(f>>>0),f=B>>>(f>>>0),S=0,E=G<<E;break}return y?(h[y>>2]=d|0,h[y+4>>2]=L|f&0,oe=0,ae=0,lt(oe|0),ae|0):(oe=0,ae=0,lt(oe|0),ae|0)}while(!1);if(!T)B=E,L=0,E=0;else{ee=A|0|0,G=ce|_&0,B=Kt(ee|0,G|0,-1,-1)|0,A=X()|0,L=E,E=0;do _=L,L=S>>>31|L<<1,S=E|S<<1,_=d<<1|_>>>31|0,ce=d>>>31|f<<1|0,zr(B|0,A|0,_|0,ce|0)|0,ae=X()|0,oe=ae>>31|((ae|0)<0?-1:0)<<1,E=oe&1,d=zr(_|0,ce|0,oe&ee|0,(((ae|0)<0?-1:0)>>31|((ae|0)<0?-1:0)<<1)&G|0)|0,f=X()|0,T=T-1|0;while((T|0)!=0);B=L,L=0}return T=0,y|0&&(h[y>>2]=d,h[y+4>>2]=f),oe=(S|0)>>>31|(B|T)<<1|(T<<1|S>>>31)&0|L,ae=(S<<1|0)&-2|E,lt(oe|0),ae|0}function Kl(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0,B=0;return B=f>>31|((f|0)<0?-1:0)<<1,L=((f|0)<0?-1:0)>>31|((f|0)<0?-1:0)<<1,S=_>>31|((_|0)<0?-1:0)<<1,y=((_|0)<0?-1:0)>>31|((_|0)<0?-1:0)<<1,E=zr(B^d|0,L^f|0,B|0,L|0)|0,T=X()|0,d=S^B,f=y^L,zr((sy(E,T,zr(S^A|0,y^_|0,S|0,y|0)|0,X()|0,0)|0)^d|0,(X()|0)^f|0,d|0,f|0)|0}function XF(d,f){d=d|0,f=f|0;var A=0,_=0,y=0,S=0;return S=d&65535,y=f&65535,A=ke(y,S)|0,_=d>>>16,d=(A>>>16)+(ke(y,_)|0)|0,y=f>>>16,f=ke(y,S)|0,lt((d>>>16)+(ke(y,_)|0)+(((d&65535)+f|0)>>>16)|0),d+f<<16|A&65535|0|0}function es(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0;return y=d,S=A,A=XF(y,S)|0,d=X()|0,lt((ke(f,S)|0)+(ke(_,y)|0)+d|d&0|0),A|0|0|0}function Mh(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0,T=0,E=0,L=0,B=0;return y=j,j=j+16|0,E=y|0,T=f>>31|((f|0)<0?-1:0)<<1,S=((f|0)<0?-1:0)>>31|((f|0)<0?-1:0)<<1,B=_>>31|((_|0)<0?-1:0)<<1,L=((_|0)<0?-1:0)>>31|((_|0)<0?-1:0)<<1,d=zr(T^d|0,S^f|0,T|0,S|0)|0,f=X()|0,sy(d,f,zr(B^A|0,L^_|0,B|0,L|0)|0,X()|0,E)|0,_=zr(h[E>>2]^T|0,h[E+4>>2]^S|0,T|0,S|0)|0,A=X()|0,j=y,lt(A|0),_|0}function wh(d,f,A,_){d=d|0,f=f|0,A=A|0,_=_|0;var y=0,S=0;return S=j,j=j+16|0,y=S|0,sy(d,f,A,_,y)|0,j=S,lt(h[y+4>>2]|0),h[y>>2]|0|0}function HT(d,f,A){return d=d|0,f=f|0,A=A|0,(A|0)<32?(lt(f>>A|0),d>>>A|(f&(1<<A)-1)<<32-A):(lt(((f|0)<0?-1:0)|0),f>>A-32|0)}function pt(d,f,A){return d=d|0,f=f|0,A=A|0,(A|0)<32?(lt(f>>>A|0),d>>>A|(f&(1<<A)-1)<<32-A):(lt(0),f>>>A-32|0)}function bt(d,f,A){return d=d|0,f=f|0,A=A|0,(A|0)<32?(lt(f<<A|(d&(1<<A)-1<<32-A)>>>32-A|0),d<<A):(lt(d<<A-32|0),0)}function WT(d,f,A){return d=d|0,f=f|0,f=mt(f)|0,(f|0)==32&&(f=f+(mt(d)|0)|0),lt(0),f|0}function $T(d,f){return d=+d,f=+f,d!=d?+f:f!=f?+d:+gt(+d,+f)}function hm(d,f){return d=+d,f=+f,d!=d?+f:f!=f?+d:+Re(+d,+f)}function dm(d){return d=+d,d>=0?+Ot(d+.5):+ze(d-.5)}function Th(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0;if((A|0)>=8192)return zn(d|0,f|0,A|0)|0,d|0;if(S=d|0,y=d+A|0,(d&3)==(f&3)){for(;d&3;){if(!A)return S|0;fe[d>>0]=fe[f>>0]|0,d=d+1|0,f=f+1|0,A=A-1|0}for(A=y&-4|0,_=A-64|0;(d|0)<=(_|0);)h[d>>2]=h[f>>2],h[d+4>>2]=h[f+4>>2],h[d+8>>2]=h[f+8>>2],h[d+12>>2]=h[f+12>>2],h[d+16>>2]=h[f+16>>2],h[d+20>>2]=h[f+20>>2],h[d+24>>2]=h[f+24>>2],h[d+28>>2]=h[f+28>>2],h[d+32>>2]=h[f+32>>2],h[d+36>>2]=h[f+36>>2],h[d+40>>2]=h[f+40>>2],h[d+44>>2]=h[f+44>>2],h[d+48>>2]=h[f+48>>2],h[d+52>>2]=h[f+52>>2],h[d+56>>2]=h[f+56>>2],h[d+60>>2]=h[f+60>>2],d=d+64|0,f=f+64|0;for(;(d|0)<(A|0);)h[d>>2]=h[f>>2],d=d+4|0,f=f+4|0}else for(A=y-4|0;(d|0)<(A|0);)fe[d>>0]=fe[f>>0]|0,fe[d+1>>0]=fe[f+1>>0]|0,fe[d+2>>0]=fe[f+2>>0]|0,fe[d+3>>0]=fe[f+3>>0]|0,d=d+4|0,f=f+4|0;for(;(d|0)<(y|0);)fe[d>>0]=fe[f>>0]|0,d=d+1|0,f=f+1|0;return S|0}function au(d,f,A){d=d|0,f=f|0,A=A|0;var _=0,y=0,S=0,T=0;if(S=d+A|0,f=f&255,(A|0)>=67){for(;d&3;)fe[d>>0]=f,d=d+1|0;for(_=S&-4|0,T=f|f<<8|f<<16|f<<24,y=_-64|0;(d|0)<=(y|0);)h[d>>2]=T,h[d+4>>2]=T,h[d+8>>2]=T,h[d+12>>2]=T,h[d+16>>2]=T,h[d+20>>2]=T,h[d+24>>2]=T,h[d+28>>2]=T,h[d+32>>2]=T,h[d+36>>2]=T,h[d+40>>2]=T,h[d+44>>2]=T,h[d+48>>2]=T,h[d+52>>2]=T,h[d+56>>2]=T,h[d+60>>2]=T,d=d+64|0;for(;(d|0)<(_|0);)h[d>>2]=T,d=d+4|0}for(;(d|0)<(S|0);)fe[d>>0]=f,d=d+1|0;return S-A|0}function jT(d){return d=+d,d>=0?+Ot(d+.5):+ze(d-.5)}function Jl(d){d=d|0;var f=0,A=0,_=0;return _=nn()|0,A=h[It>>2]|0,f=A+d|0,(d|0)>0&(f|0)<(A|0)|(f|0)<0?(qi(f|0)|0,cn(12),-1):(f|0)>(_|0)&&!(Hn(f|0)|0)?(cn(12),-1):(h[It>>2]=f,A|0)}return{___divdi3:Kl,___muldi3:es,___remdi3:Mh,___uremdi3:wh,_areNeighborCells:UB,_bitshift64Ashr:HT,_bitshift64Lshr:pt,_bitshift64Shl:bt,_calloc:Ro,_cellAreaKm2:pF,_cellAreaM2:AF,_cellAreaRads2:ty,_cellToBoundary:bh,_cellToCenterChild:wT,_cellToChildPos:sF,_cellToChildren:QB,_cellToChildrenSize:up,_cellToLatLng:ou,_cellToLocalIj:bF,_cellToParent:$v,_cellToVertex:Eo,_cellToVertexes:VF,_cellsToDirectedEdge:OB,_cellsToLinkedMultiPolygon:_B,_childPosToCell:oF,_compactCells:ZB,_destroyLinkedMultiPolygon:PT,_directedEdgeToBoundary:lm,_directedEdgeToCells:GB,_edgeLengthKm:gF,_edgeLengthM:_F,_edgeLengthRads:mF,_emscripten_replace_memory:Vn,_free:sn,_getBaseCellNumber:ST,_getDirectedEdgeDestination:zB,_getDirectedEdgeOrigin:kB,_getHexagonAreaAvgKm2:RT,_getHexagonAreaAvgM2:hF,_getHexagonEdgeLengthAvgKm:dF,_getHexagonEdgeLengthAvgM:fF,_getIcosahedronFaces:TT,_getNumCells:ey,_getPentagons:Zv,_getRes0Cells:SB,_getResolution:YB,_greatCircleDistanceKm:dp,_greatCircleDistanceM:lF,_greatCircleDistanceRads:aF,_gridDisk:Zr,_gridDiskDistances:Xl,_gridDistance:MF,_gridPathCells:TF,_gridPathCellsSize:wF,_gridRingUnsafe:Kr,_i64Add:Kt,_i64Subtract:zr,_isPentagon:ci,_isResClassIII:eF,_isValidCell:Hv,_isValidDirectedEdge:VB,_isValidVertex:qF,_latLngToCell:Yv,_llvm_ctlz_i64:WT,_llvm_maxnum_f64:$T,_llvm_minnum_f64:hm,_llvm_round_f64:dm,_localIjToCell:SF,_malloc:Ma,_maxFaceCount:iF,_maxGridDiskSize:jl,_maxPolygonToCellsSize:lp,_maxPolygonToCellsSizeExperimental:CF,_memcpy:Th,_memset:au,_originToDirectedEdges:qB,_pentagonCount:rF,_polygonToCells:mB,_polygonToCellsExperimental:RF,_readInt64AsDoubleFromPointer:UF,_res0CellCount:bB,_round:jT,_sbrk:Jl,_sizeOfCellBoundary:NF,_sizeOfCoordIJ:FF,_sizeOfGeoLoop:DF,_sizeOfGeoPolygon:IF,_sizeOfH3Index:PF,_sizeOfLatLng:LF,_sizeOfLinkedGeoPolygon:BF,_uncompactCells:KB,_uncompactCellsSize:JB,_vertexToLatLng:GF,establishStackSpace:no,stackAlloc:rn,stackRestore:Wn,stackSave:Ar}}(tn,Rn,k);e.___divdi3=le.___divdi3,e.___muldi3=le.___muldi3,e.___remdi3=le.___remdi3,e.___uremdi3=le.___uremdi3,e._areNeighborCells=le._areNeighborCells,e._bitshift64Ashr=le._bitshift64Ashr,e._bitshift64Lshr=le._bitshift64Lshr,e._bitshift64Shl=le._bitshift64Shl,e._calloc=le._calloc,e._cellAreaKm2=le._cellAreaKm2,e._cellAreaM2=le._cellAreaM2,e._cellAreaRads2=le._cellAreaRads2,e._cellToBoundary=le._cellToBoundary,e._cellToCenterChild=le._cellToCenterChild,e._cellToChildPos=le._cellToChildPos,e._cellToChildren=le._cellToChildren,e._cellToChildrenSize=le._cellToChildrenSize,e._cellToLatLng=le._cellToLatLng,e._cellToLocalIj=le._cellToLocalIj,e._cellToParent=le._cellToParent,e._cellToVertex=le._cellToVertex,e._cellToVertexes=le._cellToVertexes,e._cellsToDirectedEdge=le._cellsToDirectedEdge,e._cellsToLinkedMultiPolygon=le._cellsToLinkedMultiPolygon,e._childPosToCell=le._childPosToCell,e._compactCells=le._compactCells,e._destroyLinkedMultiPolygon=le._destroyLinkedMultiPolygon,e._directedEdgeToBoundary=le._directedEdgeToBoundary,e._directedEdgeToCells=le._directedEdgeToCells,e._edgeLengthKm=le._edgeLengthKm,e._edgeLengthM=le._edgeLengthM,e._edgeLengthRads=le._edgeLengthRads;var Bt=e._emscripten_replace_memory=le._emscripten_replace_memory;e._free=le._free,e._getBaseCellNumber=le._getBaseCellNumber,e._getDirectedEdgeDestination=le._getDirectedEdgeDestination,e._getDirectedEdgeOrigin=le._getDirectedEdgeOrigin,e._getHexagonAreaAvgKm2=le._getHexagonAreaAvgKm2,e._getHexagonAreaAvgM2=le._getHexagonAreaAvgM2,e._getHexagonEdgeLengthAvgKm=le._getHexagonEdgeLengthAvgKm,e._getHexagonEdgeLengthAvgM=le._getHexagonEdgeLengthAvgM,e._getIcosahedronFaces=le._getIcosahedronFaces,e._getNumCells=le._getNumCells,e._getPentagons=le._getPentagons,e._getRes0Cells=le._getRes0Cells,e._getResolution=le._getResolution,e._greatCircleDistanceKm=le._greatCircleDistanceKm,e._greatCircleDistanceM=le._greatCircleDistanceM,e._greatCircleDistanceRads=le._greatCircleDistanceRads,e._gridDisk=le._gridDisk,e._gridDiskDistances=le._gridDiskDistances,e._gridDistance=le._gridDistance,e._gridPathCells=le._gridPathCells,e._gridPathCellsSize=le._gridPathCellsSize,e._gridRingUnsafe=le._gridRingUnsafe,e._i64Add=le._i64Add,e._i64Subtract=le._i64Subtract,e._isPentagon=le._isPentagon,e._isResClassIII=le._isResClassIII,e._isValidCell=le._isValidCell,e._isValidDirectedEdge=le._isValidDirectedEdge,e._isValidVertex=le._isValidVertex,e._latLngToCell=le._latLngToCell,e._llvm_ctlz_i64=le._llvm_ctlz_i64,e._llvm_maxnum_f64=le._llvm_maxnum_f64,e._llvm_minnum_f64=le._llvm_minnum_f64,e._llvm_round_f64=le._llvm_round_f64,e._localIjToCell=le._localIjToCell,e._malloc=le._malloc,e._maxFaceCount=le._maxFaceCount,e._maxGridDiskSize=le._maxGridDiskSize,e._maxPolygonToCellsSize=le._maxPolygonToCellsSize,e._maxPolygonToCellsSizeExperimental=le._maxPolygonToCellsSizeExperimental,e._memcpy=le._memcpy,e._memset=le._memset,e._originToDirectedEdges=le._originToDirectedEdges,e._pentagonCount=le._pentagonCount,e._polygonToCells=le._polygonToCells,e._polygonToCellsExperimental=le._polygonToCellsExperimental,e._readInt64AsDoubleFromPointer=le._readInt64AsDoubleFromPointer,e._res0CellCount=le._res0CellCount,e._round=le._round,e._sbrk=le._sbrk,e._sizeOfCellBoundary=le._sizeOfCellBoundary,e._sizeOfCoordIJ=le._sizeOfCoordIJ,e._sizeOfGeoLoop=le._sizeOfGeoLoop,e._sizeOfGeoPolygon=le._sizeOfGeoPolygon,e._sizeOfH3Index=le._sizeOfH3Index,e._sizeOfLatLng=le._sizeOfLatLng,e._sizeOfLinkedGeoPolygon=le._sizeOfLinkedGeoPolygon,e._uncompactCells=le._uncompactCells,e._uncompactCellsSize=le._uncompactCellsSize,e._vertexToLatLng=le._vertexToLatLng,e.establishStackSpace=le.establishStackSpace;var tt=e.stackAlloc=le.stackAlloc,ut=e.stackRestore=le.stackRestore,Ut=e.stackSave=le.stackSave;if(e.asm=le,e.cwrap=R,e.setValue=g,e.getValue=v,q){ue(q)||(q=s(q));{vt();var Dt=function($e){$e.byteLength&&($e=new Uint8Array($e)),W.set($e,m),e.memoryInitializerRequest&&delete e.memoryInitializerRequest.response,ot()},An=function(){o(q,Dt,function(){throw"could not load memory initializer "+q})},Jn=zt(q);if(Jn)Dt(Jn.buffer);else if(e.memoryInitializerRequest){var Ki=function(){var $e=e.memoryInitializerRequest,ht=$e.response;if($e.status!==200&&$e.status!==0){var te=zt(e.memoryInitializerRequestURL);if(te)ht=te.buffer;else{console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+$e.status+", retrying "+q),An();return}}Dt(ht)};e.memoryInitializerRequest.response?setTimeout(Ki,0):e.memoryInitializerRequest.addEventListener("load",Ki)}else An()}}var Nn;Oe=function $e(){Nn||Er(),Nn||(Oe=$e)};function Er($e){if(Qe>0||(Ye(),Qe>0))return;function ht(){Nn||(Nn=!0,!b&&(ct(),Je(),e.onRuntimeInitialized&&e.onRuntimeInitialized(),Ke()))}e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),ht()},1)):ht()}e.run=Er;function Rr($e){throw e.onAbort&&e.onAbort($e),$e+="",a($e),l($e),b=!0,"abort("+$e+"). Build with -s ASSERTIONS=1 for more info."}if(e.abort=Rr,e.preInit)for(typeof e.preInit=="function"&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();return Er(),i}(typeof Un=="object"?Un:{}),pn="number",an=pn,Rp=pn,dn=pn,fn=pn,Pr=pn,Gt=pn,pX=[["sizeOfH3Index",pn],["sizeOfLatLng",pn],["sizeOfCellBoundary",pn],["sizeOfGeoLoop",pn],["sizeOfGeoPolygon",pn],["sizeOfLinkedGeoPolygon",pn],["sizeOfCoordIJ",pn],["readInt64AsDoubleFromPointer",pn],["isValidCell",Rp,[dn,fn]],["latLngToCell",an,[pn,pn,Pr,Gt]],["cellToLatLng",an,[dn,fn,Gt]],["cellToBoundary",an,[dn,fn,Gt]],["maxGridDiskSize",an,[pn,Gt]],["gridDisk",an,[dn,fn,pn,Gt]],["gridDiskDistances",an,[dn,fn,pn,Gt,Gt]],["gridRingUnsafe",an,[dn,fn,pn,Gt]],["maxPolygonToCellsSize",an,[Gt,Pr,pn,Gt]],["polygonToCells",an,[Gt,Pr,pn,Gt]],["maxPolygonToCellsSizeExperimental",an,[Gt,Pr,pn,Gt]],["polygonToCellsExperimental",an,[Gt,Pr,pn,pn,pn,Gt]],["cellsToLinkedMultiPolygon",an,[Gt,pn,Gt]],["destroyLinkedMultiPolygon",null,[Gt]],["compactCells",an,[Gt,Gt,pn,pn]],["uncompactCells",an,[Gt,pn,pn,Gt,pn,Pr]],["uncompactCellsSize",an,[Gt,pn,pn,Pr,Gt]],["isPentagon",Rp,[dn,fn]],["isResClassIII",Rp,[dn,fn]],["getBaseCellNumber",pn,[dn,fn]],["getResolution",pn,[dn,fn]],["maxFaceCount",an,[dn,fn,Gt]],["getIcosahedronFaces",an,[dn,fn,Gt]],["cellToParent",an,[dn,fn,Pr,Gt]],["cellToChildren",an,[dn,fn,Pr,Gt]],["cellToCenterChild",an,[dn,fn,Pr,Gt]],["cellToChildrenSize",an,[dn,fn,Pr,Gt]],["cellToChildPos",an,[dn,fn,Pr,Gt]],["childPosToCell",an,[pn,pn,dn,fn,Pr,Gt]],["areNeighborCells",an,[dn,fn,dn,fn,Gt]],["cellsToDirectedEdge",an,[dn,fn,dn,fn,Gt]],["getDirectedEdgeOrigin",an,[dn,fn,Gt]],["getDirectedEdgeDestination",an,[dn,fn,Gt]],["isValidDirectedEdge",Rp,[dn,fn]],["directedEdgeToCells",an,[dn,fn,Gt]],["originToDirectedEdges",an,[dn,fn,Gt]],["directedEdgeToBoundary",an,[dn,fn,Gt]],["gridDistance",an,[dn,fn,dn,fn,Gt]],["gridPathCells",an,[dn,fn,dn,fn,Gt]],["g
3839ridPathCellsSize",an,[dn,fn,dn,fn,Gt]],["cellToLocalIj",an,[dn,fn,dn,fn,pn,Gt]],["localIjToCell",an,[dn,fn,Gt,pn,Gt]],["getHexagonAreaAvgM2",an,[Pr,Gt]],["getHexagonAreaAvgKm2",an,[Pr,Gt]],["getHexagonEdgeLengthAvgM",an,[Pr,Gt]],["getHexagonEdgeLengthAvgKm",an,[Pr,Gt]],["greatCircleDistanceM",pn,[Gt,Gt]],["greatCircleDistanceKm",pn,[Gt,Gt]],["greatCircleDistanceRads",pn,[Gt,Gt]],["cellAreaM2",an,[dn,fn,Gt]],["cellAreaKm2",an,[dn,fn,Gt]],["cellAreaRads2",an,[dn,fn,Gt]],["edgeLengthM",an,[dn,fn,Gt]],["edgeLengthKm",an,[dn,fn,Gt]],["edgeLengthRads",an,[dn,fn,Gt]],["getNumCells",an,[Pr,Gt]],["getRes0Cells",an,[Gt]],["res0CellCount",pn],["getPentagons",an,[pn,Gt]],["pentagonCount",pn],["cellToVertex",an,[dn,fn,pn,Gt]],["cellToVertexes",an,[dn,fn,Gt]],["vertexToLatLng",an,[dn,fn,Gt]],["isValidVertex",Rp,[dn,fn]]],AX=0,mX=1,gX=2,_X=3,y5=4,vX=5,yX=6,xX=7,bX=8,SX=9,MX=10,wX=11,TX=12,EX=13,RX=14,CX=15,Yr={};Yr[AX]="Success";Yr[mX]="The operation failed but a more specific error is not available";Yr[gX]="Argument was outside of acceptable range";Yr[_X]="Latitude or longitude arguments were outside of acceptable range";Yr[y5]="Resolution argument was outside of acceptable range";Yr[vX]="Cell argument was not valid";Yr[yX]="Directed edge argument was not valid";Yr[xX]="Undirected edge argument was not valid";Yr[bX]="Vertex argument was not valid";Yr[SX]="Pentagon distortion was encountered";Yr[MX]="Duplicate input";Yr[wX]="Cell arguments were not neighbors";Yr[TX]="Cell arguments had incompatible resolutions";Yr[EX]="Memory allocation failed";Yr[RX]="Bounds of provided memory were insufficient";Yr[CX]="Mode or flags argument was not valid";var PX=1e3,x5=1001,b5=1002,z1={};z1[PX]="Unknown unit";z1[x5]="Array length out of bounds";z1[b5]="Got unexpected null value for H3 index";var LX="Unknown error";function S5(i,e,t){var n=t&&"value"in t,r=new Error((i[e]||LX)+" (code: "+e+(n?", value: "+t.value:"")+")");return r.code=e,r}function M5(i,e){var t=arguments.length===2?{value:e}:{};return S5(Yr,i,t)}function w5(i,e){var t=arguments.length===2?{value:e}:{};return S5(z1,i,t)}function i0(i){if(i!==0)throw M5(i)}var Ys={};pX.forEach(function(e){Ys[e[0]]=Un.cwrap.apply(Un,e)});var Id=16,r0=4,Rf=8,NX=8,J_=Ys.sizeOfH3Index(),hM=Ys.sizeOfLatLng(),DX=Ys.sizeOfCellBoundary(),IX=Ys.sizeOfGeoPolygon(),xA=Ys.sizeOfGeoLoop();Ys.sizeOfLinkedGeoPolygon();Ys.sizeOfCoordIJ();function BX(i){if(typeof i!="number"||i<0||i>15||Math.floor(i)!==i)throw M5(y5,i);return i}function FX(i){if(!i)throw w5(b5);return i}var UX=Math.pow(2,32)-1;function OX(i){if(i>UX)throw w5(x5,i);return i}var kX=/[^0-9a-fA-F]/;function T5(i){if(Array.isArray(i)&&i.length===2&&Number.isInteger(i[0])&&Number.isInteger(i[1]))return i;if(typeof i!="string"||kX.test(i))return[0,0];var e=parseInt(i.substring(0,i.length-8),Id),t=parseInt(i.substring(i.length-8),Id);return[t,e]}function lR(i){if(i>=0)return i.toString(Id);i=i&2147483647;var e=E5(8,i.toString(Id)),t=(parseInt(e[0],Id)+8).toString(Id);return e=t+e.substring(1),e}function zX(i,e){return lR(e)+E5(8,lR(i))}function E5(i,e){for(var t=i-e.length,n="",r=0;r<t;r++)n+="0";return n=n+e,n}function cR(i,e,t){for(var n=i.length,r=Un._calloc(n,hM),s=t?1:0,o=t?0:1,a=0;a<n*2;a+=2)Un.HEAPF64.set([i[a/2][s],i[a/2][o]].map(L5),r/Rf+a);return Un.HEAPU32.set([n,r],e/r0),e}function VX(i,e){var t=i.length-1,n=Un._calloc(IX),r=0,s=r+xA,o=s+r0;cR(i[0],n+r,e);var a;if(t>0){a=Un._calloc(t,xA);for(var l=0;l<t;l++)cR(i[l+1],a+xA*l,e)}return Un.setValue(n+s,t,"i32"),Un.setValue(n+o,a,"i32"),n}function GX(i){var e=0,t=e+xA,n=t+r0,r=r0;Un._free(Un.getValue(i+e+r,"i8*"));var s=Un.getValue(i+t,"i32");if(s>0){for(var o=Un.getValue(i+n,"i32"),a=0;a<s;a++)Un._free(Un.getValue(o+xA*a+r,"i8*"));Un._free(o)}Un._free(i)}function R5(i,e){e===void 0&&(e=0);var t=Un.getValue(i+J_*e,"i32"),n=Un.getValue(i+J_*e+r0,"i32");return n?zX(t,n):null}function qX(i){return Ys.readInt64AsDoubleFromPointer(i)}function HX(i,e){for(var t=[],n=0;n<e;n++){var r=R5(i,n);r!==null&&t.push(r)}return t}function e1(i){return YX(Un.getValue(i,"double"))}function WX(i){return[e1(i),e1(i+Rf)]}function $X(i){return[e1(i+Rf),e1(i)]}function jX(i,e,t){for(var n=Un.getValue(i,"i32"),r=i+Rf,s=[],o=$X,a=0;a<n*2;a+=2)s.push(o(r+Rf*a));return s.push(s[0]),s}function XX(i,e,t){var n=Un._malloc(hM);
3839Un.HEAPF64.set([i,e].map(L5),n/Rf);var r=Un._malloc(J_);try{return i0(Ys.latLngToCell(n,t,r)),FX(R5(r))}finally{Un._free(r),Un._free(n)}}function C5(i){var e=Un._malloc(hM),t=T5(i),n=t[0],r=t[1];try{return i0(Ys.cellToLatLng(n,r,e)),WX(e)}finally{Un._free(e)}}function P5(i,e){var t=Un._malloc(DX),n=T5(i),r=n[0],s=n[1];try{return i0(Ys.cellToBoundary(r,s,t)),jX(t,e,e)}finally{Un._free(t)}}function uR(i,e,t){if(BX(e),t=!!t,i.length===0||i[0].length===0)return[];var n=typeof i[0][0]=="number"?[i]:i,r=VX(n,t),s=Un._malloc(NX);try{i0(Ys.maxPolygonToCellsSize(r,e,0,s));var o=OX(qX(s)),a=Un._calloc(o,J_);try{return i0(Ys.polygonToCells(r,e,0,a)),HX(a,o)}finally{Un._free(a)}}finally{Un._free(s),GX(r)}}function L5(i){return i*Math.PI/180}function YX(i){return i*180/Math.PI}/**
3840 * @license
3841 * Copyright 2010-2025 Three.js Authors
3842 * SPDX-License-Identifier: MIT
3843 */const QX=["alphaMap","alphaTest","anisotropy","anisotropyMap","anisotropyRotation","aoMap","attenuationColor","attenuationDistance","bumpMap","clearcoat","clearcoatMap","clearcoatNormalMap","clearcoatNormalScale","clearcoatRoughness","color","dispersion","displacementMap","emissive","emissiveMap","envMap","gradientMap","ior","iridescence","iridescenceIOR","iridescenceMap","iridescenceThicknessMap","lightMap","map","matcap","metalness","metalnessMap","normalMap","normalScale","opacity","roughness","roughnessMap","sheen","sheenColor","sheenColorMap","sheenRoughnessMap","shininess","specular","specularColor","specularColorMap","specularIntensity","specularIntensityMap","specularMap","thickness","transmission","transmissionMap"];class ZX{constructor(e){this.renderObjects=new WeakMap,this.hasNode=this.containsNode(e),this.hasAnimation=e.object.isSkinnedMesh===!0,this.refreshUniforms=QX,this.renderId=0}firstInitialization(e){return this.renderObjects.has(e)===!1?(this.getRenderObjectData(e),!0):!1}needsVelocity(e){const t=e.getMRT();return t!==null&&t.has("velocity")}getRenderObjectData(e){let t=this.renderObjects.get(e);if(t===void 0){const{geometry:n,material:r,object:s}=e;if(t={material:this.getMaterialData(r),geometry:{id:n.id,attributes:this.getAttributesData(n.attributes),indexVersion:n.index?n.index.version:null,drawRange:{start:n.drawRange.start,count:n.drawRange.count}},worldMatrix:s.matrixWorld.clone()},s.center&&(t.center=s.center.clone()),s.morphTargetInfluences&&(t.morphTargetInfluences=s.morphTargetInfluences.slice()),e.bundle!==null&&(t.version=e.bundle.version),t.material.transmission>0){const{width:o,height:a}=e.context;t.bufferWidth=o,t.bufferHeight=a}this.renderObjects.set(e,t)}return t}getAttributesData(e){const t={};for(const n in e){const r=e[n];t[n]={version:r.version}}return t}containsNode(e){const t=e.material;for(const n in t)if(t[n]&&t[n].isNode)return!0;return e.renderer.overrideNodes.modelViewMatrix!==null||e.renderer.overrideNodes.modelNormalViewMatrix!==null}getMaterialData(e){const t={};for(const n of this.refreshUniforms){const r=e[n];r!=null&&(typeof r=="object"&&r.clone!==void 0?r.isTexture===!0?t[n]={id:r.id,version:r.version}:t[n]=r.clone():t[n]=r)}return t}equals(e){const{object:t,material:n,geometry:r}=e,s=this.getRenderObjectData(e);if(s.worldMatrix.equals(t.matrixWorld)!==!0)return s.worldMatrix.copy(t.matrixWorld),!1;const o=s.material;for(const b in o){const M=o[b],x=n[b];if(M.equals!==void 0){if(M.equals(x)===!1)return M.copy(x),!1}else if(x.isTexture===!0){if(M.id!==x.id||M.version!==x.version)return M.id=x.id,M.version=x.version,!1}else if(M!==x)return o[b]=x,!1}if(o.transmission>0){const{width:b,height:M}=e.context;if(s.bufferWidth!==b||s.bufferHeight!==M)return s.bufferWidth=b,s.bufferHeight=M,!1}const a=s.geometry,l=r.attributes,c=a.attributes,u=Object.keys(c),p=Object.keys(l);if(a.id!==r.id)return a.id=r.id,!1;if(u.length!==p.length)return s.geometry.attributes=this.getAttributesData(l),!1;for(const b of u){const M=c[b],x=l[b];if(x===void 0)return delete c[b],!1;if(M.version!==x.version)return M.version=x.version,!1}const m=r.index,g=a.indexVersion,v=m?m.version:null;if(g!==v)return a.indexVersion=v,!1;if(a.drawRange.start!==r.drawRange.start||a.drawRange.count!==r.drawRange.count)return a.drawRange.start=r.drawRange.start,a.drawRange.count=r.drawRange.count,!1;if(s.morphTargetInfluences){let b=!1;for(let M=0;M<s.morphTargetInfluences.length;M++)s.morphTargetInfluences[M]!==t.morphTargetInfluences[M]&&(b=!0);if(b)return!0}return s.center&&s.center.equals(t.center)===!1?(s.center.copy(t.center),
3843!0):(e.bundle!==null&&(s.version=e.bundle.version),!0)}needsRefresh(e,t){if(this.hasNode||this.hasAnimation||this.firstInitialization(e)||this.needsVelocity(t.renderer))return!0;const{renderId:n}=t;if(this.renderId!==n)return this.renderId=n,!0;const r=e.object.static===!0,s=e.bundle!==null&&e.bundle.static===!0&&this.getRenderObjectData(e).version===e.bundle.version;return r||s?!1:this.equals(e)!==!0}}function s0(i,e=0){let t=3735928559^e,n=1103547991^e;if(i instanceof Array)for(let r=0,s;r<i.length;r++)s=i[r],t=Math.imul(t^s,2654435761),n=Math.imul(n^s,1597334677);else for(let r=0,s;r<i.length;r++)s=i.charCodeAt(r),t=Math.imul(t^s,2654435761),n=Math.imul(n^s,1597334677);return t=Math.imul(t^t>>>16,2246822507),t^=Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(t^t>>>13,3266489909),4294967296*(2097151&n)+(t>>>0)}const N5=i=>s0(i),V1=i=>s0(i),o0=(...i)=>s0(i);function D5(i,e=!1){const t=[];i.isNode===!0&&(t.push(i.id),i=i.getSelf());for(const{property:n,childNode:r}of t1(i))t.push(s0(n.slice(0,-4)),r.getCacheKey(e));return s0(t)}function*t1(i,e=!1){for(const t in i){if(t.startsWith("_")===!0)continue;const n=i[t];if(Array.isArray(n)===!0)for(let r=0;r<n.length;r++){const s=n[r];s&&(s.isNode===!0||e&&typeof s.toJSON=="function")&&(yield{property:t,index:r,childNode:s})}else if(n&&n.isNode===!0)yield{property:t,childNode:n};else if(typeof n=="object")for(const r in n){const s=n[r];s&&(s.isNode===!0||e&&typeof s.toJSON=="function")&&(yield{property:t,index:r,childNode:s})}}}const KX=new Map([[1,"float"],[2,"vec2"],[3,"vec3"],[4,"vec4"],[9,"mat3"],[16,"mat4"]]),hR=new WeakMap;function I5(i){return KX.get(i)}function n1(i){if(/[iu]?vec\d/.test(i))return i.startsWith("ivec")?Int32Array:i.startsWith("uvec")?Uint32Array:Float32Array;if(/mat\d/.test(i)||/float/.test(i))return Float32Array;if(/uint/.test(i))return Uint32Array;if(/int/.test(i))return Int32Array;throw new Error(`THREE.NodeUtils: Unsupported type: ${i}`)}function dM(i){if(/float|int|uint/.test(i))return 1;if(/vec2/.test(i))return 2;if(/vec3/.test(i))return 3;if(/vec4/.test(i)||/mat2/.test(i))return 4;if(/mat3/.test(i))return 9;if(/mat4/.test(i))return 16;console.error("THREE.TSL: Unsupported type:",i)}function Cc(i){if(i==null)return null;const e=typeof i;return i.isNode===!0?"node":e==="number"?"float":e==="boolean"?"bool":e==="string"?"string":e==="function"?"shader":i.isVector2===!0?"vec2":i.isVector3===!0?"vec3":i.isVector4===!0?"vec4":i.isMatrix2===!0?"mat2":i.isMatrix3===!0?"mat3":i.isMatrix4===!0?"mat4":i.isColor===!0?"color":i instanceof ArrayBuffer?"ArrayBuffer":null}function B5(i,...e){const t=i?i.slice(-4):void 0;return e.length===1&&(t==="vec2"?e=[e[0],e[0]]:t==="vec3"?e=[e[0],e[0],e[0]]:t==="vec4"&&(e=[e[0],e[0],e[0],e[0]])),i==="color"?new qt(...e):t==="vec2"?new at(...e):t==="vec3"?new re(...e):t==="vec4"?new Jt(...e):t==="mat2"?new F1(...e):t==="mat3"?new Sn(...e):t==="mat4"?new un(...e):i==="bool"?e[0]||!1:i==="float"||i==="int"||i==="uint"?e[0]||0:i==="string"?e[0]||"":i==="ArrayBuffer"?O5(e[0]):null}function F5(i){let e=hR.get(i);return e===void 0&&(e={},hR.set(i,e)),e}function U5(i){let e="";const t=new Uint8Array(i);for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function O5(i){return Uint8Array.from(atob(i),e=>e.charCodeAt(0)).buffer}const vb={VERTEX:"vertex",FRAGMENT:"fragment"},gn={NONE:"none",FRAME:"frame",RENDER:"render",OBJECT:"object"},JX={BOOLEAN:"bool",INTEGER:"int",FLOAT:"float",VECTOR2:"vec2",VECTOR3:"vec3",VECTOR4:"vec4",MATRIX2:"mat2",MATRIX3:"mat3",MATRIX4:"mat4"},as={READ_ONLY:"readOnly",WRITE_ONLY:"writeOnly",READ_WRITE:"readWrite"},k5=["fragment","vertex"],yb=["setup","analyze","generate"],xb=[...k5,"compute"],fh=["x","y","z","w"];let eY=0,Qt=class extends il{static get type(){return"Node"}constructor(e=null){super(),this.nodeType=e,this.updateType=gn.NONE,this.updateBeforeType=gn.NONE,this.updateAfterType=gn.NONE,this.uuid=Sf.generateUUID(),this.version=0,this.global=!1,this.parents=!1,this.isNode=!0,this._cacheKey=null,this._cacheKeyVersion=0,Object.defineProperty(this,"id",{value:eY++})}set needsUpdate(e){e===!0&&this.version++}get type(){return this.constructor.type}onUpdate(e,t){return this.updateType=t,this.update=e.bind(this.getSelf()),this}onFrameUpdate(e){return this.onUpdate(e,gn.FRAME)}
3843onRenderUpdate(e){return this.onUpdate(e,gn.RENDER)}onObjectUpdate(e){return this.onUpdate(e,gn.OBJECT)}onReference(e){return this.updateReference=e.bind(this.getSelf()),this}getSelf(){return this.self||this}updateReference(){return this}isGlobal(){return this.global}*getChildren(){for(const{childNode:e}of t1(this))yield e}dispose(){this.dispatchEvent({type:"dispose"})}traverse(e){e(this);for(const t of this.getChildren())t.traverse(e)}getCacheKey(e=!1){return e=e||this.version!==this._cacheKeyVersion,(e===!0||this._cacheKey===null)&&(this._cacheKey=o0(D5(this,e),this.customCacheKey()),this._cacheKeyVersion=this.version),this._cacheKey}customCacheKey(){return 0}getScope(){return this}getHash(){return this.uuid}getUpdateType(){return this.updateType}getUpdateBeforeType(){return this.updateBeforeType}getUpdateAfterType(){return this.updateAfterType}getElementType(e){const t=this.getNodeType(e);return e.getElementType(t)}getMemberType(){return"void"}getNodeType(e){const t=e.getNodeProperties(this);return t.outputNode?t.outputNode.getNodeType(e):this.nodeType}getShared(e){const t=this.getHash(e);return e.getNodeFromHash(t)||this}setup(e){const t=e.getNodeProperties(this);let n=0;for(const r of this.getChildren())t["node"+n++]=r;return t.outputNode||null}analyze(e){if(e.increaseUsage(this)===1){const n=e.getNodeProperties(this);for(const r of Object.values(n))r&&r.isNode===!0&&r.build(e)}}generate(e,t){const{outputNode:n}=e.getNodeProperties(this);if(n&&n.isNode===!0)return n.build(e,t)}updateBefore(){console.warn("Abstract function.")}updateAfter(){console.warn("Abstract function.")}update(){console.warn("Abstract function.")}build(e,t=null){const n=this.getShared(e);if(this!==n)return n.build(e,t);e.addNode(this),e.addChain(this);let r=null;const s=e.getBuildStage();if(s==="setup"){this.updateReference(e);const o=e.getNodeProperties(this);if(o.initialized!==!0){o.initialized=!0;const a=this.setup(e),l=a&&a.isNode===!0;for(const c of Object.values(o))if(c&&c.isNode===!0){if(c.parents===!0){const u=e.getNodeProperties(c);u.parents=u.parents||[],u.parents.push(this)}c.build(e)}l&&a.build(e),o.outputNode=a}r=o.outputNode||null}else if(s==="analyze")this.analyze(e);else if(s==="generate")if(this.generate.length===1){const a=this.getNodeType(e),l=e.getDataFromNode(this);r=l.snippet,r===void 0?l.generated===void 0?(l.generated=!0,r=this.generate(e)||"",l.snippet=r):(console.warn("THREE.Node: Recursion detected.",this),r=""):l.flowCodes!==void 0&&e.context.nodeBlock!==void 0&&e.addFlowCodeHierarchy(this,e.context.nodeBlock),r=e.format(r,a,t)}else r=this.generate(e,t)||"";return e.removeChain(this),e.addSequentialNode(this),r}getSerializeChildren(){return t1(this)}serialize(e){const t=this.getSerializeChildren(),n={};for(const{property:r,index:s,childNode:o}of t)s!==void 0?(n[r]===void 0&&(n[r]=Number.isInteger(s)?[]:{}),n[r][s]=o.toJSON(e.meta).uuid):n[r]=o.toJSON(e.meta).uuid;Object.keys(n).length>0&&(e.inputNodes=n)}deserialize(e){if(e.inputNodes!==void 0){const t=e.meta.nodes;for(const n in e.inputNodes)if(Array.isArray(e.inputNodes[n])){const r=[];for(const s of e.inputNodes[n])r.push(t[s]);this[n]=r}else if(typeof e.inputNodes[n]=="object"){const r={};for(const s in e.inputNodes[n]){const o=e.inputNodes[n][s];r[s]=t[o]}this[n]=r}else{const r=e.inputNodes[n];this[n]=t[r]}}}toJSON(e){const{uuid:t,type:n}=this,r=e===void 0||typeof e=="string";r&&(e={textures:{},images:{},nodes:{}});let s=e.nodes[t];s===void 0&&(s={uuid:t,type:n,meta:e,metadata:{version:4.6,type:"Node",generator:"Node.toJSON"}},r!==!0&&(e.nodes[s.uuid]=s),this.serialize(s),delete s.meta);function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}if(r){const a=o(e.textures),l=o(e.images),c=o(e.nodes);a.length>0&&(s.textures=a),l.length>0&&(s.images=l),c.length>0&&(s.nodes=c)}return s}};class ph extends Qt{static get type(){return"ArrayElementNode"}constructor(e,t){super(),this.node=e,this.indexNode=t,this.isArrayElementNode=!0}getNodeType(e){return this.node.getElementType(e)}generate(e){const t=this.indexNode.getNodeType(e),n=this.node.build(e),r=this.indexNode.build(e,!e.isVector(t)&&e.isInteger(t)?t:"uint");return`${n}[ ${r} ]`}}class z5 extends Qt{static get type(){return"ConvertNode"}constructor(e,t){super(),this.node=e,this.convertTo=t}getNodeType(e){const t=this.node.getNodeType(e);let n=null;for(const r of this.convertTo.split("|"))(n===null||e.getTypeLength(t)===e.getTypeLength(r))&&(n=r);return n}serialize(e){super.serialize(e),e.convertTo=this.convertTo}deserialize(e){super.deserialize(e),this.convertTo=e.convertTo}generate(e,t){const n=this.node,r=this.getNodeType(e),s=n.build(e,r);return e.format(s,r,t)}}class Zi extends Qt{static get type(){return"TempNode"}constructor(e=null){super(e),this.isTempNode=!0}hasDependencies(e){return e.getDataFromNode(this).usageCount>1}build(e,t){if(e.getBuildStage()==="generate"){const r=e.getVectorType(this.getNodeType(e,t)),s=e.getDataFromNode(this);if(s.propertyName!==void 0)return e.format(s.propertyName,r,t);if(r!=="void"&&t!=="void"&&this.hasDependencies(e)){const o=super.build(e,r),a=e.getVarFromNode(this,null,r),l=e.getPropertyName(a);return e.addLineFlowCode(`${l} = ${o}`,this),s.snippet=o,s.propertyName=l,e.format(s.propertyName,r,t)}}return super.build(e,t)}}class tY extends Zi{static get type(){return"JoinNode"}constructor(e=[],t=null){super(t),this.nodes=e}
3843getNodeType(e){return this.nodeType!==null?e.getVectorType(this.nodeType):e.getTypeFromLength(this.nodes.reduce((t,n)=>t+e.getTypeLength(n.getNodeType(e)),0))}generate(e,t){const n=this.getNodeType(e),r=e.getTypeLength(n),s=this.nodes,o=e.getComponentType(n),a=[];let l=0;for(const u of s){if(l>=r){console.error(`THREE.TSL: Length of parameters exceeds maximum length of function '${n}()' type.`);break}let p=u.getNodeType(e),m=e.getTypeLength(p),g;l+m>r&&(console.error(`THREE.TSL: Length of '${n}()' data exceeds maximum length of output type.`),m=r-l,p=e.getTypeFromLength(m)),l+=m,g=u.build(e,p);const v=e.getComponentType(p);v!==o&&(g=e.format(g,v,o)),a.push(g)}const c=`${e.getType(n)}( ${a.join(", ")} )`;return e.format(c,n,t)}}const nY=fh.join("");class bb extends Qt{static get type(){return"SplitNode"}constructor(e,t="x"){super(),this.node=e,this.components=t,this.isSplitNode=!0}getVectorLength(){let e=this.components.length;for(const t of this.components)e=Math.max(fh.indexOf(t)+1,e);return e}getComponentType(e){return e.getComponentType(this.node.getNodeType(e))}getNodeType(e){return e.getTypeFromLength(this.components.length,this.getComponentType(e))}generate(e,t){const n=this.node,r=e.getTypeLength(n.getNodeType(e));let s=null;if(r>1){let o=null;this.getVectorLength()>=r&&(o=e.getTypeFromLength(this.getVectorLength(),this.getComponentType(e)));const l=n.build(e,o);this.components.length===r&&this.components===nY.slice(0,this.components.length)?s=e.format(l,o,t):s=e.format(`${l}.${this.components}`,this.getNodeType(e),t)}else s=n.build(e,t);return s}serialize(e){super.serialize(e),e.components=this.components}deserialize(e){super.deserialize(e),this.components=e.components}}class iY extends Zi{static get type(){return"SetNode"}constructor(e,t,n){super(),this.sourceNode=e,this.components=t,this.targetNode=n}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{sourceNode:t,components:n,targetNode:r}=this,s=this.getNodeType(e),o=e.getComponentType(r.getNodeType(e)),a=e.getTypeFromLength(n.length,o),l=r.build(e,a),c=t.build(e,s),u=e.getTypeLength(s),p=[];for(let m=0;m<u;m++){const g=fh[m];g===n[0]?(p.push(l),m+=n.length-1):p.push(c+"."+g)}return`${e.getType(s)}( ${p.join(", ")} )`}}class rY extends Zi{static get type(){return"FlipNode"}constructor(e,t){super(),this.sourceNode=e,this.components=t}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{components:t,sourceNode:n}=this,r=this.getNodeType(e),s=n.build(e),o=e.getVarFromNode(this),a=e.getPropertyName(o);e.addLineFlowCode(a+" = "+s,this);const l=e.getTypeLength(r),c=[];let u=0;for(let p=0;p<l;p++){const m=fh[p];m===t[u]?(c.push("1.0 - "+(a+"."+m)),u++):c.push(a+"."+m)}return`${e.getType(r)}( ${c.join(", ")} )`}}class fM extends Qt{static get type(){return"InputNode"}constructor(e,t=null){super(t),this.isInputNode=!0,this.value=e,this.precision=null}getNodeType(){return this.nodeType===null?Cc(this.value):this.nodeType}getInputType(e){return this.getNodeType(e)}setPrecision(e){return this.precision=e,this}serialize(e){super.serialize(e),e.value=this.value,this.value&&this.value.toArray&&(e.value=this.value.toArray()),e.valueType=Cc(this.value),e.nodeType=this.nodeType,e.valueType==="ArrayBuffer"&&(e.value=U5(e.value)),e.precision=this.precision}deserialize(e){super.deserialize(e),this.nodeType=e.nodeType,this.value=Array.isArray(e.value)?B5(e.valueType,...e.value):e.value,this.precision=e.precision||null,this.value&&this.value.fromArray&&(this.value=this.value.fromArray(e.value))}generate(){console.warn("Abstract function.")}}const dR=/float|u?int/;class xa extends fM{static get type(){return"ConstNode"}constructor(e,t=null){super(e,t),this.isConstNode=!0}generateConst(e){return e.generateConst(this.getNodeType(e),this.value)}generate(e,t){const n=this.getNodeType(e);return dR.test(n)&&dR.test(t)?e.generateConst(t,this.value):e.format(this.generateConst(e),n,t)}}class sY extends Qt{static get type(){return"MemberNode"}constructor(e,t){super(),this.node=e,this.property=t,this.isMemberNode=!0}getNodeType(e){return this.node.getMemberType(e,this.property)}generate(e){return this.node.build(e)+"."+this.property}}let lh=null;const Bd=new Map;function Ze(i,e){if(Bd.has(i)){console.warn(`THREE.TSL: Redefinition of method chaining '${i}'.`);return}if(typeof e!="function")throw new Error(`THREE.TSL: Node element ${i} is not a function`);Bd.set(i,e)}const V5=i=>i.replace(/r|s/g,"x").replace(/g|t/g,"y").replace(/b|p/g,"z").replace(/a|q/g,"w"),fR=i=>V5(i).split("").sort().join(""),G5={setup(i,e){const t=e.shift();return i(I0(t),...e)},get(i,e,t){if(typeof e=="string"&&i[e]===void 0){if(i.isStackNode!==!0&&e==="assign")return(...n)=>(lh.assign(t,...n),t);if(Bd.has(e)){const n=Bd.get(e);return i.isStackNode?(...r)=>t.add(n(...r)):(...r)=>n(t,...r)}else{if(e==="self")return i;if(e.endsWith("Assign")&&Bd.has(e.slice(0,e.length-6))){const n=Bd.get(e.slice(0,e.length-6));return i.isStackNode?(...r)=>t.assign(r[0],n(...r)):(...r)=>t.assign(n(t,...r))}else{if(/^[xyzwrgbastpq]{1,4}$/.test(e)===!0)return e=V5(e),it(new bb(t,e));if(/^set[XYZWRGBASTPQ]{1,4}$/.test(e)===!0)return e=fR(e.slice(3).toLowerCase()),n=>it(new iY(i,e,n));if(/^flip[XYZWRGBASTPQ]{1,4}$/.test(e)===!0)return e=fR(e.slice(4).toLowerCase()),()=>it(new rY(it(i),e));if(e==="width"||e==="height"||e==="depth")return e==="width"?e="x":e==="height"?e="y":e==="depth"&&(e="z"),it(new bb(i,e));if(/^\d+$/.test(e)===!0)return it(new ph(t,new xa(Number(e),"uint")));if(/^get$/.test(e)===!0)return n=>it(new sY(t,n))}}}return Reflect.get(i,e,t)},set(i,e,t,n){return typeof e=="string"&&i[e]===void 0&&(/^[xyzwrgbastpq]{1,4}$/.test(e)===!0||e==="width"||e==="height"||e==="depth"||/^\d+$/.test(e)===!0)?(n[e].assign(t),!0):Reflect.set(i,e,t,n)}},Yy=new WeakMap,pR=new WeakMap,oY=function(i,e=null){const t=Cc(i);if(t==="node"){let n=Yy.get(i);return n===void 0&&(n=new Proxy(i,G5),Yy.set(i,n),Yy.set(n,n)),n}else{if(e===null&&(t==="float"||t==="boolean")||t&&t!=="shader"&&t!=="string")return it(Sb(i,e));if(t==="shader")return Ee(i)}return i},aY=function(i,e=null){for(const t in i)i[t]=it(i[t],e);return i},lY=function(i,e=null){const t=i.length;for(let n=0;n<t;n++)i[n]=it(i[n],e);return i},cY=function(i,e=null,t=null,n=null){const r=u=>
3843it(n!==null?Object.assign(u,n):u);let s,o=e,a,l;function c(u){let p;return o?p=/[a-z]/i.test(o)?o+"()":o:p=i.type,a!==void 0&&u.length<a?(console.error(`THREE.TSL: "${p}" parameter length is less than minimum required.`),u.concat(new Array(a-u.length).fill(0))):l!==void 0&&u.length>l?(console.error(`THREE.TSL: "${p}" parameter length exceeds limit.`),u.slice(0,l)):u}return e===null?s=(...u)=>r(new i(...$u(c(u)))):t!==null?(t=it(t),s=(...u)=>r(new i(e,...$u(c(u)),t))):s=(...u)=>r(new i(e,...$u(c(u)))),s.setParameterLength=(...u)=>(u.length===1?a=l=u[0]:u.length===2&&([a,l]=u),s),s.setName=u=>(o=u,s),s},uY=function(i,...e){return it(new i(...$u(e)))};class hY extends Qt{constructor(e,t){super(),this.shaderNode=e,this.inputNodes=t,this.isShaderCallNodeInternal=!0}getNodeType(e){return this.shaderNode.nodeType||this.getOutputNode(e).getNodeType(e)}getMemberType(e,t){return this.getOutputNode(e).getMemberType(e,t)}call(e){const{shaderNode:t,inputNodes:n}=this,r=e.getNodeProperties(t);if(r.onceOutput)return r.onceOutput;let s=null;if(t.layout){let o=pR.get(e.constructor);o===void 0&&(o=new WeakMap,pR.set(e.constructor,o));let a=o.get(t);a===void 0&&(a=it(e.buildFunctionNode(t)),o.set(t,a)),e.addInclude(a),s=it(a.call(n))}else{const o=t.jsFunc,a=n!==null||o.length>1?o(n||[],e):o(e);s=it(a)}return t.once&&(r.onceOutput=s),s}getOutputNode(e){const t=e.getNodeProperties(this);return t.outputNode===null&&(t.outputNode=this.setupOutput(e)),t.outputNode}setup(e){return this.getOutputNode(e)}setupOutput(e){return e.addStack(),e.stack.outputNode=this.call(e),e.removeStack()}generate(e,t){return this.getOutputNode(e).build(e,t)}}class dY extends Qt{constructor(e,t){super(t),this.jsFunc=e,this.layout=null,this.global=!0,this.once=!1}setLayout(e){return this.layout=e,this}call(e=null){return I0(e),it(new hY(this,e))}setup(){return this.call()}}const fY=[!1,!0],pY=[0,1,2,3],AY=[-1,-2],q5=[.5,1.5,1/3,1e-6,1e6,Math.PI,Math.PI*2,1/Math.PI,2/Math.PI,1/(Math.PI*2),Math.PI/2],pM=new Map;for(const i of fY)pM.set(i,new xa(i));const AM=new Map;for(const i of pY)AM.set(i,new xa(i,"uint"));const mM=new Map([...AM].map(i=>new xa(i.value,"int")));for(const i of AY)mM.set(i,new xa(i,"int"));const G1=new Map([...mM].map(i=>new xa(i.value)));for(const i of q5)G1.set(i,new xa(i));for(const i of q5)G1.set(-i,new xa(-i));const q1={bool:pM,uint:AM,ints:mM,float:G1},AR=new Map([...pM,...G1]),Sb=(i,e)=>AR.has(i)?AR.get(i):i.isNode===!0?i:new xa(i,e),mY=i=>{try{return i.getNodeType()}catch{return}},pr=function(i,e=null){return(...t)=>{if((t.length===0||!["bool","float","int","uint"].includes(i)&&t.every(r=>typeof r!="object"))&&(t=[B5(i,...t)]),t.length===1&&e!==null&&e.has(t[0]))return it(e.get(t[0]));if(t.length===1){const r=Sb(t[0],i);return mY(r)===i?it(r):it(new z5(r,i))}const n=t.map(r=>Sb(r));return it(new tY(n,i))}},a0=i=>typeof i=="object"&&i!==null?i.value:i,H5=i=>i!=null?i.nodeType||i.convertTo||(typeof i=="string"?i:null):null;function Fd(i,e){return new Proxy(new dY(i,e),G5)}const it=(i,e=null)=>oY(i,e),I0=(i,e=null)=>new aY(i,e),$u=(i,e=null)=>new lY(i,e),rt=(...i)=>new cY(...i),St=(...i)=>new uY(...i);let gY=0;const Ee=(i,e=null)=>{let t=null;e!==null&&(typeof e=="object"?t=e.return:(typeof e=="string"?t=e:console.error("THREE.TSL: Invalid layout type."),e=null));const n=new Fd(i,t),r=(...s)=>{let o;I0(s),s[0]&&s[0].isNode?o=[...s]:o=s[0];const a=n.call(o);return t==="void"&&a.toStack(),a};if(r.shaderNode=n,r.setLayout=s=>(n.setLayout(s),r),r.once=()=>(n.once=!0,r),e!==null){if(typeof e.inputs!="object"){const s={name:"fn"+gY++,type:t,inputs:[]};for(const o in e)o!=="return"&&s.inputs.push({name:o,type:e[o]});e=s}r.setLayout(e)}return r};Ze("toGlobal",i=>(i.global=!0,i));const l0=i=>{lh=i},gM=()=>lh,xn=(...i)=>lh.If(...i),_Y=(...i)=>lh.Switch(...i);function H1(i){return lh&&lh.add(i),i}Ze("toStack",H1);const W5=new pr("color"),se=new pr("float",q1.float),me=new pr("int",q1.ints),Nt=new pr("uint",q1.uint),zl=new pr("bool",q1.bool),dt=new pr("vec2"),vr=new pr("ivec2"),$5=new pr("uvec2"),j5=new pr("bvec2"),Se=new pr("vec3"),X5=new pr("ivec3"),Xf=new pr("uvec3"),_M=new pr("bvec3"),jt=new pr("vec4"),Y5=new pr("ivec4"),Q5=new pr("uvec4"),Z5=new pr("bvec4"),W1=new pr("mat2"),hs=new pr("mat3"),ju=new pr("mat4"),vY=(i="")=>it(new xa(i,"string")),yY=i=>it(new xa(i,"ArrayBuffer"));Ze("toColor",W5);Ze("toFloat",se);Ze("toInt",me);Ze("toUint",Nt);Ze("toBool",zl);Ze("toVec2",dt);Ze("toIVec2",vr);Ze("toUVec2",$5);Ze("toBVec2",j5);Ze("toVec3",Se);Ze("toIVec3",X5);Ze("toUVec3",Xf);Ze("toBVec3",_M);Ze("toVec4",jt);Ze("toIVec4",Y5);Ze("toUVec4",Q5);Ze("toBVec4",Z5);Ze("toMat2",W1);Ze("toMat3",hs);Ze("toMat4",ju);const K5=rt(ph).setParameterLength(2),J5=(i,e)=>it(new z5(it(i),e)),xY=(i,e)=>it(new bb(it(i),e));Ze("element",K5);Ze("convert",J5);const bY=i=>(console.warn("THREE.TSL: append() has been renamed to Stack()."),H1(i));
3843Ze("append",i=>(console.warn("THREE.TSL: .append() has been renamed to .toStack()."),H1(i)));const SY=(...i)=>(console.warn("THREE.TSL: tslFn() has been renamed to Fn()."),Ee(...i));class Kn extends Qt{static get type(){return"PropertyNode"}constructor(e,t=null,n=!1){super(e),this.name=t,this.varying=n,this.isPropertyNode=!0}getHash(e){return this.name||super.getHash(e)}isGlobal(){return!0}generate(e){let t;return this.varying===!0?(t=e.getVaryingFromNode(this,this.name),t.needsInterpolation=!0):t=e.getVarFromNode(this,this.name),e.getPropertyName(t)}}const Yf=(i,e)=>it(new Kn(i,e)),c0=(i,e)=>it(new Kn(i,e,!0)),$n=St(Kn,"vec4","DiffuseColor"),Mb=St(Kn,"vec3","EmissiveColor"),Ua=St(Kn,"float","Roughness"),u0=St(Kn,"float","Metalness"),i1=St(Kn,"float","Clearcoat"),h0=St(Kn,"float","ClearcoatRoughness"),zu=St(Kn,"vec3","Sheen"),$1=St(Kn,"float","SheenRoughness"),j1=St(Kn,"float","Iridescence"),vM=St(Kn,"float","IridescenceIOR"),yM=St(Kn,"float","IridescenceThickness"),r1=St(Kn,"float","AlphaT"),bc=St(Kn,"float","Anisotropy"),bA=St(Kn,"vec3","AnisotropyT"),Xu=St(Kn,"vec3","AnisotropyB"),Is=St(Kn,"color","SpecularColor"),d0=St(Kn,"float","SpecularF90"),s1=St(Kn,"float","Shininess"),Xd=St(Kn,"vec4","Output"),A_=St(Kn,"float","dashSize"),wb=St(Kn,"float","gapSize"),MY=St(Kn,"float","pointWidth"),SA=St(Kn,"float","IOR"),o1=St(Kn,"float","Transmission"),xM=St(Kn,"float","Thickness"),bM=St(Kn,"float","AttenuationDistance"),SM=St(Kn,"color","AttenuationColor"),MM=St(Kn,"float","Dispersion");class eN extends Qt{static get type(){return"UniformGroupNode"}constructor(e,t=!1,n=1){super("string"),this.name=e,this.shared=t,this.order=n,this.isUniformGroup=!0}serialize(e){super.serialize(e),e.name=this.name,e.version=this.version,e.shared=this.shared}deserialize(e){super.deserialize(e),this.name=e.name,this.version=e.version,this.shared=e.shared}}const tN=i=>new eN(i),X1=(i,e=0)=>new eN(i,!0,e),nN=X1("frame"),Zt=X1("render"),wM=tN("object");class B0 extends fM{static get type(){return"UniformNode"}constructor(e,t=null){super(e,t),this.isUniformNode=!0,this.name="",this.groupNode=wM}label(e){return this.name=e,this}setGroup(e){return this.groupNode=e,this}getGroup(){return this.groupNode}getUniformHash(e){return this.getHash(e)}
3843onUpdate(e,t){const n=this.getSelf();return e=e.bind(n),super.onUpdate(r=>{const s=e(r,n);s!==void 0&&(this.value=s)},t)}generate(e,t){const n=this.getNodeType(e),r=this.getUniformHash(e);let s=e.getNodeFromHash(r);s===void 0&&(e.setHashNode(this,r),s=this);const o=s.getInputType(e),a=e.getUniformFromNode(s,o,e.shaderStage,this.name||e.context.label),l=e.getPropertyName(a);return e.context.label!==void 0&&delete e.context.label,e.format(l,n,t)}}const $t=(i,e)=>{const t=H5(e||i),n=i&&i.isNode===!0?i.node&&i.node.value||i.value:i;return it(new B0(n,t))};class mR extends Zi{static get type(){return"ArrayNode"}constructor(e,t,n=null){super(e),this.count=t,this.values=n,this.isArrayNode=!0}getNodeType(e){return this.nodeType===null&&(this.nodeType=this.values[0].getNodeType(e)),this.nodeType}getElementType(e){return this.getNodeType(e)}generate(e){const t=this.getNodeType(e);return e.generateArray(t,this.count,this.values)}}const iN=(...i)=>{let e;if(i.length===1){const t=i[0];e=new mR(null,t.length,t)}else{const t=i[0],n=i[1];e=new mR(t,n)}return it(e)};Ze("toArray",(i,e)=>iN(Array(e).fill(i)));class wY extends Zi{static get type(){return"AssignNode"}constructor(e,t){super(),this.targetNode=e,this.sourceNode=t}hasDependencies(){return!1}getNodeType(e,t){return t!=="void"?this.targetNode.getNodeType(e):"void"}needsSplitAssign(e){const{targetNode:t}=this;if(e.isAvailable("swizzleAssign")===!1&&t.isSplitNode&&t.components.length>1){const n=e.getTypeLength(t.node.getNodeType(e));return fh.join("").slice(0,n)!==t.components}return!1}generate(e,t){const{targetNode:n,sourceNode:r}=this,s=this.needsSplitAssign(e),o=n.getNodeType(e),a=n.context({assign:!0}).build(e),l=r.build(e,o),c=r.getNodeType(e),u=e.getDataFromNode(this);let p;if(u.initialized===!0)t!=="void"&&(p=a);else if(s){const m=e.getVarFromNode(this,null,o),g=e.getPropertyName(m);e.addLineFlowCode(`${g} = ${l}`,this);const v=n.node.context({assign:!0}).build(e);for(let b=0;b<n.components.length;b++){const M=n.components[b];e.addLineFlowCode(`${v}.${M} = ${g}[ ${b} ]`,this)}t!=="void"&&(p=a)}else p=`${a} = ${l}`,(t==="void"||c==="void")&&(e.addLineFlowCode(p,this),t!=="void"&&(p=a));return u.initialized=!0,e.format(p,o,t)}}const rN=rt(wY).setParameterLength(2);Ze("assign",rN);class TY extends Zi{static get type(){return"FunctionCallNode"}constructor(e=null,t={}){super(),this.functionNode=e,this.parameters=t}setParameters(e){return this.parameters=e,this}getParameters(){return this.parameters}getNodeType(e){return this.functionNode.getNodeType(e)}generate(e){const t=[],n=this.functionNode,r=n.getInputs(e),s=this.parameters,o=(l,c)=>{const u=c.type,p=u==="pointer";let m;return p?m="&"+l.build(e):m=l.build(e,u),m};if(Array.isArray(s)){if(s.length>r.length)console.error("THREE.TSL: The number of provided parameters exceeds the expected number of inputs in 'Fn()'."),s.length=r.length;else if(s.length<r.length)for(console.error("THREE.TSL: The number of provided parameters is less than the expected number of inputs in 'Fn()'.");s.length<r.length;)s.push(se(0));for(let l=0;l<s.length;l++)t.push(o(s[l],r[l]))}else for(const l of r){const c=s[l.name];c!==void 0?t.push(o(c,l)):(console.error(`THREE.TSL: Input '${l.name}' not found in 'Fn()'.`),t.push(o(se(0),l)))}return`${n.build(e,"property")}( ${t.join(", ")} )`}}const sN=(i,...e)=>(e=e.length>1||e[0]&&e[0].isNode===!0?$u(e):I0(e[0]),it(new TY(it(i),e)));Ze("call",sN);const EY={"==":"equal","!=":"notEqual","<":"lessThan",">":"greaterThan","<=":"lessThanEqual",">=":"greaterThanEqual","%":"mod"};class Bi extends Zi{static get type(){return"OperatorNode"}constructor(e,t,n,...r){if(super(),r.length>0){let s=new Bi(e,t,n);for(let o=0;o<r.length-1;o++)s=new Bi(e,s,r[o]);t=s,n=r[r.length-1]}this.op=e,this.aNode=t,this.bNode=n,this.isOperatorNode=!0}getOperatorMethod(e,t){return e.getMethod(EY[this.op],t)}getNodeType(e){const t=this.op,n=this.aNode,r=this.bNode,s=n.getNodeType(e),o=typeof r<"u"?r.getNodeType(e):null;if(s==="void"||o==="void")return"void";if(t==="%")return s;if(t==="~"||t==="&"||t==="|"||t==="^"||t===">>"||t==="<<")return e.getIntegerType(s);if(t==="!"||t==="&&"||t==="||"||t==="^^")return"bool";if(t==="=="||t==="!="||t==="<"||t===">"||t==="<="||t===">="){const a=Math.max(e.getTypeLength(s),e.getTypeLength(o));return a>1?`bvec${a}`:"bool"}else{if(e.isMatrix(s)){if(o==="float")return s;if(e.isVector(o))return e.getVectorFromMatrix(s);if(e.isMatrix(o))return s}else if(e.isMatrix(o)){if(s==="float")return o;if(e.isVector(s))return e.getVectorFromMatrix(o)}return e.getTypeLength(o)>e.getTypeLength(s)?o:s}}generate(e,t){const n=this.op,r=this.aNode,s=this.bNode,o=this.getNodeType(e);let a=null,l=null;o!=="void"?(a=r.getNodeType(e),l=typeof s<"u"?s.getNodeType(e):null,n==="<"||n===">"||n==="<="||n===">="||n==="=="||n==="!="?e.isVector(a)?l=a:e.isVector(l)?a=l:a!==l&&(a=l="float"):n===">>"||n==="<<"?(a=o,l=e.changeComponentType(l,"uint")):n==="%"?(a=o,l=e.isInteger(a)&&e.isInteger(l)?l:a):e.isMatrix(a)?l==="float"?l="float":e.isVector(l)?l=e.getVectorFromMatrix(a):e.isMatrix(l)||(a=l=o):e.isMatrix(l)?a==="float"?a="float":e.isVector(a)?a=e.getVectorFromMatrix(l):a=l=o:a=l=o):a=l=o;const c=r.build(e,a),u=typeof s<"u"?s.build(e,l):null,p=e.getFunctionOperator(n);if(t!=="void"){const m=e.renderer.coordinateSystem===Ms;if(n==="=="||n==="!="||n==="<"||n===">"||n==="<="||n===">=")return m?e.isVector(a)?e.format(`${this.getOperatorMethod(e,t)}( ${c}, ${u} )`,o,t):e.format(`( ${c} ${n} ${u} )`,o,t):e.format(`( ${c} ${n} ${u} )`,o,t);if(n==="%")return e.isInteger(l)?e.format(`( ${c} % ${u} )`,o,t):e.format(`${this.getOperatorMethod(e,o)}( ${c}, ${u} )`,o,t);if(n==="!"||n==="~")return e.format(`(${n}${c})`,a,t);if(p)return e.format(`${p}( ${c}, ${u} )`,o,t);if(e.isMatrix(a)&&l==="float")return e.format(`( ${u} ${n} ${c} )`,o,t);if(a==="float"&&e.isMatrix(l))return e.format(`${c} ${n} ${u}`,o,t);{let g=`( ${c} ${n} ${u} )`;return!m&&o==="bool"&&e.isVector(a)&&e.isVector(l)&&(g=`all${g}`),e.format(g,o,t)}}else if(a!=="void")return p?e.format(`${p}( ${c}, ${u} )`,o,t):e.isMatrix(a)&&l==="float"?e.format(`${u} ${n} ${c}`,o,t):e.format(`${c} ${n} ${u}`,o,t)}serialize(e){super.serialize(e),e.op=this.op}deserialize(e){super.deserialize(e),this.op=e.op}}const rr=rt(Bi,"+").setParameterLength(2,1/0).setName("add"),On=rt(Bi,"-").setParameterLength(2,1/0).setName("sub"),_n=rt(Bi,"*").setParameterLength(2,1/0).setName("mul"),_a=rt(Bi,"/").setParameterLength(2,1/0).setName("div"),F0=rt(Bi,"%").setParameterLength(2).setName("mod"),TM=rt(Bi,"==").setParameterLength(2).setName("equal"),oN=rt(Bi,"!=").setParameterLength(2).setName("notEqual"),aN=rt(Bi,"<").setParameterLength(2).setName("lessThan"),EM=rt(Bi,">").setParameterLength(2).setName("greaterThan"),lN=rt(Bi,"<=").setParameterLength(2).setName("lessThanEqual"),cN=rt(Bi,">=").setParameterLength(2).setName("greaterThanEqual"),uN=rt(Bi,"&&").setParameterLength(2,1/0).setName("and"),hN=rt(Bi,"||").setParameterLength(2,1/0).setName("or"),dN=rt(Bi,"!").setParameterLength(1).setName("not"),fN=rt(Bi,"^^").setParameterLength(2).setName("xor"),pN=rt(Bi,"&").setParameterLength(2).setName("bitAnd"),AN=rt(Bi,"~").setParameterLength(2).setName("bitNot"),mN=rt(Bi,"|").setParameterLength(2).setName("bitOr"),gN=rt(Bi,"^").setParameterLength(2).setName("bitXor"),_N=rt(Bi,"<<").setParameterLength(2).setName("shiftLeft"),vN=rt(Bi,">>").setParameterLength(2).setName("shiftRight"),yN=Ee(([i])=>(i.addAssign(1),i)),xN=Ee(([i])=>(i.subAssign(1),i)),bN=Ee(([i])=>{const e=me(i).toConst();return i.addAssign(1),e}),SN=Ee(([i])=>{const e=me(i).toConst();return i.subAssign(1),e});Ze("add",rr);Ze("sub",On);Ze("mul",_n);Ze("div",_a);Ze("mod",F0);Ze("equal",TM);Ze("notEqual",oN);Ze("lessThan",aN);Ze("greaterThan",EM);Ze("lessThanEqual",lN);Ze("greaterThanEqual",cN);Ze("and",uN);Ze("or",hN);Ze("not",dN);Ze("xor",fN);Ze("bitAnd",pN);Ze("bitNot",AN);Ze("bitOr",mN);Ze("bitXor",gN);Ze("shiftLeft",_N);Ze("shiftRight",vN);Ze("incrementBefore",yN);Ze("decrementBefore",xN);Ze("increment",bN);Ze("decrement",SN);const MN=(i,e)=>(console.warn('THREE.TSL: "remainder()" is deprecated. Use "mod( int( ... ) )" instead.'),F0(i,e)),wN=(i,e)=>(console.warn('THREE.TSL: "modInt()" is deprecated. Use "mod( int( ... ) )" instead.'),F0(me(i),me(e)));Ze("remainder",MN);Ze("modInt",wN);class Ne extends Zi{static get type(){return"MathNode"}constructor(e,t,n=null,r=null){if(super(),(e===Ne.MAX||e===Ne.MIN)&&arguments.length>3){let s=new Ne(e,t,n);for(let o=2;o<arguments.length-1;o++)s=new Ne(e,s,arguments[o]);t=s,n=arguments[arguments.length-1],r=null}this.method=e,this.aNode=t,this.bNode=n,this.cNode=r,this.isMathNode=!0}getInputType(e){const t=this.aNode.getNodeType(e),n=this.bNode?this.bNode.getNodeType(e):null,r=this.cNode?this.cNode.getNodeType(e):null,s=e.isMatrix(t)?0:e.getTypeLength(t),o=e.isMatrix(n)?0:e.getTypeLength(n),a=e.isMatrix(r)?0:e.getTypeLength(r);return s>o&&s>a?t:o>a?n:a>s?r:t}getNodeType(e){const t=this.method;return t===Ne.LENGTH||t===Ne.DISTANCE||t===Ne.DOT?"float":t===Ne.CROSS?"vec3":t===Ne.ALL||t===Ne.ANY?"bool":t===Ne.EQUALS?e.changeComponentType(this.aNode.getNodeType(e),"bool"):this.getInputType(e)}generate(e,t){let n=this.method;const r=this.getNodeType(e),s=this.getInputType(e),o=this.aNode,a=this.bNode,l=this.cNode,c=e.renderer.coordinateSystem;if(n===Ne.TRANSFORM_DIRECTION){let u=o,p=a;e.isMatrix(u.getNodeType(e))?p=jt(Se(p),0):u=jt(Se(u),0);const m=_n(u,p).xyz;return Vl(m).build(e,t)}else{if(n===Ne.NEGATE)return e.format("( - "+o.build(e,s)+" )",r,t);if(n===Ne.ONE_MINUS)return On(1,o).build(e,t);if(n===Ne.RECIPROCAL)return _a(1,o).build(e,t);if(n===Ne.DIFFERENCE)return gi(On(o,a)).build(e,t);{const u=[];return n===Ne.CROSS?u.push(o.build(e,r),a.build(e,r)):c===Ms&&n===Ne.STEP?u.push(o.build(e,e.getTypeLength(o.getNodeType(e))===1?"float":s),a.build(e,s)):c===Ms&&(n===Ne.MIN||n===Ne.MAX)?u.push(o.build(e,s),a.build(e,e.getTypeLength(a.getNodeType(e))===1?"float":s)):n===Ne.REFRACT?u.push(o.build(e,s),a.build(e,s),l.build(e,"float")):n===Ne.MIX?u.push(o.build(e,s),a.build(e,s),l.build(e,e.getTypeLength(l.getNodeType(e))===1?"float":s)):(c===Xa&&n===Ne.ATAN&&a!==null&&(n="atan2"),e.shaderStage!=="fragment"&&(n===Ne.DFDX||n===Ne.DFDY)&&(console.warn(`THREE.TSL: '${n}' is not supported in the ${e.shaderStage} stage.`),n="/*"+n+"*/"),u.push(o.build(e,s)),a!==null&&u.push(a.build(e,s)),l!==null&&u.push(l.build(e,s))),e.format(`${e.getMethod(n,r)}( ${u.join(", ")} )`,r,t)}}}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}Ne.ALL="all";Ne.ANY="any";
3843Ne.RADIANS="radians";Ne.DEGREES="degrees";Ne.EXP="exp";Ne.EXP2="exp2";Ne.LOG="log";Ne.LOG2="log2";Ne.SQRT="sqrt";Ne.INVERSE_SQRT="inversesqrt";Ne.FLOOR="floor";Ne.CEIL="ceil";Ne.NORMALIZE="normalize";Ne.FRACT="fract";Ne.SIN="sin";Ne.COS="cos";Ne.TAN="tan";Ne.ASIN="asin";Ne.ACOS="acos";Ne.ATAN="atan";Ne.ABS="abs";Ne.SIGN="sign";Ne.LENGTH="length";Ne.NEGATE="negate";Ne.ONE_MINUS="oneMinus";Ne.DFDX="dFdx";Ne.DFDY="dFdy";Ne.ROUND="round";Ne.RECIPROCAL="reciprocal";Ne.TRUNC="trunc";Ne.FWIDTH="fwidth";Ne.TRANSPOSE="transpose";Ne.BITCAST="bitcast";Ne.EQUALS="equals";Ne.MIN="min";Ne.MAX="max";Ne.STEP="step";Ne.REFLECT="reflect";Ne.DISTANCE="distance";Ne.DIFFERENCE="difference";Ne.DOT="dot";Ne.CROSS="cross";Ne.POW="pow";Ne.TRANSFORM_DIRECTION="transformDirection";Ne.MIX="mix";Ne.CLAMP="clamp";Ne.REFRACT="refract";Ne.SMOOTHSTEP="smoothstep";Ne.FACEFORWARD="faceforward";const TN=se(1e-6),RY=se(1e6),a1=se(Math.PI),CY=se(Math.PI*2),EN=rt(Ne,Ne.ALL).setParameterLength(1),RN=rt(Ne,Ne.ANY).setParameterLength(1),CN=rt(Ne,Ne.RADIANS).setParameterLength(1),PN=rt(Ne,Ne.DEGREES).setParameterLength(1),RM=rt(Ne,Ne.EXP).setParameterLength(1),Cf=rt(Ne,Ne.EXP2).setParameterLength(1),Y1=rt(Ne,Ne.LOG).setParameterLength(1),Ha=rt(Ne,Ne.LOG2).setParameterLength(1),ol=rt(Ne,Ne.SQRT).setParameterLength(1),CM=rt(Ne,Ne.INVERSE_SQRT).setParameterLength(1),Wa=rt(Ne,Ne.FLOOR).setParameterLength(1),Q1=rt(Ne,Ne.CEIL).setParameterLength(1),Vl=rt(Ne,Ne.NORMALIZE).setParameterLength(1),$l=rt(Ne,Ne.FRACT).setParameterLength(1),go=rt(Ne,Ne.SIN).setParameterLength(1),Ml=rt(Ne,Ne.COS).setParameterLength(1),LN=rt(Ne,Ne.TAN).setParameterLength(1),NN=rt(Ne,Ne.ASIN).setParameterLength(1),DN=rt(Ne,Ne.ACOS).setParameterLength(1),PM=rt(Ne,Ne.ATAN).setParameterLength(1,2),gi=rt(Ne,Ne.ABS).setParameterLength(1),f0=rt(Ne,Ne.SIGN).setParameterLength(1),Bl=rt(Ne,Ne.LENGTH).setParameterLength(1),IN=rt(Ne,Ne.NEGATE).setParameterLength(1),BN=rt(Ne,Ne.ONE_MINUS).setParameterLength(1),LM=rt(Ne,Ne.DFDX).setParameterLength(1),NM=rt(Ne,Ne.DFDY).setParameterLength(1),FN=rt(Ne,Ne.ROUND).setParameterLength(1),UN=rt(Ne,Ne.RECIPROCAL).setParameterLength(1),DM=rt(Ne,Ne.TRUNC).setParameterLength(1),ON=rt(Ne,Ne.FWIDTH).setParameterLength(1),kN=rt(Ne,Ne.TRANSPOSE).setParameterLength(1),PY=rt(Ne,Ne.BITCAST).setParameterLength(2),zN=(i,e)=>(console.warn('THREE.TSL: "equals" is deprecated. Use "equal" inside a vector instead, like: "bvec*( equal( ... ) )"'),TM(i,e)),Qs=rt(Ne,Ne.MIN).setParameterLength(2,1/0),Qi=rt(Ne,Ne.MAX).setParameterLength(2,1/0),Z1=rt(Ne,Ne.STEP).setParameterLength(2),VN=rt(Ne,Ne.REFLECT).setParameterLength(2),GN=rt(Ne,Ne.DISTANCE).setParameterLength(2),qN=rt(Ne,Ne.DIFFERENCE).setParameterLength(2),Qc=rt(Ne,Ne.DOT).setParameterLength(2),K1=rt(Ne,Ne.CROSS).setParameterLength(2),ua=rt(Ne,Ne.POW).setParameterLength(2),IM=rt(Ne,Ne.POW,2).setParameterLength(1),HN=rt(Ne,Ne.POW,3).setParameterLength(1),WN=rt(Ne,Ne.POW,4).setParameterLength(1),$N=rt(Ne,Ne.TRANSFORM_DIRECTION).setParameterLength(2),jN=i=>_n(f0(i),ua(gi(i),1/3)),BM=i=>Qc(i,i),Qn=rt(Ne,Ne.MIX).setParameterLength(3),Qa=(i,e=0,t=1)=>it(new Ne(Ne.CLAMP,it(i),it(e),it(t))),XN=i=>Qa(i),FM=rt(Ne,Ne.REFRACT).setParameterLength(3),Za=rt(Ne,Ne.SMOOTHSTEP).setParameterLength(3),UM=rt(Ne,Ne.FACEFORWARD).setParameterLength(3),YN=Ee(([i])=>{const n=43758.5453,r=Qc(i.xy,dt(12.9898,78.233)),s=F0(r,a1);return $l(go(s).mul(n))}),QN=(i,e,t)=>Qn(e,t,i),ZN=(i,e,t)=>Za(e,t,i),KN=(i,e)=>(console.warn('THREE.TSL: "atan2" is overloaded. Use "atan" instead.'),PM(i,e)),LY=UM,NY=CM;Ze("all",EN);Ze("any",RN);Ze("equals",zN);Ze("radians",CN);Ze("degrees",PN);Ze("exp",RM);Ze("exp2",Cf);Ze("log",Y1);Ze("log2",Ha);Ze("sqrt",ol);Ze("inverseSqrt",CM);Ze("floor",Wa);Ze("ceil",Q1);Ze("normalize",Vl);Ze("fract",$l);Ze("sin",go);Ze("cos",Ml);Ze("tan",LN);Ze("asin",NN);Ze("acos",DN);Ze("atan",PM);Ze("abs",gi);Ze("sign",f0);Ze("length",Bl);Ze("lengthSq",BM);Ze("negate",IN);Ze("oneMinus",BN);Ze("dFdx",LM);Ze("dFdy",NM);Ze("round",FN);Ze("reciprocal",UN);Ze("trunc",DM);Ze("fwidth",ON);Ze("atan2",KN);Ze("min",Qs);Ze("max",Qi);Ze("step",Z1);Ze("reflect",VN);Ze("distance",GN);Ze("dot",Qc);Ze("cross",K1);Ze("pow",ua);Ze("pow2",IM);Ze("pow3",HN);Ze("pow4",WN);
3843Ze("transformDirection",$N);Ze("mix",QN);Ze("clamp",Qa);Ze("refract",FM);Ze("smoothstep",ZN);Ze("faceForward",UM);Ze("difference",qN);Ze("saturate",XN);Ze("cbrt",jN);Ze("transpose",kN);Ze("rand",YN);class DY extends Qt{static get type(){return"ConditionalNode"}constructor(e,t,n=null){super(),this.condNode=e,this.ifNode=t,this.elseNode=n}getNodeType(e){const{ifNode:t,elseNode:n}=e.getNodeProperties(this);if(t===void 0)return this.setup(e),this.getNodeType(e);const r=t.getNodeType(e);if(n!==null){const s=n.getNodeType(e);if(e.getTypeLength(s)>e.getTypeLength(r))return s}return r}setup(e){const t=this.condNode.cache(),n=this.ifNode.cache(),r=this.elseNode?this.elseNode.cache():null,s=e.context.nodeBlock;e.getDataFromNode(n).parentNodeBlock=s,r!==null&&(e.getDataFromNode(r).parentNodeBlock=s);const o=e.getNodeProperties(this);o.condNode=t,o.ifNode=n.context({nodeBlock:n}),o.elseNode=r?r.context({nodeBlock:r}):null}generate(e,t){const n=this.getNodeType(e),r=e.getDataFromNode(this);if(r.nodeProperty!==void 0)return r.nodeProperty;const{condNode:s,ifNode:o,elseNode:a}=e.getNodeProperties(this),l=e.currentFunctionNode,c=t!=="void",u=c?Yf(n).build(e):"";r.nodeProperty=u;const p=s.build(e,"bool");e.addFlowCode(`
3844${e.tab}if ( ${p} ) {
3845
3846`).addFlowTab();let m=o.build(e,n);if(m&&(c?m=u+" = "+m+";":(m="return "+m+";",l===null&&(console.warn("THREE.TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values."),m="// "+m))),e.removeFlowTab().addFlowCode(e.tab+"	"+m+`
3847
3848`+e.tab+"}"),a!==null){e.addFlowCode(` else {
3849
3850`).addFlowTab();let g=a.build(e,n);g&&(c?g=u+" = "+g+";":(g="return "+g+";",l===null&&(console.warn("THREE.TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values."),g="// "+g))),e.removeFlowTab().addFlowCode(e.tab+"	"+g+`
3851
3852`+e.tab+`}
3853
3854`)}else e.addFlowCode(`
3855
3856`);return e.format(u,n,t)}}const Ur=rt(DY).setParameterLength(2,3);Ze("select",Ur);const JN=(...i)=>(console.warn("THREE.TSL: cond() has been renamed to select()."),Ur(...i));Ze("cond",JN);class e8 extends Qt{static get type(){return"ContextNode"}constructor(e,t={}){super(),this.isContextNode=!0,this.node=e,this.value=t}getScope(){return this.node.getScope()}getNodeType(e){return this.node.getNodeType(e)}analyze(e){this.node.build(e)}setup(e){const t=e.getContext();e.setContext({...e.context,...this.value});const n=this.node.build(e);return e.setContext(t),n}generate(e,t){const n=e.getContext();e.setContext({...e.context,...this.value});const r=this.node.build(e,t);return e.setContext(n),r}}const J1=rt(e8).setParameterLength(1,2),t8=(i,e)=>J1(i,{label:e});Ze("context",J1);Ze("label",t8);class m_ extends Qt{static get type(){return"VarNode"}constructor(e,t=null,n=!1){super(),this.node=e,this.name=t,this.global=!0,this.isVarNode=!0,this.readOnly=n}getMemberType(e,t){return this.node.getMemberType(e,t)}getElementType(e){return this.node.getElementType(e)}getNodeType(e){return this.node.getNodeType(e)}generate(e){const{node:t,name:n,readOnly:r}=this,{renderer:s}=e,o=s.backend.isWebGPUBackend===!0;let a=!1,l=!1;r&&(a=e.isDeterministic(t),l=o?r:a);const c=e.getVectorType(this.getNodeType(e)),u=t.build(e,c),p=e.getVarFromNode(this,n,c,void 0,l),m=e.getPropertyName(p);let g=m;if(l)if(o)g=a?`const ${m}`:`let ${m}`;else{const v=e.getArrayCount(t);g=`const ${e.getVar(p.type,m,v)}`}return e.addLineFlowCode(`${g} = ${u}`,this),m}}const OM=rt(m_),n8=(i,e=null)=>OM(i,e).toStack(),i8=(i,e=null)=>OM(i,e,!0).toStack();Ze("toVar",n8);Ze("toConst",i8);const r8=i=>(console.warn('TSL: "temp( node )" is deprecated. Use "Var( node )" or "node.toVar()" instead.'),OM(i));Ze("temp",r8);class IY extends Qt{static get type(){return"VaryingNode"}constructor(e,t=null){super(),this.node=e,this.name=t,this.isVaryingNode=!0,this.interpolationType=null,this.interpolationSampling=null}isGlobal(){return!0}setInterpolation(e,t=null){return this.interpolationType=e,this.interpolationSampling=t,this}getHash(e){return this.name||super.getHash(e)}getNodeType(e){return this.node.getNodeType(e)}setupVarying(e){const t=e.getNodeProperties(this);let n=t.varying;if(n===void 0){const r=this.name,s=this.getNodeType(e),o=this.interpolationType,a=this.interpolationSampling;t.varying=n=e.getVaryingFromNode(this,r,s,o,a),t.node=this.node}return n.needsInterpolation||(n.needsInterpolation=e.shaderStage==="fragment"),n}setup(e){this.setupVarying(e)}analyze(e){return this.setupVarying(e),this.node.analyze(e)}generate(e){const t=e.getNodeProperties(this),n=this.setupVarying(e),r=e.shaderStage==="fragment"&&t.reassignPosition===!0&&e.context.needsPositionReassign;if(t.propertyName===void 0||r){const s=this.getNodeType(e),o=e.getPropertyName(n,vb.VERTEX);e.flowNodeFromShaderStage(vb.VERTEX,this.node,s,o),t.propertyName=o,r?t.reassignPosition=!1:t.reassignPosition===void 0&&e.context.
3856isPositionNodeInput&&(t.reassignPosition=!0)}return e.getPropertyName(n)}}const Mo=rt(IY).setParameterLength(1,2),s8=i=>Mo(i);Ze("toVarying",Mo);Ze("toVertexStage",s8);Ze("varying",(...i)=>(console.warn("THREE.TSL: .varying() has been renamed to .toVarying()."),Mo(...i)));Ze("vertexStage",(...i)=>(console.warn("THREE.TSL: .vertexStage() has been renamed to .toVertexStage()."),Mo(...i)));const o8=Ee(([i])=>{const e=i.mul(.9478672986).add(.0521327014).pow(2.4),t=i.mul(.0773993808),n=i.lessThanEqual(.04045);return Qn(e,t,n)}).setLayout({name:"sRGBTransferEOTF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),a8=Ee(([i])=>{const e=i.pow(.41666).mul(1.055).sub(.055),t=i.mul(12.92),n=i.lessThanEqual(.0031308);return Qn(e,t,n)}).setLayout({name:"sRGBTransferOETF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),U0="WorkingColorSpace",kM="OutputColorSpace";class O0 extends Zi{static get type(){return"ColorSpaceNode"}constructor(e,t,n){super("vec4"),this.colorNode=e,this.source=t,this.target=n}resolveColorSpace(e,t){return t===U0?En.workingColorSpace:t===kM?e.context.outputColorSpace||e.renderer.outputColorSpace:t}setup(e){const{colorNode:t}=this,n=this.resolveColorSpace(e,this.source),r=this.resolveColorSpace(e,this.target);let s=t;return En.enabled===!1||n===r||!n||!r||(En.getTransfer(n)===ei&&(s=jt(o8(s.rgb),s.a)),En.getPrimaries(n)!==En.getPrimaries(r)&&(s=jt(hs(En._getMatrix(new Sn,n,r)).mul(s.rgb),s.a)),En.getTransfer(r)===ei&&(s=jt(a8(s.rgb),s.a))),s}}const l8=i=>it(new O0(it(i),U0,kM)),c8=i=>it(new O0(it(i),kM,U0)),u8=(i,e)=>it(new O0(it(i),U0,e)),ev=(i,e)=>it(new O0(it(i),e,U0)),BY=(i,e,t)=>it(new O0(it(i),e,t));Ze("toOutputColorSpace",l8);Ze("toWorkingColorSpace",c8);Ze("workingToColorSpace",u8);Ze("colorSpaceToWorking",ev);let FY=class extends ph{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),n=this.referenceNode.getNodeType(),r=this.getNodeType();return e.format(t,n,r)}};class h8 extends Qt{static get type(){return"ReferenceBaseNode"}constructor(e,t,n=null,r=null){super(),this.property=e,this.uniformType=t,this.object=n,this.count=r,this.properties=e.split("."),this.reference=n,this.node=null,this.group=null,this.updateType=gn.OBJECT}setGroup(e){return this.group=e,this}element(e){return it(new FY(this,it(e)))}setNodeType(e){const t=$t(null,e).getSelf();this.group!==null&&t.setGroup(this.group),this.node=t}getNodeType(e){return this.node===null&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let n=e[t[0]];for(let r=1;r<t.length;r++)n=n[t[r]];return n}updateReference(e){return this.reference=this.object!==null?this.object:e.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){this.node===null&&this.setNodeType(this.uniformType);const e=this.getValueFromReference();Array.isArray(e)?this.node.array=e:this.node.value=e}}const UY=(i,e,t)=>it(new h8(i,e,t));class OY extends h8{static get type(){return"RendererReferenceNode"}constructor(e,t,n=null){super(e,t,n),this.renderer=n,this.setGroup(Zt)}updateReference(e){return this.reference=this.renderer!==null?this.renderer:e.renderer,this.reference}}const d8=(i,e,t=null)=>it(new OY(i,e,t));class kY extends Zi{static get type(){return"ToneMappingNode"}constructor(e,t=p8,n=null){super("vec3"),this.toneMapping=e,this.exposureNode=t,this.colorNode=n}customCacheKey(){return o0(this.toneMapping)}setup(e){const t=this.colorNode||e.context.color,n=this.toneMapping;if(n===Ws)return t;let r=null;const s=e.renderer.library.getToneMappingFunction(n);return s!==null?r=jt(s(t.rgb,this.exposureNode),t.a):(console.error("ToneMappingNode: Unsupported Tone Mapping configuration.",n),r=t),r}}const f8=(i,e,t)=>it(new kY(i,it(e),it(t))),p8=d8("toneMappingExposure","float");Ze("toneMapping",(i,e,t)=>f8(e,t,i));class zY extends fM{static get type(){return"BufferAttributeNode"}constructor(e,t=null,n=0,r=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferStride=n,this.bufferOffset=r,this.usage=k_,this.instanced=!1,this.attribute=null,this.global=!0,e&&e.isBufferAttribute===!0&&(this.attribute=e,this.usage=e.usage,this.instanced=e.isInstancedBufferAttribute)}getHash(e){if(this.bufferStride===0&&this.bufferOffset===0){let t=e.globalCache.getData(this.value);return t===void 0&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getNodeType(e){return this.bufferType===null&&(this.bufferType=e.getTypeFromAttribute(this.attribute)),this.bufferType}setup(e){if(this.attribute!==null)return;const t=this.getNodeType(e),n=this.value,r=e.getTypeLength(t),s=this.bufferStride||r,o=this.bufferOffset,a=n.isInterleavedBuffer===!0?n:new WS(n,s),l=new Rc(a,r,o);a.setUsage(this.usage),this.attribute=l,this.attribute.isInstancedBufferAttribute=this.instanced}generate(e){const t=this.getNodeType(e),n=e.getBufferAttributeFromNode(this,t),r=e.getPropertyName(n);let s=null;return e.shaderStage==="vertex"||e.shaderStage==="compute"?(this.name=r,s=r):s=Mo(this).build(e,t),s}getInputType(){return"bufferAttribute"}setUsage(e){return this.usage=e,this.attribute&&this.attribute.isBufferAttribute===!0&&(this.attribute.usage=e),this}setInstanced(e){return this.instanced=e,this}}const k0=(i,e=null,t=0,n=0)=>it(new zY(i,e,t,n)),A8=(i,e=null,t=0,n=0)=>k0(i,e,t,n).setUsage(Ld),l1=(i,e=null,t=0,n=0)=>k0(i,e,t,n).setInstanced(!0),Tb=(i,e=null,t=0,n=0)=>A8(i,e,t,n).setInstanced(!0);Ze("toAttribute",i=>k0(i.value));class VY extends Qt{static get type(){return"ComputeNode"}constructor(e,t,n=[64]){super("void"),this.isComputeNode=!0,this.computeNode=e,this.count=t,this.workgroupSize=n,this.dispatchCount=0,this.version=1,this.name="",this.updateBeforeType=gn.OBJECT,this.onInitFunction=null,this.updateDispatchCount()}dispose(){this.dispatchEvent({type:"dispose"})}label(e){return this.name=e,this}updateDispatchCount(){const{count:e,workgroupSize:t}=this;let n=t[0];for(let r=1;r<t.length;r++)n*=t[r];this.dispatchCount=Math.ceil(e/n)}onInit(e){return this.onInitFunction=e,this}updateBefore({renderer:e}){e.compute(this)}setup(e){const t=this.computeNode.build(e);if(t){const n=e.getNodeProperties(this);n.outputComputeNode=t.outputNode,t.outputNode=null}return t}generate(e,t){const{shaderStage:n}=e;if(n==="compute"){const r=this.computeNode.build(e,"void");r!==""&&e.addLineFlowCode(r,this)}else{const s=e.getNodeProperties(this).outputComputeNode;if(s)return s.build(e,t)}}}const m8=(i,e,t)=>it(new VY(it(i),e,t));Ze("compute",m8);class GY extends Qt{static get type(){return"CacheNode"}constructor(e,t=!0){super(),this.node=e,this.parent=t,this.isCacheNo
3856de=!0}getNodeType(e){const t=e.getCache(),n=e.getCacheFromNode(this,this.parent);e.setCache(n);const r=this.node.getNodeType(e);return e.setCache(t),r}build(e,...t){const n=e.getCache(),r=e.getCacheFromNode(this,this.parent);e.setCache(r);const s=this.node.build(e,...t);return e.setCache(n),s}}const MA=(i,e)=>it(new GY(it(i),e));Ze("cache",MA);class qY extends Qt{static get type(){return"BypassNode"}constructor(e,t){super(),this.isBypassNode=!0,this.outputNode=e,this.callNode=t}getNodeType(e){return this.outputNode.getNodeType(e)}generate(e){const t=this.callNode.build(e,"void");return t!==""&&e.addLineFlowCode(t,this),this.outputNode.build(e)}}const g8=rt(qY).setParameterLength(2);Ze("bypass",g8);class _8 extends Qt{static get type(){return"RemapNode"}constructor(e,t,n,r=se(0),s=se(1)){super(),this.node=e,this.inLowNode=t,this.inHighNode=n,this.outLowNode=r,this.outHighNode=s,this.doClamp=!0}setup(){const{node:e,inLowNode:t,inHighNode:n,outLowNode:r,outHighNode:s,doClamp:o}=this;let a=e.sub(t).div(n.sub(t));return o===!0&&(a=a.clamp()),a.mul(s.sub(r)).add(r)}}const v8=rt(_8,null,null,{doClamp:!1}).setParameterLength(3,5),y8=rt(_8).setParameterLength(3,5);Ze("remap",v8);Ze("remapClamp",y8);class g_ extends Qt{static get type(){return"ExpressionNode"}constructor(e="",t="void"){super(t),this.snippet=e}generate(e,t){const n=this.getNodeType(e),r=this.snippet;if(n==="void")e.addLineFlowCode(r,this);else return e.format(r,n,t)}}const Gl=rt(g_).setParameterLength(1,2),x8=i=>(i?Ur(i,Gl("discard")):Gl("discard")).toStack(),HY=()=>Gl("return").toStack();Ze("discard",x8);class WY extends Zi{static get type(){return"RenderOutputNode"}constructor(e,t,n){super("vec4"),this.colorNode=e,this.toneMapping=t,this.outputColorSpace=n,this.isRenderOutputNode=!0}setup({context:e}){let t=this.colorNode||e.color;const n=(this.toneMapping!==null?this.toneMapping:e.toneMapping)||Ws,r=(this.outputColorSpace!==null?this.outputColorSpace:e.outputColorSpace)||vo;return n!==Ws&&(t=t.toneMapping(n)),r!==vo&&r!==En.workingColorSpace&&(t=t.workingToColorSpace(r)),t}}const b8=(i,e=null,t=null)=>it(new WY(it(i),e,t));Ze("renderOutput",b8);class $Y extends Zi{static get type(){return"DebugNode"}constructor(e,t=null){super(),this.node=e,this.callback=t}getNodeType(e){return this.node.getNodeType(e)}setup(e){return this.node.build(e)}analyze(e){return this.node.build(e)}generate(e){const t=this.callback,n=this.node.build(e),r="--- TSL debug - "+e.shaderStage+" shader ---",s="-".repeat(r.length);let o="";return o+="// #"+r+`#
3857`,o+=e.flow.code.replace(/^\t/mg,"")+`
3858`,o+="/* ... */ "+n+` /* ... */
3859`,o+="// #"+s+`#
3860`,t!==null?t(e,o):console.log(o),n}}const S8=(i,e=null)=>it(new $Y(it(i),e));Ze("debug",S8);function jY(i){console.warn("THREE.TSL: AddNodeElement has been removed in favor of tree-shaking. Trying add",i)}class M8 extends Qt{static get type(){return"AttributeNode"}constructor(e,t=null){super(t),this.global=!0,this._attributeName=e}getHash(e){return this.getAttributeName(e)}getNodeType(e){let t=this.nodeType;if(t===null){const n=this.getAttributeName(e);if(e.hasGeometryAttribute(n)){const r=e.geometry.getAttribute(n);t=e.getTypeFromAttribute(r)}else t="float"}return t}setAttributeName(e){return this._attributeName=e,this}getAttributeName(){return this._attributeName}generate(e){const t=this.getAttributeName(e),n=this.getNodeType(e);if(e.hasGeometryAttribute(t)===!0){const s=e.geometry.getAttribute(t),o=e.getTypeFromAttribute(s),a=e.getAttribute(t,o);return e.shaderStage==="vertex"?e.format(a.name,o,n):Mo(this).build(e,n)}else return console.warn(`AttributeNode: Vertex attribute "${t}" not found on geometry.`),e.generateConst(n)}serialize(e){super.serialize(e),e.global=this.global,e._attributeName=this._attributeName}deserialize(e){super.deserialize(e),this.global=e.global,this._attributeName=e._attributeName}}const ql=(i,e=null)=>it(new M8(i,e)),Ci=(i=0)=>ql("uv"+(i>0?i:""),"vec2");class XY extends Qt{static get type(){return"TextureSizeNode"}constructor(e,t=null){super("uvec2"),this.isTextureSizeNode=!0,this.textureNode=e,this.levelNode=t}generate(e,t){const n=this.textureNode.build(e,"property"),r=this.levelNode===null?"0":this.levelNode.build(e,"int");return e.format(`${e.getMethod("textureDimensions")}( ${n}, ${r} )`,this.getNodeType(e),t)}}const Bc=rt(XY).setParameterLength(1,2);class YY extends B0{static get type(){return"MaxMipLevelNode"}constructor(e){super(0),this._textureNode=e,this.updateType=gn.FRAME}get textureNode(){return this._textureNode}get texture(){return this._textureNode.value}update(){const e=this.texture,t=e.images,n=t&&t.length>0?t[0]&&t[0].image||t[0]:e.image;if(n&&n.width!==void 0){const{width:r,height:s}=n;this.value=Math.log2(Math.max(r,s))}}}const w8=rt(YY).setParameterLength(1);class Ka extends B0{static get type(){return"TextureNode"}constructor(e,t=null,n=null,r=null){super(e),this.isTextureNode=!0,this.uvNode=t,this.levelNode=n,this.biasNode=r,this.compareNode=null,this.depthNode=null,this.gradNode=null,this.sampler=!0,this.updateMatrix=!1,this.updateType=gn.NONE,this.referenceNode=null,this._value=e,this._matrixUniform=null,this.setUpdateMatrix(t===null)}set value(e){this.referenceNode?this.referenceNode.value=e:this._value=e}get value(){return this.referenceNode?this.referenceNode.value:this._value}getUniformHash(){return this.value.uuid}getNodeType(){return this.value.isDepthTexture===!0?"float":this.value.type===mi?"uvec4":this.value.type===Ir?"ivec4":"vec4"}getInputType(){return"texture"}getDefaultUV(){return Ci(this.value.channel)}updateReference(){return this.value}getTransformedUV(e){return this._matrixUniform===null&&(this._matrixUniform=$t(this.value.matrix)),this._matrixUniform.mul(Se(e,1)).xy}setUpdateMatrix(e){return this.updateMatrix=e,this.updateType=e?gn.OBJECT:gn.NONE,this}setupUV(e,t){const n=this.value;return e.isFlipY()&&(n.image instanceof ImageBitmap&&n.flipY===!0||n.isRenderTargetTexture===!0||n.isFramebufferTexture===!0||n.isDepthTexture===!0)&&(this.sampler?t=t.flipY():t=t.setY(me(Bc(this,this.levelNode).y).sub(t.y).sub(1))),t}setup(e){const t=e.getNodeProperties(this);t.referenceNode=this.referenceNode;const n=this.value;if(!n||n.isTexture!==!0)throw new Error("THREE.TSL: `texture( value )` function expects a valid instance of THREE.Texture().");let r=this.uvNode;(r===null||e.context.forceUVContext===!0)&&e.context.getUV&&(r=e.context.getUV(this,e)),r||(r=this.getDefaultUV()),this.updateMatrix===!0&&(r=this.getTransformedUV(r)),r=this.setupUV(e,r);let s=this.levelNode;s===null&&e.context.getTextureLevel&&(s=e.context.getTextureLevel(this)),t.uvNode=r,t.levelNode=s,t.biasNode=this.biasNode,t.compareNode=this.compareNode,t.gradNode=this.gradNode,t.depthNode=this.depthNode}generateUV(e,t){return t.build(e,this.sampler===!0?"vec2":"ivec2")}generateSnippet(e,t,n,r,s,o,a,l){const c=this.value;let u;return r?u=e.generateTextureLevel(c,t,n,r,o):s?u=e.generateTextureBias(c,t,n,s,o):l?u=e.generateTextureGrad(c,t,n,l,o):a?u=e.generateTextureCompare(c,t,n,a,o):this.sampler===!1?u=e.generateTextureLoad(c,t,n,o):u=e.generateTexture(c,t,n,o),u}generate(e,t){const n=this.value,r=e.getNodeProperties(this),s=super.generate(e,"property");if(/^sampler/.test(t))return s+"_sampler";if(e.isReference(t))return s;{const o=e.getDataFromNode(this);let a=o.propertyName;if(a===void 0){const{uvNode:u,levelNode:p,biasNode:m,compareNode:g,depthNode:v,gradNode:b}=r,M=this.generateUV(e,u),x=p?p.build(e,"float"):null,w=m?m.build(e,"float"):null,R=v?v.build(e,"int"):null,C=g?g.build(e,"float"):null,N=b?[b[0].build(e,"vec2"),b[1].build(e,"vec2")]:null,D=e.getVarFromNode(this);a=e.getPropertyName(D);const P=this.generateSnippet(e,s,M,x,w,R,C,N);e.addLineFlowCode(`${a} = ${P}`,this),o.snippet=P,o.propertyName=a}let l=a;const c=this.getNodeType(e);return e.needsToWorkingColorSpace(n)&&(l=ev(Gl(l,c),n.colorSpace).setup(e).build(e,c)),e.format(l,c,t)}}setSampler(e){return this.sampler=e,this}getSampler(){return this.sampler}uv(e){return console.warn("THREE.TextureNode: .uv() has been renamed. Use .sample() instead."),this.sample(e)}sample(e){const t=this.clone();return t.uvNode=it(e),t.referenceNode=this.getSelf(),it(t)}blur(e){const t=this.clone();t.biasNode=it(e).mul(w8(t)),t.referenceNode=this.getSelf();const n=t.value;return t.generateMipmaps===!1&&(n&&n.generateMipmaps===!1||n.minFilter===xi||n.magFilter===xi)&&(console.warn("THREE.TSL: texture().blur() requires mipmaps and sampling. Use .generateMipmaps=true and .minFilter/.magFilter=THREE.LinearFilter in the Texture."),t.biasNode=null),it(t)}level(e){const t=this.clone();return t.levelNode=it(e),t.referenceNode=this.getSelf(),it(t)}size(e){return Bc(this,e)}bias(e){const t=this.clone();return t.biasNode=it(e),t.referenceNode=this.getSelf(),it(t)}compare(e){const t=this.clone();return t.compareNode=it(e),t.referenceNode=this.getSelf(),it(t)}grad(e,t){const n=this.clone();return n.gradNode=[it(e),it(t)],n.referenceNode=this.getSelf(),it(n)}depth(e){const t=this.clone();return t.depthNode=it(e),t.referenceNode=this.getSelf(),it(t)}serialize(e){super.serialize(e),e.value=this.value.toJSON(e.meta).uuid,e.sampler=this.sampler,e.updateMatrix=this.updateMatrix,e.updateType=this.updateType}deserialize(e){super.deserialize(e),this.value=e.meta.textures[e.value],this.sampler=e.sampler,this.updateMatrix=e.updateMatrix,this.updateType=e.updateType}update(){const e=this.value,t=this._matrixUniform;t!==null&&(t.value=e.matrix),e.matrixAutoUpdate===!0&&e.updateMatrix()}clone(){const e=new this.constructor(this.value,this.uvNode,this.levelNode,this.biasNode);return e.sampler=this.sampler,e.depthNode=this.depthNode,e.compareNode=this.compareNode,e.gradNode=this.gradNode,e}}const Ln=rt(Ka).setParameterLength(1,4),$i=(...i)=>Ln(...i).setSampler(!1),QY=i=>(i.isNode===!0?i:Ln(i)).convert("sampler"),ZY=i=>(i.isNode===!0?i:Ln(i)).convert("samplerComparison");class zM extends B0{static get type(){return"BufferNode"}constructor(e,t,n=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferCount=n}getElementType(e){return this.getNodeType(e)}getInputType(){return"buffer"}}const z0=(i,e,t)=>it(new zM(i,e,t));class KY extends ph{static get type(){return"UniformArrayElementNode"}constructor(e,t){super(e,t),this.isArrayBufferElementNode=!0}generate(e){const t=super.generate(e),n=this.getNodeType(),r=this.node.getPaddedType();return e.format(t,r,n)}}class T8 extends zM{static get type(){return"UniformArrayNode"}constructor(e,t=null){super(null),this.array=e,this.elementType=t===null?Cc(e[0]):t,this.paddedType=this.getPaddedType(),this.updateType=gn.RENDER,this.isArrayBufferNode=!0}getNodeType(){return this.paddedType}getElementType(){return this.elementType}getPaddedType(){const e=this.elementType;let t="vec4";return e==="mat2"?t="mat2":/mat/.test(e)===!0?t="mat4":e.charAt(0)==="i"?t="ivec4":e.charAt(0)==="u"&&(t="uvec4"),t}update(){const{array:e,value:t}=this,n=this.elementType;if(n==="float"||n==="int"||n==="uint")for(let r=0;r<e.length;r++){const s=r*4;t[s]=e[r]}else if(n==="color")for(let r=0;r<e.length;r++){const s=r*4,o=e[r];t[s]=o.r,t[s+1]=o.g,t[s+2]=o.b||0}else if(n==="mat2")for(let r=0;r<e.length;r++){const s=r*4,o=e[r];t[s]=o.elements[0],t[s+1]=o.elements[1],t[s+2]=o.elements[2],t[s+3]=o.elements[3]}else if(n==="mat3")for(let r=0;r<e.length;r++){const s=r*16,o=e[r];t[s]=o.elements[0],t[s+1]=o.elements[1],t[s+2]=o.elements[2],t[s+4]=o.elements[3],t[s+5]=o.elements[4],t[s+6]=o.elements[5],t[s+8]=o.elements[6],t[s+9]=o.elements[7],t[s+10]=o.elements[8],t[s+1
38605]=1}else if(n==="mat4")for(let r=0;r<e.length;r++){const s=r*16,o=e[r];for(let a=0;a<o.elements.length;a++)t[s+a]=o.elements[a]}else for(let r=0;r<e.length;r++){const s=r*4,o=e[r];t[s]=o.x,t[s+1]=o.y,t[s+2]=o.z||0,t[s+3]=o.w||0}}setup(e){const t=this.array.length,n=this.elementType;let r=Float32Array;const s=this.paddedType,o=e.getTypeLength(s);return n.charAt(0)==="i"&&(r=Int32Array),n.charAt(0)==="u"&&(r=Uint32Array),this.value=new r(t*o),this.bufferCount=t,this.bufferType=s,super.setup(e)}element(e){return it(new KY(this,it(e)))}}const Fo=(i,e)=>it(new T8(i,e)),JY=(i,e)=>(console.warn("THREE.TSL: uniforms() has been renamed to uniformArray()."),it(new T8(i,e)));class eQ extends Qt{constructor(e){super("float"),this.name=e,this.isBuiltinNode=!0}generate(){return this.name}}const V0=rt(eQ).setParameterLength(1),tv=$t(0,"uint").label("u_cameraIndex").setGroup(X1("cameraIndex")).toVarying("v_cameraIndex"),Mc=$t("float").label("cameraNear").setGroup(Zt).onRenderUpdate(({camera:i})=>i.near),wc=$t("float").label("cameraFar").setGroup(Zt).onRenderUpdate(({camera:i})=>i.far),Ah=Ee(({camera:i})=>{let e;if(i.isArrayCamera&&i.cameras.length>0){const t=[];for(const r of i.cameras)t.push(r.projectionMatrix);e=Fo(t).setGroup(Zt).label("cameraProjectionMatrices").element(i.isMultiViewCamera?V0("gl_ViewID_OVR"):tv).toVar("cameraProjectionMatrix")}else e=$t("mat4").label("cameraProjectionMatrix").setGroup(Zt).onRenderUpdate(({camera:t})=>t.projectionMatrix);return e}).once()(),tQ=Ee(({camera:i})=>{let e;if(i.isArrayCamera&&i.cameras.length>0){const t=[];for(const r of i.cameras)t.push(r.projectionMatrixInverse);e=Fo(t).setGroup(Zt).label("cameraProjectionMatricesInverse").element(i.isMultiViewCamera?V0("gl_ViewID_OVR"):tv).toVar("cameraProjectionMatrixInverse")}else e=$t("mat4").label("cameraProjectionMatrixInverse").setGroup(Zt).onRenderUpdate(({camera:t})=>t.projectionMatrixInverse);return e}).once()(),eo=Ee(({camera:i})=>{let e;if(i.isArrayCamera&&i.cameras.length>0){const t=[];for(const r of i.cameras)t.push(r.matrixWorldInverse);e=Fo(t).setGroup(Zt).label("cameraViewMatrices").element(i.isMultiViewCamera?V0("gl_ViewID_OVR"):tv).toVar("cameraViewMatrix")}else e=$t("mat4").label("cameraViewMatrix").setGroup(Zt).onRenderUpdate(({camera:t})=>t.matrixWorldInverse);return e}).once()(),nQ=$t("mat4").label("cameraWorldMatrix").setGroup(Zt).onRenderUpdate(({camera:i})=>i.matrixWorld),iQ=$t("mat3").label("cameraNormalMatrix").setGroup(Zt).onRenderUpdate(({camera:i})=>i.normalMatrix),E8=$t(new re).label("cameraPosition").setGroup(Zt).onRenderUpdate(({camera:i},e)=>e.value.setFromMatrixPosition(i.matrixWorld)),gR=new Yc;class In extends Qt{static get type(){return"Object3DNode"}constructor(e,t=null){super(),this.scope=e,this.object3d=t,this.updateType=gn.OBJECT,this._uniformNode=new B0(null)}getNodeType(){const e=this.scope;if(e===In.WORLD_MATRIX)return"mat4";if(e===In.POSITION||e===In.VIEW_POSITION||e===In.DIRECTION||e===In.SCALE)return"vec3";if(e===In.RADIUS)return"float"}update(e){const t=this.object3d,n=this._uniformNode,r=this.scope;if(r===In.WORLD_MATRIX)n.value=t.matrixWorld;else if(r===In.POSITION)n.value=n.value||new re,n.value.setFromMatrixPosition(t.matrixWorld);else if(r===In.SCALE)n.value=n.value||new re,n.value.setFromMatrixScale(t.matrixWorld);else if(r===In.DIRECTION)n.value=n.value||new re,t.getWorldDirection(n.value);else if(r===In.VIEW_POSITION){const s=e.camera;n.value=n.value||new re,n.value.setFromMatrixPosition(t.matrixWorld),n.value.applyMatrix4(s.matrixWorldInverse)}else if(r===In.RADIUS){const s=e.object.geometry;s.boundingSphere===null&&s.computeBoundingSphere(),gR.copy(s.boundingSphere).applyMatrix4(t.matrixWorld),n.value=gR.radius}}generate(e){const t=this.scope;return t===In.WORLD_MATRIX?this._uniformNode.nodeType="mat4":t===In.POSITION||t===In.VIEW_POSITION||t===In.DIRECTION||t===In.SCALE?this._uniformNode.nodeType="vec3":t===In.RADIUS&&(this._uniformNode.nodeType="float"),this._uniformNode.build(e)}serialize(e){super.serialize(e),e.scope=this.scope}deserialize(e){super.deserialize(e),this.scope=e.scope}}In.WORLD_MATRIX="worldMatrix";In.POSITION="position";In.SCALE="scale";In.VIEW_POSITION="viewPosition";In.DIRECTION="direction";In.RADIUS="radius";const rQ=rt(In,In.DIRECTION).setParameterLength(1),sQ=rt(In,In.WORLD_MATRIX).setParameterLength(1),R8=rt(In,In.POSITION).setParameterLength(1),oQ=rt(In,In.SCALE).setParameterLength(1),aQ=rt(In,In.VIEW_POSITION).setParameterLength(1),lQ=rt(In,In.RADIUS).setParameterLength(1);class qo extends In{static get type(){return"ModelNode"}constructor(e){super(e)}update(e){this.object3d=e.object,super.update(e)}}const cQ=St(qo,qo.DIRECTION),Uo=St(qo,qo.WORLD_MATRIX),uQ=St(qo,qo.POSITION),hQ=St(qo,qo.SCALE),dQ=St(qo,qo.VIEW_POSITION),fQ=St(qo,qo.RADIUS),C8=$t(new Sn).onObjectUpdate(({object:i},e)=>e.value.getNormalMatrix(i.matrixWorld)),pQ=$t(new un).onObjectUpdate(({object:i},e)=>e.value.copy(i.matrixWorld).invert()),mh=Ee(i=>i.renderer.overrideNodes.modelViewMatrix||P8).once()().toVar("modelViewMatrix"),P8=eo.mul(Uo),Eb=Ee(i=>
3860(i.context.isHighPrecisionModelViewMatrix=!0,$t("mat4").onObjectUpdate(({object:e,camera:t})=>e.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,e.matrixWorld)))).once()().toVar("highpModelViewMatrix"),Rb=Ee(i=>{const e=i.context.isHighPrecisionModelViewMatrix;return $t("mat3").onObjectUpdate(({object:t,camera:n})=>(e!==!0&&t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix)))}).once()().toVar("highpModelNormalViewMatrix"),G0=ql("position","vec3"),Xi=G0.toVarying("positionLocal"),c1=G0.toVarying("positionPrevious"),Fl=Uo.mul(Xi).xyz.toVarying("v_positionWorld").context({needsPositionReassign:!0}),VM=Xi.transformDirection(Uo).toVarying("v_positionWorldDirection").normalize().toVar("positionWorldDirection").context({needsPositionReassign:!0}),tr=Ee(i=>i.context.setupPositionView(),"vec3").once()().toVarying("v_positionView").context({needsPositionReassign:!0}),wi=tr.negate().toVarying("v_positionViewDirection").normalize().toVar("positionViewDirection");class AQ extends Qt{static get type(){return"FrontFacingNode"}constructor(){super("bool"),this.isFrontFacingNode=!0}generate(e){const{renderer:t,material:n}=e;return t.coordinateSystem===Ms&&n.side===oi?"false":e.getFrontFacing()}}const L8=St(AQ),q0=se(L8).mul(2).sub(1),nv=ql("normal","vec3"),Zs=Ee(i=>i.geometry.hasAttribute("normal")===!1?(console.warn('THREE.TSL: Vertex attribute "normal" not found on geometry.'),Se(0,1,0)):nv,"vec3").once()().toVar("normalLocal"),N8=tr.dFdx().cross(tr.dFdy()).normalize().toVar("normalFlat"),Ho=Ee(i=>{let e;return i.material.flatShading===!0?e=N8:e=Mo(GM(Zs),"v_normalView").normalize(),e},"vec3").once()().toVar("normalView"),iv=Ee(i=>{let e=Ho.transformDirection(eo);return i.material.flatShading!==!0&&(e=Mo(e,"v_normalWorld")),e},"vec3").once()().normalize().toVar("normalWorld"),ji=Ee(i=>{let e=i.context.setupNormal().context({getUV:null});return i.material.flatShading!==!0&&(e=e.mul(q0)),e},"vec3").once()().toVar("transformedNormalView"),rv=ji.transformDirection(eo).toVar("transformedNormalWorld"),Ud=Ee(i=>{let e=i.context.setupClearcoatNormal().context({getUV:null});return i.material.flatShading!==!0&&(e=e.mul(q0)),e},"vec3").once()().toVar("transformedClearcoatNormalView"),D8=Ee(([i,e=Uo])=>{const t=hs(e),n=i.div(Se(t[0].dot(t[0]),t[1].dot(t[1]),t[2].dot(t[2])));return t.mul(n).xyz}),GM=Ee(([i],e)=>{const t=e.renderer.overrideNodes.modelNormalViewMatrix;if(t!==null)return t.transformDirection(i);const n=C8.mul(i);return eo.transformDirection(n)}),_R=new Es,Qy=new un,I8=$t(0).onReference(({material:i})=>i).onObjectUpdate(({material:i})=>i.refractionRatio),__=$t(1).onReference(({material:i})=>i).onObjectUpdate(function({material:i,scene:e}){return i.envMap?i.envMapIntensity:e.environmentIntensity}),qM=$t(new un).onReference(function(i){return i.material}).onObjectUpdate(function({material:i,scene:e}){const t=e.environment!==null&&i.envMap===null?e.environmentRotation:i.envMapRotation;return t?(_R.copy(t),Qy.makeRotationFromEuler(_R)):Qy.identity(),Qy}),B8=wi.negate().reflect(ji),F8=wi.negate().refract(ji,I8),U8=B8.transformDirection(eo).toVar("reflectVector"),O8=F8.transformDirection(eo).toVar("reflectVector");
3860class mQ extends Ka{static get type(){return"CubeTextureNode"}constructor(e,t=null,n=null,r=null){super(e,t,n,r),this.isCubeTextureNode=!0}getInputType(){return"cubeTexture"}getDefaultUV(){const e=this.value;return e.mapping===Aa?U8:e.mapping===ma?O8:(console.error('THREE.CubeTextureNode: Mapping "%s" not supported.',e.mapping),Se(0,0,0))}setUpdateMatrix(){}setupUV(e,t){const n=this.value;return(e.renderer.coordinateSystem===Xa||!n.isRenderTargetTexture)&&(t=Se(t.x.negate(),t.yz)),qM.mul(t)}generateUV(e,t){return t.build(e,"vec3")}}const Pf=rt(mQ).setParameterLength(1,4).setName("cubeTexture");class gQ extends ph{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),n=this.referenceNode.getNodeType(),r=this.getNodeType();return e.format(t,n,r)}}class sv extends Qt{static get type(){return"ReferenceNode"}constructor(e,t,n=null,r=null){super(),this.property=e,this.uniformType=t,this.object=n,this.count=r,this.properties=e.split("."),this.reference=n,this.node=null,this.group=null,this.name=null,this.updateType=gn.OBJECT}element(e){return it(new gQ(this,it(e)))}setGroup(e){return this.group=e,this}label(e){return this.name=e,this}setNodeType(e){let t=null;this.count!==null?t=z0(null,e,this.count):Array.isArray(this.getValueFromReference())?t=Fo(null,e):e==="texture"?t=Ln(null):e==="cubeTexture"?t=Pf(null):t=$t(null,e),this.group!==null&&t.setGroup(this.group),this.name!==null&&t.label(this.name),this.node=t.getSelf()}getNodeType(e){return this.node===null&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let n=e[t[0]];for(let r=1;r<t.length;r++)n=n[t[r]];return n}updateReference(e){return this.reference=this.object!==null?this.object:e.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){this.node===null&&this.setNodeType(this.uniformType);const e=this.getValueFromReference();Array.isArray(e)?this.node.array=e:this.node.value=e}}const ui=(i,e,t)=>it(new sv(i,e,t)),Cb=(i,e,t,n)=>it(new sv(i,e,n,t));class _Q extends sv{static get type(){return"MaterialReferenceNode"}constructor(e,t,n=null){super(e,t,n),this.material=n,this.isMaterialReferenceNode=!0}updateReference(e){return this.reference=this.material!==null?this.material:e.material,this.reference}}const Rl=(i,e,t=null)=>it(new _Q(i,e,t)),ov=Ee(i=>(i.geometry.hasAttribute("tangent")===!1&&i.geometry.computeTangents(),ql("tangent","vec4")))(),H0=ov.xyz.toVar("tangentLocal"),W0=mh.mul(jt(H0,0)).xyz.toVarying("v_tangentView").normalize().toVar("tangentView"),k8=W0.transformDirection(eo).toVarying("v_tangentWorld").normalize().toVar("tangentWorld"),HM=W0.toVar("transformedTangentView"),vQ=HM.transformDirection(eo).normalize().toVar("transformedTangentWorld"),$0=Ee(([i,e],t)=>{let n=i.mul(ov.w).xyz;return t.material.flatShading!==!0&&(n=Mo(i,e)),n}).once(),yQ=$0(nv.cross(ov),"v_bitangentGeometry").normalize().toVar("bitangentGeometry"),xQ=$0(Zs.cross(H0),"v_bitangentLocal").normalize().toVar("bitangentLocal"),z8=$0(Ho.cross(W0),"v_bitangentView").normalize().toVar("bitangentView"),bQ=$0(iv.cross(k8),"v_bitangentWorld").normalize().toVar("bitangentWorld"),V8=$0(ji.cross(HM),"v_transformedBitangentView").normalize().toVar("transformedBitangentView"),SQ=V8.transformDirection(eo).normalize().toVar("transformedBitangentWorld"),Vu=hs(W0,z8,Ho),G8=wi.mul(Vu),MQ=(i,e)=>i.sub(G8.mul(e)),q8=(()=>{let i=Xu.cross(wi);return i=i.cross(Xu).normalize(),i=Qn(i,ji,bc.mul(Ua.oneMinus()).oneMinus().pow2().pow2()).normalize(),i})(),wQ=Ee(i=>{const{eye_pos:e,surf_norm:t,mapN:n,uv:r}=i,s=e.dFdx(),o=e.dFdy(),a=r.dFdx(),l=r.dFdy(),c=t,u=o.cross(c),p=c.cross(s),m=u.mul(a.x).add(p.mul(l.x)),g=u.mul(a.y).add(p.mul(l.y)),v=m.dot(m).max(g.dot(g)),b=q0.mul(v.inverseSqrt());return rr(m.mul(n.x,b),g.mul(n.y,b),c.mul(n.z)).normalize()});class TQ extends Zi{static get type(){return"NormalMapNode"}constructor(e,t=null){super("vec3"),this.node=e,this.scaleNode=t,this.normalMapType=kl}setup(e){const{normalMapType:t,scaleNode:n}=this;let r=this.node.mul(2).sub(1);n!==null&&(r=Se(r.xy.mul(n),r.z));let s=null;return t===iL?s=GM(r):t===kl&&(e.hasGeometryAttribute("tangent")===!0?s=Vu.mul(r).normalize():s=wQ({eye_pos:tr,surf_norm:Ho,mapN:r,uv:Ci()})),s}}const Pb=rt(TQ).setParameterLength(1,2),EQ=Ee(({textureNode:i,bumpScale:e})=>{const t=r=>i.cache().context({getUV:s=>r(s.uvNode||Ci()),forceUVContext:!0}),n=se(t(r=>r));return dt(se(t(r=>r.add(r.dFdx()))).sub(n),se(t(r=>r.add(r.dFdy()))).sub(n)).mul(e)}
3860),RQ=Ee(i=>{const{surf_pos:e,surf_norm:t,dHdxy:n}=i,r=e.dFdx().normalize(),s=e.dFdy().normalize(),o=t,a=s.cross(o),l=o.cross(r),c=r.dot(a).mul(q0),u=c.sign().mul(n.x.mul(a).add(n.y.mul(l)));return c.abs().mul(t).sub(u).normalize()});class CQ extends Zi{static get type(){return"BumpMapNode"}constructor(e,t=null){super("vec3"),this.textureNode=e,this.scaleNode=t}setup(){const e=this.scaleNode!==null?this.scaleNode:1,t=EQ({textureNode:this.textureNode,bumpScale:e});return RQ({surf_pos:tr,surf_norm:Ho,dHdxy:t})}}const H8=rt(CQ).setParameterLength(1,2),vR=new Map;class et extends Qt{static get type(){return"MaterialNode"}constructor(e){super(),this.scope=e}getCache(e,t){let n=vR.get(e);return n===void 0&&(n=Rl(e,t),vR.set(e,n)),n}getFloat(e){return this.getCache(e,"float")}getColor(e){return this.getCache(e,"color")}getTexture(e){return this.getCache(e==="map"?"map":e+"Map","texture")}setup(e){const t=e.context.material,n=this.scope;let r=null;if(n===et.COLOR){const s=t.color!==void 0?this.getColor(n):Se();t.map&&t.map.isTexture===!0?r=s.mul(this.getTexture("map")):r=s}else if(n===et.OPACITY){const s=this.getFloat(n);t.alphaMap&&t.alphaMap.isTexture===!0?r=s.mul(this.getTexture("alpha")):r=s}else if(n===et.SPECULAR_STRENGTH)t.specularMap&&t.specularMap.isTexture===!0?r=this.getTexture("specular").r:r=se(1);else if(n===et.SPECULAR_INTENSITY){const s=this.getFloat(n);t.specularIntensityMap&&t.specularIntensityMap.isTexture===!0?r=s.mul(this.getTexture(n).a):r=s}else if(n===et.SPECULAR_COLOR){const s=this.getColor(n);t.specularColorMap&&t.specularColorMap.isTexture===!0?r=s.mul(this.getTexture(n).rgb):r=s}else if(n===et.ROUGHNESS){const s=this.getFloat(n);t.roughnessMap&&t.roughnessMap.isTexture===!0?r=s.mul(this.getTexture(n).g):r=s}else if(n===et.METALNESS){const s=this.getFloat(n);t.metalnessMap&&t.metalnessMap.isTexture===!0?r=s.mul(this.getTexture(n).b):r=s}else if(n===et.EMISSIVE){const s=this.getFloat("emissiveIntensity"),o=this.getColor(n).mul(s);t.emissiveMap&&t.emissiveMap.isTexture===!0?r=o.mul(this.getTexture(n)):r=o}else if(n===et.NORMAL)t.normalMap?(r=Pb(this.getTexture("normal"),this.getCache("normalScale","vec2")),r.normalMapType=t.normalMapType):t.bumpMap?r=H8(this.getTexture("bump").r,this.getFloat("bumpScale")):r=Ho;else if(n===et.CLEARCOAT){const s=this.getFloat(n);t.clearcoatMap&&t.clearcoatMap.isTexture===!0?r=s.mul(this.getTexture(n).r):r=s}else if(n===et.CLEARCOAT_ROUGHNESS){const s=this.getFloat(n);t.clearcoatRoughnessMap&&t.clearcoatRoughnessMap.isTexture===!0?r=s.mul(this.getTexture(n).r):r=s}else if(n===et.CLEARCOAT_NORMAL)t.clearcoatNormalMap?r=Pb(this.getTexture(n),this.getCache(n+"Scale","vec2")):r=Ho;else if(n===et.SHEEN){const s=this.getColor("sheenColor").mul(this.getFloat("sheen"));t.sheenColorMap&&t.sheenColorMap.isTexture===!0?r=s.mul(this.getTexture("sheenColor").rgb):r=s}else if(n===et.SHEEN_ROUGHNESS){const s=this.getFloat(n);t.sheenRoughnessMap&&t.sheenRoughnessMap.isTexture===!0?r=s.mul(this.getTexture(n).a):r=s,r=r.clamp(.07,1)}else if(n===et.ANISOTROPY)if(t.anisotropyMap&&t.anisotropyMap.isTexture===!0){const s=this.getTexture(n);r=W1(Td.x,Td.y,Td.y.negate(),Td.x).mul(s.rg.mul(2).sub(dt(1)).normalize().mul(s.b))}else r=Td;else if(n===et.IRIDESCENCE_THICKNESS){const s=ui("1","float",t.iridescenceThicknessRange);if(t.iridescenceThicknessMap){const o=ui("0","float",t.iridescenceThicknessRange);r=s.sub(o).mul(this.getTexture(n).g).add(o)}else r=s}else if(n===et.TRANSMISSION){const s=this.getFloat(n);t.transmissionMap?r=s.mul(this.getTexture(n).r):r=s}else if(n===et.THICKNESS){const s=this.getFloat(n);t.thicknessMap?r=s.mul(this.getTexture(n).g):r=s}else if(n===et.IOR)r=this.getFloat(n);else if(n===et.LIGHT_MAP)r=this.getTexture(n).rgb.mul(this.getFloat("lightMapIntensity"));else if(n===et.AO)r=this.getTexture(n).r.sub(1).mul(this.getFloat("aoMapIntensity")).add(1);else{const s=this.getNodeType(e);r=this.getCache(n,s)}return r}}et.ALPHA_TEST="alphaTest";et.COLOR="color";et.OPACITY="opacity";et.SHININESS="shininess";et.SPECULAR="specular";et.SPECULAR_STRENGTH="specularStrength";et.SPECULAR_INTENSITY="specularIntensity";et.SPECULAR_COLOR="specularColor";et.REFLECTIVITY="reflectivity";et.ROUGHNESS="roughness";et.METALNESS="metalness";et.NORMAL="normal";et.CLEARCOAT="clearcoat";et.CLEARCOAT_ROUGHNESS="clearcoatRoughness";et.CLEARCOAT_NORMAL="clearcoatNormal";et.EMISSIVE="emissive";et.ROTATION="rotation";et.SHEEN="sheen";et.SHEEN_ROUGHNESS="sheenRoughness";et.ANISOTROPY="anisotropy";et.IRIDESCENCE="iridescence";et.IRIDESCENCE_IOR="iridescenceIOR";et.IRIDESCENCE_THICKNESS="iridescenceThickness";et.IOR="ior";et.TRANSMISSION="transmission";et.THICKNESS="thickness";et.ATTENUATION_DISTANCE="attenuationDistance";et.ATTENUATION_COLOR="attenuationColor";et.LINE_SCALE="scale";et.LINE_DASH_SIZE="dashSize";et.LINE_GAP_SIZE="gapSize";et.LINE_WIDTH="linewidth";et.LINE_DASH_OFFSET="dashOffset";et.POINT_SIZE="size";et.DISPERSION="dispersion";et.LIGHT_MAP="light";et.AO="ao";const W8=St(et,et.ALPHA_TEST),$8=St(et,et.COLOR),j8=St(et,et.SHININESS),X8=St(et,et.EMISSIVE),WM=St(et,et.OPACITY),Y8=St(et,et.SPECULAR),Lb=St(et,et.SPECULAR_INTENSITY),Q8=St(et,et.SPECULAR_COLOR),wA=St(et,et.SPECULAR_STRENGTH),v_=St(et,et.REFLECTIVITY),Z8=St(et,et.ROUGHNESS),K8=St(et,et.METALNESS),J8=St(et,et.NORMAL),e6=St(et,et.CLEARCOAT),t6=St(et,et.CLEARCOAT_ROUGHNESS),n6=St(et,et.CLEARCOAT_NORMAL),i6=St(et,et.ROTATION),r6=St(et,et.SHEEN),s6=St(et,et.SHEEN_ROUGHNESS),o6=St(et,et.ANISOTROPY),a6=St(et,et.IRIDESCENCE),l6=St(et,et.IRIDESCENCE_IOR),c6=St(et,et.IRIDESCENCE_THICKNESS),u6=St(et,et.TRANSMISSION),h6=St(et,et.THICKNESS),d6=St(et,et.IOR),f6=St(et,et.ATTENUATION_DISTANCE),p6=St(et,et.ATTENUATION_COLOR),A6=St(et,et.LINE_SCALE),m6=St(et,et.LINE_DASH_SIZE),g6=St(et,et.LINE_GAP_SIZE),PQ=St(et,et.LINE_WIDTH),_6=St(et,et.LINE_DASH_OFFSET),v6=St(et,et.POINT_SIZE),y6=St(et,et.DISPERSION),$M=St(et,et.LIGHT_MAP),x6=St(et,et.AO),Td=$t(ne
3860w at).onReference(function(i){return i.material}).onRenderUpdate(function({material:i}){this.value.set(i.anisotropy*Math.cos(i.anisotropyRotation),i.anisotropy*Math.sin(i.anisotropyRotation))}),jM=Ee(i=>i.context.setupModelViewProjection(),"vec4").once()().toVarying("v_modelViewProjection");class Ti extends Qt{static get type(){return"IndexNode"}constructor(e){super("uint"),this.scope=e,this.isIndexNode=!0}generate(e){const t=this.getNodeType(e),n=this.scope;let r;if(n===Ti.VERTEX)r=e.getVertexIndex();else if(n===Ti.INSTANCE)r=e.getInstanceIndex();else if(n===Ti.DRAW)r=e.getDrawIndex();else if(n===Ti.INVOCATION_LOCAL)r=e.getInvocationLocalIndex();else if(n===Ti.INVOCATION_SUBGROUP)r=e.getInvocationSubgroupIndex();else if(n===Ti.SUBGROUP)r=e.getSubgroupIndex();else throw new Error("THREE.IndexNode: Unknown scope: "+n);let s;return e.shaderStage==="vertex"||e.shaderStage==="compute"?s=r:s=Mo(this).build(e,t),s}}Ti.VERTEX="vertex";Ti.INSTANCE="instance";Ti.SUBGROUP="subgroup";Ti.INVOCATION_LOCAL="invocationLocal";Ti.INVOCATION_SUBGROUP="invocationSubgroup";Ti.DRAW="draw";const b6=St(Ti,Ti.VERTEX),Fc=St(Ti,Ti.INSTANCE),LQ=St(Ti,Ti.SUBGROUP),NQ=St(Ti,Ti.INVOCATION_SUBGROUP),DQ=St(Ti,Ti.INVOCATION_LOCAL),S6=St(Ti,Ti.DRAW);class M6 extends Qt{static get type(){return"InstanceNode"}constructor(e,t,n=null){super("void"),this.count=e,this.instanceMatrix=t,this.instanceColor=n,this.instanceMatrixNode=null,this.instanceColorNode=null,this.updateType=gn.FRAME,this.buffer=null,this.bufferColor=null}setup(e){const{count:t,instanceMatrix:n,instanceColor:r}=this;let{instanceMatrixNode:s,instanceColorNode:o}=this;if(s===null){if(t<=1e3)s=z0(n.array,"mat4",Math.max(t,1)).element(Fc);else{const l=new q_(n.array,16,1);this.buffer=l;const c=n.usage===Ld?Tb:l1,u=[c(l,"vec4",16,0),c(l,"vec4",16,4),c(l,"vec4",16,8),c(l,"vec4",16,12)];s=ju(...u)}this.instanceMatrixNode=s}if(r&&o===null){const l=new Ic(r.array,3),c=r.usage===Ld?Tb:l1;this.bufferColor=l,o=Se(c(l,"vec3",3,0)),this.instanceColorNode=o}const a=s.mul(Xi).xyz;if(Xi.assign(a),e.hasGeometryAttribute("normal")){const l=D8(Zs,s);Zs.assign(l)}this.instanceColorNode!==null&&c0("vec3","vInstanceColor").assign(this.instanceColorNode)}update(){this.instanceMatrix.usage!==Ld&&this.buffer!==null&&this.instanceMatrix.version!==this.buffer.version&&(this.buffer.version=this.instanceMatrix.version),this.instanceColor&&this.instanceColor.usage!==Ld&&this.bufferColor!==null&&this.instanceColor.version!==this.bufferColor.version&&(this.bufferColor.version=this.instanceColor.version)}}const IQ=rt(M6).setParameterLength(2,3);class BQ extends M6{static get type(){return"InstancedMeshNode"}constructor(e){const{count:t,instanceMatrix:n,instanceColor:r}=e;super(t,n,r),this.instancedMesh=e}}const w6=rt(BQ).setParameterLength(1);class FQ extends Qt{static get type(){return"BatchNode"}constructor(e){super("void"),this.batchMesh=e,this.batchingIdNode=null}setup(e){this.batchingIdNode===null&&(e.getDrawIndex()===null?this.batchingIdNode=Fc:this.batchingIdNode=S6);const n=Ee(([v])=>{const b=me(Bc($i(this.batchMesh._indirectTexture),0).x),M=me(v).mod(b),x=me(v).div(b);return $i(this.batchMesh._indirectTexture,vr(M,x)).x}).setLayout({name:"getIndirectIndex",type:"uint",inputs:[{name:"id",type:"int"}]})(me(this.batchingIdNode)),r=this.batchMesh._matricesTexture,s=me(Bc($i(r),0).x),o=se(n).mul(4).toInt().toVar(),a=o.mod(s),l=o.div(s),c=ju($i(r,vr(a,l)),$i(r,vr(a.add(1),l)),$i(r,vr(a.add(2),l)),$i(r,vr(a.add(3),l))),u=this.batchMesh._colorsTexture;if(u!==null){const b=Ee(([M])=>{const x=me(Bc($i(u),0).x),w=M,R=w.mod(x),C=w.div(x);return $i(u,vr(R,C)).rgb}).setLayout({name:"getBatchingColor",type:"vec3",inputs:[{name:"id",type:"int"}]})(n);c0("vec3","vBatchColor").assign(b)}const p=hs(c);Xi.assign(c.mul(Xi));const m=Zs.div(Se(p[0].dot(p[0]),p[1].dot(p[1]),p[2].dot(p[2]))),g=p.mul(m).xyz;Zs.assign(g),e.hasGeometryAttribute("tangent")&&H0.mulAssign(p)}}const T6=rt(FQ).setParameterLength(1);class UQ extends ph{static get type(){return"StorageArrayElementNode"}constructor(e,t){super(e,t),this.isStorageArrayElementNode=!0}set storageBufferNode(e){this.node=e}get storageBufferNode(){return this.node}getMemberType(e,t){const n=this.storageBufferNode.structTypeNode;return n?n.getMemberType(e,t):"void"}setup(e){return e.isAvailable("storageBuffer")===!1&&this.node.isPBO===!0&&e.setupPBO(this.node),super.setup(e)}generate(e,t){let n;const r=e.context.assign;if(e.isAvailable("storageBuffer")===!1?this.node.isPBO===!0&&r!==!0&&(this.node.value.isInstancedBufferAttribute||e.shaderStage!=="compute")?n=e.generatePBO(this):n=this.node.build(e):n=super.generate(e),r!==!0){const s=this.getNodeType(e);n=e.format(n,s,t)}return n}}const OQ=rt(UQ).setParameterLength(2);class kQ extends zM{static get type(){return"StorageBufferNode"}constructor(e,t=null,n=0){let r,s=null;t&&t.isStruct?(r="struct",s=t.layout,(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute)&&(n=e.count)):t===null&&(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute)?(r=I5(e.itemSize),n=e.count):r=t,super(e,r,n),this.isStorageBufferNode=!0,this.structTypeNode=s,this.access=as.READ_WRITE,this.isAtomic=!1,this.isPBO=!1,this._attribute=null,this._varying=null,this.global=!0,e.isStorageBufferAttribute!==!0&&e.isStorageInstancedBufferAttribute!==!0&&(e.isInstancedBufferAttribute?e.isStorageInstancedBufferAttribute=!0:e.isStorageBufferAttribute=!0)}getHash(e){if(this.bufferCount===0){let t=e.globalCache.getData(this.value);return t===void 0&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getInputType(){return this.value.isIndirectStorageBufferAttribute?"indirectStorageBuffer":"storageBuffer"}element(e){return OQ(this,e)}setPBO(e){return this.isPBO=e,this}getPBO(){return this.isPBO}setAccess(e){return this.access=e,this}toReadOnly(){return this.setAccess(as.READ_ONLY)}setAtomic(e){return this.isAtomic=e,this}toAtomic(){return this.setAtomic(!0)}getAttributeData(){return this._attribute===null&&(this._attribute=k0(this.value),this._varying=Mo(this._attribute)),{attribute:this._attribute,varying:this._varying}}getNodeType(e){if(this.structTypeNode!==null)return this.structTypeNode.getNodeType(e);if(e.isAvailable("storageBuffer")||e.isAvailable("indirectStorageBuffer"))return super.getNodeType(e);const{attribute:t}=this.getAttributeData();return t.getNodeType(e)}generate(e){if(this.structTypeNode!==null&&this.structTypeNode.build(e),e.isAvailable("storageBuffer")||e.isAvailable("indirectStorageBuffer"))return super.generate(e);const{attribute:t,varying:n}=this.getAttributeData(),r=n.build(e);return e.registerTransform(r,t),r}}const Yu=(i,e=null,t=0)=>it(new kQ(i,e,t)),zQ=(i,e,t)=>(console.warn('THREE.TSL: "storageObject()" is deprecated. Use "storage().setPBO( true )" instead.'),Yu(i,e,t).setPBO(!0)),yR=new WeakMap;class E6 extends Qt{static get type(){return"SkinningNode"}constructor(e){super("void"),this.skinnedMesh=e,this.updateType=gn.OBJECT,this.skinIndexNode=ql("skinIndex","uvec4"),this.skinWeightNode=ql
3860("skinWeight","vec4"),this.bindMatrixNode=ui("bindMatrix","mat4"),this.bindMatrixInverseNode=ui("bindMatrixInverse","mat4"),this.boneMatricesNode=Cb("skeleton.boneMatrices","mat4",e.skeleton.bones.length),this.positionNode=Xi,this.toPositionNode=Xi,this.previousBoneMatricesNode=null}getSkinnedPosition(e=this.boneMatricesNode,t=this.positionNode){const{skinIndexNode:n,skinWeightNode:r,bindMatrixNode:s,bindMatrixInverseNode:o}=this,a=e.element(n.x),l=e.element(n.y),c=e.element(n.z),u=e.element(n.w),p=s.mul(t),m=rr(a.mul(r.x).mul(p),l.mul(r.y).mul(p),c.mul(r.z).mul(p),u.mul(r.w).mul(p));return o.mul(m).xyz}getSkinnedNormal(e=this.boneMatricesNode,t=Zs){const{skinIndexNode:n,skinWeightNode:r,bindMatrixNode:s,bindMatrixInverseNode:o}=this,a=e.element(n.x),l=e.element(n.y),c=e.element(n.z),u=e.element(n.w);let p=rr(r.x.mul(a),r.y.mul(l),r.z.mul(c),r.w.mul(u));return p=o.mul(p).mul(s),p.transformDirection(t).xyz}getPreviousSkinnedPosition(e){const t=e.object;return this.previousBoneMatricesNode===null&&(t.skeleton.previousBoneMatrices=new Float32Array(t.skeleton.boneMatrices),this.previousBoneMatricesNode=Cb("skeleton.previousBoneMatrices","mat4",t.skeleton.bones.length)),this.getSkinnedPosition(this.previousBoneMatricesNode,c1)}needsPreviousBoneMatrices(e){const t=e.renderer.getMRT();return t&&t.has("velocity")||F5(e.object).useVelocity===!0}setup(e){this.needsPreviousBoneMatrices(e)&&c1.assign(this.getPreviousSkinnedPosition(e));const t=this.getSkinnedPosition();if(this.toPositionNode&&this.toPositionNode.assign(t),e.hasGeometryAttribute("normal")){const n=this.getSkinnedNormal();Zs.assign(n),e.hasGeometryAttribute("tangent")&&H0.assign(n)}return t}generate(e,t){if(t!=="void")return super.generate(e,t)}update(e){const t=e.object&&e.object.skeleton?e.object.skeleton:this.skinnedMesh.skeleton;yR.get(t)!==e.frameId&&(yR.set(t,e.frameId),this.previousBoneMatricesNode!==null&&t.previousBoneMatrices.set(t.boneMatrices),t.update())}}const R6=i=>it(new E6(i)),VQ=(i,e=null)=>{const t=new E6(i);return t.positionNode=Yu(new Ic(i.geometry.getAttribute("position").array,3),"vec3").setPBO(!0).toReadOnly().element(Fc).toVar(),t.skinIndexNode=Yu(new Ic(new Uint32Array(i.geometry.getAttribute("skinIndex").array),4),"uvec4").setPBO(!0).toReadOnly().element(Fc).toVar(),t.skinWeightNode=Yu(new Ic(i.geometry.getAttribute("skinWeight").array,4),"vec4").setPBO(!0).toReadOnly().element(Fc).toVar(),t.bindMatrixNode=$t(i.bindMatrix,"mat4"),t.bindMatrixInverseNode=$t(i.bindMatrixInverse,"mat4"),t.boneMatricesNode=z0(i.skeleton.boneMatrices,"mat4",i.skeleton.bones.length),t.toPositionNode=e,it(t)};class GQ extends Qt{static get type(){return"LoopNode"}constructor(e=[]){super(),this.params=e}getVarName(e){return String.fromCharCode(105+e)}getProperties(e){const t=e.getNodeProperties(this);if(t.stackNode!==void 0)return t;const n={};for(let o=0,a=this.params.length-1;o<a;o++){const l=this.params[o],c=l.isNode!==!0&&l.name||this.getVarName(o),u=l.isNode!==!0&&l.type||"int";n[c]=Gl(c,u)}const r=e.addStack();t.returnsNode=this.params[this.params.length-1](n,e),t.stackNode=r;const s=this.params[0];return s.isNode!==!0&&typeof s.update=="function"&&(t.updateNode=Ee(this.params[0].update)(n)),e.removeStack(),t}getNodeType(e){const{returnsNode:t}=this.getProperties(e);return t?t.getNodeType(e):"void"}setup(e){this.getProperties(e)}generate(e){const t=this.getProperties(e),n=this.params,r=t.stackNode;for(let a=0,l=n.length-1;a<l;a++){const c=n[a];let u=!1,p=null,m=null,g=null,v=null,b=null,M=null;c.isNode?c.getNodeType(e)==="bool"?(u=!0,v="bool",m=c.build(e,v)):(v="int",g=this.getVarName(a),p="0",m=c.build(e,v),b="<"):(v=c.type||"int",g=c.name||this.getVarName(a),p=c.start,m=c.end,b=c.condition,M=c.update,typeof p=="number"?p=e.generateConst(v,p):p&&p.isNode&&(p=p.build(e,v)),typeof m=="number"?m=e.generateConst(v,m):m&&m.isNode&&(m=m.build(e,v)),p!==void 0&&m===void 0?(p=p+" - 1",m="0",b=">="):m!==void 0&&p===void 0&&(p="0",b="<"),b===void 0&&(Number(p)>Number(m)?b=">=":b="<"));let x;if(u)x=`while ( ${m} )`;else{const w={start:p,end:m},R=w.start,C=w.end;let N;const D=()=>b.includes("<")?"+=":"-=";if(M!=null)switch(typeof M){case"function":N=e.flowStagesNode(t.updateNode,"void").code.replace(/\t|;/g,"");break;case"number":N=g+" "+D()+" "+e.generateConst(v,M);break;case"string":N=g+" "+M;break;default:M.isNode?N=g+" "+D()+" "+M.build(e):(console.error("THREE.TSL: 'Loop( { update: ... } )' is not a function, string or number."),N="break /* invalid update */")}
3860else v==="int"||v==="uint"?M=b.includes("<")?"++":"--":M=D()+" 1.",N=g+" "+M;const P=e.getVar(v,g)+" = "+R,O=g+" "+b+" "+C;x=`for ( ${P}; ${O}; ${N} )`}e.addFlowCode((a===0?`
3861`:"")+e.tab+x+` {
3862
3863`).addFlowTab()}const s=r.build(e,"void"),o=t.returnsNode?t.returnsNode.build(e):"";e.removeFlowTab().addFlowCode(`
3864`+e.tab+s);for(let a=0,l=this.params.length-1;a<l;a++)e.addFlowCode((a===0?"":e.tab)+`}
3865
3866`).removeFlowTab();return e.addFlowTab(),o}}const Zn=(...i)=>it(new GQ($u(i,"int"))).toStack(),qQ=()=>Gl("continue").toStack(),C6=()=>Gl("break").toStack(),HQ=(...i)=>(console.warn("THREE.TSL: loop() has been renamed to Loop()."),Zn(...i)),Zy=new WeakMap,ao=new Jt,xR=Ee(({bufferMap:i,influence:e,stride:t,width:n,depth:r,offset:s})=>{const o=me(b6).mul(t).add(s),a=o.div(n),l=o.sub(a.mul(n));return $i(i,vr(l,a)).depth(r).xyz.mul(e)});function WQ(i){const e=i.morphAttributes.position!==void 0,t=i.morphAttributes.normal!==void 0,n=i.morphAttributes.color!==void 0,r=i.morphAttributes.position||i.morphAttributes.normal||i.morphAttributes.color,s=r!==void 0?r.length:0;let o=Zy.get(i);if(o===void 0||o.count!==s){let x=function(){b.dispose(),Zy.delete(i),i.removeEventListener("dispose",x)};o!==void 0&&o.texture.dispose();const a=i.morphAttributes.position||[],l=i.morphAttributes.normal||[],c=i.morphAttributes.color||[];let u=0;e===!0&&(u=1),t===!0&&(u=2),n===!0&&(u=3);let p=i.attributes.position.count*u,m=1;const g=4096;p>g&&(m=Math.ceil(p/g),p=g);const v=new Float32Array(p*m*4*s),b=new C1(v,p,m,s);b.type=er,b.needsUpdate=!0;const M=u*4;for(let w=0;w<s;w++){const R=a[w],C=l[w],N=c[w],D=p*m*4*w;for(let P=0;P<R.count;P++){const O=P*M;e===!0&&(ao.fromBufferAttribute(R,P),v[D+O+0]=ao.x,v[D+O+1]=ao.y,v[D+O+2]=ao.z,v[D+O+3]=0),t===!0&&(ao.fromBufferAttribute(C,P),v[D+O+4]=ao.x,v[D+O+5]=ao.y,v[D+O+6]=ao.z,v[D+O+7]=0),n===!0&&(ao.fromBufferAttribute(N,P),v[D+O+8]=ao.x,v[D+O+9]=ao.y,v[D+O+10]=ao.z,v[D+O+11]=N.itemSize===4?ao.w:1)}}o={count:s,texture:b,stride:u,size:new at(p,m)},Zy.set(i,o),i.addEventListener("dispose",x)}return o}class $Q extends Qt{static get type(){return"MorphNode"}constructor(e){super("void"),this.mesh=e,this.morphBaseInfluence=$t(1),this.updateType=gn.OBJECT}setup(e){const{geometry:t}=e,n=t.morphAttributes.position!==void 0,r=t.hasAttribute("normal")&&t.morphAttributes.normal!==void 0,s=t.morphAttributes.position||t.morphAttributes.normal||t.morphAttributes.color,o=s!==void 0?s.length:0,{texture:a,stride:l,size:c}=WQ(t);n===!0&&Xi.mulAssign(this.morphBaseInfluence),r===!0&&Zs.mulAssign(this.morphBaseInfluence);const u=me(c.width);Zn(o,({i:p})=>{const m=se(0).toVar();this.mesh.count>1&&this.mesh.morphTexture!==null&&this.mesh.morphTexture!==void 0?m.assign($i(this.mesh.morphTexture,vr(me(p).add(1),me(Fc))).r):m.assign(ui("morphTargetInfluences","float").element(p).toVar()),xn(m.notEqual(0),()=>{n===!0&&Xi.addAssign(xR({bufferMap:a,influence:m,stride:l,width:u,depth:p,offset:me(0)})),r===!0&&Zs.addAssign(xR({bufferMap:a,influence:m,stride:l,width:u,depth:p,offset:me(1)}))})})}update(){const e=this.morphBaseInfluence;this.mesh.geometry.morphTargetsRelative?e.value=1:e.value=1-this.mesh.morphTargetInfluences.reduce((t,n)=>t+n,0)}}const P6=rt($Q).setParameterLength(1);class Qf extends Qt{static get type(){return"LightingNode"}constructor(){super("vec3"),this.isLightingNode=!0}}class jQ extends Qf{static get type(){return"AONode"}constructor(e=null){super(),this.aoNode=e}setup(e){e.context.ambientOcclusion.mulAssign(this.aoNode)}}class XQ extends e8{static get type(){return"LightingContextNode"}constructor(e,t=null,n=null,r=null){super(e),this.lightingModel=t,this.backdropNode=n,this.backdropAlphaNode=r,this._value=null}getContext(){const{backdropNode:e,backdropAlphaNode:t}=this,n=Se().toVar("directDiffuse"),r=Se().toVar("directSpecular"),s=Se().toVar("indirectDiffuse"),o=Se().toVar("indirectSpecular"),a={directDiffuse:n,directSpecular:r,indirectDiffuse:s,indirectSpecular:o};return{radiance:Se().toVar("radiance"),irradiance:Se().toVar("irradiance"),iblIrradiance:Se().toVar("iblIrradiance"),ambientOcclusion:se(1).toVar("ambientOcclusion"),reflectedLight:a,backdrop:e,backdropAlpha:t}}setup(e){return this.value=this._value||(this._value=this.getContext()),this.value.lightingModel=this.lightingModel||e.context.lightingModel,super.setup(e)}}const L6=rt(XQ);class YQ extends Qf{static get type(){return"IrradianceNode"}constructor(e){super(),this.node=e}
3866setup(e){e.context.irradiance.addAssign(this.node)}}let Cp,Pp;class cr extends Qt{static get type(){return"ScreenNode"}constructor(e){super(),this.scope=e,this.isViewportNode=!0}getNodeType(){return this.scope===cr.VIEWPORT?"vec4":"vec2"}getUpdateType(){let e=gn.NONE;return(this.scope===cr.SIZE||this.scope===cr.VIEWPORT)&&(e=gn.RENDER),this.updateType=e,e}update({renderer:e}){const t=e.getRenderTarget();this.scope===cr.VIEWPORT?t!==null?Pp.copy(t.viewport):(e.getViewport(Pp),Pp.multiplyScalar(e.getPixelRatio())):t!==null?(Cp.width=t.width,Cp.height=t.height):e.getDrawingBufferSize(Cp)}setup(){const e=this.scope;let t=null;return e===cr.SIZE?t=$t(Cp||(Cp=new at)):e===cr.VIEWPORT?t=$t(Pp||(Pp=new Jt)):t=dt(j0.div(p0)),t}generate(e){if(this.scope===cr.COORDINATE){let t=e.getFragCoord();if(e.isFlipY()){const n=e.getNodeProperties(p0).outputNode.build(e);t=`${e.getType("vec2")}( ${t}.x, ${n}.y - ${t}.y )`}return t}return super.generate(e)}}cr.COORDINATE="coordinate";cr.VIEWPORT="viewport";cr.SIZE="size";cr.UV="uv";const fa=St(cr,cr.UV),p0=St(cr,cr.SIZE),j0=St(cr,cr.COORDINATE),Yd=St(cr,cr.VIEWPORT),N6=Yd.zw,D6=j0.sub(Yd.xy),QQ=D6.div(N6),ZQ=Ee(()=>(console.warn('THREE.TSL: "viewportResolution" is deprecated. Use "screenSize" instead.'),p0),"vec2").once()(),KQ=Ee(()=>(console.warn('THREE.TSL: "viewportTopLeft" is deprecated. Use "screenUV" instead.'),fa),"vec2").once()(),JQ=Ee(()=>(console.warn('THREE.TSL: "viewportBottomLeft" is deprecated. Use "screenUV.flipY()" instead.'),fa.flipY()),"vec2").once()(),Lp=new at;class av extends Ka{static get type(){return"ViewportTextureNode"}constructor(e=fa,t=null,n=null){n===null&&(n=new vL,n.minFilter=Os),super(n,e,t),this.generateMipmaps=!1,this.isOutputTextureNode=!0,this.updateBeforeType=gn.FRAME}updateBefore(e){const t=e.renderer;t.getDrawingBufferSize(Lp);const n=this.value;(n.image.width!==Lp.width||n.image.height!==Lp.height)&&(n.image.width=Lp.width,n.image.height=Lp.height,n.needsUpdate=!0);const r=n.generateMipmaps;n.generateMipmaps=this.generateMipmaps,t.copyFramebufferToTexture(n),n.generateMipmaps=r}clone(){const e=new this.constructor(this.uvNode,this.levelNode,this.value);return e.generateMipmaps=this.generateMipmaps,e}}const eZ=rt(av).setParameterLength(0,3),XM=rt(av,null,null,{generateMipmaps:!0}).setParameterLength(0,3);let Ky=null;class tZ extends av{static get type(){return"ViewportDepthTextureNode"}constructor(e=fa,t=null){Ky===null&&(Ky=new $s),super(e,t,Ky)}}const YM=rt(tZ).setParameterLength(0,2);class zs extends Qt{static get type(){return"ViewportDepthNode"}constructor(e,t=null){super("float"),this.scope=e,this.valueNode=t,this.isViewportDepthNode=!0}generate(e){const{scope:t}=this;return t===zs.DEPTH_BASE?e.getFragDepth():super.generate(e)}setup({camera:e}){const{scope:t}=this,n=this.valueNode;let r=null;if(t===zs.DEPTH_BASE)n!==null&&(r=B6().assign(n));else if(t===zs.DEPTH)e.isPerspectiveCamera?r=I6(tr.z,Mc,wc):r=Qd(tr.z,Mc,wc);else if(t===zs.LINEAR_DEPTH)if(n!==null)if(e.isPerspectiveCamera){const s=QM(n,Mc,wc);r=Qd(s,Mc,wc)}else r=n;else r=Qd(tr.z,Mc,wc);return r}}zs.DEPTH_BASE="depthBase";zs.DEPTH="depth";zs.LINEAR_DEPTH="linearDepth";const Qd=(i,e,t)=>i.add(e).div(e.sub(t)),nZ=(i,e,t)=>e.sub(t).mul(i).sub(e),I6=(i,e,t)=>e.add(i).mul(t).div(t.sub(e).mul(i)),QM=(i,e,t)=>e.mul(t).div(t.sub(e).mul(i).sub(t)),ZM=(i,e,t)=>{e=e.max(1e-6).toVar();const n=Ha(i.negate().div(e)),r=Ha(t.div(e));return n.div(r)},iZ=(i,e,t)=>{const n=i.mul(Y1(t.div(e)));return se(Math.E).pow(n).mul(e).negate()},B6=rt(zs,zs.DEPTH_BASE),KM=St(zs,zs.DEPTH),u1=rt(zs,zs.LINEAR_DEPTH).setParameterLength(0,1),rZ=u1(YM());KM.assign=i=>B6(i);class Vo extends Qt{static get type(){return"ClippingNode"}constructor(e=Vo.DEFAULT){super(),this.scope=e}setup(e){super.setup(e);const t=e.clippingContext,{intersectionPlanes:n,unionPlanes:r}=t;return this.hardwareClipping=e.material.hardwareClipping,this.scope===Vo.ALPHA_TO_COVERAGE?this.setupAlphaToCoverage(n,r):this.scope===Vo.HARDWARE?this.setupHardwareClipping(r,e):this.setupDefault(n,r)}setupAlphaToCoverage(e,t){return Ee(()=>{const n=se().toVar("distanceToPlane"),r=se().toVar("distanceToGradient"),s=se(1).toVar("clipOpacity"),o=t.length;if(this.hardwareClipping===!1&&o>0){const l=Fo(t);Zn(o,({i:c})=>{const u=l.element(c);n.assign(tr.dot(u.xyz).negate().add(u.w)),r.assign(n.fwidth().div(2)),s.mulAssign(Za(r.negate(),r,n))})}const a=e.length;if(a>0){const l=Fo(e),c=se(1).toVar("intersectionClipOpacity");Zn(a,({i:u})=>{const p=l.element(u);n.assign(tr.dot(p.xyz).negate().add(p.w)),r.assign(n.fwidth().div(2)),c.mulAssign(Za(r.negate(),r,n).oneMinus())}),s.mulAssign(c.oneMinus())}$n.a.mulAssign(s),$n.a.equal(0).discard()})()}setupDefault(e,t){return Ee(()=>{const n=t.length;if(this.hardwareClipping===!1&&n>0){const s=Fo(t);Zn(n,({i:o})=>
3866{const a=s.element(o);tr.dot(a.xyz).greaterThan(a.w).discard()})}const r=e.length;if(r>0){const s=Fo(e),o=zl(!0).toVar("clipped");Zn(r,({i:a})=>{const l=s.element(a);o.assign(tr.dot(l.xyz).greaterThan(l.w).and(o))}),o.discard()}})()}setupHardwareClipping(e,t){const n=e.length;return t.enableHardwareClipping(n),Ee(()=>{const r=Fo(e),s=V0(t.getClipDistance());Zn(n,({i:o})=>{const a=r.element(o),l=tr.dot(a.xyz).sub(a.w).negate();s.element(o).assign(l)})})()}}Vo.ALPHA_TO_COVERAGE="alphaToCoverage";Vo.DEFAULT="default";Vo.HARDWARE="hardware";const sZ=()=>it(new Vo),oZ=()=>it(new Vo(Vo.ALPHA_TO_COVERAGE)),aZ=()=>it(new Vo(Vo.HARDWARE)),lZ=.05,bR=Ee(([i])=>$l(_n(1e4,go(_n(17,i.x).add(_n(.1,i.y)))).mul(rr(.1,gi(go(_n(13,i.y).add(i.x))))))),SR=Ee(([i])=>bR(dt(bR(i.xy),i.z))),cZ=Ee(([i])=>{const e=Qi(Bl(LM(i.xyz)),Bl(NM(i.xyz))),t=se(1).div(se(lZ).mul(e)).toVar("pixScale"),n=dt(Cf(Wa(Ha(t))),Cf(Q1(Ha(t)))),r=dt(SR(Wa(n.x.mul(i.xyz))),SR(Wa(n.y.mul(i.xyz)))),s=$l(Ha(t)),o=rr(_n(s.oneMinus(),r.x),_n(s,r.y)),a=Qs(s,s.oneMinus()),l=Se(o.mul(o).div(_n(2,a).mul(On(1,a))),o.sub(_n(.5,a)).div(On(1,a)),On(1,On(1,o).mul(On(1,o)).div(_n(2,a).mul(On(1,a))))),c=o.lessThan(a.oneMinus()).select(o.lessThan(a).select(l.x,l.y),l.z);return Qa(c,1e-6,1)}).setLayout({name:"getAlphaHashThreshold",type:"float",inputs:[{name:"position",type:"vec3"}]});class uZ extends M8{static get type(){return"VertexColorNode"}constructor(e){super(null,"vec4"),this.isVertexColorNode=!0,this.index=e}getAttributeName(){const e=this.index;return"color"+(e>0?e:"")}generate(e){const t=this.getAttributeName(e),n=e.hasGeometryAttribute(t);let r;return n===!0?r=super.generate(e):r=e.generateConst(this.nodeType,new Jt(1,1,1,1)),r}serialize(e){super.serialize(e),e.index=this.index}deserialize(e){super.deserialize(e),this.index=e.index}}const F6=(i=0)=>it(new uZ(i));class sr extends cs{static get type(){return"NodeMaterial"}get type(){return this.constructor.type}set type(e){}constructor(){super(),this.isNodeMaterial=!0,this.fog=!0,this.lights=!1,this.hardwareClipping=!1,this.lightsNode=null,this.envNode=null,this.aoNode=null,this.colorNode=null,this.normalNode=null,this.opacityNode=null,this.backdropNode=null,this.backdropAlphaNode=null,this.alphaTestNode=null,this.positionNode=null,this.geometryNode=null,this.depthNode=null,this.receivedShadowPositionNode=null,this.castShadowPositionNode=null,this.receivedShadowNode=null,this.castShadowNode=null,this.outputNode=null,this.mrtNode=null,this.fragmentNode=null,this.vertexNode=null,Object.defineProperty(this,"shadowPositionNode",{get:()=>this.receivedShadowPositionNode,set:e=>{console.warn('THREE.NodeMaterial: ".shadowPositionNode" was renamed to ".receivedShadowPositionNode".'),this.receivedShadowPositionNode=e}})}customProgramCacheKey(){return this.type+D5(this)}build(e){this.setup(e)}setupObserver(e){return new ZX(e)}setup(e){e.context.setupNormal=()=>this.setupNormal(e),e.context.setupPositionView=()=>this.setupPositionView(e),e.context.setupModelViewProjection=()=>this.setupModelViewProjection(e);const t=e.renderer,n=t.getRenderTarget();e.addStack();const r=this.vertexNode||this.setupVertex(e);e.stack.outputNode=r,this.setupHardwareClipping(e),this.geometryNode!==null&&(e.stack.outputNode=e.stack.outputNode.bypass(this.geometryNode)),e.addFlow("vertex",e.removeStack()),e.addStack();let s;const o=this.setupClipping(e);if((this.depthWrite===!0||this.depthTest===!0)&&(n!==null?n.depthBuffer===!0&&this.setupDepth(e):t.depth===!0&&this.setupDepth(e)),this.fragmentNode===null){this.setupDiffuseColor(e),this.setupVariants(e);const a=this.setupLighting(e);o!==null&&e.stack.add(o);const l=jt(a,$n.a).max(0);s=this.setupOutput(e,l),Xd.assign(s);const c=this.outputNode!==null;if(c&&(s=this.outputNode),n!==null){const u=t.getMRT(),p=this.mrtNode;u!==null?(c&&Xd.assign(s),s=u,p!==null&&(s=u.merge(p))):p!==null&&(s=p)}}else{let a=this.fragmentNode;a.isOutputStructNode!==!0&&(a=jt(a)),s=this.setupOutput(e,a)}e.stack.outputNode=s,e.addFlow("fragment",e.removeStack()),e.observer=this.setupObserver(e)}setupClipping(e){if(e.clippingContext===null)return null;const{unionPlanes:t,intersectionPlanes:n}=e.clippingContext;let r=null;if(t.length>0||n.length>0){const s=e.renderer.samples;this.alphaToCoverage&&s>1?r=oZ():e.stack.add(sZ())}return r}setupHardwareClipping(e){if(this.hardwareClipping=!1,e.clippingContext===null)return;const t=e.clippingContext.unionPlanes.length;t>0&&t<=8&&e.isAvailable("clipDistance")&&(e.stack.add(aZ()),this.hardwareClipping=!0)}setupDepth(e){const{renderer:t,camera:n}=e;let r=this.depthNode;if(r===null){const s=t.getMRT();s&&s.has("depth")?r=s.get("depth"):t.logarithmicDepthBuffer===!0&&(n.isPerspectiveCamera?r=ZM(tr.z,Mc,wc):r=Qd(tr.z,Mc,wc))}r!==null&&KM.assign(r).toStack()}setupPositionView(){return mh.mul(Xi).xyz}setupModelViewProjection(){return Ah.mul(tr)}setupVertex(e){return e.addStack(),this.setupPosition(e),e.context.vertex=e.removeStack(),jM}setupPosition(e){const{object:t,geometry:n}=e;if((n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color)&&P6(t).toStack(),t.isSkinnedMesh===!0&&R6(t).toStack(),this.displacementMap){const r=Rl("displacementMap","texture"),s=Rl("displacementScale","float"),o=Rl("displacementBias","float");Xi.addAssign(Zs.normalize().mul(r.x.mul(s).add(o)))}return t.isBatchedMesh&&T6(t).toStack(),t.isInstancedMesh&&t.instanceMatrix&&t.instanceMatrix.isInstancedBufferAttribute===!0&&w6(t).toStack(),this.positionNode!==null&&Xi.assign(this.positionNode.context({isPositionNodeInput:!0})),Xi}setupDiffuseColor({object:e,geometry:t}){let n=this.colorNode?jt(this.colorNode):$8;this.vertexColors===!0&&t.hasAttribute("color")&&(n=n.mul(F6())),e.instanceColor&&(n=c0("vec3","vInstanceColor").mul(n)),e.isBatchedMesh&&e._colorsTexture&&(n=c0("vec3","vBatchColor").mul(n)),$n.assign(n);const r=this.opacityNode?se(this.opacityNode):WM;if($n.a.assign($n.a.mul(r)),this.alphaTestNode!==null||this.alphaTest>0){const s=this.alphaTestNode!==null?se(this.alphaTestNode):W8;$n.a.lessThanEqual(s).discard()}this.alphaHash===!0&&$n.a.lessThan(cZ(Xi)).discard(),this.transparent===!1&&this.blending===ws&&this.alphaToCoverage===!1&&$n.a.assign(1)}setupVariants(){}setupOutgoingLight(){return this.lights===!0?Se(0):$n.rgb}setupNormal(){return this.normalNode?Se(this.normalNode):J8}setupEnvironment(){let e=null;return this.envNode?e=this.envNode:this.envMap&&(e=this.envMap.isCubeTexture?Rl("envMap","cubeTexture"):Rl("envMap","texture")),e}setupLightMap(e){let t=null;return e.material.lightMap&&(t=new YQ($M)),t}setupLights(e){const t=[],n=this.setupEnvironment(e);n&&n.isLightingNode&&t.push(n);const r=this.setupLightMap(e);if(r&&r.isLightingNode&&t.push(r),this.aoNode!==null||e.material.aoMap){const o=this.aoNode!==null?this.aoNode:x6;t.push(new jQ(o))}let s=this.lightsNode||e.lightsNode;return t.length>0&&(s=e.renderer.lighting.createNode([...s.getLights(),...t])),s}setupLightingModel(){}setupLighting(e){const{material:t}=e,{backdropNode:n,backdropAlphaNode:r,emissiveNode:s}=this,a=this.lights===!0||this.lightsNode!==null?this.setupLights(e):null;let l=this.setupOutgoingLight(e);if(a&&a.getScope().hasLights){const c=this.setupLightingModel(e)||null;l=L6(a,c,n,r)}else n!==null&&(l=Se(r!==null?Qn(l,n,r):n));return(s&&s.isNode===!0||t.emissive&&t.emissive.isColor===!0)&&(Mb.assign(Se(s||X8)),l=l.add(Mb)),l}setupFog(e,t){const n=e.fogNode;return n&&(Xd.assign(t),t=jt(n)),t}setupOutput(e,t){return this.fog===!0&&(t=this.setupFog(e,t)),t}setDefaultValues(e){for(const n in e){const r=e[n];this[n]===void 0&&(this[n]=r,r&&r.clone&&(this[n]=r.clone()))}const t=Object.getOwnPropertyDescriptors(e.constructor.prototype);for(const n in t)Object.getOwnPropertyDescriptor(this.constructor.prototype,n)===void 0&&t[n].get!==void 0&&Object.defineProperty(this.constructor.prototype,n,t[n])}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{},nodes:{}});const n=cs.prototype.toJSON.call(this,e),r=t1(this);n.inputNodes={};for(const{property:o,childNode:a}of r)n.inputNodes[o]=a.toJSON(e).uuid;function s(o){const a=[];for(const l in o){const c=o[l];delete c.metadata,a.push(c)}return a}if(t){const o=s(e.textures),a=s(e.images),l=s(e.nodes);o.length>0&&(n.textures=o),a.length>0&&(n.images=a),l.length>0&&(n.nodes=l)}return n}copy(e){return this.lightsNode=e.lightsNode,this.envNode=e.envNode,this.colorNode=e.colorNode,this.normalNode=e.normalNode,this.opacityNode=e.opacityNode,this.backdropNode=e.backdropNode,this.backdropAlphaNode=e.backdropAlphaNode,this.alphaTestNode=e.alphaTestNode,this.positionNode=e.positionNode,this.geometryNode=e.geometryNode,this.depthNode=e.depthNode,this.receivedShadowPositionNode=e.receivedShadowPositionNode,this.castShadowPositionNode=e.castShadowPositionNode,this.receivedShadowNode=e.receivedShadowNode,this.castShadowNode=e.castShadowNode,this.outputNode=e.outputNode,this.mrtNode=e.mrtNode,this.fragmentNode=e.fragmentNode,this.vertexNode=e.vertexNode,super.copy(e)}}const hZ=new $f;class dZ extends sr{static get type(){return"LineBasicNodeMaterial"}constructor(e){super(),this.isLineBasicNodeMaterial=!0,this.setDefaultValues(hZ),this.setValues(e)}}const fZ=new mk;class pZ extends sr{static get type(){return"LineDashedNodeMaterial"}constructor(e){super(),this.isLineDashedNodeMaterial=!0,this.setDefaultValues(fZ),this.dashOffset=0,this.offsetNode=null,this.dashScaleNode=null,this.dashSizeNode=null,this.gapSizeNode=null,this.setValues(e)}setupVariants(){const e=this.offsetNode?se(this.offsetNode):_6,t=this.dashScaleNode?se(this.dashScaleNode):A6,n=this.dashSizeNode?se(this.dashSizeNode):m6,r=this.gapSizeNode?se(this.gapSizeNode):g6;A_.assign(n),wb.assign(r);const s=Mo(ql("lineDistance").mul(t));(e?s.add(e):s).mod(A_.add(wb)).greaterThan(A_).discard()}}let Jy=null;class AZ extends av{static get type(){return"ViewportSharedTextureNode"}constructor(e=fa,t=null){Jy===null&&(Jy=new vL),super(e,t,Jy)}updateReference(){return this}}const mZ=rt(AZ).setParameterLength(0,2),U6=i=>it(i).mul(.5).add(.5),gZ=i=>it(i).mul(2).sub(1),_Z=new dk;class vZ extends sr{static get type(){return"MeshNormalNodeMaterial"}constructor(e){super(),this.isMeshNormalNodeMaterial=!0,this.setDefaultValues(_Z),this.setValues(e)}setupDiffuseColor(){const e=this.opacityNode?se(this.opacityNode):WM;$n.assign(ev(jt(U6(ji),e),Xt))}}class yZ extends Zi{static get type(){return"EquirectUVNode"}constructor(e=VM){super("vec2"),this.dirNode=e}setup(){const e=this.dirNode,t=e.z.atan(e.x).mul(1/(Math.PI*2)).add(.5),n=e.y.clamp(-1,1).asin().mul(1/Math.PI).add(.5);return dt(t,n)}}const JM=rt(yZ).setParameterLength(0,1);class O6 extends mL{constructor(e=1,t={}){super(e,t),this.isCubeRenderTarget=!0}fromEquirectangularTexture(e,t){const n=t.minFilter,r=t.generateMipmaps;t.generateMipmaps=!0,this.texture.type=t.type,this.texture.colorSpace
3866=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const s=new Hf(5,5,5),o=JM(VM),a=new sr;a.colorNode=Ln(t,o,0),a.side=oi,a.blending=Hs;const l=new qn(s,a),c=new N1;c.add(l),t.minFilter===Os&&(t.minFilter=xr);const u=new AL(1,10,this),p=e.getMRT();return e.setMRT(null),u.update(e,c),e.setMRT(p),t.minFilter=n,t.currentGenerateMipmaps=r,l.geometry.dispose(),l.material.dispose(),this}}const TA=new WeakMap;class xZ extends Zi{static get type(){return"CubeMapNode"}constructor(e){super("vec3"),this.envNode=e,this._cubeTexture=null,this._cubeTextureNode=Pf(null);const t=new L1;t.isRenderTargetTexture=!0,this._defaultTexture=t,this.updateBeforeType=gn.RENDER}updateBefore(e){const{renderer:t,material:n}=e,r=this.envNode;if(r.isTextureNode||r.isMaterialReferenceNode){const s=r.isTextureNode?r.value:n[r.property];if(s&&s.isTexture){const o=s.mapping;if(o===eh||o===th){if(TA.has(s)){const a=TA.get(s);MR(a,s.mapping),this._cubeTexture=a}else{const a=s.image;if(bZ(a)){const l=new O6(a.height);l.fromEquirectangularTexture(t,s),MR(l.texture,s.mapping),this._cubeTexture=l.texture,TA.set(s,l.texture),s.addEventListener("dispose",k6)}else this._cubeTexture=this._defaultTexture}this._cubeTextureNode.value=this._cubeTexture}else this._cubeTextureNode=this.envNode}}}setup(e){return this.updateBefore(e),this._cubeTextureNode}}function bZ(i){return i==null?!1:i.height>0}function k6(i){const e=i.target;e.removeEventListener("dispose",k6);const t=TA.get(e);t!==void 0&&(TA.delete(e),t.dispose())}function MR(i,e){e===eh?i.mapping=Aa:e===th&&(i.mapping=ma)}const z6=rt(xZ).setParameterLength(1);class ew extends Qf{static get type(){return"BasicEnvironmentNode"}constructor(e=null){super(),this.envNode=e}setup(e){e.context.environment=z6(this.envNode)}}class SZ extends Qf{static get type(){return"BasicLightMapNode"}constructor(e=null){super(),this.lightMapNode=e}setup(e){const t=se(1/Math.PI);e.context.irradianceLightMap=this.lightMapNode.mul(t)}}class lv{start(e){e.lightsNode.setupLights(e,e.lightsNode.getLightNodes(e)),this.indirect(e)}finish(){}direct(){}directRectArea(){}indirect(){}ambientOcclusion(){}}class V6 extends lv{constructor(){super()}indirect({context:e}){const t=e.ambientOcclusion,n=e.reflectedLight,r=e.irradianceLightMap;n.indirectDiffuse.assign(jt(0)),r?n.indirectDiffuse.addAssign(r):n.indirectDiffuse.addAssign(jt(1,1,1,0)),n.indirectDiffuse.mulAssign(t),n.indirectDiffuse.mulAssign($n.rgb)}finish(e){const{material:t,context:n}=e,r=n.outgoingLight,s=e.context.environment;if(s)switch(t.combine){case E0:r.rgb.assign(Qn(r.rgb,r.rgb.mul(s.rgb),wA.mul(v_)));break;case YP:r.rgb.assign(Qn(r.rgb,s.rgb,wA.mul(v_)));break;case QP:r.rgb.addAssign(s.rgb.mul(wA.mul(v_)));break;default:console.warn("THREE.BasicLightingModel: Unsupported .combine value:",t.combine);break}}}const MZ=new Bo;class wZ extends sr{static get type(){return"MeshBasicNodeMaterial"}constructor(e){super(),this.isMeshBasicNodeMaterial=!0,this.lights=!0,this.setDefaultValues(MZ),this.setValues(e)}setupNormal(){return Ho}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new ew(t):null}setupLightMap(e){let t=null;return e.material.lightMap&&(t=new SZ($M)),t}setupOutgoingLight(){return $n.rgb}setupLightingModel(){return new V6}}const Lf=Ee(({f0:i,f90:e,dotVH:t})=>{const n=t.mul(-5.55473).sub(6.98316).mul(t).exp2();return i.mul(n.oneMinus()).add(e.mul(n))}),ch=Ee(i=>i.diffuseColor.mul(1/Math.PI)),TZ=()=>se(.25),EZ=Ee(({dotNH:i})=>s1.mul(se(.5)).add(1).mul(se(1/Math.PI)).mul(i.pow(s1))),RZ=Ee(({lightDirection:i})=>{const e=i.add(wi).normalize(),t=ji.dot(e).clamp(),n=wi.dot(e).clamp(),r=Lf({f0:Is,f90:1,dotVH:n}),s=TZ(),o=EZ({dotNH:t});return r.mul(s).mul(o)});class G6 extends V6{constructor(e=!0){super(),this.specular=e}direct({lightDirection:e,lightColor:t,reflectedLight:n}){const s=ji.dot(e).clamp().mul(t);n.directDiffuse.addAssign(s.mul(ch({diffuseColor:$n.rgb}))),this.specular===!0&&n.directSpecular.addAssign(s.mul(RZ({lightDirection:e})).mul(wA))}indirect(e){const{ambientOcclusion:t,irradiance:n,reflectedLight:r}=e.context;r.indirectDiffuse.addAssign(n.mul(ch({diffuseColor:$n}))),r.indirectDiffuse.mulAssign(t)}}const CZ=new Wl;class PZ extends sr{static get type(){return"MeshLambertNodeMaterial"}constructor(e){super(),this.isMeshLambertNodeMaterial=!0,this.lights=!0,this.setDefaultValues(CZ),this.setValues(e)}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new ew(t):null}setupLightingModel(){return new G6(!1)}}const LZ=new BL;class NZ extends sr{static get type(){return"MeshPhongNodeMaterial"}constructor(e){super(),this.isMeshPhongNodeMaterial=!0,this.lights=!0,this.shininessNode=null,this.specularNode=null,this.setDefaultValues(LZ),this.setValues(e)}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new ew(t):null}setupLightingModel(){return new G6}setupVariants(){const e=(this.shininessNode?se(this.shininessNode):j8).max(1e-4);s1.assign(e);const t=this.specularNode||Y8;Is.assign(t)}copy(e){return this.shininessNode=e.shininessNode,this.specularNode=e.specularNode,super.copy(e)}}const q6=Ee(i=>{if(i.geometry.hasAttribute("normal")===!1)return se(0);const e=Ho.dFdx().abs().max(Ho.dFdy().abs());return e.x.max(e.y).max(e.z)}),tw=Ee(i=>{const{roughness:e}=i,t=q6();let n=e.max(.0525);return n=n.add(t),n=n.min(1),n}),H6=Ee(({alpha:i,dotNL:e,dotNV:t})=>{const n=i.pow2(),r=e.mul(n.add(n.oneMinus().mul(t.pow2())).sqrt()),s=t.mul(n.add(n.oneMinus().mul(e.pow2())).sqrt());return _a(.5,r.add(s).max(TN))}).setLayout({name:"V_GGX_SmithCorrelated",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNL",type:"float"},{name:"dotNV",type:"float"}]}),DZ=Ee(({alphaT:i,alphaB:e,dotTV:t,dotBV:n,dotTL:r,dotBL:s,dotNV:o,dotNL:a})=>{const l=a.mul(Se(i.mul(t),e.mul(n),o).length()),c=o.mul(Se(i.mul(r),e.mul(s),a).length());return _a(.5,l.add(c)).saturate()}).setLayout({name:"V_GGX_SmithCorrelated_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotTV",type:"float",qualifier:"in"},{name:"dotBV",type:"float",qualifier:"in"},{name:"dotTL",type:"float",qualifier:"in"},{name:"dotBL",type:"float",qualifier:"in"},{name:"dotNV",type:"float",qualifier:"in"},{name:"dotNL",type:"float",qualifier:"in"}]}),W6=Ee(({alpha:i,dotNH:e})=>{const t=i.pow2(),n=e.pow2().mul(t.oneMinus()).oneMinus();return t.div(n.pow2()).mul(1/Math.PI)}
3866).setLayout({name:"D_GGX",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNH",type:"float"}]}),IZ=se(1/Math.PI),BZ=Ee(({alphaT:i,alphaB:e,dotNH:t,dotTH:n,dotBH:r})=>{const s=i.mul(e),o=Se(e.mul(n),i.mul(r),s.mul(t)),a=o.dot(o),l=s.div(a);return IZ.mul(s.mul(l.pow2()))}).setLayout({name:"D_GGX_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotNH",type:"float",qualifier:"in"},{name:"dotTH",type:"float",qualifier:"in"},{name:"dotBH",type:"float",qualifier:"in"}]}),Nb=Ee(i=>{const{lightDirection:e,f0:t,f90:n,roughness:r,f:s,USE_IRIDESCENCE:o,USE_ANISOTROPY:a}=i,l=i.normalView||ji,c=r.pow2(),u=e.add(wi).normalize(),p=l.dot(e).clamp(),m=l.dot(wi).clamp(),g=l.dot(u).clamp(),v=wi.dot(u).clamp();let b=Lf({f0:t,f90:n,dotVH:v}),M,x;if(a0(o)&&(b=j1.mix(b,s)),a0(a)){const w=bA.dot(e),R=bA.dot(wi),C=bA.dot(u),N=Xu.dot(e),D=Xu.dot(wi),P=Xu.dot(u);M=DZ({alphaT:r1,alphaB:c,dotTV:R,dotBV:D,dotTL:w,dotBL:N,dotNV:m,dotNL:p}),x=BZ({alphaT:r1,alphaB:c,dotNH:g,dotTH:C,dotBH:P})}else M=H6({alpha:c,dotNL:p,dotNV:m}),x=W6({alpha:c,dotNH:g});return b.mul(M).mul(x)}),nw=Ee(({roughness:i,dotNV:e})=>{const t=jt(-1,-.0275,-.572,.022),n=jt(1,.0425,1.04,-.04),r=i.mul(t).add(n),s=r.x.mul(r.x).min(e.mul(-9.28).exp2()).mul(r.x).add(r.y);return dt(-1.04,1.04).mul(s).add(r.zw)}).setLayout({name:"DFGApprox",type:"vec2",inputs:[{name:"roughness",type:"float"},{name:"dotNV",type:"vec3"}]}),$6=Ee(i=>{const{dotNV:e,specularColor:t,specularF90:n,roughness:r}=i,s=nw({dotNV:e,roughness:r});return t.mul(s.x).add(n.mul(s.y))}),j6=Ee(({f:i,f90:e,dotVH:t})=>{const n=t.oneMinus().saturate(),r=n.mul(n),s=n.mul(r,r).clamp(0,.9999);return i.sub(Se(e).mul(s)).div(s.oneMinus())}).setLayout({name:"Schlick_to_F0",type:"vec3",inputs:[{name:"f",type:"vec3"},{name:"f90",type:"float"},{name:"dotVH",type:"float"}]}),FZ=Ee(({roughness:i,dotNH:e})=>{const t=i.pow2(),n=se(1).div(t),s=e.pow2().oneMinus().max(.0078125);return se(2).add(n).mul(s.pow(n.mul(.5))).div(2*Math.PI)}
vendor: 4,232 bytes, line 3866
3866).setLayout({name:"D_Charlie",type:"float",inputs:[{name:"roughness",type:"float"},{name:"dotNH",type:"float"}]}),UZ=Ee(({dotNV:i,dotNL:e})=>se(1).div(se(4).mul(e.add(i).sub(e.mul(i))))).setLayout({name:"V_Neubelt",type:"float",inputs:[{name:"dotNV",type:"float"},{name:"dotNL",type:"float"}]}),OZ=Ee(({lightDirection:i})=>{const e=i.add(wi).normalize(),t=ji.dot(i).clamp(),n=ji.dot(wi).clamp(),r=ji.dot(e).clamp(),s=FZ({roughness:$1,dotNH:r}),o=UZ({dotNV:n,dotNL:t});return zu.mul(s).mul(o)}),kZ=Ee(({N:i,V:e,roughness:t})=>{const s=.0078125,o=i.dot(e).saturate(),a=dt(t,o.oneMinus().sqrt());return a.assign(a.mul(.984375).add(s)),a}).setLayout({name:"LTC_Uv",type:"vec2",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"roughness",type:"float"}]}),zZ=Ee(({f:i})=>{const e=i.length();return Qi(e.mul(e).add(i.z).div(e.add(1)),0)}).setLayout({name:"LTC_ClippedSphereFormFactor",type:"float",inputs:[{name:"f",type:"vec3"}]}),Ym=Ee(({v1:i,v2:e})=>{const t=i.dot(e),n=t.abs().toVar(),r=n.mul(.0145206).add(.4965155).mul(n).add(.8543985).toVar(),s=n.add(4.1616724).mul(n).add(3.417594).toVar(),o=r.div(s),a=t.greaterThan(0).select(o,Qi(t.mul(t).oneMinus(),1e-7).inverseSqrt().mul(.5).sub(o));return i.cross(e).mul(a)}).setLayout({name:"LTC_EdgeVectorFormFactor",type:"vec3",inputs:[{name:"v1",type:"vec3"},{name:"v2",type:"vec3"}]}),wR=Ee(({N:i,V:e,P:t,mInv:n,p0:r,p1:s,p2:o,p3:a})=>{const l=s.sub(r).toVar(),c=a.sub(r).toVar(),u=l.cross(c),p=Se().toVar();return xn(u.dot(t.sub(r)).greaterThanEqual(0),()=>{const m=e.sub(i.mul(e.dot(i))).normalize(),g=i.cross(m).negate(),v=n.mul(hs(m,g,i).transpose()).toVar(),b=v.mul(r.sub(t)).normalize().toVar(),M=v.mul(s.sub(t)).normalize().toVar(),x=v.mul(o.sub(t)).normalize().toVar(),w=v.mul(a.sub(t)).normalize().toVar(),R=Se(0).toVar();R.addAssign(Ym({v1:b,v2:M})),R.addAssign(Ym({v1:M,v2:x})),R.addAssign(Ym({v1:x,v2:w})),R.addAssign(Ym({v1:w,v2:b})),p.assign(Se(zZ({f:R})))}),p}).setLayout({name:"LTC_Evaluate",type:"vec3",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"P",type:"vec3"},{name:"mInv",type:"mat3"},{name:"p0",type:"vec3"},{name:"p1",type:"vec3"},{name:"p2",type:"vec3"},{name:"p3",type:"vec3"}]}),cv=1/6,X6=i=>_n(cv,_n(i,_n(i,i.negate().add(3)).sub(3)).add(1)),Db=i=>_n(cv,_n(i,_n(i,_n(3,i).sub(6))).add(4)),Y6=i=>_n(cv,_n(i,_n(i,_n(-3,i).add(3)).add(3)).add(1)),Ib=i=>_n(cv,ua(i,3)),TR=i=>X6(i).add(Db(i)),ER=i=>Y6(i).add(Ib(i)),RR=i=>rr(-1,Db(i).div(X6(i).add(Db(i)))),CR=i=>rr(1,Ib(i).div(Y6(i).add(Ib(i)))),PR=(i,e,t)=>{const n=i.uvNode,r=_n(n,e.zw).add(.5),s=Wa(r),o=$l(r),a=TR(o.x),l=ER(o.x),c=RR(o.x),u=CR(o.x),p=RR(o.y),m=CR(o.y),g=dt(s.x.add(c),s.y.add(p)).sub(.5).mul(e.xy),v=dt(s.x.add(u),s.y.add(p)).sub(.5).mul(e.xy),b=dt(s.x.add(c),s.y.add(m)).sub(.5).mul(e.xy),M=dt(s.x.add(u),s.y.add(m)).sub(.5).mul(e.xy),x=TR(o.y).mul(rr(a.mul(i.sample(g).level(t)),l.mul(i.sample(v).level(t)))),w=ER(o.y).mul(rr(a.mul(i.sample(b).level(t)),l.mul(i.sample(M).level(t))));return x.add(w)},Q6=Ee(([i,e=se(3)])=>{const t=dt(i.size(me(e))),n=dt(i.size(me(e.add(1)))),r=_a(1,t),s=_a(1,n),o=PR(i,jt(r,t),Wa(e)),a=PR(i,jt(s,n),Q1(e));return $l(e).mix(o,a)}),LR=Ee(([i,e,t,n,r])=>{const s=Se(FM(e.negate(),Vl(i),_a(1,n))),o=Se(Bl(r[0].xyz),Bl(r[1].xyz),Bl(r[2].xyz));return Vl(s).mul(t.mul(o))}).setLayout({name:"getVolumeTransmissionRay",type:"vec3",inputs:[{name:"n",type:"vec3"},{name:"v",type:"vec3"},{name:"thickness",type:"float"},{name:"ior",type:"float"},{name:"modelMatrix",type:"mat4"}]}),VZ=Ee(([i,e])=>i.mul(Qa(e.mul(2).sub(2),0,1))).setLayout({name:"applyIorToRoughness",type:"float",inputs:[{name:"roughness",type:"float"},{name:"ior",type:"float"}]}),GZ=XM(),qZ=XM(),NR=Ee(([i,e,t],{material:n})=>{const s=(n.side===oi?GZ:qZ).sample(i),o=Ha(p0.x).mul(VZ(e,t));return Q6(s,o)}),DR=Ee(([i,e,t])=>(xn(t.notEqual(0),()=>{const n=Y1(e).negate().div(t);return RM(n.negate().mul(i))}),Se(1))).setLayout({name:"volumeAttenuation",type:"vec3",inputs:[{name:"transmissionDistance",type:"float"},{name:"attenuationColor",type:"vec3"},{name:"attenuationDistance",type:"float"}]}),HZ=Ee(([i,e,t,n,r,s,o,a,l,c,u,p,m,g,v])=>{let b,M;if(v){b=jt().toVar(),M=Se().toVar();const N=u.sub(1).mul(v.mul(.025)),D=Se(u.sub(N),u,u.add(N));Zn({start:0,end:3},({i:P})=>
vendor: 7,878 bytes, line 3866
3866{const O=D.element(P),I=LR(i,e,p,O,a),F=o.add(I),k=c.mul(l.mul(jt(F,1))),Y=dt(k.xy.div(k.w)).toVar();Y.addAssign(1),Y.divAssign(2),Y.assign(dt(Y.x,Y.y.oneMinus()));const W=NR(Y,t,O);b.element(P).assign(W.element(P)),b.a.addAssign(W.a),M.element(P).assign(n.element(P).mul(DR(Bl(I),m,g).element(P)))}),b.a.divAssign(3)}else{const N=LR(i,e,p,u,a),D=o.add(N),P=c.mul(l.mul(jt(D,1))),O=dt(P.xy.div(P.w)).toVar();O.addAssign(1),O.divAssign(2),O.assign(dt(O.x,O.y.oneMinus())),b=NR(O,t,u),M=n.mul(DR(Bl(N),m,g))}const x=M.rgb.mul(b.rgb),w=i.dot(e).clamp(),R=Se($6({dotNV:w,specularColor:r,specularF90:s,roughness:t})),C=M.r.add(M.g,M.b).div(3);return jt(R.oneMinus().mul(x),b.a.oneMinus().mul(C).oneMinus())}),WZ=hs(3.2404542,-.969266,.0556434,-1.5371385,1.8760108,-.2040259,-.4985314,.041556,1.0572252),$Z=i=>{const e=i.sqrt();return Se(1).add(e).div(Se(1).sub(e))},IR=(i,e)=>i.sub(e).div(i.add(e)).pow2(),jZ=(i,e)=>{const t=i.mul(2*Math.PI*1e-9),n=Se(54856e-17,44201e-17,52481e-17),r=Se(1681e3,1795300,2208400),s=Se(43278e5,93046e5,66121e5),o=se(9747e-17*Math.sqrt(2*Math.PI*45282e5)).mul(t.mul(2239900).add(e.x).cos()).mul(t.pow2().mul(-45282e5).exp());let a=n.mul(s.mul(2*Math.PI).sqrt()).mul(r.mul(t).add(e).cos()).mul(t.pow2().negate().mul(s).exp());return a=Se(a.x.add(o),a.y,a.z).div(10685e-11),WZ.mul(a)},XZ=Ee(({outsideIOR:i,eta2:e,cosTheta1:t,thinFilmThickness:n,baseF0:r})=>{const s=Qn(i,e,Za(0,.03,n)),a=i.div(s).pow2().mul(t.pow2().oneMinus()).oneMinus();xn(a.lessThan(0),()=>Se(1));const l=a.sqrt(),c=IR(s,i),u=Lf({f0:c,f90:1,dotVH:t}),p=u.oneMinus(),m=s.lessThan(i).select(Math.PI,0),g=se(Math.PI).sub(m),v=$Z(r.clamp(0,.9999)),b=IR(v,s.toVec3()),M=Lf({f0:b,f90:1,dotVH:l}),x=Se(v.x.lessThan(s).select(Math.PI,0),v.y.lessThan(s).select(Math.PI,0),v.z.lessThan(s).select(Math.PI,0)),w=s.mul(n,l,2),R=Se(g).add(x),C=u.mul(M).clamp(1e-5,.9999),N=C.sqrt(),D=p.pow2().mul(M).div(Se(1).sub(C)),O=u.add(D).toVar(),I=D.sub(p).toVar();return Zn({start:1,end:2,condition:"<=",name:"m"},({m:F})=>{I.mulAssign(N);const k=jZ(se(F).mul(w),se(F).mul(R)).mul(2);O.addAssign(I.mul(k))}),O.max(Se(0))}).setLayout({name:"evalIridescence",type:"vec3",inputs:[{name:"outsideIOR",type:"float"},{name:"eta2",type:"float"},{name:"cosTheta1",type:"float"},{name:"thinFilmThickness",type:"float"},{name:"baseF0",type:"vec3"}]}),YZ=Ee(({normal:i,viewDir:e,roughness:t})=>{const n=i.dot(e).saturate(),r=t.pow2(),s=Ur(t.lessThan(.25),se(-339.2).mul(r).add(se(161.4).mul(t)).sub(25.9),se(-8.48).mul(r).add(se(14.3).mul(t)).sub(9.95)),o=Ur(t.lessThan(.25),se(44).mul(r).sub(se(23.7).mul(t)).add(3.26),se(1.97).mul(r).sub(se(3.27).mul(t)).add(.72));return Ur(t.lessThan(.25),0,se(.1).mul(t).sub(.025)).add(s.mul(n).add(o).exp()).mul(1/Math.PI).saturate()}),ex=Se(.04),tx=se(1);class Z6 extends lv{constructor(e=!1,t=!1,n=!1,r=!1,s=!1,o=!1){super(),this.clearcoat=e,this.sheen=t,this.iridescence=n,this.anisotropy=r,this.transmission=s,this.dispersion=o,this.clearcoatRadiance=null,this.clearcoatSpecularDirect=null,this.clearcoatSpecularIndirect=null,this.sheenSpecularDirect=null,this.sheenSpecularIndirect=null,this.iridescenceFresnel=null,this.iridescenceF0=null}start(e){if(this.clearcoat===!0&&(this.clearcoatRadiance=Se().toVar("clearcoatRadiance"),this.clearcoatSpecularDirect=Se().toVar("clearcoatSpecularDirect"),this.clearcoatSpecularIndirect=Se().toVar("clearcoatSpecularIndirect")),this.sheen===!0&&(this.sheenSpecularDirect=Se().toVar("sheenSpecularDirect"),this.sheenSpecularIndirect=Se().toVar("sheenSpecularIndirect")),this.iridescence===!0){const t=ji.dot(wi).clamp();this.iridescenceFresnel=XZ({outsideIOR:se(1),eta2:vM,cosTheta1:t,thinFilmThickness:yM,baseF0:Is}),this.iridescenceF0=j6({f:this.iridescenceFresnel,f90:1,dotVH:t})}if(this.transmission===!0){const t=Fl,n=E8.sub(Fl).normalize(),r=rv,s=e.context;s.backdrop=HZ(r,n,Ua,$n,Is,d0,t,Uo,eo,Ah,SA,xM,SM,bM,this.dispersion?MM:null),s.backdropAlpha=o1,$n.a.mulAssign(Qn(1,s.backdrop.a,o1))}super.start(e)}computeMultiscattering(e,t,n){const r=ji.dot(wi).clamp(),s=nw({roughness:Ua,dotNV:r}),a=(this.iridescenceF0?j1.mix(Is,this.iridescenceF0):Is).mul(s.x).add(n.mul(s.y)),c=s.x.add(s.y).oneMinus(),u=Is.add(Is.oneMinus().mul(.047619)),p=a.mul(u).div(c.mul(u).oneMinus());e.addAssign(a),t.addAssign(p.mul(c))}direct({lightDirection:e,lightColor:t,reflectedLight:n}){const s=ji.dot(e).clamp().mul(t);if(this.sheen===!0&&this.sheenSpecularDirect.addAssign(s.mul(OZ({lightDirection:e}))),this.clearcoat===!0){const a=Ud.dot(e).clamp().mul(t);this.clearcoatSpecularDirect.addAssign(a.mul(Nb({lightDirection:e,f0:ex,f90:tx,roughness:h0,normalView:Ud})))}n.directDiffuse.addAssign(s.mul(ch({diffuseColor:$n.rgb}))),n.directSpecular.addAssign(s.mul(Nb({lightDirection:e,f0:Is,f90:1,roughness:Ua,iridescence:this.iridescence,f:this.iridescenceFresnel,USE_IRIDESCENCE:this.iridescence,USE_ANISOTROPY:this.anisotropy})))}directRectArea({lightColor:e,lightPosition:t,halfWidth:n,halfHeight:r,reflectedLight:s,ltc_1:o,ltc_2:a}){const l=t.add(n).sub(r),c=t.sub(n).sub(r),u=t.sub(n).add(r),p=t.add(n).add(r),m=ji,g=wi,v=tr.toVar(),b=kZ({N:m,V:g,roughness:Ua}),M=o.sample(b).toVar(),x=a.sample(b).toVar(),w=hs(Se(M.x,0,M.y),Se(0,1,0),Se(M.z,0,M.w)).toVar(),R=Is.mul(x.x).add(Is.oneMinus().mul(x.y)).toVar();s.directSpecular.addAssign(e.mul(R).mul(wR({N:m,V:g,P:v,mInv:w,p0:l,p1:c,p2:u,p3:p}))),s.directDiffuse.addAssign(e.mul($n).mul(wR({N:m,V:g,P:v,mInv:hs(1,0,0,0,1,0,0,0,1),p0:l,p1:c,p2:u,p3:p})))}indirect(e){this.indirectDiffuse(e),this.indirectSpecular(e),this.ambientOcclusion(e)}indirectDiffuse(e){const{irradiance:t,reflectedLight:n}=e.context;n.indirectDiffuse.addAssign(t.mul(ch({diffuseColor:$n})))}indirectSpecular(e){const{radiance:t,iblIrradiance:n,reflectedLight:r}=e.context;if(this.sheen===!0&&this.sheenSpecularIndirect.addAssign(n.mul(zu,YZ({normal:ji,viewDir:wi,roughness:$1}))),this.clearcoat===!0){const u=Ud.dot(wi).clamp(),p=$6({dotNV:u,specularColor:ex,specularF90:tx,roughness:h0});this.clearcoatSpecularIndirect.addAssign(this.clearcoatRadiance.mul(p))}const s=Se().toVar("singleScattering"),o=Se().toVar("multiScattering"),a=n.mul(1/Math.PI);this.computeMultiscattering(s,o,d0);const l=s.add(o),c=$n.mul(l.r.max(l.g).max(l.b).oneMinus());r.indirectSpecular.addAssign(t.mul(s)),r.indirectSpecular.addAssign(o.mul(a)),r.indirectDiffuse.addAssign(c.mul(a))}ambientOcclusion(e){const{ambientOcclusion:t,reflectedLight:n}=e.context,s=ji.dot(wi).clamp().add(t),o=Ua.mul(-16).oneMinus().negate().exp2(),a=t.sub(s.pow(o).oneMinus()).clamp();this.clearcoat===!0&&this.clearcoatSpecularIndirect.mulAssign(t),this.sheen===!0&&this.sheenSpecularIndirect.mulAssign(t),n.indirectDiffuse.mulAssign(t),n.indirectSpecular.mulAssign(a)}finish({context:e}){const{outgoingLight:t}=e;if(this.clearcoat===!0){const n=Ud.dot(wi).clamp(),r=Lf({dotVH:n,f0:ex,f90:tx}),s=t.mul(i1.mul(r).oneMinus()).add(this.clearcoatSpecularDirect.add(this.clearcoatSpecularIndirect).mul(i1));t.assign(s)}if(this.sheen===!0){const n=zu.r.max(zu.g).max(zu.b).mul(.157).oneMinus(),r=t.mul(n).add(this.sheenSpecularDirect,this.sheenSpecularIndirect);t.assign(r)}}}const BR=se(1),Bb=se(-2),Qm=se(.8),nx=se(-1),Zm=se(.4),ix=se(2),Km=se(.305),rx=se(3),FR=se(.21),QZ=se(4),UR=se(4),ZZ=se(16),KZ=Ee(([i])=>{const e=Se(gi(i)).toVar(),t=se(-1).toVar();return xn(e.x.greaterThan(e.z),()=>{xn(e.x.greaterThan(e.y),()=>{t.assign(Ur(i.x.greaterThan(0),0,3))}).Else(()=>{t.assign(Ur(i.y.greaterThan(0),1,4))})}).Else(()=>{xn(e.z.greaterThan(e.y),()=>{t.assign(Ur(i.z.greaterThan(0),2,5))}).Else(()=>{t.assign(Ur(i.y.greaterThan(0),1,4))})}),t}).setLayout({name:"getFace",type:"float",inputs:[{name:"direction",type:"vec3"}]}),JZ=Ee(([i,e])=>{const t=dt().toVar();return xn(e.equal(0),()=>{t.assign(dt(i.z,i.y).div(gi(i.x)))}).ElseIf(e.equal(1),()=>{t.assign(dt(i.x.negate(),i.z.negate()).div(gi(i.y)))}).ElseIf(e.equal(2),()=>{t.assign(dt(i.x.negate(),i.y).div(gi(i.z)))}
3866).ElseIf(e.equal(3),()=>{t.assign(dt(i.z.negate(),i.y).div(gi(i.x)))}).ElseIf(e.equal(4),()=>{t.assign(dt(i.x.negate(),i.z).div(gi(i.y)))}).Else(()=>{t.assign(dt(i.x,i.y).div(gi(i.z)))}),_n(.5,t.add(1))}).setLayout({name:"getUV",type:"vec2",inputs:[{name:"direction",type:"vec3"},{name:"face",type:"float"}]}),eK=Ee(([i])=>{const e=se(0).toVar();return xn(i.greaterThanEqual(Qm),()=>{e.assign(BR.sub(i).mul(nx.sub(Bb)).div(BR.sub(Qm)).add(Bb))}).ElseIf(i.greaterThanEqual(Zm),()=>{e.assign(Qm.sub(i).mul(ix.sub(nx)).div(Qm.sub(Zm)).add(nx))}).ElseIf(i.greaterThanEqual(Km),()=>{e.assign(Zm.sub(i).mul(rx.sub(ix)).div(Zm.sub(Km)).add(ix))}).ElseIf(i.greaterThanEqual(FR),()=>{e.assign(Km.sub(i).mul(QZ.sub(rx)).div(Km.sub(FR)).add(rx))}).Else(()=>{e.assign(se(-2).mul(Ha(_n(1.16,i))))}),e}).setLayout({name:"roughnessToMip",type:"float",inputs:[{name:"roughness",type:"float"}]}),K6=Ee(([i,e])=>{const t=i.toVar();t.assign(_n(2,t).sub(1));const n=Se(t,1).toVar();return xn(e.equal(0),()=>{n.assign(n.zyx)}).ElseIf(e.equal(1),()=>{n.assign(n.xzy),n.xz.mulAssign(-1)}).ElseIf(e.equal(2),()=>{n.x.mulAssign(-1)}).ElseIf(e.equal(3),()=>{n.assign(n.zyx),n.xz.mulAssign(-1)}).ElseIf(e.equal(4),()=>{n.assign(n.xzy),n.xy.mulAssign(-1)}).ElseIf(e.equal(5),()=>{n.z.mulAssign(-1)}),n}).setLayout({name:"getDirection",type:"vec3",inputs:[{name:"uv",type:"vec2"},{name:"face",type:"float"}]}),J6=Ee(([i,e,t,n,r,s])=>{const o=se(t),a=Se(e),l=Qa(eK(o),Bb,s),c=$l(l),u=Wa(l),p=Se(Fb(i,a,u,n,r,s)).toVar();return xn(c.notEqual(0),()=>{const m=Se(Fb(i,a,u.add(1),n,r,s)).toVar();p.assign(Qn(p,m,c))}),p}),Fb=Ee(([i,e,t,n,r,s])=>{const o=se(t).toVar(),a=Se(e),l=se(KZ(a)).toVar(),c=se(Qi(UR.sub(o),0)).toVar();o.assign(Qi(o,UR));const u=se(Cf(o)).toVar(),p=dt(JZ(a,l).mul(u.sub(2)).add(1)).toVar();return xn(l.greaterThan(2),()=>{p.y.addAssign(u),l.subAssign(3)}),p.x.addAssign(l.mul(u)),p.x.addAssign(c.mul(_n(3,ZZ))),p.y.addAssign(_n(4,Cf(s).sub(u))),p.x.mulAssign(n),p.y.mulAssign(r),i.sample(p).grad(dt(),dt())}),sx=Ee(({envMap:i,mipInt:e,outputDirection:t,theta:n,axis:r,CUBEUV_TEXEL_WIDTH:s,CUBEUV_TEXEL_HEIGHT:o,CUBEUV_MAX_MIP:a})=>{const l=Ml(n),c=t.mul(l).add(r.cross(t).mul(go(n))).add(r.mul(r.dot(t).mul(l.oneMinus())));return Fb(i,c,e,s,o,a)}),eD=Ee(({n:i,latitudinal:e,poleAxis:t,outputDirection:n,weights:r,samples:s,dTheta:o,mipInt:a,envMap:l,CUBEUV_TEXEL_WIDTH:c,CUBEUV_TEXEL_HEIGHT:u,CUBEUV_MAX_MIP:p})=>{const m=Se(Ur(e,t,K1(t,n))).toVar();xn(m.equal(Se(0)),()=>{m.assign(Se(n.z,0,n.x.negate()))}),m.assign(Vl(m));const g=Se().toVar();return g.addAssign(r.element(0).mul(sx({theta:0,axis:m,outputDirection:n,mipInt:a,envMap:l,CUBEUV_TEXEL_WIDTH:c,CUBEUV_TEXEL_HEIGHT:u,CUBEUV_MAX_MIP:p}))),Zn({start:me(1),end:i},({i:v})=>{xn(v.greaterThanEqual(s),()=>{C6()});const b=se(o.mul(se(v))).toVar();g.addAssign(r.element(v).mul(sx({theta:b.mul(-1),axis:m,outputDirection:n,mipInt:a,envMap:l,CUBEUV_TEXEL_WIDTH:c,CUBEUV_TEXEL_HEIGHT:u,CUBEUV_MAX_MIP:p}))),g.addAssign(r.element(v).mul(sx({theta:b,axis:m,outputDirection:n,mipInt:a,envMap:l,CUBEUV_TEXEL_WIDTH:c,CUBEUV_TEXEL_HEIGHT:u,CUBEUV_MAX_MIP:p})))}),jt(g,1)}),Od=4,OR=[.125,.215,.35,.446,.526,.582],Iu=20,ox=new N0(-1,1,1,-1,0,1),tK=new Br(90,1),kR=new qt;let ax=null,lx=0,cx=0;const Pu=(1+Math.sqrt(5))/2,Xh=1/Pu,zR=[new re(-Pu,Xh,0),new re(Pu,Xh,0),new re(-Xh,0,Pu),new re(Xh,0,Pu),new re(0,Pu,-Xh),new re(0,Pu,Xh),new re(-1,1,-1),new re(1,1,-1),new re(-1,1,1),new re(1,1,1)],nK=new re,tD=new WeakMap,iK=[3,1,5,0,4,2],ux=K6(Ci(),ql("faceIndex")).normalize(),iw=Se(ux.x,ux.y,ux.z);let rK=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._backgroundBox=null}get _hasInitialized(){return this._renderer.hasInitialized()}fromScene(e,t=0,n=.1,r=100,s={}){const{size:o=256,position:a=nK,renderTarget:l=null}=s;if(this._setSize(o),this._hasInitialized===!1){console.warn("THREE.PMREMGenerator: .fromScene() called before the backend is initialized. Try using .fromSceneAsync() instead.");const u=l||this._allocateTargets();
3866return s.renderTarget=u,this.fromSceneAsync(e,t,n,r,s),u}ax=this._renderer.getRenderTarget(),lx=this._renderer.getActiveCubeFace(),cx=this._renderer.getActiveMipmapLevel();const c=l||this._allocateTargets();return c.depthBuffer=!0,this._sceneToCubeUV(e,n,r,c,a),t>0&&this._blur(c,0,0,t),this._applyPMREM(c),this._cleanup(c),c}async fromSceneAsync(e,t=0,n=.1,r=100,s={}){return this._hasInitialized===!1&&await this._renderer.init(),this.fromScene(e,t,n,r,s)}fromEquirectangular(e,t=null){if(this._hasInitialized===!1){console.warn("THREE.PMREMGenerator: .fromEquirectangular() called before the backend is initialized. Try using .fromEquirectangularAsync() instead."),this._setSizeFromTexture(e);const n=t||this._allocateTargets();return this.fromEquirectangularAsync(e,n),n}return this._fromTexture(e,t)}async fromEquirectangularAsync(e,t=null){return this._hasInitialized===!1&&await this._renderer.init(),this._fromTexture(e,t)}fromCubemap(e,t=null){if(this._hasInitialized===!1){console.warn("THREE.PMREMGenerator: .fromCubemap() called before the backend is initialized. Try using .fromCubemapAsync() instead."),this._setSizeFromTexture(e);const n=t||this._allocateTargets();return this.fromCubemapAsync(e,t),n}return this._fromTexture(e,t)}async fromCubemapAsync(e,t=null){return this._hasInitialized===!1&&await this._renderer.init(),this._fromTexture(e,t)}async compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=GR(),await this._compileMaterial(this._cubemapMaterial))}async compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=qR(),await this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSizeFromTexture(e){e.mapping===Aa||e.mapping===ma?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4)}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(ax,lx,cx),e.scissorTest=!1,Jm(e,0,0,e.width,e.height)}_fromTexture(e,t){this._setSizeFromTexture(e),ax=this._renderer.getRenderTarget(),lx=this._renderer.getActiveCubeFace(),cx=this._renderer.getActiveMipmapLevel();const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:xr,minFilter:xr,generateMipmaps:!1,type:dr,format:Yi,colorSpace:ha},r=VR(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=VR(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas,lodMeshes:this._lodMeshes}=sK(s)),this._blurMaterial=oK(s,e,t)}return r}async _compileMaterial(e){const t=new qn(this._lodPlanes[0],e);await this._renderer.compile(t,ox)}_sceneToCubeUV(e,t,n,r,s){const o=tK;o.near=t,o.far=n;const a=[1,1,1,1,-1,1],l=[1,-1,1,-1,1,-1],c=this._renderer,u=c.autoClear;c.getClearColor(kR),c.autoClear=!1;let p=this._backgroundBox;
3866if(p===null){const v=new Bo({name:"PMREM.Background",side:oi,depthWrite:!1,depthTest:!1});p=new qn(new Hf,v)}let m=!1;const g=e.background;g?g.isColor&&(p.material.color.copy(g),e.background=null,m=!0):(p.material.color.copy(kR),m=!0),c.setRenderTarget(r),c.clear(),m&&c.render(p,o);for(let v=0;v<6;v++){const b=v%3;b===0?(o.up.set(0,a[v],0),o.position.set(s.x,s.y,s.z),o.lookAt(s.x+l[v],s.y,s.z)):b===1?(o.up.set(0,0,a[v]),o.position.set(s.x,s.y,s.z),o.lookAt(s.x,s.y+l[v],s.z)):(o.up.set(0,a[v],0),o.position.set(s.x,s.y,s.z),o.lookAt(s.x,s.y,s.z+l[v]));const M=this._cubeSize;Jm(r,b*M,v>2?M:0,M,M),c.render(e,o)}c.autoClear=u,e.background=g}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===Aa||e.mapping===ma;r?this._cubemapMaterial===null&&(this._cubemapMaterial=GR(e)):this._equirectMaterial===null&&(this._equirectMaterial=qR(e));const s=r?this._cubemapMaterial:this._equirectMaterial;s.fragmentNode.value=e;const o=this._lodMeshes[0];o.material=s;const a=this._cubeSize;Jm(t,0,0,3*a,2*a),n.setRenderTarget(t),n.render(o,ox)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.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=zR[(r-s-1)%zR.length];this._blur(e,s-1,s,o,a)}t.autoClear=n}_blur(e,t,n,r,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,r,"latitudinal",s),this._halfBlur(o,e,n,n,r,"longitudinal",s)}_halfBlur(e,t,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 u=3,p=this._lodMeshes[r];p.material=c;const m=tD.get(c),g=this._sizeLods[n]-1,v=isFinite(s)?Math.PI/(2*g):2*Math.PI/(2*Iu-1),b=s/v,M=isFinite(s)?1+Math.floor(u*b):Iu;M>Iu&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${M} samples when the maximum is set to ${Iu}`);const x=[];let w=0;for(let P=0;P<Iu;++P){const O=P/b,I=Math.exp(-O*O/2);x.push(I),P===0?w+=I:P<M&&(w+=2*I)}for(let P=0;P<x.length;P++)x[P]=x[P]/w;e.texture.frame=(e.texture.frame||0)+1,m.envMap.value=e.texture,m.samples.value=M,m.weights.array=x,m.latitudinal.value=o==="latitudinal"?1:0,a&&(m.poleAxis.value=a);const{_lodMax:R}=this;m.dTheta.value=v,m.mipInt.value=R-n;const C=this._sizeLods[r],N=3*C*(r>R-Od?r-R+Od:0),D=4*(this._cubeSize-C);Jm(t,N,D,3*C,2*C),l.setRenderTarget(t),l.render(p,ox)}};function sK(i){const e=[],t=[],n=[],r=[];let s=i;const o=i-Od+1+OR.length;for(let a=0;a<o;a++){const l=Math.pow(2,s);t.push(l);let c=1/l;a>i-Od?c=OR[a-i+Od-1]:a===0&&(c=0),n.push(c);const u=1/(l-2),p=-u,m=1+u,g=[p,p,m,p,m,m,p,p,m,m,p,m],v=6,b=6,M=3,x=2,w=1,R=new Float32Array(M*b*v),C=new Float32Array(x*b*v),N=new Float32Array(w*b*v);for(let P=0;P<v;P++){const O=P%3*2/3-1,I=P>2?0:-1,F=[O,I,0,O+2/3,I,0,O+2/3,I+1,0,O,I,0,O+2/3,I+1,0,O,I+1,0],k=iK[P];R.set(F,M*b*k),C.set(g,x*b*k);const Y=[k,k,k,k,k,k];N.set(Y,w*b*k)}const D=new vi;D.setAttribute("position",new Ii(R,M)),D.setAttribute("uv",new Ii(C,x)),D.setAttribute("faceIndex",new Ii(N,w)),e.push(D),r.push(new qn(D,null)),s>Od&&s--}return{lodPlanes:e,sizeLods:t,sigmas:n,lodMeshes:r}}function VR(i,e,t){const n=new rl(i,e,t);return n.texture.mapping=nh,n.texture.name="PMREM.cubeUv",n.texture.isPMREMTexture=!0,n.scissorTest=!0,n}function Jm(i,e,t,n,r){i.viewport.set(e,t,n,r),i.scissor.set(e,t,n,r)}function rw(i){const e=new sr;return e.depthTest=!1,e.depthWrite=!1,e.blending=Hs,e.name=`PMREM_${i}`,e}function oK(i,e,t){const n=Fo(new Array(Iu).fill(0)),r=$t(new re(0,1,0)),s=$t(0),o=se(Iu),a=$t(0),l=$t(1),c=Ln(null),u=$t(0),p=se(1/e),m=se(1/t),g=se(i),v={n:o,latitudinal:a,weights:n,poleAxis:r,outputDirection:iw,dTheta:s,samples:l,envMap:c,mipInt:u,CUBEUV_TEXEL_WIDTH:p,CUBEUV_TEXEL_HEIGHT:m,CUBEUV_MAX_MIP:g},b=rw("blur");return b.fragmentNode=eD({...v,latitudinal:a.equal(1)}),tD.set(b,v),b}function GR(i){const e=rw("cubemap");return e.fragmentNode=Pf(i,iw),e}function qR(i){const e=rw("equirect");return e.fragmentNode=Ln(i,JM(iw),0),e}const HR=new WeakMap;function aK(i){const e=Math.log2(i)-2,t=1/i;return{texelWidth:1/(3*Math.max(Math.pow(2,e),7*16)),texelHeight:t,maxMip:e}}function lK(i,e,t){const n=cK(e);let r=n.get(i);if((r!==void 0?r.pmremVersion:-1)!==i.pmremVersion){const o=i.image;if(i.isCubeTexture)if(hK(o))r=t.fromCubemap(i,r);else return null;else if(dK(o))r=t.fromEquirectangular(i,r);else return null;r.pmremVersion=i.pmremVersion,n.set(i,r)}return r.texture}function cK(i){let e=HR.get(i);return e===void 0&&(e=new WeakMap,HR.set(i,e)),e}class uK extends Zi{static get type(){return"PMREMNode"}constructor(e,t=null,n=null){super("vec3"),this._value=e,this._pmrem=null,this.uvNode=t,this.levelNode=n,this._generator=null;const r=new Cs;r.isRenderTargetTexture=!0,this._texture=Ln(r),this._width=$t(0),this._height=$t(0),this._maxMip=$t(0),this.updateBeforeType=gn.RENDER}set value(e){this._value=e,this._pmrem=null}get value(){return this._value}updateFromTexture(e){const t=aK(e.image.height);this._texture.value=e,this._width.value=t.texelWidth,this._height.value=t.texelHeight,this._maxMip.value=t.maxMip}updateBefore(e){let t=this._pmrem;const n=t?t.pmremVersion:-1,r=this._value;n!==r.pmremVersion&&(r.isPMREMTexture===!0?t=r:t=lK(r,e.renderer,this._generator),t!==null&&(this._pmrem=t,this.updateFromTexture(t)))}setup(e){this._generator===null&&(this._generator=new rK(e.renderer)),this.updateBefore(e);let t=this.uvNode;t===null&&e.context.getUV&&(t=e.context.getUV(this)),t=qM.mul(Se(t.x,t.y.negate(),t.z));let n=this.levelNode;return n===null&&e.context.getTextureLevel&&(n=e.context.getTextureLevel(this)),J6(this._texture,t,n,this._width,this._height,this._maxMip)}dispose(){super.dispose(),this._generator!==null&&this._generator.dispose()}}function hK(i){if(i==null)return!1;let e=0;const t=6;for(let n=0;n<t;n++)i[n]!==void 0&&e++;return e===t}function dK(i){return i==null?!1:i.height>0}const sw=rt(uK).setParameterLength(1,3),WR=new WeakMap;class fK extends Qf{static get type(){return"EnvironmentNode"}constructor(e=null){super(),this.envNode=e}setup(e){const{material:t}=e;let n=this.envNode;if(n.isTextureNode||n.isMaterialReferenceNode){const p=n.isTextureNode?n.value:t[n.property];let m=WR.get(p);m===void 0&&(m=sw(p),WR.set(p,m)),n=m}const s=t.useAnisotropy===!0||t.anisotropy>0?q8:ji,o=n.context($R(Ua,s)).mul(__),a=n.context(pK(rv)).mul(Math.PI).mul(__),l=MA(o),c=MA(a);
vendor: 4,872 bytes, line 3866
3866e.context.radiance.addAssign(l),e.context.iblIrradiance.addAssign(c);const u=e.context.lightingModel.clearcoatRadiance;if(u){const p=n.context($R(h0,Ud)).mul(__),m=MA(p);u.addAssign(m)}}}const $R=(i,e)=>{let t=null;return{getUV:()=>(t===null&&(t=wi.negate().reflect(e),t=i.mul(i).mix(t,e).normalize(),t=t.transformDirection(eo)),t),getTextureLevel:()=>i}},pK=i=>({getUV:()=>i,getTextureLevel:()=>se(1)}),AK=new IL;class nD extends sr{static get type(){return"MeshStandardNodeMaterial"}constructor(e){super(),this.isMeshStandardNodeMaterial=!0,this.lights=!0,this.emissiveNode=null,this.metalnessNode=null,this.roughnessNode=null,this.setDefaultValues(AK),this.setValues(e)}setupEnvironment(e){let t=super.setupEnvironment(e);return t===null&&e.environmentNode&&(t=e.environmentNode),t?new fK(t):null}setupLightingModel(){return new Z6}setupSpecular(){const e=Qn(Se(.04),$n.rgb,u0);Is.assign(e),d0.assign(1)}setupVariants(){const e=this.metalnessNode?se(this.metalnessNode):K8;u0.assign(e);let t=this.roughnessNode?se(this.roughnessNode):Z8;t=tw({roughness:t}),Ua.assign(t),this.setupSpecular(),$n.assign(jt($n.rgb.mul(e.oneMinus()),$n.a))}copy(e){return this.emissiveNode=e.emissiveNode,this.metalnessNode=e.metalnessNode,this.roughnessNode=e.roughnessNode,super.copy(e)}}const mK=new uk;class gK extends nD{static get type(){return"MeshPhysicalNodeMaterial"}constructor(e){super(),this.isMeshPhysicalNodeMaterial=!0,this.clearcoatNode=null,this.clearcoatRoughnessNode=null,this.clearcoatNormalNode=null,this.sheenNode=null,this.sheenRoughnessNode=null,this.iridescenceNode=null,this.iridescenceIORNode=null,this.iridescenceThicknessNode=null,this.specularIntensityNode=null,this.specularColorNode=null,this.iorNode=null,this.transmissionNode=null,this.thicknessNode=null,this.attenuationDistanceNode=null,this.attenuationColorNode=null,this.dispersionNode=null,this.anisotropyNode=null,this.setDefaultValues(mK),this.setValues(e)}get useClearcoat(){return this.clearcoat>0||this.clearcoatNode!==null}get useIridescence(){return this.iridescence>0||this.iridescenceNode!==null}get useSheen(){return this.sheen>0||this.sheenNode!==null}get useAnisotropy(){return this.anisotropy>0||this.anisotropyNode!==null}get useTransmission(){return this.transmission>0||this.transmissionNode!==null}get useDispersion(){return this.dispersion>0||this.dispersionNode!==null}setupSpecular(){const e=this.iorNode?se(this.iorNode):d6;SA.assign(e),Is.assign(Qn(Qs(IM(SA.sub(1).div(SA.add(1))).mul(Q8),Se(1)).mul(Lb),$n.rgb,u0)),d0.assign(Qn(Lb,1,u0))}setupLightingModel(){return new Z6(this.useClearcoat,this.useSheen,this.useIridescence,this.useAnisotropy,this.useTransmission,this.useDispersion)}setupVariants(e){if(super.setupVariants(e),this.useClearcoat){const t=this.clearcoatNode?se(this.clearcoatNode):e6,n=this.clearcoatRoughnessNode?se(this.clearcoatRoughnessNode):t6;i1.assign(t),h0.assign(tw({roughness:n}))}if(this.useSheen){const t=this.sheenNode?Se(this.sheenNode):r6,n=this.sheenRoughnessNode?se(this.sheenRoughnessNode):s6;zu.assign(t),$1.assign(n)}if(this.useIridescence){const t=this.iridescenceNode?se(this.iridescenceNode):a6,n=this.iridescenceIORNode?se(this.iridescenceIORNode):l6,r=this.iridescenceThicknessNode?se(this.iridescenceThicknessNode):c6;j1.assign(t),vM.assign(n),yM.assign(r)}if(this.useAnisotropy){const t=(this.anisotropyNode?dt(this.anisotropyNode):o6).toVar();bc.assign(t.length()),xn(bc.equal(0),()=>{t.assign(dt(1,0))}).Else(()=>{t.divAssign(dt(bc)),bc.assign(bc.saturate())}),r1.assign(bc.pow2().mix(Ua.pow2(),1)),bA.assign(Vu[0].mul(t.x).add(Vu[1].mul(t.y))),Xu.assign(Vu[1].mul(t.x).sub(Vu[0].mul(t.y)))}if(this.useTransmission){const t=this.transmissionNode?se(this.transmissionNode):u6,n=this.thicknessNode?se(this.thicknessNode):h6,r=this.attenuationDistanceNode?se(this.attenuationDistanceNode):f6,s=this.attenuationColorNode?Se(this.attenuationColorNode):p6;if(o1.assign(t),xM.assign(n),bM.assign(r),SM.assign(s),this.useDispersion){const o=this.dispersionNode?se(this.dispersionNode):y6;MM.assign(o)}}}setupClearcoatNormal(){return this.clearcoatNormalNode?Se(this.clearcoatNormalNode):n6}setup(e){e.context.setupClearcoatNormal=()=>this.setupClearcoatNormal(e),super.setup(e)}copy(e){return this.clearcoatNode=e.clearcoatNode,this.clearcoatRoughnessNode=e.clearcoatRoughnessNode,this.clearcoatNormalNode=e.clearcoatNormalNode,this.sheenNode=e.sheenNode,this.sheenRoughnessNode=e.sheenRoughnessNode,this.iridescenceNode=e.iridescenceNode,this.iridescenceIORNode=e.iridescenceIORNode,this.iridescenceThicknessNode=e.iridescenceThicknessNode,this.specularIntensityNode=e.specularIntensityNode,this.specularColorNode=e.specularColorNode,this.transmissionNode=e.transmissionNode,this.thicknessNode=e.thicknessNode,this.attenuationDistanceNode=e.attenuationDistanceNode,this.attenuationColorNode=e.attenuationColorNode,this.dispersionNode=e.dis
3866persionNode,this.anisotropyNode=e.anisotropyNode,super.copy(e)}}const _K=Ee(({normal:i,lightDirection:e,builder:t})=>{const n=i.dot(e),r=dt(n.mul(.5).add(.5),0);if(t.material.gradientMap){const s=Rl("gradientMap","texture").context({getUV:()=>r});return Se(s.r)}else{const s=r.fwidth().mul(.5);return Qn(Se(.7),Se(1),Za(se(.7).sub(s.x),se(.7).add(s.x),r.x))}});class vK extends lv{direct({lightDirection:e,lightColor:t,reflectedLight:n},r){const s=_K({normal:nv,lightDirection:e,builder:r}).mul(t);n.directDiffuse.addAssign(s.mul(ch({diffuseColor:$n.rgb})))}indirect(e){const{ambientOcclusion:t,irradiance:n,reflectedLight:r}=e.context;r.indirectDiffuse.addAssign(n.mul(ch({diffuseColor:$n}))),r.indirectDiffuse.mulAssign(t)}}const yK=new hk;class xK extends sr{static get type(){return"MeshToonNodeMaterial"}constructor(e){super(),this.isMeshToonNodeMaterial=!0,this.lights=!0,this.setDefaultValues(yK),this.setValues(e)}setupLightingModel(){return new vK}}class bK extends Zi{static get type(){return"MatcapUVNode"}constructor(){super("vec2")}setup(){const e=Se(wi.z,0,wi.x.negate()).normalize(),t=wi.cross(e);return dt(e.dot(ji),t.dot(ji)).mul(.495).add(.5)}}const iD=St(bK),SK=new Ak;class MK extends sr{static get type(){return"MeshMatcapNodeMaterial"}constructor(e){super(),this.isMeshMatcapNodeMaterial=!0,this.setDefaultValues(SK),this.setValues(e)}setupVariants(e){const t=iD;let n;e.material.matcap?n=Rl("matcap","texture").context({getUV:()=>t}):n=Se(Qn(.2,.8,t.y)),$n.rgb.mulAssign(n.rgb)}}class wK extends Zi{static get type(){return"RotateNode"}constructor(e,t){super(),this.positionNode=e,this.rotationNode=t}getNodeType(e){return this.positionNode.getNodeType(e)}setup(e){const{rotationNode:t,positionNode:n}=this;if(this.getNodeType(e)==="vec2"){const s=t.cos(),o=t.sin();return W1(s,o,o.negate(),s).mul(n)}else{const s=t,o=ju(jt(1,0,0,0),jt(0,Ml(s.x),go(s.x).negate(),0),jt(0,go(s.x),Ml(s.x),0),jt(0,0,0,1)),a=ju(jt(Ml(s.y),0,go(s.y),0),jt(0,1,0,0),jt(go(s.y).negate(),0,Ml(s.y),0),jt(0,0,0,1)),l=ju(jt(Ml(s.z),go(s.z).negate(),0,0),jt(go(s.z),Ml(s.z),0,0),jt(0,0,1,0),jt(0,0,0,1));return o.mul(a).mul(l).mul(jt(n,1)).xyz}}}const uv=rt(wK).setParameterLength(2),TK=new w9;class rD extends sr{static get type(){return"SpriteNodeMaterial"}constructor(e){super(),this.isSpriteNodeMaterial=!0,this._useSizeAttenuation=!0,this.positionNode=null,this.rotationNode=null,this.scaleNode=null,this.transparent=!0,this.setDefaultValues(TK),this.setValues(e)}setupPositionView(e){const{object:t,camera:n}=e,r=this.sizeAttenuation,{positionNode:s,rotationNode:o,scaleNode:a}=this,l=mh.mul(Se(s||0));let c=dt(Uo[0].xyz.length(),Uo[1].xyz.length());if(a!==null&&(c=c.mul(dt(a))),r===!1)if(n.isPerspectiveCamera)c=c.mul(l.z.negate());else{const g=se(2).div(Ah.element(1).element(1));c=c.mul(g.mul(2))}let u=G0.xy;if(t.center&&t.center.isVector2===!0){const g=UY("center","vec2",t);u=u.sub(g.sub(.5))}u=u.mul(c);const p=se(o||i6),m=uv(u,p);return jt(l.xy.add(m),l.zw)}copy(e){return this.positionNode=e.positionNode,this.rotationNode=e.rotationNode,this.scaleNode=e.scaleNode,super.copy(e)}get sizeAttenuation(){return this._useSizeAttenuation}set sizeAttenuation(e){this._useSizeAttenuation!==e&&(this._useSizeAttenuation=e,this.needsUpdate=!0)}}const EK=new jS;class RK extends rD{static get type(){return"PointsNodeMaterial"}constructor(e){super(),this.sizeNode=null,this.isPointsNodeMaterial=!0,this.setDefaultValues(EK),this.setValues(e)}setupPositionView(){const{positionNode:e}=this;return mh.mul(Se(e||Xi)).xyz}setupVertex(e){const t=super.setupVertex(e);if(e.material.isNodeMaterial!==!0)return t;const{rotationNode:n,scaleNode:r,sizeNode:s}=this,o=G0.xy.toVar(),a=Yd.z.div(Yd.w);if(n&&n.isNode){const c=se(n);o.assign(uv(o,c))}let l=s!==null?dt(s):v6;return this.sizeAttenuation===!0&&(l=l.mul(l.div(tr.z.negate()))),r&&r.isNode&&(l=l.mul(dt(r))),o.mulAssign(l.mul(2)),o.assign(o.div(Yd.z)),o.y.assign(o.y.mul(a)),o.assign(o.mul(t.w)),t.addAssign(jt(o,0,0)),t}get alphaToCoverage(){return this._useAlphaToCoverage}set alphaToCoverage(e){this._useAlphaToCoverage!==e&&(this._useAlphaToCoverage=e,this.needsUpdate=!0)}}class CK extends lv{constructor(){super(),this.shadowNode=se(1).toVar("shadowMask")}direct({lightNode:e}){this.shadowNode.mulAssign(e.shadowNode)}finish({context:e}){$n.a.mulAssign(this.shadowNode.oneMinus()),e.outgoingLight.rgb.assign($n.rgb)}}const PK=new ck;class LK extends sr{static get type(){return"ShadowNodeMaterial"}constructor(e){super(),this.isShadowNodeMaterial=!0,this.lights=!0,this.transparent=!0,this.setDefaultValues(PK),this.setValues(e)}setupLightingModel(){return new CK}}Yf("vec3");Yf("vec3");Yf("vec3");class NK{constructor(e,t){this.nodes=e,this.info=t,this._context=typeof self<"u"?self:null,this._animationLoop=null,this._requestId=null}start(){const e=(t,n)=>{this._requestId=this._context.requestAnimationFrame(e),this.info.autoReset===!0&&this.info.reset(),this.nodes.nodeFrame.update(
3866),this.info.frame=this.nodes.nodeFrame.frameId,this._animationLoop!==null&&this._animationLoop(t,n)};e()}stop(){this._context.cancelAnimationFrame(this._requestId),this._requestId=null}getAnimationLoop(){return this._animationLoop}setAnimationLoop(e){this._animationLoop=e}getContext(){return this._context}setContext(e){this._context=e}dispose(){this.stop()}}class va{constructor(){this.weakMap=new WeakMap}get(e){let t=this.weakMap;for(let n=0;n<e.length-1;n++)if(t=t.get(e[n]),t===void 0)return;return t.get(e[e.length-1])}set(e,t){let n=this.weakMap;for(let r=0;r<e.length-1;r++){const s=e[r];n.has(s)===!1&&n.set(s,new WeakMap),n=n.get(s)}return n.set(e[e.length-1],t),this}delete(e){let t=this.weakMap;for(let n=0;n<e.length-1;n++)if(t=t.get(e[n]),t===void 0)return!1;return t.delete(e[e.length-1])}}let DK=0;function IK(i){const e=Object.keys(i);let t=Object.getPrototypeOf(i);for(;t;){const n=Object.getOwnPropertyDescriptors(t);for(const r in n)if(n[r]!==void 0){const s=n[r];s&&typeof s.get=="function"&&e.push(r)}t=Object.getPrototypeOf(t)}return e}class BK{constructor(e,t,n,r,s,o,a,l,c,u){this.id=DK++,this._nodes=e,this._geometries=t,this.renderer=n,this.object=r,this.material=s,this.scene=o,this.camera=a,this.lightsNode=l,this.context=c,this.geometry=r.geometry,this.version=s.version,this.drawRange=null,this.attributes=null,this.pipeline=null,this.group=null,this.vertexBuffers=null,this.drawParams=null,this.bundle=null,this.clippingContext=u,this.clippingContextCacheKey=u!==null?u.cacheKey:"",this.initialNodesCacheKey=this.getDynamicCacheKey(),this.initialCacheKey=this.getCacheKey(),this._nodeBuilderState=null,this._bindings=null,this._monitor=null,this.onDispose=null,this.isRenderObject=!0,this.onMaterialDispose=()=>{this.dispose()},this.material.addEventListener("dispose",this.onMaterialDispose)}updateClipping(e){this.clippingContext=e}get clippingNeedsUpdate(){return this.clippingContext===null||this.clippingContext.cacheKey===this.clippingContextCacheKey?!1:(this.clippingContextCacheKey=this.clippingContext.cacheKey,!0)}get hardwareClippingPlanes(){return this.material.hardwareClipping===!0?this.clippingContext.unionClippingCount:0}getNodeBuilderState(){return this._nodeBuilderState||(this._nodeBuilderState=this._nodes.getForRender(this))}getMonitor(){return this._monitor||(this._monitor=this.getNodeBuilderState().observer)}getBindings(){return this._bindings||(this._bindings=this.getNodeBuilderState().createBindings())}getBindingGroup(e){for(const t of this.getBindings())if(t.name===e)return t}getIndex(){return this._geometries.getIndex(this)}getIndirect(){return this._geometries.getIndirect(this)}getChainArray(){return[this.object,this.material,this.context,this.lightsNode]}setGeometry(e){this.geometry=e,this.attributes=null}getAttributes(){if(this.attributes!==null)return this.attributes;const e=this.getNodeBuilderState().nodeAttributes,t=this.geometry,n=[],r=new Set;for(const s of e){const o=s.node&&s.node.attribute?s.node.attribute:t.getAttribute(s.name);if(o===void 0)continue;n.push(o);const a=o.isInterleavedBufferAttribute?o.data:o;r.add(a)}return this.attributes=n,this.vertexBuffers=Array.from(r.values()),n}getVertexBuffers(){return this.vertexBuffers===null&&this.getAttributes(),this.vertexBuffers}getDrawParameters(){const{object:e,material:t,geometry:n,group:r,drawRange:s}=this,o=this.drawParams||(this.drawParams={vertexCount:0,firstVertex:0,instanceCount:0,firstInstance:0}),a=this.getIndex(),l=a!==null;let c=1;if(n.isInstancedBufferGeometry===!0?c=n.instanceCount:e.count!==void 0&&(c=Math.max(0,e.count)),c===0)return null;if(o.instanceCount=c,e.isBatchedMesh===!0)return o;let u=1;t.wireframe===!0&&!e.isPoints&&!e.isLineSegments&&!e.isLine&&!e.isLineLoop&&(u=2);let p=s.start*u,m=(s.start+s.count)*u;r!==null&&(p=Math.max(p,r.start*u),m=Math.min(m,(r.start+r.count)*u));const g=n.attributes.position;let v=1/0;l?v=a.count:g!=null&&(v=g.count),p=Math.max(p,0),m=Math.min(m,v);const b=m-p;return b<0||b===1/0?null:(o.vertexCount=b,o.firstVertex=p,o)}getGeometryCacheKey(){const{geometry:e}=this;let t="";for(const n of Object.keys(e.attributes).sort()){const r=e.attributes[n];t+=n+",",r.data&&(t+=r.data.stride+","),r.offset&&(t+=r.offset+","),r.itemSize&&(t+=r.itemSize+","),r.normalized&&(t+="n,")}for(const n of Object.keys(e.morphAttributes).sort()){const r=e.morphAttributes[n];t+="morph-"+n+",";for(let s=0,o=r.length;s<o;s++){const a=r[s];t+=a.id+","}}return e.index&&(t+="index,"),t}getMaterialCacheKey(){const{object:e,material:t}=this;let n=t.customProgramCacheKey();
3866for(const r of IK(t)){if(/^(is[A-Z]|_)|^(visible|version|uuid|name|opacity|userData)$/.test(r))continue;const s=t[r];let o;if(s!==null){const a=typeof s;a==="number"?o=s!==0?"1":"0":a==="object"?(o="{",s.isTexture&&(o+=s.mapping),o+="}"):o=String(s)}else o=String(s);n+=o+","}return n+=this.clippingContextCacheKey+",",e.geometry&&(n+=this.getGeometryCacheKey()),e.skeleton&&(n+=e.skeleton.bones.length+","),e.isBatchedMesh&&(n+=e._matricesTexture.uuid+",",e._colorsTexture!==null&&(n+=e._colorsTexture.uuid+",")),e.count>1&&(n+=e.uuid+","),n+=e.receiveShadow+",",N5(n)}get needsGeometryUpdate(){return this.geometry.id!==this.object.geometry.id}get needsUpdate(){return this.initialNodesCacheKey!==this.getDynamicCacheKey()||this.clippingNeedsUpdate}getDynamicCacheKey(){let e=0;return this.material.isShadowPassMaterial!==!0&&(e=this._nodes.getCacheKey(this.scene,this.lightsNode)),this.camera.isArrayCamera&&(e=o0(e,this.camera.cameras.length)),this.object.receiveShadow&&(e=o0(e,1)),e}getCacheKey(){return this.getMaterialCacheKey()+this.getDynamicCacheKey()}dispose(){this.material.removeEventListener("dispose",this.onMaterialDispose),this.onDispose()}}const mu=[];class FK{constructor(e,t,n,r,s,o){this.renderer=e,this.nodes=t,this.geometries=n,this.pipelines=r,this.bindings=s,this.info=o,this.chainMaps={}}get(e,t,n,r,s,o,a,l){const c=this.getChainMap(l);mu[0]=e,mu[1]=t,mu[2]=o,mu[3]=s;let u=c.get(mu);return u===void 0?(u=this.createRenderObject(this.nodes,this.geometries,this.renderer,e,t,n,r,s,o,a,l),c.set(mu,u)):(u.updateClipping(a),u.needsGeometryUpdate&&u.setGeometry(e.geometry),(u.version!==t.version||u.needsUpdate)&&(u.initialCacheKey!==u.getCacheKey()?(u.dispose(),u=this.get(e,t,n,r,s,o,a,l)):u.version=t.version)),mu.length=0,u}getChainMap(e="default"){return this.chainMaps[e]||(this.chainMaps[e]=new va)}dispose(){this.chainMaps={}}createRenderObject(e,t,n,r,s,o,a,l,c,u,p){const m=this.getChainMap(p),g=new BK(e,t,n,r,s,o,a,l,c,u);return g.onDispose=()=>{this.pipelines.delete(g),this.bindings.delete(g),this.nodes.delete(g),m.delete(g.getChainArray())},g}}class Zc{constructor(){this.data=new WeakMap}get(e){let t=this.data.get(e);return t===void 0&&(t={},this.data.set(e,t)),t}delete(e){let t=null;return this.data.has(e)&&(t=this.data.get(e),this.data.delete(e)),t}has(e){return this.data.has(e)}dispose(){this.data=new WeakMap}}const Oo={VERTEX:1,INDEX:2,STORAGE:3,INDIRECT:4},Tc=16,UK=211,OK=212;class kK extends Zc{constructor(e){super(),this.backend=e}delete(e){const t=super.delete(e);return t!==null&&this.backend.destroyAttribute(e),t}update(e,t){const n=this.get(e);if(n.version===void 0)t===Oo.VERTEX?this.backend.createAttribute(e):t===Oo.INDEX?this.backend.createIndexAttribute(e):t===Oo.STORAGE?this.backend.createStorageAttribute(e):t===Oo.INDIRECT&&this.backend.createIndirectStorageAttribute(e),n.version=this._getBufferAttribute(e).version;else{const r=this._getBufferAttribute(e);(n.version<r.version||r.usage===Ld)&&(this.backend.updateAttribute(e),n.version=r.version)}}_getBufferAttribute(e){return e.isInterleavedBufferAttribute&&(e=e.data),e}}function sD(i){return i.index!==null?i.index.version:i.attributes.position.version}function jR(i){const e=[],t=i.index,n=i.attributes.position;if(t!==null){const s=t.array;for(let o=0,a=s.length;o<a;o+=3){const l=s[o+0],c=s[o+1],u=s[o+2];e.push(l,c,c,u,u,l)}}else{const s=n.array;for(let o=0,a=s.length/3-1;o<a;o+=3){const l=o+0,c=o+1,u=o+2;e.push(l,c,c,u,u,l)}}const r=new(zS(e)?HS:qS)(e,1);return r.version=sD(i),r}class zK extends Zc{constructor(e,t){super(),this.attributes=e,this.info=t,this.wireframes=new WeakMap,this.attributeCall=new WeakMap}has(e){const t=e.geometry;return super.has(t)&&this.get(t).initialized===!0}updateForRender(e){this.has(e)===!1&&this.initGeometry(e),this.updateAttributes(e)}initGeometry(e){const t=e.geometry,n=this.get(t);n.initialized=!0,this.info.memory.geometries++;const r=()=>{this.info.memory.geometries--;const s=t.index,o=e.getAttributes();s!==null&&this.attributes.delete(s);for(const l of o)this.attributes.delete(l);const a=this.wireframes.get(t);a!==void 0&&this.attributes.delete(a),t.removeEventListener("dispose",r)};t.addEventListener("dispose",r)}updateAttributes(e){const t=e.getAttributes();for(const s of t)s.isStorageBufferAttribute||s.isStorageInstancedBufferAttribute?this.updateAttribute(s,Oo.STORAGE):this.updateAttribute(s,Oo.VERTEX);const n=this.getIndex(e);n!==null&&this.updateAttribute(n,Oo.INDEX);const r=e.geometry.indirect;r!==null&&this.updateAttribute(r,Oo.INDIRECT)}updateAttribute(e,t){const n=this.info.render.calls;e.isInterleavedBufferAttribute?this.attributeCall.get(e)===void 0?(this.attributes.update(e,t),this.attributeCall.set(e,n)):this.attributeCall.get(e.data)!==n&&(this.attributes.update(e,t),this.attributeCall.set(e.data,n),this.attributeCall.set(e,n)):this.attributeCall.get(e)!==n&&(this.attributes.update(e,t),this.attributeCall.set(e,n))}getIndirect(e){return e.geometry.indirect}getIndex(e){const{geometry:t,material:n}=e;let r=t.index;if(n.wireframe===!0){const s=this.wireframes;let o=s.get(t);o===void 0?(o=jR(t),s.set(t,o)):o.version!==sD(t)&&(this.attributes.delete(o),o=jR(t),s.set(t,o)),r=o}return r}}class VK{constructor(){this.autoReset=!0,this.frame=0,this.calls=0,this.render={calls:0,frameCalls:0,drawCalls:0,triangles:0,points:0,lines:0,timestamp:0},this.compute={calls:0,frameCalls:0,timestamp:0},this.memory={geometries:0,textures:0}}update(e,t,n){this.render.drawCalls++,e.isMesh||e.isSprite?this.render.triangles+=n*(t/3):e.isPoints?this.render.points+=n*t:e.isLineSegments?this.render.lines+=n*(t/2):e.isLine?this.render.lines+=n*(t-1):console.error("THREE.WebGPUInfo: Unknown object type.")}reset(){this.render.drawCalls=0,this.render.frameCalls=0,this.compute.frameCalls=0,this.render.triangles=0,this.render.points=0,this.render.lines=0}dispose(){this.reset(),this.calls=0,this.render.calls=0,this.compute.calls=0,this.render.timestamp=0,this.compute.timestamp=0,this.memory.geometries=0,this.memory.textures=0}}class oD{constructor(e){this.cacheKey=e,this.usedTimes=0}}class GK extends oD{constructor(e,t,n){super(e),this.vertexProgram=t,this.fragmentProgram=n}}class qK extends oD{constructor(e,t){super(e),this.computeProgram=t,this.isComputePipeline=!0}}let HK=0;class hx{constructor(e,t,n,r=null,s=null){this.id=HK++,this.code=e,this.stage=t,this.name=n,this.transforms=r,this.attributes=s,this.usedTimes=0}}class WK extends Zc{constructor(e,t){super(),this.backend=e,this.nodes=t,this.bindings=null,this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}getForCompute(e,t){const{backend:n}=this,r=this.get(e);if(this._needsComputeUpdate(e)){const s=r.pipeline;s&&(s.usedTimes--,s.computeProgram.usedTimes--);const o=this.nodes.getForCompute(e);let a=this.programs.compute.get(o.computeShader);a===void 0&&(s&&s.computeProgram.usedTimes===0&&this._releaseProgram(s.computeProgram),a=new hx(o.computeShader,"compute",e.name,o.transforms,o.nodeAttributes),this.programs.compute.set(o.computeShader,a),n.createProgram(a));const l=this._getComputeCacheKey(e,a);let c=this.caches.get(l);c===void 0&&(s&&s.usedTimes===0&&this._releasePipeline(s),c=this._getComputePipeline(e,a,l,t)),c.usedTimes++,a.usedTimes++,r.version=e.version,r.pipeline=c}return r.pipeline}getForRender(e,t=null){const{backend:n}=this,r=this.get(e);
3866if(this._needsRenderUpdate(e)){const s=r.pipeline;s&&(s.usedTimes--,s.vertexProgram.usedTimes--,s.fragmentProgram.usedTimes--);const o=e.getNodeBuilderState(),a=e.material?e.material.name:"";let l=this.programs.vertex.get(o.vertexShader);l===void 0&&(s&&s.vertexProgram.usedTimes===0&&this._releaseProgram(s.vertexProgram),l=new hx(o.vertexShader,"vertex",a),this.programs.vertex.set(o.vertexShader,l),n.createProgram(l));let c=this.programs.fragment.get(o.fragmentShader);c===void 0&&(s&&s.fragmentProgram.usedTimes===0&&this._releaseProgram(s.fragmentProgram),c=new hx(o.fragmentShader,"fragment",a),this.programs.fragment.set(o.fragmentShader,c),n.createProgram(c));const u=this._getRenderCacheKey(e,l,c);let p=this.caches.get(u);p===void 0?(s&&s.usedTimes===0&&this._releasePipeline(s),p=this._getRenderPipeline(e,l,c,u,t)):e.pipeline=p,p.usedTimes++,l.usedTimes++,c.usedTimes++,r.pipeline=p}return r.pipeline}delete(e){const t=this.get(e).pipeline;return t&&(t.usedTimes--,t.usedTimes===0&&this._releasePipeline(t),t.isComputePipeline?(t.computeProgram.usedTimes--,t.computeProgram.usedTimes===0&&this._releaseProgram(t.computeProgram)):(t.fragmentProgram.usedTimes--,t.vertexProgram.usedTimes--,t.vertexProgram.usedTimes===0&&this._releaseProgram(t.vertexProgram),t.fragmentProgram.usedTimes===0&&this._releaseProgram(t.fragmentProgram))),super.delete(e)}dispose(){super.dispose(),this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}updateForRender(e){this.getForRender(e)}_getComputePipeline(e,t,n,r){n=n||this._getComputeCacheKey(e,t);let s=this.caches.get(n);return s===void 0&&(s=new qK(n,t),this.caches.set(n,s),this.backend.createComputePipeline(s,r)),s}_getRenderPipeline(e,t,n,r,s){r=r||this._getRenderCacheKey(e,t,n);let o=this.caches.get(r);return o===void 0&&(o=new GK(r,t,n),this.caches.set(r,o),e.pipeline=o,this.backend.createRenderPipeline(e,s)),o}_getComputeCacheKey(e,t){return e.id+","+t.id}_getRenderCacheKey(e,t,n){return t.id+","+n.id+","+this.backend.getRenderCacheKey(e)}_releasePipeline(e){this.caches.delete(e.cacheKey)}_releaseProgram(e){const t=e.code,n=e.stage;this.programs[n].delete(t)}_needsComputeUpdate(e){const t=this.get(e);return t.pipeline===void 0||t.version!==e.version}_needsRenderUpdate(e){return this.get(e).pipeline===void 0||this.backend.needsRenderUpdate(e)}}class $K extends Zc{constructor(e,t,n,r,s,o){super(),this.backend=e,this.textures=n,this.pipelines=s,this.attributes=r,this.nodes=t,this.info=o,this.pipelines.bindings=this}getForRender(e){const t=e.getBindings();for(const n of t){const r=this.get(n);r.bindGroup===void 0&&(this._init(n),this.backend.createBindings(n,t,0),r.bindGroup=n)}return t}getForCompute(e){const t=this.nodes.getForCompute(e).bindings;for(const n of t){const r=this.get(n);r.bindGroup===void 0&&(this._init(n),this.backend.createBindings(n,t,0),r.bindGroup=n)}return t}updateForCompute(e){this._updateBindings(this.getForCompute(e))}updateForRender(e){this._updateBindings(this.getForRender(e))}_updateBindings(e){for(const t of e)this._update(t,e)}_init(e){for(const t of e.bindings)if(t.isSampledTexture)this.textures.updateTexture(t.texture);else if(t.isStorageBuffer){const n=t.attribute,r=n.isIndirectStorageBufferAttribute?Oo.INDIRECT:Oo.STORAGE;this.attributes.update(n,r)}}_update(e,t){const{backend:n}=this;let r=!1,s=!0,o=0,a=0;for(const l of e.bindings)if(!(l.isNodeUniformsGroup&&this.nodes.updateGroup(l)===!1)){if(l.isStorageBuffer){const c=l.attribute,u=c.isIndirectStorageBufferAttribute?Oo.INDIRECT:Oo.STORAGE;this.attributes.update(c,u)}if(l.isUniformBuffer)l.update()&&n.updateBinding(l);else if(l.isSampler)l.update();else if(l.isSampledTexture){const c=this.textures.get(l.texture);l.needsBindingsUpdate(c.generation)&&(r=!0);const u=l.update(),p=l.texture;u&&this.textures.updateTexture(p);const m=n.get(p);if(m.externalTexture!==void 0||c.isDefaultTexture?s=!1:(o=o*10+p.id,a+=p.version),n.isWebGPUBackend===!0&&m.texture===void 0&&m.externalTexture===void 0&&(console.error("Bindings._update: binding should be available:",l,u,p,l.textureNode.value,r),this.textures.updateTexture(p),r=!0),p.isStorageTexture===!0){const g=this.get(p);l.store===!0?g.needsMipmap=!0:this.textures.needsMipmaps(p)&&g.needsMipmap===!0&&(this.backend.generateMipmaps(p),g.needsMipmap=!1)}}}r===!0&&this.backend.updateBindings(e,t,s?o:0,a)}}function jK(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.z!==e.z?i.z-e.z:i.id-e.id}function XR(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.z!==e.z?e.z-i.z:i.id-e.id}function YR(i){return(i.transmission>0||i.transmissionNode)&&i.side===ur&&i.forceSinglePass===!1}class XK{constructor(e,t,n){this.renderItems=[],this.renderItemsIndex=0,this.opaque=[],this.transparentDoublePass=[],this.transparent=[],this.bundles=[],this.lightsNode=e.getNode(t,n),this.lightsArray=[],this.scene=t,this.camera=n,this.occlusionQueryCount=0}begin(){return this.renderItemsIndex=0,this.opaque.length=0,this.transparentDoublePass.length=0,this.transparent.length=0,this.bundles.length=0,this.lightsArray.length=0,this.occlusionQueryCount=0,this}getNextRenderItem(e,t,n,r,s,o,a){let l=this.renderItems[this.renderItemsIndex];return l===void 0?(l={id:e.id,object:e,geometry:t,material:n,groupOrder:r,renderOrder:e.renderOrder,z:s,group:o,clippingContext:a},this.renderItems[this.renderItemsIndex]=l):(l.id=e.id,l.object=e,l.geometry=t,l.material=n,l.groupOrder=r,l.renderOrder=e.renderOrder,l.z=s,l.group=o,l.clippingContext=a
3866),this.renderItemsIndex++,l}push(e,t,n,r,s,o,a){const l=this.getNextRenderItem(e,t,n,r,s,o,a);e.occlusionTest===!0&&this.occlusionQueryCount++,n.transparent===!0||n.transmission>0?(YR(n)&&this.transparentDoublePass.push(l),this.transparent.push(l)):this.opaque.push(l)}unshift(e,t,n,r,s,o,a){const l=this.getNextRenderItem(e,t,n,r,s,o,a);n.transparent===!0||n.transmission>0?(YR(n)&&this.transparentDoublePass.unshift(l),this.transparent.unshift(l)):this.opaque.unshift(l)}pushBundle(e){this.bundles.push(e)}pushLight(e){this.lightsArray.push(e)}sort(e,t){this.opaque.length>1&&this.opaque.sort(e||jK),this.transparentDoublePass.length>1&&this.transparentDoublePass.sort(t||XR),this.transparent.length>1&&this.transparent.sort(t||XR)}finish(){this.lightsNode.setLights(this.lightsArray);for(let e=this.renderItemsIndex,t=this.renderItems.length;e<t;e++){const n=this.renderItems[e];if(n.id===null)break;n.id=null,n.object=null,n.geometry=null,n.material=null,n.groupOrder=null,n.renderOrder=null,n.z=null,n.group=null,n.clippingContext=null}}}const Np=[];class YK{constructor(e){this.lighting=e,this.lists=new va}get(e,t){const n=this.lists;Np[0]=e,Np[1]=t;let r=n.get(Np);return r===void 0&&(r=new XK(this.lighting,e,t),n.set(Np,r)),Np.length=0,r}dispose(){this.lists=new va}}let QK=0;class ZK{constructor(){this.id=QK++,this.color=!0,this.clearColor=!0,this.clearColorValue={r:0,g:0,b:0,a:1},this.depth=!0,this.clearDepth=!0,this.clearDepthValue=1,this.stencil=!1,this.clearStencil=!0,this.clearStencilValue=1,this.viewport=!1,this.viewportValue=new Jt,this.scissor=!1,this.scissorValue=new Jt,this.renderTarget=null,this.textures=null,this.depthTexture=null,this.activeCubeFace=0,this.activeMipmapLevel=0,this.sampleCount=1,this.width=0,this.height=0,this.occlusionQueryCount=0,this.clippingContext=null,this.isRenderContext=!0}getCacheKey(){return aD(this)}}function aD(i){const{textures:e,activeCubeFace:t}=i,n=[t];for(const r of e)n.push(r.id);return V1(n)}const Dp=[],KK=new N1,JK=new L0;class eJ{constructor(){this.chainMaps={}}get(e,t,n=null){Dp[0]=e,Dp[1]=t;let r;if(n===null)r="default";else{const a=n.texture.format;r=`${n.textures.length}:${a}:${n.samples}:${n.depthBuffer}:${n.stencilBuffer}`}const s=this._getChainMap(r);let o=s.get(Dp);return o===void 0&&(o=new ZK,s.set(Dp,o)),Dp.length=0,n!==null&&(o.sampleCount=n.samples===0?1:n.samples),o}getForClear(e=null){return this.get(KK,JK,e)}_getChainMap(e){return this.chainMaps[e]||(this.chainMaps[e]=new va)}dispose(){this.chainMaps={}}}const tJ=new re;class nJ extends Zc{constructor(e,t,n){super(),this.renderer=e,this.backend=t,this.info=n}updateRenderTarget(e,t=0){const n=this.get(e),r=e.samples===0?1:e.samples,s=n.depthTextureMips||(n.depthTextureMips={}),o=e.textures,a=this.getSize(o[0]),l=a.width>>t,c=a.height>>t;let u=e.depthTexture||s[t];const p=e.depthBuffer===!0||e.stencilBuffer===!0;let m=!1;u===void 0&&p&&(e.multiview===!0&&a.depth>1?u=new yL:u=new $s,u.format=e.stencilBuffer?So:bo,u.type=e.stencilBuffer?xo:mi,u.image.width=l,u.image.height=c,u.image.depth=a.depth,s[t]=u),(n.width!==a.width||a.height!==n.height)&&(m=!0,u&&(u.needsUpdate=!0,u.image.width=l,u.image.height=c,u.image.depth=u.isDepthArrayTexture?u.image.depth:1)),n.width=a.width,n.height=a.height,n.textures=o,n.depthTexture=u||null,n.depth=e.depthBuffer,n.stencil=e.stencilBuffer,n.renderTarget=e,n.sampleCount!==r&&(m=!0,u&&(u.needsUpdate=!0),n.sampleCount=r);const g={sampleCount:r};if(e.isXRRenderTarget!==!0){for(let v=0;v<o.length;v++){const b=o[v];b.isTextureArray=e.multiview===!0&&a.depth>1,m&&(b.needsUpdate=!0),this.updateTexture(b,g)}u&&this.updateTexture(u,g)}if(n.initialized!==!0){n.initialized=!0;const v=()=>{e.removeEventListener("dispose",v);for(let b=0;b<o.length;b++)this._destroyTexture(o[b]);u&&this._destroyTexture(u),this.delete(e)};e.addEventListener("dispose",v)}}updateTexture(e,t={}){const n=this.get(e);if(n.initialized===!0&&n.version===e.version)return;const r=e.isRenderTargetTexture||e.isDepthTexture||e.isFramebufferTexture,s=this.backend;if(r&&n.initialized===!0&&(s.destroySampler(e),s.destroyTexture(e)),e.isFramebufferTexture){const c=this.renderer.getRenderTarget();c?e.type=c.texture.type:e.type=Gi}const{width:o,height:a,depth:l}=this.getSize(e);if(t.width=o,t.height=a,t.depth=l,t.needsMipmaps=this.needsMipmaps(e),t.levels=t.needsMipmaps?this.getMipLevels(e,o,a):1,r||e.isStorageTexture===!0)s.createSampler(e),s.createTexture(e,t),n.generation=e.version;else if(n.initialized!==!0&&s.createSampler(e),e.version>0){const u=e.image;if(u===void 0)console.warn("THREE.Renderer: Texture marked for update but image is undefined.");else if(u.complete===!1)console.warn("THREE.Renderer: Texture marked for update but image is incomplete.");else{if(e.images){const p=[];for(const m of e.images)p.push(m);t.images=p}else t.image=u;(n.isDefaultTexture===void 0||n.isDefaultTexture===!0)&&(s.createTexture(e,t),n.isDefaultTexture=!1,n.generation=e.version),e.source.dataReady===!0&&s.updateTexture(e,t),t.needsMipmaps&&e.mipmaps.length===0&&s.generateMipmaps(e)}}else s.createDefaultTexture(e),n.isDefaultTexture=!0,n.generation=e.version;if(n.initialized!==!0){n.initialized=!0,n.generation=e.version,this.info.memory.textures++;const c=()=>{e.removeEventListener("dispose",c),this._destroyTexture(e)};e.addEventListener("dispose",c)}n.version=e.version}getSize(e,t=tJ){let n=e.images?e.images[0]:e.image;return n?(n.image!==void 0&&(n=n.image),t.width=n.width||1,t.height=n.height||1,t.depth=e.isCubeTexture?6:n.depth||1):t.width=t.height=t.depth=1,t}
3866getMipLevels(e,t,n){let r;return e.isCompressedTexture?e.mipmaps?r=e.mipmaps.length:r=1:r=Math.floor(Math.log2(Math.max(t,n)))+1,r}needsMipmaps(e){return e.isCompressedTexture===!0||e.generateMipmaps}_destroyTexture(e){this.has(e)===!0&&(this.backend.destroySampler(e),this.backend.destroyTexture(e),this.delete(e),this.info.memory.textures--)}}class ow extends qt{constructor(e,t,n,r=1){super(e,t,n),this.a=r}set(e,t,n,r=1){return this.a=r,super.set(e,t,n)}copy(e){return e.a!==void 0&&(this.a=e.a),super.copy(e)}clone(){return new this.constructor(this.r,this.g,this.b,this.a)}}class lD extends Kn{static get type(){return"ParameterNode"}constructor(e,t=null){super(e,t),this.isParameterNode=!0}getHash(){return this.uuid}generate(){return this.name}}const iJ=(i,e)=>it(new lD(i,e));class rJ extends Qt{static get type(){return"StackNode"}constructor(e=null){super(),this.nodes=[],this.outputNode=null,this.parent=e,this._currentCond=null,this._expressionNode=null,this.isStackNode=!0}getNodeType(e){return this.outputNode?this.outputNode.getNodeType(e):"void"}getMemberType(e,t){return this.outputNode?this.outputNode.getMemberType(e,t):"void"}add(e){return this.nodes.push(e),this}If(e,t){const n=new Fd(t);return this._currentCond=Ur(e,n),this.add(this._currentCond)}ElseIf(e,t){const n=new Fd(t),r=Ur(e,n);return this._currentCond.elseNode=r,this._currentCond=r,this}Else(e){return this._currentCond.elseNode=new Fd(e),this}Switch(e){return this._expressionNode=it(e),this}Case(...e){const t=[];if(e.length>=2)for(let a=0;a<e.length-1;a++)t.push(this._expressionNode.equal(it(e[a])));else throw new Error("TSL: Invalid parameter length. Case() requires at least two parameters.");const n=e[e.length-1],r=new Fd(n);let s=t[0];for(let a=1;a<t.length;a++)s=s.or(t[a]);const o=Ur(s,r);return this._currentCond===null?(this._currentCond=o,this.add(this._currentCond)):(this._currentCond.elseNode=o,this._currentCond=o,this)}Default(e){return this.Else(e),this}build(e,...t){const n=gM();l0(this);for(const r of this.nodes)r.build(e,"void");return l0(n),this.outputNode?this.outputNode.build(e,...t):super.build(e,...t)}else(...e){return console.warn("THREE.TSL: .else() has been renamed to .Else()."),this.Else(...e)}elseif(...e){return console.warn("THREE.TSL: .elseif() has been renamed to .ElseIf()."),this.ElseIf(...e)}}const y_=rt(rJ).setParameterLength(0,1);function sJ(i){return Object.entries(i).map(([e,t])=>typeof t=="string"?{name:e,type:t,atomic:!1}:{name:e,type:t.type,atomic:t.atomic||!1})}class oJ extends Qt{static get type(){return"StructTypeNode"}constructor(e,t=null){super("struct"),this.membersLayout=sJ(e),this.name=t,this.isStructLayoutNode=!0}getLength(){let e=0;for(const t of this.membersLayout)e+=dM(t.type);return e}getMemberType(e,t){const n=this.membersLayout.find(r=>r.name===t);return n?n.type:"void"}getNodeType(e){return e.getStructTypeFromNode(this,this.membersLayout,this.name).name}setup(e){e.addInclude(this)}generate(e){return this.getNodeType(e)}}class aJ extends Qt{static get type(){return"StructNode"}constructor(e,t){super("vec3"),this.structLayoutNode=e,this.values=t,this.isStructNode=!0}getNodeType(e){return this.structLayoutNode.getNodeType(e)}getMemberType(e,t){return this.structLayoutNode.getMemberType(e,t)}generate(e){const t=e.getVarFromNode(this),n=t.type,r=e.getPropertyName(t);return e.addLineFlowCode(`${r} = ${e.generateStruct(n,this.structLayoutNode.membersLayout,this.values)}`,this),t.name}}const lJ=(i,e=null)=>{const t=new oJ(i,e),n=(...r)=>{let s=null;if(r.length>0)if(r[0].isNode){s={};const o=Object.keys(i);for(let a=0;a<r.length;a++)s[o[a]]=r[a]}else s=r[0];return it(new aJ(t,s))};return n.layout=t,n.isStruct=!0,n};class cD extends Qt{static get type(){return"OutputStructNode"}constructor(...e){super(),this.members=e,this.isOutputStructNode=!0}getNodeType(e){const t=e.getNodeProperties(this);if(t.membersLayout===void 0){const n=this.members,r=[];for(let s=0;s<n.length;s++){const o="m"+s,a=n[s].getNodeType(e);r.push({name:o,type:a,index:s})}t.membersLayout=r,t.structType=e.getOutputStructTypeFromNode(this,t.membersLayout)}return t.structType.name}generate(e){const t=e.getOutputStructName(),n=this.members,r=t!==""?t+".":"";for(let s=0;s<n.length;s++){const o=n[s].build(e);e.addLineFlowCode(`${r}m${s} = ${o}`,this)}return t}}const cJ=rt(cD);function uD(i,e){for(let t=0;t<i.length;t++)if(i[t].name===e)return t;return-1}
3866class uJ extends cD{static get type(){return"MRTNode"}constructor(e){super(),this.outputNodes=e,this.isMRTNode=!0}has(e){return this.outputNodes[e]!==void 0}get(e){return this.outputNodes[e]}merge(e){const t={...this.outputNodes,...e.outputNodes};return hD(t)}setup(e){const t=this.outputNodes,n=e.renderer.getRenderTarget(),r=[],s=n.textures;for(const o in t){const a=uD(s,o);r[a]=jt(t[o])}return this.members=r,super.setup(e)}}const hD=rt(uJ),hJ=Ee(([i])=>{const e=i.toUint().mul(747796405).add(2891336453),t=e.shiftRight(e.shiftRight(28).add(4)).bitXor(e).mul(277803737);return t.shiftRight(22).bitXor(t).toFloat().mul(1/2**32)}),Ub=(i,e)=>ua(_n(4,i.mul(On(1,i))),e),dJ=(i,e)=>i.lessThan(.5)?Ub(i.mul(2),e).div(2):On(1,Ub(_n(On(1,i),2),e).div(2)),fJ=(i,e,t)=>ua(_a(ua(i,e),rr(ua(i,e),ua(On(1,i),t))),1/e),pJ=(i,e)=>go(a1.mul(e.mul(i).sub(1))).div(a1.mul(e.mul(i).sub(1))),wl=Ee(([i])=>i.fract().sub(.5).abs()).setLayout({name:"tri",type:"float",inputs:[{name:"x",type:"float"}]}),AJ=Ee(([i])=>Se(wl(i.z.add(wl(i.y.mul(1)))),wl(i.z.add(wl(i.x.mul(1)))),wl(i.y.add(wl(i.x.mul(1)))))).setLayout({name:"tri3",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),mJ=Ee(([i,e,t])=>{const n=Se(i).toVar(),r=se(1.4).toVar(),s=se(0).toVar(),o=Se(n).toVar();return Zn({start:se(0),end:se(3),type:"float",condition:"<="},()=>{const a=Se(AJ(o.mul(2))).toVar();n.addAssign(a.add(t.mul(se(.1).mul(e)))),o.mulAssign(1.8),r.mulAssign(1.5),n.mulAssign(1.2);const l=se(wl(n.z.add(wl(n.x.add(wl(n.y)))))).toVar();s.addAssign(l.div(r)),o.addAssign(.14)}),s}
3866).setLayout({name:"triNoise3D",type:"float",inputs:[{name:"position",type:"vec3"},{name:"speed",type:"float"},{name:"time",type:"float"}]});class gJ extends Qt{static get type(){return"FunctionOverloadingNode"}constructor(e=[],...t){super(),this.functionNodes=e,this.parametersNodes=t,this._candidateFnCall=null,this.global=!0}getNodeType(){return this.functionNodes[0].shaderNode.layout.type}setup(e){const t=this.parametersNodes;let n=this._candidateFnCall;if(n===null){let r=null,s=-1;for(const o of this.functionNodes){const l=o.shaderNode.layout;if(l===null)throw new Error("FunctionOverloadingNode: FunctionNode must be a layout.");const c=l.inputs;if(t.length===c.length){let u=0;for(let p=0;p<t.length;p++){const m=t[p],g=c[p];m.getNodeType(e)===g.type?u++:u=0}u>s&&(r=o,s=u)}}this._candidateFnCall=n=r(...t)}return n}}const _J=rt(gJ),Qr=i=>(...e)=>_J(i,...e),gh=$t(0).setGroup(Zt).onRenderUpdate(i=>i.time),dD=$t(0).setGroup(Zt).onRenderUpdate(i=>i.deltaTime),vJ=$t(0,"uint").setGroup(Zt).onRenderUpdate(i=>i.frameId),yJ=(i=1)=>(console.warn('TSL: timerLocal() is deprecated. Use "time" instead.'),gh.mul(i)),xJ=(i=1)=>(console.warn('TSL: timerGlobal() is deprecated. Use "time" instead.'),gh.mul(i)),bJ=(i=1)=>(console.warn('TSL: timerDelta() is deprecated. Use "deltaTime" instead.'),dD.mul(i)),SJ=(i=gh)=>i.add(.75).mul(Math.PI*2).sin().mul(.5).add(.5),MJ=(i=gh)=>i.fract().round(),wJ=(i=gh)=>i.add(.5).fract().mul(2).sub(1).abs(),TJ=(i=gh)=>i.fract(),EJ=Ee(([i,e,t=dt(.5)])=>uv(i.sub(t),e).add(t)),RJ=Ee(([i,e,t=dt(.5)])=>{const n=i.sub(t),r=n.dot(n),o=r.mul(r).mul(e);return i.add(n.mul(o))}),CJ=Ee(({position:i=null,horizontal:e=!0,vertical:t=!1})=>{let n;i!==null?(n=Uo.toVar(),n[3][0]=i.x,n[3][1]=i.y,n[3][2]=i.z):n=Uo;const r=eo.mul(n);return a0(e)&&(r[0][0]=Uo[0].length(),r[0][1]=0,r[0][2]=0),a0(t)&&(r[1][0]=0,r[1][1]=Uo[1].length(),r[1][2]=0),r[2][0]=0,r[2][1]=0,r[2][2]=1,Ah.mul(r).mul(Xi)}),PJ=Ee(([i=null])=>{const e=u1();return u1(YM(i)).sub(e).lessThan(0).select(fa,i)});class LJ extends Qt{static get type(){return"SpriteSheetUVNode"}constructor(e,t=Ci(),n=se(0)){super("vec2"),this.countNode=e,this.uvNode=t,this.frameNode=n}setup(){const{frameNode:e,uvNode:t,countNode:n}=this,{width:r,height:s}=n,o=e.mod(r.mul(s)).floor(),a=o.mod(r),l=s.sub(o.add(1).div(r).ceil()),c=n.reciprocal(),u=dt(a,l);return t.add(u).mul(c)}}const NJ=rt(LJ).setParameterLength(3);class DJ extends Qt{static get type(){return"TriplanarTexturesNode"}constructor(e,t=null,n=null,r=se(1),s=Xi,o=Zs){super("vec4"),this.textureXNode=e,this.textureYNode=t,this.textureZNode=n,this.scaleNode=r,this.positionNode=s,this.normalNode=o}setup(){const{textureXNode:e,textureYNode:t,textureZNode:n,scaleNode:r,positionNode:s,normalNode:o}=this;let a=o.abs().normalize();a=a.div(a.dot(Se(1)));const l=s.yz.mul(r),c=s.zx.mul(r),u=s.xy.mul(r),p=e.value,m=t!==null?t.value:p,g=n!==null?n.value:p,v=Ln(p,l).mul(a.x),b=Ln(m,c).mul(a.y),M=Ln(g,u).mul(a.z);return rr(v,b,M)}}const fD=rt(DJ).setParameterLength(1,6),IJ=(...i)=>fD(...i),Yh=new Da,gu=new re,Qh=new re,dx=new re,Ip=new un,eg=new re(0,0,-1),Ea=new Jt,Bp=new re,tg=new re,Fp=new Jt,ng=new at,h1=new rl,BJ=fa.flipX();h1.depthTexture=new $s(1,1);let fx=!1;
3866class aw extends Ka{static get type(){return"ReflectorNode"}constructor(e={}){super(e.defaultTexture||h1.texture,BJ),this._reflectorBaseNode=e.reflector||new FJ(this,e),this._depthNode=null,this.setUpdateMatrix(!1)}get reflector(){return this._reflectorBaseNode}get target(){return this._reflectorBaseNode.target}getDepthNode(){if(this._depthNode===null){if(this._reflectorBaseNode.depth!==!0)throw new Error("THREE.ReflectorNode: Depth node can only be requested when the reflector is created with { depth: true }. ");this._depthNode=it(new aw({defaultTexture:h1.depthTexture,reflector:this._reflectorBaseNode}))}return this._depthNode}setup(e){return e.object.isQuadMesh||this._reflectorBaseNode.build(e),super.setup(e)}clone(){const e=new this.constructor(this.reflectorNode);return e._reflectorBaseNode=this._reflectorBaseNode,e}dispose(){super.dispose(),this._reflectorBaseNode.dispose()}}class FJ extends Qt{static get type(){return"ReflectorBaseNode"}constructor(e,t={}){super();const{target:n=new ir,resolution:r=1,generateMipmaps:s=!1,bounces:o=!0,depth:a=!1}=t;this.textureNode=e,this.target=n,this.resolution=r,this.generateMipmaps=s,this.bounces=o,this.depth=a,this.updateBeforeType=o?gn.RENDER:gn.FRAME,this.virtualCameras=new WeakMap,this.renderTargets=new Map,this.forceUpdate=!1}_updateResolution(e,t){const n=this.resolution;t.getDrawingBufferSize(ng),e.setSize(Math.round(ng.width*n),Math.round(ng.height*n))}setup(e){return this._updateResolution(h1,e.renderer),super.setup(e)}dispose(){super.dispose();for(const e of this.renderTargets.values())e.dispose()}getVirtualCamera(e){let t=this.virtualCameras.get(e);return t===void 0&&(t=e.clone(),this.virtualCameras.set(e,t)),t}getRenderTarget(e){let t=this.renderTargets.get(e);return t===void 0&&(t=new rl(0,0,{type:dr}),this.generateMipmaps===!0&&(t.texture.minFilter=vO,t.texture.generateMipmaps=!0),this.depth===!0&&(t.depthTexture=new $s),this.renderTargets.set(e,t)),t}updateBefore(e){if(this.bounces===!1&&fx)return!1;fx=!0;const{scene:t,camera:n,renderer:r,material:s}=e,{target:o}=this,a=this.getVirtualCamera(n),l=this.getRenderTarget(a);if(r.getDrawingBufferSize(ng),this._updateResolution(l,r),Qh.setFromMatrixPosition(o.matrixWorld),dx.setFromMatrixPosition(n.matrixWorld),Ip.extractRotation(o.matrixWorld),gu.set(0,0,1),gu.applyMatrix4(Ip),Bp.subVectors(Qh,dx),Bp.dot(gu)>0===!0&&this.forceUpdate===!1)return;Bp.reflect(gu).negate(),Bp.add(Qh),Ip.extractRotation(n.matrixWorld),eg.set(0,0,-1),eg.applyMatrix4(Ip),eg.add(dx),tg.subVectors(Qh,eg),tg.reflect(gu).negate(),tg.add(Qh),a.coordinateSystem=n.coordinateSystem,a.position.copy(Bp),a.up.set(0,1,0),a.up.applyMatrix4(Ip),a.up.reflect(gu),a.lookAt(tg),a.near=n.near,a.far=n.far,a.updateMatrixWorld(),a.projectionMatrix.copy(n.projectionMatrix),Yh.setFromNormalAndCoplanarPoint(gu,Qh),Yh.applyMatrix4(a.matrixWorldInverse),Ea.set(Yh.normal.x,Yh.normal.y,Yh.normal.z,Yh.constant);const u=a.projectionMatrix;Fp.x=(Math.sign(Ea.x)+u.elements[8])/u.elements[0],Fp.y=(Math.sign(Ea.y)+u.elements[9])/u.elements[5],Fp.z=-1,Fp.w=(1+u.elements[10])/u.elements[14],Ea.multiplyScalar(1/Ea.dot(Fp));const p=0;u.elements[2]=Ea.x,u.elements[6]=Ea.y,u.elements[10]=r.coordinateSystem===Xa?Ea.z-p:Ea.z+1-p,u.elements[14]=Ea.w,this.textureNode.value=l.texture,this.depth===!0&&(this.textureNode.getDepthNode().value=l.depthTexture),s.visible=!1;const m=r.getRenderTarget(),g=r.getMRT(),v=r.autoClear;r.setMRT(null),r.setRenderTarget(l),r.autoClear=!0,r.render(t,a),r.setMRT(g),r.setRenderTarget(m),r.autoClear=v,s.visible=!0,fx=!1,this.forceUpdate=!1}}const UJ=i=>it(new aw(i)),px=new N0(-1,1,1,-1,0,1);class OJ extends vi{constructor(e=!1){super();const t=e===!1?[0,-1,0,1,2,1]:[0,2,0,0,2,0];this.setAttribute("position",new Gn([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Gn(t,2))}}const kJ=new OJ;class lw extends qn{constructor(e=null){super(kJ,e),this.camera=px,this.isQuadMesh=!0}async renderAsync(e){return e.renderAsync(this,px)}render(e){e.render(this,px)}}const zJ=new at;class VJ extends Ka{static get type(){return"RTTNode"}constructor(e,t=null,n=null,r={type:dr}){const s=new rl(t,n,r);
3866super(s.texture,Ci()),this.node=e,this.width=t,this.height=n,this.pixelRatio=1,this.renderTarget=s,this.textureNeedsUpdate=!0,this.autoUpdate=!0,this._rttNode=null,this._quadMesh=new lw(new sr),this.updateBeforeType=gn.RENDER}get autoSize(){return this.width===null}setup(e){return this._rttNode=this.node.context(e.getSharedContext()),this._quadMesh.material.name="RTT",this._quadMesh.material.needsUpdate=!0,super.setup(e)}setSize(e,t){this.width=e,this.height=t;const n=e*this.pixelRatio,r=t*this.pixelRatio;this.renderTarget.setSize(n,r),this.textureNeedsUpdate=!0}setPixelRatio(e){this.pixelRatio=e,this.setSize(this.width,this.height)}updateBefore({renderer:e}){if(this.textureNeedsUpdate===!1&&this.autoUpdate===!1)return;if(this.textureNeedsUpdate=!1,this.autoSize===!0){this.pixelRatio=e.getPixelRatio();const n=e.getSize(zJ);this.setSize(n.width,n.height)}this._quadMesh.material.fragmentNode=this._rttNode;const t=e.getRenderTarget();e.setRenderTarget(this.renderTarget),this._quadMesh.render(e),e.setRenderTarget(t)}clone(){const e=new Ka(this.value,this.uvNode,this.levelNode);return e.sampler=this.sampler,e.referenceNode=this,e}}const pD=(i,...e)=>it(new VJ(it(i),...e)),GJ=(i,...e)=>i.isTextureNode?i:i.isPassNode?i.getTextureNode():pD(i,...e),Ed=Ee(([i,e,t],n)=>{let r;n.renderer.coordinateSystem===Xa?(i=dt(i.x,i.y.oneMinus()).mul(2).sub(1),r=jt(Se(i,e),1)):r=jt(Se(i.x,i.y.oneMinus(),e).mul(2).sub(1),1);const s=jt(t.mul(r));return s.xyz.div(s.w)}),qJ=Ee(([i,e])=>{const t=e.mul(jt(i,1)),n=t.xy.div(t.w).mul(.5).add(.5).toVar();return dt(n.x,n.y.oneMinus())}),HJ=Ee(([i,e,t])=>{const n=Bc($i(e)),r=vr(i.mul(n)).toVar(),s=$i(e,r).toVar(),o=$i(e,r.sub(vr(2,0))).toVar(),a=$i(e,r.sub(vr(1,0))).toVar(),l=$i(e,r.add(vr(1,0))).toVar(),c=$i(e,r.add(vr(2,0))).toVar(),u=$i(e,r.add(vr(0,2))).toVar(),p=$i(e,r.add(vr(0,1))).toVar(),m=$i(e,r.sub(vr(0,1))).toVar(),g=$i(e,r.sub(vr(0,2))).toVar(),v=gi(On(se(2).mul(a).sub(o),s)).toVar(),b=gi(On(se(2).mul(l).sub(c),s)).toVar(),M=gi(On(se(2).mul(p).sub(u),s)).toVar(),x=gi(On(se(2).mul(m).sub(g),s)).toVar(),w=Ed(i,s,t).toVar(),R=v.lessThan(b).select(w.sub(Ed(i.sub(dt(se(1).div(n.x),0)),a,t)),w.negate().add(Ed(i.add(dt(se(1).div(n.x),0)),l,t))),C=M.lessThan(x).select(w.sub(Ed(i.add(dt(0,se(1).div(n.y))),p,t)),w.negate().add(Ed(i.sub(dt(0,se(1).div(n.y))),m,t)));return Vl(K1(R,C))});class x_ extends Ic{constructor(e,t,n=Float32Array){const r=ArrayBuffer.isView(e)?e:new n(e*t);super(r,t),this.isStorageInstancedBufferAttribute=!0}}class WJ extends Ii{constructor(e,t,n=Float32Array){const r=ArrayBuffer.isView(e)?e:new n(e*t);super(r,t),this.isStorageBufferAttribute=!0}}const $J=(i,e="float")=>{let t,n;e.isStruct===!0?(t=e.layout.getLength(),n=n1("float")):(t=dM(e),n=n1(e));const r=new WJ(i,t,n);return Yu(r,e,i)},jJ=(i,e="float")=>{let t,n;e.isStruct===!0?(t=e.layout.getLength(),n=n1("float")):(t=dM(e),n=n1(e));const r=new x_(i,t,n);return Yu(r,e,i)};class XJ extends Qt{static get type(){return"PointUVNode"}constructor(){super("vec2"),this.isPointUVNode=!0}generate(){return"vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y )"}}const YJ=St(XJ),Up=new Es,Ax=new un;class Vs extends Qt{static get type(){return"SceneNode"}constructor(e=Vs.BACKGROUND_BLURRINESS,t=null){super(),this.scope=e,this.scene=t}setup(e){const t=this.scope,n=this.scene!==null?this.scene:e.scene;let r;return t===Vs.BACKGROUND_BLURRINESS?r=ui("backgroundBlurriness","float",n):t===Vs.BACKGROUND_INTENSITY?r=ui("backgroundIntensity","float",n):t===Vs.BACKGROUND_ROTATION?r=$t("mat4").label("backgroundRotation").setGroup(Zt).onRenderUpdate(()=>{const s=n.background;return s!==null&&s.isTexture&&s.mapping!==CS?(Up.copy(n.backgroundRotation),Up.x*=-1,Up.y*=-1,Up.z*=-1,Ax.makeRotationFromEuler(Up)):Ax.identity(),Ax}):console.error("THREE.SceneNode: Unknown scope:",t),r}}Vs.BACKGROUND_BLURRINESS="backgroundBlurriness";Vs.BACKGROUND_INTENSITY="backgroundIntensity";Vs.BACKGROUND_ROTATION="backgroundRotation";const AD=St(Vs,Vs.BACKGROUND_BLURRINESS),Ob=St(Vs,Vs.BACKGROUND_INTENSITY),mD=St(Vs,Vs.BACKGROUND_ROTATION);class QJ extends Ka{static get type(){return"StorageTextureNode"}constructor(e,t,n=null){super(e,t),this.storeNode=n,this.isStorageTextureNode=!0,this.access=as.WRITE_ONLY}getInputType(){return"storageTexture"}setup(e){super.setup(e);const t=e.getNodeProperties(this);t.storeNode=this.storeNode}setAccess(e){return this.access=e,this}generate(e,t){let n;return this.storeNode!==null?n=this.generateStore(e):n=super.generate(e,t),n}toReadWrite(){return this.setAccess(as.READ_WRITE)}toReadOnly(){return this.setAccess(as.READ_ONLY)}toWriteOnly(){return this.setAccess(as.WRITE_ONLY)}generateStore(e){const t=e.getNodeProperties(this),{uvNode:n,storeNode:r}=t,s=super.generate(e,"property"),o=n.build(e,"uvec2"),a=r.build(e,"vec4"),l=e.generateTextureStore(e,s,o,a);e.addLineFlowCode(l,this)}}const gD=rt(QJ).setParameterLength(1,3),ZJ=(i,e,t)=>{const n=gD(i,e,t);return t!==null&&n.toStack(),n},KJ=Ee(({texture:i,uv:e})=>{const n=Se().toVar();return xn(e.x.lessThan(1e-4),()=>{n.assign(Se(1,0,0))}).ElseIf(e.y.lessThan(1e-4),()=>{n.assign(Se(0,1,0))}).ElseIf(e.z.lessThan(1e-4),()=>{n.assign(Se(0,0,1))}).ElseIf(e.x.greaterThan(1-1e-4),()=>{n.assign(Se(-1,0,0))}).ElseIf(e.y.greaterThan(1-1e-4),()=>{n.assign(Se(0,-1,0))}).ElseIf(e.z.greaterThan(1-1e-4),()=>{n.assign(Se(0,0,-1))}).Else(()=>{const s=i.sample(e.add(Se(-.01,0,0))).r.sub(i.sample(e.add(Se(.01,0,0))).r),o=i.sample(e.add(Se(0,-.01,0))).r.sub(i.sample(e.add(Se(0,.01,0))).r),a=i.sample(e.add(Se(0,0,-.01))).r.sub(i.sample(e.add(Se(0,0,.01))).r);n.assign(Se(s,o,a))}),n.normalize()});
3866class JJ extends Ka{static get type(){return"Texture3DNode"}constructor(e,t=null,n=null){super(e,t,n),this.isTexture3DNode=!0}getInputType(){return"texture3D"}getDefaultUV(){return Se(.5,.5,.5)}setUpdateMatrix(){}setupUV(e,t){const n=this.value;return e.isFlipY()&&(n.isRenderTargetTexture===!0||n.isFramebufferTexture===!0)&&(this.sampler?t=t.flipY():t=t.setY(me(Bc(this,this.levelNode).y).sub(t.y).sub(1))),t}generateUV(e,t){return t.build(e,"vec3")}normal(e){return KJ({texture:this,uv:e})}}const _D=rt(JJ).setParameterLength(1,3);class eee extends sv{static get type(){return"UserDataNode"}constructor(e,t,n=null){super(e,t,n),this.userData=n}updateReference(e){return this.reference=this.userData!==null?this.userData:e.object.userData,this.reference}}const tee=(i,e,t)=>it(new eee(i,e,t)),QR=new WeakMap;class nee extends Zi{static get type(){return"VelocityNode"}constructor(){super("vec2"),this.projectionMatrix=null,this.updateType=gn.OBJECT,this.updateAfterType=gn.OBJECT,this.previousModelWorldMatrix=$t(new un),this.previousProjectionMatrix=$t(new un).setGroup(Zt),this.previousCameraViewMatrix=$t(new un)}setProjectionMatrix(e){this.projectionMatrix=e}update({frameId:e,camera:t,object:n}){const r=ZR(n);this.previousModelWorldMatrix.value.copy(r);const s=vD(t);s.frameId!==e&&(s.frameId=e,s.previousProjectionMatrix===void 0?(s.previousProjectionMatrix=new un,s.previousCameraViewMatrix=new un,s.currentProjectionMatrix=new un,s.currentCameraViewMatrix=new un,s.previousProjectionMatrix.copy(this.projectionMatrix||t.projectionMatrix),s.previousCameraViewMatrix.copy(t.matrixWorldInverse)):(s.previousProjectionMatrix.copy(s.currentProjectionMatrix),s.previousCameraViewMatrix.copy(s.currentCameraViewMatrix)),s.currentProjectionMatrix.copy(this.projectionMatrix||t.projectionMatrix),s.currentCameraViewMatrix.copy(t.matrixWorldInverse),this.previousProjectionMatrix.value.copy(s.previousProjectionMatrix),this.previousCameraViewMatrix.value.copy(s.previousCameraViewMatrix))}updateAfter({object:e}){ZR(e).copy(e.matrixWorld)}setup(){const e=this.projectionMatrix===null?Ah:$t(this.projectionMatrix),t=this.previousCameraViewMatrix.mul(this.previousModelWorldMatrix),n=e.mul(mh).mul(Xi),r=this.previousProjectionMatrix.mul(t).mul(c1),s=n.xy.div(n.w),o=r.xy.div(r.w);return On(s,o)}}function vD(i){let e=QR.get(i);return e===void 0&&(e={},QR.set(i,e)),e}function ZR(i,e=0){const t=vD(i);let n=t[e];return n===void 0&&(t[e]=n=new un,t[e].copy(i.matrixWorld)),n}const iee=St(nee),yD=Ee(([i,e])=>Qs(1,i.oneMinus().div(e)).oneMinus()).setLayout({name:"blendBurn",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),xD=Ee(([i,e])=>Qs(i.div(e.oneMinus()),1)).setLayout({name:"blendDodge",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),bD=Ee(([i,e])=>i.oneMinus().mul(e.oneMinus()).oneMinus()).setLayout({name:"blendScreen",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),SD=Ee(([i,e])=>Qn(i.mul(2).mul(e),i.oneMinus().mul(2).mul(e.oneMinus()).oneMinus(),Z1(.5,i))).setLayout({name:"blendOverlay",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),ree=Ee(([i,e])=>{const t=e.a.add(i.a.mul(e.a.oneMinus()));return jt(e.rgb.mul(e.a).add(i.rgb.mul(i.a).mul(e.a.oneMinus())).div(t),t)}).setLayout({name:"blendColor",type:"vec4",inputs:[{name:"base",type:"vec4"},{name:"blend",type:"vec4"}]}),see=(...i)=>(console.warn('THREE.TSL: "burn" has been renamed. Use "blendBurn" instead.'),yD(i)),oee=(...i)=>(console.warn('THREE.TSL: "dodge" has been renamed. Use "blendDodge" instead.'),xD(i)),aee=(...i)=>(console.warn('THREE.TSL: "screen" has been renamed. Use "blendScreen" instead.'),bD(i)),lee=(...i)=>(console.warn('THREE.TSL: "overlay" has been renamed. Use "blendOverlay" instead.'),SD(i)),cee=Ee(([i])=>cw(i.rgb)),uee=Ee(([i,e=se(1)])=>e.mix(cw(i.rgb),i.rgb)),hee=Ee(([i,e=se(1)])=>{const t=rr(i.r,i.g,i.b).div(3),n=i.r.max(i.g.max(i.b)),r=n.sub(t).mul(e).mul(-3);return Qn(i.rgb,n,r)}),dee=Ee(([i,e=se(1)])=>{const t=Se(.57735,.57735,.57735),n=e.cos();return Se(i.rgb.mul(n).add(t.cross(i.rgb).mul(e.sin()).add(t.mul(Qc(t,i.rgb).mul(n.oneMinus())))))}),cw=(i,e=Se(En.getLuminanceCoefficients(new re)))=>Qc(i,e),fee=Ee(([i,e=Se(1),t=Se(0),n=Se(1),r=se(1),s=Se(En.getLuminanceCoefficients(new re,ha))])=>{const o=i.rgb.dot(Se(s)),a=Qi(i.rgb.mul(e).add(t),0).toVar(),l=a.pow(n).toVar();return xn(a.r.greaterThan(0),()=>{a.r.assign(l.r)}),xn(a.g.greaterThan(0),()=>{a.g.assign(l.g)}),xn(a.b.greaterThan(0),()=>{a.b.assign(l.b)}),a.assign(o.add(a.sub(o).mul(r))),jt(a.rgb,i.a)});class pee extends Zi{static get type(){return"PosterizeNode"}constructor(e,t){super(),this.sourceNode=e,this.stepsNode=t}setup(){const{sourceNode:e,stepsNode:t}=this;return e.mul(t).floor().div(t)}}const Aee=rt(pee).setParameterLength(2),ig=new at;
3866class MD extends Ka{static get type(){return"PassTextureNode"}constructor(e,t){super(t),this.passNode=e,this.setUpdateMatrix(!1)}setup(e){return e.object.isQuadMesh&&this.passNode.build(e),super.setup(e)}clone(){return new this.constructor(this.passNode,this.value)}}class KR extends MD{static get type(){return"PassMultipleTextureNode"}constructor(e,t,n=!1){super(e,null),this.textureName=t,this.previousTexture=n}updateTexture(){this.value=this.previousTexture?this.passNode.getPreviousTexture(this.textureName):this.passNode.getTexture(this.textureName)}setup(e){return this.updateTexture(),super.setup(e)}clone(){return new this.constructor(this.passNode,this.textureName,this.previousTexture)}}class Ja extends Zi{static get type(){return"PassNode"}constructor(e,t,n,r={}){super("vec4"),this.scope=e,this.scene=t,this.camera=n,this.options=r,this._pixelRatio=1,this._width=1,this._height=1;const s=new $s;s.isRenderTargetTexture=!0,s.name="depth";const o=new rl(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:dr,...r});o.texture.name="output",o.depthTexture=s,this.renderTarget=o,this._textures={output:o.texture,depth:s},this._textureNodes={},this._linearDepthNodes={},this._viewZNodes={},this._previousTextures={},this._previousTextureNodes={},this._cameraNear=$t(0),this._cameraFar=$t(0),this._mrt=null,this._layers=null,this._resolution=1,this.isPassNode=!0,this.updateBeforeType=gn.FRAME}setResolution(e){return this._resolution=e,this}getResolution(){return this._resolution}setLayers(e){return this._layers=e,this}getLayers(){return this._layers}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}isGlobal(){return!0}getTexture(e){let t=this._textures[e];return t===void 0&&(t=this.renderTarget.texture.clone(),t.name=e,this._textures[e]=t,this.renderTarget.textures.push(t)),t}getPreviousTexture(e){let t=this._previousTextures[e];return t===void 0&&(t=this.getTexture(e).clone(),this._previousTextures[e]=t),t}toggleTexture(e){const t=this._previousTextures[e];if(t!==void 0){const n=this._textures[e],r=this.renderTarget.textures.indexOf(n);this.renderTarget.textures[r]=t,this._textures[e]=t,this._previousTextures[e]=n,this._textureNodes[e].updateTexture(),this._previousTextureNodes[e].updateTexture()}}getTextureNode(e="output"){let t=this._textureNodes[e];return t===void 0&&(t=it(new KR(this,e)),t.updateTexture(),this._textureNodes[e]=t),t}getPreviousTextureNode(e="output"){let t=this._previousTextureNodes[e];return t===void 0&&(this._textureNodes[e]===void 0&&this.getTextureNode(e),t=it(new KR(this,e,!0)),t.updateTexture(),this._previousTextureNodes[e]=t),t}getViewZNode(e="depth"){let t=this._viewZNodes[e];if(t===void 0){const n=this._cameraNear,r=this._cameraFar;this._viewZNodes[e]=t=QM(this.getTextureNode(e),n,r)}return t}getLinearDepthNode(e="depth"){let t=this._linearDepthNodes[e];if(t===void 0){const n=this._cameraNear,r=this._cameraFar,s=this.getViewZNode(e);this._linearDepthNodes[e]=t=Qd(s,n,r)}return t}setup({renderer:e}){return this.renderTarget.samples=this.options.samples===void 0?e.samples:this.options.samples,e.backend.isWebGLBackend===!0&&(this.renderTarget.samples=0),this.renderTarget.texture.type=e.getColorBufferType(),this.scope===Ja.COLOR?this.getTextureNode():this.getLinearDepthNode()}updateBefore(e){const{renderer:t}=e,{scene:n}=this;let r,s;const o=t.getOutputRenderTarget();o&&o.isXRRenderTarget===!0?(s=1,r=t.xr.getCamera(),t.xr.updateCamera(r),ig.set(o.width,o.height)):(r=this.camera,s=t.getPixelRatio(),t.getSize(ig)),this._pixelRatio=s,this.setSize(ig.width,ig.height);const a=t.getRenderTarget(),l=t.getMRT(),c=r.layers.mask;this._cameraNear.value=r.near,this._cameraFar.value=r.far,this._layers!==null&&(r.layers.mask=this._layers.mask);for(const u in this._previousTextures)this.toggleTexture(u);t.setRenderTarget(this.renderTarget),t.setMRT(this._mrt),t.render(n,r),t.setRenderTarget(a),t.setMRT(l),r.layers.mask=c}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio*this._resolution,r=this._height*this._pixelRatio*this._resolution;this.renderTarget.setSize(n,r)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget.dispose()}}Ja.COLOR="color";Ja.DEPTH="depth";const mee=(i,e,t)=>it(new Ja(Ja.COLOR,i,e,t)),gee=(i,e)=>it(new MD(i,e)),_ee=(i,e,t)=>it(new Ja(Ja.DEPTH,i,e,t));class vee extends Ja{static get type(){return"ToonOutlinePassNode"}
3866constructor(e,t,n,r,s){super(Ja.COLOR,e,t),this.colorNode=n,this.thicknessNode=r,this.alphaNode=s,this._materialCache=new WeakMap}updateBefore(e){const{renderer:t}=e,n=t.getRenderObjectFunction();t.setRenderObjectFunction((r,s,o,a,l,c,u,p)=>{if((l.isMeshToonMaterial||l.isMeshToonNodeMaterial)&&l.wireframe===!1){const m=this._getOutlineMaterial(l);t.renderObject(r,s,o,a,m,c,u,p)}t.renderObject(r,s,o,a,l,c,u,p)}),super.updateBefore(e),t.setRenderObjectFunction(n)}_createMaterial(){const e=new sr;e.isMeshToonOutlineMaterial=!0,e.name="Toon_Outline",e.side=oi;const t=Zs.negate(),n=Ah.mul(mh),r=se(1),s=n.mul(jt(Xi,1)),o=n.mul(jt(Xi.add(t),1)),a=Vl(s.sub(o));return e.vertexNode=s.add(a.mul(this.thicknessNode).mul(s.w).mul(r)),e.colorNode=jt(this.colorNode,this.alphaNode),e}_getOutlineMaterial(e){let t=this._materialCache.get(e);return t===void 0&&(t=this._createMaterial(),this._materialCache.set(e,t)),t}}const yee=(i,e,t=new qt(0,0,0),n=.003,r=1)=>it(new vee(i,e,it(t),it(n),it(r))),wD=Ee(([i,e])=>i.mul(e).clamp()).setLayout({name:"linearToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),TD=Ee(([i,e])=>(i=i.mul(e),i.div(i.add(1)).clamp())).setLayout({name:"reinhardToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),ED=Ee(([i,e])=>{i=i.mul(e),i=i.sub(.004).max(0);const t=i.mul(i.mul(6.2).add(.5)),n=i.mul(i.mul(6.2).add(1.7)).add(.06);return t.div(n).pow(2.2)}).setLayout({name:"cineonToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),xee=Ee(([i])=>{const e=i.mul(i.add(.0245786)).sub(90537e-9),t=i.mul(i.add(.432951).mul(.983729)).add(.238081);return e.div(t)}),RD=Ee(([i,e])=>{const t=hs(.59719,.35458,.04823,.076,.90834,.01566,.0284,.13383,.83777),n=hs(1.60475,-.53108,-.07367,-.10208,1.10813,-.00605,-.00327,-.07276,1.07602);return i=i.mul(e).div(.6),i=t.mul(i),i=xee(i),i=n.mul(i),i.clamp()}).setLayout({name:"acesFilmicToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),bee=hs(Se(1.6605,-.1246,-.0182),Se(-.5876,1.1329,-.1006),Se(-.0728,-.0083,1.1187)),See=hs(Se(.6274,.0691,.0164),Se(.3293,.9195,.088),Se(.0433,.0113,.8956)),Mee=Ee(([i])=>{const e=Se(i).toVar(),t=Se(e.mul(e)).toVar(),n=Se(t.mul(t)).toVar();return se(15.5).mul(n.mul(t)).sub(_n(40.14,n.mul(e))).add(_n(31.96,n).sub(_n(6.868,t.mul(e))).add(_n(.4298,t).add(_n(.1191,e).sub(.00232))))}),CD=Ee(([i,e])=>{const t=Se(i).toVar(),n=hs(Se(.856627153315983,.137318972929847,.11189821299995),Se(.0951212405381588,.761241990602591,.0767994186031903),Se(.0482516061458583,.101439036467562,.811302368396859)),r=hs(Se(1.1271005818144368,-.1413297634984383,-.14132976349843826),Se(-.11060664309660323,1.157823702216272,-.11060664309660294),Se(-.016493938717834573,-.016493938717834257,1.2519364065950405)),s=se(-12.47393),o=se(4.026069);return t.mulAssign(e),t.assign(See.mul(t)),t.assign(n.mul(t)),t.assign(Qi(t,1e-10)),t.assign(Ha(t)),t.assign(t.sub(s).div(o.sub(s))),t.assign(Qa(t,0,1)),t.assign(Mee(t)),t.assign(r.mul(t)),t.assign(ua(Qi(Se(0),t),Se(2.2))),t.assign(bee.mul(t)),t.assign(Qa(t,0,1)),t}).setLayout({name:"agxToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),PD=Ee(([i,e])=>{const t=se(.76),n=se(.15);i=i.mul(e);const r=Qs(i.r,Qs(i.g,i.b)),s=Ur(r.lessThan(.08),r.sub(_n(6.25,r.mul(r))),.04);i.subAssign(s);const o=Qi(i.r,Qi(i.g,i.b));xn(o.lessThan(t),()=>i);const a=On(1,t),l=On(1,a.mul(a).div(o.add(a.sub(t))));i.mulAssign(l.div(o));const c=On(1,_a(1,n.mul(o.sub(l)).add(1)));return Qn(i,Se(l),c)}).setLayout({name:"neutralToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]});class lr extends Qt{static get type(){return"CodeNode"}constructor(e="",t=[],n=""){super("code"),this.isCodeNode=!0,this.code=e,this.includes=t,this.language=n}isGlobal(){return!0}setIncludes(e){return this.includes=e,this}getIncludes(){return this.includes}generate(e){const t=this.getIncludes(e);for(const r of t)r.build(e);const n=e.getCodeFromNode(this,this.getNodeType(e));return n.code=this.code,n.code}serialize(e){super.serialize(e),e.code=this.code,e.language=this.language}deserialize(e){super.deserialize(e),this.code=e.code,this.language=e.language}}const hv=rt(lr).setParameterLength(1,3),wee=(i,e)=>hv(i,e,"js"),Tee=(i,e)=>hv(i,e,"wgsl"),Eee=(i,e)=>hv(i,e,"glsl");class LD extends lr{static get type(){return"FunctionNode"}constructor(e="",t=[],n=""){super(e,t,n)}getNodeType(e){return this.getNodeFunction(e).type}getInputs(e){return this.getNodeFunction(e).inputs}getNodeFunction(e){const t=e.getDataFromNode(this);let n=t.nodeFunction;return n===void 0&&(n=e.parser.parseFunction(this.code),t.nodeFunction=n),n}generate(e,t){super.generate(e);const n=this.getNodeFunction(e),r=n.name,s=n.type,o=e.getCodeFromNode(this,s);r!==""&&(o.name=r);const a=e.getPropertyName(o),l=this.getNodeFunction(e).getCode(a);return o.code=l+`
3867`,t==="property"?a:e.format(`${a}()`,s,t)}}const ND=(i,e=[],t="")=>{for(let s=0;s<e.length;s++){const o=e[s];typeof o=="function"&&(e[s]=o.functionNode)}const n=it(new LD(i,e,t)),r=(...s)=>n.call(...s);return r.functionNode=n,r},Ree=(i,e)=>ND(i,e,"glsl"),Cee=(i,e)=>ND(i,e,"wgsl");class Pee extends Qt{static get type(){return"ScriptableValueNode"}constructor(e=null){super(),this._value=e,this._cache=null,this.inputType=null,this.outputType=null,this.events=new il,this.isScriptableValueNode=!0}get isScriptableOutputNode(){return this.outputType!==null}set value(e){this._value!==e&&(this._cache&&this.inputType==="URL"&&this.value.value instanceof ArrayBuffer&&(URL.revokeObjectURL(this._cache),this._cache=null),this._value=e,this.events.dispatchEvent({type:"change"}),this.refresh())}get value(){return this._value}refresh(){this.events.dispatchEvent({type:"refresh"})}getValue(){const e=this.value;if(e&&this._cache===null&&this.inputType==="URL"&&e.value instanceof ArrayBuffer)this._cache=URL.createObjectURL(new Blob([e.value]));else if(e&&e.value!==null&&e.value!==void 0&&((this.inputType==="URL"||this.inputType==="String")&&t
3867ypeof e.value=="string"||this.inputType==="Number"&&typeof e.value=="number"||this.inputType==="Vector2"&&e.value.isVector2||this.inputType==="Vector3"&&e.value.isVector3||this.inputType==="Vector4"&&e.value.isVector4||this.inputType==="Color"&&e.value.isColor||this.inputType==="Matrix3"&&e.value.isMatrix3||this.inputType==="Matrix4"&&e.value.isMatrix4))return e.value;return this._cache||e}getNodeType(e){return this.value&&this.value.isNode?this.value.getNodeType(e):"float"}setup(){return this.value&&this.value.isNode?this.value:se()}serialize(e){super.serialize(e),this.value!==null?this.inputType==="ArrayBuffer"?e.value=U5(this.value):e.value=this.value?this.value.toJSON(e.meta).uuid:null:e.value=null,e.inputType=this.inputType,e.outputType=this.outputType}deserialize(e){super.deserialize(e);let t=null;e.value!==null&&(e.inputType==="ArrayBuffer"?t=O5(e.value):e.inputType==="Texture"?t=e.meta.textures[e.value]:t=e.meta.nodes[e.value]||null),this.value=t,this.inputType=e.inputType,this.outputType=e.outputType}}const b_=rt(Pee).setParameterLength(1);class DD extends Map{get(e,t=null,...n){if(this.has(e))return super.get(e);if(t!==null){const r=t(...n);return this.set(e,r),r}}}class Lee{constructor(e){this.scriptableNode=e}get parameters(){return this.scriptableNode.parameters}get layout(){return this.scriptableNode.getLayout()}getInputLayout(e){return this.scriptableNode.getInputLayout(e)}get(e){const t=this.parameters[e];return t?t.getValue():null}}const S_=new DD;class Nee extends Qt{static get type(){return"ScriptableNode"}constructor(e=null,t={}){super(),this.codeNode=e,this.parameters=t,this._local=new DD,this._output=b_(null),this._outputs={},this._source=this.source,this._method=null,this._object=null,this._value=null,this._needsOutputUpdate=!0,this.onRefresh=this.onRefresh.bind(this),this.isScriptableNode=!0}get source(){return this.codeNode?this.codeNode.code:""}setLocal(e,t){return this._local.set(e,t)}getLocal(e){return this._local.get(e)}onRefresh(){this._refresh()}getInputLayout(e){for(const t of this.getLayout())if(t.inputType&&(t.id===e||t.name===e))return t}getOutputLayout(e){for(const t of this.getLayout())if(t.outputType&&(t.id===e||t.name===e))return t}setOutput(e,t){const n=this._outputs;return n[e]===void 0?n[e]=b_(t):n[e].value=t,this}getOutput(e){return this._outputs[e]}getParameter(e){return this.parameters[e]}setParameter(e,t){const n=this.parameters;return t&&t.isScriptableNode?(this.deleteParameter(e),n[e]=t,n[e].getDefaultOutput().events.addEventListener("refresh",this.onRefresh)):t&&t.isScriptableValueNode?(this.deleteParameter(e),n[e]=t,n[e].events.addEventListener("refresh",this.onRefresh)):n[e]===void 0?(n[e]=b_(t),n[e].events.addEventListener("refresh",this.onRefresh)):n[e].value=t,this}getValue(){return this.getDefaultOutput().getValue()}deleteParameter(e){let t=this.parameters[e];return t&&(t.isScriptableNode&&(t=t.getDefaultOutput()),t.events.removeEventListener("refresh",this.onRefresh)),this}clearParameters(){for(const e of Object.keys(this.parameters))this.deleteParameter(e);return this.needsUpdate=!0,this}call(e,...t){const r=this.getObject()[e];if(typeof r=="function")return r(...t)}async callAsync(e,...t){const r=this.getObject()[e];if(typeof r=="function")return r.constructor.name==="AsyncFunction"?await r(...t):r(...t)}getNodeType(e){return this.getDefaultOutputNode().getNodeType(e)}refresh(e=null){e!==null?this.getOutput(e).refresh():this._refresh()}getObject(){if(this.needsUpdate&&this.dispose(),this._object!==null)return this._object;const e=()=>this.refresh(),t=(c,u)=>this.setOutput(c,u),n=new Lee(this),r=S_.get("THREE"),s=S_.get("TSL"),o=this.getMethod(),a=[n,this._local,S_,e,t,r,s];this._object=o(...a);const l=this._object.layout;if(l&&(l.cache===!1&&this._local.clear(),this._output.outputType=l.outputType||null,Array.isArray(l.elements)))for(const c of l.elements){const u=c.id||c.name;c.inputType&&(this.getParameter(u)===void 0&&this.setParameter(u,null),this.getParameter(u).inputType=c.inputType),c.outputType&&(this.getOutput(u)===void 0&&this.setOutput(u,null),this.getOutput(u).outputType=c.outputType)}return this._object}deserialize(e){super.deserialize(e);for(const t in this.parameters){let n=this.parameters[t];n.isScriptableNode&&(n=n.getDefaultOutput()),n.events.addEventListener("refresh",this.onRefresh)}}getLayout(){return this.getObject().layout}getDefaultOutputNode(){const e=this.getDefaultOutput().value;return e&&e.isNode?e:se()}getDefaultOutput(){return this._exec()._output}getMethod(){if(this.needsUpdate&&this.dispose(),this._method!==null)return this._method;const e=["parameters","local","global","refresh","setOutput","THREE","TSL"],n=["layout","init","main","dispose"].join(", "),r="var "+n+`; var output = {};
3868`,s=`
3869return { ...output, `+n+" };",o=r+this.codeNode.code+s;return this._method=new Function(...e,o),this._method}dispose(){this._method!==null&&(this._object&&typeof this._object.dispose=="function"&&this._object.dispose(),this._method=null,this._object=null,this._source=null,this._value=null,this._needsOutputUpdate=!0,this._output.value=null,this._outputs={})}setup(){return this.getDefaultOutputNode()}getCacheKey(e){const t=[N5(this.source),this.getDefaultOutputNode().getCacheKey(e)];for(const n in this.parameters)t.push(this.parameters[n].getCacheKey(e));return V1(t)}set needsUpdate(e){e===!0&&this.dispose()}get needsUpdate(){return this.source!==this._source}
3869_exec(){return this.codeNode===null?this:(this._needsOutputUpdate===!0&&(this._value=this.call("main"),this._needsOutputUpdate=!1),this._output.value=this._value,this)}_refresh(){this.needsUpdate=!0,this._exec(),this._output.refresh()}}const Dee=rt(Nee).setParameterLength(1,2);function ID(i){let e;const t=i.context.getViewZ;return t!==void 0&&(e=t(this)),(e||tr.z).negate()}const uw=Ee(([i,e],t)=>{const n=ID(t);return Za(i,e,n)}),hw=Ee(([i],e)=>{const t=ID(e);return i.mul(i,t,t).negate().exp().oneMinus()}),A0=Ee(([i,e])=>jt(e.toFloat().mix(Xd.rgb,i.toVec3()),Xd.a));function Iee(i,e,t){return console.warn('THREE.TSL: "rangeFog( color, near, far )" is deprecated. Use "fog( color, rangeFogFactor( near, far ) )" instead.'),A0(i,uw(e,t))}function Bee(i,e){return console.warn('THREE.TSL: "densityFog( color, density )" is deprecated. Use "fog( color, densityFogFactor( density ) )" instead.'),A0(i,hw(e))}let _u=null,vu=null;class Fee extends Qt{static get type(){return"RangeNode"}constructor(e=se(),t=se()){super(),this.minNode=e,this.maxNode=t}getVectorLength(e){const t=e.getTypeLength(Cc(this.minNode.value)),n=e.getTypeLength(Cc(this.maxNode.value));return t>n?t:n}getNodeType(e){return e.object.count>1?e.getTypeFromLength(this.getVectorLength(e)):"float"}setup(e){const t=e.object;let n=null;if(t.count>1){const r=this.minNode.value,s=this.maxNode.value,o=e.getTypeLength(Cc(r)),a=e.getTypeLength(Cc(s));_u=_u||new Jt,vu=vu||new Jt,_u.setScalar(0),vu.setScalar(0),o===1?_u.setScalar(r):r.isColor?_u.set(r.r,r.g,r.b,1):_u.set(r.x,r.y,r.z||0,r.w||0),a===1?vu.setScalar(s):s.isColor?vu.set(s.r,s.g,s.b,1):vu.set(s.x,s.y,s.z||0,s.w||0);const l=4,c=l*t.count,u=new Float32Array(c);for(let m=0;m<c;m++){const g=m%l,v=_u.getComponent(g),b=vu.getComponent(g);u[m]=Sf.lerp(v,b,Math.random())}const p=this.getNodeType(e);if(t.count<=4096)n=z0(u,"vec4",t.count).element(Fc).convert(p);else{const m=new Ic(u,4);e.geometry.setAttribute("__range"+this.id,m),n=l1(m).convert(p)}}else n=se(0);return n}}const Uee=rt(Fee).setParameterLength(2);class Oee extends Qt{static get type(){return"ComputeBuiltinNode"}constructor(e,t){super(t),this._builtinName=e}getHash(e){return this.getBuiltinName(e)}getNodeType(){return this.nodeType}setBuiltinName(e){return this._builtinName=e,this}getBuiltinName(){return this._builtinName}hasBuiltin(e){return e.hasBuiltin(this._builtinName)}generate(e,t){const n=this.getBuiltinName(e),r=this.getNodeType(e);return e.shaderStage==="compute"?e.format(n,r,t):(console.warn(`ComputeBuiltinNode: Compute built-in value ${n} can not be accessed in the ${e.shaderStage} stage`),e.generateConst(r))}serialize(e){super.serialize(e),e.global=this.global,e._builtinName=this._builtinName}deserialize(e){super.deserialize(e),this.global=e.global,this._builtinName=e._builtinName}}const X0=(i,e)=>it(new Oee(i,e)),kee=X0("numWorkgroups","uvec3"),zee=X0("workgroupId","uvec3"),Vee=X0("globalId","uvec3"),Gee=X0("localId","uvec3"),qee=X0("subgroupSize","uint");class Hee extends Qt{constructor(e){super(),this.scope=e}generate(e){const{scope:t}=this,{renderer:n}=e;n.backend.isWebGLBackend===!0?e.addFlowCode(`	// ${t}Barrier 
3870`):e.addLineFlowCode(`${t}Barrier()`,this)}}const dw=rt(Hee),Wee=()=>dw("workgroup").toStack(),$ee=()=>dw("storage").toStack(),jee=()=>dw("texture").toStack();class Xee extends ph{constructor(e,t){super(e,t),this.isWorkgroupInfoElementNode=!0}generate(e,t){let n;const r=e.context.assign;if(n=super.generate(e),r!==!0){const s=this.getNodeType(e);n=e.format(n,s,t)}return n}}class Yee extends Qt{constructor(e,t,n=0){super(t),this.bufferType=t,this.bufferCount=n,this.isWorkgroupInfoNode=!0,this.elementType=t,this.scope=e}label(e){return this.name=e,this}setScope(e){return this.scope=e,this}getElementType(){return this.elementType}getInputType(){return`${this.scope}Array`}element(e){return it(new Xee(this,e))}generate(e){return e.getScopedArray(this.name||`${this.scope}Array_${this.id}`,this.scope.toLowerCase(),this.bufferType,this.bufferCount)}}const Qee=(i,e)=>it(new Yee("Workgroup",i,e));class Tr extends Qt{static get type(){return"AtomicFunctionNode"}constructor(e,t,n){super("uint"),this.method=e,this.pointerNode=t,this.valueNode=n,this.parents=!0}getInputType(e){return this.pointerNode.getNodeType(e)}getNodeType(e){return this.getInputType(e)}generate(e){const t=e.getNodeProperties(this),n=t.parents,r=this.method,s=this.getNodeType(e),o=this.getInputType(e),a=this.pointerNode,l=this.valueNode,c=[];c.push(`&${a.build(e,o)}`),l!==null&&c.push(l.build(e,o));const u=`${e.getMethod(r,s)}( ${c.join(", ")} )`;if(n.length===1&&n[0].isStackNode===!0)e.addLineFlowCode(u,this);else return t.constNode===void 0&&(t.constNode=Gl(u,s).toConst()),t.constNode.build(e)}}Tr.ATOMIC_LOAD="atomicLoad";Tr.ATOMIC_STORE="atomicStore";Tr.ATOMIC_ADD="atomicAdd";Tr.ATOMIC_SUB="atomicSub";Tr.ATOMIC_MAX="atomicMax";Tr.ATOMIC_MIN="atomicMin";Tr.ATOMIC_AND="atomicAnd";Tr.ATOMIC_OR="atomicOr";Tr.ATOMIC_XOR="atomicXor";const Zee=rt(Tr),al=(i,e,t)=>Zee(i,e,t).toStack(),Kee=i=>al(Tr.ATOMIC_LOAD,i,null),Jee=(i,e)=>al(Tr.ATOMIC_STORE,i,e),ete=(i,e)=>al(Tr.ATOMIC_ADD,i,e),tte=(i,e)=>al(Tr.ATOMIC_SUB,i,e),nte=(i,e)=>al(Tr.ATOMIC_MAX,i,e),ite=(i,e)=>al(Tr.ATOMIC_MIN,i,e),rte=(i,e)=>al(Tr.ATOMIC_AND,i,e),ste=(i,e)=>al(Tr.ATOMIC_OR,i,e),ote=(i,e)=>al(Tr.ATOMIC_XOR,i,e);let rg;function dv(i){rg=rg||new WeakMap;let e=rg.get(i);return e===void 0&&rg.set(i,e={}),e}function fw(i){const e=dv(i);return e.shadowMatrix||(e.shadowMatrix=$t("mat4").setGroup(Zt).onRenderUpd
3870ate(()=>(i.castShadow!==!0&&i.shadow.updateMatrices(i),i.shadow.matrix)))}function BD(i,e=Fl){const t=fw(i).mul(e);return t.xyz.div(t.w)}function pw(i){const e=dv(i);return e.position||(e.position=$t(new re).setGroup(Zt).onRenderUpdate((t,n)=>n.value.setFromMatrixPosition(i.matrixWorld)))}function FD(i){const e=dv(i);return e.targetPosition||(e.targetPosition=$t(new re).setGroup(Zt).onRenderUpdate((t,n)=>n.value.setFromMatrixPosition(i.target.matrixWorld)))}function Aw(i){const e=dv(i);return e.viewPosition||(e.viewPosition=$t(new re).setGroup(Zt).onRenderUpdate(({camera:t},n)=>{n.value=n.value||new re,n.value.setFromMatrixPosition(i.matrixWorld),n.value.applyMatrix4(t.matrixWorldInverse)}))}const mw=i=>eo.transformDirection(pw(i).sub(FD(i))),ate=i=>i.sort((e,t)=>e.id-t.id),lte=(i,e)=>{for(const t of e)if(t.isAnalyticLightNode&&t.light.id===i)return t;return null},mx=new WeakMap;class gw extends Qt{static get type(){return"LightsNode"}constructor(){super("vec3"),this.totalDiffuseNode=Se().toVar(),this.totalSpecularNode=Se().toVar(),this.outgoingLightNode=Se().toVar(),this._lights=[],this._lightNodes=null,this._lightNodesHash=null,this.global=!0}customCacheKey(){const e=[],t=this._lights;for(let n=0;n<t.length;n++){const r=t[n];if(e.push(r.id),r.isSpotLight===!0){const s=r.map!==null?r.map.id:-1;e.push(s)}}return V1(e)}getHash(e){if(this._lightNodesHash===null){this._lightNodes===null&&this.setupLightsNode(e);const t=[];for(const n of this._lightNodes)t.push(n.getSelf().getHash());this._lightNodesHash="lights-"+t.join(",")}return this._lightNodesHash}analyze(e){const t=e.getDataFromNode(this);for(const n of t.nodes)n.build(e)}setupLightsNode(e){const t=[],n=this._lightNodes,r=ate(this._lights),s=e.renderer.library;for(const o of r)if(o.isNode)t.push(it(o));else{let a=null;if(n!==null&&(a=lte(o.id,n)),a===null){const l=s.getLightNodeClass(o.constructor);if(l===null){console.warn(`LightsNode.setupNodeLights: Light node not found for ${o.constructor.name}`);continue}let c=null;mx.has(o)?c=mx.get(o):(c=it(new l(o)),mx.set(o,c)),t.push(c)}}this._lightNodes=t}setupDirectLight(e,t,n){const{lightingModel:r,reflectedLight:s}=e.context;r.direct({...n,lightNode:t,reflectedLight:s},e)}setupDirectRectAreaLight(e,t,n){const{lightingModel:r,reflectedLight:s}=e.context;r.directRectArea({...n,lightNode:t,reflectedLight:s},e)}setupLights(e,t){for(const n of t)n.build(e)}getLightNodes(e){return this._lightNodes===null&&this.setupLightsNode(e),this._lightNodes}setup(e){const t=e.lightsNode;e.lightsNode=this;let n=this.outgoingLightNode;const r=e.context,s=r.lightingModel,o=e.getDataFromNode(this);if(s){const{totalDiffuseNode:a,totalSpecularNode:l}=this;r.outgoingLight=n;const c=e.addStack();o.nodes=c.nodes,s.start(e);const{backdrop:u,backdropAlpha:p}=r,{directDiffuse:m,directSpecular:g,indirectDiffuse:v,indirectSpecular:b}=r.reflectedLight;let M=m.add(v);u!==null&&(p!==null?M=Se(p.mix(M,u)):M=Se(u),r.material.transparent=!0),a.assign(M),l.assign(g.add(b)),n.assign(a.add(l)),s.finish(e),n=n.bypass(e.removeStack())}else o.nodes=[];return e.lightsNode=t,n}setLights(e){return this._lights=e,this._lightNodes=null,this._lightNodesHash=null,this}getLights(){return this._lights}get hasLights(){return this._lights.length>0}}const cte=(i=[])=>it(new gw).setLights(i);class ute extends Qt{static get type(){return"ShadowBaseNode"}constructor(e){super(),this.light=e,this.updateBeforeType=gn.RENDER,this.isShadowBaseNode=!0}setupShadowPosition({context:e,material:t}){_w.assign(t.receivedShadowPositionNode||e.shadowPositionWorld||Fl)}dispose(){this.updateBeforeType=gn.NONE}}const _w=Yf("vec3","shadowPositionWorld");function hte(i,e={}){return e.toneMapping=i.toneMapping,e.toneMappingExposure=i.toneMappingExposure,e.outputColorSpace=i.outputColorSpace,e.renderTarget=i.getRenderTarget(),e.activeCubeFace=i.getActiveCubeFace(),e.activeMipmapLevel=i.getActiveMipmapLevel(),e.renderObjectFunction=i.getRenderObjectFunction(),e.pixelRatio=i.getPixelRatio(),e.mrt=i.getMRT(),e.clearColor=i.getClearColor(e.clearColor||new qt),e.clearAlpha=i.getClearAlpha(),e.autoClear=i.autoClear,e.scissorTest=i.getScissorTest(),e}function dte(i,e){return e=hte(i,e),i.setMRT(null),i.setRenderObjectFunction(null),i.setClearColor(0,1),i.autoClear=!0,e}function fte(i,e){i.toneMapping=e.toneMapping,i.toneMappingExposure=e.toneMappingExposure,i.outputColorSpace
vendor: 8,165 bytes, line 3870
3870=e.outputColorSpace,i.setRenderTarget(e.renderTarget,e.activeCubeFace,e.activeMipmapLevel),i.setRenderObjectFunction(e.renderObjectFunction),i.setPixelRatio(e.pixelRatio),i.setMRT(e.mrt),i.setClearColor(e.clearColor,e.clearAlpha),i.autoClear=e.autoClear,i.setScissorTest(e.scissorTest)}function pte(i,e={}){return e.background=i.background,e.backgroundNode=i.backgroundNode,e.overrideMaterial=i.overrideMaterial,e}function Ate(i,e){return e=pte(i,e),i.background=null,i.backgroundNode=null,i.overrideMaterial=null,e}function mte(i,e){i.background=e.background,i.backgroundNode=e.backgroundNode,i.overrideMaterial=e.overrideMaterial}function gte(i,e,t){return t=dte(i,t),t=Ate(e,t),t}function _te(i,e,t){fte(i,t),mte(e,t)}const JR=new WeakMap,UD=Ee(({depthTexture:i,shadowCoord:e,depthLayer:t})=>{let n=Ln(i,e.xy).label("t_basic");return i.isDepthArrayTexture&&(n=n.depth(t)),n.compare(e.z)}),OD=Ee(({depthTexture:i,shadowCoord:e,shadow:t,depthLayer:n})=>{const r=(M,x)=>{let w=Ln(i,M);return i.isDepthArrayTexture&&(w=w.depth(n)),w.compare(x)},s=ui("mapSize","vec2",t).setGroup(Zt),o=ui("radius","float",t).setGroup(Zt),a=dt(1).div(s),l=a.x.negate().mul(o),c=a.y.negate().mul(o),u=a.x.mul(o),p=a.y.mul(o),m=l.div(2),g=c.div(2),v=u.div(2),b=p.div(2);return rr(r(e.xy.add(dt(l,c)),e.z),r(e.xy.add(dt(0,c)),e.z),r(e.xy.add(dt(u,c)),e.z),r(e.xy.add(dt(m,g)),e.z),r(e.xy.add(dt(0,g)),e.z),r(e.xy.add(dt(v,g)),e.z),r(e.xy.add(dt(l,0)),e.z),r(e.xy.add(dt(m,0)),e.z),r(e.xy,e.z),r(e.xy.add(dt(v,0)),e.z),r(e.xy.add(dt(u,0)),e.z),r(e.xy.add(dt(m,b)),e.z),r(e.xy.add(dt(0,b)),e.z),r(e.xy.add(dt(v,b)),e.z),r(e.xy.add(dt(l,p)),e.z),r(e.xy.add(dt(0,p)),e.z),r(e.xy.add(dt(u,p)),e.z)).mul(1/17)}),kD=Ee(({depthTexture:i,shadowCoord:e,shadow:t,depthLayer:n})=>{const r=(p,m)=>{let g=Ln(i,p);return i.isDepthArrayTexture&&(g=g.depth(n)),g.compare(m)},s=ui("mapSize","vec2",t).setGroup(Zt),o=dt(1).div(s),a=o.x,l=o.y,c=e.xy,u=$l(c.mul(s).add(.5));return c.subAssign(u.mul(o)),rr(r(c,e.z),r(c.add(dt(a,0)),e.z),r(c.add(dt(0,l)),e.z),r(c.add(o),e.z),Qn(r(c.add(dt(a.negate(),0)),e.z),r(c.add(dt(a.mul(2),0)),e.z),u.x),Qn(r(c.add(dt(a.negate(),l)),e.z),r(c.add(dt(a.mul(2),l)),e.z),u.x),Qn(r(c.add(dt(0,l.negate())),e.z),r(c.add(dt(0,l.mul(2))),e.z),u.y),Qn(r(c.add(dt(a,l.negate())),e.z),r(c.add(dt(a,l.mul(2))),e.z),u.y),Qn(Qn(r(c.add(dt(a.negate(),l.negate())),e.z),r(c.add(dt(a.mul(2),l.negate())),e.z),u.x),Qn(r(c.add(dt(a.negate(),l.mul(2))),e.z),r(c.add(dt(a.mul(2),l.mul(2))),e.z),u.x),u.y)).mul(1/9)}),zD=Ee(({depthTexture:i,shadowCoord:e,depthLayer:t})=>{const n=se(1).toVar();let r=Ln(i).sample(e.xy);(i.isDepthArrayTexture||i.isDataArrayTexture)&&(r=r.depth(t)),r=r.rg;const s=Z1(e.z,r.x);return xn(s.notEqual(se(1)),()=>{const o=e.z.sub(r.x),a=Qi(0,r.y.mul(r.y));let l=a.div(a.add(o.mul(o)));l=Qa(On(l,.3).div(.95-.3)),n.assign(Qa(Qi(s,l)))}),n}),vte=Ee(([i,e,t])=>{let n=Fl.sub(i).length();return n=n.sub(e).div(t.sub(e)),n=n.saturate(),n}),yte=i=>{const e=i.shadow.camera,t=ui("near","float",e).setGroup(Zt),n=ui("far","float",e).setGroup(Zt),r=R8(i);return vte(r,t,n)},VD=i=>{let e=JR.get(i);if(e===void 0){const t=i.isPointLight?yte(i):null;e=new sr,e.colorNode=jt(0,0,0,1),e.depthNode=t,e.isShadowPassMaterial=!0,e.name="ShadowMaterial",e.fog=!1,JR.set(i,e)}return e},eC=new va,Zh=[],GD=(i,e,t,n)=>{Zh[0]=i,Zh[1]=e;let r=eC.get(Zh);return(r===void 0||r.shadowType!==t||r.useVelocity!==n)&&(r=(s,o,a,l,c,u,...p)=>{(s.castShadow===!0||s.receiveShadow&&t===fo)&&(n&&(F5(s).useVelocity=!0),s.onBeforeShadow(i,s,a,e.camera,l,o.overrideMaterial,u),i.renderObject(s,o,a,l,c,u,...p),s.onAfterShadow(i,s,a,e.camera,l,o.overrideMaterial,u))},r.shadowType=t,r.useVelocity=n,eC.set(Zh,r)),Zh[0]=null,Zh[1]=null,r},xte=Ee(({samples:i,radius:e,size:t,shadowPass:n,depthLayer:r})=>{const s=se(0).toVar("meanVertical"),o=se(0).toVar("squareMeanVertical"),a=i.lessThanEqual(se(1)).select(se(0),se(2).div(i.sub(1))),l=i.lessThanEqual(se(1)).select(se(0),se(-1));Zn({start:me(0),end:me(i),type:"int",condition:"<"},({i:u})=>{const p=l.add(se(u).mul(a));let m=n.sample(rr(j0.xy,dt(0,p).mul(e)).div(t));(n.value.isDepthArrayTexture||n.value.isDataArrayTexture)&&(m=m.depth(r)),m=m.x,s.addAssign(m),o.addAssign(m.mul(m))}),s.divAssign(i),o.divAssign(i);const c=ol(o.sub(s.mul(s)));return dt(s,c)}),bte=Ee(({samples:i,radius:e,size:t,shadowPass:n,depthLayer:r})=>{const s=se(0).toVar("meanHorizontal"),o=se(0).toVar("squareMeanHorizontal"),a=i.lessThanEqual(se(1)).select(se(0),se(2).div(i.sub(1))),l=i.lessThanEqual(se(1)).select(se(0),se(-1));Zn({start:me(0),end:me(i),type:"int",condition:"<"},({i:u})=>{const p=l.add(se(u).mul(a));let m=n.sample(rr(j0.xy,dt(p,0).mul(e)).div(t));(n.value.isDepthArrayTexture||n.value.isDataArrayTexture)&&(m=m.depth(r)),s.addAssign(m.x),o.addAssign(rr(m.y.mul(m.y),m.x.mul(m.x)))}),s.divAssign(i),o.divAssign(i);const c=ol(o.sub(s.mul(s)));return dt(s,c)}),Ste=[UD,OD,kD,zD];let gx;const sg=new lw;class qD extends ute{static get type(){return"ShadowNode"}constructor(e,t=null){super(e),this.shadow=t||e.shadow,this.shadowMap=null,this.vsmShadowMapVertical=null,this.vsmShadowMapHorizontal=null,this.vsmMaterialVertical=null,this.vsmMaterialHorizontal=null,this._node=null,this._cameraFrameId=new WeakMap,this.isShadowNode=!0,this.depthLayer=0}setupShadowFilter(e,{filterFn:t,depthTexture:n,shadowCoord:r,shadow:s,depthLayer:o}){const a=r.x.greaterThanEqual(0).and(r.x.lessThanEqual(1)).and(r.y.greaterThanEqual(0)).and(r.y.lessThanEqual(1)).and(r.z.lessThanEqual(1)),l=t({depthTexture:n,shadowCoord:r,shadow:s,depthLayer:o});return a.select(l,se(1))}setupShadowCoord(e,t){const{shadow:n}=this,{renderer:r}=e,s=ui("bias","float",n).setGroup(Zt);let o=t,a;if(n.camera.isOrthographicCamera||r.logarithmicDepthBuffer!==!0)o=o.xyz.div(o.w),a=o.z,r.coordinateSystem===Xa&&(a=a.mul(2).sub(1));else{const l=o.w;o=o.xy.div(l);const c=ui("near","float",n.camera).setGroup(Zt),u=ui("far","float",n.camera).setGroup(Zt);a=ZM(l.negate(),c,u)}return o=Se(o.x,o.y.oneMinus(),a.add(s)),o}getShadowFilterFn(e){return Ste[e]}setupRenderTarget(e,t){const n=new $s(e.mapSize.width,e.mapSize.height);n.name="ShadowDepthTexture",n.compareFunction=E1;const r=t.createRenderTarget(e.mapSize.width,e.mapSize.height);return r.texture.name="ShadowMap",r.texture.type=e.mapType,r.depthTexture=n,{shadowMap:r,depthTexture:n}}setupShadow(e){const{renderer:t}=e,{light:n,shadow:r}=this,s=t.shadowMap.type,{depthTexture:o,shadowMap:a}=this.setupRenderTarget(r,e);if(r.camera.updateProjectionMatrix(),s===fo){o.compareFunction=null,a.isRenderTargetArray?(a._vsmShadowMapVertical||(a._vsmShadowMapVertical=e.createRenderTargetArray(r.mapSize.width,r.mapSize.height,a.depth,{format:Nl,type:dr,depthBuffer:!1}),a._vsmShadowMapVertical.texture.name="VSMVertical"),this.vsmShadowMapVertical=a._vsmShadowMapVertical,a._vsmShadowMapHorizontal||(a._vsmShadowMapHorizontal=e.createRenderTargetArray(r.mapSize.width,r.mapSize.height,a.depth,{format:Nl,type:dr,depthBuffer:!1}),a._vsmShadowMapHorizontal.texture.name="VSMHorizontal"),this.vsmShadowMapHorizontal=a._vsmShadowMapHorizontal):(this.vsmShadowMapVertical=e.createRenderTarget(r.mapSize.width,r.mapSize.height,{format:Nl,type:dr,depthBuffer:!1}),this.vsmShadowMapHorizontal=e.createRenderTarget(r.mapSize.width,r.mapSize.height,{format:Nl,type:dr,depthBuffer:!1}));let x=Ln(o);o.isDepthArrayTexture&&(x=x.depth(this.depthLayer));let w=Ln(this.vsmShadowMapVertical.texture);o.isDepthArrayTexture&&(w=w.depth(this.depthLayer));const R=ui("blurSamples","float",r).setGroup(Zt),C=ui("radius","float",r).setGroup(Zt),N=ui("mapSize","vec2",r).setGroup(Zt);let D=this.vsmMaterialVertical||(this.vsmMaterialVertical=new sr);D.fragmentNode=xte({samples:R,radius:C,size:N,shadowPass:x,depthLayer:this.depthLayer}).context(e.getSharedContext()),D.name="VSMVertical",D=this.vsmMaterialHorizontal||(this.vsmMaterialHorizontal=new sr),D.fragmentNode=bte({samples:R,radius:C,size:N,shadowPass:w,depthLayer:this.depthLayer}).context(e.getSharedContext()),D.name="VSMHorizontal"}const l=ui("intensity","float",r).setGroup(Zt),c=ui("normalBias","float",r).setGroup(Zt),u=fw(n).mul(_w.add(rv.mul(c))),p=this.setupShadowCoord(e,u),m=r.filterNode||this.get
3870ShadowFilterFn(t.shadowMap.type)||null;if(m===null)throw new Error("THREE.WebGPURenderer: Shadow map type not supported yet.");const g=s===fo?this.vsmShadowMapHorizontal.texture:o,v=this.setupShadowFilter(e,{filterFn:m,shadowTexture:a.texture,depthTexture:g,shadowCoord:p,shadow:r,depthLayer:this.depthLayer});let b=Ln(a.texture,p);o.isDepthArrayTexture&&(b=b.depth(this.depthLayer));const M=Qn(1,v.rgb.mix(b,1),l.mul(b.a)).toVar();return this.shadowMap=a,this.shadow.map=a,M}setup(e){if(e.renderer.shadowMap.enabled!==!1)return Ee(()=>{let t=this._node;return this.setupShadowPosition(e),t===null&&(this._node=t=this.setupShadow(e)),e.material.shadowNode&&console.warn('THREE.NodeMaterial: ".shadowNode" is deprecated. Use ".castShadowNode" instead.'),e.material.receivedShadowNode&&(t=e.material.receivedShadowNode(t)),t})()}renderShadow(e){const{shadow:t,shadowMap:n,light:r}=this,{renderer:s,scene:o}=e;t.updateMatrices(r),n.setSize(t.mapSize.width,t.mapSize.height,n.depth),s.render(o,t.camera)}updateShadow(e){const{shadowMap:t,light:n,shadow:r}=this,{renderer:s,scene:o,camera:a}=e,l=s.shadowMap.type,c=t.depthTexture.version;this._depthVersionCached=c;const u=r.camera.layers.mask;(r.camera.layers.mask&4294967294)===0&&(r.camera.layers.mask=a.layers.mask);const p=s.getRenderObjectFunction(),m=s.getMRT(),g=m?m.has("velocity"):!1;gx=gte(s,o,gx),o.overrideMaterial=VD(n),s.setRenderObjectFunction(GD(s,r,l,g)),s.setClearColor(0,0),s.setRenderTarget(t),this.renderShadow(e),s.setRenderObjectFunction(p),n.isPointLight!==!0&&l===fo&&this.vsmPass(s),r.camera.layers.mask=u,_te(s,o,gx)}vsmPass(e){const{shadow:t}=this,n=this.shadowMap.depth;this.vsmShadowMapVertical.setSize(t.mapSize.width,t.mapSize.height,n),this.vsmShadowMapHorizontal.setSize(t.mapSize.width,t.mapSize.height,n),e.setRenderTarget(this.vsmShadowMapVertical),sg.material=this.vsmMaterialVertical,sg.render(e),e.setRenderTarget(this.vsmShadowMapHorizontal),sg.material=this.vsmMaterialHorizontal,sg.render(e)}dispose(){this.shadowMap.dispose(),this.shadowMap=null,this.vsmShadowMapVertical!==null&&(this.vsmShadowMapVertical.dispose(),this.vsmShadowMapVertical=null,this.vsmMaterialVertical.dispose(),this.vsmMaterialVertical=null),this.vsmShadowMapHorizontal!==null&&(this.vsmShadowMapHorizontal.dispose(),this.vsmShadowMapHorizontal=null,this.vsmMaterialHorizontal.dispose(),this.vsmMaterialHorizontal=null),super.dispose()}updateBefore(e){const{shadow:t}=this;let n=t.needsUpdate||t.autoUpdate;n&&(this._cameraFrameId[e.camera]===e.frameId&&(n=!1),this._cameraFrameId[e.camera]=e.frameId),n&&(this.updateShadow(e),this.shadowMap.depthTexture.version===this._depthVersionCached&&(t.needsUpdate=!1))}}const HD=(i,e)=>it(new qD(i,e)),Mte=new qt,ra=Ee(([i,e])=>{const t=i.toVar(),n=gi(t),r=_a(1,Qi(n.x,Qi(n.y,n.z)));n.mulAssign(r),t.mulAssign(r.mul(e.mul(2).oneMinus()));const s=dt(t.xy).toVar(),a=e.mul(1.5).oneMinus();return xn(n.z.greaterThanEqual(a),()=>{xn(t.z.greaterThan(0),()=>{s.x.assign(On(4,t.x))})}).ElseIf(n.x.greaterThanEqual(a),()=>{const l=f0(t.x);s.x.assign(t.z.mul(l).add(l.mul(2)))}).ElseIf(n.y.greaterThanEqual(a),()=>{const l=f0(t.y);s.x.assign(t.x.add(l.mul(2)).add(2)),s.y.assign(t.z.mul(l).sub(2))}),dt(.125,.25).mul(s).add(dt(.375,.75)).flipY()}).setLayout({name:"cubeToUV",type:"vec2",inputs:[{name:"pos",type:"vec3"},{name:"texelSizeY",type:"float"}]}),WD=Ee(({depthTexture:i,bd3D:e,dp:t,texelSize:n})=>Ln(i,ra(e,n.y)).compare(t)),$D=Ee(({depthTexture:i,bd3D:e,dp:t,texelSize:n,shadow:r})=>{const s=ui("radius","float",r).setGroup(Zt),o=dt(-1,1).mul(s).mul(n.y);return Ln(i,ra(e.add(o.xyy),n.y)).compare(t).add(Ln(i,ra(e.add(o.yyy),n.y)).compare(t)).add(Ln(i,ra(e.add(o.xyx),n.y)).compare(t)).add(Ln(i,ra(e.add(o.yyx),n.y)).compare(t)).add(Ln(i,ra(e,n.y)).compare(t)).add(Ln(i,ra(e.add(o.xxy),n.y)).compare(t)).add(Ln(i,ra(e.add(o.yxy),n.y)).compare(t)).add(Ln(i,ra(e.add(o.xxx),n.y)).compare(t)).add(Ln(i,ra(e.add(o.yxx),n.y)).compare(t)).mul(1/9)}),wte=Ee(({filterFn:i,depthTexture:e,shadowCoord:t,shadow:n})=>{const r=t.xyz.toVar(),s=r.length(),o=$t("float").setGroup(Zt).onRenderUpdate(()=>
3870n.camera.near),a=$t("float").setGroup(Zt).onRenderUpdate(()=>n.camera.far),l=ui("bias","float",n).setGroup(Zt),c=$t(n.mapSize).setGroup(Zt),u=se(1).toVar();return xn(s.sub(a).lessThanEqual(0).and(s.sub(o).greaterThanEqual(0)),()=>{const p=s.sub(o).div(a.sub(o)).toVar();p.addAssign(l);const m=r.normalize(),g=dt(1).div(c.mul(dt(4,2)));u.assign(i({depthTexture:e,bd3D:m,dp:p,texelSize:g,shadow:n}))}),u}),tC=new Jt,Kh=new at,Op=new at;class Tte extends qD{static get type(){return"PointShadowNode"}constructor(e,t=null){super(e,t)}getShadowFilterFn(e){return e===dO?WD:$D}setupShadowCoord(e,t){return t}setupShadowFilter(e,{filterFn:t,shadowTexture:n,depthTexture:r,shadowCoord:s,shadow:o}){return wte({filterFn:t,shadowTexture:n,depthTexture:r,shadowCoord:s,shadow:o})}renderShadow(e){const{shadow:t,shadowMap:n,light:r}=this,{renderer:s,scene:o}=e,a=t.getFrameExtents();Op.copy(t.mapSize),Op.multiply(a),n.setSize(Op.width,Op.height),Kh.copy(t.mapSize);const l=s.autoClear,c=s.getClearColor(Mte),u=s.getClearAlpha();s.autoClear=!1,s.setClearColor(t.clearColor,t.clearAlpha),s.clear();const p=t.getViewportCount();for(let m=0;m<p;m++){const g=t.getViewport(m),v=Kh.x*g.x,b=Op.y-Kh.y-Kh.y*g.y;tC.set(v,b,Kh.x*g.z,Kh.y*g.w),n.viewport.copy(tC),t.updateMatrices(r,m),s.render(o,t.camera)}s.autoClear=l,s.setClearColor(c,u)}}const jD=(i,e)=>it(new Tte(i,e));class _h extends Qf{static get type(){return"AnalyticLightNode"}constructor(e=null){super(),this.light=e,this.color=new qt,this.colorNode=e&&e.colorNode||$t(this.color).setGroup(Zt),this.baseColorNode=null,this.shadowNode=null,this.shadowColorNode=null,this.isAnalyticLightNode=!0,this.updateType=gn.FRAME}customCacheKey(){return o0(this.light.id,this.light.castShadow?1:0)}getHash(){return this.light.uuid}getLightVector(e){return Aw(this.light).sub(e.context.positionView||tr)}setupDirect(){}setupDirectRectArea(){}setupShadowNode(){return HD(this.light)}setupShadow(e){const{renderer:t}=e;if(t.shadowMap.enabled===!1)return;let n=this.shadowColorNode;if(n===null){const r=this.light.shadow.shadowNode;let s;r!==void 0?s=it(r):s=this.setupShadowNode(),this.shadowNode=s,this.shadowColorNode=n=this.colorNode.mul(s),this.baseColorNode=this.colorNode}this.colorNode=n}setup(e){this.colorNode=this.baseColorNode||this.colorNode,this.light.castShadow?e.object.receiveShadow&&this.setupShadow(e):this.shadowNode!==null&&(this.shadowNode.dispose(),this.shadowNode=null,this.shadowColorNode=null);const t=this.setupDirect(e),n=this.setupDirectRectArea(e);t&&e.lightsNode.setupDirectLight(e,this,t),n&&e.lightsNode.setupDirectRectAreaLight(e,this,n)}update(){const{light:e}=this;this.color.copy(e.color).multiplyScalar(e.intensity)}}const vw=Ee(({lightDistance:i,cutoffDistance:e,decayExponent:t})=>{const n=i.pow(t).max(.01).reciprocal();return e.greaterThan(0).select(n.mul(i.div(e).pow4().oneMinus().clamp().pow2()),n)}),XD=({color:i,lightVector:e,cutoffDistance:t,decayExponent:n})=>{const r=e.normalize(),s=e.length(),o=vw({lightDistance:s,cutoffDistance:t,decayExponent:n}),a=i.mul(o);return{lightDirection:r,lightColor:a}};class Ete extends _h{static get type(){return"PointLightNode"}constructor(e=null){super(e),this.cutoffDistanceNode=$t(0).setGroup(Zt),this.decayExponentNode=$t(2).setGroup(Zt)}update(e){const{light:t}=this;super.update(e),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}setupShadowNode(){return jD(this.light)}setupDirect(e){return XD({color:this.colorNode,lightVector:this.getLightVector(e),cutoffDistance:this.cutoffDistanceNode,decayExponent:this.decayExponentNode})}}const Rte=Ee(([i=Ci()])=>{const e=i.mul(2),t=e.x.floor(),n=e.y.floor();return t.add(n).mod(2).sign()}),Cte=Ee(([i=Ci()],{renderer:e,material:t})=>{const n=se(1).toVar(),r=BM(i.mul(2).sub(1));if(t.alphaToCoverage&&e.samples>1){const s=se(r.fwidth()).toVar();n.assign(Za(s.oneMinus(),s.add(1),r).oneMinus())}else r.greaterThan(1).discard();return n}),EA=Ee(([i,e,t])=>{const n=se(t).toVar(),r=se(e).toVar(),s=zl(i).toVar();return Ur(s,r,n)}).setLayout({name:"mx_select",type:"float",inputs:[{name:"b",type:"bool"},{name:"t",type:"float"},{name:"f",type:"float"}]}),d1=Ee(([i,e])=>{const t=zl(e).toVar(),n=se(i).toVar();return Ur(t,n.negate(),n)}).setLayout({name:"mx_negate_if",type:"float",inputs:[{name:"val",type:"float"},{name:"b",type:"bool"}]}),nr=Ee(([i])=>{const e=se(i).toVar();return me(Wa(e))}
vendor: 4,365 bytes, line 3870
3870).setLayout({name:"mx_floor",type:"int",inputs:[{name:"x",type:"float"}]}),Ri=Ee(([i,e])=>{const t=se(i).toVar();return e.assign(nr(t)),t.sub(se(e))}),Pte=Ee(([i,e,t,n,r,s])=>{const o=se(s).toVar(),a=se(r).toVar(),l=se(n).toVar(),c=se(t).toVar(),u=se(e).toVar(),p=se(i).toVar(),m=se(On(1,a)).toVar();return On(1,o).mul(p.mul(m).add(u.mul(a))).add(o.mul(c.mul(m).add(l.mul(a))))}).setLayout({name:"mx_bilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"}]}),Lte=Ee(([i,e,t,n,r,s])=>{const o=se(s).toVar(),a=se(r).toVar(),l=Se(n).toVar(),c=Se(t).toVar(),u=Se(e).toVar(),p=Se(i).toVar(),m=se(On(1,a)).toVar();return On(1,o).mul(p.mul(m).add(u.mul(a))).add(o.mul(c.mul(m).add(l.mul(a))))}).setLayout({name:"mx_bilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"}]}),YD=Qr([Pte,Lte]),Nte=Ee(([i,e,t,n,r,s,o,a,l,c,u])=>{const p=se(u).toVar(),m=se(c).toVar(),g=se(l).toVar(),v=se(a).toVar(),b=se(o).toVar(),M=se(s).toVar(),x=se(r).toVar(),w=se(n).toVar(),R=se(t).toVar(),C=se(e).toVar(),N=se(i).toVar(),D=se(On(1,g)).toVar(),P=se(On(1,m)).toVar();return se(On(1,p)).toVar().mul(P.mul(N.mul(D).add(C.mul(g))).add(m.mul(R.mul(D).add(w.mul(g))))).add(p.mul(P.mul(x.mul(D).add(M.mul(g))).add(m.mul(b.mul(D).add(v.mul(g))))))}).setLayout({name:"mx_trilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"v4",type:"float"},{name:"v5",type:"float"},{name:"v6",type:"float"},{name:"v7",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),Dte=Ee(([i,e,t,n,r,s,o,a,l,c,u])=>{const p=se(u).toVar(),m=se(c).toVar(),g=se(l).toVar(),v=Se(a).toVar(),b=Se(o).toVar(),M=Se(s).toVar(),x=Se(r).toVar(),w=Se(n).toVar(),R=Se(t).toVar(),C=Se(e).toVar(),N=Se(i).toVar(),D=se(On(1,g)).toVar(),P=se(On(1,m)).toVar();return se(On(1,p)).toVar().mul(P.mul(N.mul(D).add(C.mul(g))).add(m.mul(R.mul(D).add(w.mul(g))))).add(p.mul(P.mul(x.mul(D).add(M.mul(g))).add(m.mul(b.mul(D).add(v.mul(g))))))}).setLayout({name:"mx_trilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"v4",type:"vec3"},{name:"v5",type:"vec3"},{name:"v6",type:"vec3"},{name:"v7",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),QD=Qr([Nte,Dte]),Ite=Ee(([i,e,t])=>{const n=se(t).toVar(),r=se(e).toVar(),s=Nt(i).toVar(),o=Nt(s.bitAnd(Nt(7))).toVar(),a=se(EA(o.lessThan(Nt(4)),r,n)).toVar(),l=se(_n(2,EA(o.lessThan(Nt(4)),n,r))).toVar();return d1(a,zl(o.bitAnd(Nt(1)))).add(d1(l,zl(o.bitAnd(Nt(2)))))}).setLayout({name:"mx_gradient_float_0",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"}]}),Bte=Ee(([i,e,t,n])=>{const r=se(n).toVar(),s=se(t).toVar(),o=se(e).toVar(),a=Nt(i).toVar(),l=Nt(a.bitAnd(Nt(15))).toVar(),c=se(EA(l.lessThan(Nt(8)),o,s)).toVar(),u=se(EA(l.lessThan(Nt(4)),s,EA(l.equal(Nt(12)).or(l.equal(Nt(14))),o,r))).toVar();return d1(c,zl(l.bitAnd(Nt(1)))).add(d1(u,zl(l.bitAnd(Nt(2)))))}).setLayout({name:"mx_gradient_float_1",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),Nr=Qr([Ite,Bte]),Fte=Ee(([i,e,t])=>{const n=se(t).toVar(),r=se(e).toVar(),s=Xf(i).toVar();return Se(Nr(s.x,r,n),Nr(s.y,r,n),Nr(s.z,r,n))}).setLayout({name:"mx_gradient_vec3_0",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"}]}),Ute=Ee(([i,e,t,n])=>{const r=se(n).toVar(),s=se(t).toVar(),o=se(e).toVar(),a=Xf(i).toVar();return Se(Nr(a.x,o,s,r),Nr(a.y,o,s,r),Nr(a.z,o,s,r))}).setLayout({name:"mx_gradient_vec3_1",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),No=Qr([Fte,Ute]),Ote=Ee(([i])=>{const e=se(i).toVar();return _n(.6616,e)}).setLayout({name:"mx_gradient_scale2d_0",type:"float",inputs:[{name:"v",type:"float"}]}),kte=Ee(([i])=>{const e=se(i).toVar();return _n(.982,e)}).setLayout({name:"mx_gradient_scale3d_0",type:"float",inputs:[{name:"v",type:"float"}]}),zte=Ee(([i])=>{const e=Se(i).toVar();return _n(.6616,e)}
vendor: 13,224 bytes, line 3870
3870).setLayout({name:"mx_gradient_scale2d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),ZD=Qr([Ote,zte]),Vte=Ee(([i])=>{const e=Se(i).toVar();return _n(.982,e)}).setLayout({name:"mx_gradient_scale3d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),KD=Qr([kte,Vte]),Ao=Ee(([i,e])=>{const t=me(e).toVar(),n=Nt(i).toVar();return n.shiftLeft(t).bitOr(n.shiftRight(me(32).sub(t)))}).setLayout({name:"mx_rotl32",type:"uint",inputs:[{name:"x",type:"uint"},{name:"k",type:"int"}]}),JD=Ee(([i,e,t])=>{i.subAssign(t),i.bitXorAssign(Ao(t,me(4))),t.addAssign(e),e.subAssign(i),e.bitXorAssign(Ao(i,me(6))),i.addAssign(t),t.subAssign(e),t.bitXorAssign(Ao(e,me(8))),e.addAssign(i),i.subAssign(t),i.bitXorAssign(Ao(t,me(16))),t.addAssign(e),e.subAssign(i),e.bitXorAssign(Ao(i,me(19))),i.addAssign(t),t.subAssign(e),t.bitXorAssign(Ao(e,me(4))),e.addAssign(i)}),Y0=Ee(([i,e,t])=>{const n=Nt(t).toVar(),r=Nt(e).toVar(),s=Nt(i).toVar();return n.bitXorAssign(r),n.subAssign(Ao(r,me(14))),s.bitXorAssign(n),s.subAssign(Ao(n,me(11))),r.bitXorAssign(s),r.subAssign(Ao(s,me(25))),n.bitXorAssign(r),n.subAssign(Ao(r,me(16))),s.bitXorAssign(n),s.subAssign(Ao(n,me(4))),r.bitXorAssign(s),r.subAssign(Ao(s,me(14))),n.bitXorAssign(r),n.subAssign(Ao(r,me(24))),n}).setLayout({name:"mx_bjfinal",type:"uint",inputs:[{name:"a",type:"uint"},{name:"b",type:"uint"},{name:"c",type:"uint"}]}),ls=Ee(([i])=>{const e=Nt(i).toVar();return se(e).div(se(Nt(me(4294967295))))}).setLayout({name:"mx_bits_to_01",type:"float",inputs:[{name:"bits",type:"uint"}]}),$a=Ee(([i])=>{const e=se(i).toVar();return e.mul(e).mul(e).mul(e.mul(e.mul(6).sub(15)).add(10))}).setLayout({name:"mx_fade",type:"float",inputs:[{name:"t",type:"float"}]}),Gte=Ee(([i])=>{const e=me(i).toVar(),t=Nt(Nt(1)).toVar(),n=Nt(Nt(me(3735928559)).add(t.shiftLeft(Nt(2))).add(Nt(13))).toVar();return Y0(n.add(Nt(e)),n,n)}).setLayout({name:"mx_hash_int_0",type:"uint",inputs:[{name:"x",type:"int"}]}),qte=Ee(([i,e])=>{const t=me(e).toVar(),n=me(i).toVar(),r=Nt(Nt(2)).toVar(),s=Nt().toVar(),o=Nt().toVar(),a=Nt().toVar();return s.assign(o.assign(a.assign(Nt(me(3735928559)).add(r.shiftLeft(Nt(2))).add(Nt(13))))),s.addAssign(Nt(n)),o.addAssign(Nt(t)),Y0(s,o,a)}).setLayout({name:"mx_hash_int_1",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),Hte=Ee(([i,e,t])=>{const n=me(t).toVar(),r=me(e).toVar(),s=me(i).toVar(),o=Nt(Nt(3)).toVar(),a=Nt().toVar(),l=Nt().toVar(),c=Nt().toVar();return a.assign(l.assign(c.assign(Nt(me(3735928559)).add(o.shiftLeft(Nt(2))).add(Nt(13))))),a.addAssign(Nt(s)),l.addAssign(Nt(r)),c.addAssign(Nt(n)),Y0(a,l,c)}).setLayout({name:"mx_hash_int_2",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),Wte=Ee(([i,e,t,n])=>{const r=me(n).toVar(),s=me(t).toVar(),o=me(e).toVar(),a=me(i).toVar(),l=Nt(Nt(4)).toVar(),c=Nt().toVar(),u=Nt().toVar(),p=Nt().toVar();return c.assign(u.assign(p.assign(Nt(me(3735928559)).add(l.shiftLeft(Nt(2))).add(Nt(13))))),c.addAssign(Nt(a)),u.addAssign(Nt(o)),p.addAssign(Nt(s)),JD(c,u,p),c.addAssign(Nt(r)),Y0(c,u,p)}).setLayout({name:"mx_hash_int_3",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"}]}),$te=Ee(([i,e,t,n,r])=>{const s=me(r).toVar(),o=me(n).toVar(),a=me(t).toVar(),l=me(e).toVar(),c=me(i).toVar(),u=Nt(Nt(5)).toVar(),p=Nt().toVar(),m=Nt().toVar(),g=Nt().toVar();return p.assign(m.assign(g.assign(Nt(me(3735928559)).add(u.shiftLeft(Nt(2))).add(Nt(13))))),p.addAssign(Nt(c)),m.addAssign(Nt(l)),g.addAssign(Nt(a)),JD(p,m,g),p.addAssign(Nt(o)),m.addAssign(Nt(s)),Y0(p,m,g)}).setLayout({name:"mx_hash_int_4",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"},{name:"yy",type:"int"}]}),ni=Qr([Gte,qte,Hte,Wte,$te]),jte=Ee(([i,e])=>{const t=me(e).toVar(),n=me(i).toVar(),r=Nt(ni(n,t)).toVar(),s=Xf().toVar();return s.x.assign(r.bitAnd(me(255))),s.y.assign(r.shiftRight(me(8)).bitAnd(me(255))),s.z.assign(r.shiftRight(me(16)).bitAnd(me(255))),s}).setLayout({name:"mx_hash_vec3_0",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),Xte=Ee(([i,e,t])=>{const n=me(t).toVar(),r=me(e).toVar(),s=me(i).toVar(),o=Nt(ni(s,r,n)).toVar(),a=Xf().toVar();return a.x.assign(o.bitAnd(me(255))),a.y.assign(o.shiftRight(me(8)).bitAnd(me(255))),a.z.assign(o.shiftRight(me(16)).bitAnd(me(255))),a}).setLayout({name:"mx_hash_vec3_1",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),Do=Qr([jte,Xte]),Yte=Ee(([i])=>{const e=dt(i).toVar(),t=me().toVar(),n=me().toVar(),r=se(Ri(e.x,t)).toVar(),s=se(Ri(e.y,n)).toVar(),o=se($a(r)).toVar(),a=se($a(s)).toVar(),l=se(YD(Nr(ni(t,n),r,s),Nr(ni(t.add(me(1)),n),r.sub(1),s),Nr(ni(t,n.add(me(1))),r,s.sub(1)),Nr(ni(t.add(me(1)),n.add(me(1))),r.sub(1),s.sub(1)),o,a)).toVar();return ZD(l)}).setLayout({name:"mx_perlin_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"}]}),Qte=Ee(([i])=>{const e=Se(i).toVar(),t=me().toVar(),n=me().toVar(),r=me().toVar(),s=se(Ri(e.x,t)).toVar(),o=se(Ri(e.y,n)).toVar(),a=se(Ri(e.z,r)).toVar(),l=se($a(s)).toVar(),c=se($a(o)).toVar(),u=se($a(a)).toVar(),p=se(QD(Nr(ni(t,n,r),s,o,a),Nr(ni(t.add(me(1)),n,r),s.sub(1),o,a),Nr(ni(t,n.add(me(1)),r),s,o.sub(1),a),Nr(ni(t.add(me(1)),n.add(me(1)),r),s.sub(1),o.sub(1),a),Nr(ni(t,n,r.add(me(1))),s,o,a.sub(1)),Nr(ni(t.add(me(1)),n,r.add(me(1))),s.sub(1),o,a.sub(1)),Nr(ni(t,n.add(me(1)),r.add(me(1))),s,o.sub(1),a.sub(1)),Nr(ni(t.add(me(1)),n.add(me(1)),r.add(me(1))),s.sub(1),o.sub(1),a.sub(1)),l,c,u)).toVar();return KD(p)}).setLayout({name:"mx_perlin_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"}]}),yw=Qr([Yte,Qte]),Zte=Ee(([i])=>{const e=dt(i).toVar(),t=me().toVar(),n=me().toVar(),r=se(Ri(e.x,t)).toVar(),s=se(Ri(e.y,n)).toVar(),o=se($a(r)).toVar(),a=se($a(s)).toVar(),l=Se(YD(No(Do(t,n),r,s),No(Do(t.add(me(1)),n),r.sub(1),s),No(Do(t,n.add(me(1))),r,s.sub(1)),No(Do(t.add(me(1)),n.add(me(1))),r.sub(1),s.sub(1)),o,a)).toVar();return ZD(l)}).setLayout({name:"mx_perlin_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),Kte=Ee(([i])=>{const e=Se(i).toVar(),t=me().toVar(),n=me().toVar(),r=me().toVar(),s=se(Ri(e.x,t)).toVar(),o=se(Ri(e.y,n)).toVar(),a=se(Ri(e.z,r)).toVar(),l=se($a(s)).toVar(),c=se($a(o)).toVar(),u=se($a(a)).toVar(),p=Se(QD(No(Do(t,n,r),s,o,a),No(Do(t.add(me(1)),n,r),s.sub(1),o,a),No(Do(t,n.add(me(1)),r),s,o.sub(1),a),No(Do(t.add(me(1)),n.add(me(1)),r),s.sub(1),o.sub(1),a),No(Do(t,n,r.add(me(1))),s,o,a.sub(1)),No(Do(t.add(me(1)),n,r.add(me(1))),s.sub(1),o,a.sub(1)),No(Do(t,n.add(me(1)),r.add(me(1))),s,o.sub(1),a.sub(1)),No(Do(t.add(me(1)),n.add(me(1)),r.add(me(1))),s.sub(1),o.sub(1),a.sub(1)),l,c,u)).toVar();return KD(p)}).setLayout({name:"mx_perlin_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),xw=Qr([Zte,Kte]),Jte=Ee(([i])=>{const e=se(i).toVar(),t=me(nr(e)).toVar();return ls(ni(t))}).setLayout({name:"mx_cell_noise_float_0",type:"float",inputs:[{name:"p",type:"float"}]}),ene=Ee(([i])=>{const e=dt(i).toVar(),t=me(nr(e.x)).toVar(),n=me(nr(e.y)).toVar();return ls(ni(t,n))}).setLayout({name:"mx_cell_noise_float_1",type:"float",inputs:[{name:"p",type:"vec2"}]}),tne=Ee(([i])=>{const e=Se(i).toVar(),t=me(nr(e.x)).toVar(),n=me(nr(e.y)).toVar(),r=me(nr(e.z)).toVar();return ls(ni(t,n,r))}).setLayout({name:"mx_cell_noise_float_2",type:"float",inputs:[{name:"p",type:"vec3"}]}),nne=Ee(([i])=>{const e=jt(i).toVar(),t=me(nr(e.x)).toVar(),n=me(nr(e.y)).toVar(),r=me(nr(e.z)).toVar(),s=me(nr(e.w)).toVar();return ls(ni(t,n,r,s))}).setLayout({name:"mx_cell_noise_float_3",type:"float",inputs:[{name:"p",type:"vec4"}]}),ine=Qr([Jte,ene,tne,nne]),rne=Ee(([i])=>{const e=se(i).toVar(),t=me(nr(e)).toVar();return Se(ls(ni(t,me(0))),ls(ni(t,me(1))),ls(ni(t,me(2))))}).setLayout({name:"mx_cell_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"float"}]}),sne=Ee(([i])=>{const e=dt(i).toVar(),t=me(nr(e.x)).toVar(),n=me(nr(e.y)).toVar();return Se(ls(ni(t,n,me(0))),ls(ni(t,n,me(1))),ls(ni(t,n,me(2))))}).setLayout({name:"mx_cell_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),one=Ee(([i])=>{const e=Se(i).toVar(),t=me(nr(e.x)).toVar(),n=me(nr(e.y)).toVar(),r=me(nr(e.z)).toVar();return Se(ls(ni(t,n,r,me(0))),ls(ni(t,n,r,me(1))),ls(ni(t,n,r,me(2))))}).setLayout({name:"mx_cell_noise_vec3_2",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),ane=Ee(([i])=>{const e=jt(i).toVar(),t=me(nr(e.x)).toVar(),n=me(nr(e.y)).toVar(),r=me(nr(e.z)).toVar(),s=me(nr(e.w)).toVar();return Se(ls(ni(t,n,r,s,me(0))),ls(ni(t,n,r,s,me(1))),ls(ni(t,n,r,s,me(2))))}).setLayout({name:"mx_cell_noise_vec3_3",type:"vec3",inputs:[{name:"p",type:"vec4"}]}),eI=Qr([rne,sne,one,ane]),f1=Ee(([i,e,t,n])=>{const r=se(n).toVar(),s=se(t).toVar(),o=me(e).toVar(),a=Se(i).toVar(),l=se(0).toVar(),c=se(1).toVar();return Zn(o,()=>{l.addAssign(c.mul(yw(a))),c.mulAssign(r),a.mulAssign(s)}),l}).setLayout({name:"mx_fractal_noise_float",type:"float",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),tI=Ee(([i,e,t,n])=>{const r=se(n).toVar(),s=se(t).toVar(),o=me(e).toVar(),a=Se(i).toVar(),l=Se(0).toVar(),c=se(1).toVar();return Zn(o,()=>{l.addAssign(c.mul(xw(a))),c.mulAssign(r),a.mulAssign(s)}),l}).setLayout({name:"mx_fractal_noise_vec3",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),lne=Ee(([i,e,t,n])=>{const r=se(n).toVar(),s=se(t).toVar(),o=me(e).toVar(),a=Se(i).toVar();return dt(f1(a,o,s,r),f1(a.add(Se(me(19),me(193),me(17))),o,s,r))}).setLayout({name:"mx_fractal_noise_vec2",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),cne=Ee(([i,e,t,n])=>{const r=se(n).toVar(),s=se(t).toVar(),o=me(e).toVar(),a=Se(i).toVar(),l=Se(tI(a,o,s,r)).toVar(),c=se(f1(a.add(Se(me(19),me(193),me(17))),o,s,r)).toVar();return jt(l,c)}).setLayout({name:"mx_fractal_noise_vec4",type:"vec4",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),une=Ee(([i,e,t,n,r,s,o])=>{const a=me(o).toVar(),l=se(s).toVar(),c=me(r).toVar(),u=me(n).toVar(),p=me(t).toVar(),m=me(e).toVar(),g=dt(i).toVar(),v=Se(eI(dt(m.add(u),p.add(c)))).toVar(),b=dt(v.x,v.y).toVar();b.subAssign(.5),b.mulAssign(l),b.addAssign(.5);const M=dt(dt(se(m),se(p)).add(b)).toVar(),x=dt(M.sub(g)).toVar();return xn(a.equal(me(2)),()=>gi(x.x).add(gi(x.y))),xn(a.equal(me(3)),()=>Qi(gi(x.x),gi(x.y))),Qc(x,x)}).setLayout({name:"mx_worley_distance_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),hne=Ee(([i,e,t,n,r,s,o,a,l])=>{const c=me(l).toVar(),u=se(a).toVar(),p=me(o).toVar(),m=me(s).toVar(),g=me(r).toVar(),v=me(n).toVar(),b=me(t).toVar(),M=me(e).toVar(),x=Se(i).toVar(),w=Se(eI(Se(M.add(g),b.add(m),v.add(p)))).toVar();w.subAssign(.5),w.mulAssign(u),w.addAssign(.5);const R=Se(Se(se(M),se(b),se(v)).add(w)).toVar(),C=Se(R.sub(x)).toVar();return xn(c.equal(me(2)),()=>gi(C.x).add(gi(C.y)).add(gi(C.z))),xn(c.equal(me(3)),()=>Qi(Qi(gi(C.x),gi(C.y)),gi(C.z))),Qc(C,C)}).setLayout({name:"mx_worley_distance_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"zoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),Zf=Qr([une,hne]),dne=Ee(([i,e,t])=>{const n=me(t).toVar(),r=se(e).toVar(),s=dt(i).toVar(),o=me().toVar(),a=me().toVar(),l=dt(Ri(s.x,o),Ri(s.y,a)).toVar(),c=se(1e6).toVar();return Zn({start:-1,end:me(1),name:"x",condition:"<="},({x:u})=>{Zn({start:-1,end:me(1),name:"y",condition:"<="},({y:p})=>{const m=se(Zf(l,u,p,o,a,r,n)).toVar();c.assign(Qs(c,m))})}),xn(n.equal(me(0)),()=>{c.assign(ol(c))}),c}).setLayout({name:"mx_worley_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),fne=Ee(([i,e,t])=>{const n=me(t).toVar(),r=se(e).toVar(),s=dt(i).toVar(),o=me().toVar(),a=me().toVar(),l=dt(Ri(s.x,o),Ri(s.y,a)).toVar(),c=dt(1e6,1e6).toVar();return Zn({start:-1,end:me(1),name:"x",condition:"<="},({x:u})=>{Zn({start:-1,end:me(1),name:"y",condition:"<="},({y:p})=>{const m=se(Zf(l,u,p,o,a,r,n)).toVar();xn(m.lessThan(c.x),()=>{c.y.assign(c.x),c.x.assign(m)}).ElseIf(m.lessThan(c.y),()=>{c.y.assign(m)})})}),xn(n.equal(me(0)),()=>{c.assign(ol(c))}),c}).setLayout({name:"mx_worley_noise_vec2_0",type:"vec2",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),pne=Ee(([i,e,t])=>{const n=me(t).toVar(),r=se(e).toVar(),s=dt(i).toVar(),o=me().toVar(),a=me().toVar(),l=dt(Ri(s.x,o),Ri(s.y,a)).toVar(),c=Se(1e6,1e6,1e6).toVar();return Zn({start:-1,end:me(1),name:"x",condition:"<="},({x:u})=>{Zn({start:-1,end:me(1),name:"y",condition:"<="},({y:p})=>{const m=se(Zf(l,u,p,o,a,r,n)).toVar();xn(m.lessThan(c.x),()=>{c.z.assign(c.y),c.y.assign(c.x),c.x.assign(m)}).ElseIf(m.lessThan(c.y),()=>{c.z.assign(c.y),c.y.assign(m)}).ElseIf(m.lessThan(c.z),()=>{c.z.assign(m)})})}),xn(n.equal(me(0)),()=>{c.assign(ol(c))}),c}
vendor: 4,255 bytes, line 3870
3870).setLayout({name:"mx_worley_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),Ane=Ee(([i,e,t])=>{const n=me(t).toVar(),r=se(e).toVar(),s=Se(i).toVar(),o=me().toVar(),a=me().toVar(),l=me().toVar(),c=Se(Ri(s.x,o),Ri(s.y,a),Ri(s.z,l)).toVar(),u=se(1e6).toVar();return Zn({start:-1,end:me(1),name:"x",condition:"<="},({x:p})=>{Zn({start:-1,end:me(1),name:"y",condition:"<="},({y:m})=>{Zn({start:-1,end:me(1),name:"z",condition:"<="},({z:g})=>{const v=se(Zf(c,p,m,g,o,a,l,r,n)).toVar();u.assign(Qs(u,v))})})}),xn(n.equal(me(0)),()=>{u.assign(ol(u))}),u}).setLayout({name:"mx_worley_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),mne=Qr([dne,Ane]),gne=Ee(([i,e,t])=>{const n=me(t).toVar(),r=se(e).toVar(),s=Se(i).toVar(),o=me().toVar(),a=me().toVar(),l=me().toVar(),c=Se(Ri(s.x,o),Ri(s.y,a),Ri(s.z,l)).toVar(),u=dt(1e6,1e6).toVar();return Zn({start:-1,end:me(1),name:"x",condition:"<="},({x:p})=>{Zn({start:-1,end:me(1),name:"y",condition:"<="},({y:m})=>{Zn({start:-1,end:me(1),name:"z",condition:"<="},({z:g})=>{const v=se(Zf(c,p,m,g,o,a,l,r,n)).toVar();xn(v.lessThan(u.x),()=>{u.y.assign(u.x),u.x.assign(v)}).ElseIf(v.lessThan(u.y),()=>{u.y.assign(v)})})})}),xn(n.equal(me(0)),()=>{u.assign(ol(u))}),u}).setLayout({name:"mx_worley_noise_vec2_1",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),_ne=Qr([fne,gne]),vne=Ee(([i,e,t])=>{const n=me(t).toVar(),r=se(e).toVar(),s=Se(i).toVar(),o=me().toVar(),a=me().toVar(),l=me().toVar(),c=Se(Ri(s.x,o),Ri(s.y,a),Ri(s.z,l)).toVar(),u=Se(1e6,1e6,1e6).toVar();return Zn({start:-1,end:me(1),name:"x",condition:"<="},({x:p})=>{Zn({start:-1,end:me(1),name:"y",condition:"<="},({y:m})=>{Zn({start:-1,end:me(1),name:"z",condition:"<="},({z:g})=>{const v=se(Zf(c,p,m,g,o,a,l,r,n)).toVar();xn(v.lessThan(u.x),()=>{u.z.assign(u.y),u.y.assign(u.x),u.x.assign(v)}).ElseIf(v.lessThan(u.y),()=>{u.z.assign(u.y),u.y.assign(v)}).ElseIf(v.lessThan(u.z),()=>{u.z.assign(v)})})})}),xn(n.equal(me(0)),()=>{u.assign(ol(u))}),u}).setLayout({name:"mx_worley_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),yne=Qr([pne,vne]),xne=Ee(([i])=>{const e=i.y,t=i.z,n=Se().toVar();return xn(e.lessThan(1e-4),()=>{n.assign(Se(t,t,t))}).Else(()=>{let r=i.x;r=r.sub(Wa(r)).mul(6).toVar();const s=me(DM(r)),o=r.sub(se(s)),a=t.mul(e.oneMinus()),l=t.mul(e.mul(o).oneMinus()),c=t.mul(e.mul(o.oneMinus()).oneMinus());xn(s.equal(me(0)),()=>{n.assign(Se(t,c,a))}).ElseIf(s.equal(me(1)),()=>{n.assign(Se(l,t,a))}).ElseIf(s.equal(me(2)),()=>{n.assign(Se(a,t,c))}).ElseIf(s.equal(me(3)),()=>{n.assign(Se(a,l,t))}).ElseIf(s.equal(me(4)),()=>{n.assign(Se(c,a,t))}).Else(()=>{n.assign(Se(t,a,l))})}),n}).setLayout({name:"mx_hsvtorgb",type:"vec3",inputs:[{name:"hsv",type:"vec3"}]}),bne=Ee(([i])=>{const e=Se(i).toVar(),t=se(e.x).toVar(),n=se(e.y).toVar(),r=se(e.z).toVar(),s=se(Qs(t,Qs(n,r))).toVar(),o=se(Qi(t,Qi(n,r))).toVar(),a=se(o.sub(s)).toVar(),l=se().toVar(),c=se().toVar(),u=se().toVar();return u.assign(o),xn(o.greaterThan(0),()=>{c.assign(a.div(o))}).Else(()=>{c.assign(0)}),xn(c.lessThanEqual(0),()=>{l.assign(0)}).Else(()=>{xn(t.greaterThanEqual(o),()=>{l.assign(n.sub(r).div(a))}).ElseIf(n.greaterThanEqual(o),()=>{l.assign(rr(2,r.sub(t).div(a)))}).Else(()=>{l.assign(rr(4,t.sub(n).div(a)))}),l.mulAssign(1/6),xn(l.lessThan(0),()=>{l.addAssign(1)})}),Se(l,c,u)}).setLayout({name:"mx_rgbtohsv",type:"vec3",inputs:[{name:"c",type:"vec3"}]}),Sne=Ee(([i])=>{const e=Se(i).toVar(),t=_M(EM(e,Se(.04045))).toVar(),n=Se(e.div(12.92)).toVar(),r=Se(ua(Qi(e.add(Se(.055)),Se(0)).div(1.055),Se(2.4))).toVar();return Qn(n,r,t)}).setLayout({name:"mx_srgb_texture_to_lin_rec709",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),nI=(i,e)=>{i=se(i),e=se(e);const t=dt(e.dFdx(),e.dFdy()).length().mul(.7071067811865476);return Za(i.sub(t),i.add(t),e)},iI=(i,e,t,n)=>Qn(i,e,t[n].clamp()),Mne=(i,e,t=Ci())=>iI(i,e,t,"x"),wne=(i,e,t=Ci())=>iI(i,e,t,"y"),rI=(i,e,t,n,r)=>Qn(i,e,nI(t,n[r])),Tne=(i,e,t,n=Ci())=>rI(i,e,t,n,"x"),Ene=(i,e,t,n=Ci())=>rI(i,e,t,n,"y"),Rne=(i=1,e=0,t=Ci())=>t.mul(i).add(e),Cne=(i,e=1)=>
3870(i=se(i),i.abs().pow(e).mul(i.sign())),Pne=(i,e=1,t=.5)=>se(i).sub(t).mul(e).add(t),Lne=(i=Ci(),e=1,t=0)=>yw(i.convert("vec2|vec3")).mul(e).add(t),Nne=(i=Ci(),e=1,t=0)=>xw(i.convert("vec2|vec3")).mul(e).add(t),Dne=(i=Ci(),e=1,t=0)=>(i=i.convert("vec2|vec3"),jt(xw(i),yw(i.add(dt(19,73)))).mul(e).add(t)),Ine=(i=Ci(),e=1)=>mne(i.convert("vec2|vec3"),e,me(1)),Bne=(i=Ci(),e=1)=>_ne(i.convert("vec2|vec3"),e,me(1)),Fne=(i=Ci(),e=1)=>yne(i.convert("vec2|vec3"),e,me(1)),Une=(i=Ci())=>ine(i.convert("vec2|vec3")),One=(i=Ci(),e=3,t=2,n=.5,r=1)=>f1(i,me(e),t,n).mul(r),kne=(i=Ci(),e=3,t=2,n=.5,r=1)=>lne(i,me(e),t,n).mul(r),zne=(i=Ci(),e=3,t=2,n=.5,r=1)=>tI(i,me(e),t,n).mul(r),Vne=(i=Ci(),e=3,t=2,n=.5,r=1)=>cne(i,me(e),t,n).mul(r),Gne=Ee(([i,e,t])=>{const n=Vl(i).toVar(),r=On(se(.5).mul(e.sub(t)),Fl).div(n).toVar(),s=On(se(-.5).mul(e.sub(t)),Fl).div(n).toVar(),o=Se().toVar();o.x=n.x.greaterThan(se(0)).select(r.x,s.x),o.y=n.y.greaterThan(se(0)).select(r.y,s.y),o.z=n.z.greaterThan(se(0)).select(r.z,s.z);const a=Qs(Qs(o.x,o.y),o.z).toVar();return Fl.add(n.mul(a)).toVar().sub(t)}),sI=Ee(([i,e])=>{const t=i.x,n=i.y,r=i.z;let s=e.element(0).mul(.886227);return s=s.add(e.element(1).mul(2*.511664).mul(n)),s=s.add(e.element(2).mul(2*.511664).mul(r)),s=s.add(e.element(3).mul(2*.511664).mul(t)),s=s.add(e.element(4).mul(2*.429043).mul(t).mul(n)),s=s.add(e.element(5).mul(2*.429043).mul(n).mul(r)),s=s.add(e.element(6).mul(r.mul(r).mul(.743125).sub(.247708))),s=s.add(e.element(7).mul(2*.429043).mul(t).mul(r)),s=s.add(e.element(8).mul(.429043).mul(_n(t,t).sub(_n(n,n)))),s});var z=Object.freeze({__proto__:null,BRDF_GGX:Nb,BRDF_Lambert:ch,BasicPointShadowFilter:WD,BasicShadowFilter:UD,Break:C6,Const:i8,Continue:qQ,DFGApprox:nw,D_GGX:W6,Discard:x8,EPSILON:TN,F_Schlick:Lf,Fn:Ee,INFINITY:RY,If:xn,Loop:Zn,NodeAccess:as,NodeShaderStage:vb,NodeType:JX,NodeUpdateType:gn,PCFShadowFilter:OD,PCFSoftShadowFilter:kD,PI:a1,PI2:CY,PointShadowFilter:$D,Return:HY,Schlick_to_F0:j6,ScriptableNodeResources:S_,ShaderNode:Fd,Stack:H1,Switch:_Y,TBNViewMatrix:Vu,VSMShadowFilter:zD,V_GGX_SmithCorrelated:H6,Var:n8,abs:gi,acesFilmicToneMapping:RD,acos:DN,add:rr,addMethodChaining:Ze,addNodeElement:jY,agxToneMapping:CD,all:EN,alphaT:r1,and:uN,anisotropy:bc,anisotropyB:Xu,anisotropyT:bA,any:RN,append:bY,array:iN,arrayBuffer:yY,asin:NN,assign:rN,atan:PM,atan2:KN,atomicAdd:ete,atomicAnd:rte,atomicFunc:al,atomicLoad:Kee,atomicMax:nte,atomicMin:ite,atomicOr:ste,atomicStore:Jee,atomicSub:tte,atomicXor:ote,attenuationColor:SM,attenuationDistance:bM,attribute:ql,attributeArray:$J,backgroundBlurriness:AD,backgroundIntensity:Ob,backgroundRotation:mD,batch:T6,billboarding:CJ,bitAnd:pN,bitNot:AN,bitOr:mN,bitXor:gN,bitangentGeometry:yQ,bitangentLocal:xQ,bitangentView:z8,bitangentWorld:bQ,bitcast:PY,blendBurn:yD,blendColor:ree,blendDodge:xD,blendOverlay:SD,blendScreen:bD,blur:eD,bool:zl,buffer:z0,bufferAttribute:k0,bumpMap:H8,burn:see,bvec2:j5,bvec3:_M,bvec4:Z5,bypass:g8,cache:MA,call:sN,cameraFar:wc,cameraIndex:tv,cameraNear:Mc,cameraNormalMatrix:iQ,cameraPosition:E8,cameraProjectionMatrix:Ah,cameraProjectionMatrixInverse:tQ,cameraViewMatrix:eo,cameraWorldMatrix:nQ,cbrt:jN,cdl:fee,ceil:Q1,checker:Rte,cineonToneMapping:ED,clamp:Qa,clearcoat:i1,clearcoatRoughness:h0,code:hv,color:W5,colorSpaceToWorking:ev,colorToDirection:gZ,compute:m8,computeSkinning:VQ,cond:JN,context:J1,convert:J5,convertColorSpace:BY,convertToTexture:GJ,cos:Ml,cross:K1,cubeTexture:Pf,cubeToUV:ra,dFdx:LM,dFdy:NM,dashSize:A_,debug:S8,decrement:SN,decrementBefore:xN,defaultBuildStages:yb,defaultShaderStages:k5,defined:a0,degrees:PN,deltaTime:dD,densityFog:Bee,de
3870nsityFogFactor:hw,depth:KM,depthPass:_ee,difference:qN,diffuseColor:$n,directPointLight:XD,directionToColor:U6,dispersion:MM,distance:GN,div:_a,dodge:oee,dot:Qc,drawIndex:S6,dynamicBufferAttribute:A8,element:K5,emissive:Mb,equal:TM,equals:zN,equirectUV:JM,exp:RM,exp2:Cf,expression:Gl,faceDirection:q0,faceForward:UM,faceforward:LY,float:se,floor:Wa,fog:A0,fract:$l,frameGroup:nN,frameId:vJ,frontFacing:L8,fwidth:ON,gain:dJ,gapSize:wb,getConstNodeType:H5,getCurrentStack:gM,getDirection:K6,getDistanceAttenuation:vw,getGeometryRoughness:q6,getNormalFromDepth:HJ,getParallaxCorrectNormal:Gne,getRoughness:tw,getScreenPosition:qJ,getShIrradianceAt:sI,getShadowMaterial:VD,getShadowRenderObjectFunction:GD,getTextureIndex:uD,getViewPosition:Ed,globalId:Vee,glsl:Eee,glslFn:Ree,grayscale:cee,greaterThan:EM,greaterThanEqual:cN,hash:hJ,highpModelNormalViewMatrix:Rb,highpModelViewMatrix:Eb,hue:dee,increment:bN,incrementBefore:yN,instance:IQ,instanceIndex:Fc,instancedArray:jJ,instancedBufferAttribute:l1,instancedDynamicBufferAttribute:Tb,instancedMesh:w6,int:me,inverseSqrt:CM,inversesqrt:NY,invocationLocalIndex:DQ,invocationSubgroupIndex:NQ,ior:SA,iridescence:j1,iridescenceIOR:vM,iridescenceThickness:yM,ivec2:vr,ivec3:X5,ivec4:Y5,js:wee,label:t8,length:Bl,lengthSq:BM,lessThan:aN,lessThanEqual:lN,lightPosition:pw,lightProjectionUV:BD,lightShadowMatrix:fw,lightTargetDirection:mw,lightTargetPosition:FD,lightViewPosition:Aw,lightingContext:L6,lights:cte,linearDepth:u1,linearToneMapping:wD,localId:Gee,log:Y1,log2:Ha,logarithmicDepthToViewZ:iZ,loop:HQ,luminance:cw,mat2:W1,mat3:hs,mat4:ju,matcapUV:iD,materialAO:x6,materialAlphaTest:W8,materialAnisotropy:o6,materialAnisotropyVector:Td,materialAttenuationColor:p6,materialAttenuationDistance:f6,materialClearcoat:e6,materialClearcoatNormal:n6,materialClearcoatRoughness:t6,materialColor:$8,materialDispersion:y6,materialEmissive:X8,materialEnvIntensity:__,materialEnvRotation:qM,materialIOR:d6,materialIridescence:a6,materialIridescenceIOR:l6,materialIridescenceThickness:c6,materialLightMap:$M,materialLineDashOffset:_6,materialLineDashSize:m6,materialLineGapSize:g6,materialLineScale:A6,materialLineWidth:PQ,materialMetalness:K8,materialNormal:J8,materialOpacity:WM,materialPointSize:v6,materialReference:Rl,materialReflectivity:v_,materialRefractionRatio:I8,materialRotation:i6,materialRoughness:Z8,materialSheen:r6,materialSheenRoughness:s6,materialShininess:j8,materialSpecular:Y8,materialSpecularColor:Q8,materialSpecularIntensity:Lb,materialSpecularStrength:wA,materialThickness:h6,materialTransmission:u6,max:Qi,maxMipLevel:w8,mediumpModelViewMatrix:P8,metalness:u0,min:Qs,mix:Qn,mixElement:QN,mod:F0,modInt:wN,modelDirection:cQ,modelNormalMatrix:C8,modelPosition:uQ,modelRadius:fQ,modelScale:hQ,modelViewMatrix:mh,modelViewPosition:dQ,modelViewProjection:jM,modelWorldMatrix:Uo,modelWorldMatrixInverse:pQ,morphReference:P6,mrt:hD,mul:_n,mx_aastep:nI,mx_cell_noise_float:Une,mx_contrast:Pne,mx_fractal_noise_float:One,mx_fractal_noise_vec2:kne,mx_fractal_noise_vec3:zne,mx_fractal_noise_vec4:Vne,mx_hsvtorgb:xne,mx_noise_float:Lne,mx_noise_vec3:Nne,mx_noise_vec4:Dne,mx_ramplr:Mne,mx_ramptb:wne,mx_rgbtohsv:bne,mx_safepower:Cne,mx_splitlr:Tne,mx_splittb:Ene,mx_srgb_texture_to_lin_rec709:Sne,mx_transform_uv:Rne,mx_worley_noise_float:Ine,mx_worley_noise_vec2:Bne,mx_worley_noise_vec3:Fne,negate:IN,neutralToneMapping:PD,nodeArray:$u,nodeImmutable:St,nodeObject:it,nodeObjects:I0,nodeProxy:rt,normalFlat:N8,normalGeometry:nv,normalLocal:Zs,normalMap:Pb,normalView:Ho,normalWorld:iv,normalize:Vl,not:dN,notEqual:oN,numWorkgroups:kee,objectDirection:rQ,objectGroup:wM,objectPosition:R8,objectRadius:lQ,objectScale:oQ,objectViewPosition:aQ,objectWorldMatrix:sQ,oneMinus:BN,or:hN,orthographicDepthToViewZ:nZ,oscSawtooth:TJ,oscSine:SJ,oscSquare:MJ,oscTriangle:wJ,output:Xd,outputStruct:cJ,overlay:lee,overloadingFn:Qr,parabola:Ub,parallaxDirection:G8,parallaxUV:MQ,parameter:iJ,pass:mee,passTexture:gee,pcurve:fJ,perspectiveDepthToViewZ:QM,pmremTexture:sw,pointShadow:jD,pointUV:YJ,pointWidth:MY,positionGeometry:G0,positionLocal:Xi,positionPrevious:c1,positionView:tr,positionViewDirection:wi,positionWorld:Fl,positionWorldDirection:VM,posterize:Aee,pow:ua,pow2:IM,pow3:HN,pow4:WN,property:Yf,radians:CN,rand:YN,range:Uee,rangeFog:Iee,rangeFogFactor:uw,reciprocal:UN,reference:ui,referenceBuffer:Cb,reflect:VN,reflectVector:U8,reflectView:B8,reflector:UJ,refract:FM,refractVector:O8,refractView:F8,reinhardToneMapping:TD,remainder:MN,remap:v8,remapClamp:y8,renderGroup:Zt,renderOutput:b8,rendererReference:d8,rotate:uv,rotateUV:EJ,roughness:Ua,round:FN,rtt:pD,sRGBTransferEOTF:o8,sRGBTransferOETF:a8,sampler:QY,samplerComparison:ZY,saturate:XN,saturation:uee,screen:aee,screenCoordinate:j0,screenSize:p0,screenUV:fa,scriptable:Dee,scriptableValue:b_,select:Ur,setCurrentStack:l0,shaderStages:xb,shadow:HD,shadowPositionWorld:_w,shapeCircle:Cte,sharedUniformGroup:X1,sheen:zu,sheenRoughness:$1,shiftLeft:_N,shiftRight:vN,shininess:s1,sign:f0,sin:go,sinc:pJ,skinning:R6,smoothstep:Za,smoothstepElement:ZN,specularColor:Is,specularF90:d0,spherizeUV:RJ,split:xY,spritesheetUV:NJ,sqrt:ol,stack:y_,step:Z1,storage:Yu,storageBarrier:$ee,storageObject:zQ,storageTexture:gD,string:vY,struct:lJ,sub:On,subgroupIndex:LQ,subgroupSize:qee,tan:LN,tangentGeometry:ov,tangentLocal:H0,tangentView:W0,tangentWorld:k8,temp:r8,texture:Ln,texture3D:_D,textureBarrier:jee,textureBicubic:Q6,textureCubeUV:J6,textureLoad:$i,textureSize:Bc,textureStore:ZJ,thickness:xM,time:gh,timerDelta:bJ,timerGlobal:xJ,timerLocal:yJ,toOutputColorSpace:l8,toWorkingColorSpace:c8,toneMapping:f8,toneMappingExposure:p8,toonOutlinePass:yee,transformDirection:$N,transformNormal:D8,transformNormalToView:GM,transformedBentNormalView:q8,transformedBitangentView:V8,transformedBitangentWorld:SQ,transformedClearcoatNormalView:Ud,transformedNormalView:ji,transformedNormalWorld:rv,transformedTangentView:HM,transformedTangentWorld:vQ,transmission:o1,transpose:kN,triNoise3D:mJ,triplanarTexture:IJ,triplanarTextures:fD,trunc:DM,tslFn:SY,uint:Nt,uniform:$t,uniformArray:Fo,uniformGroup:tN,uniforms:JY,userData:tee,uv:Ci,uvec2:$5,uvec3:Xf,uvec4:Q5,varying:Mo,varyingProperty:c0,vec2:dt,vec3:Se,vec4:jt,vectorComponents:fh,velocity:iee,vertexColor:F6,vertexIndex:b6,vertexStage:s8,vibrance:hee,viewZToLogarithmicDepth:ZM,viewZToOrthographicDepth:Qd,viewZToPerspectiveDepth:I6,viewport:Yd,viewportBottomLeft:JQ,viewportCoordinate:D6,viewportDepthTexture:YM,viewportLinearDepth:rZ,viewportMipTexture:XM,viewportResolution:ZQ,viewportSafeUV:PJ,viewportSharedTexture:mZ,viewportSize:N6,viewportTexture:eZ,viewportTopLeft:KQ,viewportUV:QQ,wgsl:Tee,wgslFn:Cee,workgroupArray:Qee,workgroupBarrier:Wee,workgroupId:zee,workingToColorSpace:u8,xor:fN});const Qo=new ow;class qne extends Zc{constructor(e,t){super(),this.renderer=e,this.nodes=t}
3870update(e,t,n){const r=this.renderer,s=this.nodes.getBackgroundNode(e)||e.background;let o=!1;if(s===null)r._clearColor.getRGB(Qo),Qo.a=r._clearColor.a;else if(s.isColor===!0)s.getRGB(Qo),Qo.a=1,o=!0;else if(s.isNode===!0){const l=this.get(e),c=s;Qo.copy(r._clearColor);let u=l.backgroundMesh;if(u===void 0){let b=function(){s.removeEventListener("dispose",b),u.material.dispose(),u.geometry.dispose()};const m=J1(jt(c).mul(Ob),{getUV:()=>mD.mul(iv),getTextureLevel:()=>AD});let g=jM;g=g.setZ(g.w);const v=new sr;v.name="Background.material",v.side=oi,v.depthTest=!1,v.depthWrite=!1,v.allowOverride=!1,v.fog=!1,v.lights=!1,v.vertexNode=g,v.colorNode=m,l.backgroundMeshNode=m,l.backgroundMesh=u=new qn(new sl(1,32,32),v),u.frustumCulled=!1,u.name="Background.mesh",u.onBeforeRender=function(M,x,w){this.matrixWorld.copyPosition(w.matrixWorld)},s.addEventListener("dispose",b)}const p=c.getCacheKey();l.backgroundCacheKey!==p&&(l.backgroundMeshNode.node=jt(c).mul(Ob),l.backgroundMeshNode.needsUpdate=!0,u.material.needsUpdate=!0,l.backgroundCacheKey=p),t.unshift(u,u.geometry,u.material,0,0,null,null)}else console.error("THREE.Renderer: Unsupported background configuration.",s);const a=r.xr.getEnvironmentBlendMode();if(a==="additive"?Qo.set(0,0,0,1):a==="alpha-blend"&&Qo.set(0,0,0,0),r.autoClear===!0||o===!0){const l=n.clearColorValue;l.r=Qo.r,l.g=Qo.g,l.b=Qo.b,l.a=Qo.a,(r.backend.isWebGLBackend===!0||r.alpha===!0)&&(l.r*=l.a,l.g*=l.a,l.b*=l.a),n.depthClearValue=r._clearDepth,n.stencilClearValue=r._clearStencil,n.clearColor=r.autoClearColor===!0,n.clearDepth=r.autoClearDepth===!0,n.clearStencil=r.autoClearStencil===!0}else n.clearColor=!1,n.clearDepth=!1,n.clearStencil=!1}}let Hne=0;class kb{constructor(e="",t=[],n=0,r=[]){this.name=e,this.bindings=t,this.index=n,this.bindingsReference=r,this.id=Hne++}}class Wne{constructor(e,t,n,r,s,o,a,l,c,u=[]){this.vertexShader=e,this.fragmentShader=t,this.computeShader=n,this.transforms=u,this.nodeAttributes=r,this.bindings=s,this.updateNodes=o,this.updateBeforeNodes=a,this.updateAfterNodes=l,this.observer=c,this.usedTimes=0}createBindings(){const e=[];for(const t of this.bindings)if(t.bindings[0].groupNode.shared!==!0){const r=new kb(t.name,[],t.index,t);e.push(r);for(const s of t.bindings)r.bindings.push(s.clone())}else e.push(t);return e}}class nC{constructor(e,t,n=null){this.isNodeAttribute=!0,this.name=e,this.type=t,this.node=n}}class $ne{constructor(e,t,n){this.isNodeUniform=!0,this.name=e,this.type=t,this.node=n.getSelf()}get value(){return this.node.value}set value(e){this.node.value=e}get id(){return this.node.id}get groupNode(){return this.node.groupNode}}class oI{constructor(e,t,n=!1,r=null){this.isNodeVar=!0,this.name=e,this.type=t,this.readOnly=n,this.count=r}}class jne extends oI{constructor(e,t,n=null,r=null){super(e,t),this.needsInterpolation=!1,this.isNodeVarying=!0,this.interpolationType=n,this.interpolationSampling=r}}class Xne{constructor(e,t,n=""){this.name=e,this.type=t,this.code=n,Object.defineProperty(this,"isNodeCode",{value:!0})}}let Yne=0;class _x{constructor(e=null){this.id=Yne++,this.nodesData=new WeakMap,this.parent=e}getData(e){let t=this.nodesData.get(e);return t===void 0&&this.parent!==null&&(t=this.parent.getData(e)),t}setData(e,t){this.nodesData.set(e,t)}}class Qne{constructor(e,t){this.name=e,this.members=t,this.output=!1}}class Kc{constructor(e,t){this.name=e,this.value=t,this.boundary=0,this.itemSize=0,this.offset=0}setValue(e){this.value=e}getValue(){return this.value}}class Zne extends Kc{constructor(e,t=0){super(e,t),this.isNumberUniform=!0,this.boundary=4,this.itemSize=1}}class Kne extends Kc{constructor(e,t=new at){super(e,t),this.isVector2Uniform=!0,this.boundary=8,this.itemSize=2}}class Jne extends Kc{constructor(e,t=new re){super(e,t),this.isVector3Uniform=!0,this.boundary=16,this.itemSize=3}}class eie extends Kc{constructor(e,t=new Jt){super(e,t),this.isVector4Uniform=!0,this.boundary=16,this.itemSize=4}}class tie extends Kc{constructor(e,t=new qt){super(e,t),this.isColorUniform=!0,this.boundary=16,this.itemSize=3}}class nie extends Kc{constructor(e,t=new F1){super(e,t),this.isMatrix2Uniform=!0,this.boundary=16,this.itemSize=4}}class iie extends Kc{constructor(e,t=new Sn){super(e,t),this.isMatrix3Uniform=!0,this.boundary=48,this.itemSize=12}}class rie extends Kc{constructor(e,t=new un){super(e,t),this.isMatrix4Uniform=!0,this.boundary=64,this.itemSize=16}}class sie extends Zne{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class oie extends Kne{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class aie extends Jne{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class lie extends eie{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class cie extends tie{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class uie extends nie{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class hie extends iie{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class die extends rie{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}const iC=new WeakMap,fie=new Map([[Int8Array,"int"],[Int16Array,"int"],[Int32Array,"int"],[Uint8Array,"uint"],[Uint16Array,"uint"],[Uint32Array,"uint"],[Float32Array,"float"]]),og=i=>/e/g.test(i)?String(i).replace(/\+/g,""):(i=Number(i),i+(i%1?"":".0"));class aI{constructor(e,t,n){this.object=e,this.material=e&&e.material||null,this.geometry=e&&e.geometry||null,this.renderer=t,this.parser=n,this.scene=null,this.camera=null,this.nodes=[],this.sequentialNodes=[],this.updateNodes=[],this.updateBeforeNodes=[],this.updateAfterNodes=[],this.hashNodes={},this.observer=null,this.lightsNode=null,this.environmentNode=null,this.fogNode=null,this.clippingContext=null,this.vertexShader=null,this.fragmentShader=null,this.computeShader=null,this.flowNodes={vertex:[],fragment:[],compute:[]},this.flowCode={vertex:"",fragment:"",compute:""},this.uniforms={vertex:[],fragment:[],compute:[],index:0},this.structs={vertex:[],fragment:[],compute:[],index:0},this.bindings={vertex:{},fragment:{},compute:{}},this.bindingsIndexes={},this.bindGroups=null,this.attributes=[],this.bufferAttributes=[],this.varyings=[],this.codes={},this.vars={},this.declarations={},this.flow={code:""},this.chaining=[],this.stack=y_(),this.stacks=[],this.tab="	",this.currentFunctionNode=null,this.context={material:this.material},this.cache=new _x,this.globalCache=this.cache,this.flowsData=new WeakMap,this.shaderStage=null,this.buildStage=null}getBindGroupsCache(){let e=iC.get(this.renderer);return e===void 0&&(e=new va,iC.set(this.renderer,e)),e}createRenderTarget(e,t,n){return new rl(e,t,n)}createRenderTargetArray(e,t,n,r){return new Ck(e,t,n,r)}createCubeRenderTarget(e,t){return new O6(e,t)}includes(e){return this.nodes.includes(e)}getOutputStructName(){}_getBindGroup(e,t){const n=this.getBindGroupsCache(),r=[];let s=!0;for(const a of t)r.push(a),s=s&&a.groupNode.shared!==!0;let o;return s?(o=n.get(r),o===void 0&&(o=new kb(e,r,this.bindingsIndexes[e].group,r),n.set(r,o))):o=new kb(e,r,this.bindingsIndexes[e].group,r),o}getBindGroupArray(e,t){const n=this.bindings[t];let r=n[e];return r===void 0&&(this.bindingsIndexes[e]===void 0&&(this.bindingsIndexes[e]={binding:0,group:Object.keys(this.bindingsIndexes).length}),n[e]=r=[]),r}getBindings(){let e=this.bindGroups;if(e===null){const t={},n=this.bindings;for(const r of xb)for(const s in n[r]){const o=n[r][s];(t[s]||(t[s]=[])).push(...o)}e=[];for(const r in t){const s=t[r],o=this._getBindGroup(r,s);e.push(o)}this.bindGroups=e}return e}sortBindingGroups(){const e=this.getBindings();e.sort((t,n)=>t.bindings[0].groupNode.order-n.bindings[0].groupNode.order);for(let t=0;t<e.length;t++){const n=e[t];this.bindingsIndexes[n.name].group=t,n.index=t}}setHashNode(e,t){this.hashNodes[t]=e}addNode(e){this.nodes.includes(e)===!1&&(this.nodes.push(e),this.setHashNode(e,e.getHash(this)))}addSequentialNode(e){this.sequentialNodes.includes(e)===!1&&this.sequentialNodes.push(e)}buildUpdateNodes(){for(const e of this.nodes)e.getUpdateType()!==gn.NONE&&this.updateNodes.push(e.getSelf());for(const e of this.sequentialNodes){const t=e.getUpdateBeforeType(),n=e.getUpdateAfterType();t!==gn.NONE&&this.updateBeforeNodes.push(e.getSelf()),n!==gn.NONE&&this.updateAfterNodes.push(e.getSelf())}}get currentNode(){return this.chaining[this.chaining.length-1]}isFilteredTexture(e){return e.magFilter===xr||e.magFilter===Wd||e.magFilter===Ll||e.magFilter===Os||e.minFilter===xr||e.minFilter===Wd||e.minFilter===Ll||e.minFilter===Os}addChain(e){this.chaining.push(e)}removeChain(e){if(this.chaining.pop()!==e)throw new Error("NodeBuilder: Invalid node chaining!")}getMethod(e){return e}getNodeFromHash(e){return this.hashNodes[e]}addFlow(e,t){return this.flowNodes[e].push(t),t}setContext(e){this.context=e}getContext(){return this.context}getSharedContext(){return{...this.context},this.context}setCache(e){this.cache=e}getCache(){return this.cache}getCacheFromNode(e,t=!0){const n=this.getDataFromNode(e);return n.cache===void 0&&(n.cache=new _x(t?this.getCache():null)),n.cache}isAvailable(){return!1}getVertexIndex(){console.warn("Abstract function.")}getInstanceIndex(){console.warn("Abstract function.")}getDrawIndex(){console.warn("Abstract function.")}getFrontFacing(){console.warn("Abstract function.")}getFragCoord(){console.warn("Abstract function.")}isFlipY(){return!1}increaseUsage(e){const t=this.getDataFromNode(e);return t.usageCount=t.usageCount===void 0?1:t.usageCount+1,t.usageCount}generateTexture(){console.warn("Abstract function.")}generateTextureLod(){console.warn("Abstract function.")}generateArrayDeclaration(e,t){return this.getType(e)+"[ "+t+" ]"}generateArray(e,t,n=null){let r=this.generateArrayDeclaration(e,t)+"( ";for(let s=0;s<t;s++){const o=n?n[s]:null;o!==null?r+=o.build(this,e):r+=this.generateConst(e),s<t-1&&(r+=", ")}return r+=" )",r}generateStruct(e,t,n=null){const r=[];for(const s of t){const{name:o,type:a}=s;n&&n[o]&&n[o].isNode?r.push(n[o].build(this,a)):r.push(this.generateConst(a))}return e+"( "+r.join(", ")+" )"}generateConst(e,t=null){if(t===null&&(e==="float"||e==="int"||e==="uint"?t=0:e==="bool"?t=!1:e==="color"?t=new qt:e==="vec2"?t=new at:e==="vec3"?t=new re:e==="vec4"&&(t=new Jt)),e==="float")return og(t);if(e==="int")return`${Math.round(t)}`;if(e==="uint")return t>=0?`${Math.round(t)}u`:"0u";if(e==="bool")return t?"true":"false";if(e==="color")return`${this.getType("vec3")}( ${og(t.r)}, ${og(t.g)}, ${og(t.b)} )`;const n=this.getTypeLength(e),r=this.getComponentType(e),s=o=>this.generateConst(r,o);if(n===2)return`${this.getType(e)}( ${s(t.x)}, ${s(t.y)} )`;if(n===3)return`${this.getType(e)}( ${s(t.x)}, ${s(t.y)}, ${s(t.z)} )`;if(n===4&&e!=="mat2")return`${this.getType(e)}( ${s(t.x)}, ${s(t.y)}, ${s(t.z)}, ${s(t.w)} )`;if(n>=4&&t&&(t.isMatrix2||t.isMatrix3||t.isMatrix4))return`${this.getType(e)}( ${t.elements.map(s).join(", ")} )`;if(n>4)return`${this.getType(e)}()`;throw new Error(`NodeBuilder: Type '${e}' not found in generate constant attempt.`)}getType(e){return e==="color"?"vec3":e}hasGeometryAttribute(e){return this.geometry&&this.geometry.getAttribute(e)!==void 0}getAttribute(e,t){const n=this.attributes;for(const s of n)if(s.name===e)return s;const r=new nC(e,t);return this.registerDeclaration(r),n.push(r),r}getPropertyName(e){return e.name}isVector(e){return/vec\d/.test(e)}isMatrix(e){return/mat\d/.test(e)}isReference(e){return e==="void"||e==="property"||e==="sampler"||e==="samplerComparison"||e==="texture"||e==="cubeTexture"||e==="storageTexture"||e==="depthTexture"||e==="texture3D"}needsToWorkingColorSpace(){return!1}getComponentTypeFromTexture(e){const t=e.type;if(e.isDataTexture){if(t===Ir)return"int";if(t===mi)return"uint"}return"float"}getElementType(e){return e==="mat2"?"vec2":e==="mat3"?"vec3":e==="mat4"?"vec4":this.getComponentType(e)}getComponentType(e){if(e=this.getVectorType(e),e==="float"||e==="bool"||e==="int"||e==="uint")return e;const t=/(b|i|u|)(vec|mat)([2-4])/.exec(e);return t===null?null:t[1]==="b"?"bool":t[1]==="i"?"int":t[1]==="u"?"uint":"float"}getVectorType(e){return e==="color"?"vec3":e==="texture"||e==="cubeTexture"||e==="storageTexture"||e==="texture3D"?"vec4":e}getTypeFromLength(e,t="float"){if(e===1)return t;let n=I5(e);const r=t==="float"?"":t[0];return/mat2/.test(t)===!0&&(n=n.replace("vec","mat")),r+n}getTypeFromArray(e){return fie.get(e.constructor)}isInteger(e){return/int|uint|(i|u)vec/.test(e)}getTypeFromAttribute(e){let t=e;e.isInterleavedBufferAttribute&&(t=e.data);const n=t.array,r=e.itemSize,s=e.normalized;let o;return!(e instanceof hL)&&s!==!0&&(o=this.getTypeFromArray(n)),this.getTypeFromLength(r,o)}getTypeLength(e){const t=this.getVectorType(e),n=/vec([2-4])/.exec(t);return n!==null?Number(n[1]):t==="float"||t==="bool"||t==="int"||t==="uint"?1:/mat2/.test(e)===!0?4:/mat3/.test(e)===!0?9:/mat4/.test(e)===!0?16:0}getVectorFromMatrix(e){return e.replace("mat","vec")}changeComponentType(e,t){return this.getTypeFromLength(this.getTypeLength(e),t)}getIntegerType(e){const t=this.getComponentType(e);return t==="int"||t==="uint"?e:this.changeComponentType(e,"int")}addStack(){return this.stack=y_(this.stack),this.stacks.push(gM()||this.stack),l0(this.stack),this.stack}removeStack(){const e=this.stack;return this.stack=e.parent,l0(this.stacks.pop()),e}getDataFromNode(e,t=this.shaderStage,n=null){n=n===null?e.isGlobal(this)?this.globalCache:this.cache:n;let r=n.getData(e);return r===void 0&&(r={},n.setData(e,r)),r[t]===void 0&&(r[t]={}),r[t]}getNodeProperties(e,t="any"){const n=this.getDataFromNode(e,t);return n.properties||(n.properties={outputNode:null})}getBufferAttributeFromNode(e,t){const n=this.getDataFromNode(e);let r=n.bufferAttribute;if(r===void 0){const s=this.uniforms.index++;r=new nC("nodeAttribute"+s,t,e),this.bufferAttributes.push(r),n.bufferAttribute=r}return r}getStructTypeFromNode(e,t,n=null,r=this.shaderStage){const s=this.getDataFromNode(e,r,this.globalCache);let o=s.structType;if(o===void 0){const a=this.structs.index++;n===null&&(n="StructType"+a),o=new Qne(n,t),this.structs[r].push(o),s.structType=o}return o}getOutputStructTypeFromNode(e,t){const n=this.getStructTypeFromNode(e,t,"OutputType","fragment");return n.output=!0,n}getUniformFromNode(e,t,n=this.shaderStage,r=null){const s=this.getDataFromNode(e,n,this.globalCache);let o=s.uniform;if(o===void 0){const a=this.uniforms.index++;o=new $ne(r||"nodeUniform"+a,t,e),this.uniforms[n].push(o),this.registerDeclaration(o),s.uniform=o}return o}getArrayCount(e){let t=null;return e.isArrayNode?t=e.count:e.isVarNode&&e.node.isArrayNode&&(t=e.node.count),t}getVarFromNode(e,t=null,n=e.getNodeType(this),r=this.shaderStage,s=!1){const o=this.getDataFromNode(e,r);let a=o.variable;if(a===void 0){const l=s?"_const":"_var",c=this.vars[r]||(this.vars[r]=[]),u=this.vars[l]||(this.vars[l]=0);t===null&&(t=(s?"nodeConst":"nodeVar")+u,this.vars[l]++);const p=this.getArrayCount(e);a=new oI(t,n,s,p),s||c.push(a),this.registerDeclaration(a),o.variable=a}return a}isDeterministic(e){if(e.isMathNode)return this.isDeterministic(e.aNode)&&(e.bNode?this.isDeterministic(e.bNode):!0)&&(e.cNode?this.isDeterministic(e.cNode):!0);if(e.isOperatorNode)return this.isDeterministic(e.aNode)&&(e.bNode?this.isDeterministic(e.bNode):!0);if(e.isArrayNode){if(e.values!==null){for(const t of e.values)if(!this.isDeterministic(t))return!1}return!0}else if(e.isConstNode)return!0;return!1}getVaryingFromNode(e,t=null,n=e.getNodeType(this),r=null,s=null){const o=this.getDataFromNode(e,"any");let a=o.varying;if(a===void 0){const l=this.varyings,c=l.length;t===null&&(t="nodeVarying"+c),a=new jne(t,n,r,s),l.push(a),this.registerDeclaration(a),o.varying=a}return a}registerDeclaration(e){const t=this.shaderStage,n=this.declarations[t]||(this.declarations[t]={}),r=
3870this.getPropertyName(e);let s=1,o=r;for(;n[o]!==void 0;)o=r+"_"+s++;s>1&&(e.name=o,console.warn(`THREE.TSL: Declaration name '${r}' of '${e.type}' already in use. Renamed to '${o}'.`)),n[o]=e}getCodeFromNode(e,t,n=this.shaderStage){const r=this.getDataFromNode(e);let s=r.code;if(s===void 0){const o=this.codes[n]||(this.codes[n]=[]),a=o.length;s=new Xne("nodeCode"+a,t),o.push(s),r.code=s}return s}addFlowCodeHierarchy(e,t){const{flowCodes:n,flowCodeBlock:r}=this.getDataFromNode(e);let s=!0,o=t;for(;o;){if(r.get(o)===!0){s=!1;break}o=this.getDataFromNode(o).parentNodeBlock}if(s)for(const a of n)this.addLineFlowCode(a)}addLineFlowCodeBlock(e,t,n){const r=this.getDataFromNode(e),s=r.flowCodes||(r.flowCodes=[]),o=r.flowCodeBlock||(r.flowCodeBlock=new WeakMap);s.push(t),o.set(n,!0)}addLineFlowCode(e,t=null){return e===""?this:(t!==null&&this.context.nodeBlock&&this.addLineFlowCodeBlock(t,e,this.context.nodeBlock),e=this.tab+e,/;\s*$/.test(e)||(e=e+`;
3871`),this.flow.code+=e,this)}addFlowCode(e){return this.flow.code+=e,this}addFlowTab(){return this.tab+="	",this}removeFlowTab(){return this.tab=this.tab.slice(0,-1),this}getFlowData(e){return this.flowsData.get(e)}flowNode(e){const t=e.getNodeType(this),n=this.flowChildNode(e,t);return this.flowsData.set(e,n),n}addInclude(e){this.currentFunctionNode!==null&&this.currentFunctionNode.includes.push(e)}buildFunctionNode(e){const t=new LD,n=this.currentFunctionNode;return this.currentFunctionNode=t,t.code=this.buildFunctionCode(e),this.currentFunctionNode=n,t}flowShaderNode(e){const t=e.layout,n={[Symbol.iterator](){let o=0;const a=Object.values(this);return{next:()=>({value:a[o],done:o++>=a.length})}}};for(const o of t.inputs)n[o.name]=new lD(o.type,o.name);e.layout=null;const r=e.call(n),s=this.flowStagesNode(r,t.type);return e.layout=t,s}flowStagesNode(e,t=null){const n=this.flow,r=this.vars,s=this.declarations,o=this.cache,a=this.buildStage,l=this.stack,c={code:""};this.flow=c,this.vars={},this.declarations={},this.cache=new _x,this.stack=y_();for(const u of yb)this.setBuildStage(u),c.result=e.build(this,t);return c.vars=this.getVars(this.shaderStage),this.flow=n,this.vars=r,this.declarations=s,this.cache=o,this.stack=l,this.setBuildStage(a),c}getFunctionOperator(){return null}buildFunctionCode(){console.warn("Abstract function.")}flowChildNode(e,t=null){const n=this.flow,r={code:""};return this.flow=r,r.result=e.build(this,t),this.flow=n,r}flowNodeFromShaderStage(e,t,n=null,r=null){const s=this.shaderStage;this.setShaderStage(e);const o=this.flowChildNode(t,n);return r!==null&&(o.code+=`${this.tab+r} = ${o.result};
3872`),this.flowCode[e]=this.flowCode[e]+o.code,this.setShaderStage(s),o}getAttributesArray(){return this.attributes.concat(this.bufferAttributes)}getAttributes(){console.warn("Abstract function.")}getVaryings(){console.warn("Abstract function.")}getVar(e,t,n=null){return`${n!==null?this.generateArrayDeclaration(e,n):this.getType(e)} ${t}`}getVars(e){let t="";const n=this.vars[e];if(n!==void 0)for(const r of n)t+=`${this.getVar(r.type,r.name)}; `;return t}getUniforms(){console.warn("Abstract function.")}getCodes(e){const t=this.codes[e];let n="";if(t!==void 0)for(const r of t)n+=r.code+`
3873`;return n}getHash(){return this.vertexShader+this.fragmentShader+this.computeShader}setShaderStage(e){this.shaderStage=e}getShaderStage(){return this.shaderStage}setBuildStage(e){this.buildStage=e}getBuildStage(){return this.buildStage}buildCode(){console.warn("Abstract function.")}build(){const{object:e,material:t,renderer:n}=this;if(t!==null){let r=n.library.fromMaterial(t);r===null&&(console.error(`NodeMaterial: Material "${t.type}" is not compatible.`),r=new sr),r.build(this)}else this.addFlow("compute",e);for(const r of yb){this.setBuildStage(r),this.context.vertex&&this.context.vertex.isNode&&this.flowNodeFromShaderStage("vertex",this.context.vertex);for(const s of xb){this.setShaderStage(s);const o=this.flowNodes[s];for(const a of o)r==="generate"?this.flowNode(a):a.build(this)}}return this.setBuildStage(null),this.setShaderStage(null),this.buildCode(),this.buildUpdateNodes(),this}getNodeUniform(e,t){if(t==="float"||t==="int"||t==="uint")return new sie(e);if(t==="vec2"||t==="ivec2"||t==="uvec2")return new oie(e);if(t==="vec3"||t==="ivec3"||t==="uvec3")return new aie(e);if(t==="vec4"||t==="ivec4"||t==="uvec4")return new lie(e);if(t==="color")return new cie(e);if(t==="mat2")return new uie(e);if(t==="mat3")return new hie(e);if(t==="mat4")return new die(e);throw new Error(`Uniform "${t}" not declared.`)}format(e,t,n){if(t=this.getVectorType(t),n=this.getVectorType(n),t===n||n===null||this.isReference(n))return e;const r=this.getTypeLength(t),s=this.getTypeLength(n);return r===16&&s===9?`${this.getType(n)}( ${e}[ 0 ].xyz, ${e}[ 1 ].xyz, ${e}[ 2 ].xyz )`:r===9&&s===4?`${this.getType(n)}( ${e}[ 0 ].xy, ${e}[ 1 ].xy )`:r>4||s>4||s===0?e:r===s?`${this.getType(n)}( ${e} )`:r>s?(e=n==="bool"?`all( ${e} )`:`${e}.${"xyz".slice(0,s)}`,this.format(e,this.getTypeFromLength(s,this.getComponentType(t)),n)):s===4&&r>1?`${this.getType(n)}( ${this.format(e,t,"vec3")}, 1.0 )`:r===2?`${this.getType(n)}( ${this.format(e,t,"vec2")}, 0.0 )`:(r===1&&s>1&&t!==this.getComponentType(n)&&(e=`${this.getType(this.getComponentType(n))}( ${e} )`),`${this.getType(n)}( ${e} )`)}getSignature(){return`// Three.js r${zf} - Node System
3874`}*[Symbol.iterator](){}createNodeMaterial(e="NodeMaterial"){throw new Error(`THREE.NodeBuilder: createNodeMaterial() was deprecated. Use new ${e}() instead.`)}}class rC{constructor(){this.time=0,this.deltaTime=0,this.frameId=0,this.renderId=0,this.updateMap=new WeakMap,this.updateBeforeMap=new WeakMap,this.updateAfterMap=new WeakMap,this.renderer=null,this.material=null,this.camera=null,this.object=null,this.scene=null}_getMaps(e,t){let n=e.get(t);return n===void 0&&(n={renderMap:new WeakMap,frameMap:new WeakMap},e.set(t,n)),n}updateBeforeNode(e){const t=e.getUpdateBeforeType(),n=e.updateReference(this);if(t===gn.FRAME){const{frameMap:r}=this._getMaps(this.updateBeforeMap,n);r.get(n)!==this.frameId&&e.updateBefore(this)!==!1&&r.set(n,this.frameId)}else if(t===gn.RENDER){const{renderMap:r}=this._getMaps(this.updateBeforeMap,n);r.get(n)!==this.renderId&&e.updateBefore(this)!==!1&&r.set(n,this.renderId)}else t===gn.OBJECT&&e.updateBefore(this)}updateAfterNode(e){const t=e.getUpdateAfterType(),n=e.updateReference(this);if(t===gn.FRAME){const{frameMap:r}=this._getMaps(this.updateAfterMap,n);r.get(n)!==this.frameId&&e.updateAfter(this)!==!1&&r.set(n,this.frameId)}else if(t===gn.RENDER){const{renderMap:r}=this._getMaps(this.updateAfterMap,n);r.get(n)!==this.renderId&&e.updateAfter(this)!==!1&&r.set(n,this.renderId)}else t===gn.OBJECT&&e.updateAfter(this)}updateNode(e){const t=e.getUpdateType(),n=e.updateReference(this);if(t===gn.FRAME){const{frameMap:r}=this._getMaps(this.updateMap,n);r.get(n)!==this.frameId&&e.update(this)!==!1&&r.set(n,this.frameId)}else if(t===gn.RENDER){const{renderMap:r}=this._getMaps(this.updateMap,n);r.get(n)!==this.renderId&&e.update(this)!==!1&&r.set(n,this.renderId)}else t===gn.OBJECT&&e.update(this)}update(){this.frameId++,this.lastTime===void 0&&(this.lastTime=performance.now()),this.deltaTime=(performance.now()-this.lastTime)/1e3,this.lastTime=performance.now(),this.time+=this.deltaTime}}class bw{constructor(e,t,n=null,r="",s=!1){this.type=e,this.name=t,this.count=n,this.qual
3874ifier=r,this.isConst=s}}bw.isNodeFunctionInput=!0;class pie extends _h{static get type(){return"DirectionalLightNode"}constructor(e=null){super(e)}setupDirect(){const e=this.colorNode;return{lightDirection:mw(this.light),lightColor:e}}}const vx=new un,ag=new un;let kp=null;class Aie extends _h{static get type(){return"RectAreaLightNode"}constructor(e=null){super(e),this.halfHeight=$t(new re).setGroup(Zt),this.halfWidth=$t(new re).setGroup(Zt),this.updateType=gn.RENDER}update(e){super.update(e);const{light:t}=this,n=e.camera.matrixWorldInverse;ag.identity(),vx.copy(t.matrixWorld),vx.premultiply(n),ag.extractRotation(vx),this.halfWidth.value.set(t.width*.5,0,0),this.halfHeight.value.set(0,t.height*.5,0),this.halfWidth.value.applyMatrix4(ag),this.halfHeight.value.applyMatrix4(ag)}setupDirectRectArea(e){let t,n;e.isAvailable("float32Filterable")?(t=Ln(kp.LTC_FLOAT_1),n=Ln(kp.LTC_FLOAT_2)):(t=Ln(kp.LTC_HALF_1),n=Ln(kp.LTC_HALF_2));const{colorNode:r,light:s}=this,o=Aw(s);return{lightColor:r,lightPosition:o,halfWidth:this.halfWidth,halfHeight:this.halfHeight,ltc_1:t,ltc_2:n}}static setLTC(e){kp=e}}class lI extends _h{static get type(){return"SpotLightNode"}constructor(e=null){super(e),this.coneCosNode=$t(0).setGroup(Zt),this.penumbraCosNode=$t(0).setGroup(Zt),this.cutoffDistanceNode=$t(0).setGroup(Zt),this.decayExponentNode=$t(0).setGroup(Zt)}update(e){super.update(e);const{light:t}=this;this.coneCosNode.value=Math.cos(t.angle),this.penumbraCosNode.value=Math.cos(t.angle*(1-t.penumbra)),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}getSpotAttenuation(e){const{coneCosNode:t,penumbraCosNode:n}=this;return Za(t,n,e)}setupDirect(e){const{colorNode:t,cutoffDistanceNode:n,decayExponentNode:r,light:s}=this,o=this.getLightVector(e),a=o.normalize(),l=a.dot(mw(s)),c=this.getSpotAttenuation(l),u=o.length(),p=vw({lightDistance:u,cutoffDistance:n,decayExponent:r});let m=t.mul(c).mul(p);if(s.map){const g=BD(s,e.context.positionWorld),v=Ln(s.map,g.xy).onRenderUpdate(()=>s.map);m=g.mul(2).sub(1).abs().lessThan(1).all().select(m.mul(v),m)}return{lightColor:m,lightDirection:a}}}class mie extends lI{static get type(){return"IESSpotLightNode"}getSpotAttenuation(e){const t=this.light.iesMap;let n=null;if(t&&t.isTexture===!0){const r=e.acos().mul(1/Math.PI);n=Ln(t,dt(r,0),0).r}else n=super.getSpotAttenuation(e);return n}}class gie extends _h{static get type(){return"AmbientLightNode"}constructor(e=null){super(e)}setup({context:e}){e.irradiance.addAssign(this.colorNode)}}class _ie extends _h{static get type(){return"HemisphereLightNode"}constructor(e=null){super(e),this.lightPositionNode=pw(e),this.lightDirectionNode=this.lightPositionNode.normalize(),this.groundColorNode=$t(new qt).setGroup(Zt)}update(e){const{light:t}=this;super.update(e),this.lightPositionNode.object3d=t,this.groundColorNode.value.copy(t.groundColor).multiplyScalar(t.intensity)}setup(e){const{colorNode:t,groundColorNode:n,lightDirectionNode:r}=this,o=Ho.dot(r).mul(.5).add(.5),a=Qn(n,t,o);e.context.irradiance.addAssign(a)}}class vie extends _h{static get type(){return"LightProbeNode"}constructor(e=null){super(e);const t=[];for(let n=0;n<9;n++)t.push(new re);this.lightProbe=Fo(t)}update(e){const{light:t}=this;super.update(e);for(let n=0;n<9;n++)this.lightProbe.array[n].copy(t.sh.coefficients[n]).multiplyScalar(t.intensity)}setup(e){const t=sI(iv,this.lightProbe);e.context.irradiance.addAssign(t)}}class cI{parseFunction(){console.warn("Abstract function.")}}class Sw{constructor(e,t,n="",r=""){this.type=e,this.inputs=t,this.name=n,this.precision=r}getCode(){console.warn("Abstract function.")}}Sw.isNodeFunction=!0;const yie=/^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i,xie=/[a-z_0-9]+/ig,sC="#pragma main",bie=i=>{i=i.trim();const e=i.indexOf(sC),t=e!==-1?i.slice(e+sC.length):i,n=t.match(yie);if(n!==null&&n.length===5){const r=n[4],s=[];let o=null;for(;(o=xie.exec(r))!==null;)s.push(o);const a=[];let l=0;for(;l<s.length;){const v=s[l][0]==="const";v===!0&&l++;let b=s[l][0];b==="in"||b==="out"||b==="inout"?l++:b="";const M=s[l++][0];let x=Number.parseInt(s[l][0]);Number.isNaN(x)===!1?l++:x=null;const w=s[l++][0];a.push(new bw(M,w,x,b,v))}const c=t.substring(n[0].length),u=n[3]!==void 0?n[3]:"",p=n[2],m=n[1]!==void 0?n[1]:"",g=e!==-1?i.slice(0,e):"";
3874return{type:p,inputs:a,name:u,precision:m,inputsCode:r,blockCode:c,headerCode:g}}else throw new Error("FunctionNode: Function is not a GLSL code.")};class Sie extends Sw{constructor(e){const{type:t,inputs:n,name:r,precision:s,inputsCode:o,blockCode:a,headerCode:l}=bie(e);super(t,n,r,s),this.inputsCode=o,this.blockCode=a,this.headerCode=l}getCode(e=this.name){let t;const n=this.blockCode;if(n!==""){const{type:r,inputsCode:s,headerCode:o,precision:a}=this;let l=`${r} ${e} ( ${s.trim()} )`;a!==""&&(l=`${a} ${l}`),t=o+l+n}else t="";return t}}class Mie extends cI{parseFunction(e){return new Sie(e)}}const oC=new WeakMap,Ra=[],Jh=[];class wie extends Zc{constructor(e,t){super(),this.renderer=e,this.backend=t,this.nodeFrame=new rC,this.nodeBuilderCache=new Map,this.callHashCache=new va,this.groupsData=new va,this.cacheLib={}}updateGroup(e){const t=e.groupNode,n=t.name;if(n===wM.name)return!0;if(n===Zt.name){const s=this.get(e),o=this.nodeFrame.renderId;return s.renderId!==o?(s.renderId=o,!0):!1}if(n===nN.name){const s=this.get(e),o=this.nodeFrame.frameId;return s.frameId!==o?(s.frameId=o,!0):!1}Ra[0]=t,Ra[1]=e;let r=this.groupsData.get(Ra);return r===void 0&&this.groupsData.set(Ra,r={}),Ra.length=0,r.version!==t.version?(r.version=t.version,!0):!1}getForRenderCacheKey(e){return e.initialCacheKey}getForRender(e){const t=this.get(e);let n=t.nodeBuilderState;if(n===void 0){const{nodeBuilderCache:r}=this,s=this.getForRenderCacheKey(e);if(n=r.get(s),n===void 0){const o=this.backend.createNodeBuilder(e.object,this.renderer);o.scene=e.scene,o.material=e.material,o.camera=e.camera,o.context.material=e.material,o.lightsNode=e.lightsNode,o.environmentNode=this.getEnvironmentNode(e.scene),o.fogNode=this.getFogNode(e.scene),o.clippingContext=e.clippingContext,this.renderer.getRenderTarget()&&this.renderer.getRenderTarget().multiview&&o.enableMultiview(),o.build(),n=this._createNodeBuilderState(o),r.set(s,n)}n.usedTimes++,t.nodeBuilderState=n}return n}delete(e){if(e.isRenderObject){const t=this.get(e).nodeBuilderState;t.usedTimes--,t.usedTimes===0&&this.nodeBuilderCache.delete(this.getForRenderCacheKey(e))}return super.delete(e)}getForCompute(e){const t=this.get(e);let n=t.nodeBuilderState;if(n===void 0){const r=this.backend.createNodeBuilder(e,this.renderer);r.build(),n=this._createNodeBuilderState(r),t.nodeBuilderState=n}return n}_createNodeBuilderState(e){return new Wne(e.vertexShader,e.fragmentShader,e.computeShader,e.getAttributesArray(),e.getBindings(),e.updateNodes,e.updateBeforeNodes,e.updateAfterNodes,e.observer,e.transforms)}getEnvironmentNode(e){this.updateEnvironment(e);let t=null;if(e.environmentNode&&e.environmentNode.isNode)t=e.environmentNode;else{const n=this.get(e);n.environmentNode&&(t=n.environmentNode)}return t}
3874getBackgroundNode(e){this.updateBackground(e);let t=null;if(e.backgroundNode&&e.backgroundNode.isNode)t=e.backgroundNode;else{const n=this.get(e);n.backgroundNode&&(t=n.backgroundNode)}return t}getFogNode(e){return this.updateFog(e),e.fogNode||this.get(e).fogNode||null}getCacheKey(e,t){Ra[0]=e,Ra[1]=t;const n=this.renderer.info.calls,r=this.callHashCache.get(Ra)||{};if(r.callId!==n){const s=this.getEnvironmentNode(e),o=this.getFogNode(e);t&&Jh.push(t.getCacheKey(!0)),s&&Jh.push(s.getCacheKey()),o&&Jh.push(o.getCacheKey()),Jh.push(this.renderer.shadowMap.enabled?1:0),r.callId=n,r.cacheKey=V1(Jh),this.callHashCache.set(Ra,r),Jh.length=0}return Ra.length=0,r.cacheKey}get isToneMappingState(){return!this.renderer.getRenderTarget()}updateBackground(e){const t=this.get(e),n=e.background;if(n){const r=e.backgroundBlurriness===0&&t.backgroundBlurriness>0||e.backgroundBlurriness>0&&t.backgroundBlurriness===0;if(t.background!==n||r){const s=this.getCacheNode("background",n,()=>{if(n.isCubeTexture===!0||n.mapping===eh||n.mapping===th||n.mapping===nh){if(e.backgroundBlurriness>0||n.mapping===nh)return sw(n);{let o;return n.isCubeTexture===!0?o=Pf(n):o=Ln(n),z6(o)}}else{if(n.isTexture===!0)return Ln(n,fa.flipY()).setUpdateMatrix(!0);n.isColor!==!0&&console.error("WebGPUNodes: Unsupported background configuration.",n)}},r);t.backgroundNode=s,t.background=n,t.backgroundBlurriness=e.backgroundBlurriness}}else t.backgroundNode&&(delete t.backgroundNode,delete t.background)}getCacheNode(e,t,n,r=!1){const s=this.cacheLib[e]||(this.cacheLib[e]=new WeakMap);let o=s.get(t);return(o===void 0||r)&&(o=n(),s.set(t,o)),o}updateFog(e){const t=this.get(e),n=e.fog;if(n){if(t.fog!==n){const r=this.getCacheNode("fog",n,()=>{if(n.isFogExp2){const s=ui("color","color",n).setGroup(Zt),o=ui("density","float",n).setGroup(Zt);return A0(s,hw(o))}else if(n.isFog){const s=ui("color","color",n).setGroup(Zt),o=ui("near","float",n).setGroup(Zt),a=ui("far","float",n).setGroup(Zt);return A0(s,uw(o,a))}else console.error("THREE.Renderer: Unsupported fog configuration.",n)});t.fogNode=r,t.fog=n}}else delete t.fogNode,delete t.fog}updateEnvironment(e){const t=this.get(e),n=e.environment;if(n){if(t.environment!==n){const r=this.getCacheNode("environment",n,()=>{if(n.isCubeTexture===!0)return Pf(n);if(n.isTexture===!0)return Ln(n);console.error("Nodes: Unsupported environment configuration.",n)});t.environmentNode=r,t.environment=n}}else t.environmentNode&&(delete t.environmentNode,delete t.environment)}getNodeFrame(e=this.renderer,t=null,n=null,r=null,s=null){const o=this.nodeFrame;return o.renderer=e,o.scene=t,o.object=n,o.camera=r,o.material=s,o}getNodeFrameForRender(e){return this.getNodeFrame(e.renderer,e.scene,e.object,e.camera,e.material)}getOutputCacheKey(){const e=this.renderer;return e.toneMapping+","+e.currentColorSpace+","+e.xr.isPresenting}hasOutputChange(e){return oC.get(e)!==this.getOutputCacheKey()}getOutputNode(e){const t=this.renderer,n=this.getOutputCacheKey(),r=e.isTextureArray?_D(e,Se(fa,V0("gl_ViewID_OVR"))).renderOutput(t.toneMapping,t.currentColorSpace):Ln(e,fa).renderOutput(t.toneMapping,t.currentColorSpace);return oC.set(e,n),r}updateBefore(e){const t=e.getNodeBuilderState();for(const n of t.updateBeforeNodes)this.getNodeFrameForRender(e).updateBeforeNode(n)}updateAfter(e){const t=e.getNodeBuilderState();for(const n of t.updateAfterNodes)this.getNodeFrameForRender(e).updateAfterNode(n)}updateForCompute(e){const t=this.getNodeFrame(),n=this.getForCompute(e);for(const r of n.updateNodes)t.updateNode(r)}updateForRender(e){const t=this.getNodeFrameForRender(e),n=e.getNodeBuilderState();for(const r of n.updateNodes)t.updateNode(r)}needsRefresh(e){const t=this.getNodeFrameForRender(e);return e.getMonitor().needsRefresh(e,t)}dispose(){super.dispose(),this.nodeFrame=new rC,this.nodeBuilderCache=new Map,this.cacheLib={}}}const yx=new Da;class p1{constructor(e=null){this.version=0,this.clipIntersection=null,this.cacheKey="",this.shadowPass=!1,this.viewNormalMatrix=new Sn,this.clippingGroupContexts=new WeakMap,this.intersectionPlanes=[],this.unionPlanes=[],this.parentVersion=null,e!==null&&(this.viewNormalMatrix=e.viewNormalMatrix,this.clippingGroupContexts=e.clippingGroupContexts,this.shadowPass=e.shadowPass,this.viewMatrix=e.viewMatrix)}projectPlanes(e,t,n){const r=e.length;for(let s=0;s<r;s++){yx.copy(e[s]).applyMatrix4(this.viewMatrix,this.viewNormalMatrix);const o=t[n+s],a=yx.normal;o.x=-a.x,o.y=-a.y,o.z=-a.z,o.w=yx.constant}}updateGlobal(e,t){this.shadowPass=e.overrideMaterial!==null&&e.overrideMaterial.isShadowPassMaterial,this.viewMatrix=t.matrixWorldInverse,this.viewNormalMatrix.getNormalMatrix(this.viewMatrix)}update(e,t){let n=!1;e.version!==this.parentVersion&&(this.intersectionPlanes=Array.from(e.intersectionPlanes),this.unionPlanes=Array.from(e.unionPlanes),this.parentVersion=e.version),this.clipIntersection!==t.clipIntersection&&(this.clipIntersection=t.clipIntersection,this.clipIntersection?this.unionPlanes.length=e.unionPlanes.length:this.intersectionPlanes.length=e.intersectionPlanes.length);const r=t.clippingPlanes,s=r.length;let o,a;if(this.clipIntersection?(o=this.intersectionPlanes,a=e.intersectionPlanes.length):(o=this.unionPlanes,a=e.unionPlanes.length),o.length!==a+s){o.length=a+s;for(let l=0;l<s;l++)o[a+l]=new Jt;n=!0}this.projectPlanes(r,o,a),n&&(this.version++,this.cacheKey=`${this.intersectionPlanes.length}:${this.unionPlanes.length}`)}
3874getGroupContext(e){if(this.shadowPass&&!e.clipShadows)return this;let t=this.clippingGroupContexts.get(e);return t===void 0&&(t=new p1(this),this.clippingGroupContexts.set(e,t)),t.update(this,e),t}get unionClippingCount(){return this.unionPlanes.length}}class Tie{constructor(e,t){this.bundleGroup=e,this.camera=t}}const zp=[];class Eie{constructor(){this.bundles=new va}get(e,t){const n=this.bundles;zp[0]=e,zp[1]=t;let r=n.get(zp);return r===void 0&&(r=new Tie(e,t),n.set(zp,r)),zp.length=0,r}dispose(){this.bundles=new va}}class uI{constructor(){this.lightNodes=new WeakMap,this.materialNodes=new Map,this.toneMappingNodes=new Map}fromMaterial(e){if(e.isNodeMaterial)return e;let t=null;const n=this.getMaterialNodeClass(e.type);if(n!==null){t=new n;for(const r in e)t[r]=e[r]}return t}addToneMapping(e,t){this.addType(e,t,this.toneMappingNodes)}getToneMappingFunction(e){return this.toneMappingNodes.get(e)||null}getMaterialNodeClass(e){return this.materialNodes.get(e)||null}addMaterial(e,t){this.addType(e,t,this.materialNodes)}getLightNodeClass(e){return this.lightNodes.get(e)||null}addLight(e,t){this.addClass(e,t,this.lightNodes)}addType(e,t,n){if(n.has(t)){console.warn(`Redefinition of node ${t}`);return}if(typeof e!="function")throw new Error(`Node class ${e.name} is not a class.`);if(typeof t=="function"||typeof t=="object")throw new Error(`Base class ${t} is not a class.`);n.set(t,e)}addClass(e,t,n){if(n.has(t)){console.warn(`Redefinition of node ${t.name}`);return}if(typeof e!="function")throw new Error(`Node class ${e.name} is not a class.`);if(typeof t!="function")throw new Error(`Base class ${t.name} is not a class.`);n.set(t,e)}}const Rie=new gw,Vp=[];class Cie extends va{constructor(){super()}createNode(e=[]){return new gw().setLights(e)}getNode(e,t){if(e.isQuadMesh)return Rie;Vp[0]=e,Vp[1]=t;let n=this.get(Vp);return n===void 0&&(n=this.createNode(),this.set(Vp,n)),Vp.length=0,n}}class uA extends rl{constructor(e=1,t=1,n={}){super(e,t,n),this.isXRRenderTarget=!0,this.hasExternalTextures=!1,this.autoAllocateDepthBuffer=!0}copy(e){return super.copy(e),this.hasExternalTextures=e.hasExternalTextures,this.autoAllocateDepthBuffer=e.autoAllocateDepthBuffer,this}}const aC=new re,lC=new re;class Pie extends il{constructor(e,t=!1){super(),this.enabled=!1,this.isPresenting=!1,this.cameraAutoUpdate=!0,this._renderer=e,this._cameraL=new Br,this._cameraL.viewport=new Jt,this._cameraR=new Br,this._cameraR.viewport=new Jt,this._cameras=[this._cameraL,this._cameraR],this._cameraXR=new kL,this._currentDepthNear=null,this._currentDepthFar=null,this._controllers=[],this._controllerInputSources=[],this._xrRenderTarget=null,this._layers=[],this._supportsLayers=!1,this._createXRLayer=Fie.bind(this),this._gl=null,this._currentAnimationContext=null,this._currentAnimationLoop=null,this._currentPixelRatio=null,this._currentSize=new at,this._onSessionEvent=Die.bind(this),this._onSessionEnd=Iie.bind(this),this._onInputSourcesChange=Bie.bind(this),this._onAnimationFrame=Uie.bind(this),this._referenceSpace=null,this._referenceSpaceType="local-floor",this._customReferenceSpace=null,this._framebufferScaleFactor=1,this._foveation=1,this._session=null,this._glBaseLayer=null,this._glBinding=null,this._glProjLayer=null,this._xrFrame=null,this._useLayers=typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype,this._useMultiviewIfPossible=t,this._useMultiview=!1}getController(e){return this._getController(e).getTargetRaySpace()}getControllerGrip(e){return this._getController(e).getGripSpace()}getHand(e){return this._getController(e).getHandSpace()}getFoveation(){if(!(this._glProjLayer===null&&this._glBaseLayer===null))return this._foveation}setFoveation(e){this._foveation=e,this._glProjLayer!==null&&(this._glProjLayer.fixedFoveation=e),this._glBaseLayer!==null&&this._glBaseLayer.fixedFoveation!==void 0&&(this._glBaseLayer.fixedFoveation=e)}getFramebufferScaleFactor(){return this._framebufferScaleFactor}setFramebufferScaleFactor(e){this._framebufferScaleFactor=e,this.isPresenting===!0&&console.warn("THREE.XRManager: Cannot change framebuffer scale while presenting.")}getReferenceSpaceType(){return this._referenceSpaceType}setReferenceSpaceType(e){this._referenceSpaceType=e,this.isPresenting===!0&&console.warn("THREE.XRManager: Cannot change reference space type while presenting.")}getReferenceSpace(){return this._customReferenceSpace||this._referenceSpace}setReferenceSpace(e){this._customReferenceSpace=e}getCamera(){return this._cameraXR}getEnvironmentBlendMode(){if(this._session!==null)return this._session.environmentBlendMode}getFrame(){return this._xrFrame}useMultiview(){return this._useMultiview}createQuadLayer(e,t,n,r,s,o,a,l=[]){const c=new QS(e,t),u=new uA(s,o,{format:Yi,type:Gi,depthTexture:new $s(s,o,l.stencil?xo:mi,void 0,void 0,void 0,void 0,void 0,void 0,l.stencil?So:bo),stencilBuffer:l.stencil,resolveDepthBuffer:!1,resolveStencilBuffer:!1}),p=new Bo({color:16777215,side:qs});p.map=u.texture,p.map.offset.y=1,p.map.repeat.y=-1;const m=new qn(c,p);m.position.copy(n),m.quaternion.copy(r);const g={type:"quad",width:e,height:t,translation:n,quaternion:r,pixelwidth:s,pixelheight:o,plane:m,material:p,rendercall:a,renderTarget:u};if(this._layers.push(g),this._session!==null){g.plane.material=new Bo({color:16777215,side:qs}),g.plane.material.blending=Hd,g.plane.material.blendEquation=os,g.plane.material.blendSrc=Sl,g.plane.material.blendDst=Sl,g.xrlayer=this._createXRLayer(g);const v=this._session.renderState.layers;v.unshift(g.xrlayer),this._session.updateRenderState({layers:v})}else u.isXRRenderTarget=!1;return m}createCylinderLayer(e,t,n,r,s,o,a,l,c=[]){const u=new B1(e,e,e*t/n,64,64,!0,Math.PI-t/2,t),p=new uA(o,a,{format:Yi,type:Gi,depthTexture:new $s(o,a,c.stencil?xo:mi,void 0,void 0,void 0,void 0,void 0,void 0,c.stencil?So:bo),stencilBuffer:c.stencil,resolveDepthBuffer:!1,resolveStencilBuffer:!1}),m=new Bo({color:16777215,side:oi});m.map=p.texture,m.map.offset.y=1,m.map.repeat.y=-1;const g=new qn(u,m);g.position.copy(r),g.quaternion.copy(s);
3874const v={type:"cylinder",radius:e,centralAngle:t,aspectratio:n,translation:r,quaternion:s,pixelwidth:o,pixelheight:a,plane:g,material:m,rendercall:l,renderTarget:p};if(this._layers.push(v),this._session!==null){v.plane.material=new Bo({color:16777215,side:oi}),v.plane.material.blending=Hd,v.plane.material.blendEquation=os,v.plane.material.blendSrc=Sl,v.plane.material.blendDst=Sl,v.xrlayer=this._createXRLayer(v);const b=this._session.renderState.layers;b.unshift(v.xrlayer),this._session.updateRenderState({layers:b})}else p.isXRRenderTarget=!1;return g}renderLayers(){const e=new re,t=new ga,n=this.isPresenting;this.isPresenting=!1;for(const r of this._layers){if(r.renderTarget.isXRRenderTarget=this._session!==null,r.renderTarget.hasExternalTextures=r.renderTarget.isXRRenderTarget,r.renderTarget.autoAllocateDepthBuffer=!r.renderTarget.isXRRenderTarget,r.renderTarget.isXRRenderTarget&&this._supportsLayers){r.xrlayer.transform=new XRRigidTransform(r.plane.getWorldPosition(e),r.plane.getWorldQuaternion(t));const s=this._glBinding.getSubImage(r.xrlayer,this._xrFrame);this._renderer.backend.setXRRenderTargetTextures(r.renderTarget,s.colorTexture,s.depthStencilTexture)}this._renderer.setRenderTarget(r.renderTarget),r.rendercall()}this.isPresenting=n,this._renderer.setRenderTarget(null)}getSession(){return this._session}async setSession(e){const t=this._renderer,n=t.backend;this._gl=t.getContext();const r=this._gl,s=r.getContextAttributes();if(this._session=e,e!==null){if(n.isWebGPUBackend===!0)throw new Error('THREE.XRManager: XR is currently not supported with a WebGPU backend. Use WebGL by passing "{ forceWebGL: true }" to the constructor of the renderer.');if(e.addEventListener("select",this._onSessionEvent),e.addEventListener("selectstart",this._onSessionEvent),e.addEventListener("selectend",this._onSessionEvent),e.addEventListener("squeeze",this._onSessionEvent),e.addEventListener("squeezestart",this._onSessionEvent),e.addEventListener("squeezeend",this._onSessionEvent),e.addEventListener("end",this._onSessionEnd),e.addEventListener("inputsourceschange",this._onInputSourcesChange),await n.makeXRCompatible(),this._currentPixelRatio=t.getPixelRatio(),t.getSize(this._currentSize),this._currentAnimationContext=t._animation.getContext(),this._currentAnimationLoop=t._animation.getAnimationLoop(),t._animation.stop(),this._useLayers===!0){let o=null,a=null,l=null;t.depth&&(l=t.stencil?r.DEPTH24_STENCIL8:r.DEPTH_COMPONENT24,o=t.stencil?So:bo,a=t.stencil?xo:mi);const c={colorFormat:r.RGBA8,depthFormat:l,scaleFactor:this._framebufferScaleFactor};this._useMultiviewIfPossible&&t.hasFeature("OVR_multiview2")&&(c.textureType="texture-array",this._useMultiview=!0);const u=new XRWebGLBinding(e,r),p=u.createProjectionLayer(c),m=[p];this._glBinding=u,this._glProjLayer=p,t.setPixelRatio(1),t.setSize(p.textureWidth,p.textureHeight,!1);let g;if(this._useMultiview?(g=new yL(p.textureWidth,p.textureHeight,2),g.type=a,g.format=o):g=new $s(p.textureWidth,p.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,o),this._xrRenderTarget=new uA(p.textureWidth,p.textureHeight,{format:Yi,type:Gi,colorSpace:t.outputColorSpace,depthTexture:g,stencilBuffer:t.stencil,samples:s.antialias?4:0,resolveDepthBuffer:p.ignoreDepthValues===!1,resolveStencilBuffer:p.ignoreDepthValues===!1,depth:this._useMultiview?2:1,multiview:this._useMultiview}),this._xrRenderTarget.hasExternalTextures=!0,this._xrRenderTarget.depth=this._useMultiview?2:1,this._supportsLayers=e.enabledFeatures.includes("layers"),this._referenceSpace=await e.requestReferenceSpace(this.getReferenceSpaceType()),this._supportsLayers)for(const v of this._layers)v.plane.material=new Bo({color:16777215,side:v.type==="cylinder"?oi:qs}),v.plane.material.blending=Hd,v.plane.material.blendEquation=os,v.plane.material.blendSrc=Sl,v.plane.material.blendDst=Sl,v.xrlayer=this._createXRLayer(v),m.unshift(v.xrlayer);e.updateRenderState({layers:m})}else{const o={antialias:t.samples>0,alpha:!0,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:this.getFramebufferScaleFactor()},a=new XRWebGLLayer(e,r,o);this._glBaseLayer=a,e.updateRenderState({baseLayer:a}),t.setPixelRatio(1),t.setSize(a.framebufferWidth,a.framebufferHeight,!1),this._xrRenderTarget=new uA(a.framebufferWidth,a.framebufferHeight,{format:Yi,type:Gi,colorSpace:t.outputColorSpace,stencilBuffer:t.stencil,resolveDepthBuffer:a.ignoreDepthValues===!1,resolveStencilBuffer:a.ignoreDepthValues===!1}),this._referenceSpace=await e.requestReferenceSpace(this.getReferenceSpaceType())}this.setFoveation(this.getFoveation()),t._animation.setAnimationLoop(this._onAnimationFrame),t._animation.setContext(e),t._animation.start(),this.isPresenting=!0,this.dispatchEvent({type:"sessionstart"})}}updateCamera(e){const t=this._session;if(t===null)return;const n=e.near,r=e.far,s=this._cameraXR,o=this._cameraL,a=this._cameraR;s.near=a.near=o.near=n,s.far=a.far=o.far=r,s.isMultiViewCamera=this._useMultiview,(this._currentDepthNear!==s.near||this._currentDepthFar!==s.far)&&(t.updateRenderState({depthNear:s.near,depthFar:s.far}),this._currentDepthNear=s.near,this._currentDepthFar=s.far),o.layers.mask=e.layers.mask|2,a.layers.mask=e.layers.mask|4,s.layers.mask=o.layers.mask|a.layers.mask;const l=e.parent,c=s.cameras;cC(s,l);for(let u=0;u<c.length;u++)cC(c[u],l);c.length===2?Lie(s,o,a):s.projectionMatrix.copy(o.projectionMatrix),Nie(e,s,l)}_getController(e){let t=this._controllers[e];return t===void 0&&(t=new c_,this._controllers[e]=t),t}}function Lie(i,e,t){aC.setFromMatrixPosition(e.matrixWorld),lC.setFromMatrixPosition(t.matrixWorld);const n=aC.distanceTo(lC),r=e.projectionMatrix.elements,s=t.projectionMatrix.elements,o=r[14]/(r[10]-1),a=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],u=(r[8]-1)/r[0],p=(s[8]+1)/s[0],m=o*u,g=o*p,v=n/(-u+p),b=v*-u;if(e.matrixWorld.decompose(i.position,i.quaternion,i.scale),i.translateX(b),i.translateZ(v),i.matrixWorld.compose(i.position,i.quaternion,i.scale),i.matrixWorldInverse.copy(i.matrixWorld).invert(),r[10]===-1)i.projectionMatrix.copy(e.projectionMatrix),i.projectionMatrixInverse.copy(e.projectionMatrixInverse);else{const M=o+v,x=a+v,w=m-b,R=g+(n-b),C=l*a/x*M,N=c*a/x*M;i.projectionMatrix.makePerspective(w,R,C,N,M,x),i.projectionMatrixInverse.copy(i.projectionMatrix).invert()}}
3874function cC(i,e){e===null?i.matrixWorld.copy(i.matrix):i.matrixWorld.multiplyMatrices(e.matrixWorld,i.matrix),i.matrixWorldInverse.copy(i.matrixWorld).invert()}function Nie(i,e,t){t===null?i.matrix.copy(e.matrixWorld):(i.matrix.copy(t.matrixWorld),i.matrix.invert(),i.matrix.multiply(e.matrixWorld)),i.matrix.decompose(i.position,i.quaternion,i.scale),i.updateMatrixWorld(!0),i.projectionMatrix.copy(e.projectionMatrix),i.projectionMatrixInverse.copy(e.projectionMatrixInverse),i.isPerspectiveCamera&&(i.fov=sh*2*Math.atan(1/i.projectionMatrix.elements[5]),i.zoom=1)}function Die(i){const e=this._controllerInputSources.indexOf(i.inputSource);if(e===-1)return;const t=this._controllers[e];if(t!==void 0){const n=this.getReferenceSpace();t.update(i.inputSource,i.frame,n),t.dispatchEvent({type:i.type,data:i.inputSource})}}function Iie(){const i=this._session,e=this._renderer;i.removeEventListener("select",this._onSessionEvent),i.removeEventListener("selectstart",this._onSessionEvent),i.removeEventListener("selectend",this._onSessionEvent),i.removeEventListener("squeeze",this._onSessionEvent),i.removeEventListener("squeezestart",this._onSessionEvent),i.removeEventListener("squeezeend",this._onSessionEvent),i.removeEventListener("end",this._onSessionEnd),i.removeEventListener("inputsourceschange",this._onInputSourcesChange);for(let t=0;t<this._controllers.length;t++){const n=this._controllerInputSources[t];n!==null&&(this._controllerInputSources[t]=null,this._controllers[t].disconnect(n))}if(this._currentDepthNear=null,this._currentDepthFar=null,e.backend.setXRTarget(null),e.setOutputRenderTarget(null),e.setRenderTarget(null),this._session=null,this._xrRenderTarget=null,this._supportsLayers===!0)for(const t of this._layers)t.renderTarget=new uA(t.pixelwidth,t.pixelheight,{format:Yi,type:Gi,depthTexture:new $s(t.pixelwidth,t.pixelheight,t.stencilBuffer?xo:mi,void 0,void 0,void 0,void 0,void 0,void 0,t.stencilBuffer?So:bo),stencilBuffer:t.stencilBuffer,resolveDepthBuffer:!1,resolveStencilBuffer:!1}),t.renderTarget.isXRRenderTarget=!1,t.plane.material=t.material,t.material.map=t.renderTarget.texture,delete t.xrlayer;this.isPresenting=!1,this._useMultiview=!1,e._animation.stop(),e._animation.setAnimationLoop(this._currentAnimationLoop),e._animation.setContext(this._currentAnimationContext),e._animation.start(),e.setPixelRatio(this._currentPixelRatio),e.setSize(this._currentSize.width,this._currentSize.height,!1),this.dispatchEvent({type:"sessionend"})}function Bie(i){const e=this._controllers,t=this._controllerInputSources;for(let n=0;n<i.removed.length;n++){const r=i.removed[n],s=t.indexOf(r);s>=0&&(t[s]=null,e[s].disconnect(r))}for(let n=0;n<i.added.length;n++){const r=i.added[n];let s=t.indexOf(r);if(s===-1){for(let a=0;a<e.length;a++)if(a>=t.length){t.push(r),s=a;break}else if(t[a]===null){t[a]=r,s=a;break}if(s===-1)break}const o=e[s];o&&o.connect(r)}}function Fie(i){return i.type==="quad"?this._glBinding.createQuadLayer({transform:new XRRigidTransform(i.translation,i.quaternion),depthFormat:this._gl.DEPTH_COMPONENT,width:i.width/2,height:i.height/2,space:this._referenceSpace,viewPixelWidth:i.pixelwidth,viewPixelHeight:i.pixelheight}):this._glBinding.createCylinderLayer({transform:new XRRigidTransform(i.translation,i.quaternion),depthFormat:this._gl.DEPTH_COMPONENT,radius:i.radius,centralAngle:i.centralAngle,aspectRatio:i.aspectRatio,space:this._referenceSpace,viewPixelWidth:i.pixelwidth,viewPixelHeight:i.pixelheight})}function Uie(i,e){if(e===void 0)return;const t=this._cameraXR,n=this._renderer,r=n.backend,s=this._glBaseLayer,o=this.getReferenceSpace(),a=e.getViewerPose(o);if(this._xrFrame=e,a!==null){const l=a.views;this._glBaseLayer!==null&&r.setXRTarget(s.framebuffer);let c=!1;l.length!==t.cameras.length&&(t.cameras.length=0,c=!0);for(let u=0;u<l.length;u++){const p=l[u];let m;if(this._useLayers===!0){const v=this._glBinding.getViewSubImage(this._glProjLayer,p);m=v.viewport,u===0&&r.setXRRenderTargetTextures(this._xrRenderTarget,v.colorTexture,this._glProjLayer.ignoreDepthValues&&!this._useMultiview?void 0:v.depthStencilTexture)}else m=s.getViewport(p);let g=this._cameras[u];g===void 0&&(g=new Br,g.layers.enable(u),g.viewport=new Jt,this._cameras[u]=g),g.matrix.fromArray(p.transform.matrix),g.matrix.decompose(g.position,g.quaternion,g.scale),g.projectionMatrix.fromArray(p.projectionMatrix),g.projectionMatrixInverse.copy(g.projectionMatrix).invert(),g.viewport.set(m.x,m.y,m.width,m.height),u===0&&(t.matrix.copy(g.matrix),t.matrix.decompose(t.position,t.quaternion,t.scale)),c===!0&&t.cameras.push(g)}
3874n.setOutputRenderTarget(this._xrRenderTarget)}for(let l=0;l<this._controllers.length;l++){const c=this._controllerInputSources[l],u=this._controllers[l];c!==null&&u!==void 0&&u.update(c,e,o)}this._currentAnimationLoop&&this._currentAnimationLoop(i,e),e.detectedPlanes&&this.dispatchEvent({type:"planesdetected",data:e}),this._xrFrame=null}const uC=new N1,lg=new at,xx=new Jt,bx=new Wf,Sx=new $S,cg=new un,lc=new Jt;class Oie{constructor(e,t={}){this.isRenderer=!0;const{logarithmicDepthBuffer:n=!1,alpha:r=!0,depth:s=!0,stencil:o=!1,antialias:a=!1,samples:l=0,getFallback:c=null,colorBufferType:u=dr,multiview:p=!1}=t;this.domElement=e.getDomElement(),this.backend=e,this.samples=l||a===!0?4:0,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.alpha=r,this.logarithmicDepthBuffer=n,this.outputColorSpace=Xt,this.toneMapping=Ws,this.toneMappingExposure=1,this.sortObjects=!0,this.depth=s,this.stencil=o,this.info=new VK,this.overrideNodes={modelViewMatrix:null,modelNormalViewMatrix:null},this.library=new uI,this.lighting=new Cie,this._getFallback=c,this._pixelRatio=1,this._width=this.domElement.width,this._height=this.domElement.height,this._viewport=new Jt(0,0,this._width,this._height),this._scissor=new Jt(0,0,this._width,this._height),this._scissorTest=!1,this._attributes=null,this._geometries=null,this._nodes=null,this._animation=null,this._bindings=null,this._objects=null,this._pipelines=null,this._bundles=null,this._renderLists=null,this._renderContexts=null,this._textures=null,this._background=null,this._quad=new lw(new sr),this._quad.material.name="Renderer_output",this._currentRenderContext=null,this._opaqueSort=null,this._transparentSort=null,this._frameBufferTarget=null;const m=this.alpha===!0?0:1;this._clearColor=new ow(0,0,0,m),this._clearDepth=1,this._clearStencil=0,this._renderTarget=null,this._activeCubeFace=0,this._activeMipmapLevel=0,this._outputRenderTarget=null,this._mrt=null,this._renderObjectFunction=null,this._currentRenderObjectFunction=null,this._currentRenderBundle=null,this._handleObjectFunction=this._renderObjectDirect,this._isDeviceLost=!1,this.onDeviceLost=this._onDeviceLost,this._colorBufferType=u,this._initialized=!1,this._initPromise=null,this._compilationPromises=null,this.transparent=!0,this.opaque=!0,this.shadowMap={enabled:!1,type:_S},this.xr=new Pie(this,p),this.debug={checkShaderErrors:!0,onShaderError:null,getShaderAsync:async(g,v,b)=>{await this.compileAsync(g,v);const M=this._renderLists.get(g,v),x=this._renderContexts.get(g,v,this._renderTarget),w=g.overrideMaterial||b.material,R=this._objects.get(b,w,g,v,M.lightsNode,x,x.clippingContext),{fragmentShader:C,vertexShader:N}=R.getNodeBuilderState();return{fragmentShader:C,vertexShader:N}}}}
3874async init(){if(this._initialized)throw new Error("Renderer: Backend has already been initialized.");return this._initPromise!==null?this._initPromise:(this._initPromise=new Promise(async(e,t)=>{let n=this.backend;try{await n.init(this)}catch(r){if(this._getFallback!==null)try{this.backend=n=this._getFallback(r),await n.init(this)}catch(s){t(s);return}else{t(r);return}}this._nodes=new wie(this,n),this._animation=new NK(this._nodes,this.info),this._attributes=new kK(n),this._background=new qne(this,this._nodes),this._geometries=new zK(this._attributes,this.info),this._textures=new nJ(this,n,this.info),this._pipelines=new WK(n,this._nodes),this._bindings=new $K(n,this._nodes,this._textures,this._attributes,this._pipelines,this.info),this._objects=new FK(this,this._nodes,this._geometries,this._pipelines,this._bindings,this.info),this._renderLists=new YK(this.lighting),this._bundles=new Eie,this._renderContexts=new eJ,this._animation.start(),this._initialized=!0,e(this)}),this._initPromise)}get coordinateSystem(){return this.backend.coordinateSystem}async compileAsync(e,t,n=null){if(this._isDeviceLost===!0)return;this._initialized===!1&&await this.init();const r=this._nodes.nodeFrame,s=r.renderId,o=this._currentRenderContext,a=this._currentRenderObjectFunction,l=this._compilationPromises,c=e.isScene===!0?e:uC;n===null&&(n=e);const u=this._renderTarget,p=this._renderContexts.get(n,t,u),m=this._activeMipmapLevel,g=[];this._currentRenderContext=p,this._currentRenderObjectFunction=this.renderObject,this._handleObjectFunction=this._createObjectPipeline,this._compilationPromises=g,r.renderId++,r.update(
3874),p.depth=this.depth,p.stencil=this.stencil,p.clippingContext||(p.clippingContext=new p1),p.clippingContext.updateGlobal(c,t),c.onBeforeRender(this,e,t,u);const v=this._renderLists.get(e,t);if(v.begin(),this._projectObject(e,t,0,v,p.clippingContext),n!==e&&n.traverseVisible(function(R){R.isLight&&R.layers.test(t.layers)&&v.pushLight(R)}),v.finish(),u!==null){this._textures.updateRenderTarget(u,m);const R=this._textures.get(u);p.textures=R.textures,p.depthTexture=R.depthTexture}else p.textures=null,p.depthTexture=null;this._background.update(c,v,p);const b=v.opaque,M=v.transparent,x=v.transparentDoublePass,w=v.lightsNode;this.opaque===!0&&b.length>0&&this._renderObjects(b,t,c,w),this.transparent===!0&&M.length>0&&this._renderTransparents(M,x,t,c,w),r.renderId=s,this._currentRenderContext=o,this._currentRenderObjectFunction=a,this._compilationPromises=l,this._handleObjectFunction=this._renderObjectDirect,await Promise.all(g)}async renderAsync(e,t){this._initialized===!1&&await this.init(),this._renderScene(e,t)}async waitForGPU(){await this.backend.waitForGPU()}set highPrecision(e){e===!0?(this.overrideNodes.modelViewMatrix=Eb,this.overrideNodes.modelNormalViewMatrix=Rb):this.highPrecision&&(this.overrideNodes.modelViewMatrix=null,this.overrideNodes.modelNormalViewMatrix=null)}get highPrecision(){return this.overrideNodes.modelViewMatrix===Eb&&this.overrideNodes.modelNormalViewMatrix===Rb}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}getColorBufferType(){return this._colorBufferType}_onDeviceLost(e){let t=`THREE.WebGPURenderer: ${e.api} Device Lost:
3875
3876Message: ${e.message}`;e.reason&&(t+=`
3877Reason: ${e.reason}`),console.error(t),this._isDeviceLost=!0}_renderBundle(e,t,n){const{bundleGroup:r,camera:s,renderList:o}=e,a=this._currentRenderContext,l=this._bundles.get(r,s),c=this.backend.get(l);c.renderContexts===void 0&&(c.renderContexts=new Set);const u=r.version!==c.version,p=c.renderContexts.has(a)===!1||u;if(c.renderContexts.add(a),p){this.backend.beginBundle(a),(c.renderObjects===void 0||u)&&(c.renderObjects=[]),this._currentRenderBundle=l;const{transparentDoublePass:m,transparent:g,opaque:v}=o;this.opaque===!0&&v.length>0&&this._renderObjects(v,s,t,n),this.transparent===!0&&g.length>0&&this._renderTransparents(g,m,s,t,n),this._currentRenderBundle=null,this.backend.finishBundle(a,l),c.version=r.version}else{const{renderObjects:m}=c;for(let g=0,v=m.length;g<v;g++){const b=m[g];this._nodes.needsRefresh(b)&&(this._nodes.updateBefore(b),this._nodes.updateForRender(b),this._bindings.updateForRender(b),this._nodes.updateAfter(b))}}this.backend.addBundle(a,l)}render(e,t){if(this._initialized===!1)return console.warn("THREE.Renderer: .render() called before the backend is initialized. Try using .renderAsync() instead."),this.renderAsync(e,t);this._renderScene(e,t)}_getFrameBufferTarget(){const{currentToneMapping:e,currentColorSpace:t}=this;if(e!==Ws===!1&&t!==ha===!1)return null;const{width:s,height:o}=this.getDrawingBufferSize(lg),{depth:a,stencil:l}=this;let c=this._frameBufferTarget;c===null&&(c=new rl(s,o,{depthBuffer:a,stencilBuffer:l,type:this._colorBufferType,format:Yi,colorSpace:ha,generateMipmaps:!1,minFilter:xr,magFilter:xr,samples:this.samples}),c.isPostProcessingRenderTarget=!0,this._frameBufferTarget=c);const u=this.getOutputRenderTarget();return c.depthBuffer=a,c.stencilBuffer=l,c.setSize(s,o,u!==null?u.depth:1),c.viewport.copy(this._viewport),c.scissor.copy(this._scissor),c.viewport.multiplyScalar(this._pixelRatio),c.scissor.multiplyScalar(this._pixelRatio),c.scissorTest=this._scissorTest,c.multiview=u!==null?u.multiview:!1,c}_renderScene(e,t,n=!0){if(this._isDeviceLost===!0)return;
3877const r=n?this._getFrameBufferTarget():null,s=this._nodes.nodeFrame,o=s.renderId,a=this._currentRenderContext,l=this._currentRenderObjectFunction,c=e.isScene===!0?e:uC,u=this._renderTarget||this._outputRenderTarget,p=this._activeCubeFace,m=this._activeMipmapLevel;let g;r!==null?(g=r,this.setRenderTarget(g)):g=u;const v=this._renderContexts.get(e,t,g);this._currentRenderContext=v,this._currentRenderObjectFunction=this._renderObjectFunction||this.renderObject,this.info.calls++,this.info.render.calls++,this.info.render.frameCalls++,s.renderId=this.info.calls;const b=this.coordinateSystem,M=this.xr;if(t.coordinateSystem!==b&&M.isPresenting===!1&&(t.coordinateSystem=b,t.updateProjectionMatrix(),t.isArrayCamera))for(const W of t.cameras)W.coordinateSystem=b,W.updateProjectionMatrix();e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.matrixWorldAutoUpdate===!0&&t.updateMatrixWorld(),M.enabled===!0&&M.isPresenting===!0&&(M.cameraAutoUpdate===!0&&M.updateCamera(t),t=M.getCamera());let x=this._viewport,w=this._scissor,R=this._pixelRatio;g!==null&&(x=g.viewport,w=g.scissor,R=1),this.getDrawingBufferSize(lg),xx.set(0,0,lg.width,lg.height);const C=x.minDepth===void 0?0:x.minDepth,N=x.maxDepth===void 0?1:x.maxDepth;v.viewportValue.copy(x).multiplyScalar(R).floor(),v.viewportValue.width>>=m,v.viewportValue.height>>=m,v.viewportValue.minDepth=C,v.viewportValue.maxDepth=N,v.viewport=v.viewportValue.equals(xx)===!1,v.scissorValue.copy(w).multiplyScalar(R).floor(),v.scissor=this._scissorTest&&v.scissorValue.equals(xx)===!1,v.scissorValue.width>>=m,v.scissorValue.height>>=m,v.clippingContext||(v.clippingContext=new p1),v.clippingContext.updateGlobal(c,t),c.onBeforeRender(this,e,t,g);const D=t.isArrayCamera?Sx:bx;t.isArrayCamera||(cg.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),D.setFromProjectionMatrix(cg,b));const P=this._renderLists.get(e,t);if(P.begin(),this._projectObject(e,t,0,P,v.clippingContext),P.finish(),this.sortObjects===!0&&P.sort(this._opaqueSort,this._transparentSort),g!==null){this._textures.updateRenderTarget(g,m);const W=this._textures.get(g);v.textures=W.textures,v.depthTexture=W.depthTexture,v.width=W.width,v.height=W.height,v.renderTarget=g,v.depth=g.depthBuffer,v.stencil=g.stencilBuffer}else v.textures=null,v.depthTexture=null,v.width=this.domElement.width,v.height=this.domElement.height,v.depth=this.depth,v.stencil=this.stencil;v.width>>=m,v.height>>=m,v.activeCubeFace=p,v.activeMipmapLevel=m,v.occlusionQueryCount=P.occlusionQueryCount,this._background.update(c,P,v),v.camera=t,this.backend.beginRender(v);const{bundles:O,lightsNode:I,transparentDoublePass:F,transparent:k,opaque:Y}=P;return O.length>0&&this._renderBundles(O,c,I),this.opaque===!0&&Y.length>0&&this._renderObjects(Y,t,c,I),this.transparent===!0&&k.length>0&&this._renderTransparents(k,F,t,c,I),this.backend.finishRender(v),s.renderId=o,this._currentRenderContext=a,this._currentRenderObjectFunction=l,r!==null&&(this.setRenderTarget(u,p,m),this._renderOutput(g)),c.onAfterRender(this,e,t,g),v}_renderOutput(e){const t=this._quad;this._nodes.hasOutputChange(e.texture)&&(t.material.fragmentNode=this._nodes.getOutputNode(e.texture),t.material.needsUpdate=!0);const n=this.autoClear,r=this.xr.enabled;this.autoClear=!1,this.xr.enabled=!1,this._renderScene(t,t.camera,!1),this.autoClear=n,this.xr.enabled=r}getMaxAnisotropy(){return this.backend.getMaxAnisotropy()}getActiveCubeFace(){return this._activeCubeFace}getActiveMipmapLevel(){return this._activeMipmapLevel}async setAnimationLoop(e){this._initialized===!1&&await this.init(),this._animation.setAnimationLoop(e)}async getArrayBufferAsync(e){return await this.backend.getArrayBufferAsync(e)}getContext(){return this.backend.getContext()}getPixelRatio(){return this._pixelRatio}getDrawingBufferSize(e){return e.set(this._width*this._pixelRatio,this._height*this._pixelRatio).floor()}getSize(e){return e.set(this._width,this._height)}setPixelRatio(e=1){this._pixelRatio!==e&&(this._pixelRatio=e,this.setSize(this._width,this._height,!1))}setDrawingBufferSize(e,t,n){this.xr&&this.xr.isPresenting||(this._width=e,this._height=t,this._pixelRatio=n,this.domElement.width=Math.floor(e*n),this.domElement.height=Math.floor(t*n),this.setViewport(0,0,e,t),this._initialized&&this.backend.updateSize())}setSize(e,t,n=!0){this.xr&&this.xr.isPresenting||(this._width=e,this._height=t,this.domElement.width=Math.floor(e*this._pixelRatio),this.domElement.height=Math.floor(t*this._pixelRatio),n===!0&&(this.domElement.style.width=e+"px",this.domElement.style.height=t+"px"),this.setViewport(0,0,e,t),this._initialized&&this.backend.updateSize())}setOpaqueSort(e){this._opaqueSort=e}setTransparentSort(e){this._transparentSort=e}getScissor(e){const t=this._scissor;return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e}setScissor(e,t,n,r){const s=this._scissor;e.isVector4?s.copy(e):s.set(e,t,n,r)}getScissorTest(){return this._scissorTest}setScissorTest(e){this._scissorTest=e,this.backend.setScissorTest(e)}getViewport(e){return e.copy(this._viewport)}setViewport(e,t,n,r,s=0,o=1){const a=this._viewport;e.isVector4?a.copy(e):a.set(e,t,n,r),a.minDepth=s,a.maxDepth=o}getClearColor(e){return e.copy(this._clearColor)}
3877setClearColor(e,t=1){this._clearColor.set(e),this._clearColor.a=t}getClearAlpha(){return this._clearColor.a}setClearAlpha(e){this._clearColor.a=e}getClearDepth(){return this._clearDepth}setClearDepth(e){this._clearDepth=e}getClearStencil(){return this._clearStencil}setClearStencil(e){this._clearStencil=e}isOccluded(e){const t=this._currentRenderContext;return t&&this.backend.isOccluded(t,e)}clear(e=!0,t=!0,n=!0){if(this._initialized===!1)return console.warn("THREE.Renderer: .clear() called before the backend is initialized. Try using .clearAsync() instead."),this.clearAsync(e,t,n);const r=this._renderTarget||this._getFrameBufferTarget();let s=null;if(r!==null){this._textures.updateRenderTarget(r);const o=this._textures.get(r);s=this._renderContexts.getForClear(r),s.textures=o.textures,s.depthTexture=o.depthTexture,s.width=o.width,s.height=o.height,s.renderTarget=r,s.depth=r.depthBuffer,s.stencil=r.stencilBuffer,s.clearColorValue=this.backend.getClearColor(),s.activeCubeFace=this.getActiveCubeFace(),s.activeMipmapLevel=this.getActiveMipmapLevel()}this.backend.clear(e,t,n,s),r!==null&&this._renderTarget===null&&this._renderOutput(r)}clearColor(){return this.clear(!0,!1,!1)}clearDepth(){return this.clear(!1,!0,!1)}clearStencil(){return this.clear(!1,!1,!0)}async clearAsync(e=!0,t=!0,n=!0){this._initialized===!1&&await this.init(),this.clear(e,t,n)}async clearColorAsync(){this.clearAsync(!0,!1,!1)}async clearDepthAsync(){this.clearAsync(!1,!0,!1)}async clearStencilAsync(){this.clearAsync(!1,!1,!0)}get currentToneMapping(){return this.isOutputTarget?this.toneMapping:Ws}get currentColorSpace(){return this.isOutputTarget?this.outputColorSpace:ha}get isOutputTarget(){return this._renderTarget===this._outputRenderTarget||this._renderTarget===null}dispose(){this.info.dispose(),this.backend.dispose(),this._animation.dispose(),this._objects.dispose(),this._pipelines.dispose(),this._nodes.dispose(),this._bindings.dispose(),this._renderLists.dispose(),this._renderContexts.dispose(),this._textures.dispose(),this._frameBufferTarget!==null&&this._frameBufferTarget.dispose(),Object.values(this.backend.timestampQueryPool).forEach(e=>{e!==null&&e.dispose()}),this.setRenderTarget(null),this.setAnimationLoop(null)}setRenderTarget(e,t=0,n=0){this._renderTarget=e,this._activeCubeFace=t,this._activeMipmapLevel=n}getRenderTarget(){return this._renderTarget}setOutputRenderTarget(e){this._outputRenderTarget=e}getOutputRenderTarget(){return this._outputRenderTarget}setRenderObjectFunction(e){this._renderObjectFunction=e}getRenderObjectFunction(){return this._renderObjectFunction}compute(e){if(this._isDeviceLost===!0)return;if(this._initialized===!1)return console.warn("THREE.Renderer: .compute() called before the backend is initialized. Try using .computeAsync() instead."),this.computeAsync(e);const t=this._nodes.nodeFrame,n=t.renderId;this.info.calls++,this.info.compute.calls++,this.info.compute.frameCalls++,t.renderId=this.info.calls;const r=this.backend,s=this._pipelines,o=this._bindings,a=this._nodes,l=Array.isArray(e)?e:[e];if(l[0]===void 0||l[0].isComputeNode!==!0)throw new Error("THREE.Renderer: .compute() expects a ComputeNode.");r.beginCompute(e);for(const c of l){if(s.has(c)===!1){const m=()=>{c.removeEventListener("dispose",m),s.delete(c),o.delete(c),a.delete(c)};c.addEventListener("dispose",m);const g=c.onInitFunction;g!==null&&g.call(c,{renderer:this})}a.updateForCompute(c),o.updateForCompute(c);const u=o.getForCompute(c),p=s.getForCompute(c,u);r.compute(e,c,u,p)}r.finishCompute(e),t.renderId=n}async computeAsync(e){this._initialized===!1&&await this.init(),this.compute(e)}async hasFeatureAsync(e){return this._initialized===!1&&await this.init(),this.backend.hasFeature(e)}async resolveTimestampsAsync(e="render"){return this._initialized===!1&&await this.init(),this.backend.resolveTimestampsAsync(e)}hasFeature(e){return this._initialized===!1?(console.warn("THREE.Renderer: .hasFeature() called before the backend is initialized. Try using .hasFeatureAsync() instead."),!1):this.backend.hasFeature(e)}hasInitialized(){return this._initialized}async initTextureAsync(e){this._initialized===!1&&await this.init(),this._textures.updateTexture(e)}initTexture(e){this._initialized===!1&&console.warn("THREE.Renderer: .initTexture() called before the backend is initialized. Try using .initTextureAsync() instead."),this._textures.updateTexture(e)}
3877copyFramebufferToTexture(e,t=null){if(t!==null)if(t.isVector2)t=lc.set(t.x,t.y,e.image.width,e.image.height).floor();else if(t.isVector4)t=lc.copy(t).floor();else{console.error("THREE.Renderer.copyFramebufferToTexture: Invalid rectangle.");return}else t=lc.set(0,0,e.image.width,e.image.height);let n=this._currentRenderContext,r;n!==null?r=n.renderTarget:(r=this._renderTarget||this._getFrameBufferTarget(),r!==null&&(this._textures.updateRenderTarget(r),n=this._textures.get(r))),this._textures.updateTexture(e,{renderTarget:r}),this.backend.copyFramebufferToTexture(e,n,t)}copyTextureToTexture(e,t,n=null,r=null,s=0,o=0){this._textures.updateTexture(e),this._textures.updateTexture(t),this.backend.copyTextureToTexture(e,t,n,r,s,o)}async readRenderTargetPixelsAsync(e,t,n,r,s,o=0,a=0){return this.backend.copyTextureToBuffer(e.textures[o],t,n,r,s,a)}_projectObject(e,t,n,r,s){if(e.visible===!1)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder,e.isClippingGroup&&e.enabled&&(s=s.getGroupContext(e));else if(e.isLOD)e.autoUpdate===!0&&e.update(t);else if(e.isLight)r.pushLight(e);else if(e.isSprite){const l=t.isArrayCamera?Sx:bx;if(!e.frustumCulled||l.intersectsSprite(e,t)){this.sortObjects===!0&&lc.setFromMatrixPosition(e.matrixWorld).applyMatrix4(cg);const{geometry:c,material:u}=e;u.visible&&r.push(e,c,u,n,lc.z,null,s)}}else if(e.isLineLoop)console.error("THREE.Renderer: Objects of type THREE.LineLoop are not supported. Please use THREE.Line or THREE.LineSegments.");else if(e.isMesh||e.isLine||e.isPoints){const l=t.isArrayCamera?Sx:bx;if(!e.frustumCulled||l.intersectsObject(e,t)){const{geometry:c,material:u}=e;if(this.sortObjects===!0&&(c.boundingSphere===null&&c.computeBoundingSphere(),lc.copy(c.boundingSphere.center).applyMatrix4(e.matrixWorld).applyMatrix4(cg)),Array.isArray(u)){const p=c.groups;for(let m=0,g=p.length;m<g;m++){const v=p[m],b=u[v.materialIndex];b&&b.visible&&r.push(e,c,b,n,lc.z,v,s)}}else u.visible&&r.push(e,c,u,n,lc.z,null,s)}}}if(e.isBundleGroup===!0&&this.backend.beginBundle!==void 0){const l=r;r=this._renderLists.get(e,t),r.begin(),l.pushBundle({bundleGroup:e,camera:t,renderList:r}),r.finish()}const a=e.children;for(let l=0,c=a.length;l<c;l++)this._projectObject(a[l],t,n,r,s)}_renderBundles(e,t,n){for(const r of e)this._renderBundle(r,t,n)}_renderTransparents(e,t,n,r,s){if(t.length>0){for(const{material:o}of t)o.side=oi;this._renderObjects(t,n,r,s,"backSide");for(const{material:o}of t)o.side=qs;this._renderObjects(e,n,r,s);for(const{material:o}of t)o.side=ur}else this._renderObjects(e,n,r,s)}_renderObjects(e,t,n,r,s=null){for(let o=0,a=e.length;o<a;o++){const{object:l,geometry:c,material:u,group:p,clippingContext:m}=e[o];this._currentRenderObjectFunction(l,n,t,c,u,p,r,m,s)}}renderObject(e,t,n,r,s,o,a,l=null,c=null){let u,p,m;if(e.onBeforeRender(this,t,n,r,s,o),s.allowOverride===!0&&t.overrideMaterial!==null){const g=t.overrideMaterial;s.positionNode&&s.positionNode.isNode&&(u=g.positionNode,g.positionNode=s.positionNode),g.alphaTest=s.alphaTest,g.alphaMap=s.alphaMap,g.transparent=s.transparent||s.transmission>0,g.isShadowPassMaterial&&(g.side=s.shadowSide===null?s.side:s.shadowSide,s.depthNode&&s.depthNode.isNode&&(m=g.depthNode,g.depthNode=s.depthNode),s.castShadowNode&&s.castShadowNode.isNode&&(p=g.colorNode,g.colorNode=s.castShadowNode),s.castShadowPositionNode&&s.castShadowPositionNode.isNode&&(u=g.positionNode,g.positionNode=s.castShadowPositionNode)),s=g}s.transparent===!0&&s.side===ur&&s.forceSinglePass===!1?(s.side=oi,this._handleObjectFunction(e,s,t,n,a,o,l,"backSide"),s.side=qs,this._handleObjectFunction(e,s,t,n,a,o,l,c),s.side=ur):this._handleObjectFunction(e,s,t,n,a,o,l,c),u!==void 0&&(t.overrideMaterial.positionNode=u),m!==void 0&&(t.overrideMaterial.depthNode=m),p!==void 0&&(t.overrideMaterial.colorNode=p),e.onAfterRender(this,t,n,r,s,o)}_renderObjectDirect(e,t,n,r,s,o,a,l){const c=this._objects.get(e,t,n,r,s,this._currentRenderContext,a,l);c.drawRange=e.geometry.drawRange,c.group=o;const u=this._nodes.needsRefresh(c);u&&(this._nodes.updateBefore(c),this._geometries.updateForRender(c),this._nodes.updateForRender(c),this._bindings.updateForRender(c)),this._pipelines.updateForRender(c),this._currentRenderBundle!==null&&(this.backend.get(this._currentRenderBundle).renderObjects.push(c),c.bundle=this._currentRenderBundle.bundleGroup),this.backend.draw(c,this.info),u&&this._nodes.updateAfter(c)}_createObjectPipeline(e,t,n,r,s,o,a,l){const c=this._objects.get(e,t,n,r,s,this._currentRenderContext,a,l);c.drawRange=e.geometry.drawRange,c.group=o,this._nodes.updateBefore(c),this._geometries.updateForRender(c),this._nodes.updateForRender(c),this._bindings.updateForRender(c),this._pipelines.getForRender(c,this._compilationPromises),this._nodes.updateAfter(c)}get compile(){return this.compileAsync}}class Mw{constructor(e=""){this.name=e,this.visibility=0}setVisibility(e){this.visibility|=e}clone(){return Object.assign(new this.constructor,this)}}function kie(i){return i+(Tc-i%Tc)%Tc}class hI extends Mw{constructor(e,t=null){super(e),this.isBuffer=!0,this.bytesPerElement=Float32Array.BYTES_PER_ELEMENT,this._buffer=t}get byteLength(){return kie(this._buffer.byteLength)}get buffer(){return this._buffer}update(){return!0}}class dI extends hI{constructor(e,t=null){super(e,t),this.isUniformBuffer=!0}}let zie=0;class fI extends dI{constructor(e,t){super("UniformBuffer_"+zie++,e?e.value:null),this.nodeUniform=e,this.groupNode=t}get buffer(){return this.nodeUniform.value}}class Vie extends dI{constructor(e){super(e),this.isUniformsGroup=!0,this._values=null,this.uniforms=[]}addUniform(e){return this.uniforms.push(e),this}removeUniform(e){const t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}get values(){return this._values===null&&(this._values=Array.from(this.buffer)),this._values}get buffer(){let e=this._buffer;if(e===null){const t=this.byteLength;
3877e=new Float32Array(new ArrayBuffer(t)),this._buffer=e}return e}get byteLength(){let e=0;for(let t=0,n=this.uniforms.length;t<n;t++){const r=this.uniforms[t],{boundary:s,itemSize:o}=r,a=e%Tc,l=Tc-a;a!==0&&l-s<0?e+=Tc-a:a%s!==0&&(e+=a%s),r.offset=e/this.bytesPerElement,e+=o*this.bytesPerElement}return Math.ceil(e/Tc)*Tc}update(){let e=!1;for(const t of this.uniforms)this.updateByType(t)===!0&&(e=!0);return e}updateByType(e){if(e.isNumberUniform)return this.updateNumber(e);if(e.isVector2Uniform)return this.updateVector2(e);if(e.isVector3Uniform)return this.updateVector3(e);if(e.isVector4Uniform)return this.updateVector4(e);if(e.isColorUniform)return this.updateColor(e);if(e.isMatrix3Uniform)return this.updateMatrix3(e);if(e.isMatrix4Uniform)return this.updateMatrix4(e);console.error("THREE.WebGPUUniformsGroup: Unsupported uniform type.",e)}updateNumber(e){let t=!1;const n=this.values,r=e.getValue(),s=e.offset,o=e.getType();if(n[s]!==r){const a=this._getBufferForType(o);a[s]=n[s]=r,t=!0}return t}updateVector2(e){let t=!1;const n=this.values,r=e.getValue(),s=e.offset,o=e.getType();if(n[s+0]!==r.x||n[s+1]!==r.y){const a=this._getBufferForType(o);a[s+0]=n[s+0]=r.x,a[s+1]=n[s+1]=r.y,t=!0}return t}updateVector3(e){let t=!1;const n=this.values,r=e.getValue(),s=e.offset,o=e.getType();if(n[s+0]!==r.x||n[s+1]!==r.y||n[s+2]!==r.z){const a=this._getBufferForType(o);a[s+0]=n[s+0]=r.x,a[s+1]=n[s+1]=r.y,a[s+2]=n[s+2]=r.z,t=!0}return t}updateVector4(e){let t=!1;const n=this.values,r=e.getValue(),s=e.offset,o=e.getType();if(n[s+0]!==r.x||n[s+1]!==r.y||n[s+2]!==r.z||n[s+4]!==r.w){const a=this._getBufferForType(o);a[s+0]=n[s+0]=r.x,a[s+1]=n[s+1]=r.y,a[s+2]=n[s+2]=r.z,a[s+3]=n[s+3]=r.w,t=!0}return t}updateColor(e){let t=!1;const n=this.values,r=e.getValue(),s=e.offset;if(n[s+0]!==r.r||n[s+1]!==r.g||n[s+2]!==r.b){const o=this.buffer;o[s+0]=n[s+0]=r.r,o[s+1]=n[s+1]=r.g,o[s+2]=n[s+2]=r.b,t=!0}return t}updateMatrix3(e){let t=!1;const n=this.values,r=e.getValue().elements,s=e.offset;if(n[s+0]!==r[0]||n[s+1]!==r[1]||n[s+2]!==r[2]||n[s+4]!==r[3]||n[s+5]!==r[4]||n[s+6]!==r[5]||n[s+8]!==r[6]||n[s+9]!==r[7]||n[s+10]!==r[8]){const o=this.buffer;o[s+0]=n[s+0]=r[0],o[s+1]=n[s+1]=r[1],o[s+2]=n[s+2]=r[2],o[s+4]=n[s+4]=r[3],o[s+5]=n[s+5]=r[4],o[s+6]=n[s+6]=r[5],o[s+8]=n[s+8]=r[6],o[s+9]=n[s+9]=r[7],o[s+10]=n[s+10]=r[8],t=!0}return t}updateMatrix4(e){let t=!1;const n=this.values,r=e.getValue().elements,s=e.offset;return qie(n,r,s)===!1&&(this.buffer.set(r,s),Gie(n,r,s),t=!0),t}_getBufferForType(e){return e==="int"||e==="ivec2"||e==="ivec3"||e==="ivec4"?new Int32Array(this.buffer.buffer):e==="uint"||e==="uvec2"||e==="uvec3"||e==="uvec4"?new Uint32Array(this.buffer.buffer):this.buffer}}function Gie(i,e,t){for(let n=0,r=e.length;n<r;n++)i[t+n]=e[n]}function qie(i,e,t){for(let n=0,r=e.length;n<r;n++)if(i[t+n]!==e[n])return!1;return!0}let Hie=0;class pI extends Vie{constructor(e,t){super(e),this.id=Hie++,this.groupNode=t,this.isNodeUniformsGroup=!0}}let Wie=0;class $ie extends Mw{constructor(e,t){super(e),this.id=Wie++,this.texture=t,this.version=t?t.version:0,this.store=!1,this.generation=null,this.isSampledTexture=!0}needsBindingsUpdate(e){const{texture:t}=this;return e!==this.generation?(this.generation=e,!0):t.isVideoTexture}update(){const{texture:e,version:t}=this;return t!==e.version?(this.version=e.version,!0):!1}}class fv extends $ie{constructor(e,t,n,r=null){super(e,t?t.value:null),this.textureNode=t,this.groupNode=n,this.access=r}needsBindingsUpdate(e){return this.textureNode.value!==this.texture||super.needsBindingsUpdate(e)}update(){const{textureNode:e}=this;return this.texture!==e.value?(this.texture=e.value,!0):super.update()}}class AI extends fv{constructor(e,t,n,r=null){super(e,t,n,r),this.isSampledCubeTexture=!0}}class mI extends fv{constructor(e,t,n,r=null){super(e,t,n,r),this.isSampledTexture3D=!0}}const jie={textureDimensions:"textureSize",equals:"equal"},Xie={low:"lowp",medium:"mediump",high:"highp"},hC={swizzleAssign:!0,storageBuffer:!1},dC={perspective:"smooth",linear:"noperspective"},fC={centroid:"centroid","flat first":"flat","flat either":"flat"},pC=`
3878precision highp float;
3879precision highp int;
3880precision highp sampler2D;
3881precision highp sampler3D;
3882precision highp samplerCube;
3883precision highp sampler2DArray;
3884
3885precision highp usampler2D;
3886precision highp usampler3D;
3887precision highp usamplerCube;
3888precision highp usampler2DArray;
3889
3890precision highp isampler2D;
3891precision highp isampler3D;
3892precision highp isamplerCube;
3893precision highp isampler2DArray;
3894
3895precision lowp sampler2DShadow;
3896precision lowp sampler2DArrayShadow;
3897precision lowp samplerCubeShadow;
3898`;class Yie extends aI{constructor(e,t){super(e,t,new Mie),this.uniformGroups={},this.transforms=[],this.extensions={},this.builtins={vertex:[],fragment:[],compute:[]}}needsToWorkingColorSpace(e){return e.isVideoTexture===!0&&e.colorSpace!==vo}getMethod(e){return jie[e]||e}getOutputStructName(){return""}buildFunctionCode(e){const t=e.layout,n=this.flowShaderNode(e),r=[];
3898for(const o of t.inputs)r.push(this.getType(o.type)+" "+o.name);return`${this.getType(t.type)} ${t.name}( ${r.join(", ")} ) {
3899
3900	${n.vars}
3901
3902${n.code}
3903	return ${n.result};
3904
3905}`}setupPBO(e){const t=e.value;if(t.pbo===void 0){const n=t.array,r=t.count*t.itemSize,{itemSize:s}=t,o=t.array.constructor.name.toLowerCase().includes("int");let a=o?Vf:C0;s===2?a=o?Gf:Nl:s===3?a=o?yO:R0:s===4&&(a=o?qf:Yi);const l={Float32Array:er,Uint8Array:Gi,Uint16Array:la,Uint32Array:mi,Int8Array:Gu,Int16Array:qu,Int32Array:Ir,Uint8ClampedArray:Gi},c=Math.pow(2,Math.ceil(Math.log2(Math.sqrt(r/s))));let u=Math.ceil(r/s/c);c*u*s<r&&u++;const p=c*u*s,m=new n.constructor(p);m.set(n,0),t.array=m;const g=new T9(t.array,c,u,a,l[t.array.constructor.name]||er);g.needsUpdate=!0,g.isPBOTexture=!0;const v=new Ka(g,null,null);v.setPrecision("high"),t.pboNode=v,t.pbo=v.value,this.getUniformFromNode(t.pboNode,"texture",this.shaderStage,this.context.label)}}getPropertyName(e,t=this.shaderStage){return e.isNodeUniform&&e.node.isTextureNode!==!0&&e.node.isBufferNode!==!0?t.charAt(0)+"_"+e.name:super.getPropertyName(e,t)}generatePBO(e){const{node:t,indexNode:n}=e,r=t.value;if(this.renderer.backend.has(r)){const u=this.renderer.backend.get(r);u.pbo=r.pbo}const s=this.getUniformFromNode(r.pboNode,"texture",this.shaderStage,this.context.label),o=this.getPropertyName(s);this.increaseUsage(n);const a=n.build(this,"uint"),l=this.getDataFromNode(e);let c=l.propertyName;if(c===void 0){const u=this.getVarFromNode(e);c=this.getPropertyName(u);const p=this.getDataFromNode(t);let m=p.propertySizeName;m===void 0&&(m=c+"Size",this.getVarFromNode(t,m,"uint"),this.addLineFlowCode(`${m} = uint( textureSize( ${o}, 0 ).x )`,e),p.propertySizeName=m);const{itemSize:g}=r,v="."+fh.join("").slice(0,g),b=`ivec2(${a} % ${m}, ${a} / ${m})`,M=this.generateTextureLoad(null,o,b,null,"0");let x="vec4";r.pbo.type===mi?x="uvec4":r.pbo.type===Ir&&(x="ivec4"),this.addLineFlowCode(`${c} = ${x}(${M})${v}`,e),l.propertyName=c}return c}generateTextureLoad(e,t,n,r,s="0"){return r?`texelFetch( ${t}, ivec3( ${n}, ${r} ), ${s} )`:`texelFetch( ${t}, ${n}, ${s} )`}generateTexture(e,t,n,r){return e.isDepthTexture?(r&&(n=`vec4( ${n}, ${r} )`),`texture( ${t}, ${n} ).x`):(r&&(n=`vec3( ${n}, ${r} )`),`texture( ${t}, ${n} )`)}generateTextureLevel(e,t,n,r){return`textureLod( ${t}, ${n}, ${r} )`}generateTextureBias(e,t,n,r){return`texture( ${t}, ${n}, ${r} )`}generateTextureGrad(e,t,n,r){return`textureGrad( ${t}, ${n}, ${r[0]}, ${r[1]} )`}generateTextureCompare(e,t,n,r,s,o=this.shaderStage){if(o==="fragment")return s?`texture( ${t}, vec4( ${n}, ${s}, ${r} ) )`:`texture( ${t}, vec3( ${n}, ${r} ) )`;console.error(`WebGPURenderer: THREE.DepthTexture.compareFunction() does not support ${o} shader.`)}getVars(e){const t=[],n=this.vars[e];if(n!==void 0)for(const r of n)t.push(`${this.getVar(r.type,r.name,r.count)};`);return t.join(`
3906	`)}getUniforms(e){const t=this.uniforms[e],n=[],r={};for(const o of t){let a=null,l=!1;if(o.type==="texture"||o.type==="texture3D"){const u=o.node.value;let p="";(u.isDataTexture===!0||u.isData3DTexture===!0)&&(u.type===mi?p="u":u.type===Ir&&(p="i")),o.type==="texture3D"&&u.isTextureArray===!1?a=`${p}sampler3D ${o.name};`:u.compareFunction?u.isDepthArrayTexture===!0?a=`sampler2DArrayShadow ${o.name};`:a=`sampler2DShadow ${o.name};`:u.isDataArrayTexture===!0||u.isCompressedArrayTexture===!0||u.isTextureArray===!0?a=`${p}sampler2DArray ${o.name};`:a=`${p}sampler2D ${o.name};`}else if(o.type==="cubeTexture")a=`samplerCube ${o.name};`;else if(o.type==="buffer"){const u=o.node,p=this.getType(u.bufferType),m=u.bufferCount,g=m>0?m:"";a=`${u.name} {
3907	${p} ${o.name}[${g}];
3908};
3909`}else a=`${this.getVectorType(o.type)} ${this.getPropertyName(o,e)};`,l=!0;const c=o.node.precision;if(c!==null&&(a=Xie[c]+" "+a),l){a="	"+a;const u=o.groupNode.name;(r[u]||(r[u]=[])).push(a)}else a="uniform "+a,n.push(a)}let s="";for(const o in r){const a=r[o];s+=this._getGLSLUniformStruct(e+"_"+o,a.join(`
3910`))+`
3911`}return s+=n.join(`
3912`),s}getTypeFromAttribute(e){let t=super.getTypeFromAttribute(e);if(/^[iu]/.test(t)&&e.gpuType!==Ir){let n=e;e.isInterleavedBufferAttribute&&(n=e.data);const r=n.array;
3912r instanceof Uint32Array||r instanceof Int32Array||(t=t.slice(1))}return t}getAttributes(e){let t="";if(e==="vertex"||e==="compute"){const n=this.getAttributesArray();let r=0;for(const s of n)t+=`layout( location = ${r++} ) in ${s.type} ${s.name};
3913`}return t}getStructMembers(e){const t=[];for(const n of e.members)t.push(`	${n.type} ${n.name};`);return t.join(`
3914`)}getStructs(e){const t=[],n=this.structs[e],r=[];for(const s of n)if(s.output)for(const o of s.members)r.push(`layout( location = ${o.index} ) out ${o.type} ${o.name};`);else{let o="struct "+s.name+` {
3915`;o+=this.getStructMembers(s),o+=`
3916};
3917`,t.push(o)}return r.length===0&&r.push("layout( location = 0 ) out vec4 fragColor;"),`
3918`+r.join(`
3919`)+`
3920
3921`+t.join(`
3922`)}getVaryings(e){let t="";const n=this.varyings;if(e==="vertex"||e==="compute")for(const r of n){e==="compute"&&(r.needsInterpolation=!0);const s=this.getType(r.type);if(r.needsInterpolation)if(r.interpolationType){const o=dC[r.interpolationType]||r.interpolationType,a=fC[r.interpolationSampling]||"";t+=`${o} ${a} out ${s} ${r.name};
3923`}else{const o=s.includes("int")||s.includes("uv")||s.includes("iv")?"flat ":"";t+=`${o}out ${s} ${r.name};
3924`}else t+=`${s} ${r.name};
3925`}else if(e==="fragment"){for(const r of n)if(r.needsInterpolation){const s=this.getType(r.type);if(r.interpolationType){const o=dC[r.interpolationType]||r.interpolationType,a=fC[r.interpolationSampling]||"";t+=`${o} ${a} in ${s} ${r.name};
3926`}else{const o=s.includes("int")||s.includes("uv")||s.includes("iv")?"flat ":"";t+=`${o}in ${s} ${r.name};
3927`}}}for(const r of this.builtins[e])t+=`${r};
3928`;return t}getVertexIndex(){return"uint( gl_VertexID )"}getInstanceIndex(){return"uint( gl_InstanceID )"}getInvocationLocalIndex(){return`uint( gl_InstanceID ) % ${this.object.workgroupSize.reduce((n,r)=>n*r,1)}u`}getDrawIndex(){return this.renderer.backend.extensions.has("WEBGL_multi_draw")?"uint( gl_DrawID )":null}getFrontFacing(){return"gl_FrontFacing"}getFragCoord(){return"gl_FragCoord.xy"}getFragDepth(){return"gl_FragDepth"}enableExtension(e,t,n=this.shaderStage){const r=this.extensions[n]||(this.extensions[n]=new Map);r.has(e)===!1&&r.set(e,{name:e,behavior:t})}getExtensions(e){const t=[];if(e==="vertex"){const r=this.renderer.backend.extensions;this.object.isBatchedMesh&&r.has("WEBGL_multi_draw")&&this.enableExtension("GL_ANGLE_multi_draw","require",e)}const n=this.extensions[e];if(n!==void 0)for(const{name:r,behavior:s}of n.values())t.push(`#extension ${r} : ${s}`);return t.join(`
3929`)}getClipDistance(){return"gl_ClipDistance"}isAvailable(e){let t=hC[e];if(t===void 0){let n;switch(t=!1,e){case"float32Filterable":n="OES_texture_float_linear";break;case"clipDistance":n="WEBGL_clip_cull_distance";break}if(n!==void 0){const r=this.renderer.backend.extensions;r.has(n)&&(r.get(n),t=!0)}hC[e]=t}return t}isFlipY(){return!0}enableHardwareClipping(e){this.enableExtension("GL_ANGLE_clip_cull_distance","require"),this.builtins.vertex.push(`out float gl_ClipDistance[ ${e} ]`)}
3929enableMultiview(){this.enableExtension("GL_OVR_multiview2","require","fragment"),this.enableExtension("GL_OVR_multiview2","require","vertex"),this.builtins.vertex.push("layout(num_views = 2) in")}registerTransform(e,t){this.transforms.push({varyingName:e,attributeNode:t})}getTransforms(){const e=this.transforms;let t="";for(let n=0;n<e.length;n++){const r=e[n],s=this.getPropertyName(r.attributeNode);s&&(t+=`${r.varyingName} = ${s};
3930	`)}return t}_getGLSLUniformStruct(e,t){return`
3931layout( std140 ) uniform ${e} {
3932${t}
3933};`}_getGLSLVertexCode(e){return`#version 300 es
3934
3935${this.getSignature()}
3936
3937// extensions
3938${e.extensions}
3939
3940// precision
3941${pC}
3942
3943// uniforms
3944${e.uniforms}
3945
3946// varyings
3947${e.varyings}
3948
3949// attributes
3950${e.attributes}
3951
3952// codes
3953${e.codes}
3954
3955void main() {
3956
3957	// vars
3958	${e.vars}
3959
3960	// transforms
3961	${e.transforms}
3962
3963	// flow
3964	${e.flow}
3965
3966	gl_PointSize = 1.0;
3967
3968}
3969`}_getGLSLFragmentCode(e){return`#version 300 es
3970
3971${this.getSignature()}
3972
3973// extensions
3974${e.extensions}
3975
3976// precision
3977${pC}
3978
3979// uniforms
3980${e.uniforms}
3981
3982// varyings
3983${e.varyings}
3984
3985// codes
3986${e.codes}
3987
3988// structs
3989${e.structs}
3990
3991void main() {
3992
3993	// vars
3994	${e.vars}
3995
3996	// flow
3997	${e.flow}
3998
3999}
4000`}buildCode(){const e=this.material!==null?{fragment:{},vertex:{}}:{compute:{}};this.sortBindingGroups();for(const t in e){let n=`// code
4001
4002`;n+=this.flowCode[t];const r=this.flowNodes[t],s=r[r.length-1];for(const a of r){const l=this.getFlowData(a),c=a.name;c&&(n.length>0&&(n+=`
4003`),n+=`	// flow -> ${c}
4004	`),n+=`${l.code}
4005	`,a===s&&t!=="compute"&&(n+=`// result
4006	`,t==="vertex"?(n+="gl_Position = ",n+=`${l.result};`):t==="fragment"&&(a.outputNode.isOutputStructNode||(n+="fragColor = ",n+=`${l.result};`)))}const o=e[t];o.extensions=this.getExtensions(t),o.uniforms=this.getUniforms(t),o.attributes=this.getAttributes(t),o.varyings=this.getVaryings(t),o.vars=this.getVars(t),o.structs=this.getStructs(t),o.codes=this.getCodes(t),o.transforms=this.getTransforms(t),o.flow=n}this.material!==null?(this.vertexShader=this._getGLSLVertexCode(e.vertex),this.fragmentShader=this._getGLSLFragmentCode(e.fragment)):this.computeShader=this._getGLSLVertexCode(e.compute)}getUniformFromNode(e,t,n,r=null){const s=super.getUniformFromNode(e,t,n,r),o=this.getDataFromNode(e,n,this.globalCache);let a=o.uniformGPU;if(a===void 0){const l=e.groupNode,c=l.name,u=this.getBindGroupArray(c,n);if(t==="texture")a=new fv(s.name,s.node,l),u.push(a);else if(t==="cubeTexture")a=new AI(s.name,s.node,l),u.push(a);else if(t==="texture3D")a=new mI(s.name,s.node,l),u.push(a);else if(t==="buffer"){e.name=`NodeBuffer_${e.id}`,s.name=`buffer${e.id}`;const p=new fI(e,l);p.name=e.name,u.push(p),a=p}else{const p=this.uniformGroups[n]||(this.uniformGroups[n]={});let m=p[c];m===void 0&&(m=new pI(n+"_"+c,l),p[c]=m,u.push(m)),a=this.getNodeUniform(s,t),m.addUniform(a)}o.uniformGPU=a}return s}}let Mx=null,ed=null;class gI{constructor(e={}){this.parameters=Object.assign({},e),this.data=new WeakMap,this.renderer=null,this.domElement=null,this.timestampQueryPool={render:null,compute:null},this.trackTimestamp=e.trackTimestamp===!0}async init(e){this.renderer=e}get coordinateSystem(){}beginRender(){}finishRender(){}beginCompute(){}finishCompute(){}draw(){}compute(){}createProgram(){}destroyProgram(){}createBindings(){}updateBindings(){}updateBinding(){}createRenderPipeline(){}createComputePipeline(){}needsRenderUpdate(){}getRenderCacheKey(){}createNodeBuilder(){}createSampler(){}destroySampler(){}createDefaultTexture(){}createTexture(){}updateTexture(){}generateMipmaps(){}destroyTexture(){}async copyTextureToBuffer(){}copyTextureToTexture(){}copyFramebufferToTexture(){}createAttribute(){}createIndexAttribute(){}createStorageAttribute(){}updateAttribute(){}destroyAttribute(){}getContext(){}updateSize(){}updateViewport(){}isOccluded(){}async resolveTimestampsAsync(e="render"){if(!this.trackTimestamp){da("WebGPURenderer: Timestamp tracking is disabled.");return}const t=this.timestampQueryPool[e];if(!t){da(`WebGPURenderer: No timestamp query pool for type '${e}' found.`);return}const n=await t.resolveQueriesAsync();return this.renderer.info[e].timestamp=n,n}async waitForGPU(){}async getArrayBufferAsync(){}async hasFeatureAsync(){}hasFeature(){}getMaxAnisotropy(){}getDrawingBufferSize(){return Mx=Mx||new at,this.renderer.getDrawingBufferSize(Mx)}setScissorTest(){}getClearColor(){const e=this.renderer;return ed=ed||new ow,e.getClearColor(ed),ed.getRGB(ed),ed}getDomElement(){let e=this.domElement;return e===null&&(e=this.parameters.canvas!==void 0?this.parameters.canvas:oL(),"setAttribute"in e&&e.setAttribute("data-engine",`three.js r${zf} webgpu`),this.domElement=e),e}set(e,t){this.data.set(e,t)}get(e){let t=this.data.get(e);return t===void 0&&(t={},this.data.set(e,t)),t}has(e){return this.data.has(e)}delete(e){this.data.delete(e)}dispose(){}}let Qie=0;class Zie{constructor(e,t){this.buffers=[e.bufferGPU,t],this.type=e.type,this.bufferType=e.bufferType,this.pbo=e.pbo,this.byteLength=e.byteLength,this.bytesPerElement=e.BYTES_PER_ELEMENT,this.version=e.version,this.isInteger=e.isInteger,this.activeBufferIndex=0,this.baseId=e.id}get id(){return`${this.baseId}|${this.activeBufferIndex}`}get bufferGPU(){return this.buffers[this.activeBufferIndex]}get transformBuffer(){return this.buffers[this.activeBufferIndex^1]}switchBuffers(){this.activeBufferIndex^=1}}class Kie{constructor(e){this.backend=e}createAttribute(e,t){const n=this.backend,{gl:r}=n,s=e.array,o=e.usage||r.STATIC_DRAW,a=e.isInterleavedBufferAttribute?e.data:e,l=n.get(a);let c=l.bufferGPU;c===void 0&&(c=this._createBuffer(r,t,s,o),l.bufferGPU=c,l.bufferType=t,l.version=a.version);let u;if(s instanceof Float32Array)u=r.FLOAT;else if(s instanceof Uint16Array)e.isFloat16BufferAttribute?u=r.HALF_FLOAT:u=r.UNSIGNED_SHORT;else if(s instanceof Int16Array)u=r.SHORT;else if(s instanceof Uint32Array)u=r.UNSIGNED_INT;else if(s instanceof Int32Array)u=r.INT;else if(s instanceof Int8Array)u=r.BYTE;else if(s instanceof Uint8Array)u=r.UNSIGNED_BYTE;else if(s instanceof Uint8ClampedArray)u=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLBackend: Unsupported buffer data format: "+s);let p={bufferGPU:c,bufferType:t,type:u,byteLength:s.byteLength,bytesPerElement:s.BYTES_PER_ELEMENT,version:e.version,pbo:e.pbo,isInteger:u===r.INT||u===r.UNSIGNED_INT||e.gpuType===Ir,id:Qie++};if(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute){const m=this._createBuffer(r,t,s,o);p=new Zie(p,m)}n.set(e,p)}updateAttribute(e){const t=this.backend,{gl:n}=t,r=e.array,s=e.isInterleavedBufferAttribute?e.data:e,o=t.get(s),a=o.bufferType,l=e.isInterleavedBufferAttribute?e.data.updateRanges:e.updateRanges;if(n.bindBuffer(a,o.bufferGPU),l.length===0)n.bufferSubData(a,0,r);else{for(let c=0,u=l.length;c<u;c++){const p=l[c];n.bufferSubData(a,p.start*r.BYTES_PER_ELEMENT,r,p.start,p.count)}s.clearUpdateRanges()}n.bindBuffer(a,null),o.version=s.version}destroyAttribute(e){const t=this.backend,{gl:n}=t;e.isInterleavedBufferAttribute&&t.delete(e.data);const r=t.get(e);n.deleteBuffer(r.bufferGPU),t.delete(e)}async getArrayBufferAsync(e){const t=this.backend,{gl:n}=t,r=e.isInterleavedBufferAttribute?e.data:e,{bufferGPU:s}=t.get(r),o=e.array,a=o.byteLength;n.bindBuffer(n.COPY_READ_BUFFER,s);const l=n.createBuffer();n.bindBuffer(n.COPY_WRITE_BUFFER,l),n.bufferData(n.COPY_WRITE_BUFFER,a,n.STREAM_READ),n.copyBufferSubData(n.COPY_READ_BUFFER,n.COPY_WRITE_BUFFER,0,0,a),await t.utils._clientWaitAsync();const c=new e.array.constructor(o.length);return n.bindBuffer(n.COPY_WRITE_BUFFER,l),n.getBufferSubData(n.COPY_WRITE_BUFFER,0,c),n.deleteBuffer(l),n.bindBuffer(n.COPY_READ_BUFFER,null),n.bindBuffer(n.COPY_WRITE_BUFFER,null),c.buffer}_createBuffer(e,t,n,r){const s=e.createBuffer();return e.bindBuffer(t,s),e.bufferData(t,n,r),e.bindBuffer(t,null),s}}let wx,Gp,Jie=class{constructor(e){this.backend=e,this.gl=this.backend.gl,this.enabled={},this.currentFlipSided=null,this.currentCullFace=null,this.currentProgram=null,this.currentBlendingEnabled=!1,this.currentBlending=null,this.currentBlendSrc=null,this.currentBlendDst=null,this.currentBlendSrcAlpha=null,this.currentBlendDstAlpha=null,this.currentPremultipledAlpha=null,this.currentPolygonOffsetFactor=null,this.currentPolygonOffsetUnits=null,this.currentColorMask=null,this.currentDepthFunc=null,this.currentDepthMask=null,this.currentStencilFunc=null,this.currentStencilRef=null,this.currentStencilFuncMask=null,this.currentStencilFail=null,this.currentStencilZFail=null,this.currentStencilZPass=null,this.currentStencilMask=null,this.currentLineWidth=null,this.currentClippingPlanes=0,this.currentVAO=null,this.currentIndex=null,this.currentBoundFramebuffers={},this.currentDrawbuffers=new WeakMap,this.maxTextures=this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS),this.currentTextureSlot=null,this.currentBoundTextures={},this.currentBoundBufferBases={},this._init()}_init(){const e=this.gl;wx={[os]:e.FUNC_ADD,[vS]:e.FUNC_SUBTRACT,[yS]:e.FUNC_REVERSE_SUBTRACT},Gp={[Sl]:e.ZERO,[xS]:e.ONE,[bS]:e.SRC_COLOR,[NA]:e.SRC_ALPHA,[RS]:e.SRC_ALPHA_SATURATE,[TS]:e.DST_COLOR,[MS]:e.DST_ALPHA,[SS]:e.ONE_MINUS_SRC_COLOR,[DA]:e.ONE_MINUS_SRC_ALPHA,[ES]:e.ONE_MINUS_DST_COLOR,[wS]:e.ONE_MINUS_DST_ALPHA};const t=e.getParameter(e.SCISSOR_BOX),n=e.getParameter(e.VIEWPORT);this.currentScissor=new Jt().fromArray(t),this.currentViewport=new Jt().fromArray(n),this._tempVec4=new Jt}enable(e){const{enabled:t}=this;t[e]!==!0&&(this.gl.enable(e),t[e]=!0)}disable(e){const{enabled:t}=this;t[e]!==!1&&(this.gl.disable(e),t[e]=!1)}setFlipSided(e){if(this.currentFlipSided!==e){const{gl:t}=this;e?t.frontFace(t.CW):t.frontFace(t.CCW),this.currentFlipSided=e}}setCullFace(e){const{gl:t}=this;e!==WP?(this.enable(t.CULL_FACE),e!==this.currentCullFace&&(e===H2?t.cullFace(t.BACK):e===$P?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):this.disable(t.CULL_FACE),this.currentCullFace=e}setLineWidth(e){const{currentLineWidth:t,gl:n}=this;e!==t&&(n.lineWidth(e),this.currentLineWidth=e)}setBlending(e,t,n,r,s,o,a,l){const{gl:c}=this;if(e===Hs){this.currentBlendingEnabled===!0&&(this.disable(c.BLEND),this.currentBlendingEnabled=!1);return}if(this.currentBlendingEnabled===!1&&(this.enable(c.BLEND),this.currentBlendingEnabled=!0),e!==
4006Hd){if(e!==this.currentBlending||l!==this.currentPremultipledAlpha){if((this.currentBlendEquation!==os||this.currentBlendEquationAlpha!==os)&&(c.blendEquation(c.FUNC_ADD),this.currentBlendEquation=os,this.currentBlendEquationAlpha=os),l)switch(e){case ws:c.blendFuncSeparate(c.ONE,c.ONE_MINUS_SRC_ALPHA,c.ONE,c.ONE_MINUS_SRC_ALPHA);break;case rf:c.blendFunc(c.ONE,c.ONE);break;case sf:c.blendFuncSeparate(c.ZERO,c.ONE_MINUS_SRC_COLOR,c.ZERO,c.ONE);break;case of:c.blendFuncSeparate(c.ZERO,c.SRC_COLOR,c.ZERO,c.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",e);break}else switch(e){case ws:c.blendFuncSeparate(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA,c.ONE,c.ONE_MINUS_SRC_ALPHA);break;case rf:c.blendFunc(c.SRC_ALPHA,c.ONE);break;case sf:c.blendFuncSeparate(c.ZERO,c.ONE_MINUS_SRC_COLOR,c.ZERO,c.ONE);break;case of:c.blendFunc(c.ZERO,c.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",e);break}this.currentBlendSrc=null,this.currentBlendDst=null,this.currentBlendSrcAlpha=null,this.currentBlendDstAlpha=null,this.currentBlending=e,this.currentPremultipledAlpha=l}return}s=s||t,o=o||n,a=a||r,(t!==this.currentBlendEquation||s!==this.currentBlendEquationAlpha)&&(c.blendEquationSeparate(wx[t],wx[s]),this.currentBlendEquation=t,this.currentBlendEquationAlpha=s),(n!==this.currentBlendSrc||r!==this.currentBlendDst||o!==this.currentBlendSrcAlpha||a!==this.currentBlendDstAlpha)&&(c.blendFuncSeparate(Gp[n],Gp[r],Gp[o],Gp[a]),this.currentBlendSrc=n,this.currentBlendDst=r,this.currentBlendSrcAlpha=o,this.currentBlendDstAlpha=a),this.currentBlending=e,this.currentPremultipledAlpha=!1}setColorMask(e){this.currentColorMask!==e&&(this.gl.colorMask(e,e,e,e),this.currentColorMask=e)}setDepthTest(e){const{gl:t}=this;e?this.enable(t.DEPTH_TEST):this.disable(t.DEPTH_TEST)}setDepthMask(e){this.currentDepthMask!==e&&(this.gl.depthMask(e),this.currentDepthMask=e)}setDepthFunc(e){if(this.currentDepthFunc!==e){const{gl:t}=this;switch(e){case IA:t.depthFunc(t.NEVER);break;case BA:t.depthFunc(t.ALWAYS);break;case FA:t.depthFunc(t.LESS);break;case qc:t.depthFunc(t.LEQUAL);break;case UA:t.depthFunc(t.EQUAL);break;case OA:t.depthFunc(t.GEQUAL);break;case kA:t.depthFunc(t.GREATER);break;case zA:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}this.currentDepthFunc=e}}scissor(e,t,n,r){const s=this._tempVec4.set(e,t,n,r);if(this.currentScissor.equals(s)===!1){const{gl:o}=this;o.scissor(s.x,s.y,s.z,s.w),this.currentScissor.copy(s)}}viewport(e,t,n,r){const s=this._tempVec4.set(e,t,n,r);if(this.currentViewport.equals(s)===!1){const{gl:o}=this;o.viewport(s.x,s.y,s.z,s.w),this.currentViewport.copy(s)}}setScissorTest(e){const t=this.gl;e?t.enable(t.SCISSOR_TEST):t.disable(t.SCISSOR_TEST)}setStencilTest(e){const{gl:t}=this;e?this.enable(t.STENCIL_TEST):this.disable(t.STENCIL_TEST)}setStencilMask(e){this.currentStencilMask!==e&&(this.gl.stencilMask(e),this.currentStencilMask=e)}setStencilFunc(e,t,n){(this.currentStencilFunc!==e||this.currentStencilRef!==t||this.currentStencilFuncMask!==n)&&(this.gl.stencilFunc(e,t,n),this.currentStencilFunc=e,this.currentStencilRef=t,this.currentStencilFuncMask=n)}setStencilOp(e,t,n){(this.currentStencilFail!==e||this.currentStencilZFail!==t||this.currentStencilZPass!==n)&&(this.gl.stencilOp(e,t,n),this.currentStencilFail=e,this.currentStencilZFail=t,this.currentStencilZPass=n)}setMaterial(e,t,n){const{gl:r}=this;e.side===ur?this.disable(r.CULL_FACE):this.enable(r.CULL_FACE);let s=e.side===oi;t&&(s=!s),this.setFlipSided(s),e.blending===ws&&e.transparent===!1?this.setBlending(Hs):this.setBlending(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),this.setDepthFunc(e.depthFunc),this.setDepthTest(e.depthTest),this.setDepthMask(e.depthWrite),this.setColorMask(e.colorWrite);const o=e.stencilWrite;if(this.setStencilTest(o),o&&(this.setStencilMask(e.stencilWriteMask),this.setStencilFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),this.setStencilOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),this.setPolygonOffset(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),e.alphaToCoverage===!0&&this.backend.renderer.samples>1?this.enable(r.SAMPLE_ALPHA_TO_COVERAGE):this.disable(r.SAMPLE_ALPHA_TO_COVERAGE),n>0&&this.currentClippingPlanes!==n)for(let l=0;l<8;l++)l<n?this.enable(12288+l):this.disable(12288+l)}setPolygonOffset(e,t,n){const{gl:r}=this;e?(this.enable(r.POLYGON_OFFSET_FILL),(this.currentPolygonOffsetFactor!==t||this.currentPolygonOffsetUnits!==n)&&(r.polygonOffset(t,n),this.currentPolygonOffsetFactor=t,this.currentPolygonOffsetUnits=n)):this.disable(r.POLYGON_OFFSET_FILL)}useProgram(e){return this.currentProgram!==e?(this.gl.useProgram(e),this.currentProgram=e,!0):!1}setVertexState(e,t=null){const n=this.gl;return this.currentVAO!==e||this.currentIndex!==t?(n.bindVertexArray(e),t!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t),this.currentVAO=e,this.currentIndex=t,!0):!1}resetVertexState(){const e=this.gl;e.bindVertexArray(null),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),this.currentVAO=null,this.currentIndex=null}bindFramebuffer(e,t){const{gl:n,currentBoundFramebuffers:r}=this;return r[e]!==t?(n.bindFramebuffer(e,t),r[e]=t,e===n.DRAW_FRAMEBUFFER&&(r[n.FRAMEBUFFER]=t),e===n.FRAMEBUFFER&&(r[n.DRAW_FRAMEBUFFER]=t),!0):!1}drawBuffers(e,t){const{gl:n}=this;let r=[],s=!1;if(e.textures!==null){r=this.currentDrawbuffers.get(t),r===void 0&&(r=[],this.currentDrawbuffers.set(t,r));const o=e.textures;if(r.length!==o.length||r[0]!==n.COLOR_ATTACHMENT0){for(let a=0,l=o.length;a<l;a++)r[a]=n.COLOR_ATTACHMENT0+a;r.length=o.length,s=!0}}else r[0]!==n.BACK&&(r[0]=n.BACK,s=!0);s&&n.drawBuffers(r)}activeTexture(e){const{gl:t,currentTextureSlot:n,maxTextures:r}=this;e===void 0&&(e=t.TEXTURE0+r-1),n!==e&&(t.activeTexture(e),this.currentTextureSlot=e)}bindTexture(e,t,n){const{gl:r,currentTextureSlot:s,currentBoundTextures:o,maxTextures:a}=this;n===void 0&&(s===null?n=r.TEXTURE0+a-1:n=s);let l=o[n];l===void 0&&(l={type:void 0,texture:void 0},o[n]=l),(l.type!==e||l.texture!==t)&&(s!==n&&(r.activeTexture(n),this.currentTextureSlot=n),r.bindTexture(e,t),l.type=e,l.texture=t)}bindBufferBase(e,t,n){const{gl:r}=this,s=`${e}-${t}`;return this.currentBoundBufferBases[s]!==n?(r.bindBufferBase(e,t,n),this.currentBoundBufferBases[s]=n,!0):!1}unbindTexture(){const{gl:e,currentTextureSlot:t,currentBoundTextures:n}=this,r=n[t];r!==void 0&&r.type!==void 0&&(e.bindTexture(r.type,null),r.type=void 0,r.texture=void 0)}},ere=class{constructor(e){this.backend=e,this.gl=this.backend.gl,this.extensions=e.extensions}convert(e,t=vo){const{gl:n,extensions:r}=this;let s;if(e===Gi)return n.UNSIGNED_BYTE;if(e===M1)return n.UNSIGNED_SHORT_4_4_4_4;if(e===w1)return n.UNSIGNED_SHORT_5_5_5_1;if(e===T1)return n.UNSIGNED_INT_5_9_9_9_REV;if(e===Gu)return n.BYTE;if(e===qu)return n.SHORT;if(e===la)return n.UNSIGNED_SHORT;if(e===Ir)return n.INT;if(e===mi)return n.UNSIGNED_INT;if(e===er)return n.FLOAT;if(e===dr)return n.HALF_FLOAT;if(e===LS)return n.ALPHA;if(e===R0)return n.RGB;if(e===Yi)return n.RGBA;if(e===bo)return n.DEPTH_COMPONENT;if(e===So)return n.DEPTH_STENCIL;if(e===C0)return n.RED;if(e===Vf)return n.RED_INTEGER;if(e===Nl)return n.RG;if(e===Gf)return n.RG_INTEGER;if(e===qf)return n.RGBA_INTEGER;if(e===Hu||e===Lc||e===Nc||e===Dc)if(t===Xt)if(s=r.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(e===Hu)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(e===Lc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(e===Nc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(e===Dc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=r.get("WEBGL_compressed_texture_s3tc"),s!==null){if(e===Hu)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===Lc)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===Nc)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===Dc)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(e===VA||e===GA||e===qA||e===HA)if(s=r.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(e===VA)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===GA)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===qA)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===HA)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(e===WA||e===af||e===lf)if(s=r.get("WEBGL_compressed_texture_etc"),s!==null){if(e===WA||e===af)return t===Xt?s.
4006COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(e===lf)return t===Xt?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(e===cf||e===uf||e===hf||e===df||e===ff||e===pf||e===Af||e===mf||e===gf||e===_f||e===vf||e===yf||e===xf||e===bf)if(s=r.get("WEBGL_compressed_texture_astc"),s!==null){if(e===cf)return t===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(e===uf)return t===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(e===hf)return t===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(e===df)return t===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(e===ff)return t===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(e===pf)return t===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(e===Af)return t===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(e===mf)return t===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(e===gf)return t===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(e===_f)return t===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(e===vf)return t===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(e===yf)return t===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(e===xf)return t===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(e===bf)return t===Xt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(e===Wu)if(s=r.get("EXT_texture_compression_bptc"),s!==null){if(e===Wu)return t===Xt?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;if(e===NS||e===$A||e===jA||e===XA)if(s=r.get("EXT_texture_compression_rgtc"),s!==null){if(e===Wu)return s.COMPRESSED_RED_RGTC1_EXT;if(e===$A)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(e===jA)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(e===XA)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return e===xo?n.UNSIGNED_INT_24_8:n[e]!==void 0?n[e]:null}_clientWaitAsync(){const{gl:e}=this,t=e.fenceSync(e.SYNC_GPU_COMMANDS_COMPLETE,0);return e.flush(),new Promise((n,r)=>{function s(){const o=e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0);if(o===e.WAIT_FAILED){e.deleteSync(t),r();return}if(o===e.TIMEOUT_EXPIRED){requestAnimationFrame(s);return}e.deleteSync(t),n()}s()})}},AC=!1,ug,Tx,mC;class tre{constructor(e){this.backend=e,this.gl=e.gl,this.extensions=e.extensions,this.defaultTextures={},AC===!1&&(this._init(),AC=!0)}_init(){const e=this.gl;ug={[ih]:e.REPEAT,[ka]:e.CLAMP_TO_EDGE,[rh]:e.MIRRORED_REPEAT},Tx={[xi]:e.NEAREST,[PS]:e.NEAREST_MIPMAP_NEAREST,[Ll]:e.NEAREST_MIPMAP_LINEAR,[xr]:e.LINEAR,[Wd]:e.LINEAR_MIPMAP_NEAREST,[Os]:e.LINEAR_MIPMAP_LINEAR},mC={[DS]:e.NEVER,[OS]:e.ALWAYS,[E1]:e.LESS,[R1]:e.LEQUAL,[IS]:e.EQUAL,[US]:e.GEQUAL,[BS]:e.GREATER,[FS]:e.NOTEQUAL}}getGLTextureType(e){const{gl:t}=this;let n;return e.isCubeTexture===!0?n=t.TEXTURE_CUBE_MAP:e.isDepthArrayTexture===!0||e.isDataArrayTexture===!0||e.isCompressedArrayTexture===!0||e.isTextureArray===!0?n=t.TEXTURE_2D_ARRAY:e.isData3DTexture===!0?n=t.TEXTURE_3D:n=t.TEXTURE_2D,n}getInternalFormat(e,t,n,r,s=!1){const{gl:o,extensions:a}=this;if(e!==null){if(o[e]!==void 0)return o[e];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+e+"'")}let l=t;return t===o.RED&&(n===o.FLOAT&&(l=o.R32F),n===o.HALF_FLOAT&&(l=o.R16F),n===o.UNSIGNED_BYTE&&(l=o.R8),n===o.UNSIGNED_SHORT&&(l=o.R16),n===o.UNSIGNED_INT&&(l=o.R32UI),n===o.BYTE&&(l=o.R8I),n===o.SHORT&&(l=o.R16I),n===o.INT&&(l=o.R32I)),t===o.RED_INTEGER&&(n===o.UNSIGNED_BYTE&&(l=o.R8UI),n===o.UNSIGNED_SHORT&&(l=o.R16UI),n===o.UNSIGNED_INT&&(l=o.R32UI),n===o.BYTE&&(l=o.R8I),n===o.SHORT&&(l=o.R16I),n===o.INT&&(l=o.R32I)),t===o.RG&&(n===o.FLOAT&&(l=o.RG32F),n===o.HALF_FLOAT&&(l=o.RG16F),n===o.UNSIGNED_BYTE&&(l=o.RG8),n===o.UNSIGNED_SHORT&&(l=o.RG16),n===o.UNSIGNED_INT&&(l=o.RG32UI
4006),n===o.BYTE&&(l=o.RG8I),n===o.SHORT&&(l=o.RG16I),n===o.INT&&(l=o.RG32I)),t===o.RG_INTEGER&&(n===o.UNSIGNED_BYTE&&(l=o.RG8UI),n===o.UNSIGNED_SHORT&&(l=o.RG16UI),n===o.UNSIGNED_INT&&(l=o.RG32UI),n===o.BYTE&&(l=o.RG8I),n===o.SHORT&&(l=o.RG16I),n===o.INT&&(l=o.RG32I)),t===o.RGB&&(n===o.FLOAT&&(l=o.RGB32F),n===o.HALF_FLOAT&&(l=o.RGB16F),n===o.UNSIGNED_BYTE&&(l=o.RGB8),n===o.UNSIGNED_SHORT&&(l=o.RGB16),n===o.UNSIGNED_INT&&(l=o.RGB32UI),n===o.BYTE&&(l=o.RGB8I),n===o.SHORT&&(l=o.RGB16I),n===o.INT&&(l=o.RGB32I),n===o.UNSIGNED_BYTE&&(l=r===Xt&&s===!1?o.SRGB8:o.RGB8),n===o.UNSIGNED_SHORT_5_6_5&&(l=o.RGB565),n===o.UNSIGNED_SHORT_5_5_5_1&&(l=o.RGB5_A1),n===o.UNSIGNED_SHORT_4_4_4_4&&(l=o.RGB4),n===o.UNSIGNED_INT_5_9_9_9_REV&&(l=o.RGB9_E5)),t===o.RGB_INTEGER&&(n===o.UNSIGNED_BYTE&&(l=o.RGB8UI),n===o.UNSIGNED_SHORT&&(l=o.RGB16UI),n===o.UNSIGNED_INT&&(l=o.RGB32UI),n===o.BYTE&&(l=o.RGB8I),n===o.SHORT&&(l=o.RGB16I),n===o.INT&&(l=o.RGB32I)),t===o.RGBA&&(n===o.FLOAT&&(l=o.RGBA32F),n===o.HALF_FLOAT&&(l=o.RGBA16F),n===o.UNSIGNED_BYTE&&(l=o.RGBA8),n===o.UNSIGNED_SHORT&&(l=o.RGBA16),n===o.UNSIGNED_INT&&(l=o.RGBA32UI),n===o.BYTE&&(l=o.RGBA8I),n===o.SHORT&&(l=o.RGBA16I),n===o.INT&&(l=o.RGBA32I),n===o.UNSIGNED_BYTE&&(l=r===Xt&&s===!1?o.SRGB8_ALPHA8:o.RGBA8),n===o.UNSIGNED_SHORT_4_4_4_4&&(l=o.RGBA4),n===o.UNSIGNED_SHORT_5_5_5_1&&(l=o.RGB5_A1)),t===o.RGBA_INTEGER&&(n===o.UNSIGNED_BYTE&&(l=o.RGBA8U
4006I),n===o.UNSIGNED_SHORT&&(l=o.RGBA16UI),n===o.UNSIGNED_INT&&(l=o.RGBA32UI),n===o.BYTE&&(l=o.RGBA8I),n===o.SHORT&&(l=o.RGBA16I),n===o.INT&&(l=o.RGBA32I)),t===o.DEPTH_COMPONENT&&(n===o.UNSIGNED_SHORT&&(l=o.DEPTH_COMPONENT16),n===o.UNSIGNED_INT&&(l=o.DEPTH_COMPONENT24),n===o.FLOAT&&(l=o.DEPTH_COMPONENT32F)),t===o.DEPTH_STENCIL&&n===o.UNSIGNED_INT_24_8&&(l=o.DEPTH24_STENCIL8),(l===o.R16F||l===o.R32F||l===o.RG16F||l===o.RG32F||l===o.RGBA16F||l===o.RGBA32F)&&a.get("EXT_color_buffer_float"),l}setTextureParameters(e,t){const{gl:n,extensions:r,backend:s}=this;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,t.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,t.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE),n.texParameteri(e,n.TEXTURE_WRAP_S,ug[t.wrapS]),n.texParameteri(e,n.TEXTURE_WRAP_T,ug[t.wrapT]),(e===n.TEXTURE_3D||e===n.TEXTURE_2D_ARRAY)&&t.isDepthArrayTexture!==!0&&t.isTextureArray===!1&&n.texParameteri(e,n.TEXTURE_WRAP_R,ug[t.wrapR]),n.texParameteri(e,n.TEXTURE_MAG_FILTER,Tx[t.magFilter]);const o=t.mipmaps!==void 0&&t.mipmaps.length>0,a=t.minFilter===xr&&o?Os:t.minFilter;if(n.texParameteri(e,n.TEXTURE_MIN_FILTER,Tx[a]),t.compareFunction&&(n.texParameteri(e,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(e,n.TEXTURE_COMPARE_FUNC,mC[t.compareFunction])),r.has("EXT_texture_filter_anisotropic")===!0){if(t.magFilter===xi||t.minFilter!==Ll&&t.minFilter!==Os||t.type===er&&r.has("OES_texture_float_linear")===!1)return;if(t.anisotropy>1){const l=r.get("EXT_texture_filter_anisotropic");n.texParameterf(e,l.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,s.getMaxAnisotropy()))}}}createDefaultTexture(e){const{gl:t,backend:n,defaultTextures:r}=this,s=this.getGLTextureType(e);let o=r[s];o===void 0&&(o=t.createTexture(),n.state.bindTexture(s,o),t.texParameteri(s,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(s,t.TEXTURE_MAG_FILTER,t.NEAREST),r[s]=o),n.set(e,{textureGPU:o,glTextureType:s,isDefault:!0})}createTexture(e,t){const{gl:n,backend:r}=this,{levels:s,width:o,height:a,depth:l}=t,c=r.utils.convert(e.format,e.colorSpace),u=r.utils.convert(e.type),p=this.getInternalFormat(e.internalFormat,c,u,e.colorSpace,e.isVideoTexture),m=n.createTexture(),g=this.getGLTextureType(e);r.state.bindTexture(g,m),this.setTextureParameters(g,e),e.isDepthArrayTexture||e.isDataArrayTexture||e.isCompressedArrayTexture||e.isTextureArray?n.texStorage3D(n.TEXTURE_2D_ARRAY,s,p,o,a,l):e.isData3DTexture?n.texStorage3D(n.TEXTURE_3D,s,p,o,a,l):e.isVideoTexture||n.texStorage2D(g,s,p,o,a),r.set(e,{textureGPU:m,glTextureType:g,glFormat:c,glType:u,glInternalFormat:p})}copyBufferToTexture(e,t){const{gl:n,backend:r}=this,{textureGPU:s,glTextureType:o,glFormat:a,glType:l}=r.get(t),{width:c,height:u}=t.source.data;n.bindBuffer(n.PIXEL_UNPACK_BUFFER,e),r.state.bindTexture(o,s),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.texSubImage2D(o,0,0,0,c,u,a,l,0),n.bindBuffer(n.PIXEL_UNPACK_BUFFER,null),r.state.unbindTexture()}updateTexture(e,t){const{gl:n}=this,{width:r,height:s}=t,{textureGPU:o,glTextureType:a,glFormat:l,glType:c,glInternalFormat:u}=this.backend.get(e);if(e.isRenderTargetTexture||o===void 0)return;const p=m=>m.isDataTexture?m.image.data:typeof HTMLImageElement<"u"&&m instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&m instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&m instanceof ImageBitmap||m instanceof OffscreenCanvas?m:m.data;if(this.backend.state.bindTexture(a,o),this.setTextureParameters(a,e),e.isCompressedTexture){const m=e.mipmaps,g=t.image;for(let v=0;v<m.length;v++){const b=m[v];e.isCompressedArrayTexture?e.format!==n.RGBA?l!==null?n.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,v,0,0,0,b.width,b.height,g.depth,l,b.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texSubImage3D(n.TEXTURE_2D_ARRAY,v,0,0,0,b.width,b.height,g.depth,l,c,b.data):l!==null?n.compressedTexSubImage2D(n.TEXTURE_2D,v,0,0,b.width,b.height,l,b.data):console.warn("Unsupported compressed texture format")}}else if(e.isCubeTexture){const m=t.images;for(let g=0;g<6;g++){const v=p(m[g]);n.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+g,0,0,0,r,s,l,c,v)}}else if(e.isDataArrayTexture||e.isDepthArrayTexture){const m=t.image;n.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,m.width,m.height,m.depth,l,c,m.data)}else if(e.isData3DTexture){const m=t.image;n.texSubImage3D(n.TEXTURE_3D,0,0,0,0,m.width,m.height,m.depth,l,c,m.data)}
4006else if(e.isVideoTexture)e.update(),n.texImage2D(a,0,u,l,c,t.image);else{const m=p(t.image);n.texSubImage2D(a,0,0,0,r,s,l,c,m)}}generateMipmaps(e){const{gl:t,backend:n}=this,{textureGPU:r,glTextureType:s}=n.get(e);n.state.bindTexture(s,r),t.generateMipmap(s)}deallocateRenderBuffers(e){const{gl:t,backend:n}=this;if(e){const r=n.get(e);if(r.renderBufferStorageSetup=void 0,r.framebuffers){for(const s in r.framebuffers)t.deleteFramebuffer(r.framebuffers[s]);delete r.framebuffers}if(r.depthRenderbuffer&&(t.deleteRenderbuffer(r.depthRenderbuffer),delete r.depthRenderbuffer),r.stencilRenderbuffer&&(t.deleteRenderbuffer(r.stencilRenderbuffer),delete r.stencilRenderbuffer),r.msaaFrameBuffer&&(t.deleteFramebuffer(r.msaaFrameBuffer),delete r.msaaFrameBuffer),r.msaaRenderbuffers){for(let s=0;s<r.msaaRenderbuffers.length;s++)t.deleteRenderbuffer(r.msaaRenderbuffers[s]);delete r.msaaRenderbuffers}}}destroyTexture(e){const{gl:t,backend:n}=this,{textureGPU:r,renderTarget:s}=n.get(e);this.deallocateRenderBuffers(s),t.deleteTexture(r),n.delete(e)}copyTextureToTexture(e,t,n=null,r=null,s=0,o=0){const{gl:a,backend:l}=this,{state:c}=this.backend,{textureGPU:u,glTextureType:p,glType:m,glFormat:g}=l.get(t);c.bindTexture(p,u);let v,b,M,x,w,R,C,N,D;const P=e.isCompressedTexture?e.mipmaps[o]:e.image;if(n!==null)v=n.max.x-n.min.x,b=n.max.y-n.min.y,M=n.isBox3?n.max.z-n.min.z:1,x=n.min.x,w=n.min.y,R=n.isBox3?n.min.z:0;else{const Q=Math.pow(2,-s);v=Math.floor(P.width*Q),b=Math.floor(P.height*Q),e.isDataArrayTexture||e.isDepthArrayTexture?M=P.depth:e.isData3DTexture?M=Math.floor(P.depth*Q):M=1,x=0,w=0,R=0}r!==null?(C=r.x,N=r.y,D=r.z):(C=0,N=0,D=0),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,t.flipY),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),a.pixelStorei(a.UNPACK_ALIGNMENT,t.unpackAlignment);const O=a.getParameter(a.UNPACK_ROW_LENGTH),I=a.getParameter(a.UNPACK_IMAGE_HEIGHT),F=a.getParameter(a.UNPACK_SKIP_PIXELS),k=a.getParameter(a.UNPACK_SKIP_ROWS),Y=a.getParameter(a.UNPACK_SKIP_IMAGES);a.pixelStorei(a.UNPACK_ROW_LENGTH,P.width),a.pixelStorei(a.UNPACK_IMAGE_HEIGHT,P.height),a.pixelStorei(a.UNPACK_SKIP_PIXELS,x),a.pixelStorei(a.UNPACK_SKIP_ROWS,w),a.pixelStorei(a.UNPACK_SKIP_IMAGES,R);const W=t.isDataArrayTexture||t.isData3DTexture||t.isDepthArrayTexture;if(e.isRenderTargetTexture||e.isDepthTexture){const Q=l.get(e),J=l.get(t),H=l.get(Q.renderTarget),$=l.get(J.renderTarget),K=H.framebuffers[Q.cacheKey],he=$.framebuffers[J.cacheKey];c.bindFramebuffer(a.READ_FRAMEBUFFER,K),c.bindFramebuffer(a.DRAW_FRAMEBUFFER,he);let ie=a.COLOR_BUFFER_BIT;e.isDepthTexture&&(ie=a.DEPTH_BUFFER_BIT),a.blitFramebuffer(x,w,v,b,C,N,v,b,ie,a.NEAREST),c.bindFramebuffer(a.READ_FRAMEBUFFER,null),c.bindFramebuffer(a.DRAW_FRAMEBUFFER,null)}else W?e.isDataTexture||e.isData3DTexture?a.texSubImage3D(p,o,C,N,D,v,b,M,g,m,P.data):t.isCompressedArrayTexture?a.compressedTexSubImage3D(p,o,C,N,D,v,b,M,g,P.data):a.texSubImage3D(p,o,C,N,D,v,b,M,g,m,P):e.isDataTexture?a.texSubImage2D(p,o,C,N,v,b,g,m,P.data):e.isCompressedTexture?a.compressedTexSubImage2D(p,o,C,N,P.width,P.height,g,P.data):a.texSubImage2D(p,o,C,N,v,b,g,m,P);a.pixelStorei(a.UNPACK_ROW_LENGTH,O),a.pixelStorei(a.UNPACK_IMAGE_HEIGHT,I),a.pixelStorei(a.UNPACK_SKIP_PIXELS,F),a.pixelStorei(a.UNPACK_SKIP_ROWS,k),a.pixelStorei(a.UNPACK_SKIP_IMAGES,Y),o===0&&t.generateMipmaps&&a.generateMipmap(p),c.unbindTexture()}copyFramebufferToTexture(e,t,n){const{gl:r}=this,{state:s}=this.backend,{textureGPU:o}=this.backend.get(e),{x:a,y:l,z:c,w:u}=n,p=e.isDepthTexture===!0||t.renderTarget&&t.renderTarget.samples>0,m=t.renderTarget?t.renderTarget.height:this.backend.getDrawingBufferSize().y;if(p){const g=a!==0||l!==0;let v,b;if(e.isDepthTexture===!0?(v=r.DEPTH_BUFFER_BIT,b=r.DEPTH_ATTACHMENT,t.stencil&&(v|=r.STENCIL_BUFFER_BIT)):(v=r.COLOR_BUFFER_BIT,b=r.COLOR_ATTACHMENT0),g){const M=this.backend.get(t.renderTarget),x=M.framebuffers[t.getCacheKey()],w=M.msaaFrameBuffer;s.bindFramebuffer(r.DRAW_FRAMEBUFFER,x),s.bindFramebuffer(r.READ_FRAMEBUFFER,w);const R=m-l-u;r.blitFramebuffer(a,R,a+c,R+u,a,R,a+c,R+u,v,r.NEAREST),s.bindFramebuffer(r.READ_FRAMEBUFFER,x),s.bindTexture(r.TEXTURE_2D,o),r.copyTexSubImage2D(r.TEXTURE_2D,0,0,0,a,R,c,u),s.unbindTexture()}else{const M=r.createFramebuffer();s.bindFramebuffer(r.DRAW_FRAMEBUFFER,M),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,b,r.TEXTURE_2D,o,0),r.blitFramebuffer(0,0,c,u,0,0,c,u,v,r.NEAREST),r.deleteFramebuffer(M)}}else s.bindTexture(r.TEXTURE_2D,o),r.copyTexSubImage2D(r.TEXTURE_2D,0,0,0,a,m-u-l,c,u),s.unbindTexture();e.generateMipmaps&&this.generateMipmaps(e),this.backend._setFramebuffer(t)}setupRenderBufferStorage(e,t,n,r=!1){const{gl:s}=this,o=t.renderTarget,{depthTexture:a,depthBuffer:l,stencilBuffer:c,width:u,height:p}=o;if(s.bindRenderbuffer(s.RENDERBUFFER,e),l&&!c){let m=s.DEPTH_COMPONENT24;r===!0?this.extensions.get("WEBGL_multisampled_render_to_texture").renderbufferStorageMultisampleEXT(s.RENDERBUFFER,o.samples,m,u,p):n>0?(a&&a.isDepthTexture&&a.type===s.FLOAT&&(m=s.DEPTH_COMPONENT32F),s.renderbufferStorageMultisample(s.RENDERBUFFER,n,m,u,p)):s.renderbufferStorage(s.RENDERBUFFER,m,u,p),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,e)}else l&&c&&(n>
40060?s.renderbufferStorageMultisample(s.RENDERBUFFER,n,s.DEPTH24_STENCIL8,u,p):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,u,p),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,e))}async copyTextureToBuffer(e,t,n,r,s,o){const{backend:a,gl:l}=this,{textureGPU:c,glFormat:u,glType:p}=this.backend.get(e),m=l.createFramebuffer();l.bindFramebuffer(l.READ_FRAMEBUFFER,m);const g=e.isCubeTexture?l.TEXTURE_CUBE_MAP_POSITIVE_X+o:l.TEXTURE_2D;l.framebufferTexture2D(l.READ_FRAMEBUFFER,l.COLOR_ATTACHMENT0,g,c,0);const v=this._getTypedArrayType(p),b=this._getBytesPerTexel(p,u),x=r*s*b,w=l.createBuffer();l.bindBuffer(l.PIXEL_PACK_BUFFER,w),l.bufferData(l.PIXEL_PACK_BUFFER,x,l.STREAM_READ),l.readPixels(t,n,r,s,u,p,0),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),await a.utils._clientWaitAsync();const R=new v(x/v.BYTES_PER_ELEMENT);return l.bindBuffer(l.PIXEL_PACK_BUFFER,w),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,R),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),l.deleteFramebuffer(m),R}_getTypedArrayType(e){const{gl:t}=this;if(e===t.UNSIGNED_BYTE)return Uint8Array;
4006if(e===t.UNSIGNED_SHORT_4_4_4_4||e===t.UNSIGNED_SHORT_5_5_5_1||e===t.UNSIGNED_SHORT_5_6_5||e===t.UNSIGNED_SHORT)return Uint16Array;if(e===t.UNSIGNED_INT)return Uint32Array;if(e===t.HALF_FLOAT)return Uint16Array;if(e===t.FLOAT)return Float32Array;throw new Error(`Unsupported WebGL type: ${e}`)}_getBytesPerTexel(e,t){const{gl:n}=this;let r=0;if(e===n.UNSIGNED_BYTE&&(r=1),(e===n.UNSIGNED_SHORT_4_4_4_4||e===n.UNSIGNED_SHORT_5_5_5_1||e===n.UNSIGNED_SHORT_5_6_5||e===n.UNSIGNED_SHORT||e===n.HALF_FLOAT)&&(r=2),(e===n.UNSIGNED_INT||e===n.FLOAT)&&(r=4),t===n.RGBA)return r*4;if(t===n.RGB)return r*3;if(t===n.ALPHA)return r}}let nre=class{constructor(e){this.backend=e,this.gl=this.backend.gl,this.availableExtensions=this.gl.getSupportedExtensions(),this.extensions={}}get(e){let t=this.extensions[e];return t===void 0&&(t=this.gl.getExtension(e),this.extensions[e]=t),t}has(e){return this.availableExtensions.includes(e)}},ire=class{constructor(e){this.backend=e,this.maxAnisotropy=null}getMaxAnisotropy(){if(this.maxAnisotropy!==null)return this.maxAnisotropy;const e=this.backend.gl,t=this.backend.extensions;if(t.has("EXT_texture_filter_anisotropic")===!0){const n=t.get("EXT_texture_filter_anisotropic");this.maxAnisotropy=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else this.maxAnisotropy=0;return this.maxAnisotropy}};const gC={WEBGL_multi_draw:"WEBGL_multi_draw",WEBGL_compressed_texture_astc:"texture-compression-astc",WEBGL_compressed_texture_etc:"texture-compression-etc2",WEBGL_compressed_texture_etc1:"texture-compression-etc1",WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBKIT_WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBGL_compressed_texture_s3tc:"texture-compression-bc",EXT_texture_compression_bptc:"texture-compression-bptc",EXT_disjoint_timer_query_webgl2:"timestamp-query",OVR_multiview2:"OVR_multiview2"};let rre=class{constructor(e){this.gl=e.gl,this.extensions=e.extensions,this.info=e.renderer.info,this.mode=null,this.index=0,this.type=null,this.object=null}render(e,t){const{gl:n,mode:r,object:s,type:o,info:a,index:l}=this;l!==0?n.drawElements(r,t,o,e):n.drawArrays(r,e,t),a.update(s,t,1)}renderInstances(e,t,n){const{gl:r,mode:s,type:o,index:a,object:l,info:c}=this;n!==0&&(a!==0?r.drawElementsInstanced(s,t,o,e,n):r.drawArraysInstanced(s,e,t,n),c.update(l,t,n))}renderMultiDraw(e,t,n){const{extensions:r,mode:s,object:o,info:a}=this;if(n===0)return;const l=r.get("WEBGL_multi_draw");if(l===null)for(let c=0;c<n;c++)this.render(e[c],t[c]);else{this.index!==0?l.multiDrawElementsWEBGL(s,t,0,this.type,e,0,n):l.multiDrawArraysWEBGL(s,e,0,t,0,n);let c=0;for(let u=0;u<n;u++)c+=t[u];a.update(o,c,1)}}renderMultiDrawInstances(e,t,n,r){const{extensions:s,mode:o,object:a,info:l}=this;if(n===0)return;const c=s.get("WEBGL_multi_draw");if(c===null)for(let u=0;u<n;u++)this.renderInstances(e[u],t[u],r[u]);else{this.index!==0?c.multiDrawElementsInstancedWEBGL(o,t,0,this.type,e,0,r,0,n):c.multiDrawArraysInstancedWE
4006BGL(o,e,0,t,0,r,0,n);let u=0;for(let p=0;p<n;p++)u+=t[p]*r[p];l.update(a,u,1)}}};class _I{constructor(e=256){this.trackTimestamp=!0,this.maxQueries=e,this.currentQueryIndex=0,this.queryOffsets=new Map,this.isDisposed=!1,this.lastValue=0,this.pendingResolve=!1}allocateQueriesForContext(){}async resolveQueriesAsync(){}dispose(){}}class sre extends _I{constructor(e,t,n=2048){if(super(n),this.gl=e,this.type=t,this.ext=e.getExtension("EXT_disjoint_timer_query_webgl2")||e.getExtension("EXT_disjoint_timer_query"),!this.ext){console.warn("EXT_disjoint_timer_query not supported; timestamps will be disabled."),this.trackTimestamp=!1;return}this.queries=[];for(let r=0;r<this.maxQueries;r++)this.queries.push(e.createQuery());this.activeQuery=null,this.queryStates=new Map}allocateQueriesForContext(e){if(!this.trackTimestamp)return null;if(this.currentQueryIndex+2>this.maxQueries)return da(`WebGPUTimestampQueryPool [${this.type}]: Maximum number of queries exceeded, when using trackTimestamp it is necessary to resolves the queries via renderer.resolveTimestampsAsync( THREE.TimestampQuery.${this.type.toUpperCase()} ).`),null;const t=this.currentQueryIndex;return this.currentQueryIndex+=2,this.queryStates.set(t,"inactive"),this.queryOffsets.set(e.id,t),t}beginQuery(e){if(!this.trackTimestamp||this.isDisposed)return;const t=this.queryOffsets.get(e.id);if(t==null||this.activeQuery!==null)return;const n=this.queries[t];if(n)try{this.queryStates.get(t)==="inactive"&&(this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT,n),this.activeQuery=t,this.queryStates.set(t,"started"))}catch(r){console.error("Error in beginQuery:",r),this.activeQuery=null,this.queryStates.set(t,"inactive")}}endQuery(e){if(!this.trackTimestamp||this.isDisposed)return;const t=this.queryOffsets.get(e.id);if(t!=null&&this.activeQuery===t)try{this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.queryStates.set(t,"ended"),this.activeQuery=null}catch(n){console.error("Error in endQuery:",n),this.queryStates.set(t,"inactive"),this.activeQuery=null}}async resolveQueriesAsync(){if(!this.trackTimestamp||this.pendingResolve)return this.lastValue;this.pendingResolve=!0;try{const e=[];for(const[r,s]of this.queryStates)if(s==="ended"){const o=this.queries[r];e.push(this.resolveQuery(o))}if(e.length===0)return this.lastValue;const n=(await Promise.all(e)).reduce((r,s)=>r+s,0);return this.lastValue=n,this.currentQueryIndex=0,this.queryOffsets.clear(),this.queryStates.clear(),this.activeQuery=null,n}catch(e){return console.error("Error resolving queries:",e),this.lastValue}finally{this.pendingResolve=!1}}async resolveQuery(e){return new Promise(t=>{if(this.isDisposed){t(this.lastValue);return}let n,r=!1;const s=()=>{n&&(clearTimeout(n),n=null)},o=l=>{r||(r=!0,s(),t(l))},a=()=>{if(this.isDisposed){o(this.lastValue);return}try{if(this.gl.getParameter(this.ext.GPU_DISJOINT_EXT)){o(this.lastValue);return}if(!this.gl.getQueryParameter(e,this.gl.QUERY_RESULT_AVAILABLE)){n=setTimeout(a,1);return}const u=this.gl.getQueryParameter(e,this.gl.QUERY_RESULT);t(Number(u)/1e6)}catch(l){console.error("Error checking query:",l),t(this.lastValue)}};a()})}dispose(){if(!this.isDisposed&&(this.isDisposed=!0,!!this.trackTimestamp)){for(const e of this.queries)this.gl.deleteQuery(e);this.queries=[],this.queryStates.clear(),this.queryOffsets.clear(),this.lastValue=0,this.activeQuery=null}}}class _C extends gI{constructor(e={}){super(e),this.isWebGLBackend=!0,this.attributeUtils=null,this.extensions=null,this.capabilities=null,this.textureUtils=null,this.bufferRenderer=null,this.gl=null,this.state=null,this.utils=null,this.vaoCache={},this.transformFeedbackCache={},this.discard=!1,this.disjoint=null,this.parallel=null,this._currentContext=null,this._knownBindings=new WeakSet,this._supportsInvalidateFramebuffer=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),this._xrFramebuffer=null}init(e){super.init(e);const t=this.parameters,n={antialias:e.samples>0,alpha:!0,depth:e.depth,stencil:e.stencil},r=t.context!==void 0?t.context:e.domElement.getContext("webgl2",n);function s(o){o.preventDefault();const a={api:"WebGL",message:o.statusMessage||"Unknown reason",reason:null,originalEvent:o};e.onDeviceLost(a)}this._onContextLost=s,e.domElement.addEventListener("webglcontextlost",s,!1),this.gl=r,this.extensions=new nre(this),this.capabilities=new ire(this),this.attributeUtils=new Kie(this),this.textureUtils=new tre(this),this.bufferRenderer=new rre(this),this.state=new Jie(this),this.utils=new ere(this),this.extensions.get("EXT_color_buffer_float"),this.extensions.get("WEBGL_clip_cull_distance"),this.extensions.get("OES_texture_float_linear"),this.extensions.get("EXT_color_buffer_half_float"),this.extensions.get("WEBGL_multisampled_render_to_texture"),this.extensions.get("WEBGL_render_shared_exponent"),this.extensions.get("WEBGL_multi_draw"),this.extensions.get("OVR_multiview2"),this.disjoint=this.extensions.get("EXT_disjoint_timer_query_webgl2"),this.parallel=this.extensions.get("KHR_parallel_shader_compile")}get coordinateSystem(){return Ms}async getArrayBufferAsync(e){return await this.attributeUtils.getArrayBufferAsync(e)}async waitForGPU(){await this.utils._clientWaitAsync()}async makeXRCompatible(){this.gl.getContextAttributes().xrCompatible!==!0&&await this.gl.makeXRCompatible()}setXRTarget(e){this._xrFramebuffer=e}setXRRenderTargetTextures(e,t,n=null){const r=this.gl;if(this.set(e.texture,{textureGPU:t,glInternalFormat:r.RGBA8}),n!==null){const s=e.stencilBuffer?r.DEPTH24_STENCIL8:r.DEPTH_COMPONENT24;this.set(e.depthTexture,{textureGPU:n,glInternalFormat:s}),this.extensions.has("WEBGL_multisampled_render_to_texture")===!0&&e.autoAllocateDepthBuffer===!0&&e.multiview===!1&&console.warn("THREE.WebGLBackend: Render-to-texture extension was disabled because an external texture was provided"),e.autoAllocateDepthBuffer=!1}}initTimestampQuery(e){if(!this.disjoint||!this.trackTimestamp)return;const t=e.isComputeNode?"compute":"render";this.timestampQueryPool[t]||(this.timestampQueryPool[t]=new sre(this.gl,t,2048));const n=this.timestampQueryPool[t];n.allocateQueriesForContext(e)!==null&&n.beginQuery(e)}prepareTimestampBuffer(e){if(!this.disjoint||!this.trackTimestamp)return;const t=e.isComputeNode?"compute":"render";this.timestampQueryPool[t].endQuery(e)}getContext(){return this.gl}beginRender(e){const{state:t,gl:n}=this,r=this.get(e);if(e.viewport?this.updateViewport(e):t.viewport(0,0,n.drawingBufferWidth,n.drawingBufferHeight),e.scissor){const{x:o,y:a,width:l,height:c}=e.scissorValue;t.scissor(o,e.height-c-a,l,c)}this.initTimestampQuery(e),r.previousContext=this._currentContext,this._currentContext=e,this._setFramebuffer(e),this.clear(e.clearColor,e.clearDepth,e.clearStencil,e,!1);const s=e.occlusionQueryCount;s>0&&(r.currentOcclusionQueries=r.occlusionQueries,r.currentOcclusionQueryObjects=r.occlusionQueryObjects,r.lastOcclusionObject=null,r.occlusionQueries=new Array(s),r.occlusionQueryObjects=new Array(s),r.occlusionQueryIndex=0)}finishRender(e){const{gl:t,state:n}=this,r=this.get(e),s=r.previousContext;n.resetVertexState();const o=e.occlusionQueryCount;o>0&&(o>r.occlusionQueryIndex&&t.endQuery(t.ANY_SAMPLES_PASSED),this.resolveOccludedAsync(e));const a=e.textures;if(a!==null)for(let l=0;l<a.length;l++){const c=a[l];c.generateMipmaps&&this.generateMipmaps(c)}if(this._currentContext=s,e.textures!==null&&e.renderTarget){const l=this.get(e.renderTarget),{samples:c}=e.renderTarget;if(c>0&&this._useMultisampledExtension(e.renderTarget)===!1){const u=l.framebuffers[e.getCacheKey()],p=t.COLOR_BUFFER_BIT,m=l.msaaFrameBuffer,g=e.textures;n.bindFramebuffer(t.READ_FRAMEBUFFER,m),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,u);for(let v=0;v<g.length;v++)if(e.scissor){const{x:b,y:M,width:x,height:w}=e.scissorValue,R=e.height-w-M;t.blitFramebuffer(b,R,b+x,R+w,b,R,b+x,R+w,p,t.NEAREST),this._supportsInvalidateFramebuffer===!0&&t.invalidateSubFramebuffer(t.READ_FRAMEBUFFER,l.invali
4006dationArray,b,R,x,w)}else t.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,p,t.NEAREST),this._supportsInvalidateFramebuffer===!0&&t.invalidateFramebuffer(t.READ_FRAMEBUFFER,l.invalidationArray)}}s!==null&&(this._setFramebuffer(s),s.viewport?this.updateViewport(s):n.viewport(0,0,t.drawingBufferWidth,t.drawingBufferHeight)),this.prepareTimestampBuffer(e)}resolveOccludedAsync(e){const t=this.get(e),{currentOcclusionQueries:n,currentOcclusionQueryObjects:r}=t;if(n&&r){const s=new WeakSet,{gl:o}=this;t.currentOcclusionQueryObjects=null,t.currentOcclusionQueries=null;const a=()=>{let l=0;for(let c=0;c<n.length;c++){const u=n[c];u!==null&&o.getQueryParameter(u,o.QUERY_RESULT_AVAILABLE)&&(o.getQueryParameter(u,o.QUERY_RESULT)===0&&s.add(r[c]),n[c]=null,o.deleteQuery(u),l++)}l<n.length?requestAnimationFrame(a):t.occluded=s};a()}}isOccluded(e,t){const n=this.get(e);return n.occluded&&n.occluded.has(t)}updateViewport(e){const{state:t}=this,{x:n,y:r,width:s,height:o}=e.viewportValue;t.viewport(n,e.height-o-r,s,o)}setScissorTest(e){this.state.setScissorTest(e)}getClearColor(){const e=super.getClearColor();return e.r*=e.a,e.g*=e.a,e.b*=e.a,e}clear(e,t,n,r=null,s=!0){const{gl:o,renderer:a}=this;r===null&&(r={textures:null,clearColorValue:this.getClearColor()});let l=0;if(e&&(l|=o.COLOR_BUFFER_BIT),t&&(l|=o.DEPTH_BUFFER_BIT),n&&(l|=o.STENCIL_BUFFER_BIT),l!==0){let c;r.clearColorValue?c=r.clearColorValue:c=this.getClearColor();const u=a.getClearDepth(),p=a.getClearStencil();if(t&&this.state.setDepthMask(!0),r.textures===null)o.clearColor(c.r,c.g,c.b,c.a),o.clear(l);else{if(s&&this._setFramebuffer(r),e)for(let m=0;m<r.textures.length;m++)m===0?o.clearBufferfv(o.COLOR,m,[c.r,c.g,c.b,c.a]):o.clearBufferfv(o.COLOR,m,[0,0,0,1]);
4006t&&n?o.clearBufferfi(o.DEPTH_STENCIL,0,u,p):t?o.clearBufferfv(o.DEPTH,0,[u]):n&&o.clearBufferiv(o.STENCIL,0,[p])}}}beginCompute(e){const{state:t,gl:n}=this;t.bindFramebuffer(n.FRAMEBUFFER,null),this.initTimestampQuery(e)}compute(e,t,n,r){const{state:s,gl:o}=this;this.discard===!1&&(o.enable(o.RASTERIZER_DISCARD),this.discard=!0);const{programGPU:a,transformBuffers:l,attributes:c}=this.get(r),u=this._getVaoKey(c),p=this.vaoCache[u];p===void 0?this._createVao(c):s.setVertexState(p),s.useProgram(a),this._bindUniforms(n);const m=this._getTransformFeedback(l);o.bindTransformFeedback(o.TRANSFORM_FEEDBACK,m),o.beginTransformFeedback(o.POINTS),c[0].isStorageInstancedBufferAttribute?o.drawArraysInstanced(o.POINTS,0,1,t.count):o.drawArrays(o.POINTS,0,t.count),o.endTransformFeedback(),o.bindTransformFeedback(o.TRANSFORM_FEEDBACK,null);for(let g=0;g<l.length;g++){const v=l[g];v.pbo&&this.textureUtils.copyBufferToTexture(v.transformBuffer,v.pbo),v.switchBuffers()}}finishCompute(e){const t=this.gl;this.discard=!1,t.disable(t.RASTERIZER_DISCARD),this.prepareTimestampBuffer(e),this._currentContext&&this._setFramebuffer(this._currentContext)}_isRenderCameraDepthArray(e){return e.depthTexture&&e.depthTexture.isDepthArrayTexture&&e.camera.isArrayCamera}draw(e){const{object:t,pipeline:n,material:r,context:s,hardwareClippingPlanes:o}=e,{programGPU:a}=this.get(n),{gl:l,state:c}=this,u=this.get(s),p=e.getDrawParameters();if(p===null)return;this._bindUniforms(e.getBindings());const m=t.isMesh&&t.matrixWorld.determinant()<0;c.setMaterial(r,m,o),c.useProgram(a);const g=this.get(e);let v=g.staticVao;if(v===void 0||g.geometryId!==e.geometry.id){const P=this._getVaoKey(e.getAttributes());if(v=this.vaoCache[P],v===void 0){let O;({vaoGPU:v,staticVao:O}=this._createVao(e.getAttributes())),O&&(g.staticVao=v,g.geometryId=e.geometry.id)}}const b=e.getIndex(),M=b!==null?this.get(b).bufferGPU:null;c.setVertexState(v,M);const x=u.lastOcclusionObject;if(x!==t&&x!==void 0){if(x!==null&&x.occlusionTest===!0&&(l.endQuery(l.ANY_SAMPLES_PASSED),u.occlusionQueryIndex++),t.occlusionTest===!0){const P=l.createQuery();l.beginQuery(l.ANY_SAMPLES_PASSED,P),u.occlusionQueries[u.occlusionQueryIndex]=P,u.occlusionQueryObjects[u.occlusionQueryIndex]=t}u.lastOcclusionObject=t}const w=this.bufferRenderer;t.isPoints?w.mode=l.POINTS:t.isLineSegments?w.mode=l.LINES:t.isLine?w.mode=l.LINE_STRIP:t.isLineLoop?w.mode=l.LINE_LOOP:r.wireframe===!0?(c.setLineWidth(r.wireframeLinewidth*this.renderer.getPixelRatio()),w.mode=l.LINES):w.mode=l.TRIANGLES;const{vertexCount:R,instanceCount:C}=p;let{firstVertex:N}=p;if(w.object=t,b!==null){N*=b.array.BYTES_PER_ELEMENT;const P=this.get(b);w.index=b.count,w.type=P.type}else w.index=0;const D=()=>{t.isBatchedMesh?t._multiDrawInstances!==null?(da("THREE.WebGLBackend: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),w.renderMultiDrawInstances(t._multiDrawStarts,t._multiDrawCounts,t._multiDrawCount,t._multiDrawInstances)):this.hasFeature("WEBGL_multi_draw")?w.renderMultiDraw(t._multiDrawStarts,t._multiDrawCounts,t._multiDrawCount):da("THREE.WebGLRenderer: WEBGL_multi_draw not supported."):C>1?w.renderInstances(N,R,C):w.render(N,R)};if(e.camera.isArrayCamera===!0&&e.camera.cameras.length>0&&e.camera.isMultiViewCamera===!1){const P=this.get(e.camera),O=e.camera.cameras,I=e.getBindingGroup("cameraIndex").bindings[0];if(P.indexesGPU===void 0||P.indexesGPU.length!==O.length){const J=new Uint32Array([0,0,0,0]),H=[];for(let $=0,K=O.length;$<K;$++){const he=l.createBuffer();J[0]=$,l.bindBuffer(l.UNIFORM_BUFFER,he),l.bufferData(l.UNIFORM_BUFFER,J,l.STATIC_DRAW),H.push(he)}P.indexesGPU=H}const F=this.get(I),k=this.renderer.getPixelRatio(),Y=this._currentContext.renderTarget,W=this._isRenderCameraDepthArray(this._currentContext),Q=this._currentContext.activeCubeFace;if(W){const J=this.get(Y.depthTexture);if(J.clearedRenderId!==this.renderer._nodes.nodeFrame.renderId){J.clearedRenderId=this.renderer._nodes.nodeFrame.renderId;const{stencilBuffer:H}=Y;for(let $=0,K=O.length;$<K;$++)this.renderer._activeCubeFace=$,this._currentContext.activeCubeFace=$,this._setFramebuffer(this._currentContext),this.clear(!1,!0,H,this._currentContext,!1);this.renderer._activeCubeFace=Q,this._currentContext.activeCubeFace=Q}}for(let J=0,H=O.length;J<H;J++){const $=O[J];if(t.layers.test($.layers)){W&&(this.renderer._activeCubeFace=J,this._currentContext.activeCubeFace=J,this._setFramebuffer(this._currentContext));const K=$.viewport;if(K!==void 0){const he=K.x*k,ie=K.y*k,de=K.width*k,Ce=K.height*k;c.viewport(Math.floor(he),Math.floor(e.context.height-Ce-ie),Math.floor(de),Math.floor(Ce))}c.bindBufferBase(l.UNIFORM_BUFFER,F.index,P.indexesGPU[J]),D()}this._currentContext.activeCubeFace=Q,this.renderer._activeCubeFace=Q}}else D()}
4006needsRenderUpdate(){return!1}getRenderCacheKey(){return""}createDefaultTexture(e){this.textureUtils.createDefaultTexture(e)}createTexture(e,t){this.textureUtils.createTexture(e,t)}updateTexture(e,t){this.textureUtils.updateTexture(e,t)}generateMipmaps(e){this.textureUtils.generateMipmaps(e)}destroyTexture(e){this.textureUtils.destroyTexture(e)}async copyTextureToBuffer(e,t,n,r,s,o){return this.textureUtils.copyTextureToBuffer(e,t,n,r,s,o)}createSampler(){}destroySampler(){}createNodeBuilder(e,t){return new Yie(e,t)}createProgram(e){const t=this.gl,{stage:n,code:r}=e,s=n==="fragment"?t.createShader(t.FRAGMENT_SHADER):t.createShader(t.VERTEX_SHADER);t.shaderSource(s,r),t.compileShader(s),this.set(e,{shaderGPU:s})}destroyProgram(e){this.delete(e)}createRenderPipeline(e,t){const n=this.gl,r=e.pipeline,{fragmentProgram:s,vertexProgram:o}=r,a=n.createProgram(),l=this.get(s).shaderGPU,c=this.get(o).shaderGPU;if(n.attachShader(a,l),n.attachShader(a,c),n.linkProgram(a),this.set(r,{programGPU:a,fragmentShader:l,vertexShader:c}),t!==null&&this.parallel){const u=new Promise(p=>{const m=this.parallel,g=()=>{n.getProgramParameter(a,m.COMPLETION_STATUS_KHR)?(this._completeCompile(e,r),p()):requestAnimationFrame(g)};g()});t.push(u);return}this._completeCompile(e,r)}_handleSource(e,t){const n=e.split(`
4007`),r=[],s=Math.max(t-6,0),o=Math.min(t+6,n.length);for(let a=s;a<o;a++){const l=a+1;r.push(`${l===t?">":" "} ${l}: ${n[a]}`)}return r.join(`
4008`)}
4008_getShaderErrors(e,t,n){const r=e.getShaderParameter(t,e.COMPILE_STATUS),s=e.getShaderInfoLog(t).trim();if(r&&s==="")return"";const o=/ERROR: 0:(\d+)/.exec(s);if(o){const a=parseInt(o[1]);return n.toUpperCase()+`
4009
4010`+s+`
4011
4012`+this._handleSource(e.getShaderSource(t),a)}else return s}_logProgramError(e,t,n){if(this.renderer.debug.checkShaderErrors){const r=this.gl,s=r.getProgramInfoLog(e).trim();if(r.getProgramParameter(e,r.LINK_STATUS)===!1)if(typeof this.renderer.debug.onShaderError=="function")this.renderer.debug.onShaderError(r,e,n,t);else{const o=this._getShaderErrors(r,n,"vertex"),a=this._getShaderErrors(r,t,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(e,r.VALIDATE_STATUS)+`
4013
4014Program Info Log: `+s+`
4015`+o+`
4016`+a)}else s!==""&&console.warn("THREE.WebGLProgram: Program Info Log:",s)}}_completeCompile(e,t){const{state:n,gl:r}=this,s=this.get(t),{programGPU:o,fragmentShader:a,vertexShader:l}=s;r.getProgramParameter(o,r.LINK_STATUS)===!1&&this._logProgramError(o,a,l),n.useProgram(o);const c=e.getBindings();this._setupBindings(c,o),this.set(t,{programGPU:o})}createComputePipeline(e,t){const{state:n,gl:r}=this,s={stage:"fragment",code:`#version 300 es
4017precision highp float;
4018void main() {}`};this.createProgram(s);const{computeProgram:o}=e,a=r.createProgram(),l=this.get(s).shaderGPU,c=this.get(o).shaderGPU,u=o.transforms,p=[],m=[];for(let M=0;M<u.length;M++){const x=u[M];p.push(x.varyingName),m.push(x.attributeNode)}r.attachShader(a,l),r.attachShader(a,c),r.transformFeedbackVaryings(a,p,r.SEPARATE_ATTRIBS),r.linkProgram(a),r.getProgramParameter(a,r.LINK_STATUS)===!1&&this._logProgramError(a,l,c),n.useProgram(a),this._setupBindings(t,a);const g=o.attributes,v=[],b=[];for(let M=0;M<g.length;M++){const x=g[M].node.attribute;v.push(x),this.has(x)||this.attributeUtils.createAttribute(x,r.ARRAY_BUFFER)}for(let M=0;M<m.length;M++){const x=m[M].attribute;this.has(x)||this.attributeUtils.createAttribute(x,r.ARRAY_BUFFER);const w=this.get(x);b.push(w)}this.set(e,{programGPU:a,transformBuffers:b,attributes:v})}createBindings(e,t){if(this._knownBindings.has(t)===!1){this._knownBindings.add(t);let n=0,r=0;for(const s of t){this.set(s,{textures:r,uniformBuffers:n});for(const o of s.bindings)o.isUniformBuffer&&n++,o.isSampledTexture&&r++}}this.updateBindings(e,t)}updateBindings(e){const{gl:t}=this,n=this.get(e);let r=n.uniformBuffers,s=n.textures;for(const o of e.bindings)if(o.isUniformsGroup||o.isUniformBuffer){const a=o.buffer,l=t.createBuffer();t.bindBuffer(t.UNIFORM_BUFFER,l),t.bufferData(t.UNIFORM_BUFFER,a,t.DYNAMIC_DRAW),this.set(o,{index:r++,bufferGPU:l})}else if(o.isSampledTexture){const{textureGPU:a,glTextureType:l}=this.get(o.texture);this.set(o,{index:s++,textureGPU:a,glTextureType:l})}}updateBinding(e){const t=this.gl;if(e.isUniformsGroup||e.isUniformBuffer){const r=this.get(e).bufferGPU,s=e.buffer;t.bindBuffer(t.UNIFORM_BUFFER,r),t.bufferData(t.UNIFORM_BUFFER,s,t.DYNAMIC_DRAW)}}createIndexAttribute(e){const t=this.gl;this.attributeUtils.createAttribute(e,t.ELEMENT_ARRAY_BUFFER)}createAttribute(e){if(this.has(e))return;const t=this.gl;this.attributeUtils.createAttribute(e,t.ARRAY_BUFFER)}createStorageAttribute(e){if(this.has(e))return;const t=this.gl;this.attributeUtils.createAttribute(e,t.ARRAY_BUFFER)}updateAttribute(e){this.attributeUtils.updateAttribute(e)}destroyAttribute(e){this.attributeUtils.destroyAttribute(e)}hasFeature(e){const t=Object.keys(gC).filter(r=>gC[r]===e),n=this.extensions;for(let r=0;r<t.length;r++)if(n.has(t[r]))return!0;return!1}getMaxAnisotropy(){return this.capabilities.getMaxAnisotropy()}copyTextureToTexture(e,t,n=null,r=null,s=0,o=0){this.textureUtils.copyTextureToTexture(e,t,n,r,s,o)}copyFramebufferToTexture(e,t,n){this.textureUtils.copyFramebufferToTexture(e,t,n)}_setFramebuffer(e){const{gl:t,state:n}=this;let r=null;if(e.textures!==null){const s=e.renderTarget,o=this.get(s),{samples:a,depthBuffer:l,stencilBuffer:c}=s,u=s.isWebGLCubeRenderTarget===!0,p=s.isRenderTarget3D===!0,m=s.isRenderTargetArray===!0,g=s.isXRRenderTarget===!0,v=g===!0&&s.hasExternalTextures===!0;let b=o.msaaFrameBuffer,M=o.depthRenderbuffer;const x=this.extensions.get("WEBGL_multisampled_render_to_texture"),w=this.extensions.get("OVR_multiview2"),R=this._useMultisampledExtension(s),C=aD(e);let N;if(u?(o.cubeFramebuffers||(o.cubeFramebuffers={}),N=o.cubeFramebuffers[C]):g&&v===!1?N=this._xrFramebuffer:(o.framebuffers||(o.framebuffers={}),N=o.framebuffers[C]),N===void 0){N=t.createFramebuffer(),n.bindFramebuffer(t.FRAMEBUFFER,N);const D=e.textures;if(u){o.cubeFramebuffers[C]=N;const{textureGPU:P}=this.get(D[0]),O=this.renderer._activeCubeFace;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+O,P,0)}else{o.framebuffers[C]=N;for(let P=0;P<D.length;P++){const O=D[P],I=this.get(O);I.renderTarget=e.renderTarget,I.cacheKey=C;const F=t.COLOR_ATTACHMENT0+P;if(p||m){const k=this.renderer._activeCubeFace;t.framebufferTextureLayer(t.FRAMEBUFFER,F,I.textureGPU,0,k)}else s.multiview?w.framebufferTextureMultisampleMultiviewOVR(t.FRAMEBUFFER,F,I.textureGPU,0,a,0,2):v&&R?x.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,F,t.TEXTURE_2D,I.textureGPU,0,a):t.framebufferTexture2D(t.FRAMEBUFFER,F,t.TEXTURE_2D,I.textureGPU,0)}n.drawBuffers(e,N)}if(s.isXRRenderTarget&&s.autoAllocateDepthBuffer===!0){const P=t.createRenderbuffer();this.textureUtils.setupRenderBufferStorage(P,e,0,R),o.xrDepthRenderbuffer=P}else if(e.depthTexture!==null){const P=this.get(e.depthTexture),O=c?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;if(P.renderTarget=e.renderTarget,P.cacheKey=C,s.multiview)w.framebufferTextureMultisampleMultiviewOVR(t.FRAMEBUFFER,O,P.textureGPU,0,a,0,2);else if(v&&R)x.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,O,t.TEXTURE_2D,P.textureGPU,0,a);else if(e.depthTexture.isDepthArrayTexture){const I=this.renderer._activeCubeFace;t.framebufferTextureLayer(t.FRAMEBUFFER,O,P.textureGPU,0,I)}else t.framebufferTexture2D(t.FRAMEBUFFER,O,t.TEXTURE_2D,P.textureGPU,0)}}else{if(this._isRenderCameraDepthArray(e)){n.bindFramebuffer(t.FRAMEBUFFER,N);const P=this.renderer._activeCubeFace,O=this.get(e.depthTexture),I=c?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;t.framebufferTextureLayer(t.FRAMEBUFFER,I,O.textureGPU,0,P)}if(g&&v||s.multiview){n.bindFramebuffer(t.FRAMEBUFFER,N);const P=this.get(e.textures[0]);s.multiview?w.framebufferTextureMultisampleMultiviewOVR(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,P.textureGPU,0,a,0,2):R?x.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,P.textureGPU,0,a):t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,P.textureGPU,0);const O=c?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;if(s.autoAllocateDepthBuffer===!0){const I=o.xrDepthRenderbuffer;t.bindRenderbuffer(t.RENDERBUFFER,I),t.framebufferRenderbuffer(t.FRAMEBUFFER,O,t.RENDERBUFFER,I)}else{const I=this.get(e.depthTexture);s.multiview?w.framebufferTextureMultisampleMultiviewOVR(t.FRAMEBUFFER,O,I.textureGPU,0,a,0,2):R?x.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,O,t.TEXTURE_2D,I.textureGPU,0,a):t.framebufferTexture2D(t.FRAMEBUFFER,O,t.TEXTURE_2D,I.textureGPU,0)}}}if(a>0&&R===!1&&!s.multiview){if(b===void 0){const D=[];b=t.createFramebuffer(),n.bindFramebuffer(t.FRAMEBUFFER,b);const P=[],O=e.textures;for(let I=0;I<O.length;I++){if(P[I]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,P[I]),D.push(t.COLOR_ATTACHMENT0+I),l){const Y=c?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;D.push(Y)}const F=e.textures[I],k=this.get(F);t.renderbufferStorageMultisample(t.RENDERBUFFER,a,k.glInternalFormat,e.width,e.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+I,t.RENDERBUFFER,P[I])}if(o.msaaFrameBuffer=b,o.msaaRenderbuffers=P,M===void 0){M=t.createRenderbuffer(),this.textureUtils.setupRenderBufferStorage(M,e,a),o.depthRenderbuffer=M;const I=c?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;D.push(I)}o.invalidationArray=D}r=o.msaaFrameBuffer}else r=N}n.bindFramebuffer(t.FRAMEBUFFER,r)}_getVaoKey(e){let t="";for(let n=0;n<e.length;n++){const r=this.get(e[n]);t+=":"+r.id}return t}_createVao(e){const{gl:t}=this,n=t.createVertexArray();let r="",s=!0;
4018t.bindVertexArray(n);for(let o=0;o<e.length;o++){const a=e[o],l=this.get(a);r+=":"+l.id,t.bindBuffer(t.ARRAY_BUFFER,l.bufferGPU),t.enableVertexAttribArray(o),(a.isStorageBufferAttribute||a.isStorageInstancedBufferAttribute)&&(s=!1);let c,u;a.isInterleavedBufferAttribute===!0?(c=a.data.stride*l.bytesPerElement,u=a.offset*l.bytesPerElement):(c=0,u=0),l.isInteger?t.vertexAttribIPointer(o,a.itemSize,l.type,c,u):t.vertexAttribPointer(o,a.itemSize,l.type,a.normalized,c,u),a.isInstancedBufferAttribute&&!a.isInterleavedBufferAttribute?t.vertexAttribDivisor(o,a.meshPerAttribute):a.isInterleavedBufferAttribute&&a.data.isInstancedInterleavedBuffer&&t.vertexAttribDivisor(o,a.data.meshPerAttribute)}return t.bindBuffer(t.ARRAY_BUFFER,null),this.vaoCache[r]=n,{vaoGPU:n,staticVao:s}}_getTransformFeedback(e){let t="";for(let s=0;s<e.length;s++)t+=":"+e[s].id;let n=this.transformFeedbackCache[t];if(n!==void 0)return n;const{gl:r}=this;n=r.createTransformFeedback(),r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,n);for(let s=0;s<e.length;s++){const o=e[s];r.bindBufferBase(r.TRANSFORM_FEEDBACK_BUFFER,s,o.transformBuffer)}return r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,null),this.transformFeedbackCache[t]=n,n}_setupBindings(e,t){const n=this.gl;for(const r of e)for(const s of r.bindings){const a=this.get(s).index;if(s.isUniformsGroup||s.isUniformBuffer){const l=n.getUniformBlockIndex(t,s.name);n.uniformBlockBinding(t,l,a)}else if(s.isSampledTexture){const l=n.getUniformLocation(t,s.name);n.uniform1i(l,a)}}}_bindUniforms(e){const{gl:t,state:n}=this;for(const r of e)for(const s of r.bindings){const o=this.get(s),a=o.index;s.isUniformsGroup||s.isUniformBuffer?n.bindBufferBase(t.UNIFORM_BUFFER,a,o.bufferGPU):s.isSampledTexture&&n.bindTexture(o.glTextureType,o.textureGPU,t.TEXTURE0+a)}}_useMultisampledExtension(e){return e.multiview===!0?!0:e.samples>0&&this.extensions.has("WEBGL_multisampled_render_to_texture")===!0&&e.autoAllocateDepthBuffer!==!1}dispose(){const e=this.extensions.get("WEBGL_lose_context");e&&e.loseContext(),this.renderer.domElement.removeEventListener("webglcontextlost",this._onContextLost)}}const kd={PointList:"point-list",LineList:"line-list",LineStrip:"line-strip",TriangleList:"triangle-list",TriangleStrip:"triangle-strip"},Vr={Never:"never",Less:"less",Equal:"equal",LessEqual:"less-equal",Greater:"greater",NotEqual:"not-equal",GreaterEqual:"greater-equal",Always:"always"},vs={Store:"store"},Xn={Load:"load",Clear:"clear"},Ex={CCW:"ccw"},Rx={None:"none",Front:"front",Back:"back"},Nf={Uint16:"uint16",Uint32:"uint32"},be={R8Unorm:"r8unorm",R8Snorm:"r8snorm",R8Uint:"r8uint",R8Sint:"r8sint",R16Uint:"r16uint",R16Sint:"r16sint",R16Float:"r16float",RG8Unorm:"rg8unorm",RG8Snorm:"rg8snorm",RG8Uint:"rg8uint",RG8Sint:"rg8sint",R32Uint:"r32uint",R32Sint:"r32sint",R32Float:"r32float",RG16Uint:"rg16uint",RG16Sint:"rg16sint",RG16Float:"rg16float",RGBA8Unorm:"rgba8unorm",RGBA8UnormSRGB:"rgba8unorm-srgb",RGBA8Snorm:"rgba8snorm",RGBA8Uint:"rgba8uint",RGBA8Sint:"rgba8sint",BGRA8Unorm:"bgra8unorm",BGRA8UnormSRGB:"bgra8unorm-srgb",RGB9E5UFloat:"rgb9e5ufloat",RGB10A2Unorm:"rgb10a2unorm",RG11B10UFloat:"rgb10a2unorm",RG32Uint:"rg32uint",RG32Sint:"rg32sint",RG32Float:"rg32float",RGBA16Uint:"rgba16uint",RGBA16Sint:"rgba16sint",RGBA16Float:"rgba16float",RGBA32Uint:"rgba32uint",RGBA32Sint:"rgba32sint",RGBA32Float:"rgba32float",Depth16Unorm:"depth16unorm",Depth24Plus:"depth24plus",Depth24PlusStencil8:"depth24plus-stencil8",Depth32Float:"depth32float",Depth32FloatStencil8:"depth32float-stencil8",BC1RGBAUnorm:"bc1-rgba-unorm",BC1RGBAUnormSRGB:"bc1-rgba-unorm-srgb",BC2RGBAUnorm:"bc2-rgba-unorm",BC2RGBAUnormSRGB:"bc2-rgba-unorm-srgb",BC3RGBAUnorm:"bc3-rgba-unorm",BC3RGBAUnormSRGB:"bc3-rgba-unorm-srgb",BC4RUnorm:"bc4-r-unorm",BC4RSnorm:"bc4-r-snorm",BC5RGUnorm:"bc5-rg-unorm",BC5RGSnorm:"bc5-rg-snorm",BC6HRGBUFloat:"bc6h-rgb-ufloat",BC6HRGBFloat:"bc6h-rgb-float",BC7RGBAUnorm:"bc7-rgba-unorm",BC7RGBAUnormSRGB:"bc7-rgba-srgb",ETC2RGB8Unorm:"etc2-rgb8unorm",ETC2RGB8UnormSRGB:"etc2-rgb8unorm-srgb",ETC2RGB8A1Unorm:"etc2-rgb8a1unorm",ETC2RGB8A1UnormSRGB:"etc2-rgb8a1unorm-srgb",ETC2RGBA8Unorm:"etc2-rgba8unorm",ETC2RGBA8UnormSRGB:"etc2-rgba8unorm-srgb",EACR11Unorm:"eac-r11unorm",EACR11Snorm:"eac-r11snorm",EACRG11Unorm:"eac-rg11unorm",EACRG11Snorm:"eac-rg11snorm",ASTC4x4Unorm:"astc-4x4-unorm",ASTC4x4UnormSRGB:"astc-4x4-unorm-srgb",ASTC5x4Unorm:"astc-5x4-unorm",ASTC5x4UnormSRGB:"astc-5x4-unorm-srgb",ASTC5x5Unorm:"astc-5x5-unorm",ASTC5x5UnormSRGB:"astc-5x5-unorm-srgb",ASTC6x5Unorm:"astc-6x5-unorm",ASTC6x5UnormSRGB:"astc-6x5-unorm-srgb",ASTC6x6Unorm:"astc-6x6-unorm",ASTC6x6UnormSRGB:"astc-6x6-unorm-srgb",ASTC8x5Unorm:"astc-8x5-unorm",ASTC8x5UnormSRGB:"astc-8x5-unorm-srgb",ASTC8x6Unorm:"astc-8x6-unorm",ASTC8x6UnormSRGB:"astc-8x6-unorm-srgb",ASTC8x8Unorm:"astc-8x8-unorm",ASTC8x8UnormSRGB:"astc-8x8-unorm-srgb",ASTC10x5Unorm:"astc-10x5-unorm",ASTC10x5UnormSRGB:"astc-10x5-unorm-srgb",ASTC10x6Unorm:"astc-10x6-unorm",ASTC10x6UnormSRGB:"astc-10x6-unorm-srgb",ASTC10x8Unorm:"astc-10x8-unorm",ASTC10x8UnormSRGB:"astc-10x8-unorm-srgb",ASTC10x10Unorm:"astc-10x10-unorm",ASTC10x10UnormSRGB:"astc-10x10-unorm-srgb",ASTC12x10Unorm:"astc-12x10-unorm",ASTC12x10UnormSRGB:"astc-12x10-unorm-srgb",ASTC12x12Unorm:"astc-12x12-unorm",ASTC12x12UnormSRGB:"astc-12x12-unorm-srgb"},Cx={ClampToEdge:"clamp-to-edge",Repeat:"repeat",MirrorRepeat:"mirror-repeat"},Bu={Linear:"linear",Nearest:"nearest"},yn={Zero:"zero",One:"one",Src:"src",OneMinusSrc:"one-minus-src",SrcAlpha:"src-alpha",OneMinusSrcAlpha:"one-minus-src-alpha",Dst:"dst",OneMinusDstColor:"one-minus-dst",DstAlpha:"dst-alpha",OneMinusDstAlpha:"one-minus-dst-alpha",SrcAlphaSaturated:"src-alpha-saturated",Constant:"constant",OneMinusConstant:"one-minus-constant"},yu={Add:"add",Subtract:"subtract",ReverseSubtract:"reverse-subtract",Min:"min",Max:"max"},vC={None:0,All:15},cc={Keep:"keep",Zero:"zero",Replace:"replace",Invert:"invert",IncrementClamp:"increment-clamp",DecrementClamp:"decrement-clamp",IncrementWrap:"increment-wrap",DecrementWrap:"decrement-wrap"},Px={Storage:"storage",ReadOnlyStorage:"read-only-storage"},Lx={WriteOnly:"write-only",ReadOnly:"read-only",ReadWrite:"read-write"}
4018,yC={NonFiltering:"non-filtering",Comparison:"comparison"},xu={Float:"float",UnfilterableFloat:"unfilterable-float",Depth:"depth",SInt:"sint",UInt:"uint"},xC={TwoD:"2d",ThreeD:"3d"},Dr={TwoD:"2d",TwoDArray:"2d-array",Cube:"cube",ThreeD:"3d"},ore={All:"all"},hg={Vertex:"vertex",Instance:"instance"},zb={DepthClipControl:"depth-clip-control",Depth32FloatStencil8:"depth32float-stencil8",TextureCompressionBC:"texture-compression-bc",TextureCompressionETC2:"texture-compression-etc2",TextureCompressionASTC:"texture-compression-astc",TimestampQuery:"timestamp-query",IndirectFirstInstance:"indirect-first-instance",ShaderF16:"shader-f16",RG11B10UFloat:"rg11b10ufloat-renderable",BGRA8UNormStorage:"bgra8unorm-storage",Float32Filterable:"float32-filterable",ClipDistances:"clip-distances",DualSourceBlending:"dual-source-blending",Subgroups:"subgroups"};class are extends Mw{constructor(e,t){super(e),this.texture=t,this.version=t?t.version:0,this.isSampler=!0}}class lre extends are{constructor(e,t,n){super(e,t?t.value:null),this.textureNode=t,this.groupNode=n}update(){this.texture=this.textureNode.value}}class cre extends hI{constructor(e,t){super(e,t?t.array:null),this.attribute=t,this.isStorageBuffer=!0}}let ure=0;class hre extends cre{constructor(e,t){super("StorageBuffer_"+ure++,e?e.value:null),this.nodeUniform=e,this.access=e?e.access:as.READ_WRITE,this.groupNode=t}get buffer(){return this.nodeUniform.value}}class dre extends Zc{constructor(e){super(),this.device=e;const t=`
4019struct VarysStruct {
4020	@builtin( position ) Position: vec4<f32>,
4021	@location( 0 ) vTex : vec2<f32>
4022};
4023
4024@vertex
4025fn main( @builtin( vertex_index ) vertexIndex : u32 ) -> VarysStruct {
4026
4027	var Varys : VarysStruct;
4028
4029	var pos = array< vec2<f32>, 4 >(
4030		vec2<f32>( -1.0,  1.0 ),
4031		vec2<f32>(  1.0,  1.0 ),
4032		vec2<f32>( -1.0, -1.0 ),
4033		vec2<f32>(  1.0, -1.0 )
4034	);
4035
4036	var tex = array< vec2<f32>, 4 >(
4037		vec2<f32>( 0.0, 0.0 ),
4038		vec2<f32>( 1.0, 0.0 ),
4039		vec2<f32>( 0.0, 1.0 ),
4040		vec2<f32>( 1.0, 1.0 )
4041	);
4042
4043	Varys.vTex = tex[ vertexIndex ];
4044	Varys.Position = vec4<f32>( pos[ vertexIndex ], 0.0, 1.0 );
4045
4046	return Varys;
4047
4048}
4049`,n=`
4050@group( 0 ) @binding( 0 )
4051var imgSampler : sampler;
4052
4053@group( 0 ) @binding( 1 )
4054var img : texture_2d<f32>;
4055
4056@fragment
4057fn main( @location( 0 ) vTex : vec2<f32> ) -> @location( 0 ) vec4<f32> {
4058
4059	return textureSample( img, imgSampler, vTex );
4060
4061}
4062`,r=`
4063@group( 0 ) @binding( 0 )
4064var imgSampler : sampler;
4065
4066@group( 0 ) @binding( 1 )
4067var img : texture_2d<f32>;
4068
4069@fragment
4070fn main( @location( 0 ) vTex : vec2<f32> ) -> @location( 0 ) vec4<f32> {
4071
4072	return textureSample( img, imgSampler, vec2( vTex.x, 1.0 - vTex.y ) );
4073
4074}
4075`;this.mipmapSampler=e.createSampler({minFilter:Bu.Linear}),this.flipYSampler=e.createSampler({minFilter:Bu.Nearest}),this.transferPipelines={},this.flipYPipelines={},this.mipmapVertexShaderModule=e.createShaderModule({label:"mipmapVertex",code:t}),this.mipmapFragmentShaderModule=e.createShaderModule({label:"mipmapFragment",code:n}),this.flipYFragmentShaderModule=e.createShaderModule({label:"flipYFragment",code:r})}getTransferPipeline(e){let t=this.transferPipelines[e];return t===void 0&&(t=this.device.createRenderPipeline({label:`mipmap-${e}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.mipmapFragmentShaderModule,entryPoint:"main",targets:[{format:e}]},primitive:{topology:kd.TriangleStrip,stripIndexFormat:Nf.Uint32},layout:"auto"}),this.transferPipelines[e]=t),t}getFlipYPipeline(e){let t=this.flipYPipelines[e];return t===void 0&&(t=this.device.createRenderPipeline({label:`flipY-${e}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.flipYFragmentShaderModule,entryPoint:"main",targets:[{format:e}]},primitive:{topology:kd.TriangleStrip,stripIndexFormat:Nf.Uint32},layout:"auto"}),this.flipYPipelines[e]=t),t}flipY(e,t,n=0){const r=t.format,{width:s,height:o}=t.size,a=this.getTransferPipeline(r),l=this.getFlipYPipeline(r),c=this.device.createTexture({size:{width:s,height:o,depthOrArrayLayers:1},format:r,usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING}),u=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:Dr.TwoD,baseArrayLayer:n}),p=c.createView({baseMipLevel:0,mipLevelCount:1,dimension:Dr.TwoD,baseArrayLayer:0}),m=this.device.createCommandEncoder({}),g=(v,b,M)=>{const x=v.getBindGroupLayout(0),w=this.device.createBindGroup({layout:x,entries:[{binding:0,resource:this.flipYSampler},{binding:1,resource:b}]}),R=m.beginRenderPass({colorAttachments:[{view:M,loadOp:Xn.Clear,storeOp:vs.Store,clearValue:[0,0,0,0]}]});R.setPipeline(v),R.setBindGroup(0,w),R.draw(4,1,0,0),R.end()};g(a,u,p),g(l,p,u),this.device.queue.submit([m.finish()]),c.destroy()}generateMipmaps(e,t,n=0){const r=this.get(e);r.useCount===void 0&&(r.useCount=0,r.layers=[]);
4075const s=r.layers[n]||this._mipmapCreateBundles(e,t,n),o=this.device.createCommandEncoder({});this._mipmapRunBundles(o,s),this.device.queue.submit([o.finish()]),r.useCount!==0&&(r.layers[n]=s),r.useCount++}_mipmapCreateBundles(e,t,n){const r=this.getTransferPipeline(t.format),s=r.getBindGroupLayout(0);let o=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:Dr.TwoD,baseArrayLayer:n});const a=[];for(let l=1;l<t.mipLevelCount;l++){const c=this.device.createBindGroup({layout:s,entries:[{binding:0,resource:this.mipmapSampler},{binding:1,resource:o}]}),u=e.createView({baseMipLevel:l,mipLevelCount:1,dimension:Dr.TwoD,baseArrayLayer:n}),p={colorAttachments:[{view:u,loadOp:Xn.Clear,storeOp:vs.Store,clearValue:[0,0,0,0]}]},m=this.device.createRenderBundleEncoder({colorFormats:[t.format]});m.setPipeline(r),m.setBindGroup(0,c),m.draw(4,1,0,0),a.push({renderBundles:[m.finish()],passDescriptor:p}),o=u}return a}_mipmapRunBundles(e,t){const n=t.length;for(let r=0;r<n;r++){const s=t[r],o=e.beginRenderPass(s.passDescriptor);o.executeBundles(s.renderBundles),o.end()}}}const fre={[DS]:"never",[E1]:"less",[IS]:"equal",[R1]:"less-equal",[BS]:"greater",[US]:"greater-equal",[OS]:"always",[FS]:"not-equal"},pre=[0,1,3,2,4,5];class Are{constructor(e){this.backend=e,this._passUtils=null,this.defaultTexture={},this.defaultCubeTexture={},this.defaultVideoFrame=null,this.colorBuffer=null,this.depthTexture=new $s,this.depthTexture.name="depthBuffer"}createSampler(e){const t=this.backend,n=t.device,r=t.get(e),s={addressModeU:this._convertAddressMode(e.wrapS),addressModeV:this._convertAddressMode(e.wrapT),addressModeW:this._convertAddressMode(e.wrapR),magFilter:this._convertFilterMode(e.magFilter),minFilter:this._convertFilterMode(e.minFilter),mipmapFilter:this._convertFilterMode(e.minFilter),maxAnisotropy:1};s.magFilter===Bu.Linear&&s.minFilter===Bu.Linear&&s.mipmapFilter===Bu.Linear&&(s.maxAnisotropy=e.anisotropy),e.isDepthTexture&&e.compareFunction!==null&&(s.compare=fre[e.compareFunction]),r.sampler=n.createSampler(s)}createDefaultTexture(e){let t;const n=Vb(e);e.isCubeTexture?t=this._getDefaultCubeTextureGPU(n):e.isVideoTexture?this.backend.get(e).externalTexture=this._getDefaultVideoFrame():t=this._getDefaultTextureGPU(n),this.backend.get(e).texture=t}createTexture(e,t={}){const n=this.backend,r=n.get(e);if(r.initialized)throw new Error("WebGPUTextureUtils: Texture already initialized.");t.needsMipmaps===void 0&&(t.needsMipmaps=!1),t.levels===void 0&&(t.levels=1),t.depth===void 0&&(t.depth=1);const{width:s,height:o,depth:a,levels:l}=t;e.isFramebufferTexture&&(t.renderTarget?t.format=this.backend.utils.getCurrentColorFormat(t.renderTarget):t.format=this.backend.utils.getPreferredCanvasFormat());const c=this._getDimension(e),u=e.internalFormat||t.format||Vb(e,n.device);r.format=u;const{samples:p,primarySamples:m,isMSAA:g}=n.utils.getTextureSampleData(e);let v=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC;e.isStorageTexture===!0&&(v|=GPUTextureUsage.STORAGE_BINDING),e.isCompressedTexture!==!0&&e.isCompressedArrayTexture!==!0&&(v|=GPUTextureUsage.RENDER_ATTACHMENT);const b={label:e.name,size:{width:s,height:o,depthOrArrayLayers:a},mipLevelCount:l,sampleCount:m,dimension:c,format:u,usage:v};if(e.isVideoTexture){const M=e.source.data,x=new VideoFrame(M);b.size.width=x.displayWidth,b.size.height=x.displayHeight,x.close(),r.externalTexture=M}else{if(u===void 0){console.warn("WebGPURenderer: Texture format not supported."),this.createDefaultTexture(e);return}e.isCubeTexture&&(b.textureBindingViewDimension=Dr.Cube),r.texture=n.device.createTexture(b)}if(g){const M=Object.assign({},b);M.label=M.label+"-msaa",M.sampleCount=p,r.msaaTexture=n.device.createTexture(M)}r.initialized=!0,r.textureDescriptorGPU=b}destroyTexture(e){const t=this.backend,n=t.get(e);n.texture!==void 0&&n.texture.destroy(),n.msaaTexture!==void 0&&n.msaaTexture.destroy(),t.delete(e)}destroySampler(e){const n=this.backend.get(e);delete n.sampler}generateMipmaps(e){const t=this.backend.get(e);if(e.isCubeTexture)for(let n=0;n<6;n++)this._generateMipmaps(t.texture,t.textureDescriptorGPU,n);else{const n=e.image.depth||1;for(let r=0;r<n;r++)this._generateMipmaps(t.texture,t.textureDescriptorGPU,r)}}getColorBuffer(){this.colorBuffer&&this.colorBuffer.destroy();const e=this.backend,{width:t,height:n}=e.getDrawingBufferSize();return this.colorBuffer=e.device.createTexture({label:"colorBuffer",size:{width:t,height:n,depthOrArrayLayers:1}
4075,sampleCount:e.utils.getSampleCount(e.renderer.samples),format:e.utils.getPreferredCanvasFormat(),usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC}),this.colorBuffer}getDepthBuffer(e=!0,t=!1){const n=this.backend,{width:r,height:s}=n.getDrawingBufferSize(),o=this.depthTexture,a=n.get(o).texture;let l,c;if(t?(l=So,c=xo):e&&(l=bo,c=mi),a!==void 0){if(o.image.width===r&&o.image.height===s&&o.format===l&&o.type===c)return a;this.destroyTexture(o)}return o.name="depthBuffer",o.format=l,o.type=c,o.image.width=r,o.image.height=s,this.createTexture(o,{width:r,height:s}),n.get(o).texture}updateTexture(e,t){const n=this.backend.get(e),{textureDescriptorGPU:r}=n;if(!(e.isRenderTargetTexture||r===void 0)){if(e.isDataTexture)this._copyBufferToTexture(t.image,n.texture,r,0,e.flipY);else if(e.isDataArrayTexture||e.isDepthArrayTexture||e.isData3DTexture)for(let s=0;s<t.image.depth;s++)this._copyBufferToTexture(t.image,n.texture,r,s,e.flipY,s);else if(e.isCompressedTexture||e.isCompressedArrayTexture)this._copyCompressedBufferToTexture(e.mipmaps,n.texture,r);else if(e.isCubeTexture)this._copyCubeMapToTexture(t.images,n.texture,r,e.flipY);else if(e.isVideoTexture){const s=e.source.data;n.externalTexture=s}else this._copyImageToTexture(t.image,n.texture,r,0,e.flipY);n.version=e.version,e.onUpdate&&e.onUpdate(e)}}async copyTextureToBuffer(e,t,n,r,s,o){const a=this.backend.device,l=this.backend.get(e),c=l.texture,u=l.textureDescriptorGPU.format,p=this._getBytesPerTexel(u);let m=r*p;m=Math.ceil(m/256)*256;const g=a.createBuffer({size:r*s*p,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),v=a.createCommandEncoder();v.copyTextureToBuffer({texture:c,origin:{x:t,y:n,z:o}},{buffer:g,bytesPerRow:m},{width:r,height:s});const b=this._getTypedArrayType(u);a.queue.submit([v.finish()]),await g.mapAsync(GPUMapMode.READ);const M=g.getMappedRange();return new b(M)}_isEnvironmentTexture(e){const t=e.mapping;return t===eh||t===th||t===Aa||t===ma}_getDefaultTextureGPU(e){let t=this.defaultTexture[e];if(t===void 0){const n=new Cs;n.minFilter=xi,n.magFilter=xi,this.createTexture(n,{width:1,height:1,format:e}),this.defaultTexture[e]=t=n}return this.backend.get(t).texture}_getDefaultCubeTextureGPU(e){let t=this.defaultTexture[e];if(t===void 0){const n=new L1;n.minFilter=xi,n.magFilter=xi,this.createTexture(n,{width:1,height:1,depth:6}),this.defaultCubeTexture[e]=t=n}return this.backend.get(t).texture}_getDefaultVideoFrame(){let e=this.defaultVideoFrame;if(e===null){const t={timestamp:0,codedWidth:1,codedHeight:1,format:"RGBA"};this.defaultVideoFrame=e=new VideoFrame(new Uint8Array([0,0,0,255]),t)}return e}_copyCubeMapToTexture(e,t,n,r){for(let s=0;s<6;s++){const o=e[s],a=r===!0?pre[s]:s;o.isDataTexture?this._copyBufferToTexture(o.image,t,n,a,r):this._copyImageToTexture(o,t,n,a,r)}}_copyImageToTexture(e,t,n,r,s){this.backend.device.queue.copyExternalImageToTexture({source:e,flipY:s},{texture:t,mipLevel:0,origin:{x:0,y:0,z:r}},{width:e.width,height:e.height,depthOrArrayLayers:1})}_getPassUtils(){let e=this._passUtils;return e===null&&(this._passUtils=e=new dre(this.backend.device)),e}_generateMipmaps(e,t,n=0){this._getPassUtils().generateMipmaps(e,t,n)}_flipY(e,t,n=0){this._getPassUtils().flipY(e,t,n)}_copyBufferToTexture(e,t,n,r,s,o=0){const a=this.backend.device,l=e.data,c=this._getBytesPerTexel(n.format),u=e.width*c;a.queue.writeTexture({texture:t,mipLevel:0,origin:{x:0,y:0,z:r}},l,{offset:e.width*e.height*c*o,bytesPerRow:u},{width:e.width,height:e.height,depthOrArrayLayers:1}),s===!0&&this._flipY(t,n,r)}_copyCompressedBufferToTexture(e,t,n){const r=this.backend.device,s=this._getBlockData(n.format),o=n.size.depthOrArrayLayers>1;for(let a=0;a<e.length;a++){const l=e[a],c=l.width,u=l.height,p=o?n.size.depthOrArrayLayers:1,m=Math.ceil(c/s.width)*s.byteLength,g=m*Math.ceil(u/s.height);for(let v=0;v<p;v++)r.queue.writeTexture({texture:t,mipLevel:a,origin:{x:0,y:0,z:v}},l.data,{offset:v*g,bytesPerRow:m,rowsPerImage:Math.ceil(u/s.height)},{width:Math.ceil(c/s.width)*s.width,height:Math.ceil(u/s.height)*s.height,depthOrArrayLayers:1})}}_getBlockData(e){if(e===be.BC1RGBAUnorm||e===be.BC1RGBAUnormSRGB)return{byteLength:8,width:4,height:4};if(e===be.BC2RGBAUnorm||e===be.BC2RGBAUnormSRGB)return{byteLength:16,width:4,height:4};if(e===be.BC3RGBAUnorm||e===be.BC3RGBAUnormSRGB)return{byteLength:16,width:4,height:4};if(e===be.BC4RUnorm||e===be.BC4RSnorm)return{byteLength:8,width:4,height:4};
4075if(e===be.BC5RGUnorm||e===be.BC5RGSnorm)return{byteLength:16,width:4,height:4};if(e===be.BC6HRGBUFloat||e===be.BC6HRGBFloat)return{byteLength:16,width:4,height:4};if(e===be.BC7RGBAUnorm||e===be.BC7RGBAUnormSRGB)return{byteLength:16,width:4,height:4};if(e===be.ETC2RGB8Unorm||e===be.ETC2RGB8UnormSRGB)return{byteLength:8,width:4,height:4};if(e===be.ETC2RGB8A1Unorm||e===be.ETC2RGB8A1UnormSRGB)return{byteLength:8,width:4,height:4};if(e===be.ETC2RGBA8Unorm||e===be.ETC2RGBA8UnormSRGB)return{byteLength:16,width:4,height:4};if(e===be.EACR11Unorm)return{byteLength:8,width:4,height:4};if(e===be.EACR11Snorm)return{byteLength:8,width:4,height:4};if(e===be.EACRG11Unorm)return{byteLength:16,width:4,height:4};if(e===be.EACRG11Snorm)return{byteLength:16,width:4,height:4};if(e===be.ASTC4x4Unorm||e===be.ASTC4x4UnormSRGB)return{byteLength:16,width:4,height:4};if(e===be.ASTC5x4Unorm||e===be.ASTC5x4UnormSRGB)return{byteLength:16,width:5,height:4};if(e===be.ASTC5x5Unorm||e===be.ASTC5x5UnormSRGB)return{byteLength:16,width:5,height:5};if(e===be.ASTC6x5Unorm||e===be.ASTC6x5UnormSRGB)return{byteLength:16,width:6,height:5};if(e===be.ASTC6x6Unorm||e===be.ASTC6x6UnormSRGB)return{byteLength:16,width:6,height:6};if(e===be.ASTC8x5Unorm||e===be.ASTC8x5UnormSRGB)return{byteLength:16,width:8,height:5};if(e===be.ASTC8x6Unorm||e===be.ASTC8x6UnormSRGB)return{byteLength:16,width:8,height:6};if(e===be.ASTC8x8Unorm||e===be.ASTC8x8UnormSRGB)return{byteLength:16,width:8,height:8};if(e===be.ASTC10x5Unorm||e===be.ASTC10x5UnormSRGB)return{byteLength:16,width:10,height:5};if(e===be.ASTC10x6Unorm||e===be.ASTC10x6UnormSRGB)return{byteLength:16,width:10,height:6};if(e===be.ASTC10x8Unorm||e===be.ASTC10x8UnormSRGB)return{byteLength:16,width:10,height:8};if(e===be.ASTC10x10Unorm||e===be.ASTC10x10UnormSRGB)return{byteLength:16,width:10,height:10};if(e===be.ASTC12x10Unorm||e===be.ASTC12x10UnormSRGB)return{byteLength:16,width:12,height:10};if(e===be.ASTC12x12Unorm||e===be.ASTC12x12UnormSRGB)return{byteLength:16,width:12,height:12}}_convertAddressMode(e){let t=Cx.ClampToEdge;return e===ih?t=Cx.Repeat:e===rh&&(t=Cx.MirrorRepeat),t}_convertFilterMode(e){let t=Bu.Linear;return(e===xi||e===PS||e===Ll)&&(t=Bu.Nearest),t}_getBytesPerTexel(e){if(e===be.R8Unorm||e===be.R8Snorm||e===be.R8Uint||e===be.R8Sint)return 1;if(e===be.R16Uint||e===be.R16Sint||e===be.R16Float||e===be.RG8Unorm||e===be.RG8Snorm||e===be.RG8Uint||e===be.RG8Sint)return 2;if(e===be.R32Uint||e===be.R32Sint||e===be.R32Float||e===be.RG16Uint||e===be.RG16Sint||e===be.RG16Float||e===be.RGBA8Unorm||e===be.RGBA8UnormSRGB||e===be.RGBA8Snorm||e===be.RGBA8Uint||e===be.RGBA8Sint||e===be.BGRA8Unorm||e===be.BGRA8UnormSRGB||e===be.RGB9E5UFloat||e===be.RGB10A2Unorm||e===be.RG11B10UFloat||e===be.Depth32Float||e===be.Depth24Plus||e===be.Depth24PlusStencil8||e===be.Depth32FloatStencil8)return 4;if(e===be.RG32Uint||e===be.RG32Sint||e===be.RG32Float||e===be.RGBA16Uint||e===be.RGBA16Sint||e===be.RGBA16Float)return 8;if(e===be.RGBA32Uint||e===be.RGBA32Sint||e===be.RGBA32Float)return 16}_getTypedArrayType(e){if(e===be.R8Uint)return Uint8Array;
4075if(e===be.R8Sint)return Int8Array;if(e===be.R8Unorm)return Uint8Array;if(e===be.R8Snorm)return Int8Array;if(e===be.RG8Uint)return Uint8Array;if(e===be.RG8Sint)return Int8Array;if(e===be.RG8Unorm)return Uint8Array;if(e===be.RG8Snorm)return Int8Array;if(e===be.RGBA8Uint)return Uint8Array;if(e===be.RGBA8Sint)return Int8Array;if(e===be.RGBA8Unorm)return Uint8Array;if(e===be.RGBA8Snorm)return Int8Array;if(e===be.R16Uint)return Uint16Array;if(e===be.R16Sint)return Int16Array;if(e===be.RG16Uint)return Uint16Array;if(e===be.RG16Sint)return Int16Array;if(e===be.RGBA16Uint)return Uint16Array;if(e===be.RGBA16Sint)return Int16Array;if(e===be.R16Float||e===be.RG16Float||e===be.RGBA16Float)return Uint16Array;if(e===be.R32Uint)return Uint32Array;if(e===be.R32Sint)return Int32Array;if(e===be.R32Float)return Float32Array;if(e===be.RG32Uint)return Uint32Array;if(e===be.RG32Sint)return Int32Array;if(e===be.RG32Float)return Float32Array;if(e===be.RGBA32Uint)return Uint32Array;if(e===be.RGBA32Sint)return Int32Array;if(e===be.RGBA32Float)return Float32Array;if(e===be.BGRA8Unorm||e===be.BGRA8UnormSRGB)return Uint8Array;
4075if(e===be.RGB10A2Unorm||e===be.RGB9E5UFloat||e===be.RG11B10UFloat)return Uint32Array;if(e===be.Depth32Float)return Float32Array;if(e===be.Depth24Plus||e===be.Depth24PlusStencil8)return Uint32Array;if(e===be.Depth32FloatStencil8)return Float32Array}_getDimension(e){let t;return e.isData3DTexture?t=xC.ThreeD:t=xC.TwoD,t}}function Vb(i,e=null){const t=i.format,n=i.type,r=i.colorSpace;let s;if(i.isCompressedTexture===!0||i.isCompressedArrayTexture===!0)switch(t){case Lc:s=r===Xt?be.BC1RGBAUnormSRGB:be.BC1RGBAUnorm;break;case Nc:s=r===Xt?be.BC2RGBAUnormSRGB:be.BC2RGBAUnorm;break;case Dc:s=r===Xt?be.BC3RGBAUnormSRGB:be.BC3RGBAUnorm;break;case af:s=r===Xt?be.ETC2RGB8UnormSRGB:be.ETC2RGB8Unorm;break;case lf:s=r===Xt?be.ETC2RGBA8UnormSRGB:be.ETC2RGBA8Unorm;break;case cf:s=r===Xt?be.ASTC4x4UnormSRGB:be.ASTC4x4Unorm;break;case uf:s=r===Xt?be.ASTC5x4UnormSRGB:be.ASTC5x4Unorm;break;case hf:s=r===Xt?be.ASTC5x5UnormSRGB:be.ASTC5x5Unorm;break;case df:s=r===Xt?be.ASTC6x5UnormSRGB:be.ASTC6x5Unorm;break;case ff:s=r===Xt?be.ASTC6x6UnormSRGB:be.ASTC6x6Unorm;break;case pf:s=r===Xt?be.ASTC8x5UnormSRGB:be.ASTC8x5Unorm;break;case Af:s=r===Xt?be.ASTC8x6UnormSRGB:be.ASTC8x6Unorm;break;case mf:s=r===Xt?be.ASTC8x8UnormSRGB:be.ASTC8x8Unorm;break;case gf:s=r===Xt?be.ASTC10x5UnormSRGB:be.ASTC10x5Unorm;break;case _f:s=r===Xt?be.ASTC10x6UnormSRGB:be.ASTC10x6Unorm;break;case vf:s=r===Xt?be.ASTC10x8UnormSRGB:be.ASTC10x8Unorm;break;case yf:s=r===Xt?be.ASTC10x10UnormSRGB:be.ASTC10x10Unorm;break;case xf:s=r===Xt?be.ASTC12x10UnormSRGB:be.ASTC12x10Unorm;break;case bf:s=r===Xt?be.ASTC12x12UnormSRGB:be.ASTC12x12Unorm;break;case Yi:s=r===Xt?be.RGBA8UnormSRGB:be.RGBA8Unorm;break;default:console.error("WebGPURenderer: Unsupported texture format.",t)}else switch(t){case Yi:switch(n){case Gu:s=be.RGBA8Snorm;break;case qu:s=be.RGBA16Sint;break;case la:s=be.RGBA16Uint;break;case mi:s=be.RGBA32Uint;break;case Ir:s=be.RGBA32Sint;break;case Gi:s=r===Xt?be.RGBA8UnormSRGB:be.RGBA8Unorm;break;case dr:s=be.RGBA16Float;break;case er:s=be.RGBA32Float;break;default:console.error("WebGPURenderer: Unsupported texture type with RGBAFormat.",n)}break;case R0:switch(n){case T1:s=be.RGB9E5UFloat;break;default:console.error("WebGPURenderer: Unsupported texture type with RGBFormat.",n)}break;case C0:switch(n){case Gu:s=be.R8Snorm;break;case qu:s=be.R16Sint;break;case la:s=be.R16Uint;break;case mi:s=be.R32Uint;break;case Ir:s=be.R32Sint;break;case Gi:s=be.R8Unorm;break;case dr:s=be.R16Float;break;case er:s=be.R32Float;break;default:console.error("WebGPURenderer: Unsupported texture type with RedFormat.",n)}break;case Nl:switch(n){case Gu:s=be.RG8Snorm;break;case qu:s=be.RG16Sint;break;case la:s=be.RG16Uint;break;case mi:s=be.RG32Uint;break;case Ir:s=be.RG32Sint;break;case Gi:s=be.RG8Unorm;break;case dr:s=be.RG16Float;break;case er:s=be.RG32Float;break;default:console.error("WebGPURenderer: Unsupported texture type with RGFormat.",n)}break;case bo:switch(n){case la:s=be.Depth16Unorm;break;case mi:s=be.Depth24Plus;break;case er:s=be.Depth32Float;break;default:console.error("WebGPURenderer: Unsupported texture type with DepthFormat.",n)}break;case So:switch(n){case xo:s=be.Depth24PlusStencil8;break;case er:e&&e.features.has(zb.Depth32FloatStencil8)===!1&&console.error('WebGPURenderer: Depth textures with DepthStencilFormat + FloatType can only be used with the "depth32float-stencil8" GPU feature.'),s=be.Depth32FloatStencil8;break;default:console.error("WebGPURenderer: Unsupported texture type with DepthStencilFormat.",n)}break;case Vf:switch(n){case Ir:s=be.R32Sint;break;case mi:s=be.R32Uint;break;default:console.error("WebGPURenderer: Unsupported texture type with RedIntegerFormat.",n)}break;case Gf:switch(n){case Ir:s=be.RG32Sint;break;case mi:s=be.RG32Uint;break;default:console.error("WebGPURenderer: Unsupported texture type with RGIntegerFormat.",n)}break;case qf:switch(n){case Ir:s=be.RGBA32Sint;break;case mi:s=be.RGBA32Uint;break;default:console.error("WebGPURenderer: Unsupported texture type with RGBAIntegerFormat.",n)}break;default:console.error("WebGPURenderer: Unsupported texture format.",t)}return s}const mre=/^[fn]*\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)\s*[\-\>]*\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/i,gre=/([a-z_0-9]+)\s*:\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/ig,bC={f32:"float",i32:"int",u32:"uint",bool:"bool","vec2<f32>":"vec2","vec2<i32>":"ivec2","vec2<u32>":"uvec2","vec2<bool>":"bvec2",vec2f:"vec2",vec2i:"ivec2",vec2u:"uvec2",vec2b:"bvec2","vec3<f32>":"vec3","vec3<i32>":"ivec3","vec3<u32>":"uvec3","vec3<bool>":"bvec3",vec3f:"vec3",vec3i:"ivec3",vec3u:"uvec3",vec3b:"bvec3","vec4<f32>":"vec4","vec4<i32>":"ivec4","vec4<u32>":"uvec4","vec4<bool>":"bvec4",vec4f:"vec4",vec4i:"ivec4",vec4u:"uvec4",vec4b:"bvec4","mat2x2<f32>":"mat2",mat2x2f:"mat2","mat3x3<f32>":"mat3",mat3x3f:"mat3","mat4x4<f32>
4075":"mat4",mat4x4f:"mat4",sampler:"sampler",texture_1d:"texture",texture_2d:"texture",texture_2d_array:"texture",texture_multisampled_2d:"cubeTexture",texture_depth_2d:"depthTexture",texture_depth_2d_array:"depthTexture",texture_depth_multisampled_2d:"depthTexture",texture_depth_cube:"depthTexture",texture_depth_cube_array:"depthTexture",texture_3d:"texture3D",texture_cube:"cubeTexture",texture_cube_array:"cubeTexture",texture_storage_1d:"storageTexture",texture_storage_2d:"storageTexture",texture_storage_2d_array:"storageTexture",texture_storage_3d:"storageTexture"},_re=i=>{i=i.trim();const e=i.match(mre);if(e!==null&&e.length===4){const t=e[2],n=[];let r=null;for(;(r=gre.exec(t))!==null;)n.push({name:r[1],type:r[2]});const s=[];for(let u=0;u<n.length;u++){const{name:p,type:m}=n[u];let g=m;g.startsWith("ptr")?g="pointer":(g.startsWith("texture")&&(g=m.split("<")[0]),g=bC[g]),s.push(new bw(g,p))}const o=i.substring(e[0].length),a=e[3]||"void",l=e[1]!==void 0?e[1]:"";return{type:bC[a]||a,inputs:s,name:l,inputsCode:t,blockCode:o,outputType:a}}else throw new Error("FunctionNode: Function is not a WGSL code.")};class vre extends Sw{constructor(e){const{type:t,inputs:n,name:r,inputsCode:s,blockCode:o,outputType:a}=_re(e);super(t,n,r),this.inputsCode=s,this.blockCode=o,this.outputType=a}getCode(e=this.name){const t=this.outputType!=="void"?"-> "+this.outputType:"";return`fn ${e} ( ${this.inputsCode.trim()} ) ${t}`+this.blockCode}}class yre extends cI{parseFunction(e){return new vre(e)}}const td=typeof self<"u"?self.GPUShaderStage:{VERTEX:1,FRAGMENT:2,COMPUTE:4},xre={[as.READ_ONLY]:"read",[as.WRITE_ONLY]:"write",[as.READ_WRITE]:"read_write"},SC={[ih]:"repeat",[ka]:"clamp",[rh]:"mirror"},dg={vertex:td?td.VERTEX:1,fragment:td?td.FRAGMENT:2,compute:td?td.COMPUTE:4},MC={instance:!0,swizzleAssign:!1,storageBuffer:!0},bre={"^^":"tsl_xor"},Sre={float:"f32",int:"i32",uint:"u32",bool:"bool",color:"vec3<f32>",vec2:"vec2<f32>",ivec2:"vec2<i32>",uvec2:"vec2<u32>",bvec2:"vec2<bool>",vec3:"vec3<f32>",ivec3:"vec3<i32>",uvec3:"vec3<u32>",bvec3:"vec3<bool>",vec4:"vec4<f32>",ivec4:"vec4<i32>",uvec4:"vec4<u32>",bvec4:"vec4<bool>",mat2:"mat2x2<f32>",mat3:"mat3x3<f32>",mat4:"mat4x4<f32>"},wC={},Io={tsl_xor:new lr("fn tsl_xor( a : bool, b : bool ) -> bool { return ( a || b ) && !( a && b ); }"),mod_float:new lr("fn tsl_mod_float( x : f32, y : f32 ) -> f32 { return x - y * floor( x / y ); }"),mod_vec2:new lr("fn tsl_mod_vec2( x : vec2f, y : vec2f ) -> vec2f { return x - y * floor( x / y ); }"),mod_vec3:new lr("fn tsl_mod_vec3( x : vec3f, y : vec3f ) -> vec3f { return x - y * floor( x / y ); }"),mod_vec4:new lr("fn tsl_mod_vec4( x : vec4f, y : vec4f ) -> vec4f { return x - y * floor( x / y ); }"),equals_bool:new lr("fn tsl_equals_bool( a : bool, b : bool ) -> bool { return a == b; }"),equals_bvec2:new lr("fn tsl_equals_bvec2( a : vec2f, b : vec2f ) -> vec2<bool> { return vec2<bool>( a.x == b.x, a.y == b.y ); }"),equals_bvec3:new lr("fn tsl_equals_bvec3( a : vec3f, b : vec3f ) -> vec3<bool> { return vec3<bool>( a.x == b.x, a.y == b.y, a.z == b.z ); }"),equals_bvec4:new lr("fn tsl_equals_bvec4( a : vec4f, b : vec4f ) -> vec4<bool> { return vec4<bool>( a.x == b.x, a.y == b.y, a.z == b.z, a.w == b.w ); }"),repeatWrapping_float:new lr("fn tsl_repeatWrapping_float( coord: f32 ) -> f32 { return fract( coord ); }"),mirrorWrapping_float:new lr("fn tsl_mirrorWrapping_float( coord: f32 ) -> f32 { let mirrored = fract( coord * 0.5 ) * 2.0; return 1.0 - abs( 1.0 - mirrored ); }"),clampWrapping_float:new lr("fn tsl_clampWrapping_float( coord: f32 ) -> f32 { return clamp( coord, 0.0, 1.0 ); }"),biquadraticTexture:new lr(`
4076fn tsl_biquadraticTexture( map : texture_2d<f32>, coord : vec2f, iRes : vec2u, level : u32 ) -> vec4f {
4077
4078	let res = vec2f( iRes );
4079
4080	let uvScaled = coord * res;
4081	let uvWrapping = ( ( uvScaled % res ) + res ) % res;
4082
4083	// https://www.shadertoy.com/view/WtyXRy
4084
4085	let uv = uvWrapping - 0.5;
4086	let iuv = floor( uv );
4087	let f = fract( uv );
4088
4089	let rg1 = textureLoad( map, vec2u( iuv + vec2( 0.5, 0.5 ) ) % iRes, level );
4090	let rg2 = textureLoad( map, vec2u( iuv + vec2( 1.5, 0.5 ) ) % iRes, level );
4091	let rg3 = textureLoad( map, vec2u( iuv + vec2( 0.5, 1.5 ) ) % iRes, level );
4092	let rg4 = textureLoad( map, vec2u( iuv + vec2( 1.5, 1.5 ) ) % iRes, level );
4093
4094	return mix( mix( rg1, rg2, f.x ), mix( rg3, rg4, f.x ), f.y );
4095
4096}
4097`)},hA={dFdx:"dpdx",dFdy:"- dpdy",mod_float:"tsl_mod_float",mod_vec2:"tsl_mod_vec2",mod_vec3:"tsl_mod_vec3",mod_vec4:"tsl_mod_vec4",equals_bool:"tsl_equals_bool",equals_bvec2:"tsl_equals_bvec2",equals_bvec3:"tsl_equals_bvec3",equals_bvec4:"tsl_equals_bvec4",inversesqrt:"inverseSqrt",bitcast:"bitcast<f32>"};typeof navigator<"u"&&/Windows/g.test(navigator.userAgent)&&(Io.pow_float=ne
4097w lr("fn tsl_pow_float( a : f32, b : f32 ) -> f32 { return select( -pow( -a, b ), pow( a, b ), a > 0.0 ); }"),Io.pow_vec2=new lr("fn tsl_pow_vec2( a : vec2f, b : vec2f ) -> vec2f { return vec2f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ) ); }",[Io.pow_float]),Io.pow_vec3=new lr("fn tsl_pow_vec3( a : vec3f, b : vec3f ) -> vec3f { return vec3f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ) ); }",[Io.pow_float]),Io.pow_vec4=new lr("fn tsl_pow_vec4( a : vec4f, b : vec4f ) -> vec4f { return vec4f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ), tsl_pow_float( a.w, b.w ) ); }",[Io.pow_float]),hA.pow_float="tsl_pow_float",hA.pow_vec2="tsl_pow_vec2",hA.pow_vec3="tsl_pow_vec3",hA.pow_vec4="tsl_pow_vec4");let vI="";(typeof navigator<"u"&&/Firefox|Deno/g.test(navigator.userAgent))!==!0&&(vI+=`diagnostic( off, derivative_uniformity );
4098`);class Mre extends aI{constructor(e,t){super(e,t,new yre),this.uniformGroups={},this.builtins={},this.directives={},this.scopedArrays=new Map}needsToWorkingColorSpace(e){return e.isVideoTexture===!0&&e.colorSpace!==vo}_generateTextureSample(e,t,n,r,s=this.shaderStage){return s==="fragment"?r?`textureSample( ${t}, ${t}_sampler, ${n}, ${r} )`:`textureSample( ${t}, ${t}_sampler, ${n} )`:this.isFilteredTexture(e)?this.generateFilteredTexture(e,t,n):this.generateTextureLod(e,t,n,r,"0")}_generateVideoSample(e,t,n=this.shaderStage){if(n==="fragment")return`textureSampleBaseClampToEdge( ${e}, ${e}_sampler, vec2<f32>( ${t}.x, 1.0 - ${t}.y ) )`;console.error(`WebGPURenderer: THREE.VideoTexture does not support ${n} shader.`)}_generateTextureSampleLevel(e,t,n,r,s,o=this.shaderStage){return(o==="fragment"||o==="compute")&&this.isUnfilterable(e)===!1?`textureSampleLevel( ${t}, ${t}_sampler, ${n}, ${r} )`:this.isFilteredTexture(e)?this.generateFilteredTexture(e,t,n,r):this.generateTextureLod(e,t,n,s,r)}generateWrapFunction(e){const t=`tsl_coord_${SC[e.wrapS]}S_${SC[e.wrapT]}_${e.isData3DTexture?"3d":"2d"}T`;let n=wC[t];if(n===void 0){const r=[],s=e.isData3DTexture?"vec3f":"vec2f";let o=`fn ${t}( coord : ${s} ) -> ${s} {
4099
4100	return ${s}(
4101`;const a=(l,c)=>{l===ih?(r.push(Io.repeatWrapping_float),o+=`		tsl_repeatWrapping_float( coord.${c} )`):l===ka?(r.push(Io.clampWrapping_float),o+=`		tsl_clampWrapping_float( coord.${c} )`):l===rh?(r.push(Io.mirrorWrapping_float),o+=`		tsl_mirrorWrapping_float( coord.${c} )`):(o+=`		coord.${c}`,console.warn(`WebGPURenderer: Unsupported texture wrap type "${l}" for vertex shader.`))};a(e.wrapS,"x"),o+=`,
4102`,a(e.wrapT,"y"),e.isData3DTexture&&(o+=`,
4103`,a(e.wrapR,"z")),o+=`
4104	);
4105
4106}
4107`,wC[t]=n=new lr(o,r)}return n.build(this),t}generateArrayDeclaration(e,t){return`array< ${this.getType(e)}, ${t} >`}generateTextureDimension(e,t,n){const r=this.getDataFromNode(e,this.shaderStage,this.globalCache);r.dimensionsSnippet===void 0&&(r.dimensionsSnippet={});let s=r.dimensionsSnippet[n];if(r.dimensionsSnippet[n]===void 0){let o,a;const{primarySamples:l}=this.renderer.backend.utils.getTextureSampleData(e),c=l>1;e.isData3DTexture?a="vec3<u32>":a="vec2<u32>",c||e.isVideoTexture||e.isStorageTexture?o=t:o=`${t}${n?`, u32( ${n} )`:""}`,s=new m_(new g_(`textureDimensions( ${o} )`,a)),r.dimensionsSnippet[n]=s,(e.isDataArrayTexture||e.isDepthArrayTexture||e.isData3DTexture)&&(r.arrayLayerCount=new m_(new g_(`textureNumLayers(${t})`,"u32"))),e.isTextureCube&&(r.cubeFaceCount=new m_(new g_("6u","u32")))}return s.build(this)}generateFilteredTexture(e,t,n,r="0u"){this._include("biquadraticTexture");const s=this.generateWrapFunction(e),o=this.generateTextureDimension(e,t,r);return`tsl_biquadraticTexture( ${t}, ${s}( ${n} ), ${o}, u32( ${r} ) )`}generateTextureLod(e,t,n,r,s="0u"){const o=this.generateWrapFunction(e),a=this.generateTextureDimension(e,t,s),l=e.isData3DTexture?"vec3":"vec2",c=`${l}<u32>( ${o}( ${n} ) * ${l}<f32>( ${a} ) )`;return this.generateTextureLoad(e,t,c,r,s)}generateTextureLoad(e,t,n,r,s="0u"){let o;return e.isVideoTexture===!0||e.isStorageTexture===!0?o=`textureLoad( ${t}, ${n} )`:r?o=`textureLoad( ${t}, ${n}, ${r}, u32( ${s} ) )`:(o=`textureLoad( ${t}, ${n}, u32( ${s} ) )`,this.renderer.backend.compatibilityMode&&e.isDepthTexture&&(o+=".x")),o}generateTextureStore(e,t,n,r){return`textureStore( ${t}, ${n}, ${r} )`}isSampleCompare(e){return e.isDepthTexture===!0&&e.compareFunction!==null}isUnfilterable(e){return this.getComponentTypeFromTexture(e)!=="float"||!this.isAvailable("float32Filterable")&&e.isDataTexture===!0&&e.type===er||this.isSampleCompare(e)===!1&&e.minFilter===xi&&e.magFilter===xi||this.renderer.backend.utils.getTextureSampleData(e).primarySamples>1}generateTexture(e,t,n,r,s=this.shaderStage){let o=null;return e.isVideoTexture===!0?o=this._generateVideoSample(t,n,s):this.isUnfilterable(e)?o=this.generateTextureLod(e,t,n,r,"0",s):o=this._generateTextureSample(e,t,n,r,s
4107),o}generateTextureGrad(e,t,n,r,s,o=this.shaderStage){if(o==="fragment")return`textureSampleGrad( ${t}, ${t}_sampler, ${n},  ${r[0]}, ${r[1]} )`;console.error(`WebGPURenderer: THREE.TextureNode.gradient() does not support ${o} shader.`)}generateTextureCompare(e,t,n,r,s,o=this.shaderStage){if(o==="fragment")return e.isDepthArrayTexture?`textureSampleCompare( ${t}, ${t}_sampler, ${n}, ${s}, ${r} )`:`textureSampleCompare( ${t}, ${t}_sampler, ${n}, ${r} )`;console.error(`WebGPURenderer: THREE.DepthTexture.compareFunction() does not support ${o} shader.`)}generateTextureLevel(e,t,n,r,s,o=this.shaderStage){let a=null;return e.isVideoTexture===!0?a=this._generateVideoSample(t,n,o):a=this._generateTextureSampleLevel(e,t,n,r,s,o),a}generateTextureBias(e,t,n,r,s,o=this.shaderStage){if(o==="fragment")return`textureSampleBias( ${t}, ${t}_sampler, ${n}, ${r} )`;console.error(`WebGPURenderer: THREE.TextureNode.biasNode does not support ${o} shader.`)}getPropertyName(e,t=this.shaderStage){if(e.isNodeVarying===!0&&e.needsInterpolation===!0){if(t==="vertex")return`varyings.${e.name}`}else if(e.isNodeUniform===!0){const n=e.name,r=e.type;return r==="texture"||r==="cubeTexture"||r==="storageTexture"||r==="texture3D"?n:r==="buffer"||r==="storageBuffer"||r==="indirectStorageBuffer"?this.isCustomStruct(e)?n:n+".value":e.groupNode.name+"."+n}return super.getPropertyName(e)}getOutputStructName(){return"output"}getFunctionOperator(e){const t=bre[e];return t!==void 0?(this._include(t),t):null}getNodeAccess(e,t){return t!=="compute"?as.READ_ONLY:e.access}getStorageAccess(e,t){return xre[this.getNodeAccess(e,t)]}getUniformFromNode(e,t,n,r=null){const s=super.getUniformFromNode(e,t,n,r),o=this.getDataFromNode(e,n,this.globalCache);if(o.uniformGPU===void 0){let a;const l=e.groupNode,c=l.name,u=this.getBindGroupArray(c,n);if(t==="texture"||t==="cubeTexture"||t==="storageTexture"||t==="texture3D"){let p=null;const m=this.getNodeAccess(e,n);if(t==="texture"||t==="storageTexture"?p=new fv(s.name,s.node,l,m):t==="cubeTexture"?p=new AI(s.name,s.node,l,m):t==="texture3D"&&(p=new mI(s.name,s.node,l,m)),p.store=e.isStorageTextureNode===!0,p.setVisibility(dg[n]),(n==="fragment"||n==="compute")&&this.isUnfilterable(e.value)===!1&&p.store===!1){const g=new lre(`${s.name}_sampler`,s.node,l);g.setVisibility(dg[n]),u.push(g,p),a=[g,p]}else u.push(p),a=[p]}else if(t==="buffer"||t==="storageBuffer"||t==="indirectStorageBuffer"){const p=t==="buffer"?fI:hre,m=new p(e,l);m.setVisibility(dg[n]),u.push(m),a=m,s.name=r||"NodeBuffer_"+s.id}else{const p=this.uniformGroups[n]||(this.uniformGroups[n]={});let m=p[c];m===void 0&&(m=new pI(c,l),m.setVisibility(dg[n]),p[c]=m,u.push(m)),a=this.getNodeUniform(s,t),m.addUniform(a)}o.uniformGPU=a}return s}getBuiltin(e,t,n,r=this.shaderStage){const s=this.builtins[r]||(this.builtins[r]=new Map);return s.has(e)===!1&&s.set(e,{name:e,property:t,type:n}),t}hasBuiltin(e,t=this.shaderStage){return this.builtins[t]!==void 0&&this.builtins[t].has(e)}getVertexIndex(){return this.shaderStage==="vertex"?this.getBuiltin("vertex_index","vertexIndex","u32","attribute"):"vertexIndex"}buildFunctionCode(e){const t=e.layout,n=this.flowShaderNode(e),r=[];for(const o of t.inputs)r.push(o.name+" : "+this.getType(o.type));let s=`fn ${t.name}( ${r.join(", ")} ) -> ${this.getType(t.type)} {
4108${n.vars}
4109${n.code}
4110`;return n.result&&(s+=`	return ${n.result};
4111`),s+=`
4112}
4113`,s}getInstanceIndex(){return this.shaderStage==="vertex"?this.getBuiltin("instance_index","instanceIndex","u32","attribute"):"instanceIndex"}getInvocationLocalIndex(){return this.getBuiltin("local_invocation_index","invocationLocalIndex","u32","attribute")}getSubgroupSize(){return this.enableSubGroups(),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute")}getInvocationSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_invocation_id","invocationSubgroupIndex","u32","attribute")}getSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_id","subgroupIndex","u32","attribute")}getDrawIndex(){return null}getFrontFacing(){return this.getBuiltin("front_facing","isFront","bool")}getFragCoord(){return this.getBuiltin("position","fragCoord","vec4<f32>")+".xy"}getFragDepth(){return"output."+this.getBuiltin("frag_depth","depth","f32","output")}getClipDistance(){return"varyings.hw_clip_distances"}isFlipY(){return!1}enableDirective(e,t=this.shaderStage){(this.directives[t]||(this.directives[t]=new Set)).add(e)}getDirectives(e){const t=[],n=this.directives[e];if(n!==void 0)for(const r of n)t.push(`enable ${r};`);return t.join(`
4114`)}enableSubGroups(){this.enableDirective("subgroups")}enableSubgroupsF16(){this.enableDirective("subgroups-f16")}enableClipDistances(){this.enableDirective("clip_distances")}enableShaderF16(){this.enableDirective("f16")}enableDualSourceBlending(){this.enableDirective("dual_source_blending")}enableHardwareClipping(e){this.enableClipDistances(),this.getBuiltin("clip_distances","hw_clip_distances",`array<f32, ${e} >`,"vertex")}getBuiltins(e){const t=[],n=this.builtins[e];if(n!==void 0)for(const{name:r,property:s,type:o}of n.values())t.push(`@builtin( ${r} ) ${s} : ${o}`);return t.join(`,
4115	`)}getScopedArray(e,t,n,r){return this.scopedArrays.has(e)===!1&&this.scopedArrays.set(e,{name:e,scope:t,bufferType:n,bufferCount:r}),e}getScopedArrays(e){if(e!=="compute")return;const t=[];for(const{name:n,scope:r,bufferType:s,bufferCount:o}of this.scopedArrays.values()){const a=this.getType(s);t.push(`var<${r}> ${n}: array< ${a}, ${o} >;`)}return t.join(`
4116`)}getAttributes(e){const t=[];if(e==="compute"&&(this.getBuiltin("global_invocation_id","globalId","vec3<u32>","attribute"),this.getBuiltin("workgroup_id","workgroupId","vec3<u32>","attribute"),this.getBuiltin("local_invocation_id","localId","vec3<u32>","attribute"),this.getBuiltin("num_workgroups","numWorkgroups","vec3<u32>","attribute"),this.renderer.hasFeature("subgroups")&&(this.enableDirective("subgroups",e),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute"))),e==="vertex"||e==="compute"){const n=this.getBuiltins("attribute");
4116n&&t.push(n);const r=this.getAttributesArray();for(let s=0,o=r.length;s<o;s++){const a=r[s],l=a.name,c=this.getType(a.type);t.push(`@location( ${s} ) ${l} : ${c}`)}}return t.join(`,
4117	`)}getStructMembers(e){const t=[];for(const n of e.members){const r=e.output?"@location( "+n.index+" ) ":"";let s=this.getType(n.type);n.atomic&&(s="atomic< "+s+" >"),t.push(`	${r+n.name} : ${s}`)}return e.output&&t.push(`	${this.getBuiltins("output")}`),t.join(`,
4118`)}getStructs(e){let t="";const n=this.structs[e];if(n.length>0){const r=[];for(const s of n){let o=`struct ${s.name} {
4119`;o+=this.getStructMembers(s),o+=`
4120};`,r.push(o)}t=`
4121`+r.join(`
4122
4123`)+`
4124`}return t}getVar(e,t,n=null){let r=`var ${t} : `;return n!==null?r+=this.generateArrayDeclaration(e,n):r+=this.getType(e),r}getVars(e){const t=[],n=this.vars[e];if(n!==void 0)for(const r of n)t.push(`	${this.getVar(r.type,r.name,r.count)};`);return`
4125${t.join(`
4126`)}
4127`}getVaryings(e){const t=[];if(e==="vertex"&&this.getBuiltin("position","Vertex","vec4<f32>","vertex"),e==="vertex"||e==="fragment"){const s=this.varyings,o=this.vars[e];for(let a=0;a<s.length;a++){const l=s[a];if(l.needsInterpolation){let c=`@location( ${a} )`;if(l.interpolationType){const u=l.interpolationSampling!==null?`, ${l.interpolationSampling} )`:" )";c+=` @interpolate( ${l.interpolationType}${u}`}else/^(int|uint|ivec|uvec)/.test(l.type)&&(c+=` @interpolate( ${this.renderer.backend.compatibilityMode?"flat, either":"flat"} )`);t.push(`${c} ${l.name} : ${this.getType(l.type)}`)}else e==="vertex"&&o.includes(l)===!1&&o.push(l)}}const n=this.getBuiltins(e);n&&t.push(n);const r=t.join(`,
4128	`);return e==="vertex"?this._getWGSLStruct("VaryingsStruct","	"+r):r}isCustomStruct(e){const t=e.value,n=e.node,r=(t.isBufferAttribute||t.isInstancedBufferAttribute)&&n.structTypeNode!==null,s=n.value&&n.value.array&&typeof n.value.itemSize=="number"&&n.value.array.length>n.value.itemSize;return r&&!s}getUniforms(e){const t=this.uniforms[e],n=[],r=[],s=[],o={};for(const l of t){const c=l.groupNode.name,u=this.bindingsIndexes[c];if(l.type==="texture"||l.type==="cubeTexture"||l.type==="storageTexture"||l.type==="texture3D"){const p=l.node.value;(e==="fragment"||e==="compute")&&this.isUnfilterable(p)===!1&&l.node.isStorageTextureNode!==!0&&(this.isSampleCompare(p)?n.push(`@binding( ${u.binding++} ) @group( ${u.group} ) var ${l.name}_sampler : sampler_comparison;`):n.push(`@binding( ${u.binding++} ) @group( ${u.group} ) var ${l.name}_sampler : sampler;`));let m,g="";const{primarySamples:v}=this.renderer.backend.utils.getTextureSampleData(p);if(v>1&&(g="_multisampled"),p.isCubeTexture===!0)m="texture_cube<f32>";else if(p.isDataArrayTexture===!0||p.isCompressedArrayTexture===!0||p.isTextureArray===!0)m="texture_2d_array<f32>";else if(p.isDepthTexture===!0)this.renderer.backend.compatibilityMode&&p.compareFunction===null?m=`texture${g}_2d<f32>`:m=`texture_depth${g}_2d${p.isDepthArrayTexture===!0?"_array":""}`;else if(p.isVideoTexture===!0)m="texture_external";else if(p.isData3DTexture===!0)m="texture_3d<f32>";else if(l.node.isStorageTextureNode===!0){const b=Vb(p),M=this.getStorageAccess(l.node,e);m=`texture_storage_2d<${b}, ${M}>`}else{const b=this.getComponentTypeFromTexture(p).charAt(0);m=`texture${g}_2d<${b}32>`}n.push(`@binding( ${u.binding++} ) @group( ${u.group} ) var ${l.name} : ${m};`)}else if(l.type==="buffer"||l.type==="storageBuffer"||l.type==="indirectStorageBuffer"){const p=l.node,m=this.getType(p.getNodeType(this)),g=p.bufferCount,v=g>0&&l.type==="buffer"?", "+g:"",b=p.isStorageBufferNode?`storage, ${this.getStorageAccess(p,e)}`:"uniform";if(this.isCustomStruct(l))r.push(`@binding( ${u.binding++} ) @group( ${u.group} ) var<${b}> ${l.name} : ${m};`);else{const x=`	value : array< ${p.isAtomic?`atomic<${m}>`:`${m}`}${v} >`;r.push(this._getWGSLStructBinding(l.name,x,b,u.binding++,u.group))}}else{const p=this.getType(this.getVectorType(l.type)),m=l.groupNode.name;(o[m]||(o[m]={index:u.binding++,id:u.group,snippets:[]})).snippets.push(`	${l.name} : ${p}`)}}for(const l in o){const c=o[l];s.push(this._getWGSLStructBinding(l,c.snippets.join(`,
4129`),"uniform",c.index,c.id))}let a=n.join(`
4130`);return a+=r.join(`
4131`),a+=s.join(`
4132`),a}buildCode(){const e=this.material!==null?{fragment:{},vertex:{}}:{compute:{}};this.sortBindingGroups();for(const t in e){this.shaderStage=t;const n=e[t];n.uniforms=this.getUniforms(t),n.attributes=this.getAttributes(t),n.varyings=this.getVaryings(t),n.structs=this.getStructs(t),n.vars=this.getVars(t),n.codes=this.getCodes(t),n.directives=this.getDirectives(t),n.scopedArrays=this.getScopedArrays(t);let r=`// code
4133
4134`;r+=this.flowCode[t];const s=this.flowNodes[t],o=s[s.length-1],a=o.outputNode,l=a!==void 0&&a.isOutputStructNode===!0;for(const c of s){const u=this.getFlowData(c),p=c.name;if(p&&(r.length>0&&(r+=`
4135`),r+=`	// flow -> ${p}
4136`),r+=`${u.code}
4137	`,c===o&&t!=="compute"){if(r+=`// result
4138
4139	`,t==="vertex")r+=`varyings.Vertex = ${u.result};`;else if(t==="fragment")if(l)n.returnType=a.getNodeType(this),n.structs+="var<private> output : "+n.returnType+";",r+=`return ${u.result};`;else{let m="	@location(0) color: vec4<f32>";const g=this.getBuiltins("output");g&&(m+=`,
4140	`+g),n.returnType="OutputStruct",n.structs+=this._getWGSLStruct("OutputStruct",m),n.structs+=`
4141var<private> output : OutputStruct;`,r+=`output.color = ${u.result};
4142
4143	return output;`}}}n.flow=r}this.shaderStage=null,this.material!==null?(this.vertexShader=this._getWGSLVertexCode(e.vertex),this.fragmentShader=this._getWGSLFragmentCode(e.fragment)):this.computeShader=this._getWGSLComputeCode(e.compute,(this.object.workgroupSize||[64]).join(", "))}getMethod(e,t=null){let n;return t!==null&&(n=this._getWGSLMethod(e+"_"+t)),n===void 0&&(n=this._getWGSLMethod(e)),n||e}getType(e){return Sre[e]||e}isAvailable(e){let t=MC[e];return t===void 0&&(e==="float32Filterable"?t=this.renderer.hasFeature("float32-filterable"):e==="clipDistance"&&(t=this.renderer.hasFeature("clip-distances")),MC[e]=t),t}_getWGSLMethod(e){return Io[e]!==void 0&&this._include(e),hA[e]}_include(e){const t=Io[e];return t.build(this),this.currentFunctionNode!==null&&this.currentFunctionNode.includes.push(t),t}
4143_getWGSLVertexCode(e){return`${this.getSignature()}
4144// directives
4145${e.directives}
4146
4147// structs
4148${e.structs}
4149
4150// uniforms
4151${e.uniforms}
4152
4153// varyings
4154${e.varyings}
4155var<private> varyings : VaryingsStruct;
4156
4157// codes
4158${e.codes}
4159
4160@vertex
4161fn main( ${e.attributes} ) -> VaryingsStruct {
4162
4163	// vars
4164	${e.vars}
4165
4166	// flow
4167	${e.flow}
4168
4169	return varyings;
4170
4171}
4172`}_getWGSLFragmentCode(e){return`${this.getSignature()}
4173// global
4174${vI}
4175
4176// structs
4177${e.structs}
4178
4179// uniforms
4180${e.uniforms}
4181
4182// codes
4183${e.codes}
4184
4185@fragment
4186fn main( ${e.varyings} ) -> ${e.returnType} {
4187
4188	// vars
4189	${e.vars}
4190
4191	// flow
4192	${e.flow}
4193
4194}
4195`}_getWGSLComputeCode(e,t){return`${this.getSignature()}
4196// directives
4197${e.directives}
4198
4199// system
4200var<private> instanceIndex : u32;
4201
4202// locals
4203${e.scopedArrays}
4204
4205// structs
4206${e.structs}
4207
4208// uniforms
4209${e.uniforms}
4210
4211// codes
4212${e.codes}
4213
4214@compute @workgroup_size( ${t} )
4215fn main( ${e.attributes} ) {
4216
4217	// system
4218	instanceIndex = globalId.x + globalId.y * numWorkgroups.x * u32(${t}) + globalId.z * numWorkgroups.x * numWorkgroups.y * u32(${t});
4219
4220	// vars
4221	${e.vars}
4222
4223	// flow
4224	${e.flow}
4225
4226}
4227`}_getWGSLStruct(e,t){return`
4228struct ${e} {
4229${t}
4230};`}_getWGSLStructBinding(e,t,n,r=0,s=0){const o=e+"Struct";return`${this._getWGSLStruct(o,t)}
4231@binding( ${r} ) @group( ${s} )
4232var<${n}> ${e} : ${o};`}}class wre{constructor(e){this.backend=e}getCurrentDepthStencilFormat(e){let t;return e.depthTexture!==null?t=this.getTextureFormatGPU(e.depthTexture):e.depth&&e.stencil?t=be.Depth24PlusStencil8:e.depth&&(t=be.Depth24Plus),t}getTextureFormatGPU(e){return this.backend.get(e).format}getTextureSampleData(e){let t;if(e.isFramebufferTexture)t=1;else if(e.isDepthTexture&&!e.renderTarget){const s=this.backend.renderer,o=s.getRenderTarget();t=o?o.samples:s.samples}else e.renderTarget&&(t=e.renderTarget.samples);t=t||1;const n=t>1&&e.renderTarget!==null&&e.isDepthTexture!==!0&&e.isFramebufferTexture!==!0;return{samples:t,primarySamples:n?1:t,isMSAA:n}}getCurrentColorFormat(e){let t;return e.textures!==null?t=this.getTextureFormatGPU(e.textures[0]):t=this.getPreferredCanvasFormat(),t}getCurrentColorSpace(e){return e.textures!==null?e.textures[0].colorSpace:this.backend.renderer.outputColorSpace}getPrimitiveTopology(e,t){if(e.isPoints)return kd.PointList;if(e.isLineSegments||e.isMesh&&t.wireframe===!0)return kd.LineList;if(e.isLine)return kd.LineStrip;if(e.isMesh)return kd.TriangleList}getSampleCount(e){let t=1;return e>1&&(t=Math.pow(2,Math.floor(Math.log2(e))),t===2&&(t=4)),t}getSampleCountRenderContext(e){return e.textures!==null?this.getSampleCount(e.sampleCount):this.getSampleCount(this.backend.renderer.samples)}getPreferredCanvasFormat(){const e=this.backend.parameters.outputType;if(e===void 0)return navigator.gpu.getPreferredCanvasFormat();if(e===Gi)return be.BGRA8Unorm;if(e===dr)return be.RGBA16Float;throw new Error("Unsupported outputType")}}const Tre=new Map([[Int8Array,["sint8","snorm8"]],[Uint8Array,["uint8","unorm8"]],[Int16Array,["sint16","snorm16"]],[Uint16Array,["uint16","unorm16"]],[Int32Array,["sint32","snorm32"]],[Uint32Array,["uint32","unorm32"]],[Float32Array,["float32"]]]),Ere=new Map([[hL,["float16"]]]),Rre=new Map([[Int32Array,"sint32"],[Int16Array,"sint32"],[Uint32Array,"uint32"],[Uint16Array,"uint32"],[Float32Array,"float32"]]);class Cre{constructor(e){this.backend=e}createAttribute(e,t){const n=this._getBufferAttribute(e),r=this.backend,s=r.get(n);let o=s.buffer;if(o===void 0){const a=r.device;let l=n.array;if(e.normalized===!1){if(l.constructor===Int16Array||l.constructor===Int8Array)l=new Int32Array(l);else if((l.constructor===Uint16Array||l.constructor===Uint8Array)&&(l=new Uint32Array(l),t&GPUBufferUsage.INDEX))for(let u=0;u<l.length;u++)l[u]===65535&&(l[u]=4294967295)}if(n.array=l,(n.isStorageBufferAttribute||n.isStorageInstancedBufferAttribute)&&n.itemSize===3){l=new l.constructor(n.count*4);for(let u=0;u<n.count;u++)l.set(n.array.subarray(u*3,u*3+3),u*4);n.itemSize=4,n.array=l,s._force3to4BytesAlignment=!0}const c=l.byteLength+(4-l.byteLength%4)%4;o=a.createBuffer({label:n.name,size:c,usage:t,mappedAtCreation:!0}),new l.constructor(o.getMappedRange()).set(l),o.unmap(),s.buffer=o}}updateAttribute(e){const t=this._getBufferAttribute(e),n=this.backend,r=n.device,s=n.get(t),o=n.get(t).buffer;let a=t.array;if(s._force3to4BytesAlignment===!0){a=new a.constructor(t.count*4);for(let u=0;u<t.count;u++)a.set(t.array.subarray(u*3,u*3+3),u*4);t.array=a}const l=this._isTypedArray(a),c=t.updateRanges;if(c.length===0)r.queue.writeBuffer(o,0,a,0);else{const u=l?1:a.BYTES_PER_ELEMENT;for(let p=0,m=c.length;p<m;p++){const g=c[p];let v,b;if(s._force3to4BytesAlignment===!0){const x=Math.floor(g.start/3),w=Math.ceil(g.count/3);v=x*4*u,b=w*4*u}else v=g.start*u,b=g.count*u;const M=v*(l?a.BYTES_PER_ELEMENT:1);r.queue.writeBuffer(o,M,a,v,b)}t.clearUpdateRanges()}}createShaderVertexBuffers(e){const t=e.getAttributes(),n=new Map;for(let r=0;r<t.length;r++){const s=t[r],o=s.array.BYTES_PER_ELEMENT,a=this._getBufferAttribute(s);let l=n.get(a);if(l===void 0){let p,m;s.isInterleavedBufferAttribute===!0?(p=s.data.stride*o,m=s.data.isInstancedInterleavedBuffer?hg.Instance:hg.Vertex):(p=s.itemSize*o,m=s.isInstancedBufferAttribute?hg.Instance:hg.Vertex),s.normalized===!1&&(s.array.constructor===Int16Array||s.array.
4232constructor===Uint16Array)&&(p=4),l={arrayStride:p,attributes:[],stepMode:m},n.set(a,l)}const c=this._getVertexFormat(s),u=s.isInterleavedBufferAttribute===!0?s.offset*o:0;l.attributes.push({shaderLocation:r,offset:u,format:c})}return Array.from(n.values())}destroyAttribute(e){const t=this.backend;t.get(this._getBufferAttribute(e)).buffer.destroy(),t.delete(e)}async getArrayBufferAsync(e){const t=this.backend,n=t.device,s=t.get(this._getBufferAttribute(e)).buffer,o=s.size,a=n.createBuffer({label:`${e.name}_readback`,size:o,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),l=n.createCommandEncoder({label:`readback_encoder_${e.name}`});l.copyBufferToBuffer(s,0,a,0,o);const c=l.finish();n.queue.submit([c]),await a.mapAsync(GPUMapMode.READ);const u=a.getMappedRange(),p=new e.array.constructor(u.slice(0));return a.unmap(),p.buffer}_getVertexFormat(e){const{itemSize:t,normalized:n}=e,r=e.array.constructor,s=e.constructor;let o;if(t===1)o=Rre.get(r);else{const l=(Ere.get(s)||Tre.get(r))[n?1:0];if(l){const c=r.BYTES_PER_ELEMENT*t,p=Math.floor((c+3)/4)*4/r.BYTES_PER_ELEMENT;if(p%1)throw new Error("THREE.WebGPUAttributeUtils: Bad vertex format item size.");o=`${l}x${p}`}}return o||console.error("THREE.WebGPUAttributeUtils: Vertex format not supported yet."),o}_isTypedArray(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}_getBufferAttribute(e){return e.isInterleavedBufferAttribute&&(e=e.data),e}}class Pre{constructor(e){this.backend=e,this.bindGroupLayoutCache=new WeakMap}createBindingsLayout(e){const t=this.backend,n=t.device,r=[];let s=0;for(const o of e.bindings){const a={binding:s++,visibility:o.visibility};if(o.isUniformBuffer||o.isStorageBuffer){const l={};o.isStorageBuffer&&(o.visibility&4&&(o.access===as.READ_WRITE||o.access===as.WRITE_ONLY)?l.type=Px.Storage:l.type=Px.ReadOnlyStorage),a.buffer=l}else if(o.isSampler){const l={};o.texture.isDepthTexture&&(o.texture.compareFunction!==null?l.type=yC.Comparison:t.compatibilityMode&&(l.type=yC.NonFiltering)),a.sampler=l}else if(o.isSampledTexture&&o.texture.isVideoTexture)a.externalTexture={};else if(o.isSampledTexture&&o.store){const l={};l.format=this.backend.get(o.texture).texture.format;const c=o.access;c===as.READ_WRITE?l.access=Lx.ReadWrite:c===as.WRITE_ONLY?l.access=Lx.WriteOnly:l.access=Lx.ReadOnly,a.storageTexture=l}else if(o.isSampledTexture){const l={},{primarySamples:c}=t.utils.getTextureSampleData(o.texture);if(c>1&&(l.multisampled=!0,o.texture.isDepthTexture||(l.sampleType=xu.UnfilterableFloat)),o.texture.isDepthTexture)t.compatibilityMode&&o.texture.compareFunction===null?l.sampleType=xu.UnfilterableFloat:l.sampleType=xu.Depth;else if(o.texture.isDataTexture||o.texture.isDataArrayTexture||o.texture.isData3DTexture){const u=o.texture.type;u===Ir?l.sampleType=xu.SInt:u===mi?l.sampleType=xu.UInt:u===er&&(this.backend.hasFeature("float32-filterable")?l.sampleType=xu.Float:l.sampleType=xu.UnfilterableFloat)}o.isSampledCubeTexture?l.viewDimension=Dr.Cube:o.texture.isDataArrayTexture||o.texture.isDepthArrayTexture||o.texture.isCompressedArrayTexture?l.viewDimension=Dr.TwoDArray:o.isSampledTexture3D&&(l.viewDimension=Dr.ThreeD),a.texture=l}else console.error(`WebGPUBindingUtils: Unsupported binding "${o}".`);r.push(a)}return n.createBindGroupLayout({entries:r})}createBindings(e,t,n,r=0){const{backend:s,bindGroupLayoutCache:o}=this,a=s.get(e);let l=o.get(e.bindingsReference);l===void 0&&(l=this.createBindingsLayout(e),o.set(e.bindingsReference,l));let c;n>0&&(a.groups===void 0&&(a.groups=[],a.versions=[]),a.versions[n]===r&&(c=a.groups[n])),c===void 0&&(c=this.createBindGroup(e,l),n>0&&(a.groups[n]=c,a.versions[n]=r)),a.group=c,a.layout=l}updateBinding(e){const t=this.backend,n=t.device,r=e.buffer,s=t.get(e).buffer;n.queue.writeBuffer(s,0,r,0)}createBindGroupIndex(e,t){const r=this.backend.device,s=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,o=e[0],a=r.createBuffer({label:"bindingCameraIndex_"+o,size:16,usage:s});r.queue.writeBuffer(a,0,e,0);const l=[{binding:0,resource:{buffer:a}}];return r.createBindGroup({label:"bindGroupCameraIndex_"+o,layout:t,entries:l})}createBindGroup(e,t){const n=this.backend,r=n.device;let s=0;const o=[];for(const a of e.bindings){if(a.isUniformBuffer){const l=n.get(a);if(l.buffer===void 0){const c=a.byteLength,u=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,p=r.createBuffer({label:"bindingBuffer_"+a.name,size:c,usage:u});l.buffer=p}o.push({binding:s,resource:{buffer:l.buffer}})}else if(a.isStorageBuffer){const l=n.get(a);if(l.buffer===void 0){const c=a.attribute;l.buffer=n.get(c).buffer}o.push({binding:s,resource:{buffer:l.buffer}})}else if(a.isSampler){const l=n.get(a.texture);o.push({binding:s,resource:l.sampler})}else if(a.isSampledTexture){const l=n.get(a.texture);let c;if(l.externalTexture!==void 0)c=r.importExternalTexture({source:l.externalTexture});else{const u=a.store?1:l.texture.mipLevelCount,p=`view-${l.texture.width}-${l.texture.height}-${u}`;if(c=l[p],c===void 0){const m=ore.All;let g;a.isSampledCubeTexture?g=Dr.Cube:a.isSampledTexture3D?g=Dr.ThreeD:a.texture.isDataArrayTexture||a.texture.isDepthArrayTexture||a.texture.isCompressedArrayTexture?g=Dr.TwoDArray:g=Dr.TwoD,c=l[p]=l.texture.createView({aspect:m,dimension:g,mipLevelCount:u})}}o.push({binding:s,resource:c})}s++}return r.createBindGroup({label:"bindGroup_"+e.name,layout:t,entries:o})}}class Lre{constructor(e){this.backend=e}
4232_getSampleCount(e){return this.backend.utils.getSampleCountRenderContext(e)}createRenderPipeline(e,t){const{object:n,material:r,geometry:s,pipeline:o}=e,{vertexProgram:a,fragmentProgram:l}=o,c=this.backend,u=c.device,p=c.utils,m=c.get(o),g=[];for(const W of e.getBindings()){const Q=c.get(W);g.push(Q.layout)}const v=c.attributeUtils.createShaderVertexBuffers(e);let b;r.blending!==Hs&&(r.blending!==ws||r.transparent!==!1)&&(b=this._getBlending(r));let M={};r.stencilWrite===!0&&(M={compare:this._getStencilCompare(r),failOp:this._getStencilOperation(r.stencilFail),depthFailOp:this._getStencilOperation(r.stencilZFail),passOp:this._getStencilOperation(r.stencilZPass)});const x=this._getColorWriteMask(r),w=[];if(e.context.textures!==null){const W=e.context.textures;for(let Q=0;Q<W.length;Q++){const J=p.getTextureFormatGPU(W[Q]);w.push({format:J,blend:b,writeMask:x})}}else{const W=p.getCurrentColorFormat(e.context);w.push({format:W,blend:b,writeMask:x})}const R=c.get(a).module,C=c.get(l).module,N=this._getPrimitiveState(n,s,r),D=this._getDepthCompare(r),P=p.getCurrentDepthStencilFormat(e.context),O=this._getSampleCount(e.context),I={label:`renderPipeline_${r.name||r.type}_${r.id}`,vertex:Object.assign({},R,{buffers:v}),fragment:Object.assign({},C,{targets:w}),primitive:N,multisample:{count:O,alphaToCoverageEnabled:r.alphaToCoverage&&O>1},layout:u.createPipelineLayout({bindGroupLayouts:g})},F={},k=e.context.depth,Y=e.context.stencil;if((k===!0||Y===!0)&&(k===!0&&(F.format=P,F.depthWriteEnabled=r.depthWrite,F.depthCompare=D),Y===!0&&(F.stencilFront=M,F.stencilBack={},F.stencilReadMask=r.stencilFuncMask,F.stencilWriteMask=r.stencilWriteMask),r.polygonOffset===!0&&(F.depthBias=r.polygonOffsetUnits,F.depthBiasSlopeScale=r.polygonOffsetFactor,F.depthBiasClamp=0),I.depthStencil=F),t===null)m.pipeline=u.createRenderPipeline(I);else{const W=new Promise(Q=>{u.createRenderPipelineAsync(I).then(J=>{m.pipeline=J,Q()})});t.push(W)}}createBundleEncoder(e,t="renderBundleEncoder"){const n=this.backend,{utils:r,device:s}=n,o=r.getCurrentDepthStencilFormat(e),a=r.getCurrentColorFormat(e),l=this._getSampleCount(e),c={label:t,colorFormats:[a],depthStencilFormat:o,sampleCount:l};return s.createRenderBundleEncoder(c)}createComputePipeline(e,t){const n=this.backend,r=n.device,s=n.get(e.computeProgram).module,o=n.get(e),a=[];for(const l of t){const c=n.get(l);a.push(c.layout)}o.pipeline=r.createComputePipeline({compute:s,layout:r.createPipelineLayout({bindGroupLayouts:a})})}_getBlending(e){let t,n;const r=e.blending,s=e.blendSrc,o=e.blendDst,a=e.blendEquation;if(r===Hd){const l=e.blendSrcAlpha!==null?e.blendSrcAlpha:s,c=e.blendDstAlpha!==null?e.blendDstAlpha:o,u=e.blendEquationAlpha!==null?e.blendEquationAlpha:a;t={srcFactor:this._getBlendFactor(s),dstFactor:this._getBlendFactor(o),operation:this._getBlendOperation(a)},n={srcFactor:this._getBlendFactor(l),dstFactor:this._getBlendFactor(c),operation:this._getBlendOperation(u)}}else{const l=e.premultipliedAlpha,c=(u,p,m,g)=>{t={srcFactor:u,dstFactor:p,operation:yu.Add},n={srcFactor:m,dstFactor:g,operation:yu.Add}};if(l)switch(r){case ws:c(yn.One,yn.OneMinusSrcAlpha,yn.One,yn.OneMinusSrcAlpha);break;case rf:c(yn.One,yn.One,yn.One,yn.One);break;case sf:c(yn.Zero,yn.OneMinusSrc,yn.Zero,yn.One);break;case of:c(yn.Zero,yn.Src,yn.Zero,yn.SrcAlpha);break}else switch(r){case ws:c(yn.SrcAlpha,yn.OneMinusSrcAlpha,yn.One,yn.OneMinusSrcAlpha);break;case rf:c(yn.SrcAlpha,yn.One,yn.SrcAlpha,yn.One);break;case sf:c(yn.Zero,yn.OneMinusSrc,yn.Zero,yn.One);break;case of:c(yn.Zero,yn.Src,yn.Zero,yn.Src);break}}if(t!==void 0&&n!==void 0)return{color:t,alpha:n};console.error("THREE.WebGPURenderer: Invalid blending: ",r)}_getBlendFactor(e){let t;switch(e){case Sl:t=yn.Zero;break;case xS:t=yn.One;break;case bS:t=yn.Src;break;case SS:t=yn.OneMinusSrc;break;case NA:t=yn.SrcAlpha;break;case DA:t=yn.OneMinusSrcAlpha;break;case TS:t=yn.Dst;break;case ES:t=yn.OneMinusDstColor;break;case MS:t=yn.DstAlpha;break;case wS:t=yn.OneMinusDstAlpha;break;case RS:t=yn.SrcAlphaSaturated;break;case UK:t=yn.Constant;break;case OK:t=yn.OneMinusConstant;break;default:console.error("THREE.WebGPURenderer: Blend factor not supported.",e)}return t}_getStencilCompare(e){let t;const n=e.stencilFunc;switch(n){case NO:t=Vr.Never;break;case j2:t=Vr.Always;break;case DO:t=Vr.Less;break;case BO:t=Vr.LessEqual;break;case IO:t=Vr.Equal;break;case OO:t=Vr.GreaterEqual;break;case FO:t=Vr.Greater;break;case UO:t=Vr.NotEqual;break;default:console.error("THREE.WebGPURenderer: Invalid stencil function.",n)}return t}_getStencilOperation(e){let t;switch(e){case Ru:t=cc.Keep;break;case wO:t=cc.Zero;break;case TO:t=cc.Replace;break;case LO:t=cc.Invert;break;case EO:t=cc.IncrementClamp;break;case RO:t=cc.DecrementClamp;break;case CO:t=cc.IncrementWrap;break;case PO:t=cc.DecrementWrap;break;default:console.error("THREE.WebGPURenderer: Invalid stencil operation.",t)}return t}_getBlendOperation(e){let t;switch(e){case os:t=yu.Add;break;case vS:t=yu.Subtract;break;case yS:t=yu.ReverseSubtract;break;case jP:t=yu.Min;break;case XP:t=yu.Max;break;default:console.error("THREE.WebGPUPipelineUtils: Blend equation not supported.",e)}return t}_getPrimitiveState(e,t,n){const r={},s=this.backend.utils;switch(r.topology=s.getPrimitiveTopology(e,n),t.index!==null&&e.isLine
4232===!0&&e.isLineSegments!==!0&&(r.stripIndexFormat=t.index.array instanceof Uint16Array?Nf.Uint16:Nf.Uint32),n.side){case qs:r.frontFace=Ex.CCW,r.cullMode=Rx.Back;break;case oi:r.frontFace=Ex.CCW,r.cullMode=Rx.Front;break;case ur:r.frontFace=Ex.CCW,r.cullMode=Rx.None;break;default:console.error("THREE.WebGPUPipelineUtils: Unknown material.side value.",n.side);break}return r}_getColorWriteMask(e){return e.colorWrite===!0?vC.All:vC.None}_getDepthCompare(e){let t;if(e.depthTest===!1)t=Vr.Always;else{const n=e.depthFunc;switch(n){case IA:t=Vr.Never;break;case BA:t=Vr.Always;break;case FA:t=Vr.Less;break;case qc:t=Vr.LessEqual;break;case UA:t=Vr.Equal;break;case OA:t=Vr.GreaterEqual;break;case kA:t=Vr.Greater;break;case zA:t=Vr.NotEqual;break;default:console.error("THREE.WebGPUPipelineUtils: Invalid depth function.",n)}}return t}}class Nre extends _I{constructor(e,t,n=2048){super(n),this.device=e,this.type=t,this.querySet=this.device.createQuerySet({type:"timestamp",count:this.maxQueries,label:`queryset_global_timestamp_${t}`});const r=this.maxQueries*8;this.resolveBuffer=this.device.createBuffer({label:`buffer_timestamp_resolve_${t}`,size:r,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),this.resultBuffer=this.device.createBuffer({label:`buffer_timestamp_result_${t}`,size:r,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ})}allocateQueriesForContext(e){if(!this.trackTimestamp||this.isDisposed)return null;if(this.currentQueryIndex+2>this.maxQueries)return da(`WebGPUTimestampQueryPool [${this.type}]: Maximum number of queries exceeded, when using trackTimestamp it is necessary to resolves the queries via renderer.resolveTimestampsAsync( THREE.TimestampQuery.${this.type.toUpperCase()} ).`),null;const t=this.currentQueryIndex;return this.currentQueryIndex+=2,this.queryOffsets.set(e.id,t),t}async resolveQueriesAsync(){if(!this.trackTimestamp||this.currentQueryIndex===0||this.isDisposed)return this.lastValue;if(this.pendingResolve)return this.pendingResolve;this.pendingResolve=this._resolveQueries();try{return await this.pendingResolve}finally{this.pendingResolve=null}}async _resolveQueries(){if(this.isDisposed)return this.lastValue;try{if(this.resultBuffer.mapState!=="unmapped")return this.lastValue;const e=new Map(this.queryOffsets),t=this.currentQueryIndex,n=t*8;this.currentQueryIndex=0,this.queryOffsets.clear();const r=this.device.createCommandEncoder();r.resolveQuerySet(this.querySet,0,t,this.resolveBuffer,0),r.copyBufferToBuffer(this.resolveBuffer,0,this.resultBuffer,0,n);const s=r.finish();if(this.device.queue.submit([s]),this.resultBuffer.mapState!=="unmapped")return this.lastValue;if(await this.resultBuffer.mapAsync(GPUMapMode.READ,0,n),this.isDisposed)return this.resultBuffer.mapState==="mapped"&&this.resultBuffer.unmap(),this.lastValue;const o=new BigUint64Array(this.resultBuffer.getMappedRange(0,n));let a=0;for(const[,l]of e){const c=o[l],u=o[l+1],p=Number(u-c)/1e6;a+=p}return this.resultBuffer.unmap(),this.lastValue=a,a}catch(e){return console.error("Error resolving queries:",e),this.resultBuffer.mapState==="mapped"&&this.resultBuffer.unmap(),this.lastValue}}async dispose(){if(!this.isDisposed){if(this.isDisposed=!0,this.pendingResolve)try{await this.pendingResolve}catch(e){console.error("Error waiting for pending resolve:",e)}if(this.resultBuffer&&this.resultBuffer.mapState==="mapped")try{this.resultBuffer.unmap()}catch(e){console.error("Error unmapping buffer:",e)}this.querySet&&(this.querySet.destroy(),this.querySet=null),this.resolveBuffer&&(this.resolveBuffer.destroy(),this.resolveBuffer=null),this.resultBuffer&&(this.resultBuffer.destroy(),this.resultBuffer=null),this.queryOffsets.clear(),this.pendingResolve=null}}}class Dre extends gI{constructor(e={}){super(e),this.isWebGPUBackend=!0,this.parameters.alpha=e.alpha===void 0?!0:e.alpha,this.parameters.compatibilityMode=e.compatibilityMode===void 0?!1:e.compatibilityMode,this.parameters.requiredLimits=e.requiredLimits===void 0?{}:e.requiredLimits,this.compatibilityMode=this.parameters.compatibilityMode,this.device=null,this.context=null,this.colorBuffer=null,this.defaultRenderPassdescriptor=null,this.utils=new wre(this),this.attributeUtils=new Cre(this),this.bindingUtils=new Pre(this),this.pipelineUtils=new Lre(this),this.textureUtils=new Are(this),this.occludedResolveCache=new Map}async init(e){await super.init(e);const t=this.parameters;let n;if(t.device===void 0){const o={powerPreference:t.powerPreference,featureLevel:t.compatibilityMode?"compatibility":void 0},a=typeof navigator<"u"?await navigator.gpu.requestAdapter(o):null;if(a===null)throw new Error("WebGPUBackend: Unable to create WebGPU adapter.");const l=Object.values(zb),c=[];
4232for(const p of l)a.features.has(p)&&c.push(p);const u={requiredFeatures:c,requiredLimits:t.requiredLimits};n=await a.requestDevice(u)}else n=t.device;n.lost.then(o=>{const a={api:"WebGPU",message:o.message||"Unknown reason",reason:o.reason||null,originalEvent:o};e.onDeviceLost(a)});const r=t.context!==void 0?t.context:e.domElement.getContext("webgpu");this.device=n,this.context=r;const s=t.alpha?"premultiplied":"opaque";this.trackTimestamp=this.trackTimestamp&&this.hasFeature(zb.TimestampQuery),this.context.configure({device:this.device,format:this.utils.getPreferredCanvasFormat(),usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,alphaMode:s}),this.updateSize()}get coordinateSystem(){return Xa}async getArrayBufferAsync(e){return await this.attributeUtils.getArrayBufferAsync(e)}getContext(){return this.context}_getDefaultRenderPassDescriptor(){let e=this.defaultRenderPassdescriptor;if(e===null){const n=this.renderer;e={colorAttachments:[{view:null}]},(this.renderer.depth===!0||this.renderer.stencil===!0)&&(e.depthStencilAttachment={view:this.textureUtils.getDepthBuffer(n.depth,n.stencil).createView()});const r=e.colorAttachments[0];this.renderer.samples>0?r.view=this.colorBuffer.createView():r.resolveTarget=void 0,this.defaultRenderPassdescriptor=e}const t=e.colorAttachments[0];return this.renderer.samples>0?t.resolveTarget=this.context.getCurrentTexture().createView():t.view=this.context.getCurrentTexture().createView(),e}_isRenderCameraDepthArray(e){return e.depthTexture&&e.depthTexture.isDepthArrayTexture&&e.camera.isArrayCamera}_getRenderPassDescriptor(e,t={}){const n=e.renderTarget,r=this.get(n);let s=r.descriptors;if(s===void 0||r.width!==n.width||r.height!==n.height||r.dimensions!==n.dimensions||r.activeMipmapLevel!==e.activeMipmapLevel||r.activeCubeFace!==e.activeCubeFace||r.samples!==n.samples){s={},r.descriptors=s;const c=()=>{n.removeEventListener("dispose",c),this.delete(n)};n.hasEventListener("dispose",c)===!1&&n.addEventListener("dispose",c)}const o=e.getCacheKey();let a=s[o];if(a===void 0){const c=e.textures,u=[];let p;const m=this._isRenderCameraDepthArray(e);for(let g=0;g<c.length;g++){const v=this.get(c[g]),b={label:`colorAttachment_${g}`,baseMipLevel:e.activeMipmapLevel,mipLevelCount:1,baseArrayLayer:e.activeCubeFace,arrayLayerCount:1,dimension:Dr.TwoD};if(n.isRenderTarget3D)p=e.activeCubeFace,b.baseArrayLayer=0,b.dimension=Dr.ThreeD,b.depthOrArrayLayers=c[g].image.depth;else if(n.isRenderTargetArray)if(m===!0){const M=e.camera.cameras;for(let x=0;x<M.length;x++){const w={...b,baseArrayLayer:x,arrayLayerCount:1,dimension:Dr.TwoD},R=v.texture.createView(w);u.push({view:R,resolveTarget:void 0,depthSlice:void 0})}}else b.dimension=Dr.TwoDArray,b.depthOrArrayLayers=c[g].image.depth;if(m!==!0){const M=v.texture.createView(b);let x,w;v.msaaTexture!==void 0?(x=v.msaaTexture.createView(),w=M):(x=M,w=void 0),u.push({view:x,resolveTarget:w,depthSlice:p})}}if(a={textureViews:u},e.depth){const g=this.get(e.depthTexture),v={};e.depthTexture.isDepthArrayTexture&&(v.dimension=Dr.TwoD,v.arrayLayerCount=1,v.baseArrayLayer=e.activeCubeFace),a.depthStencilView=g.texture.createView(v)}s[o]=a,r.width=n.width,r.height=n.height,r.samples=n.samples,r.activeMipmapLevel=e.activeMipmapLevel,r.activeCubeFace=e.activeCubeFace,r.dimensions=n.dimensions}const l={colorAttachments:[]};for(let c=0;c<a.textureViews.length;c++){const u=a.textureViews[c];let p={r:0,g:0,b:0,a:1};c===0&&t.clearValue&&(p=t.clearValue),l.colorAttachments.push({view:u.view,depthSlice:u.depthSlice,resolveTarget:u.resolveTarget,loadOp:t.loadOp||Xn.Load,storeOp:t.storeOp||vs.Store,clearValue:p})}return a.depthStencilView&&(l.depthStencilAttachment={view:a.depthStencilView}),l}beginRender(e){const t=this.get(e),n=this.device,r=e.occlusionQueryCount;let s;r>0&&(t.currentOcclusionQuerySet&&t.currentOcclusionQuerySet.destroy(),t.currentOcclusionQueryBuffer&&t.currentOcclusionQueryBuffer.destroy(),t.currentOcclusionQuerySet=t.occlusionQuerySet,t.currentOcclusionQueryBuffer=t.occlusionQueryBuffer,t.currentOcclusionQueryObjects=t.occlusionQueryObjects,s=n.createQuerySet({type:"occlusion",count:r,label:`occlusionQuerySet_${e.id}`}),t.occlusionQuerySet=s,t.occlusionQueryIndex=0,t.occlusionQueryObjects=new Array(r),t.lastOcclusionObject=null);let o;e.textures===null?o=this._getDefaultRenderPassDescriptor():o=this._getRenderPassDescriptor(e,{loadOp:Xn.Load}),this.initTimestampQuery(e,o),o.occlusionQuerySet=s;const a=o.depthStencilAttachment;if(e.textures!==null){const c=o.colorAttachments;for(let u=0;u<c.length;u++){const p=c[u];e.clearColor?(p.clearValue=u===0?e.clearColorValue:{r:0,g:0,b:0,a:1},p.loadOp=Xn.Clear):p.loadOp=Xn.Load,p.storeOp=vs.Store}}else{const c=o.colorAttachments[0];e.clearColor?(c.clearValue=e.clearColorValue,c.loadOp=Xn.Clear):c.loadOp=Xn.Load,c.storeOp=vs.Store}e.depth&&(e.clearDepth?(a.depthClearValue=e.clearDepthValue,a.depthLoadOp=Xn.Clear):a.depthLoadOp=Xn.Load,a.depthStoreOp=vs.Store),e.stencil&&(e.clearStencil?(a.stencilClearValue=e.clearStencilValue,a.stencilLoadOp=Xn.Clear):a.stencilLoadOp=Xn.Load,a.stencilStoreOp=vs.Store);const l=n.createCommandEncoder({label:"renderContext_"+e.id});if(this._isRenderCameraDepthArray(e)===!0){const c=e.camera.cameras;!t.layerDescriptors||t.layerDescriptors.length!==c.length?this._createDepthLayerDescriptors(e,t,o,c):this._updateDepthLayerDescriptors(e,t,c),t.bundleEncoders=[],t.bundleSets=[];for(let u=0;u<c.length;u++){const p=this.pipelineUtils.createBundleEncoder(e,"renderBundleArrayCamera_"+u),m={attributes:{},bindingGroups:[],pipeline:null,index:null};t.bundleEncoders.push(p),t.bundleSets.push(m)}t.currentPass=null}else{const c=l.beginRenderPass(o);if(t.currentPass=c,e.viewport&&this.updateViewport(e),e.scissor){const{x:u,y:p,width:m,height:g}=e.scissorValue;
4232c.setScissorRect(u,p,m,g)}}t.descriptor=o,t.encoder=l,t.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null},t.renderBundles=[]}_createDepthLayerDescriptors(e,t,n,r){const s=n.depthStencilAttachment;t.layerDescriptors=[];const o=this.get(e.depthTexture);o.viewCache||(o.viewCache=[]);for(let a=0;a<r.length;a++){const l={...n,colorAttachments:[{...n.colorAttachments[0],view:n.colorAttachments[a].view}]};if(n.depthStencilAttachment){const c=a;o.viewCache[c]||(o.viewCache[c]=o.texture.createView({dimension:Dr.TwoD,baseArrayLayer:a,arrayLayerCount:1})),l.depthStencilAttachment={view:o.viewCache[c],depthLoadOp:s.depthLoadOp||Xn.Clear,depthStoreOp:s.depthStoreOp||vs.Store,depthClearValue:s.depthClearValue||1},e.stencil&&(l.depthStencilAttachment.stencilLoadOp=s.stencilLoadOp,l.depthStencilAttachment.stencilStoreOp=s.stencilStoreOp,l.depthStencilAttachment.stencilClearValue=s.stencilClearValue)}else l.depthStencilAttachment={...s};t.layerDescriptors.push(l)}}_updateDepthLayerDescriptors(e,t,n){for(let r=0;r<n.length;r++){const s=t.layerDescriptors[r];if(s.depthStencilAttachment){const o=s.depthStencilAttachment;e.depth&&(e.clearDepth?(o.depthClearValue=e.clearDepthValue,o.depthLoadOp=Xn.Clear):o.depthLoadOp=Xn.Load),e.stencil&&(e.clearStencil?(o.stencilClearValue=e.clearStencilValue,o.stencilLoadOp=Xn.Clear):o.stencilLoadOp=Xn.Load)}}}finishRender(e){const t=this.get(e),n=e.occlusionQueryCount;t.renderBundles.length>0&&t.currentPass.executeBundles(t.renderBundles),n>t.occlusionQueryIndex&&t.currentPass.endOcclusionQuery();const r=t.encoder;if(this._isRenderCameraDepthArray(e)===!0){const s=[];for(let o=0;o<t.bundleEncoders.length;o++){const a=t.bundleEncoders[o];s.push(a.finish())}for(let o=0;o<t.layerDescriptors.length;o++)if(o<s.length){const a=t.layerDescriptors[o],l=r.beginRenderPass(a);if(e.viewport){const{x:c,y:u,width:p,height:m,minDepth:g,maxDepth:v}=e.viewportValue;l.setViewport(c,u,p,m,g,v)}if(e.scissor){const{x:c,y:u,width:p,height:m}=e.scissorValue;l.setScissorRect(c,u,p,m)}l.executeBundles([s[o]]),l.end()}}else t.currentPass&&t.currentPass.end();if(n>0){const s=n*8;let o=this.occludedResolveCache.get(s);o===void 0&&(o=this.device.createBuffer({size:s,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),this.occludedResolveCache.set(s,o));const a=this.device.createBuffer({size:s,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});t.encoder.resolveQuerySet(t.occlusionQuerySet,0,n,o,0),t.encoder.copyBufferToBuffer(o,0,a,0,s),t.occlusionQueryBuffer=a,this.resolveOccludedAsync(e)}if(this.device.queue.submit([t.encoder.finish()]),e.textures!==null){const s=e.textures;for(let o=0;o<s.length;o++){const a=s[o];a.generateMipmaps===!0&&this.textureUtils.generateMipmaps(a)}}}isOccluded(e,t){const n=this.get(e);return n.occluded&&n.occluded.has(t)}async resolveOccludedAsync(e){const t=this.get(e),{currentOcclusionQueryBuffer:n,currentOcclusionQueryObjects:r}=t;if(n&&r){const s=new WeakSet;t.currentOcclusionQueryObjects=null,t.currentOcclusionQueryBuffer=null,await n.mapAsync(GPUMapMode.READ);const o=n.getMappedRange(),a=new BigUint64Array(o);for(let l=0;l<r.length;l++)a[l]===BigInt(0)&&s.add(r[l]);n.destroy(),t.occluded=s}}updateViewport(e){const{currentPass:t}=this.get(e),{x:n,y:r,width:s,height:o,minDepth:a,maxDepth:l}=e.viewportValue;t.setViewport(n,r,s,o,a,l)}getClearColor(){const e=super.getClearColor();return this.renderer.alpha===!0&&(e.r*=e.a,e.g*=e.a,e.b*=e.a),e}clear(e,t,n,r=null){const s=this.device,o=this.renderer;let a=[],l,c,u,p;if(e){const v=this.getClearColor();c={r:v.r,g:v.g,b:v.b,a:v.a}}if(r===null){u=o.depth,p=o.stencil;const v=this._getDefaultRenderPassDescriptor();if(e){a=v.colorAttachments;const b=a[0];b.clearValue=c,b.loadOp=Xn.Clear,b.storeOp=vs.Store}(u||p)&&(l=v.depthStencilAttachment)}else{u=r.depth,p=r.stencil;const v={loadOp:e?Xn.Clear:Xn.Load,clearValue:e?c:void 0};u&&(v.depthLoadOp=t?Xn.Clear:Xn.Load,v.depthClearValue=t?o.getClearDepth():void 0,v.depthStoreOp=vs.Store),p&&(v.stencilLoadOp=n?Xn.Clear:Xn.Load,v.stencilClearValue=n?o.getClearStencil():void 0,v.stencilStoreOp=vs.Store);const b=this._getRenderPassDescriptor(r,v);a=b.colorAttachments,l=b.depthStencilAttachment}u&&l&&l.depthLoadOp===void 0&&(t?(l.depthLoadOp=Xn.Clear,l.depthClearValue=o.getClearDepth(),l.depthStoreOp=vs.Store):(l.depthLoadOp=Xn.Load,l.depthStoreOp=vs.Store)),p&&l&&l.stencilLoadOp===void 0&&(n?(l.stencilLoadOp=Xn.Clear,l.stencilClearValue=o.getClearStencil(),l.stencilStoreOp=vs.Store):(l.stencilLoadOp=Xn.Load,l.stencilStoreOp=vs.Store));const m=s.createCommandEncoder({label:"clear"});m.beginRenderPass({colorAttachments:a,depthStencilAttachment:l}).end(),s.queue.submit([m.finish()])}beginCompute(e){const t=this.get(e),n={label:"computeGroup_"+e.id};this.initTimestampQuery(e,n),t.cmdEncoderGPU=this.device.createCommandEncoder({label:"computeGroup_"+e.id}),t.passEncoderGPU=t.cmdEncoderGPU.beginComputePass(n)}compute(e,t,n,r){const{passEncoderGPU:s}=this.get(e),o=this.get(r).pipeline;s.setPipeline(o);for(let u=0,p=n.length;u<p;u++){const m=n[u],g=this.get(m);s.setBindGroup(u,g.group)}const a=this.device.limits.maxComputeWorkgroupsPerDimension,l=this.get(t);l.dispatchSize===void 0&&(l.dispatchSize={x:0,y:1,z:1});const{dispatchSize:c}=l;t.dispatchCount>a?(c.x=Math.min(t.dispatchCount,a),c.y=Math.ceil(t.dispatchCount/a)):c.x=t.dispatchCount,s.dispatchWorkgroups(c.x,c.y,c.z)}finishCompute(e){const t=this.get(e);t.passEncoderGPU.end(),this.device.queue.submit([t.cmdEncoderGPU.finish()])}async waitForGPU(){await this.device.queue.onSubmittedWorkDone()}draw(e,t){const{object:n,material:r,context:s,pipeline:o}=e,a=e.getBindings(),l=this.get(s),c=this.get(o).pipeline,u=e.getIndex(),p=u!==null,m=e.getDrawParameters();if(m===null)return;const g=(b,M)=>{b.setPipeline(c),M.pipeline=c;const x=M.bindingGroups;for(let R=0,C=a.length;R<C;R++){const N=a[R],D=this.get(N);x[N.index]!==N.id&&(b.setBindGroup(N.index,D.group),x[N.index]=N.id)}if(p===!0&&M.index!==u){const R=this.get(u).buffer,C=u.array instanceof Uint16Array?Nf.Uint16:Nf.Uint32;b.setIndexBuffer(R,C),M.index=u}const w=e.getVertexBuffers();for(let R=0,C=w.length;R<C;R++){const N=w[R];if(M.attributes[R]!==N){const D=this.get(N).buffer;b.setVertexBuffer(R,D),M.attributes[R]=N}}s.stencil===!0&&r.stencilWrite===!0&&l.currentStencilRef!==r.stencilRef&&(b.setStencilReference(r.stencilRef),l.currentStencilRef=r.stencilRef)},v=(b,M)=>{if(g(b,M),n.isBatchedMesh===!0){const x=n._multiDrawStarts,w=n._multiDrawCounts,R=n._multiDrawCount,C=n._multiDrawInstances;C!==null&&da("THREE.WebGPUBackend: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.");for(let N=0;N<R;N++){const D=C?C[N]:1,P=D>1?0:N;p===!0?b.drawIndexed(w[N],D,x[N]/u.array.BYTES_PER_ELEMENT,0,P):b.draw(w[N],D,x[N],P),t.update(n,w[N],D)}}
4232else if(p===!0){const{vertexCount:x,instanceCount:w,firstVertex:R}=m,C=e.getIndirect();if(C!==null){const N=this.get(C).buffer;b.drawIndexedIndirect(N,0)}else b.drawIndexed(x,w,R,0,0);t.update(n,x,w)}else{const{vertexCount:x,instanceCount:w,firstVertex:R}=m,C=e.getIndirect();if(C!==null){const N=this.get(C).buffer;b.drawIndirect(N,0)}else b.draw(x,w,R,0);t.update(n,x,w)}};if(e.camera.isArrayCamera&&e.camera.cameras.length>0){const b=this.get(e.camera),M=e.camera.cameras,x=e.getBindingGroup("cameraIndex");if(b.indexesGPU===void 0||b.indexesGPU.length!==M.length){const R=this.get(x),C=[],N=new Uint32Array([0,0,0,0]);for(let D=0,P=M.length;D<P;D++){N[0]=D;const O=this.bindingUtils.createBindGroupIndex(N,R.layout);C.push(O)}b.indexesGPU=C}const w=this.renderer.getPixelRatio();for(let R=0,C=M.length;R<C;R++){const N=M[R];if(n.layers.test(N.layers)){const D=N.viewport;let P=l.currentPass,O=l.currentSets;if(l.bundleEncoders){const I=l.bundleEncoders[R],F=l.bundleSets[R];P=I,O=F}D&&P.setViewport(Math.floor(D.x*w),Math.floor(D.y*w),Math.floor(D.width*w),Math.floor(D.height*w),s.viewportValue.minDepth,s.viewportValue.maxDepth),x&&b.indexesGPU&&(P.setBindGroup(x.index,b.indexesGPU[R]),O.bindingGroups[x.index]=x.id),v(P,O)}}}else if(l.currentPass){if(l.occlusionQuerySet!==void 0){const b=l.lastOcclusionObject;b!==n&&(b!==null&&b.occlusionTest===!0&&(l.currentPass.endOcclusionQuery(),l.occlusionQueryIndex++),n.occlusionTest===!0&&(l.currentPass.beginOcclusionQuery(l.occlusionQueryIndex),l.occlusionQueryObjects[l.occlusionQueryIndex]=n),l.lastOcclusionObject=n)}v(l.currentPass,l.currentSets)}}needsRenderUpdate(e){const t=this.get(e),{object:n,material:r}=e,s=this.utils,o=s.getSampleCountRenderContext(e.context),a=s.getCurrentColorSpace(e.context),l=s.getCurrentColorFormat(e.context),c=s.getCurrentDepthStencilFormat(e.context),u=s.getPrimitiveTopology(n,r);let p=!1;return(t.material!==r||t.materialVersion!==r.version||t.transparent!==r.transparent||t.blending!==r.blending||t.premultipliedAlpha!==r.premultipliedAlpha||t.blendSrc!==r.blendSrc||t.blendDst!==r.blendDst||t.blendEquation!==r.blendEquation||t.blendSrcAlpha!==r.blendSrcAlpha||t.blendDstAlpha!==r.blendDstAlpha||t.blendEquationAlpha!==r.blendEquationAlpha||t.colorWrite!==r.colorWrite||t.depthWrite!==r.depthWrite||t.depthTest!==r.depthTest||t.depthFunc!==r.depthFunc||t.stencilWrite!==r.stencilWrite||t.stencilFunc!==r.stencilFunc||t.stencilFail!==r.stencilFail||t.stencilZFail!==r.stencilZFail||t.stencilZPass!==r.stencilZPass||t.stencilFuncMask!==r.stencilFuncMask||t.stencilWriteMask!==r.stencilWriteMask||t.side!==r.side||t.alphaToCoverage!==r.alphaToCoverage||t.sampleCount!==o||t.colorSpace!==a||t.colorFormat!==l||t.depthStencilFormat!==c||t.primitiveTopology!==u||t.clippingContextCacheKey!==e.clippingContextCacheKey)&&(t.material=r,t.materialVersion=r.version,t.transparent=r.transparent,t.blending=r.blending,t.premultipliedAlpha=r.premultipliedAlpha,t.blendSrc=r.blendSrc,t.blendDst=r.blendDst,t.blendEquation=r.blendEquation,t.blendSrcAlpha=r.blendSrcAlpha,t.blendDstAlpha=r.blendDstAlpha,t.blendEquationAlpha=r.blendEquationAlpha,t.colorWrite=r.colorWrite,t.depthWrite=r.depthWrite,t.depthTest=r.depthTest,t.depthFunc=r.depthFunc,t.stencilWrite=r.stencilWrite,t.stencilFunc=r.stencilFunc,t.stencilFail=r.stencilFail,t.stencilZFail=r.stencilZFail,t.stencilZPass=r.stencilZPass,t.stencilFuncMask=r.stencilFuncMask,t.stencilWriteMask=r.stencilWriteMask,t.side=r.side,t.alphaToCoverage=r.alphaToCoverage,t.sampleCount=o,t.colorSpace=a,t.colorFormat=l,t.depthStencilFormat=c,t.primitiveTopology=u,t.clippingContextCacheKey=e.clippingContextCacheKey,p=!0),p}getRenderCacheKey(e){const{object:t,material:n}=e,r=this.utils,s=e.context;return[n.transparent,n.blending,n.premultipliedAlpha,n.blendSrc,n.blendDst,n.blendEquation,n.blendSrcAlpha,n.blendDstAlpha,n.blendEquationAlpha,n.colorWrite,n.depthWrite,n.depthTest,n.depthFunc,n.stencilWrite,n.stencilFunc,n.stencilFail,n.stencilZFail,n.stencilZPass,n.stencilFuncMask,n.stencilWriteMask,n.side,r.getSampleCountRenderContext(s),r.getCurrentColorSpace(s),r.getCurrentColorFormat(s),r.getCurrentDepthStencilFormat(s),r.getPrimitiveTopology(t,n),e.getGeometryCacheKey(),e.clippingContextCacheKey].join()}createSampler(e){this.textureUtils.createSampler(e)}destroySampler(e){this.textureUtils.destroySampler(e)}createDefaultTexture(e){this.textureUtils.createDefaultTexture(e)}createTexture(e,t){this.textureUtils.createTexture(e,t)}updateTexture(e,t){this.textureUtils.updateTexture(e,t)}generateMipmaps(e){this.textureUtils.generateMipmaps(e)}destroyTexture(e){this.textureUtils.destroyTexture(e)}async copyTextureToBuffer(e,t,n,r,s,o){return this.textureUtils.copyTextureToBuffer(e,t,n,r,s,o)}initTimestampQuery(e,t){if(!this.trackTimestamp)return;const n=e.isComputeNode?"compute":"render";this.timestampQueryPool[n]||(this.timestampQueryPool[n]=new Nre(this.device,n,2048));const r=this.timestampQueryPool[n],s=r.allocateQueriesForContext(e);t.timestampWrites={querySet:r.querySet,beginningOfPassWriteIndex:s,endOfPassWriteIndex:s+1}}createNodeBuilder(e,t){return new Mre(e,t)}createProgram(e){const t=this.get(e);t.module={module:this.device.createShaderModule({code:e.code,label:e.stage+(e.name!==""?`_${e.name}`:"")}),entryPoint:"main"}}destroyProgram(e){this.delete(e)}createRenderPipeline(e,t){this.pipelineUtils.createRenderPipeline(e,t)}createComputePipeline(e,t){this.pipelineUtils.createComputePipeline(e,t)}beginBundle(e){const t=this.get(e);t._currentPass=t.currentPass,t._currentSets=t.currentSets,t.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null},t.currentPass=this.pipelineUtils.createBundleEncoder(e)}finishBundle(e,t){const n=this.get(e),s=n.currentPass.finish();this.get(t).bundleGPU=s,n.currentSets=n._currentSets,n.currentPass=n._currentPass}addBundle(e,t){this.get(e).renderBundles.push(this.get(t).bundleGPU)}createBindings(e,t,n,r){this.bindingUtils.createBindings(e,t,n,r)}updateBindings(e,t,n,r){this.bindingUtils.createBindings(e,t,n,r)}updateBinding(e){this.bindingUtils.updateBinding(e)}createIndexAttribute(e){this.attributeUtils.createAttribute(e,GPUBufferUsage.INDEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}createAttribute(e){this.attributeUtils.createAttribute(e,GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}createStorageAttribute(e){this.attributeUtils.createAttribute(e,GPUBufferUsage.STORAGE|GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}createIndirectStorageAttribute(e){this.attributeUtils.createAttribute(e,GPUBufferUsage.STORAGE|GPUBufferUsage.INDIRECT|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}updateAttribute(e){this.attributeUtils.updateAttribute(e)}destroyAttribute(e){this.attributeUtils.destroyAttribute(e)}updateSize(){this.colorBuffer=this.textureUtils.getColorBuffer(),this.defaultRenderPassdescriptor=null}getMaxAnisotropy(){return 16}hasFeature(e){return this.device.features.has(e)}copyTextureToTexture(e,t,n=null,r=null,s=0,o=0){let a=0,l=0,c=0,u=0,p=0,m=0,g=e.image.width,v=e.image.height,b=1;n!==null&&(n.isBox3===!0?(u=n.min.x,p=n.min.y,m=n.min.z,g=n.max.x-n.min.x,v=n.max.y-n.min.y,b=n.max.z-n.min.z):(u=n.min.x,p=n.min.y,g=n.max.x-n.min.x,v=n.max.y-n.min.y,b=1)),r!==null&&(a=r.x,l=r.y,c=r.z||0);const M=this.device.createCommandEncoder({label:"copyTextureToTexture_"+e.id+"_"+t.id}),x=this.get(e).texture,w=this.get(t).texture;M.copyTextureToTexture({texture:x,mipLevel:s,origin:{x:u,y:p,z:m}},{texture:w,mipLevel:o,origin:{x:a,y:l,z:c}},[g,v,b]),this.device.queue.submit([M.finish()]),o===0&&t.generateMipmaps&&this.textureUtils.generateMipmaps(t)}copyFramebufferToTexture(e,t,n){const r=this.get(t);let s=null;t.renderTarget?e.isDepthTexture?s=this.get(t.depthTexture).texture:s=this.get(t.textures[0]).texture:e.isDepthTexture?s=this.textureUtils.getDepthBuffer(t.depth,t.stencil):s=this.context.getCurrentTexture();const o=this.get(e).texture;if(s.format!==o.format){console.error("WebGPUBackend: copyFramebufferToTexture: Source and destination formats do not match.",s.format,o.format);return}let a;if(r.currentPass?(r.currentPass.end(),a=r.encoder):a=this.device.createCommandEncoder({label:"copyFramebufferToTexture_"+e.id}),a.copyTextureToTexture({texture:s,origin:[n.x,n.y,0]},{texture:o},[n.z,n.w]),e.generateMipmaps&&this.textureUtils.generateMipmaps(e),r.currentPass){const{descriptor:l}=r;for(let c=0;c<l.colorAttachments.length;c++)l.colorAttachments[c].loadOp=Xn.Load;if(t.depth&&(l.depthStencilAttachment.depthLoadOp=Xn.Load),t.stencil&&(l.depthStencilAttachment.stencilLoadOp=Xn.Load),r.currentPass=a.beginRenderPass(l),r.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null},t.viewport&&this.updateViewport(t),t.scissor){const{x:c,y:u,width:p,height:m}=t.scissorValue;
4232r.currentPass.setScissorRect(c,u,p,m)}}else this.device.queue.submit([a.finish()])}}class Ire extends FL{constructor(e,t,n,r,s,o){super(e,t,n,r,s,o),this.iesMap=null}copy(e,t){return super.copy(e,t),this.iesMap=e.iesMap,this}}class Bre extends uI{constructor(){super(),this.addMaterial(NZ,"MeshPhongMaterial"),this.addMaterial(nD,"MeshStandardMaterial"),this.addMaterial(gK,"MeshPhysicalMaterial"),this.addMaterial(xK,"MeshToonMaterial"),this.addMaterial(wZ,"MeshBasicMaterial"),this.addMaterial(PZ,"MeshLambertMaterial"),this.addMaterial(vZ,"MeshNormalMaterial"),this.addMaterial(MK,"MeshMatcapMaterial"),this.addMaterial(dZ,"LineBasicMaterial"),this.addMaterial(pZ,"LineDashedMaterial"),this.addMaterial(RK,"PointsMaterial"),this.addMaterial(rD,"SpriteMaterial"),this.addMaterial(LK,"ShadowMaterial"),this.addLight(Ete,Sk),this.addLight(pie,UL),this.addLight(Aie,wk),this.addLight(lI,FL),this.addLight(gie,OL),this.addLight(_ie,yk),this.addLight(vie,Ek),this.addLight(mie,Ire),this.addToneMapping(wD,ZP),this.addToneMapping(TD,KP),this.addToneMapping(ED,JP),this.addToneMapping(RD,eL),this.addToneMapping(CD,tL),this.addToneMapping(PD,nL)}}class yI extends Oie{constructor(e={}){let t;e.forceWebGL?t=_C:(t=Dre,e.getFallback=()=>(console.warn("THREE.WebGPURenderer: WebGPU is not available, running under WebGL2 backend."),new _C(e)));const n=new t(e);super(n,e),this.library=new Bre,this.isWebGPURenderer=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}}/**
4233 * @license
4234 * Copyright 2010-2025 Three.js Authors
4235 * SPDX-License-Identifier: MIT
4236 */z.BRDF_GGX;z.BRDF_Lambert;z.BasicShadowFilter;z.Break;z.Continue;z.DFGApprox;z.D_GGX;z.Discard;z.EPSILON;z.F_Schlick;const Fre=z.Fn;z.INFINITY;const Ure=z.If;z.Switch;const Ore=z.Loop;z.NodeShaderStage;z.NodeType;z.NodeUpdateType;z.NodeAccess;z.PCFShadowFilter;z.PCFSoftShadowFilter;z.PI;z.PI2;z.Return;z.Schlick_to_F0;z.ScriptableNodeResources;z.ShaderNode;z.TBNViewMatrix;z.VSMShadowFilter;z.V_GGX_SmithCorrelated;z.abs;z.acesFilmicToneMapping;z.acos;z.add;z.addNodeElement;z.agxToneMapping;z.all;z.alphaT;z.and;z.anisotropy;z.anisotropyB;z.anisotropyT;z.any;z.append;z.array;z.arrayBuffer;const kre=z.asin;z.assign;z.atan;z.atan2;z.atomicAdd;z.atomicAnd;z.atomicFunc;z.atomicMax;z.atomicMin;z.atomicOr;z.atomicStore;z.atomicSub;z.atomicXor;z.atomicLoad;z.attenuationColor;z.attenuationDistance;z.attribute;z.attributeArray;z.backgroundBlurriness;z.backgroundIntensity;z.backgroundRotation;z.batch;z.billboarding;z.bitAnd;z.bitNot;z.bitOr;z.bitXor;z.bitangentGeometry;z.bitangentLocal;z.bitangentView;z.bitangentWorld;z.bitcast;z.blendBurn;z.blendColor;z.blendDodge;z.blendOverlay;z.blendScreen;z.blur;z.bool;z.buffer;z.bufferAttribute;z.bumpMap;z.burn;z.bvec2;z.bvec3;z.bvec4;z.bypass;z.cache;z.call;z.cameraFar;z.cameraIndex;z.cameraNear;z.cameraNormalMatrix;z.cameraPosition;z.cameraProjectionMatrix;z.cameraProjectionMatrixInverse;z.cameraViewMatrix;z.cameraWorldMatrix;z.cbrt;z.cdl;z.ceil;z.checker;z.cineonToneMapping;z.clamp;z.clearcoat;z.clearcoatRoughness;z.code;z.color;z.colorSpaceToWorking;z.colorToDirection;z.compute;z.computeSkinning;z.cond;z.Const;z.context;z.convert;z.convertColorSpace;z.convertToTexture;const zre=z.cos;z.cross;z.cubeTexture;z.dFdx;z.dFdy;z.dashSize;z.debug;z.decrement;z.decrementBefore;z.defaultBuildStages;z.defaultShaderStages;z.defined;z.degrees;z.deltaTime;z.densityFog;z.densityFogFactor;z.depth;z.depthPass;z.difference;z.diffuseColor;z.directPointLight;z.directionToColor;z.dispersion;z.distance;z.div;z.dodge;z.dot;z.drawIndex;z.dynamicBufferAttribute;z.element;z.emissive;z.equal;z.equals;z.equirectUV;const Vre=z.exp;z.exp2;z.expression;z.faceDirection;z.faceForward;z.faceforward;const Gre=z.float;z.floor;z.fog;z.fract;z.frameGroup;z.frameId;z.frontFacing;z.fwidth;z.gain;z.gapSize;z.getConstNodeType;z.getCurrentStack;z.getDirection;z.getDistanceAttenuation;z.getGeometryRoughness;z.getNormalFromDepth;z.getParallaxCorrectNormal;z.getRoughness;z.getScreenPosition;z.getShIrradianceAt;z.getTextureIndex;z.getViewPosition;z.getShadowMaterial;z.getShadowRenderObjectFunction;z.glsl;z.glslFn;z.grayscale;z.greaterThan;z.greaterThanEqual;z.hash;z.highpModelNormalViewMatrix;z.highpModelViewMatrix;z.hue;z.increment;z.incrementBefore;z.instance;const qre=z.instanceIndex;z.instancedArray;z.instancedBufferAttribute;z.instancedDynamicBufferAttribute;z.instancedMesh;z.int;z.inverseSqrt;z.inversesqrt;z.invocationLocalIndex;z.invocationSubgroupIndex;z.ior;z.iridescence;z.iridescenceIOR;z.iridescenceThickness;z.ivec2;z.ivec3;z.ivec4;z.js;z.label;z.length;z.lengthSq;z.lessThan;z.lessThanEqual;z.lightPosition;z.lightShadowMatrix;z.lightTargetDirection;z.lightTargetPosition;z.lightViewPosition;z.lightingContext;z.lights;z.linearDepth;z.linearToneMapping;z.localId;z.globalId;z.log;z.log2;z.logarithmicDepthToViewZ;z.loop;z.luminance;z.mediumpModelViewMatrix;z.mat2;z.mat3;z.mat4;z.matcapUV;z.materialAO;z.materialAlphaTest;z.materialAnisotropy;z.materialAnisotropyVector;z.materialAttenuationColor;z.materialAttenuationDistance;z.materialClearcoat;z.materialClearcoatNormal;z.materialClearcoatRoughness;z.materialColor;z.materialDispersion;z.materialEmissive;z.materialIOR;z.materialIridescence;z.materialIridescenceIOR;z.materialIridescenceThickness;z.materialLightMap;z.materialLineDashOffset;z.materialLineDashSize;z.materialLineGapSize;z.materialLineScale;z.materialLineWidth;z.materialMetalness;z.materialNormal;z.materialOpacity;z.materialPointSize;z.materialReference;z.materialReflectivity;z.materialRefractionRatio;z.materialRotation;z.materialRoughness;z.materialSheen;z.materialSheenRoughness;z.materialShininess;z.materialSpecular;z.materialSpecularColor;z.materialSpecularIntensity;z.materialSpecularStrength;z.materialThickness;z.materialTransmission;z.max;z.maxMipLevel;z.metalness;z.min;z.mix;z.mixElement;z.mod;z.modInt;z.modelDirection;z.modelNormalMatrix;z.modelPosition;z.modelRadius;z.modelScale;z.modelViewMatrix;z.modelViewPosition;z.modelViewProjection;z.modelWorldMatrix;z.modelWorldMatrixInverse;z.morphReference;z.mrt;z.mul;z.mx_aastep;z.mx_cell_noise_float;z.mx_contrast;z.mx_fractal_noise_float;z.mx_fractal_noise_vec2;z.mx_fractal_noise_vec3;z.mx_fractal_noise_vec4;z.mx_hsvtorgb;z.mx_noise_float;z.mx_noise_vec3;z.mx_noise_vec4;z.mx_ramplr;z.mx_ramptb;z.mx_rgbtohsv;z.mx_safepower;z.mx_splitlr;z.mx_splittb;z.mx_srgb_texture_to_lin_rec709;z.mx_transform_uv;z.mx_worley_noise_float;z.mx_worley_noise_vec2;z.mx_worley_noise_vec3;const Hre=z.negate;z.neutralToneMapping;z.nodeArray;z.nodeImmutable;z.nodeObject;z.nodeObjects;z.nodeProxy;
4236z.normalFlat;z.normalGeometry;z.normalLocal;z.normalMap;z.normalView;z.normalWorld;z.normalize;z.not;z.notEqual;z.numWorkgroups;z.objectDirection;z.objectGroup;z.objectPosition;z.objectRadius;z.objectScale;z.objectViewPosition;z.objectWorldMatrix;z.oneMinus;z.or;z.orthographicDepthToViewZ;z.oscSawtooth;z.oscSine;z.oscSquare;z.oscTriangle;z.output;z.outputStruct;z.overlay;z.overloadingFn;z.parabola;z.parallaxDirection;z.parallaxUV;z.parameter;z.pass;z.passTexture;z.pcurve;z.perspectiveDepthToViewZ;z.pmremTexture;z.pointUV;z.pointWidth;z.positionGeometry;z.positionLocal;z.positionPrevious;z.positionView;z.positionViewDirection;z.positionWorld;z.positionWorldDirection;z.posterize;z.pow;z.pow2;z.pow3;z.pow4;z.property;z.radians;z.rand;z.range;z.rangeFog;z.rangeFogFactor;z.reciprocal;z.lightProjectionUV;z.reference;z.referenceBuffer;z.reflect;z.reflectVector;z.reflectView;z.reflector;z.refract;z.refractVector;z.refractView;z.reinhardToneMapping;z.remainder;z.remap;z.remapClamp;z.renderGroup;z.renderOutput;z.rendererReference;z.rotate;z.rotateUV;z.roughness;z.round;z.rtt;z.sRGBTransferEOTF;z.sRGBTransferOETF;z.sampler;z.samplerComparison;z.saturate;z.saturation;z.screen;z.screenCoordinate;z.screenSize;z.screenUV;z.scriptable;z.scriptableValue;z.select;z.setCurrentStack;z.shaderStages;z.shadow;z.pointShadow;z.shadowPositionWorld;z.sharedUniformGroup;z.shapeCircle;z.sheen;z.sheenRoughness;z.shiftLeft;z.shiftRight;z.shininess;z.sign;const Wre=z.sin;z.sinc;z.skinning;z.smoothstep;z.smoothstepElement;z.specularColor;z.specularF90;z.spherizeUV;z.split;z.spritesheetUV;const $re=z.sqrt;z.stack;z.step;const jre=z.storage;z.storageBarrier;z.storageObject;z.storageTexture;z.string;z.struct;z.sub;z.subgroupIndex;z.subgroupSize;z.tan;z.tangentGeometry;z.tangentLocal;z.tangentView;z.tangentWorld;z.temp;z.texture;z.texture3D;z.textureBarrier;z.textureBicubic;z.textureCubeUV;z.textureLoad;z.textureSize;z.textureStore;z.thickness;z.threshold;z.time;z.timerDelta;z.timerGlobal;z.timerLocal;z.toOutputColorSpace;z.toWorkingColorSpace;z.toneMapping;z.toneMappingExposure;z.toonOutlinePass;z.transformDirection;z.transformNormal;z.transformNormalToView;z.transformedBentNormalView;z.transformedBitangentView;z.transformedBitangentWorld;z.transformedClearcoatNormalView;z.transformedNormalView;z.transformedNormalWorld;z.transformedTangentView;z.transformedTangentWorld;z.transmission;z.transpose;z.tri;z.tri3;z.triNoise3D;z.triplanarTexture;z.triplanarTextures;z.trunc;z.tslFn;z.uint;const Xre=z.uniform;z.uniformArray;z.uniformGroup;z.uniforms;z.userData;z.uv;z.uvec2;z.uvec3;z.uvec4;z.Var;z.varying;z.varyingProperty;z.vec2;z.vec3;z.vec4;z.vectorComponents;z.velocity;z.vertexColor;z.vertexIndex;z.vibrance;z.viewZToLogarithmicDepth;z.viewZToOrthographicDepth;z.viewZToPerspectiveDepth;z.viewport;z.viewportBottomLeft;z.viewportCoordinate;z.viewportDepthTexture;z.viewportLinearDepth;z.viewportMipTexture;z.viewportResolution;z.viewportSafeUV;z.viewportSharedTexture;z.viewportSize;z.viewportTexture;z.viewportTopLeft;z.viewportUV;z.wgsl;z.wgslFn;z.workgroupArray;z.workgroupBarrier;z.workgroupId;z.workingToColorSpace;z.xor;const TC=new Hl,fg=new re;class xI extends Rk{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute("position",new Gn(e,3)),this.setAttribute("uv",new Gn(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new q_(t,6,1);return this.setAttribute("instanceStart",new Rc(n,3,0)),this.setAttribute("instanceEnd",new Rc(n,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new q_(t,6,1);return this.setAttribute("instanceColorStart",new Rc(n,3,0)),this.setAttribute("instanceColorEnd",new Rc(n,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new lk(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Hl);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),TC.setFromBufferAttribute(t),this.boundingBox.union(TC))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Yc),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let r=0;for(let s=0,o=e.count;s<o;s++)fg.fromBufferAttribute(e,s),r=Math.max(r,n.distanceToSquared(fg)),fg.fromBufferAttribute(t,s),r=Math.max(r,n.distanceToSquared(fg));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}Lt.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new at(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};Fs.line={uniforms:P1.merge([Lt.common,Lt.fog,Lt.line]),vertexShader:`
4237		#include <common>
4238		#include <color_pars_vertex>
4239		#include <fog_pars_vertex>
4240		#include <logdepthbuf_pars_vertex>
4241		#include <clipping_planes_pars_vertex>
4242
4243		uniform float linewidth;
4244		uniform vec2 resolution;
4245
4246		attribute vec3 instanceStart;
4247		attribute vec3 instanceEnd;
4248
4249		attribute vec3 instanceColorStart;
4250		attribute vec3 instanceColorEnd;
4251
4252		#ifdef WORLD_UNITS
4253
4254			varying vec4 worldPos;
4255			varying vec3 worldStart;
4256			varying vec3 worldEnd;
4257
4258			#ifdef USE_DASH
4259
4260				varying vec2 vUv;
4261
4262			#endif
4263
4264		#else
4265
4266			varying vec2 vUv;
4267
4268		#endif
4269
4270		#ifdef USE_DASH
4271
4272			uniform float dashScale;
4273			attribute float instanceDistanceStart;
4274			attribute float instanceDistanceEnd;
4275			varying float vLineDistance;
4276
4277		#endif
4278
4279		void trimSegment( const in vec4 start, inout vec4 end ) {
4280
4281			// trim end segment so it terminates between the camera plane and the near plane
4282
4283			// conservative estimate of the near plane
4284			float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
4285			float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
4286			float nearEstimate = - 0.5 * b / a;
4287
4288			float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
4289
4290			end.xyz = mix( start.xyz, end.xyz, alpha );
4291
4292		}
4293
4294		void main() {
4295
4296			#ifdef USE_COLOR
4297
4298				vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
4299
4300			#endif
4301
4302			#ifdef USE_DASH
4303
4304				vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
4305				vUv = uv;
4306
4307			#endif
4308
4309			float aspect = resolution.x / resolution.y;
4310
4311			// camera space
4312			vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
4313			vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
4314
4315			#ifdef WORLD_UNITS
4316
4317				worldStart = start.xyz;
4318				worldEnd = end.xyz;
4319
4320			#else
4321
4322				vUv = uv;
4323
4324			#endif
4325
4326			// special case for perspective projection, and segments that terminate either in, or behind, the camera plane
4327			// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
4328			// but we need to perform ndc-space calculations in the shader, so we must address this issue directly
4329			// perhaps there is a more elegant solution -- WestLangley
4330
4331			bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
4332
4333			if ( perspective ) {
4334
4335				if ( start.z < 0.0 && end.z >= 0.0 ) {
4336
4337					trimSegment( start, end );
4338
4339				} else if ( end.z < 0.0 && start.z >= 0.0 ) {
4340
4341					trimSegment( end, start );
4342
4343				}
4344
4345			}
4346
4347			// clip space
4348			vec4 clipStart = projectionMatrix * start;
4349			vec4 clipEnd = projectionMatrix * end;
4350
4351			// ndc space
4352			vec3 ndcStart = clipStart.xyz / clipStart.w;
4353			vec3 ndcEnd = clipEnd.xyz / clipEnd.w;
4354
4355			// direction
4356			vec2 dir = ndcEnd.xy - ndcStart.xy;
4357
4358			// account for clip-space aspect ratio
4359			dir.x *= aspect;
4360			dir = normalize( dir );
4361
4362			#ifdef WORLD_UNITS
4363
4364				vec3 worldDir = normalize( end.xyz - start.xyz );
4365				vec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) );
4366				vec3 worldUp = normalize( cross( worldDir, tmpFwd ) );
4367				vec3 worldFwd = cross( worldDir, worldUp );
4368				worldPos = position.y < 0.5 ? start: end;
4369
4370				// height offset
4371				float hw = linewidth * 0.5;
4372				worldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp;
4373
4374				// don't extend the line if we're rendering dashes because we
4375				// won't be rendering the endcaps
4376				#ifndef USE_DASH
4377
4378					// cap extension
4379					worldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir;
4380
4381					// add width to the box
4382					worldPos.xyz += worldFwd * hw;
4383
4384					// endcaps
4385					if ( position.y > 1.0 || position.y < 0.0 ) {
4386
4387						worldPos.xyz -= worldFwd * 2.0 * hw;
4388
4389					}
4390
4391				#endif
4392
4393				// project the worldpos
4394				vec4 clip = projectionMatrix * worldPos;
4395
4396				// shift the depth of the projected points so the line
4397				// segments overlap neatly
4398				vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
4399				clip.z = clipPose.z * clip.w;
4400
4401			#else
4402
4403				vec2 offset = vec2( dir.y, - dir.x );
4404				// undo aspect ratio adjustment
4405				dir.x /= aspect;
4406				offset.x /= aspect;
4407
4408				// sign flip
4409				if ( position.x < 0.0 ) offset *= - 1.0;
4410
4411				// endcaps
4412				if ( position.y < 0.0 ) {
4413
4414					offset += - dir;
4415
4416				} else if ( position.y > 1.0 ) {
4417
4418					offset += dir;
4419
4420				}
4421
4422				// adjust for linewidth
4423				offset *= linewidth;
4424
4425				// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
4426				offset /= resolution.y;
4427
4428				// select end
4429				vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
4430
4431				// back to clip space
4432				offset *= clip.w;
4433
4434				clip.xy += offset;
4435
4436			#endif
4437
4438			gl_Position = clip;
4439
4440			vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation
4441
4442			#include <logdepthbuf_vertex>
4443			#include <clipping_planes_vertex>
4444			#include <fog_vertex>
4445
4446		}
4447		`,fragmentShader:`
4448		uniform vec3 diffuse;
4449		uniform float opacity;
4450		uniform float linewidth;
4451
4452		#ifdef USE_DASH
4453
4454			uniform float dashOffset;
4455			uniform float dashSize;
4456			uniform float gapSize;
4457
4458		#endif
4459
4460		varying float vLineDistance;
4461
4462		#ifdef WORLD_UNITS
4463
4464			varying vec4 worldPos;
4465			varying vec3 worldStart;
4466			varying vec3 worldEnd;
4467
4468			#ifdef USE_DASH
4469
4470				varying vec2 vUv;
4471
4472			#endif
4473
4474		#else
4475
4476			varying vec2 vUv;
4477
4478		#endif
4479
4480		#include <common>
4481		#include <color_pars_fragment>
4482		#include <fog_pars_fragment>
4483		#include <logdepthbuf_pars_fragment>
4484		#include <clipping_planes_pars_fragment>
4485
4486		vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {
4487
4488			float mua;
4489			float mub;
4490
4491			vec3 p13 = p1 - p3;
4492			vec3 p43 = p4 - p3;
4493
4494			vec3 p21 = p2 - p1;
4495
4496			float d1343 = dot( p13, p43 );
4497			float d4321 = dot( p43, p21 );
4498			float d1321 = dot( p13, p21 );
4499			float d4343 = dot( p43, p43 );
4500			float d2121 = dot( p21, p21 );
4501
4502			float denom = d2121 * d4343 - d4321 * d4321;
4503
4504			float numer = d1343 * d4321 - d1321 * d4343;
4505
4506			mua = numer / denom;
4507			mua = clamp( mua, 0.0, 1.0 );
4508			mub = ( d1343 + d4321 * ( mua ) ) / d4343;
4509			mub = clamp( mub, 0.0, 1.0 );
4510
4511			return vec2( mua, mub );
4512
4513		}
4514
4515		void main() {
4516
4517			#include <clipping_planes_fragment>
4518
4519			#ifdef USE_DASH
4520
4521				if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
4522
4523				if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
4524
4525			#endif
4526
4527			float alpha = opacity;
4528
4529			#ifdef WORLD_UNITS
4530
4531				// Find the closest points on the view ray and the line segment
4532				vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
4533				vec3 lineDir = worldEnd - worldStart;
4534				vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );
4535
4536				vec3 p1 = worldStart + lineDir * params.x;
4537				vec3 p2 = rayEnd * params.y;
4538				vec3 delta = p1 - p2;
4539				float len = length( delta );
4540				float norm = len / linewidth;
4541
4542				#ifndef USE_DASH
4543
4544					#ifdef USE_ALPHA_TO_COVERAGE
4545
4546						float dnorm = fwidth( norm );
4547						alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );
4548
4549					#else
4550
4551						if ( norm > 0.5 ) {
4552
4553							discard;
4554
4555						}
4556
4557					#endif
4558
4559				#endif
4560
4561			#else
4562
4563				#ifdef USE_ALPHA_TO_COVERAGE
4564
4565					// artifacts appear on some hardware if a derivative is taken within a conditional
4566					float a = vUv.x;
4567					float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
4568					float len2 = a * a + b * b;
4569					float dlen = fwidth( len2 );
4570
4571					if ( abs( vUv.y ) > 1.0 ) {
4572
4573						alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );
4574
4575					}
4576
4577				#else
4578
4579					if ( abs( vUv.y ) > 1.0 ) {
4580
4581						float a = vUv.x;
4582						float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
4583						float len2 = a * a + b * b;
4584
4585						if ( len2 > 1.0 ) discard;
4586
4587					}
4588
4589				#endif
4590
4591			#endif
4592
4593			vec4 diffuseColor = vec4( diffuse, alpha );
4594
4595			#include <logdepthbuf_fragment>
4596			#include <color_fragment>
4597
4598			gl_FragColor = vec4( diffuseColor.rgb, alpha );
4599
4600			#include <tonemapping_fragment>
4601			#include <colorspace_fragment>
4602			#include <fog_fragment>
4603			#include <premultiplied_alpha_fragment>
4604
4605		}
4606		`};class ww extends Xs{constructor(e){super({type:"LineMaterial",uniforms:P1.clone(Fs.line.uniforms),vertexShader:Fs.line.vertexShader,fragmentShader:Fs.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const Nx=new Jt,EC=new re,RC=new re,Gr=new Jt,qr=new Jt,Ca=new Jt,Dx=new re,Ix=new un,Wr=new Lk,CC=new re,pg=new Hl,Ag=new Yc,Pa=new Jt;let Oa,Qu;function PC(i,e,t){return Pa.set(0,0,-e,1).applyMatrix4(i.projectionMatrix),Pa.multiplyScalar(1/Pa.w),Pa.x=Qu/t.width,Pa.y=Qu/t.height,Pa.applyMatrix4(i.projectionMatrixInverse),Pa.multiplyScalar(1/Pa.w),Math.abs(Math.max(Pa.x,Pa.y)
4606)}function Yre(i,e){const t=i.matrixWorld,n=i.geometry,r=n.attributes.instanceStart,s=n.attributes.instanceEnd,o=Math.min(n.instanceCount,r.count);for(let a=0,l=o;a<l;a++){Wr.start.fromBufferAttribute(r,a),Wr.end.fromBufferAttribute(s,a),Wr.applyMatrix4(t);const c=new re,u=new re;Oa.distanceSqToSegment(Wr.start,Wr.end,u,c),u.distanceTo(c)<Qu*.5&&e.push({point:u,pointOnLine:c,distance:Oa.origin.distanceTo(u),object:i,face:null,faceIndex:a,uv:null,uv1:null})}}function Qre(i,e,t){const n=e.projectionMatrix,s=i.material.resolution,o=i.matrixWorld,a=i.geometry,l=a.attributes.instanceStart,c=a.attributes.instanceEnd,u=Math.min(a.instanceCount,l.count),p=-e.near;Oa.at(1,Ca),Ca.w=1,Ca.applyMatrix4(e.matrixWorldInverse),Ca.applyMatrix4(n),Ca.multiplyScalar(1/Ca.w),Ca.x*=s.x/2,Ca.y*=s.y/2,Ca.z=0,Dx.copy(Ca),Ix.multiplyMatrices(e.matrixWorldInverse,o);for(let m=0,g=u;m<g;m++){if(Gr.fromBufferAttribute(l,m),qr.fromBufferAttribute(c,m),Gr.w=1,qr.w=1,Gr.applyMatrix4(Ix),qr.applyMatrix4(Ix),Gr.z>p&&qr.z>p)continue;if(Gr.z>p){const R=Gr.z-qr.z,C=(Gr.z-p)/R;Gr.lerp(qr,C)}else if(qr.z>p){const R=qr.z-Gr.z,C=(qr.z-p)/R;qr.lerp(Gr,C)}Gr.applyMatrix4(n),qr.applyMatrix4(n),Gr.multiplyScalar(1/Gr.w),qr.multiplyScalar(1/qr.w),Gr.x*=s.x/2,Gr.y*=s.y/2,qr.x*=s.x/2,qr.y*=s.y/2,Wr.start.copy(Gr),Wr.start.z=0,Wr.end.copy(qr),Wr.end.z=0;const b=Wr.closestPointToPointParameter(Dx,!0);Wr.at(b,CC);const M=Sf.lerp(Gr.z,qr.z,b),x=M>=-1&&M<=1,w=Dx.distanceTo(CC)<Qu*.5;if(x&&w){Wr.start.fromBufferAttribute(l,m),Wr.end.fromBufferAttribute(c,m),Wr.start.applyMatrix4(o),Wr.end.applyMatrix4(o);const R=new re,C=new re;Oa.distanceSqToSegment(Wr.start,Wr.end,C,R),t.push({point:C,pointOnLine:R,distance:Oa.origin.distanceTo(C),object:i,face:null,faceIndex:m,uv:null,uv1:null})}}}class Zre extends qn{constructor(e=new xI,t=new ww({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,r=new Float32Array(2*t.count);for(let o=0,a=0,l=t.count;o<l;o++,a+=2)EC.fromBufferAttribute(t,o),RC.fromBufferAttribute(n,o),r[a]=a===0?0:r[a-1],r[a+1]=r[a]+EC.distanceTo(RC);const s=new q_(r,2,1);return e.setAttribute("instanceDistanceStart",new Rc(s,1,0)),e.setAttribute("instanceDistanceEnd",new Rc(s,1,1)),this}raycast(e,t){const n=this.material.worldUnits,r=e.camera;r===null&&!n&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const s=e.params.Line2!==void 0&&e.params.Line2.threshold||0;Oa=e.ray;const o=this.matrixWorld,a=this.geometry,l=this.material;Qu=l.linewidth+s,a.boundingSphere===null&&a.computeBoundingSphere(),Ag.copy(a.boundingSphere).applyMatrix4(o);let c;if(n)c=Qu*.5;else{const p=Math.max(r.near,Ag.distanceToPoint(Oa.origin));c=PC(r,p,l.resolution)}if(Ag.radius+=c,Oa.intersectsSphere(Ag)===!1)return;a.boundingBox===null&&a.computeBoundingBox(),pg.copy(a.boundingBox).applyMatrix4(o);let u;if(n)u=Qu*.5;else{const p=Math.max(r.near,pg.distanceToPoint(Oa.origin));u=PC(r,p,l.resolution)}pg.expandByScalar(u),Oa.intersectsBox(pg)!==!1&&(n?Yre(this,t):Qre(this,r,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(Nx),this.material.uniforms.resolution.value.set(Nx.z,Nx.w))}}class bI extends xI{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setPositions(n),this}setColors(e){const t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setColors(n),this}setFromPoints(e){const t=e.length-1,n=new Float32Array(6*t);for(let r=0;r<t;r++)n[6*r]=e[r].x,n[6*r+1]=e[r].y,n[6*r+2]=e[r].z||0,n[6*r+3]=e[r+1].x,n[6*r+4]=e[r+1].y,n[6*r+5]=e[r+1].z||0;return super.setPositions(n),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class Kre extends Zre{constructor(e=new bI,t=new ww({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class LC extends sk{constructor(e,t={}){const n=t.font;if(n===void 0)super();else{const r=n.generateShapes(e,t.size);t.depth===void 0&&(t.depth=50),t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(r,t)}
4606this.type="TextGeometry"}}class Jre{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100){const n=[],r=ese(e,t,this.data);for(let s=0,o=r.length;s<o;s++)n.push(...r[s].toShapes());return n}}function ese(i,e,t){const n=Array.from(i),r=e/t.resolution,s=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*r,o=[];let a=0,l=0;for(let c=0;c<n.length;c++){const u=n[c];if(u===`
4607`)a=0,l-=s;else{const p=tse(u,r,a,l,t);a+=p.offsetX,o.push(p.path)}}return o}function tse(i,e,t,n,r){const s=r.glyphs[i]||r.glyphs["?"];if(!s){console.error('THREE.Font: character "'+i+'" does not exists in font family '+r.familyName+".");return}const o=new Nk;let a,l,c,u,p,m,g,v;if(s.o){const b=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let M=0,x=b.length;M<x;)switch(b[M++]){case"m":a=b[M++]*e+t,l=b[M++]*e+n,o.moveTo(a,l);break;case"l":a=b[M++]*e+t,l=b[M++]*e+n,o.lineTo(a,l);break;case"q":c=b[M++]*e+t,u=b[M++]*e+n,p=b[M++]*e+t,m=b[M++]*e+n,o.quadraticCurveTo(p,m,c,u);break;case"b":c=b[M++]*e+t,u=b[M++]*e+n,p=b[M++]*e+t,m=b[M++]*e+n,g=b[M++]*e+t,v=b[M++]*e+n,o.bezierCurveTo(p,m,g,v,c,u);break}}return{offsetX:s.ha*e,path:o}}function Gb(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}function nse(i){if(Array.isArray(i))return i}function ise(i){if(Array.isArray(i))return Gb(i)}function SI(i,e,t){if(typeof i=="function"?i===e:i.has(e))return arguments.length<3?e:t;throw new TypeError("Private element is not present on this object")}function rse(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function NC(i,e,t,n,r,s,o){try{var a=i[s](o),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(n,r)}function sse(i){return function(){var e=this,t=arguments;return new Promise(function(n,r){var s=i.apply(e,t);function o(l){NC(s,n,r,o,a,"next",l)}function a(l){NC(s,n,r,o,a,"throw",l)}o(void 0)})}}function pv(i,e,t){return e=Df(e),pse(i,Ew()?Reflect.construct(e,t||[],Df(i).constructor):e.apply(i,t))}function ose(i,e){if(e.has(i))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Av(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function qp(i,e){return i.get(SI(i,e))}function Bx(i,e,t){ose(i,e),e.set(i,t)}function Fx(i,e,t){return i.set(SI(i,e),t),t}function Tw(i,e,t){if(Ew())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var r=new(i.bind.apply(i,n));return r}function ase(i,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,MI(n.key),n)}}function mv(i,e,t){return e&&ase(i.prototype,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function kr(i,e,t){return(e=MI(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function qb(){return qb=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(i,e,t){var n=Ase(i,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(arguments.length<3?i:t):r.value}},qb.apply(null,arguments)}function Df(i){return Df=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Df(i)}function gv(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),e&&Wb(i,e)}function Ew(){try{var i=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ew=function(){return!!i})()}function lse(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function cse(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,r,s,o,a=[],l=!0,c=!1;try{if(s=(t=t.call(i)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,r=u}
vendor: 4,404 bytes, lines 4607-4609
4607finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}function use(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4608In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hse(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4609In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DC(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function ti(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?DC(Object(t),!0).forEach(function(n){kr(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):DC(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function dse(i,e){if(i==null)return{};var t,n,r=fse(i,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(n=0;n<s.length;n++)t=s[n],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(i,t)&&(r[t]=i[t])}return r}function fse(i,e){if(i==null)return{};var t={};for(var n in i)if({}.hasOwnProperty.call(i,n)){if(e.indexOf(n)!==-1)continue;t[n]=i[n]}return t}function pse(i,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rse(i)}function Hb(){Hb=function(){return e};var i,e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(H,$,K){H[$]=K.value},s=typeof Symbol=="function"?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function c(H,$,K){return Object.defineProperty(H,$,{value:K,enumerable:!0,configurable:!0,writable:!0}),H[$]}try{c({},"")}catch{c=function($,K,he){return $[K]=he}}function u(H,$,K,he){var ie=$&&$.prototype instanceof x?$:x,de=Object.create(ie.prototype),Ce=new Q(he||[]);return r(de,"_invoke",{value:F(H,K,Ce)}),de}function p(H,$,K){try{return{type:"normal",arg:H.call($,K)}}catch(he){return{type:"throw",arg:he}}}e.wrap=u;var m="suspendedStart",g="suspendedYield",v="executing",b="completed",M={};function x(){}function w(){}function R(){}var C={};c(C,o,function(){return this});var N=Object.getPrototypeOf,D=N&&N(N(J([])));D&&D!==t&&n.call(D,o)&&(C=D);var P=R.prototype=x.prototype=Object.create(C);function O(H){["next","throw","return"].forEach(function($){c(H,$,function(K){return this._invoke($,K)})})}function I(H,$){function K(ie,de,Ce,Fe){var ge=p(H[ie],H,de);if(ge.type!=="throw"){var Ge=ge.arg,Me=Ge.value;return Me&&typeof Me=="object"&&n.call(Me,"__await")?$.resolve(Me.__await).then(function(Ye){K("next",Ye,Ce,Fe)},function(Ye){K("throw",Ye,Ce,Fe)}):$.resolve(Me).then(function(Ye){Ge.value=Ye,Ce(Ge)},function(Ye){return K("throw",Ye,Ce,Fe)})}Fe(ge.arg)}var he;r(this,"_invoke",{value:function(ie,de){function Ce(){return new $(function(Fe,ge){K(ie,de,Fe,ge)})}return he=he?he.then(Ce,Ce):Ce()}})}function F(H,$,K){var he=m;return function(ie,de){if(he===v)throw Error("Generator is already running");if(he===b){if(ie==="throw")throw de;return{value:i,done:!0}}for(K.method=ie,K.arg=de;;){var Ce=K.delegate;if(Ce){var Fe=k(Ce,K);if(Fe){if(Fe===M)continue;return Fe}}if(K.method==="next")K.sent=K._sent=K.arg;else if(K.method==="throw"){if(he===m)throw he=b,K.arg;K.dispatchException(K.arg)}else K.method==="return"&&K.abrupt("return",K.arg);he=v;var ge=p(H,$,K);if(ge.type==="normal"){if(he=K.done?b:g,ge.arg===M)continue;return{value:ge.arg,done:K.done}}ge.type==="throw"&&(he=b,K.method="throw",K.arg=ge.arg)}}}function k(H,$){var K=$.method,he=H.iterator[K];if(he===i)return $.delegate=null,K==="throw"&&H.iterator.return&&($.method="return",$.arg=i,k(H,$),$.method==="throw")||K!=="return"&&($.method="throw",$.arg=new TypeError("The iterator does not provide a '"+K+"' method")),M;var ie=p(he,H.iterator,$.arg);if(ie.type==="throw")return $.method="throw",$.arg=ie.arg,$.delegate=null,M;var de=ie.arg;return de?de.done?($[H.resultName]=de.value,$.next=H.nextLoc,$.method!=="return"&&($.method="next",$.arg=i),$.delegate=null,M):de:($.method="throw",$.arg=new TypeError("iterator result is not an object"),$.delegate=null,M)}
vendor: 5,099 bytes, line 4609
4609function Y(H){var $={tryLoc:H[0]};1 in H&&($.catchLoc=H[1]),2 in H&&($.finallyLoc=H[2],$.afterLoc=H[3]),this.tryEntries.push($)}function W(H){var $=H.completion||{};$.type="normal",delete $.arg,H.completion=$}function Q(H){this.tryEntries=[{tryLoc:"root"}],H.forEach(Y,this),this.reset(!0)}function J(H){if(H||H===""){var $=H[o];if($)return $.call(H);if(typeof H.next=="function")return H;if(!isNaN(H.length)){var K=-1,he=function ie(){for(;++K<H.length;)if(n.call(H,K))return ie.value=H[K],ie.done=!1,ie;return ie.value=i,ie.done=!0,ie};return he.next=he}}throw new TypeError(typeof H+" is not iterable")}return w.prototype=R,r(P,"constructor",{value:R,configurable:!0}),r(R,"constructor",{value:w,configurable:!0}),w.displayName=c(R,l,"GeneratorFunction"),e.isGeneratorFunction=function(H){var $=typeof H=="function"&&H.constructor;return!!$&&($===w||($.displayName||$.name)==="GeneratorFunction")},e.mark=function(H){return Object.setPrototypeOf?Object.setPrototypeOf(H,R):(H.__proto__=R,c(H,l,"GeneratorFunction")),H.prototype=Object.create(P),H},e.awrap=function(H){return{__await:H}},O(I.prototype),c(I.prototype,a,function(){return this}),e.AsyncIterator=I,e.async=function(H,$,K,he,ie){ie===void 0&&(ie=Promise);var de=new I(u(H,$,K,he),ie);return e.isGeneratorFunction($)?de:de.next().then(function(Ce){return Ce.done?Ce.value:de.next()})},O(P),c(P,l,"Generator"),c(P,o,function(){return this}),c(P,"toString",function(){return"[object Generator]"}),e.keys=function(H){var $=Object(H),K=[];for(var he in $)K.push(he);return K.reverse(),function ie(){for(;K.length;){var de=K.pop();if(de in $)return ie.value=de,ie.done=!1,ie}return ie.done=!0,ie}},e.values=J,Q.prototype={constructor:Q,reset:function(H){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(W),!H)for(var $ in this)$.charAt(0)==="t"&&n.call(this,$)&&!isNaN(+$.slice(1))&&(this[$]=i)},stop:function(){this.done=!0;var H=this.tryEntries[0].completion;if(H.type==="throw")throw H.arg;return this.rval},dispatchException:function(H){if(this.done)throw H;var $=this;function K(ge,Ge){return de.type="throw",de.arg=H,$.next=ge,Ge&&($.method="next",$.arg=i),!!Ge}for(var he=this.tryEntries.length-1;he>=0;--he){var ie=this.tryEntries[he],de=ie.completion;if(ie.tryLoc==="root")return K("end");if(ie.tryLoc<=this.prev){var Ce=n.call(ie,"catchLoc"),Fe=n.call(ie,"finallyLoc");if(Ce&&Fe){if(this.prev<ie.catchLoc)return K(ie.catchLoc,!0);if(this.prev<ie.finallyLoc)return K(ie.finallyLoc)}else if(Ce){if(this.prev<ie.catchLoc)return K(ie.catchLoc,!0)}else{if(!Fe)throw Error("try statement without catch or finally");if(this.prev<ie.finallyLoc)return K(ie.finallyLoc)}}}},abrupt:function(H,$){for(var K=this.tryEntries.length-1;K>=0;--K){var he=this.tryEntries[K];if(he.tryLoc<=this.prev&&n.call(he,"finallyLoc")&&this.prev<he.finallyLoc){var ie=he;break}}ie&&(H==="break"||H==="continue")&&ie.tryLoc<=$&&$<=ie.finallyLoc&&(ie=null);var de=ie?ie.completion:{};return de.type=H,de.arg=$,ie?(this.method="next",this.next=ie.finallyLoc,M):this.complete(de)},complete:function(H,$){if(H.type==="throw")throw H.arg;return H.type==="break"||H.type==="continue"?this.next=H.arg:H.type==="return"?(this.rval=this.arg=H.arg,this.method="return",this.next="end"):H.type==="normal"&&$&&(this.next=$),M},finish:function(H){for(var $=this.tryEntries.length-1;$>=0;--$){var K=this.tryEntries[$];if(K.finallyLoc===H)return this.complete(K.completion,K.afterLoc),W(K),M}},catch:function(H){for(var $=this.tryEntries.length-1;$>=0;--$){var K=this.tryEntries[$];if(K.tryLoc===H){var he=K.completion;if(he.type==="throw"){var ie=he.arg;W(K)}return ie}}throw Error("illegal catch attempt")},delegateYield:function(H,$,K){return this.delegate={iterator:J(H),resultName:$,nextLoc:K},this.method==="next"&&(this.arg=i),M}},e}function Wb(i,e){return Wb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},Wb(i,e)}function Ei(i,e){return nse(i)||cse(i,e)||wI(i,e)||use()}function Ase(i,e){for(;!{}.hasOwnProperty.call(i,e)&&(i=Df(i))!==null;);return i}function Ux(i,e,t,n){var r=qb(Df(i.prototype),e,t);return typeof r=="function"?function(s){return r.apply(t,s)}:r}function ai(i){return ise(i)||lse(i)||wI(i)||hse()}function mse(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function MI(i){var e=mse(i,"string");return typeof e=="symbol"?e:e+""}function wI(i,e){if(i){if(typeof i=="string")return Gb(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Gb(i,e):void 0}}var TI=function(e){e instanceof Array?e.forEach(TI):(e.map&&e.map.dispose(),e.dispose())},Rw=function(e){e.geometry&&e.geometry.dispose(),e.material&&TI(e.material),e.texture&&e.texture.dispose(),e.children&&e.children.forEac
4609h(Rw)},di=function(e){if(e&&e.children)for(;e.children.length;){var t=e.children[0];e.remove(t),Rw(t)}};function Ps(i,e){var t=new e;return{linkProp:function(r){return{default:t[r](),onChange:function(o,a){a[i][r](o)},triggerUpdate:!1}},linkMethod:function(r){return function(s){for(var o=s[i],a=arguments.length,l=new Array(a>1?a-1:0),c=1;c<a;c++)l[c-1]=arguments[c];var u=o[r].apply(o,l);return u===o?this:u}}}}var bi=100;function IC(){return bi}function Wo(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,r=(90-e)*Math.PI/180,s=bi*(1+t),o=Math.sin(n);return{x:s*o*Math.cos(r),y:s*Math.cos(n),z:s*o*Math.sin(r)}}function EI(i){var e=i.x,t=i.y,n=i.z,r=Math.sqrt(e*e+t*t+n*n),s=Math.acos(t/r),o=Math.atan2(n,e);return{lat:90-s*180/Math.PI,lng:90-o*180/Math.PI-(o<-Math.PI/2?360:0),altitude:r/bi-1}}function Fu(i){return i*Math.PI/180}var m0=window.THREE?window.THREE:{BackSide:oi,BufferAttribute:Ii,Color:qt,Mesh:qn,ShaderMaterial:Xs},gse=`
4610uniform float hollowRadius;
4611
4612varying vec3 vVertexWorldPosition;
4613varying vec3 vVertexNormal;
4614varying float vCameraDistanceToObjCenter;
4615varying float vVertexAngularDistanceToHollowRadius;
4616
4617void main() {    
4618  vVertexNormal	= normalize(normalMatrix * normal);
4619  vVertexWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;
4620  
4621  vec4 objCenterViewPosition = modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0);
4622  vCameraDistanceToObjCenter = length(objCenterViewPosition);
4623  
4624  float edgeAngle = atan(hollowRadius / vCameraDistanceToObjCenter);
4625  float vertexAngle = acos(dot(normalize(modelViewMatrix * vec4(position, 1.0)), normalize(objCenterViewPosition)));
4626  vVertexAngularDistanceToHollowRadius = vertexAngle - edgeAngle;
4627
4628  gl_Position	= projectionMatrix * modelViewMatrix * vec4(position, 1.0);
4629}`,_se=`
4630uniform vec3 color;
4631uniform float coefficient;
4632uniform float power;
4633uniform float hollowRadius;
4634
4635varying vec3 vVertexNormal;
4636varying vec3 vVertexWorldPosition;
4637varying float vCameraDistanceToObjCenter;
4638varying float vVertexAngularDistanceToHollowRadius;
4639
4640void main() {
4641  if (vCameraDistanceToObjCenter < hollowRadius) discard; // inside the hollowRadius
4642  if (vVertexAngularDistanceToHollowRadius < 0.0) discard; // frag position is within the hollow radius
4643
4644  vec3 worldCameraToVertex = vVertexWorldPosition - cameraPosition;
4645  vec3 viewCameraToVertex	= (viewMatrix * vec4(worldCameraToVertex, 0.0)).xyz;
4646  viewCameraToVertex = normalize(viewCameraToVertex);
4647  float intensity	= pow(
4648    coefficient + dot(vVertexNormal, viewCameraToVertex),
4649    power
4650  );
4651  gl_FragColor = vec4(color, intensity);
4652}`;function vse(i,e,t,n){return new m0.ShaderMaterial({depthWrite:!1,transparent:!0,vertexShader:gse,fragmentShader:_se,uniforms:{coefficient:{value:i},color:{value:new m0.Color(e)},power:{value:t},hollowRadius:{value:n}}})}function yse(i,e){for(var t=i.clone(),n=new Float32Array(i.attributes.position.count*3),r=0,s=n.length;r<s;r++){var o=i.attributes.normal.array[r],a=i.attributes.position.array[r];n[r]=a+o*e}return t.setAttribute("position",new m0.BufferAttribute(n,3)),t}var xse=function(i){function e(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.color,o=s===void 0?"gold":s,a=r.size,l=a===void 0?2:a,c=r.coefficient,u=c===void 0?.5:c,p=r.power,m=p===void 0?1:p,g=r.hollowRadius,v=g===void 0?0:g,b=r.backside,M=b===void 0?!0:b;Av(this,e),n=pv(this,e);var x=yse(t,l),w=vse(u,o,m,v);return M&&(w.side=m0.BackSide),n.geometry=x,n.material=w,n}return gv(e,i),mv(e)}(m0.Mesh),La=window.THREE?window.THREE:{Color:qt,Group:ks,LineBasicMaterial:$f,LineSegments:_L,Mesh:qn,MeshPhongMaterial:BL,SphereGeometry:sl,SRGBColorSpace:Xt,TextureLoader:JS},RI=wr({props:{globeImageUrl:{},bumpImageUrl:{},showGlobe:{default:!0,onChange:function(e,t){t.globeGroup.visible=!!e},triggerUpdate:!1},showGraticules:{default:!1,onChange:function(e,t){t.graticulesObj.visible=!!e},triggerUpdate:!1},showAtmosphere:{default:!0,onChange:function(e,t){t.atmosphereObj&&(t.atmosphereObj.visible=!!e)},triggerUpdate:!1},atmosphereColor:{default:"lightskyblue"},atmosphereAltitude:{default:.15},globeTileEngineUrl:{onChange:function(e,t){t.tileEngine.tileUrl=e}},globeTileEngineMaxLevel:{default:17,onChange:function(e,t){t.tileEngine.maxLevel=e},triggerUpdate:!1},updatePov:{onChange:function(e,t){t.tileEngine.updatePov(e)},triggerUpdate:!1},onReady:{default:function(){},triggerUpdate:!1}},methods:{globeMaterial:function(e,t){return t!==void 0?(e.globeObj.material=t||e.defaultGlobeMaterial,this):e.globeObj.material},_destructor:function(e){di(e.globeObj),di(e.tileEngine),di(e.graticulesObj)}},stateInit:function(){var e=new La.SphereGeometry(bi,75,75),t=new La.MeshPhongMaterial({color:0}),n=new La.Mesh(e,t);n.rotation.y=-Math.PI/2;var r=new mW(bi),s=new La.Group;
4652s.__globeObjType="globe",s.add(n),s.add(r);var o=new La.LineSegments(new u5(OU(),bi,2),new La.LineBasicMaterial({color:"lightgrey",transparent:!0,opacity:.1}));return{globeGroup:s,globeObj:n,graticulesObj:o,defaultGlobeMaterial:t,tileEngine:r}},init:function(e,t){di(e),t.scene=e,t.scene.add(t.globeGroup),t.scene.add(t.graticulesObj),t.ready=!1},update:function(e,t){var n=e.globeObj.material;if(e.tileEngine.visible=!(e.globeObj.visible=!e.globeTileEngineUrl),t.hasOwnProperty("globeImageUrl")&&(e.globeImageUrl?new La.TextureLoader().load(e.globeImageUrl,function(s){s.colorSpace=La.SRGBColorSpace,n.map=s,n.color=null,n.needsUpdate=!0,!e.ready&&(e.ready=!0)&&setTimeout(e.onReady)}):!n.color&&(n.color=new La.Color(0))),t.hasOwnProperty("bumpImageUrl")&&(e.bumpImageUrl?e.bumpImageUrl&&new La.TextureLoader().load(e.bumpImageUrl,function(s){n.bumpMap=s,n.needsUpdate=!0}):(n.bumpMap=null,n.needsUpdate=!0)),(t.hasOwnProperty("atmosphereColor")||t.hasOwnProperty("atmosphereAltitude"))&&(e.atmosphereObj&&(e.scene.remove(e.atmosphereObj),di(e.atmosphereObj)),e.atmosphereColor&&e.atmosphereAltitude)){var r=e.atmosphereObj=new xse(e.globeObj.geometry,{color:e.atmosphereColor,size:bi*e.atmosphereAltitude,hollowRadius:bi,coefficient:.1,power:3.5});r.visible=!!e.showAtmosphere,r.__globeObjType="atmosphere",e.scene.add(r)}!e.ready&&(!e.globeImageUrl||e.globeTileEngineUrl)&&(e.ready=!0,e.onReady())}}),el=function(e){return isNaN(e)?parseInt(Yt(e).toHex(),16):e},pa=function(e){return e&&isNaN(e)?RP(e).opacity:1},Wc=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r,s=1,o=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.eE+-]+)\s*\)$/.exec(e.trim().toLowerCase());if(o){var a=o.slice(1),l=Ei(a,4),c=l[0],u=l[1],p=l[2],m=l[3];r=new qt("rgb(".concat(+c,",").concat(+u,",").concat(+p,")")),s=Math.min(+m,1)}else r=new qt(e);n&&r.convertLinearToSRGB();var g=r.toArray();return t?[].concat(ai(g),[s]):g};function bse(i,e,t){return i.opacity=e,i.transparent=e<1,i.depthWrite=e>=1,i}var BC=window.THREE?window.THREE:{BufferAttribute:Ii};function tl(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Float32Array;if(e===1)return new BC.BufferAttribute(new t(i),e);for(var n=new BC.BufferAttribute(new t(i.length*e),e),r=0,s=i.length;r<s;r++)n.set(i[r],r*e);return n}function Sse(i){for(var e=i.itemSize,t=[],n=0;n<i.count;n++)t.push(i.array.slice(n*e,(n+1)*e));return t}var Ox=new WeakMap,mg=new WeakMap,gg=new WeakMap,to=function(i){function e(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.dataBindAttr,o=s===void 0?"__data":s,a=r.objBindAttr,l=a===void 0?"__threeObj":a,c=r.removeDelay,u=c===void 0?0:c;return Av(this,e),n=pv(this,e),kr(n,"scene",void 0),Bx(n,Ox,void 0),Bx(n,mg,void 0),Bx(n,gg,void 0),n.scene=t,Fx(Ox,n,o),Fx(mg,n,l),Fx(gg,n,u),n.onRemoveObj(function(){}),n}return gv(e,i),mv(e,[{key:"onCreateObj",value:function(n){var r=this;return Ux(e,"onCreateObj",this)([function(s){var o=n(s);return s[qp(mg,r)]=o,o[qp(Ox,r)]=s,r.scene.add(o),o}]),this}},{key:"onRemoveObj",value:function(n){var r=this;return Ux(e,"onRemoveObj",this)([function(s,o){var a=Ux(e,"getData",r)([s]);n(s,o);var l=function(){r.scene.remove(s),di(s),delete a[qp(mg,r)]};qp(gg,r)?setTimeout(l,qp(gg,r)):l()}]),this}}])}(W$),Zo=window.THREE?window.THREE:{BufferGeometry:vi,CylinderGeometry:B1,Matrix4:un,Mesh:qn,MeshLambertMaterial:Wl,Object3D:ir,Vector3:re},FC=Object.assign({},sM),UC=FC.BufferGeometryUtils||FC,CI=wr({props:{pointsData:{default:[]},pointLat:{default:"lat"},pointLng:{default:"lng"},pointColor:{default:function(){return"#ffffaa"}},pointAltitude:{default:.1},pointRadius:{default:.25},pointResolution:{default:12,triggerUpdate:!1},pointsMerge:{default:!1},pointsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;di(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new to(e,{objBindAttr:"__threeObjPoint"})},update:function(e,t){var n=At(e.pointLat),r=At(e.pointLng),s=At(e.pointAltitude),o=At(e.pointRadius),a=At(e.pointColor),l=new Zo.Cyl
4652inderGeometry(1,1,1,e.pointResolution);l.applyMatrix4(new Zo.Matrix4().makeRotationX(Math.PI/2)),l.applyMatrix4(new Zo.Matrix4().makeTranslation(0,0,-.5));var c=2*Math.PI*bi/360,u={};if(!e.pointsMerge&&t.hasOwnProperty("pointsMerge")&&di(e.scene),e.dataMapper.scene=e.pointsMerge?new Zo.Object3D:e.scene,e.dataMapper.onCreateObj(g).onUpdateObj(v).digest(e.pointsData),e.pointsMerge){var p=e.pointsData.length?(UC.mergeGeometries||UC.mergeBufferGeometries)(e.pointsData.map(function(b){var M=e.dataMapper.getObj(b),x=M.geometry.clone();M.updateMatrix(),x.applyMatrix4(M.matrix);var w=Wc(a(b));return x.setAttribute("color",tl(Array(x.getAttribute("position").count).fill(w),4)),x})):new Zo.BufferGeometry,m=new Zo.Mesh(p,new Zo.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0}));m.__globeObjType="points",m.__data=e.pointsData,e.dataMapper.clear(),di(e.scene),e.scene.add(m)}function g(){var b=new Zo.Mesh(l);return b.__globeObjType="point",b}function v(b,M){var x=function(O){var I=b.__currentTargetD=O,F=I.r,k=I.alt,Y=I.lat,W=I.lng;Object.assign(b.position,Wo(Y,W));var Q=e.pointsMerge?new Zo.Vector3(0,0,0):e.scene.localToWorld(new Zo.Vector3(0,0,0));b.lookAt(Q),b.scale.x=b.scale.y=Math.min(30,F)*c,b.scale.z=Math.max(k*bi,.1)},w={alt:+s(M),r:+o(M),lat:+n(M),lng:+r(M)},R=b.__currentTargetD||Object.assign({},w,{alt:-.001});if(Object.keys(w).some(function(P){return R[P]!==w[P]})&&(e.pointsMerge||!e.pointsTransitionDuration||e.pointsTransitionDuration<0?x(w):e.tweenGroup.add(new us(R).to(w,e.pointsTransitionDuration).easing(fr.Quadratic.InOut).onUpdate(x).start())),!e.pointsMerge){var C=a(M),N=C?pa(C):0,D=!!N;b.visible=D,D&&(u.hasOwnProperty(C)||(u[C]=new Zo.MeshLambertMaterial({color:el(C),transparent:N<1,opacity:N})),b.material=u[C])}}}}),PI=function(){return{uniforms:{dashOffset:{value:0},dashSize:{value:1},gapSize:{value:0},dashTranslate:{value:0}},vertexShader:`
4653    uniform float dashTranslate; 
4654
4655    attribute vec4 color;
4656    varying vec4 vColor;
4657    
4658    attribute float relDistance;
4659    varying float vRelDistance;
4660
4661    void main() {
4662      // pass through colors and distances
4663      vColor = color;
4664      vRelDistance = relDistance + dashTranslate;
4665      gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
4666    }
4667  `,fragmentShader:`
4668    uniform float dashOffset; 
4669    uniform float dashSize;
4670    uniform float gapSize; 
4671    
4672    varying vec4 vColor;
4673    varying float vRelDistance;
4674    
4675    void main() {
4676      // ignore pixels in the gap
4677      if (vRelDistance < dashOffset) discard;
4678      if (mod(vRelDistance - dashOffset, dashSize + gapSize) > dashSize) discard;
4679    
4680      // set px color: [r, g, b, a], interpolated between vertices 
4681      gl_FragColor = vColor; 
4682    }
4683  `}},$b=function(e){return e.uniforms.surfaceRadius={type:"float",value:0},e.vertexShader=(`attribute float surfaceRadius;
4684varying float vSurfaceRadius;
4685varying vec3 vPos;
4686`+e.vertexShader).replace("void main() {",["void main() {","vSurfaceRadius = surfaceRadius;","vPos = position;"].join(`
4687`)),e.fragmentShader=(`uniform float surfaceRadius;
4688varying float vSurfaceRadius;
4689varying vec3 vPos;
4690`+e.fragmentShader).replace("void main() {",["void main() {","if (length(vPos) < max(surfaceRadius, vSurfaceRadius)) discard;"].join(`
4691`)),e},Mse=function(e){return e.vertexShader=`
4692    attribute float r;
4693    
4694    const float PI = 3.1415926535897932384626433832795;
4695    float toRad(in float a) {
4696      return a * PI / 180.0;
4697    }
4698    
4699    vec3 Polar2Cartesian(in vec3 c) { // [lat, lng, r]
4700      float phi = toRad(90.0 - c.x);
4701      float theta = toRad(90.0 - c.y);
4702      float r = c.z;
4703      return vec3( // x,y,z
4704        r * sin(phi) * cos(theta),
4705        r * cos(phi),
4706        r * sin(phi) * sin(theta)
4707      );
4708    }
4709    
4710    vec2 Cartesian2Polar(in vec3 p) {
4711      float r = sqrt(p.x * p.x + p.y * p.y + p.z * p.z);
4712      float phi = acos(p.y / r);
4713      float theta = atan(p.z, p.x);
4714      return vec2( // lat,lng
4715        90.0 - phi * 180.0 / PI,
4716        90.0 - theta * 180.0 / PI - (theta < -PI / 2.0 ? 360.0 : 0.0)
4717      );
4718    }
4719    `.concat(e.vertexShader.replace("}",`                  
4720        vec3 pos = Polar2Cartesian(vec3(Cartesian2Polar(position), r));
4721        gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0
4721);
4722      }
4723    `),`
4724  `),e},Cw=function(e,t){return e.onBeforeCompile=function(n){e.userData.shader=t(n)},e},wse=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(r){return r};if(e.userData.shader)t(e.userData.shader.uniforms);else{var n=e.onBeforeCompile;e.onBeforeCompile=function(r){n(r),t(r.uniforms)}}},Tse=["stroke"],Ko=window.THREE?window.THREE:{BufferGeometry:vi,CubicBezierCurve3:bL,Curve:ya,Group:ks,Line:D1,Mesh:qn,NormalBlending:ws,ShaderMaterial:Xs,TubeGeometry:ZS,Vector3:re},Ese=Ef.default||Ef,LI=wr({props:{arcsData:{default:[]},arcStartLat:{default:"startLat"},arcStartLng:{default:"startLng"},arcEndLat:{default:"endLat"},arcEndLng:{default:"endLng"},arcColor:{default:function(){return"#ffffaa"}},arcAltitude:{},arcAltitudeAutoScale:{default:.5},arcStroke:{},arcCurveResolution:{default:64,triggerUpdate:!1},arcCircularResolution:{default:6,triggerUpdate:!1},arcDashLength:{default:1},arcDashGap:{default:0},arcDashInitialGap:{default:0},arcDashAnimateTime:{default:0},arcsTransitionDuration:{default:1e3,triggerUpdate:!1}},methods:{pauseAnimation:function(e){var t;(t=e.ticker)===null||t===void 0||t.pause()},resumeAnimation:function(e){var t;(t=e.ticker)===null||t===void 0||t.resume()},_destructor:function(e){var t;e.sharedMaterial.dispose(),(t=e.ticker)===null||t===void 0||t.dispose()}},stateInit:function(e){var t=e.tweenGroup;return{tweenGroup:t,ticker:new Ese,sharedMaterial:new Ko.ShaderMaterial(ti(ti({},PI()),{},{transparent:!0,blending:Ko.NormalBlending}))}},init:function(e,t){di(e),t.scene=e,t.dataMapper=new to(e,{objBindAttr:"__threeObjArc"}).onCreateObj(function(){var n=new Ko.Group;return n.__globeObjType="arc",n}),t.ticker.onTick.add(function(n,r){t.dataMapper.entries().map(function(s){var o=Ei(s,2),a=o[1];return a}).filter(function(s){return s.children.length&&s.children[0].material&&s.children[0].__dashAnimateStep}).forEach(function(s){var o=s.children[0],a=o.__dashAnimateStep*r,l=o.material.uniforms.dashTranslate.value%1e9;o.material.uniforms.dashTranslate.value=l+a})})},update:function(e){var t=At(e.arcStartLat),n=At(e.arcStartLng),r=At(e.arcEndLat),s=At(e.arcEndLng),o=At(e.arcAltitude),a=At(e.arcAltitudeAutoScale),l=At(e.arcStroke),c=At(e.arcColor),u=At(e.arcDashLength),p=At(e.arcDashGap),m=At(e.arcDashInitialGap),g=At(e.arcDashAnimateTime);e.dataMapper.onUpdateObj(function(x,w){var R=l(w),C=R!=null;if(!x.children.length||C!==(x.children[0].type==="Mesh")){di(x);var N=C?new Ko.Mesh:new Ko.Line(new Ko.BufferGeometry);N.material=e.sharedMaterial.clone(),x.add(N)}var D=x.children[0];Object.assign(D.material.uniforms,{dashSize:{value:u(w)},gapSize:{value:p(w)},dashOffset:{value:m(w)}});var P=g(w);D.__dashAnimateStep=P>0?1e3/P:0;var O=b(c(w),e.arcCurveResolution,C?e.arcCircularResolution+1:1),I=M(e.arcCurveResolution,C?e.arcCircularResolution+1:1,!0);D.geometry.setAttribute("color",O),D.geometry.setAttribute("relDistance",I);var F=function(Q){var J=x.__currentTargetD=Q,H=J.stroke,$=dse(J,Tse),K=v($);C?(D.geometry&&D.geometry.dispose(),D.geometry=new Ko.TubeGeometry(K,e.arcCurveResolution,H/2,e.arcCircularResolution),D.geometry.setAttribute("color",O),D.geometry.setAttribute("relDistance",I)):D.geometry.setFromPoints(K.getPoints(e.arcCurveResolution))},k={stroke:R,alt:o(w),altAutoScale:+a(w),startLat:+t(w),startLng:+n(w),endLat:+r(w),endLng:+s(w)},Y=x.__currentTargetD||Object.assign({},k,{altAutoScale:-.001});Object.keys(k).some(function(W){return Y[W]!==k[W]})&&(!e.arcsTransitionDuration||e.arcsTransitionDuration<0?F(k):e.tweenGroup.add(new us(Y).to(k,e.arcsTransitionDuration).easing(fr.Quadratic.InOut).onUpdate(F).start()))}).digest(e.arcsData);function v(x){var w=x.alt,R=x.altAutoScale,C=x.startLat,N=x.startLng,D=x.endLat,P=x.endLng,O=function(de){var Ce=Ei(de,3),Fe=Ce[0],ge=Ce[1],Ge=Ce[2],Me=Wo(ge,Fe,Ge),Ye=Me.x,ct=Me.y,Je=Me.z;return new Ko.Vector3(Ye,ct,Je)},I=[N,C],F=[P,D],k=w;if(k==null&&(k=Gc(I,F)/2*R),k){var Y=gS(I,F),W=[.25,.75].map(function(ie){return[].concat(ai(Y(ie)),[k*1.5])}),Q=Ei(W,2),J=Q[0],H=Q[1],$=Tw(Ko.CubicBezierCurve3,ai([I,J,H,F].map(O)));return $}else{var K=.001;return he.apply(void 0,ai([[].concat(I,[K]),[].concat(F,[K])].map(O)))}
4724function he(ie,de){var Ce=ie.angleTo(de),Fe=Ce===0?function(){return ie.clone()}:function(Ge){return new Ko.Vector3().addVectors(ie.clone().multiplyScalar(Math.sin((1-Ge)*Ce)),de.clone().multiplyScalar(Math.sin(Ge*Ce))).divideScalar(Math.sin(Ce))},ge=new Ko.Curve;return ge.getPoint=Fe,ge}}function b(x,w){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=w+1,N;if(x instanceof Array||x instanceof Function){var D=x instanceof Array?Vc().domain(x.map(function(W,Q){return Q/(x.length-1)})).range(x):x;N=function(Q){return Wc(D(Q),!0,!0)}}else{var P=Wc(x,!0,!0);N=function(){return P}}for(var O=[],I=0,F=C;I<F;I++)for(var k=N(I/(F-1)),Y=0;Y<R;Y++)O.push(k);return tl(O,4)}function M(x){for(var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,C=x+1,N=[],D=0,P=C;D<P;D++)for(var O=D/(P-1),I=0;I<w;I++)N.push(O);return R&&N.reverse(),tl(N,1)}}}),uc=window.THREE?window.THREE:{BufferGeometry:vi,DoubleSide:ur,Mesh:qn,MeshLambertMaterial:Wl,Object3D:ir},OC=Object.assign({},sM),kC=OC.BufferGeometryUtils||OC,NI=wr({props:{hexBinPointsData:{default:[]},hexBinPointLat:{default:"lat"},hexBinPointLng:{default:"lng"},hexBinPointWeight:{default:1},hexBinResolution:{default:4},hexMargin:{default:.2},hexTopCurvatureResolution:{default:5},hexTopColor:{default:function(){return"#ffffaa"}},hexSideColor:{default:function(){return"#ffffaa"}},hexAltitude:{default:function(e){var t=e.sumWeight;return t*.01}},hexBinMerge:{default:!1},hexTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;di(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new to(e,{objBindAttr:"__threeObjHexbin"})},update:function(e,t){var n=At(e.hexBinPointLat),r=At(e.hexBinPointLng),s=At(e.hexBinPointWeight),o=At(e.hexAltitude),a=At(e.hexTopColor),l=At(e.hexSideColor),c=At(e.hexMargin),u=fX(e.hexBinPointsData.map(function(w){return ti(ti({},w),{},{h3Idx:XX(n(w),r(w),e.hexBinResolution)})}),"h3Idx"),p=Object.entries(u).map(function(w){var R=Ei(w,2),C=R[0],N=R[1];return{h3Idx:C,points:N,sumWeight:N.reduce(function(D,P){return D+ +s(P)},0)}}),m={};if(!e.hexBinMerge&&t.hasOwnProperty("hexBinMerge")&&di(e.scene),e.dataMapper.scene=e.hexBinMerge?new uc.Object3D:e.scene,e.dataMapper.id(function(w){return w.h3Idx}).onCreateObj(M).onUpdateObj(x).digest(p),e.hexBinMerge){var g=p.length?(kC.mergeGeometries||kC.mergeBufferGeometries)(p.map(function(w){var R=e.dataMapper.getObj(w),C=R.geometry.toNonIndexed();R.updateMatrix(),C.applyMatrix4(R.matrix);var N=Wc(a(w)),D=Wc(l(w)),P=C.getAttribute("position").count,O=C.groups[0].count;return C.setAttribute("color",tl(ai(new Array(P)).map(function(I,F){return F>=O?N:D}),4)),C})):new uc.BufferGeometry,v=new uc.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0,side:uc.DoubleSide});v.onBeforeCompile=function(w){v.userData.shader=$b(w)};var b=new uc.Mesh(g,v);b.__globeObjType="hexBinPoints",b.__data=p,e.dataMapper.clear(),di(e.scene),e.scene.add(b)}function M(w){var R=new uc.Mesh;R.__hexCenter=C5(w.h3Idx),R.__hexGeoJson=P5(w.h3Idx,!0).reverse();var C=R.__hexCenter[1];return R.__hexGeoJson.forEach(function(N){var D=N[0];Math.abs(C-D)>170&&(N[0]+=C>D?360:-360)}),R.__globeObjType="hexbin",R}function x(w,R){var C=function($,K,he){return $-($-K)*he},N=Math.max(0,Math.min(1,+c(R))),D=Ei(w.__hexCenter,2),P=D[0],O=D[1],I=N===0?w.__hexGeoJson:w.__hexGeoJson.map(function(H){var $=Ei(H,2),K=$[0],he=$[1];return[[K,O],[he,P]].map(function(ie){var de=Ei(ie,2),Ce=de[0],Fe=de[1];return C(Ce,Fe,N)})}),F=e.hexTopCurvatureResolution;w.geometry&&w.geometry.dispose(),w.geometry=new uM([I],0,bi,!1,!0,!0,F);var k={alt:+o(R)},Y=function($){var K=w.__currentTargetD=$,he=K.alt;w.scale.x=w.scale.y=w.scale.z=1+he;var ie=bi/(he+1);w.geometry.setAttribute("surfaceRadius",tl(Array(w.geometry.getAttribute("position").count).fill(ie),1))},W=w.__currentTargetD||Object.assign({},k,{alt:-.001});if(Object.keys(k).some(function(H){return W[H]!==k[H]})&&(e.hexBinMerge||!e.hexTransitionDuration||e.hexTransitionDuration<0?Y(k):e.tweenGroup.add(new us(W).to(k,e.hexTransitionDuration).easing(fr.Quadratic.InOut).onUpdate(Y).start())),!e.hexBinMerge){var Q=l(R),J=a(R);[Q,J].forEach(function(H){if(!m.hasOwnProperty(H)){var $=pa(H);m[H]=Cw(new uc.MeshLambertMaterial({color:el(H),transparent:$<1,opacity:$,side:uc.DoubleSide}),$b)}}),w.material=[Q,J].map(function(H){return m[H]})}}}}),DI=function(e){return e*e},Cl=function(e){return e*Math.PI/180};function Rse(i,e){var t=Math.sqrt,n=Math.cos,r=function(u){return DI(Math.sin(u/2))},s=Cl(i[1]),o=Cl(e[1]),a=Cl(i[0]),l=Cl(e[0]);return 2*Math.asin(t(r(o-s)+n(s)*n(o)*r(l-a)))}var Cse=Math.sqrt(2*Math.PI);function Pse(i,e){return Math.exp(-DI(i/e)/2)/(e*Cse)}var Lse=function(e){var t=Ei(e,2),n=t[0],r=t[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=o.lngAccessor,l=a===void 0?function(M){return M[0]}:a,c=o.latAccessor,u=c===void 0?function(M){return M[1]}:c,p=o.weightAccessor,m=p===void 0?function(){return 1}:p,g=o.bandwidth,v=[n,r],b=g*Math.PI/180;return aU(s.map(function(M){var x=m(M);if(!x)return 0;
4724var w=Rse(v,[l(M),u(M)]);return Pse(w,b)*x}))},Nse=function(){var i=sse(Hb().mark(function e(t){var n,r,s,o,a,l,c,u,p,m,g,v,b,M,x,w,R,C,N,D,P,O,I,F,k,Y,W,Q,J,H,$,K,he,ie,de,Ce,Fe,ge,Ge,Me,Ye=arguments;return Hb().wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:if(r=Ye.length>1&&Ye[1]!==void 0?Ye[1]:[],s=Ye.length>2&&Ye[2]!==void 0?Ye[2]:{},o=s.lngAccessor,a=o===void 0?function(Ke){return Ke[0]}:o,l=s.latAccessor,c=l===void 0?function(Ke){return Ke[1]}:l,u=s.weightAccessor,p=u===void 0?function(){return 1}:u,m=s.bandwidth,(n=navigator)!==null&&n!==void 0&&n.gpu){Je.next=5;break}return console.warn("WebGPU not enabled in browser. Please consider enabling it to improve performance."),Je.abrupt("return",t.map(function(Ke){return Lse(Ke,r,{lngAccessor:a,latAccessor:c,weightAccessor:p,bandwidth:m})}));case 5:return g=4,v=Fre,b=Ure,M=Xre,x=jre,w=Gre,R=qre,C=Ore,N=$re,D=Wre,P=zre,O=kre,I=Vre,F=Hre,k=x(new x_(new Float32Array(t.flat().map(Cl)),2),"vec2",t.length),Y=x(new x_(new Float32Array(r.map(function(Ke){return[Cl(a(Ke)),Cl(c(Ke)),p(Ke)]}).flat()),3),"vec3",r.length),W=new x_(t.length,1),Q=x(W,"float",t.length),J=w(Math.PI),H=N(J.mul(2)),$=function(Rt){return Rt.mul(Rt)},K=function(Rt){return $(D(Rt.div(2)))},he=function(Rt,Ue){var Xe=w(Rt[1]),Z=w(Ue[1]),We=w(Rt[0]),Pe=w(Ue[0]);return w(2).mul(O(N(K(Z.sub(Xe)).add(P(Xe).mul(P(Z)).mul(K(Pe.sub(We)))))))},ie=function(Rt,Ue){return I(F($(Rt.div(Ue)).div(2))).div(Ue.mul(H))},de=M(Cl(m)),Ce=M(Cl(m*g)),Fe=M(r.length),ge=v(function(){var Ke=k.element(R),Rt=Q.element(R);Rt.assign(0),C(Fe,function(Ue){var Xe=Ue.i,Z=Y.element(Xe),We=Z.z;b(We,function(){var Pe=he(Z.xy,Ke.xy);b(Pe&&Pe.lessThan(Ce),function(){Rt.addAssign(ie(Pe,de).mul(We))})})})}),Ge=ge().compute(t.length),Me=new yI,Je.next=25,Me.computeAsync(Ge);case 25:return Je.t0=Array,Je.t1=Float32Array,Je.next=29,Me.getArrayBufferAsync(W);case 29:return Je.t2=Je.sent,Je.t3=new Je.t1(Je.t2),Je.abrupt("return",Je.t0.from.call(Je.t0,Je.t3));case 32:case"end":return Je.stop()}},e)}));return function(t){return i.apply(this,arguments)}}(),_g=window.THREE?window.THREE:{Mesh:qn,MeshLambertMaterial:Wl,SphereGeometry:sl},Dse=3.5,Ise=.1,zC=100,Bse=function(e){var t=RP(hO(e));return t.opacity=Math.cbrt(e),t.formatRgb()},II=wr({props:{heatmapsData:{default:[]},heatmapPoints:{default:function(e){return e}},heatmapPointLat:{default:function(e){return e[0]}},heatmapPointLng:{default:function(e){return e[1]}},heatmapPointWeight:{default:1},heatmapBandwidth:{default:2.5},heatmapColorFn:{default:function(){return Bse}},heatmapColorSaturation:{default:1.5},heatmapBaseAltitude:{default:.01},heatmapTopAltitude:{},heatmapsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;di(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new to(e,{objBindAttr:"__threeObjHeatmap"}).onCreateObj(function(){var s=new _g.Mesh(new _g.SphereGeometry(bi),Cw(new _g.MeshLambertMaterial({vertexColors:!0,transparent:!0}),Mse));return s.__globeObjType="heatmap",s})},update:function(e){var t=At(e.heatmapPoints),n=At(e.heatmapPointLat),r=At(e.heatmapPointLng),s=At(e.heatmapPointWeight),o=At(e.heatmapBandwidth),a=At(e.heatmapColorFn),l=At(e.heatmapColorSaturation),c=At(e.heatmapBaseAltitude),u=At(e.heatmapTopAltitude);e.dataMapper.onUpdateObj(function(p,m){var g=o(m),v=a(m),b=l(m),M=c(m),x=u(m),w=t(m).map(function(P){var O=n(P),I=r(P),F=Wo(O,I),k=F.x,Y=F.y,W=F.z;return{x:k,y:Y,z:W,lat:O,lng:I,weight:s(P)}}),R=Math.max(Ise,g/Dse),C=Math.ceil(360/(R||-1));p.geometry.parameters.widthSegments!==C&&(p.geometry.dispose(),p.geometry=new _g.SphereGeometry(bi,C,C/2));var N=Sse(p.geometry.getAttribute("position")),D=N.map(function(P){var O=Ei(P,3),I=O[0],F=O[1],k=O[2],Y=EI({x:I,y:F,z:k}),W=Y.lng,Q=Y.lat;return[W,Q]});Nse(D,w,{latAccessor:function(O){return O.lat},lngAccessor:function(O){return O.lng},weightAccessor:function(O){return O.weight},bandwidth:g}).then(function(P){var O=ai(new Array(zC)).map(function(Y,W){return Wc(v(W/(zC-1)))}),I=function(W){var Q=p.__currentTargetD=W,J=Q.kdeVals,H=Q.topAlt,$=Q.saturation,K=rU(J.map(Math.abs))||1e-15,he=sU([0,K/$],O);p.geometry.setAttribute("color",tl(J.map(function(de){return he(Math.abs(de))}),4));var ie=Vc([0,K],[bi*(1+M),bi*(1+(H||M))]);p.geometry.setAttribute("r",tl(J.map(ie)))},F={kdeVals:P,topAlt:x,saturation:b},k=p.__currentTargetD||Object.assign({},F,{kdeVals:P.map(function(){return 0}),topAlt:x&&M,saturation:.5});k.kdeVals.length!==P.length&&(k.kdeVals=P.slice()),Object.keys(F).some(function(Y){return k[Y]!==F[Y]})&&(!e.heatmapsTransitionDuration||e.heatmapsTransitionDuration<0?I(F):e.tweenGroup.add(new us(k).to(F,e.heatmapsTransitionDuration).easing(fr.Quadratic.InOut).onUpdate(I).start()))})}).digest(e.heatmapsData)}}),hc=window.THREE?window.THREE:{DoubleSide:ur,Group:ks,LineBasicMaterial:$f,LineSegments:_L,Mesh:qn,MeshBasicMaterial:B
4724o},BI=wr({props:{polygonsData:{default:[]},polygonGeoJsonGeometry:{default:"geometry"},polygonSideColor:{default:function(){return"#ffffaa"}},polygonSideMaterial:{},polygonCapColor:{default:function(){return"#ffffaa"}},polygonCapMaterial:{},polygonStrokeColor:{},polygonAltitude:{default:.01},polygonCapCurvatureResolution:{default:5},polygonsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;di(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new to(e,{objBindAttr:"__threeObjPolygon"}).id(function(s){return s.id}).onCreateObj(function(){var s=new hc.Group;return s.__defaultSideMaterial=Cw(new hc.MeshBasicMaterial({side:hc.DoubleSide,depthWrite:!0}),$b),s.__defaultCapMaterial=new hc.MeshBasicMaterial({side:hc.DoubleSide,depthWrite:!0}),s.add(new hc.Mesh(void 0,[s.__defaultSideMaterial,s.__defaultCapMaterial])),s.add(new hc.LineSegments(void 0,new hc.LineBasicMaterial)),s.__globeObjType="polygon",s})},update:function(e){var t=At(e.polygonGeoJsonGeometry),n=At(e.polygonAltitude),r=At(e.polygonCapCurvatureResolution),s=At(e.polygonCapColor),o=At(e.polygonCapMaterial),a=At(e.polygonSideColor),l=At(e.polygonSideMaterial),c=At(e.polygonStrokeColor),u=[];e.polygonsData.forEach(function(p){var m={data:p,capColor:s(p),capMaterial:o(p),sideColor:a(p),sideMaterial:l(p),strokeColor:c(p),altitude:+n(p),capCurvatureResolution:+r(p)},g=t(p),v=p.__id||"".concat(Math.round(Math.random()*1e9));p.__id=v,g.type==="Polygon"?u.push(ti({id:"".concat(v,"_0"),coords:g.coordinates},m)):g.type==="MultiPolygon"?u.push.apply(u,ai(g.coordinates.map(function(b,M){return ti({id:"".concat(v,"_").concat(M),coords:b},m)}))):console.warn("Unsupported GeoJson geometry type: ".concat(g.type,". Skipping geometry..."))}),e.dataMapper.onUpdateObj(function(p,m){var g=m.coords,v=m.capColor,b=m.capMaterial,M=m.sideColor,x=m.sideMaterial,w=m.strokeColor,R=m.altitude,C=m.capCurvatureResolution,N=Ei(p.children,2),D=N[0],P=N[1],O=!!w;P.visible=O;var I=!!(v||b),F=!!(M||x);Fse(D.geometry.parameters||{},{polygonGeoJson:g,curvatureResolution:C,closedTop:I,includeSides:F})||(D.geometry&&D.geometry.dispose(),D.geometry=new uM(g,0,bi,!1,I,F,C)),O&&(!P.geometry.parameters||P.geometry.parameters.geoJson.coordinates!==g||P.geometry.parameters.resolution!==C)&&(P.geometry&&P.geometry.dispose(),P.geometry=new u5({type:"Polygon",coordinates:g},bi,C));var k=F?0:-1,Y=I?F?1:0:-1;if(k>=0&&(D.material[k]=x||p.__defaultSideMaterial),Y>=0&&(D.material[Y]=b||p.__defaultCapMaterial),[[!x&&M,k],[!b&&v,Y]].forEach(function(K){var he=Ei(K,2),ie=he[0],de=he[1];if(!(!ie||de<0)){var Ce=D.material[de],Fe=pa(ie);Ce.color.set(el(ie)),Ce.transparent=Fe<1,Ce.opacity=Fe}}),O){var W=P.material,Q=pa(w);W.color.set(el(w)),W.transparent=Q<1,W.opacity=Q}var J={alt:R},H=function(he){var ie=p.__currentTargetD=he,de=ie.alt;D.scale.x=D.scale.y=D.scale.z=1+de,O&&(P.scale.x=P.scale.y=P.scale.z=1+de+1e-4),wse(p.__defaultSideMaterial,function(Ce){return Ce.surfaceRadius.value=bi/(de+1)})},$=p.__currentTargetD||Object.assign({},J,{alt:-.001});Object.keys(J).some(function(K){return $[K]!==J[K]})&&(!e.polygonsTransitionDuration||e.polygonsTransitionDuration<0||$.alt===J.alt?H(J):e.tweenGroup.add(new us($).to(J,e.polygonsTransitionDuration).easing(fr.Quadratic.InOut).onUpdate(H).start()))}).digest(u)}});function Fse(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){return function(n,r){return n===r}};return Object.entries(e).every(function(n){var r=Ei(n,2),s=r[0],o=r[1];return i.hasOwnProperty(s)&&t(s)(i[s],o)})}var nd=window.THREE?window.THREE:{BufferGeometry:vi,DoubleSide:ur,Mesh:qn,MeshLambertMaterial:Wl,Vector3:re},VC=Object.assign({},sM),GC=VC.BufferGeometryUtils||VC,FI=wr({props:{hexPolygonsData:{default:[]},hexPolygonGeoJsonGeometry:{default:"geometry"},hexPolygonColor:{default:function(){return"#ffffaa"}},hexPolygonAltitude:{default:.001},hexPolygonResolution:{default:3},hexPolygonMargin:{default:.2},hexPolygonUseDots:{default:!1},hexPolygonCurvatureResolution:{default:5},hexPolygonDotResolution:{default:12},hexPolygonsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;di(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new to(e,{objBindAttr:"__threeObjHexPolygon"}).onCreateObj(function(){var s=new nd.Mesh(void 0,new nd.MeshLambertMaterial({side:nd.DoubleSide}));
4724return s.__globeObjType="hexPolygon",s})},update:function(e){var t=At(e.hexPolygonGeoJsonGeometry),n=At(e.hexPolygonColor),r=At(e.hexPolygonAltitude),s=At(e.hexPolygonResolution),o=At(e.hexPolygonMargin),a=At(e.hexPolygonUseDots),l=At(e.hexPolygonCurvatureResolution),c=At(e.hexPolygonDotResolution);e.dataMapper.onUpdateObj(function(u,p){var m=t(p),g=s(p),v=r(p),b=Math.max(0,Math.min(1,+o(p))),M=a(p),x=l(p),w=c(p),R=n(p),C=pa(R);u.material.color.set(el(R)),u.material.transparent=C<1,u.material.opacity=C;var N={alt:v,margin:b,curvatureResolution:x},D={geoJson:m,h3Res:g},P=u.__currentTargetD||Object.assign({},N,{alt:-.001}),O=u.__currentMemD||D;if(Object.keys(N).some(function(Y){return P[Y]!==N[Y]})||Object.keys(D).some(function(Y){return O[Y]!==D[Y]})){u.__currentMemD=D;var I=[];m.type==="Polygon"?uR(m.coordinates,g,!0).forEach(function(Y){return I.push(Y)}):m.type==="MultiPolygon"?m.coordinates.forEach(function(Y){return uR(Y,g,!0).forEach(function(W){return I.push(W)})}):console.warn("Unsupported GeoJson geometry type: ".concat(m.type,". Skipping geometry..."));var F=I.map(function(Y){var W=C5(Y),Q=P5(Y,!0).reverse(),J=W[1];return Q.forEach(function(H){var $=H[0];Math.abs(J-$)>170&&(H[0]+=J>$?360:-360)}),{h3Idx:Y,hexCenter:W,hexGeoJson:Q}}),k=function(W){var Q=u.__currentTargetD=W,J=Q.alt,H=Q.margin,$=Q.curvatureResolution;u.geometry&&u.geometry.dispose(),u.geometry=F.length?(GC.mergeGeometries||GC.mergeBufferGeometries)(F.map(function(K){var he=Ei(K.hexCenter,2),ie=he[0],de=he[1];if(M){var Ce=Wo(ie,de,J),Fe=Wo(K.hexGeoJson[0][1],K.hexGeoJson[0][0],J),ge=.85*(1-H)*new nd.Vector3(Ce.x,Ce.y,Ce.z).distanceTo(new nd.Vector3(Fe.x,Fe.y,Fe.z)),Ge=new I1(ge,w);return Ge.rotateX(Fu(-ie)),Ge.rotateY(Fu(de)),Ge.translate(Ce.x,Ce.y,Ce.z),Ge}else{var Me=function(Je,Ke,Rt){return Je-(Je-Ke)*Rt},Ye=H===0?K.hexGeoJson:K.hexGeoJson.map(function(ct){var Je=Ei(ct,2),Ke=Je[0],Rt=Je[1];return[[Ke,de],[Rt,ie]].map(function(Ue){var Xe=Ei(Ue,2),Z=Xe[0],We=Xe[1];return Me(Z,We,H)})});return new uM([Ye],bi,bi*(1+J),!1,!0,!1,$)}})):new nd.BufferGeometry};!e.hexPolygonsTransitionDuration||e.hexPolygonsTransitionDuration<0?k(N):e.tweenGroup.add(new us(P).to(N,e.hexPolygonsTransitionDuration).easing(fr.Quadratic.InOut).onUpdate(k).start())}}).digest(e.hexPolygonsData)}}),Use=window.THREE?window.THREE:{Vector3:re};function Ose(i,e){var t=function(o,a){var l=o[o.length-1];return[].concat(ai(o),ai(Array(a-o.length).fill(l)))},n=Math.max(i.length,e.length),r=oU.apply(void 0,ai([i,e].map(function(s){return s.map(function(o){var a=o.x,l=o.y,c=o.z;return[a,l,c]})}).map(function(s){return t(s,n)})));return function(s){return s===0?i:s===1?e:r(s).map(function(o){var a=Ei(o,3),l=a[0],c=a[1],u=a[2];return new Use.Vector3(l,c,u)})}}var bu=window.THREE?window.THREE:{BufferGeometry:vi,Color:qt,Group:ks,Line:D1,NormalBlending:ws,ShaderMaterial:Xs,Vector3:re},kse=Ef.default||Ef,UI=wr({props:{pathsData:{default:[]},pathPoints:{default:function(e){return e}},pathPointLat:{default:function(e){return e[0]}},pathPointLng:{default:function(e){return e[1]}},pathPointAlt:{default:.001},pathResolution:{default:2},pathColor:{default:function(){return"#ffffaa"}},pathStroke:{},pathDashLength:{default:1},pathDashGap:{default:0},pathDashInitialGap:{default:0},pathDashAnimateTime:{default:0},pathTransitionDuration:{default:1e3,triggerUpdate:!1},rendererSize:{}},methods:{pauseAnimation:function(e){var t;(t=e.ticker)===null||t===void 0||t.pause()},resumeAnimation:function(e){var t;(t=e.ticker)===null||t===void 0||t.resume()},_destructor:function(e){var t;(t=e.ticker)===null||t===void 0||t.dispose()}},stateInit:function(e){var t=e.tweenGroup;return{tweenGroup:t,ticker:new kse,sharedMaterial:new bu.ShaderMaterial(ti(ti({},PI()),{},{transparent:!0,blending:bu.NormalBlending}))}},init:function(e,t){di(e),t.scene=e,t.dataMapper=new to(e,{objBindAttr:"__threeObjPath"}).onCreateObj(function(){var n=new bu.Group;return n.__globeObjType="path",n}),t.ticker.onTick.add(function(n,r){t.dataMapper.entries().map(function(s){var o=Ei(s,2),a=o[1];return a}).filter(function(s){return s.children.length&&s.children[0].material&&s.children[0].__dashAnimateStep}
4724).forEach(function(s){var o=s.children[0],a=o.__dashAnimateStep*r;if(o.type==="Line"){var l=o.material.uniforms.dashTranslate.value%1e9;o.material.uniforms.dashTranslate.value=l+a}else if(o.type==="Line2"){for(var c=o.material.dashOffset-a,u=o.material.dashSize+o.material.gapSize;c<=-u;)c+=u;o.material.dashOffset=c}})})},update:function(e){var t=At(e.pathPoints),n=At(e.pathPointLat),r=At(e.pathPointLng),s=At(e.pathPointAlt),o=At(e.pathStroke),a=At(e.pathColor),l=At(e.pathDashLength),c=At(e.pathDashGap),u=At(e.pathDashInitialGap),p=At(e.pathDashAnimateTime);e.dataMapper.onUpdateObj(function(M,x){var w=o(x),R=w!=null;if(!M.children.length||R===(M.children[0].type==="Line")){di(M);var C=R?new Kre(new bI,new ww):new bu.Line(new bu.BufferGeometry,e.sharedMaterial.clone());M.add(C)}var N=M.children[0],D=g(t(x),n,r,s,e.pathResolution),P=p(x);if(N.__dashAnimateStep=P>0?1e3/P:0,R){N.material.resolution=e.rendererSize;{var F=l(x),k=c(x),Y=u(x);N.material.dashed=k>0,N.material.dashed?N.material.defines.USE_DASH="":delete N.material.defines.USE_DASH,N.material.dashed&&(N.material.dashScale=1/m(D),N.material.dashSize=F,N.material.gapSize=k,N.material.dashOffset=-Y)}{var W=a(x);if(W instanceof Array){var Q=v(a(x),D.length-1,1,!1);N.geometry.setColors(Q.array),N.material.vertexColors=!0}else{var J=W,H=pa(J);N.material.color=new bu.Color(el(J)),N.material.transparent=H<1,N.material.opacity=H,N.material.vertexColors=!1}}N.material.needsUpdate=!0}else{Object.assign(N.material.uniforms,{dashSize:{value:l(x)},gapSize:{value:c(x)},dashOffset:{value:u(x)}});var O=v(a(x),D.length),I=b(D.length,1,!0);N.geometry.setAttribute("color",O),N.geometry.setAttribute("relDistance",I)}var $=Ose(M.__currentTargetD&&M.__currentTargetD.points||[D[0]],D),K=function(Ce){var Fe=M.__currentTargetD=Ce,ge=Fe.stroke,Ge=Fe.interpolK,Me=M.__currentTargetD.points=$(Ge);if(R){var Ye;N.geometry.setPositions((Ye=[]).concat.apply(Ye,ai(Me.map(function(ct){var Je=ct.x,Ke=ct.y,Rt=ct.z;return[Je,Ke,Rt]})))),N.material.linewidth=ge,N.material.dashed&&N.computeLineDistances()}else N.geometry.setFromPoints(Me),N.geometry.computeBoundingSphere()},he={stroke:w,interpolK:1},ie=Object.assign({},M.__currentTargetD||he,{interpolK:0});Object.keys(he).some(function(de){return ie[de]!==he[de]})&&(!e.pathTransitionDuration||e.pathTransitionDuration<0?K(he):e.tweenGroup.add(new us(ie).to(he,e.pathTransitionDuration).easing(fr.Quadratic.InOut).onUpdate(K).start()))}).digest(e.pathsData);function m(M){var x=0,w;return M.forEach(function(R){w&&(x+=w.distanceTo(R)),w=R}),x}function g(M,x,w,R,C){var N=function(I,F,k){for(var Y=[],W=1;W<=k;W++)Y.push(I+(F-I)*W/(k+1));return Y},D=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,k=[],Y=null;return I.forEach(function(W){if(Y){for(;Math.abs(Y[1]-W[1])>180;)Y[1]+=360*(Y[1]<W[1]?1:-1);var Q=Math.sqrt(Math.pow(W[0]-Y[0],2)+Math.pow(W[1]-Y[1],2));if(Q>F)for(var J=Math.floor(Q/F),H=N(Y[0],W[0],J),$=N(Y[1],W[1],J),K=N(Y[2],W[2],J),he=0,ie=H.length;he<ie;he++)k.push([H[he],$[he],K[he]])}k.push(Y=W)}),k},P=function(I){var F=Ei(I,3),k=F[0],Y=F[1],W=F[2],Q=Wo(k,Y,W),J=Q.x,H=Q.y,$=Q.z;return new bu.Vector3(J,H,$)};return D(M.map(function(O){return[x(O),w(O),R(O)]}),C).map(P)}function v(M,x){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,R=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,C=x+1,N;if(M instanceof Array||M instanceof Function){var D=M instanceof Array?Vc().domain(M.map(function(W,Q){return Q/(M.length-1)})).range(M):M;N=function(Q){return Wc(D(Q),R,!0)}}else{var P=Wc(M,R,!0);N=function(){return P}}for(var O=[],I=0,F=C;I<F;I++)for(var k=N(I/(F-1)),Y=0;Y<w;Y++)O.push(k);return tl(O,R?4:3)}function b(M){for(var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,R=M+1,C=[],N=0,D=R;N<D;N++)for(var P=N/(D-1),O=0;O<x;O++)C.push(P);return w&&C.reverse(),tl(C,1)}}}),vg=window.THREE?window.THREE:{Euler:Es,Mesh:qn,MeshLambertMaterial:Wl,SphereGeometry:sl},OI=wr({props:{tilesData:{default:[]},tileLat:{default:"lat"},tileLng:{default:"lng"},tileAltitude:{default:.01},tileWidth:{default:1},tileHeight:{default:1},tileUseGlobeProjection:{default:!0},tileMaterial:{default:function(){return new vg.MeshLambertMaterial({color:"#ffbb88",opacity:.4,transparent:!0})}},tileCurvatureResolution:{default:5},tilesTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;di(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new to(e,{objBindAttr:"__threeObjTile"}).onCreateObj(function(){var s=new vg.Mesh;
vendor: 4,230 bytes, line 4724
4724return s.__globeObjType="tile",s})},update:function(e){var t=At(e.tileLat),n=At(e.tileLng),r=At(e.tileAltitude),s=At(e.tileWidth),o=At(e.tileHeight),a=At(e.tileUseGlobeProjection),l=At(e.tileMaterial),c=At(e.tileCurvatureResolution);e.dataMapper.onUpdateObj(function(u,p){u.material=l(p);var m=a(p),g=c(p),v=function(w){var R=u.__currentTargetD=w,C=R.lat,N=R.lng,D=R.alt,P=R.width,O=R.height,I=id(N),F=id(-C);u.geometry&&u.geometry.dispose(),u.geometry=new vg.SphereGeometry(bi*(1+D),Math.ceil(P/(g||-1)),Math.ceil(O/(g||-1)),id(90-P/2)+(m?I:0),id(P),id(90-O/2)+(m?F:0),id(O)),m||u.setRotationFromEuler(new vg.Euler(F,I,0,"YXZ"))},b={lat:+t(p),lng:+n(p),alt:+r(p),width:+s(p),height:+o(p)},M=u.__currentTargetD||Object.assign({},b,{width:0,height:0});Object.keys(b).some(function(x){return M[x]!==b[x]})&&(!e.tilesTransitionDuration||e.tilesTransitionDuration<0?v(b):e.tweenGroup.add(new us(M).to(b,e.tilesTransitionDuration).easing(fr.Quadratic.InOut).onUpdate(v).start()))}).digest(e.tilesData)}}),id=function(e){return e*Math.PI/180},Hp=window.THREE?window.THREE:{BufferGeometry:vi,Color:qt,Points:C9,PointsMaterial:jS},kI=wr({props:{particlesData:{default:[]},particlesList:{default:function(e){return e}},particleLat:{default:"lat"},particleLng:{default:"lng"},particleAltitude:{default:.01},particlesSize:{default:.5},particlesSizeAttenuation:{default:!0},particlesColor:{default:function(){return"white"}},particlesTexture:{}},init:function(e,t){di(e),t.scene=e,t.dataMapper=new to(e,{objBindAttr:"__threeObjParticles"}).onCreateObj(function(){var n=new Hp.Points(new Hp.BufferGeometry,new Hp.PointsMaterial);return n.__globeObjType="particles",n}).onUpdateObj(function(n,r){var s=At(t.particlesList),o=At(t.particleLat),a=At(t.particleLng),l=At(t.particleAltitude);n.geometry.setAttribute("position",tl(s(r).map(function(c){return Object.values(Wo(o(c),a(c),l(c)))}),3))})},update:function(e,t){["particlesData","particlesList","particleLat","particleLng","particleAltitude"].some(function(a){return t.hasOwnProperty(a)})&&e.dataMapper.digest(e.particlesData);var n=At(e.particlesColor),r=At(e.particlesSize),s=At(e.particlesSizeAttenuation),o=At(e.particlesTexture);e.dataMapper.entries().forEach(function(a){var l=Ei(a,2),c=l[0],u=l[1];if(u.material.size=r(c),u.material.sizeAttenuation=s(c),e.particlesTexture)u.material.color=new Hp.Color(16777215),u.material.transparent=!1,u.material.alphaTest=.5,u.material.map=o(c);else{var p=n(c),m=pa(p);u.material.color=new Hp.Color(el(p)),u.material.transparent=m<1,u.material.opacity=m,u.material.alphaTest=0}})}}),zse=window.THREE?window.THREE:{BufferGeometry:vi},Vse=function(i){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:32;Av(this,e),t=pv(this,e),t.type="CircleLineGeometry",t.parameters={radius:n,segmentCount:r};for(var s=[],o=0;o<=r;o++){var a=(o/r-.25)*Math.PI*2;s.push({x:Math.cos(a)*n,y:Math.sin(a)*n,z:0})}return t.setFromPoints(s),t}return gv(e,i),mv(e)}(zse.BufferGeometry),rd=window.THREE?window.THREE:{Color:qt,Group:ks,Line:D1,LineBasicMaterial:$f,Vector3:re},Gse=Ef.default||Ef,zI=wr({props:{ringsData:{default:[]},ringLat:{default:"lat"},ringLng:{default:"lng"},ringAltitude:{default:.0015},ringColor:{default:function(){return"#ffffaa"},triggerUpdate:!1},ringResolution:{default:64,triggerUpdate:!1},ringMaxRadius:{default:2,triggerUpdate:!1},ringPropagationSpeed:{default:1,triggerUpdate:!1},ringRepeatPeriod:{default:700,triggerUpdate:!1}},methods:{pauseAnimation:function(e){var t;(t=e.ticker)===null||t===void 0||t.pause()},resumeAnimation:function(e){var t;(t=e.ticker)===null||t===void 0||t.resume()},_destructor:function(e){var t;(t=e.ticker)===null||t===void 0||t.dispose()}},init:function(e,t,n){var r=n.tweenGroup;di(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new to(e,{objBindAttr:"__threeObjRing",removeDelay:3e4}).onCreateObj(function(){var s=new rd.Group;return s.__globeObjType="ring",s}),t.ticker=new Gse,t.ticker.onTick.add(function(s){if(t.ringsData.length){var o=At(t.ringColor),a=At(t.ringAltitude),l=At(t.ringMaxRadius),c=At(t.ringPropagationSpeed),u=At(t.ringRepeatPeriod);t.dataMapper.entries().filter(function(p){var m=Ei(p,2),g=m[1];return g}
4724).forEach(function(p){var m=Ei(p,2),g=m[0],v=m[1];if((v.__nextRingTime||0)<=s){var b=u(g)/1e3;v.__nextRingTime=s+(b<=0?1/0:b);var M=new rd.Line(new Vse(1,t.ringResolution),new rd.LineBasicMaterial),x=o(g),w=x instanceof Array||x instanceof Function,R;w?x instanceof Array?(R=Vc().domain(x.map(function(k,Y){return Y/(x.length-1)})).range(x),M.material.transparent=x.some(function(k){return pa(k)<1})):(R=x,M.material.transparent=!0):(M.material.color=new rd.Color(el(x)),bse(M.material,pa(x)));var C=bi*(1+a(g)),N=l(g),D=N*Math.PI/180,P=c(g),O=P<=0,I=function(Y){var W=Y.t,Q=(O?1-W:W)*D;if(M.scale.x=M.scale.y=C*Math.sin(Q),M.position.z=C*(1-Math.cos(Q)),w){var J=R(W);M.material.color=new rd.Color(el(J)),M.material.transparent&&(M.material.opacity=pa(J))}};if(P===0)I({t:0}),v.add(M);else{var F=Math.abs(N/P)*1e3;t.tweenGroup.add(new us({t:0}).to({t:1},F).onUpdate(I).onStart(function(){return v.add(M)}).onComplete(function(){v.remove(M),Rw(M)}).start())}}})}})},update:function(e){var t=At(e.ringLat),n=At(e.ringLng),r=At(e.ringAltitude),s=e.scene.localToWorld(new rd.Vector3(0,0,0));e.dataMapper.onUpdateObj(function(o,a){var l=t(a),c=n(a),u=r(a);Object.assign(o.position,Wo(l,c,u)),o.lookAt(s)}).digest(e.ringsData)}}),qse={0:{x_min:73,x_max:715,ha:792,o:"m 394 -29 q 153 129 242 -29 q 73 479 73 272 q 152 829 73 687 q 394 989 241 989 q 634 829 545 989 q 715 479 715 684 q 635 129 715 270 q 394 -29 546 -29 m 394 89 q 546 211 489 89 q 598 479 598 322 q 548 748 598 640 q 394 871 491 871 q 241 748 298 871 q 190 479 190 637 q 239 211 190 319 q 394 89 296 89 "},1:{x_min:215.671875,x_max:574,ha:792,o:"m 574 0 l 442 0 l 442 697 l 215 697 l 215 796 q 386 833 330 796 q 475 986 447 875 l 574 986 l 574 0 "},2:{x_min:59,x_max:731,ha:792,o:"m 731 0 l 59 0 q 197 314 59 188 q 457 487 199 315 q 598 691 598 580 q 543 819 598 772 q 411 867 488 867 q 272 811 328 867 q 209 630 209 747 l 81 630 q 182 901 81 805 q 408 986 271 986 q 629 909 536 986 q 731 694 731 826 q 613 449 731 541 q 378 316 495 383 q 201 122 235 234 l 731 122 l 731 0 "},3:{x_min:54,x_max:737,ha:792,o:"m 737 284 q 635 55 737 141 q 399 -25 541 -25 q 156 52 248 -25 q 54 308 54 140 l 185 308 q 245 147 185 202 q 395 96 302 96 q 539 140 484 96 q 602 280 602 190 q 510 429 602 390 q 324 454 451 454 l 324 565 q 487 584 441 565 q 565 719 565 617 q 515 835 565 791 q 395 879 466 879 q 255 824 307 879 q 203 661 203 769 l 78 661 q 166 909 78 822 q 387 992 250 992 q 603 921 513 992 q 701 723 701 844 q 669 607 701 656 q 578 524 637 558 q 696 434 655 499 q 737 284 737 369 "},4:{x_min:48,x_max:742.453125,ha:792,o:"m 742 243 l 602 243 l 602 0 l 476 0 l 476 243 l 48 243 l 48 368 l 476 958 l 602 958 l 602 354 l 742 354 l 742 243 m 476 354 l 476 792 l 162 354 l 476 354 "},5:{x_min:54.171875,x_max:738,ha:792,o:"m 738 314 q 626 60 738 153 q 382 -23 526 -23 q 155 47 248 -23 q 54 256 54 125 l 183 256 q 259 132 204 174 q 382 91 314 91 q 533 149 471 91 q 602 314 602 213 q 538 469 602 411 q 386 528 475 528 q 284 506 332 528 q 197 439 237 484 l 81 439 l 159 958 l 684 958 l 684 840 l 254 840 l 214 579 q 306 627 258 612 q 407 643 354 643 q 636 552 540 643 q 738 314 738 457 "},6:{x_min:53,x_max:739,ha:792,o:"m 739 312 q 633 62 739 162 q 400 -31 534 -31 q 162 78 257 -31 q 53 439 53 206 q 178 859 53 712 q 441 986 284 986 q 643 912 559 986 q 732 713 732 833 l 601 713 q 544 830 594 786 q 426 875 494 875 q 268 793 331 875 q 193 517 193 697 q 301 597 240 570 q 427 624 362 624 q 643 540 552 624 q 739 312 739 451 m 603 298 q 540 461 603 400 q 404 516 484 516 q 268 461 323 516 q 207 300 207 401 q 269 137 207 198 q 405 83 325 83 q 541 137 486 83 q 603 298 603 197 "},7:{x_min:58.71875,x_max:730.953125,ha:792,o:"m 730 839 q 469 448 560 641 q 335 0 378 255 l 192 0 q 328 441 235 252 q 593 830 421 630 l 58 830 l 58 958 l 730 958 l 730 839 "},8:{x_min:55,x_max:736,ha:792,o:"m 571 527 q 694 424 652 491 q 736 280 736 358 q 648 71 736 158 q 395 -26 551 -26 q 142 69 238 -26 q 55 279 55 157 q 96 425 55 359 q 220 527 138 491 q 120 615 153 562 q 88 726 88 668 q 171 904 88 827 q 395 986 261 986 q 618 905 529 986 q 702 727 702 830 q 670 616 702 667 q 571 527 638 565 m 394 565 q 519 610 475 565 q 563 717 563 655 q 521 823 563 781 q 392 872 474 872 q 265 824 312 872 q 224 720 224 783 q 265 613 224 656 q 394 565 312 565 m 395 91 q 545 150 488 91 q 597 280 597 204 q 546 408 597 355 q 395 465 492 465 q 244 408 299 465 q 194 280 194 356 q 244 150 194 203 q 395 91 299 91 "},9:{x_min:53,x_max:739,ha:792,o:"m 739 524 q 619 94 739 241 q 362 -32 516 -32 q 150 47 242 -32 q 59 244 59 126 l 191 244 q 246 129 191 176 q 373 82 301 82 q 526 161 466 82 q 597 440 597 255 q 363 334 501 334 q 130 432 216 334 q 53 650 53 521 q 134 880 53 786 q 383 986 226 986 q 659 841 566 986 q 739 524 739 719 m 388 449 q 535 514 480 449 q 585 658 585 573 q 535 805 585 744 q 388 873 480 873 q 242 809 294 873 q 191 658 191 745 q 239 514 191 572 q 388 449 292 449 "},ο:{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 96 88 192 -25 q 0 368 0 201 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 "},S:{x_min:0,x_max:788,ha:890,o:"m 788 291 q 662 54 788 144 q 397 -26 550 -26 q 116 68 226 -26 q 0 337 0 168 l 131 337 q 200 152 131 220 q 384 85 269 85 q 557 129 479 85 q 650 270 650 183 q 490 429 650 379 q 194 513 341 470 q 33 739 33 584 q 142 964 33 881 q 388 1041 242 1041 q 644 957 543 1041 q 756 716 756 867 l 625 716 q 561 874 625 816 q 395 933 497 933 q 243 891 309 933 q 164 759 164 841 q 325 609 164 656 q 625 526 475 568 q 788 291 788 454 "},"¦":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "}
4724,"/":{x_min:183.25,x_max:608.328125,ha:792,o:"m 608 1041 l 266 -129 l 183 -129 l 520 1041 l 608 1041 "},Τ:{x_min:-.4375,x_max:777.453125,ha:839,o:"m 777 893 l 458 893 l 458 0 l 319 0 l 319 892 l 0 892 l 0 1013 l 777 1013 l 777 893 "},y:{x_min:0,x_max:684.78125,ha:771,o:"m 684 738 l 388 -83 q 311 -216 356 -167 q 173 -279 252 -279 q 97 -266 133 -279 l 97 -149 q 132 -155 109 -151 q 168 -160 155 -160 q 240 -114 213 -160 q 274 -26 248 -98 l 0 738 l 137 737 l 341 139 l 548 737 l 684 738 "},Π:{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 803 1012 l 803 0 "},ΐ:{x_min:-111,x_max:339,ha:361,o:"m 339 800 l 229 800 l 229 925 l 339 925 l 339 800 m -1 800 l -111 800 l -111 925 l -1 925 l -1 800 m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 m 302 1040 l 113 819 l 30 819 l 165 1040 l 302 1040 "},g:{x_min:0,x_max:686,ha:838,o:"m 686 34 q 586 -213 686 -121 q 331 -306 487 -306 q 131 -252 216 -306 q 31 -84 31 -190 l 155 -84 q 228 -174 166 -138 q 345 -207 284 -207 q 514 -109 454 -207 q 564 89 564 -27 q 461 6 521 36 q 335 -23 401 -23 q 88 100 184 -23 q 0 370 0 215 q 87 634 0 522 q 330 758 183 758 q 457 728 398 758 q 564 644 515 699 l 564 737 l 686 737 l 686 34 m 582 367 q 529 560 582 481 q 358 652 468 652 q 189 561 250 652 q 135 369 135 482 q 189 176 135 255 q 361 85 251 85 q 529 176 468 85 q 582 367 582 255 "},"²":{x_min:0,x_max:442,ha:539,o:"m 442 383 l 0 383 q 91 566 0 492 q 260 668 176 617 q 354 798 354 727 q 315 875 354 845 q 227 905 277 905 q 136 869 173 905 q 99 761 99 833 l 14 761 q 82 922 14 864 q 232 974 141 974 q 379 926 316 974 q 442 797 442 878 q 351 635 442 704 q 183 539 321 611 q 92 455 92 491 l 442 455 l 442 383 "},"–":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},Κ:{x_min:0,x_max:819.5625,ha:893,o:"m 819 0 l 650 0 l 294 509 l 139 356 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},ƒ:{x_min:-46.265625,x_max:392,ha:513,o:"m 392 651 l 259 651 l 79 -279 l -46 -278 l 134 651 l 14 651 l 14 751 l 135 751 q 151 948 135 900 q 304 1041 185 1041 q 334 1040 319 1041 q 392 1034 348 1039 l 392 922 q 337 931 360 931 q 271 883 287 931 q 260 793 260 853 l 260 751 l 392 751 l 392 651 "},e:{x_min:0,x_max:714,ha:813,o:"m 714 326 l 140 326 q 200 157 140 227 q 359 87 260 87 q 488 130 431 87 q 561 245 545 174 l 697 245 q 577 48 670 123 q 358 -26 484 -26 q 97 85 195 -26 q 0 363 0 197 q 94 642 0 529 q 358 765 195 765 q 626 627 529 765 q 714 326 714 503 m 576 429 q 507 583 564 522 q 355 650 445 650 q 206 583 266 650 q 140 429 152 522 l 576 429 "},ό:{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 94 91 194 -25 q 0 368 0 202 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 m 576 1040 l 387 819 l 303 819 l 438 1040 l 576 1040 "},J:{x_min:0,x_max:588,ha:699,o:"m 588 279 q 287 -26 588 -26 q 58 73 126 -26 q 0 327 0 158 l 133 327 q 160 172 133 227 q 288 96 198 96 q 426 171 391 96 q 449 336 449 219 l 449 1013 l 588 1013 l 588 279 "},"»":{x_min:-1,x_max:503,ha:601,o:"m 503 302 l 280 136 l 281 256 l 429 373 l 281 486 l 280 608 l 503 440 l 503 302 m 221 302 l 0 136 l 0 255 l 145 372 l 0 486 l -1 608 l 221 440 l 221 302 "},"©":{x_min:-3,x_max:1008,ha:1106,o:"m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 741 394 q 661 246 731 302 q 496 190 591 190 q 294 285 369 190 q 228 497 228 370 q 295 714 228 625 q 499 813 370 813 q 656 762 588 813 q 733 625 724 711 l 634 625 q 589 704 629 673 q 498 735 550 735 q 377 666 421 735 q 334 504 334 597 q 374 340 334 408 q 490 272 415 272 q 589 304 549 272 q 638 394 628 337 l 741 394 "},ώ:{x_min:0,x_max:922,ha:1030,o:"m 687 1040 l 498 819 l 415 819 l 549 1040 l 687 1040 m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 338 0 202 q 45 551 0 444 q 161 737 84 643 l 302 737 q 175 552 219 647 q 124 336 124 446 q 155 179 124 248 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 341 797 257 q 745 555 797 450 q 619 737 705 637 l 760 737 q 874 551 835 640 q 922 339 922 444 "}
4724,"^":{x_min:193.0625,x_max:598.609375,ha:792,o:"m 598 772 l 515 772 l 395 931 l 277 772 l 193 772 l 326 1013 l 462 1013 l 598 772 "},"«":{x_min:0,x_max:507.203125,ha:604,o:"m 506 136 l 284 302 l 284 440 l 506 608 l 507 485 l 360 371 l 506 255 l 506 136 m 222 136 l 0 302 l 0 440 l 222 608 l 221 486 l 73 373 l 222 256 l 222 136 "},D:{x_min:0,x_max:828,ha:935,o:"m 389 1013 q 714 867 593 1013 q 828 521 828 729 q 712 161 828 309 q 382 0 587 0 l 0 0 l 0 1013 l 389 1013 m 376 124 q 607 247 523 124 q 681 510 681 355 q 607 771 681 662 q 376 896 522 896 l 139 896 l 139 124 l 376 124 "},"∙":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},ÿ:{x_min:0,x_max:47,ha:125,o:"m 47 3 q 37 -7 47 -7 q 28 0 30 -7 q 39 -4 32 -4 q 45 3 45 -1 l 37 0 q 28 9 28 0 q 39 19 28 19 l 47 16 l 47 19 l 47 3 m 37 1 q 44 8 44 1 q 37 16 44 16 q 30 8 30 16 q 37 1 30 1 m 26 1 l 23 22 l 14 0 l 3 22 l 3 3 l 0 25 l 13 1 l 22 25 l 26 1 "},w:{x_min:0,x_max:1009.71875,ha:1100,o:"m 1009 738 l 783 0 l 658 0 l 501 567 l 345 0 l 222 0 l 0 738 l 130 738 l 284 174 l 432 737 l 576 738 l 721 173 l 881 737 l 1009 738 "},$:{x_min:0,x_max:700,ha:793,o:"m 664 717 l 542 717 q 490 825 531 785 q 381 872 450 865 l 381 551 q 620 446 540 522 q 700 241 700 370 q 618 45 700 116 q 381 -25 536 -25 l 381 -152 l 307 -152 l 307 -25 q 81 62 162 -25 q 0 297 0 149 l 124 297 q 169 146 124 204 q 307 81 215 89 l 307 441 q 80 536 148 469 q 13 725 13 603 q 96 910 13 839 q 307 982 180 982 l 307 1077 l 381 1077 l 381 982 q 574 917 494 982 q 664 717 664 845 m 307 565 l 307 872 q 187 831 233 872 q 142 724 142 791 q 180 618 142 656 q 307 565 218 580 m 381 76 q 562 237 562 96 q 517 361 562 313 q 381 423 472 409 l 381 76 "},"\\":{x_min:-.015625,x_max:425.0625,ha:522,o:"m 425 -129 l 337 -129 l 0 1041 l 83 1041 l 425 -129 "},µ:{x_min:0,x_max:697.21875,ha:747,o:"m 697 -4 q 629 -14 658 -14 q 498 97 513 -14 q 422 9 470 41 q 313 -23 374 -23 q 207 4 258 -23 q 119 81 156 32 l 119 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 173 124 246 q 308 83 216 83 q 452 178 402 83 q 493 359 493 255 l 493 738 l 617 738 l 617 214 q 623 136 617 160 q 673 92 637 92 q 697 96 684 92 l 697 -4 "},Ι:{x_min:42,x_max:181,ha:297,o:"m 181 0 l 42 0 l 42 1013 l 181 1013 l 181 0 "},Ύ:{x_min:0,x_max:1144.5,ha:1214,o:"m 1144 1012 l 807 416 l 807 0 l 667 0 l 667 416 l 325 1012 l 465 1012 l 736 533 l 1004 1012 l 1144 1012 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"’":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},Ν:{x_min:0,x_max:801,ha:915,o:"m 801 0 l 651 0 l 131 822 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 191 l 670 1013 l 801 1013 l 801 0 "},"-":{x_min:8.71875,x_max:350.390625,ha:478,o:"m 350 317 l 8 317 l 8 428 l 350 428 l 350 317 "},Q:{x_min:0,x_max:968,ha:1072,o:"m 954 5 l 887 -79 l 744 35 q 622 -11 687 2 q 483 -26 556 -26 q 127 130 262 -26 q 0 504 0 279 q 127 880 0 728 q 484 1041 262 1041 q 841 884 708 1041 q 968 507 968 735 q 933 293 968 398 q 832 104 899 188 l 954 5 m 723 191 q 802 330 777 248 q 828 499 828 412 q 744 790 828 673 q 483 922 650 922 q 228 791 322 922 q 142 505 142 673 q 227 221 142 337 q 487 91 323 91 q 632 123 566 91 l 520 215 l 587 301 l 723 191 "},ς:{x_min:1,x_max:676.28125,ha:740,o:"m 676 460 l 551 460 q 498 595 542 546 q 365 651 448 651 q 199 578 263 651 q 136 401 136 505 q 266 178 136 241 q 508 106 387 142 q 640 -50 640 62 q 625 -158 640 -105 q 583 -278 611 -211 l 465 -278 q 498 -182 490 -211 q 515 -80 515 -126 q 381 12 515 -15 q 134 91 197 51 q 1 388 1 179 q 100 651 1 542 q 354 761 199 761 q 587 680 498 761 q 676 460 676 599 "},M:{x_min:0,x_max:954,ha:1067,o:"m 954 0 l 819 0 l 819 869 l 537 0 l 405 0 l 128 866 l 128 0 l 0 0 l 0 1013 l 200 1013 l 472 160 l 757 1013 l 954 1013 l 954 0 "},Ψ:{x_min:0,x_max:1006,ha:1094,o:"m 1006 678 q 914 319 1006 429 q 571 200 814 200 l 571 0 l 433 0 l 433 200 q 92 319 194 200 q 0 678 0 429 l 0 1013 l 139 1013 l 139 679 q 191 417 139 492 q 433 326 255 326 l 433 1013 l 571 1013 l 571 326 l 580 326 q 813 423 747 326 q 868 679 868 502 l 868 1013 l 1006 1013 l 1006 678 "},C:{x_min:0,x_max:886,ha:944,o:"m 886 379 q 760 87 886 201 q 455 -26 634 -26 q 112 136 236 -26 q 0 509 0 283 q 118 882 0 737 q 469 1041 245 1041 q 748 955 630 1041 q 879 708 879 859 l 745 708 q 649 862 724 805 q 473 920 573 920 q 219 791 312 920 q 136 509 136 675 q 217 229 136 344 q 470 99 311 99 q 672 179 591 99 q 753 379 753 259 l 886 379 "},"!":{x_min:0,x_max:138,ha:236,o:"m 138 684 q 116 409 138 629 q 105 244 105 299 l 33 244 q 16 465 33 313 q 0 684 0 616 l 0 1013 l 138 1013 l 138 684 m 138 0 l 0 0 l 0 151 l 138 151 l 138 0 "}
4724,"{":{x_min:0,x_max:480.5625,ha:578,o:"m 480 -286 q 237 -213 303 -286 q 187 -45 187 -159 q 194 48 187 -15 q 201 141 201 112 q 164 264 201 225 q 0 314 118 314 l 0 417 q 164 471 119 417 q 201 605 201 514 q 199 665 201 644 q 193 772 193 769 q 241 941 193 887 q 480 1015 308 1015 l 480 915 q 336 866 375 915 q 306 742 306 828 q 310 662 306 717 q 314 577 314 606 q 288 452 314 500 q 176 365 256 391 q 289 275 257 337 q 314 143 314 226 q 313 84 314 107 q 310 -11 310 -5 q 339 -131 310 -94 q 480 -182 377 -182 l 480 -286 "},X:{x_min:-.015625,x_max:854.15625,ha:940,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 428 637 l 675 1013 l 836 1013 l 504 520 l 854 0 "},"#":{x_min:0,x_max:963.890625,ha:1061,o:"m 963 690 l 927 590 l 719 590 l 655 410 l 876 410 l 840 310 l 618 310 l 508 -3 l 393 -2 l 506 309 l 329 310 l 215 -2 l 102 -3 l 212 310 l 0 310 l 36 410 l 248 409 l 312 590 l 86 590 l 120 690 l 347 690 l 459 1006 l 573 1006 l 462 690 l 640 690 l 751 1006 l 865 1006 l 754 690 l 963 690 m 606 590 l 425 590 l 362 410 l 543 410 l 606 590 "},ι:{x_min:42,x_max:284,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 738 l 167 738 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 "},Ά:{x_min:0,x_max:906.953125,ha:982,o:"m 283 1040 l 88 799 l 5 799 l 145 1040 l 283 1040 m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1012 l 529 1012 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},")":{x_min:0,x_max:318,ha:415,o:"m 318 365 q 257 25 318 191 q 87 -290 197 -141 l 0 -290 q 140 21 93 -128 q 193 360 193 189 q 141 704 193 537 q 0 1024 97 850 l 87 1024 q 257 706 197 871 q 318 365 318 542 "},ε:{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 314 0 265 q 128 390 67 353 q 56 460 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 "},Δ:{x_min:0,x_max:952.78125,ha:1028,o:"m 952 0 l 0 0 l 400 1013 l 551 1013 l 952 0 m 762 124 l 476 867 l 187 124 l 762 124 "},"}":{x_min:0,x_max:481,ha:578,o:"m 481 314 q 318 262 364 314 q 282 136 282 222 q 284 65 282 97 q 293 -58 293 -48 q 241 -217 293 -166 q 0 -286 174 -286 l 0 -182 q 143 -130 105 -182 q 171 -2 171 -93 q 168 81 171 22 q 165 144 165 140 q 188 275 165 229 q 306 365 220 339 q 191 455 224 391 q 165 588 165 505 q 168 681 165 624 q 171 742 171 737 q 141 865 171 827 q 0 915 102 915 l 0 1015 q 243 942 176 1015 q 293 773 293 888 q 287 675 293 741 q 282 590 282 608 q 318 466 282 505 q 481 417 364 417 l 481 314 "},"‰":{x_min:-3,x_max:1672,ha:1821,o:"m 846 0 q 664 76 732 0 q 603 244 603 145 q 662 412 603 344 q 846 489 729 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 846 0 962 0 m 845 103 q 945 143 910 103 q 981 243 981 184 q 947 340 981 301 q 845 385 910 385 q 745 342 782 385 q 709 243 709 300 q 742 147 709 186 q 845 103 781 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 m 1428 0 q 1246 76 1314 0 q 1185 244 1185 145 q 1244 412 1185 344 q 1428 489 1311 489 q 1610 412 1542 489 q 1672 244 1672 343 q 1612 76 1672 144 q 1428 0 1545 0 m 1427 103 q 1528 143 1492 103 q 1564 243 1564 184 q 1530 340 1564 301 q 1427 385 1492 385 q 1327 342 1364 385 q 1291 243 1291 300 q 1324 147 1291 186 q 1427 103 1363 103 "},a:{x_min:0,x_max:698.609375,ha:794,o:"m 698 0 q 661 -12 679 -7 q 615 -17 643 -17 q 536 12 564 -17 q 500 96 508 41 q 384 6 456 37 q 236 -25 312 -25 q 65 31 130 -25 q 0 194 0 88 q 118 390 0 334 q 328 435 180 420 q 488 483 476 451 q 495 523 495 504 q 442 619 495 584 q 325 654 389 654 q 209 617 257 654 q 152 513 161 580 l 33 513 q 123 705 33 633 q 332 772 207 772 q 528 712 448 772 q 617 531 617 645 l 617 163 q 624 108 617 126 q 664 90 632 90 l 698 94 l 698 0 m 491 262 l 491 372 q 272 329 350 347 q 128 201 128 294 q 166 113 128 144 q 264 83 205 83 q 414 130 346 83 q 491 262 491 183 "},"—":{x_min:0,x_max:941.671875,ha:1039,o:"m 941 334 l 0 334 l 0 410 l 941 410 l 941 334 "},"=":{x_min:8.71875,x_max:780.953125,ha:792,o:"m 780 510 l 8 510 l 8 606 l 780 606 l 780 510 m 780 235 l 8 235 l 8 332 l 780 332 l 780 235 "},N:{x_min:0,x_max:801,ha:914,o:"m 801 0 l 651 0 l 131 823 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 193 l 670 1013 l 801 1013 l 801 0 "},ρ:{x_min:0,x_max:712,ha:797,o:"m 712 369 q 620 94 712 207 q 362 -26 521 -26 q 230 2 292 -26 q 119 83 167 30 l 119 -278 l 0 -278 l 0 362 q 91 643 0 531 q 355 764 190 764 q 617 647 517 764 q 712 369 712 536 m 583 366 q 530 559 583 480 q 359 651 469 651 q 190 562 252 651 q 135 370 135 483 q 189 176 135 257 q 359 85 250 85 q 528 175 466 85 q 583 366 583 254 "},"¯":{x_min:0,x_max:941.671875,ha:938,o:"m 941 1033 l 0 1033 l 0 1109 l 941 1109 l 941 1033 "},Z:{x_min:0,x_max:779,ha:849,o:"m 779 0 l 0 0 l 0 113 l 621 896 l 40 896 l 40 1013 l 779 1013 l 778 887 l 171 124 l 779 124 l 779 0 "},u:{x_min:0,x_max:617,ha:729,o:"m 617 0 l 499 0 l 499 110 q 391 10 460 45 q 246 -25 322 -25 q 61 58 127 -25 q 0 258 0 136 l 0 738 l 125 738 l 125 284 q 156 148 125 202 q 273 82 197 82 q 433 165 369 82 q 493 340 493 243 l 493 738 l 617 738 l 617 0 "},k:{x_min:0,x_max:612.484375,ha:697,o:"m 612 738 l 338 465 l 608 0 l 469 0 l 251 382 l 121 251 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 402 l 456 738 l 612 738 "},Η:{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 
47241013 l 803 0 "},Α:{x_min:0,x_max:906.953125,ha:985,o:"m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},s:{x_min:0,x_max:604,ha:697,o:"m 604 217 q 501 36 604 104 q 292 -23 411 -23 q 86 43 166 -23 q 0 238 0 114 l 121 237 q 175 122 121 164 q 300 85 223 85 q 415 112 363 85 q 479 207 479 147 q 361 309 479 276 q 140 372 141 370 q 21 544 21 426 q 111 708 21 647 q 298 761 190 761 q 492 705 413 761 q 583 531 583 643 l 462 531 q 412 625 462 594 q 298 657 363 657 q 199 636 242 657 q 143 558 143 608 q 262 454 143 486 q 484 394 479 397 q 604 217 604 341 "},B:{x_min:0,x_max:778,ha:876,o:"m 580 546 q 724 469 670 535 q 778 311 778 403 q 673 83 778 171 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 892 q 691 633 732 693 q 580 546 650 572 m 393 899 l 139 899 l 139 588 l 379 588 q 521 624 462 588 q 592 744 592 667 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 303 635 219 q 559 436 635 389 q 402 477 494 477 l 139 477 l 139 124 l 419 124 "},"…":{x_min:0,x_max:614,ha:708,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 m 378 0 l 236 0 l 236 151 l 378 151 l 378 0 m 614 0 l 472 0 l 472 151 l 614 151 l 614 0 "},"?":{x_min:0,x_max:607,ha:704,o:"m 607 777 q 543 599 607 674 q 422 474 482 537 q 357 272 357 391 l 236 272 q 297 487 236 395 q 411 619 298 490 q 474 762 474 691 q 422 885 474 838 q 301 933 371 933 q 179 880 228 933 q 124 706 124 819 l 0 706 q 94 963 0 872 q 302 1044 177 1044 q 511 973 423 1044 q 607 777 607 895 m 370 0 l 230 0 l 230 151 l 370 151 l 370 0 "},H:{x_min:0,x_max:803,ha:915,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},ν:{x_min:0,x_max:675,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 738 l 340 147 l 541 738 l 675 738 "},c:{x_min:1,x_max:701.390625,ha:775,o:"m 701 264 q 584 53 681 133 q 353 -26 487 -26 q 91 91 188 -26 q 1 370 1 201 q 92 645 1 537 q 353 761 190 761 q 572 688 479 761 q 690 493 666 615 l 556 493 q 487 606 545 562 q 356 650 428 650 q 186 563 246 650 q 134 372 134 487 q 188 179 134 258 q 359 88 250 88 q 492 136 437 88 q 566 264 548 185 l 701 264 "},"¶":{x_min:0,x_max:566.671875,ha:678,o:"m 21 892 l 52 892 l 98 761 l 145 892 l 176 892 l 178 741 l 157 741 l 157 867 l 108 741 l 88 741 l 40 871 l 40 741 l 21 741 l 21 892 m 308 854 l 308 731 q 252 691 308 691 q 227 691 240 691 q 207 696 213 695 l 207 712 l 253 706 q 288 733 288 706 l 288 763 q 244 741 279 741 q 193 797 193 741 q 261 860 193 860 q 287 860 273 860 q 308 854 302 855 m 288 842 l 263 843 q 213 796 213 843 q 248 756 213 756 q 288 796 288 756 l 288 842 m 566 988 l 502 988 l 502 -1 l 439 -1 l 439 988 l 317 988 l 317 -1 l 252 -1 l 252 602 q 81 653 155 602 q 0 805 0 711 q 101 989 0 918 q 309 1053 194 1053 l 566 1053 l 566 988 "},β:{x_min:0,x_max:660,ha:745,o:"m 471 550 q 610 450 561 522 q 660 280 660 378 q 578 64 660 151 q 367 -22 497 -22 q 239 5 299 -22 q 126 82 178 32 l 126 -278 l 0 -278 l 0 593 q 54 903 0 801 q 318 1042 127 1042 q 519 964 436 1042 q 603 771 603 887 q 567 644 
4724603 701 q 471 550 532 586 m 337 79 q 476 138 418 79 q 535 279 535 198 q 427 437 535 386 q 226 477 344 477 l 226 583 q 398 620 329 583 q 486 762 486 668 q 435 884 486 833 q 312 935 384 935 q 169 861 219 935 q 126 698 126 797 l 126 362 q 170 169 126 242 q 337 79 224 79 "},Μ:{x_min:0,x_max:954,ha:1068,o:"m 954 0 l 819 0 l 819 868 l 537 0 l 405 0 l 128 865 l 128 0 l 0 0 l 0 1013 l 199 1013 l 472 158 l 758 1013 l 954 1013 l 954 0 "},Ό:{x_min:.109375,x_max:1120,ha:1217,o:"m 1120 505 q 994 132 1120 282 q 642 -29 861 -29 q 290 130 422 -29 q 167 505 167 280 q 294 883 167 730 q 650 1046 430 1046 q 999 882 868 1046 q 1120 505 1120 730 m 977 504 q 896 784 977 669 q 644 915 804 915 q 391 785 484 915 q 307 504 307 669 q 391 224 307 339 q 644 95 486 95 q 894 224 803 95 q 977 504 977 339 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},Ή:{x_min:0,x_max:1158,ha:1275,o:"m 1158 0 l 1022 0 l 1022 475 l 496 475 l 496 0 l 356 0 l 356 1012 l 496 1012 l 496 599 l 1022 599 l 1022 1012 l 1158 1012 l 1158 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"•":{x_min:0,x_max:663.890625,ha:775,o:"m 663 529 q 566 293 663 391 q 331 196 469 196 q 97 294 194 196 q 0 529 0 393 q 96 763 0 665 q 331 861 193 861 q 566 763 469 861 q 663 529 663 665 "},"¥":{x_min:.1875,x_max:819.546875,ha:886,o:"m 563 561 l 697 561 l 696 487 l 520 487 l 482 416 l 482 380 l 697 380 l 695 308 l 482 308 l 482 0 l 342 0 l 342 308 l 125 308 l 125 380 l 342 380 l 342 417 l 303 487 l 125 487 l 125 561 l 258 561 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 l 563 561 "},"(":{x_min:0,x_max:318.0625,ha:415,o:"m 318 -290 l 230 -290 q 61 23 122 -142 q 0 365 0 190 q 62 712 0 540 q 230 1024 119 869 l 318 1024 q 175 705 219 853 q 125 360 125 542 q 176 22 125 187 q 318 -290 223 -127 "},U:{x_min:0,x_max:796,ha:904,o:"m 796 393 q 681 93 796 212 q 386 -25 566 -25 q 101 95 208 -25 q 0 393 0 211 l 0 1013 l 138 1013 l 138 391 q 204 191 138 270 q 394 107 276 107 q 586 191 512 107 q 656 391 656 270 l 656 1013 l 796 1013 l 796 393 "},γ:{x_min:.5,x_max:744.953125,ha:822,o:"m 744 737 l 463 54 l 463 -278 l 338 -278 l 338 54 l 154 495 q 104 597 124 569 q 13 651 67 651 l 0 651 l 0 751 l 39 753 q 168 711 121 753 q 242 594 207 676 l 403 208 l 617 737 l 744 737 "},α:{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 728 407 760 q 563 637 524 696 l 563 739 l 685 739 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 96 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 "},F:{x_min:0,x_max:683.328125,ha:717,o:"m 683 888 l 140 888 l 140 583 l 613 583 l 613 458 l 140 458 l 140 0 l 0 0 l 0 1013 l 683 1013 l 683 888 "},"­":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},":":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},Χ:{x_min:0,x_max:854.171875,ha:935,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 427 637 l 675 1013 l 836 1013 l 504 521 l 854 0 "},"*":{x_min:116,x_max:674,ha:792,o:"m 674 768 l 475 713 l 610 544 l 517 477 l 394 652 l 272 478 l 178 544 l 314 713 l 116 766 l 153 876 l 341 812 l 342 1013 l 446 1013 l 446 811 l 635 874 l 674 768 "},"†":{x_min:0,x_max:777,ha:835,o:"m 458 804 l 777 804 l 777 683 l 458 683 l 458 0 l 319 0 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 "},"°":{x_min:0,x_max:347,ha:444,o:"m 173 802 q 43 856 91 802 q 0 977 0 905 q 45 1101 0 1049 q 173 1153 90 1153 q 303 1098 255 1153 q 347 977 347 1049 q 303 856 347 905 q 173 802 256 802 m 173 884 q 238 910 214 884 q 262 973 262 937 q 239 1038 262 1012 q 173 1064 217 1064 q 108 1037 132 1064 q 85 973 85 1010 q 108 910 85 937 q 173 884 132 884 "},V:{x_min:0,x_max:862.71875,ha:940,o:"m 862 1013 l 505 0 l 361 0 l 0 1013 l 143 1013 l 434 165 l 718 1012 l 862 1013 "},Ξ:{x_min:0,x_max:734.71875,ha:763,o:"m 723 889 l 9 889 l 9 1013 l 723 1013 l 723 889 m 673 463 l 61 463 l 61 589 l 673 589 l 673 463 m 734 0 l 0 0 l 0 124 l 734 124 l 734 0 "}," ":{x_min:0,x_max:0,ha:853},Ϋ:{x_min:.328125,x_max:819.515625,ha:889,o:"m 588 1046 l 460 1046 l 460 1189 l 588 1189 l 588 1046 m 360 1046 l 232 1046 l 232 1189 l 360 1189 l 360 1046 m 819 1012 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1012 l 140 1012 l 411 533 l 679 1012 l 819 1012 "},"”":{x_min:0,x_max:347,ha:454,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 m 347 851 q 310 737 347 784 q 208 669 273 690 l 208 734 q 267 787 250 741 q 280 873 280 821 l 208 873 l 208 1013 l 347 1013 l 347 851 "},"@":{x_min:0,x_max:1260,ha:1357,o:"m 1098 -45 q 877 -160 1001 -117 q 633 -203 752 -203 q 155 -29 327 -203 q 0 360 0 127 q 176 802 0 616 q 687 1008 372 1008 q 1123 854 969 1008 q 1260 517 1260 718 q 1155 216 1260 341 q 868 82 1044 82 q 772 106 801 82 q 737 202 737 135 q 647 113 700 144 q 527 82 594 82 q 367 147 420 82 q 314 312 314 212 q 401 565 314 452 q 639 690 498 690 q 810 588 760 690 l 849 668 l 938 668 q 877 441 900 532 q 833 226 833 268 q 853 182 833 198 q 902 167 873 167 q 1088 272 1012 167 q 1159 512 1159 372 q 1051 793 1159 681 q 687 925 925 925 q 248 747 415 925 q 97 361 97 586 q 226 26 97 159 q 627 -122 370 -122 q 856 -87 737 -122 q 1061 8 976 -53 l 1098 -45 m 786 488 q 738 580 777 545 q 643 615 700 615 q 483 517 548 615 q 425 322 425 430 q 457 203 425 250 q 552 156 490 156 q 722 273 665 156 q 786 488 738 309 "},Ί:{x_min:0,x_max:499,ha:613,o:"m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 m 499 0 l 360 0 l 360 1012 l 499 1012 l 499 0 "},i:{x_min:14,x_max:136,ha:275,o:"m 136 873 l 14 873 l 14 1013 l 136 1013 l 136 873 m 136 0 l 14 0 l 14 737 l 136 737 l 136 0 "},Β:{x_min:0,x_max:778,ha:877,o:"m 580 545 q 724 468 671 534 q 778 310 778 402 q 673 83 778 170 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 891 q 691 632 732 692 q 580 545 650 571 m 393 899 l 139 899 l 139 587 l 379 587 q 521 623 462 587 q 592 744 592 666 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 302 635 219 q 559 435 635 388 q 402 476 494 476 l 139 476 l 139 124 l 419 124 "},υ:{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 94 617 199 q 308 -24 455 -24 q 76 94 161 -24 q 0 352 0 199 l 0 739 l 126 739 l 126 355 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 355 492 257 l 492 739 l 617 739 l 617 352 "}
4724,"]":{x_min:0,x_max:275,ha:372,o:"m 275 -281 l 0 -281 l 0 -187 l 151 -187 l 151 920 l 0 920 l 0 1013 l 275 1013 l 275 -281 "},m:{x_min:0,x_max:1019,ha:1128,o:"m 1019 0 l 897 0 l 897 454 q 860 591 897 536 q 739 660 816 660 q 613 586 659 660 q 573 436 573 522 l 573 0 l 447 0 l 447 455 q 412 591 447 535 q 294 657 372 657 q 165 586 213 657 q 122 437 122 521 l 122 0 l 0 0 l 0 738 l 117 738 l 117 640 q 202 730 150 697 q 316 763 254 763 q 437 730 381 763 q 525 642 494 697 q 621 731 559 700 q 753 763 682 763 q 943 694 867 763 q 1019 512 1019 625 l 1019 0 "},χ:{x_min:8.328125,x_max:780.5625,ha:815,o:"m 780 -278 q 715 -294 747 -294 q 616 -257 663 -294 q 548 -175 576 -227 l 379 133 l 143 -277 l 9 -277 l 313 254 l 163 522 q 127 586 131 580 q 36 640 91 640 q 8 637 27 640 l 8 752 l 52 757 q 162 719 113 757 q 236 627 200 690 l 383 372 l 594 737 l 726 737 l 448 250 l 625 -69 q 670 -153 647 -110 q 743 -188 695 -188 q 780 -184 759 -188 l 780 -278 "},ί:{x_min:42,x_max:326.71875,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 102 239 101 q 284 112 257 104 l 284 3 m 326 1040 l 137 819 l 54 819 l 189 1040 l 326 1040 "},Ζ:{x_min:0,x_max:779.171875,ha:850,o:"m 779 0 l 0 0 l 0 113 l 620 896 l 40 896 l 40 1013 l 779 1013 l 779 887 l 170 124 l 779 124 l 779 0 "},R:{x_min:0,x_max:781.953125,ha:907,o:"m 781 0 l 623 0 q 587 242 590 52 q 407 433 585 433 l 138 433 l 138 0 l 0 0 l 0 1013 l 396 1013 q 636 946 539 1013 q 749 731 749 868 q 711 597 749 659 q 608 502 674 534 q 718 370 696 474 q 729 207 722 352 q 781 26 736 62 l 781 0 m 373 551 q 533 594 465 551 q 614 731 614 645 q 532 859 614 815 q 373 896 465 896 l 138 896 l 138 551 l 373 551 "},o:{x_min:0,x_max:713,ha:821,o:"m 357 -25 q 94 91 194 -25 q 0 368 0 202 q 93 642 0 533 q 357 761 193 761 q 618 644 518 761 q 713 368 713 533 q 619 91 713 201 q 357 -25 521 -25 m 357 85 q 528 175 465 85 q 584 369 584 255 q 529 562 584 484 q 357 651 467 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 357 85 250 85 "},K:{x_min:0,x_max:819.46875,ha:906,o:"m 819 0 l 649 0 l 294 509 l 139 355 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},",":{x_min:0,x_max:142,ha:239,o:"m 142 -12 q 105 -132 142 -82 q 0 -205 68 -182 l 0 -138 q 57 -82 40 -124 q 70 0 70 -51 l 0 0 l 0 151 l 142 151 l 142 -12 "},d:{x_min:0,x_max:683,ha:796,o:"m 683 0 l 564 0 l 564 93 q 456 6 516 38 q 327 -25 395 -25 q 87 100 181 -25 q 0 365 0 215 q 90 639 0 525 q 343 763 187 763 q 564 647 486 763 l 564 1013 l 683 1013 l 683 0 m 582 373 q 529 562 582 484 q 361 653 468 653 q 190 561 253 653 q 135 365 135 479 q 189 175 135 254 q 358 85 251 85 q 529 178 468 85 q 582 373 582 258 "},"¨":{x_min:-109,x_max:247,ha:232,o:"m 247 1046 l 119 1046 l 119 1189 l 247 1189 l 247 1046 m 19 1046 l -109 1046 l -109 1189 l 19 1189 l 19 1046 "},E:{x_min:0,x_max:736.109375,ha:789,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},Y:{x_min:0,x_max:820,ha:886,o:"m 820 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 534 l 679 1012 l 820 1013 "},'"':{x_min:0,x_max:299,ha:396,o:"m 299 606 l 203 606 l 203 988 l 299 988 l 299 606 m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"‹":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"„":{x_min:0,x_max:364,ha:467,o:"m 141 -12 q 104 -132 141 -82 q 0 -205 67 -182 l 0 -138 q 56 -82 40 -124 q 69 0 69 -51 l 0 0 l 0 151 l 141 151 l 141 -12 m 364 -12 q 327 -132 364 -82 q 222 -205 290 -182 l 222 -138 q 279 -82 262 -124 q 292 0 292 -51 l 222 0 l 222 151 l 364 151 l 364 -12 "},δ:{x_min:1,x_max:710,ha:810,o:"m 710 360 q 616 87 710 196 q 356 -28 518 -28 q 99 82 197 -28 q 1 356 1 192 q 100 606 1 509 q 355 703 199 703 q 180 829 288 754 q 70 903 124 866 l 70 1012 l 643 1012 l 643 901 l 258 901 q 462 763 422 794 q 636 592 577 677 q 710 360 710 485 m 584 365 q 552 501 584 447 q 451 602 521 555 q 372 611 411 611 q 197 541 258 611 q 136 355 136 472 q 190 171 136 245 q 358 85 252 85 q 528 173 465 85 q 584 365 584 252 "},έ:{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 313 0 265 q 128 390 67 352 q 56 459 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 43
47246 117 379 76 q 509 234 493 159 l 634 234 m 520 1040 l 331 819 l 248 819 l 383 1040 l 520 1040 "},ω:{x_min:0,x_max:922,ha:1031,o:"m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 339 0 203 q 45 551 0 444 q 161 738 84 643 l 302 738 q 175 553 219 647 q 124 336 124 446 q 155 179 124 249 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 342 797 257 q 745 556 797 450 q 619 738 705 638 l 760 738 q 874 551 835 640 q 922 339 922 444 "},"´":{x_min:0,x_max:96,ha:251,o:"m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"±":{x_min:11,x_max:781,ha:792,o:"m 781 490 l 446 490 l 446 255 l 349 255 l 349 490 l 11 490 l 11 586 l 349 586 l 349 819 l 446 819 l 446 586 l 781 586 l 781 490 m 781 21 l 11 21 l 11 115 l 781 115 l 781 21 "},"|":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},ϋ:{x_min:0,x_max:617,ha:725,o:"m 482 800 l 372 800 l 372 925 l 482 925 l 482 800 m 239 800 l 129 800 l 129 925 l 239 925 l 239 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 "},"§":{x_min:0,x_max:593,ha:690,o:"m 593 425 q 554 312 593 369 q 467 233 516 254 q 537 83 537 172 q 459 -74 537 -12 q 288 -133 387 -133 q 115 -69 184 -133 q 47 96 47 -6 l 166 96 q 199 7 166 40 q 288 -26 232 -26 q 371 -5 332 -26 q 420 60 420 21 q 311 201 420 139 q 108 309 210 255 q 0 490 0 383 q 33 602 0 551 q 124 687 66 654 q 75 743 93 712 q 58 812 58 773 q 133 984 58 920 q 300 1043 201 1043 q 458 987 394 1043 q 529 814 529 925 l 411 814 q 370 908 404 877 q 289 939 336 939 q 213 911 246 939 q 180 841 180 883 q 286 720 180 779 q 484 612 480 615 q 593 425 593 534 m 467 409 q 355 544 467 473 q 196 630 228 612 q 146 587 162 609 q 124 525 124 558 q 239 387 124 462 q 398 298 369 315 q 448 345 429 316 q 467 409 467 375 "},b:{x_min:0,x_max:685,ha:783,o:"m 685 372 q 597 99 685 213 q 347 -25 501 -25 q 219 5 277 -25 q 121 93 161 36 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 634 q 214 723 157 692 q 341 754 272 754 q 591 637 493 754 q 685 372 685 526 m 554 356 q 499 550 554 470 q 328 644 437 644 q 162 556 223 644 q 108 369 108 478 q 160 176 108 256 q 330 83 221 83 q 498 169 435 83 q 554 356 554 245 "},q:{x_min:0,x_max:683,ha:876,o:"m 683 -278 l 564 -278 l 564 97 q 474 8 533 39 q 345 -23 415 -23 q 91 93 188 -23 q 0 364 0 203 q 87 635 0 522 q 337 760 184 760 q 466 727 408 760 q 564 637 523 695 l 564 737 l 683 737 l 683 -278 m 582 375 q 527 564 582 488 q 358 652 466 652 q 190 565 253 652 q 135 377 135 488 q 189 179 135 261 q 361 84 251 84 q 530 179 469 84 q 582 375 582 260 "},Ω:{x_min:-.171875,x_max:969.5625,ha:1068,o:"m 969 0 l 555 0 l 555 123 q 744 308 675 194 q 814 558 814 423 q 726 812 814 709 q 484 922 633 922 q 244 820 334 922 q 154 567 154 719 q 223 316 154 433 q 412 123 292 199 l 412 0 l 0 0 l 0 124 l 217 124 q 68 327 122 210 q 15 572 15 444 q 144 911 15 781 q 484 1041 274 1041 q 822 909 691 1041 q 953 569 953 777 q 899 326 953 443 q 750 124 846 210 l 969 124 l 969 0 "},ύ:{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 535 1040 l 346 819 l 262 819 l 397 1040 l 535 1040 "},z:{x_min:-.015625,x_max:613.890625,ha:697,o:"m 613 0 l 0 0 l 0 100 l 433 630 l 20 630 l 20 738 l 594 738 l 593 636 l 163 110 l 613 110 l 613 0 "},"™":{x_min:0,x_max:894,ha:1e3,o:"m 389 951 l 229 951 l 229 503 l 160 503 l 160 951 l 0 951 l 0 1011 l 389 1011 l 389 951 m 894 503 l 827 503 l 827 939 l 685 503 l 620 503 l 481 937 l 481 503 l 417 503 l 417 1011 l 517 1011 l 653 580 l 796 1010 l 894 1011 l 894 503 "},ή:{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 721 124 755 q 200 630 193 687 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 m 479 1040 l 290 819 l 207 819 l 341 1040 l 479 1040 "},Θ:{x_min:0,x_max:960,ha:1056,o:"m 960 507 q 833 129 960 280 q 476 -32 698 -32 q 123 129 255 -32 q 0 507 0 28
47240 q 123 883 0 732 q 476 1045 255 1045 q 832 883 696 1045 q 960 507 960 732 m 817 500 q 733 789 817 669 q 476 924 639 924 q 223 792 317 924 q 142 507 142 675 q 222 222 142 339 q 476 89 315 89 q 730 218 636 89 q 817 500 817 334 m 716 449 l 243 449 l 243 571 l 716 571 l 716 449 "},"®":{x_min:-3,x_max:1008,ha:1106,o:"m 503 532 q 614 562 566 532 q 672 658 672 598 q 614 747 672 716 q 503 772 569 772 l 338 772 l 338 532 l 503 532 m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 788 146 l 678 146 q 653 316 655 183 q 527 449 652 449 l 338 449 l 338 146 l 241 146 l 241 854 l 518 854 q 688 808 621 854 q 766 658 766 755 q 739 563 766 607 q 668 497 713 519 q 751 331 747 472 q 788 164 756 190 l 788 146 "},"~":{x_min:0,x_max:833,ha:931,o:"m 833 958 q 778 753 833 831 q 594 665 716 665 q 402 761 502 665 q 240 857 302 857 q 131 795 166 857 q 104 665 104 745 l 0 665 q 54 867 0 789 q 237 958 116 958 q 429 861 331 958 q 594 765 527 765 q 704 827 670 765 q 729 958 729 874 l 833 958 "},Ε:{x_min:0,x_max:736.21875,ha:778,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},"³":{x_min:0,x_max:450,ha:547,o:"m 450 552 q 379 413 450 464 q 220 366 313 366 q 69 414 130 366 q 0 567 0 470 l 85 567 q 126 470 85 504 q 225 437 168 437 q 320 467 280 437 q 360 552 360 498 q 318 632 360 608 q 213 657 276 657 q 195 657 203 657 q 176 657 181 657 l 176 722 q 279 733 249 722 q 334 815 334 752 q 300 881 334 856 q 220 907 267 907 q 133 875 169 907 q 97 781 97 844 l 15 781 q 78 926 15 875 q 220 972 135 972 q 364 930 303 972 q 426 817 426 888 q 344 697 426 733 q 421 642 392 681 q 450 552 450 603 "},"[":{x_min:0,x_max:273.609375,ha:371,o:"m 273 -281 l 0 -281 l 0 1013 l 273 1013 l 273 920 l 124 920 l 124 -187 l 273 -187 l 273 -281 "},L:{x_min:0,x_max:645.828125,ha:696,o:"m 645 0 l 0 0 l 0 1013 l 140 1013 l 140 126 l 645 126 l 645 0 "},σ:{x_min:0,x_max:803.390625,ha:894,o:"m 803 628 l 633 628 q 713 368 713 512 q 618 93 713 204 q 357 -25 518 -25 q 94 91 194 -25 q 0 368 0 201 q 94 644 0 533 q 356 761 194 761 q 481 750 398 761 q 608 739 564 739 l 803 739 l 803 628 m 360 85 q 529 180 467 85 q 584 374 584 262 q 527 566 584 490 q 352 651 463 651 q 187 559 247 651 q 135 368 135 478 q 189 175 135 254 q 360 85 251 85 "},ζ:{x_min:0,x_max:573,ha:642,o:"m 573 -40 q 553 -162 573 -97 q 510 -278 543 -193 l 400 -278 q 441 -187 428 -219 q 462 -90 462 -132 q 378 -14 462 -14 q 108 45 197 -14 q 0 290 0 117 q 108 631 0 462 q 353 901 194 767 l 55 901 l 55 1012 l 561 1012 l 561 924 q 261 669 382 831 q 128 301 128 489 q 243 117 128 149 q 458 98 350 108 q 573 -40 573 80 "},θ:{x_min:0,x_max:674,ha:778,o:"m 674 496 q 601 160 674 304 q 336 -26 508 -26 q 73 153 165 -26 q 0 485 0 296 q 72 840 0 683 q 343 1045 166 1045 q 605 844 516 1045 q 674 496 674 692 m 546 579 q 498 798 546 691 q 336 935 437 935 q 178 798 237 935 q 126 579 137 701 l 546 579 m 546 475 l 126 475 q 170 233 126 348 q 338 80 230 80 q 504 233 447 80 q 546 475 546 346 "},Ο:{x_min:0,x_max:958,ha:1054,o:"m 485 1042 q 834 883 703 1042 q 958 511 958 735 q 834 136 958 287 q 481 -26 701 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 729 q 485 1042 263 1042 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 670 q 480 913 640 913 q 226 785 321 913 q 142 504 142 671 q 226 224 142 339 q 480 98 319 98 "},Γ:{x_min:0,x_max:705.28125,ha:749,o:"m 705 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 705 1012 l 705 886 "}," ":{x_min:0,x_max:0,ha:375},"%":{x_min:-3,x_max:1089,ha:1186,o:"m 845 0 q 663 76 731 0 q 602 244 602 145 q 661 412 602 344 q 845 489 728 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 845 0 962 0 m 844 103 q 945 143 909 103 q 981 243 981 184 q 947 340 981 301 q 844 385 909 385 q 744 342 781 385 q 708 243 708 300 q 741 147 708 186 q 844 103 780 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 8
472410 382 771 q 241 855 308 855 "},P:{x_min:0,x_max:726,ha:806,o:"m 424 1013 q 640 931 555 1013 q 726 719 726 850 q 637 506 726 587 q 413 426 548 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 379 889 l 140 889 l 140 548 l 372 548 q 522 589 459 548 q 593 720 593 637 q 528 845 593 801 q 379 889 463 889 "},Έ:{x_min:0,x_max:1078.21875,ha:1118,o:"m 1078 0 l 342 0 l 342 1013 l 1067 1013 l 1067 889 l 481 889 l 481 585 l 1019 585 l 1019 467 l 481 467 l 481 125 l 1078 125 l 1078 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},Ώ:{x_min:.125,x_max:1136.546875,ha:1235,o:"m 1136 0 l 722 0 l 722 123 q 911 309 842 194 q 981 558 981 423 q 893 813 981 710 q 651 923 800 923 q 411 821 501 923 q 321 568 321 720 q 390 316 321 433 q 579 123 459 200 l 579 0 l 166 0 l 166 124 l 384 124 q 235 327 289 210 q 182 572 182 444 q 311 912 182 782 q 651 1042 441 1042 q 989 910 858 1042 q 1120 569 1120 778 q 1066 326 1120 443 q 917 124 1013 210 l 1136 124 l 1136 0 m 277 1040 l 83 800 l 0 800 l 140 1041 l 277 1040 "},_:{x_min:0,x_max:705.5625,ha:803,o:"m 705 -334 l 0 -334 l 0 -234 l 705 -234 l 705 -334 "},Ϊ:{x_min:-110,x_max:246,ha:275,o:"m 246 1046 l 118 1046 l 118 1189 l 246 1189 l 246 1046 m 18 1046 l -110 1046 l -110 1189 l 18 1189 l 18 1046 m 136 0 l 0 0 l 0 1012 l 136 1012 l 136 0 "},"+":{x_min:23,x_max:768,ha:792,o:"m 768 372 l 444 372 l 444 0 l 347 0 l 347 372 l 23 372 l 23 468 l 347 468 l 347 840 l 444 840 l 444 468 l 768 468 l 768 372 "},"½":{x_min:0,x_max:1050,ha:1149,o:"m 1050 0 l 625 0 q 712 178 625 108 q 878 277 722 187 q 967 385 967 328 q 932 456 967 429 q 850 484 897 484 q 759 450 798 484 q 721 352 721 416 l 640 352 q 706 502 640 448 q 851 551 766 551 q 987 509 931 551 q 1050 385 1050 462 q 976 251 1050 301 q 829 179 902 215 q 717 68 740 133 l 1050 68 l 1050 0 m 834 985 l 215 -28 l 130 -28 l 750 984 l 834 985 m 224 422 l 142 422 l 142 811 l 0 811 l 0 867 q 104 889 62 867 q 164 973 157 916 l 224 973 l 224 422 "},Ρ:{x_min:0,x_max:720,ha:783,o:"m 424 1013 q 637 933 554 1013 q 720 723 720 853 q 633 508 720 591 q 413 426 546 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 378 889 l 140 889 l 140 548 l 371 548 q 521 589 458 548 q 592 720 592 637 q 527 845 592 801 q 378 889 463 889 "},"'":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},ª:{x_min:0,x_max:350,ha:397,o:"m 350 625 q 307 616 328 616 q 266 631 281 616 q 247 673 251 645 q 190 628 225 644 q 116 613 156 613 q 32 641 64 613 q 0 722 0 669 q 72 826 0 800 q 247 866 159 846 l 247 887 q 220 934 247 916 q 162 953 194 953 q 104 934 129 953 q 76 882 80 915 l 16 882 q 60 976 16 941 q 166 1011 104 1011 q 266 979 224 1011 q 308 891 308 948 l 308 706 q 311 679 308 688 q 331 670 315 670 l 350 672 l 350 625 m 247 757 l 247 811 q 136 790 175 798 q 64 726 64 773 q 83 682 64 697 q 132 667 103 667 q 207 690 174 667 q 247 757 247 718 "},"΅":{x_min:0,x_max:450,ha:553,o:"m 450 800 l 340 800 l 340 925 l 450 925 l 450 800 m 406 1040 l 212 800 l 129 800 l 269 1040 l 406 1040 m 110 800 l 0 800 l 0 925 l 110 925 l 110 800 "},T:{x_min:0,x_max:777,ha:835,o:"m 777 894 l 458 894 l 458 0 l 319 0 l 319 894 l 0 894 l 0 1013 l 777 1013 l 777 894 "},Φ:{x_min:0,x_max:915,ha:997,o:"m 527 0 l 389 0 l 389 122 q 110 231 220 122 q 0 509 0 340 q 110 785 0 677 q 389 893 220 893 l 389 1013 l 527 1013 l 527 893 q 804 786 693 893 q 915 509 915 679 q 805 231 915 341 q 527 122 696 122 l 527 0 m 527 226 q 712 310 641 226 q 779 507 779 389 q 712 705 779 627 q 527 787 641 787 l 527 226 m 389 226 l 389 787 q 205 698 275 775 q 136 505 136 620 q 206 308 136 391 q 389 226 276 226 "},"⁋":{x_min:0,x_max:0,ha:694},j:{x_min:-77.78125,x_max:167,ha:349,o:"m 167 871 l 42 871 l 42 1013 l 167 1013 l 167 871 m 167 -80 q 121 -231 167 -184 q -26 -278 76 -278 l -77 -278 l -77 -164 l -41 -164 q 26 -143 11 -164 q 42 -65 42 -122 l 42 737 l 167 737 l 167 -80 "},Σ:{x_min:0,x_max:756.953125,ha:819,o:"m 756 0 l 0 0 l 0 107 l 395 523 l 22 904 l 22 1013 l 745 1013 l 745 889 l 209 889 l 566 523 l 187 125 l 756 125 l 756 0 "},"›":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},"<":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"£":{x_min:0,x_max:704.484375,ha:801,o:"m 704 41 q 623 -10 664 5 q 543 -26 583 -26 q 359 15 501 -26 q 243 36 288 36 q 158 23 197 36 q 73 -21 119 10 l 6 76 q 125 195 90 150 q 175 331 175 262 q 147 443 175 383 l 0 443 l 0 512 l 108 512 q 43 734 43 623 q 120 929 43 854 q 358 1010 204 1010 q 579 936 487 1010 q 678 729 678 857 l 678 684 l 552 684 q 504 838 552 780 q 362 896 457 896 q 216 852 263 896 q 176 747 176 815 q 199 627 176 697 q 248 512 217 574 l 468 512 l 468 443 l 279 443 q 297 356 297 398 q 230 194 297 279 q 153 107 211 170 q 227 133 190 125 q 293 142 264 142 q 410 119 339 142 q 516 96 482 96 q 579 105 550 96 q 648 142 608 115 l 704 41 "},t:{x_min:0,x_max:367,ha:458,o:"m 367 0 q 312 -5 339 -2 q 262 -8 284 -8 q 145 28 183 -8 q 108 143 108 64 l 108 638 l 0 638 l 0 738 l 108 738 l 108 944 l 232 944 l 232 738 l 367 738 l 367 638 l 232 638 l 232 185 q 248 121 232 140 q 307 102 264 102 q 345 104 330 102 q 367 107 360 107 l 367 0 "},"¬":{x_min:0,x_max:706,ha:803,o:"m 706 411 l 706 158 l 630 158 l 630 335 l 0 335 l 0 411 l 706 411 "},λ:{x_min:0,x_max:750,ha:803,o:"m 750 -7 q 679 -15 716 -15 q 538 59 591 -15 q 466 214 512 97 l 336 551 l 126 0 l 0 0 l 270 705 q 223 837 247 770 q 116 899 190 899 q 90 898 100 899 l 90 1004 q 152 1011 125 1011 q 298 938 244 1011 q 373 783 326 901 l 605 192 q 649 115 629 136 q 716 95 669 95 l 736 95 q 750 97 745 97 l 750 -7 "},W:{x_min:0,x_max:1263.890625,ha:1351,o:"m 1263 1013 l 995 0 l 859 0 l 627 837 l 405 0 l 265 0 l 0 1013 l 136 1013 l 342 202 l 556 1013 l 701 1013 l 921 207 l 1133 1012 l 1263 1013 "},">":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},v:{x_min:0,x_max:675.15625,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 737 l 340 147 l 541 737 l 675 738 "},τ:{x_min:.28125,x_max:644.5,ha:703,o:"m 644 628 l 382 628 l 382 179 q 388 120 382 137 q 43
47246 91 401 91 q 474 94 447 91 q 504 97 501 97 l 504 0 q 454 -9 482 -5 q 401 -14 426 -14 q 278 67 308 -14 q 260 233 260 118 l 260 628 l 0 628 l 0 739 l 644 739 l 644 628 "},ξ:{x_min:0,x_max:624.9375,ha:699,o:"m 624 -37 q 608 -153 624 -96 q 563 -278 593 -211 l 454 -278 q 491 -183 486 -200 q 511 -83 511 -126 q 484 -23 511 -44 q 370 1 452 1 q 323 0 354 1 q 283 -1 293 -1 q 84 76 169 -1 q 0 266 0 154 q 56 431 0 358 q 197 538 108 498 q 94 613 134 562 q 54 730 54 665 q 77 823 54 780 q 143 901 101 867 l 27 901 l 27 1012 l 576 1012 l 576 901 l 380 901 q 244 863 303 901 q 178 745 178 820 q 312 600 178 636 q 532 582 380 582 l 532 479 q 276 455 361 479 q 118 281 118 410 q 165 173 118 217 q 274 120 208 133 q 494 101 384 110 q 624 -37 624 76 "},"&":{x_min:-3,x_max:894.25,ha:992,o:"m 894 0 l 725 0 l 624 123 q 471 0 553 40 q 306 -41 390 -41 q 168 -7 231 -41 q 62 92 105 26 q 14 187 31 139 q -3 276 -3 235 q 55 433 -3 358 q 248 581 114 508 q 170 689 196 640 q 137 817 137 751 q 214 985 137 922 q 384 1041 284 1041 q 548 988 483 1041 q 622 824 622 928 q 563 666 622 739 q 431 556 516 608 l 621 326 q 649 407 639 361 q 663 493 653 426 l 781 493 q 703 229 781 352 l 894 0 m 504 818 q 468 908 504 877 q 384 940 433 940 q 293 907 331 940 q 255 818 255 875 q 289 714 255 767 q 363 628 313 678 q 477 729 446 682 q 504 818 504 771 m 556 209 l 314 499 q 179 395 223 449 q 135 283 135 341 q 146 222 135 253 q 183 158 158 192 q 333 80 241 80 q 556 209 448 80 "},Λ:{x_min:0,x_max:862.5,ha:942,o:"m 862 0 l 719 0 l 426 847 l 143 0 l 0 0 l 356 1013 l 501 1013 l 862 0 "},I:{x_min:41,x_max:180,ha:293,o:"m 180 0 l 41 0 l 41 1013 l 180 1013 l 180 0 "},G:{x_min:0,x_max:921,ha:1011,o:"m 921 0 l 832 0 l 801 136 q 655 15 741 58 q 470 -28 568 -28 q 126 133 259 -28 q 0 499 0 284 q 125 881 0 731 q 486 1043 259 1043 q 763 957 647 1043 q 905 709 890 864 l 772 709 q 668 866 747 807 q 486 926 589 926 q 228 795 322 926 q 142 507 142 677 q 228 224 142 342 q 483 94 323 94 q 712 195 625 94 q 796 435 796 291 l 477 435 l 477 549 l 921 549 l 921 0 "},ΰ:{x_min:0,x_max:617,ha:725,o:"m 524 800 l 414 800 l 414 925 l 524 925 l 524 800 m 183 800 l 73 800 l 73 925 l 183 925 l 183 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 489 1040 l 300 819 l 216 819 l 351 1040 l 489 1040 "},"`":{x_min:0,x_max:138.890625,ha:236,o:"m 138 699 l 0 699 l 0 861 q 36 974 0 929 q 138 1041 72 1020 l 138 977 q 82 931 95 969 q 69 839 69 893 l 138 839 l 138 699 "},"·":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},Υ:{x_min:.328125,x_max:819.515625,ha:889,o:"m 819 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 "},r:{x_min:0,x_max:355.5625,ha:432,o:"m 355 621 l 343 621 q 179 569 236 621 q 122 411 122 518 l 122 0 l 0 0 l 0 737 l 117 737 l 117 604 q 204 719 146 686 q 355 753 262 753 l 355 621 "},x:{x_min:0,x_max:675,ha:764,o:"m 675 0 l 525 0 l 331 286 l 144 0 l 0 0 l 256 379 l 12 738 l 157 737 l 336 473 l 516 738 l 661 738 l 412 380 l 675 0 "},μ:{x_min:0,x_max:696.609375,ha:747,o:"m 696 -4 q 628 -14 657 -14 q 498 97 513 -14 q 422 8 470 41 q 313 -24 374 -24 q 207 3 258 -24 q 120 80 157 31 l 120 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 172 124 246 q 308 82 216 82 q 451 177 402 82 q 492 358 492 254 l 492 738 l 616 738 l 616 214 q 623 136 616 160 q 673 92 636 92 q 696 95 684 92 l 696 -4 "},h:{x_min:0,x_max:615,ha:724,o:"m 615 472 l 615 0 l 490 0 l 490 454 q 456 590 490 535 q 338 654 416 654 q 186 588 251 654 q 122 436 122 522 l 122 0 l 0 0 l 0 1013 l 122 1013 l 122 633 q 218 727 149 694 q 362 760 287 760 q 552 676 484 760 q 615 472 615 600 "},".":{x_min:0,x_max:142,ha:239,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},φ:{x_min:-2,x_max:878,ha:974,o:"m 496 -279 l 378 -279 l 378 -17 q 101 88 204 -17 q -2 367 -2 194 q 68 626 -2 510 q 283 758 151 758 l 283 646 q 167 537 209 626 q 133 373 133 462 q 192 177 133 254 q 378 93 259 93 l 378 758 q 445 764 426 763 q 476 765 464 765 q 765 659 653 765 q 878 377 878 553 q 771 96 878 209 q 496 -17 665 -17 l 496 -279 m 496 93 l 514 93 q 687 183 623 93 q 746 380 746 265 q 691 569 746 491 q 522 658 629 658 l 496 656 l 496 93 "},";":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 -12 q 105 -132 142 -82 q 0 -206 68 -182 l 0 -138 q 58 -82 43 -123 q 68 0 68 -56 l 0 0 l 0 151 l 142 151 l 142 -12 "},f:{x_min:0,x_max:378,ha:472,o:"m 378 638 l 246 638 l 246 0 l 121 0 l 121 638 l 0 638 l 0 738 l 121 738 q 137 935 121 887 q 290 1028 171 1028 q 320 1027 305 1028 q 378 1021 334 1026 l 378 908 q 323 918 346 918 q 257 870 273 918 q 246 780 246 840 l 246 738 l 378 738 l 378 638 "},"“":{x_min:1,x_max:348.21875,ha:454,o:"m 140 670 l 1 670 l 1 830 q 37 943 1 897 q 140 1011 74 990 l 140 947 q 82 900 97 940 q 68 810 68 861 l 140 810 l 140 670 m 348 670 l 209 670 l 209 830 q 245 943 209 897 q 348 1011 282 990 l 348 947 q 290 900 305 940 q 276 810 276 861 l 348 810 l 348 670 "},A:{x_min:.03125,x_max:906.953125,ha:1008,o:"m 906 0 l 756 0 l 648 303 l 251 303 l 142 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 610 421 l 452 867 l 293 421 l 610 421 "},"‘":{x_min:1,x_max:139.890625,ha:236,o:"m 139 670 l 1 670 l 1 830 q 37 943 1 897 q 139 1011 74 990 l 139 947 q 82 900 97 940 q 68 810 68 861 l 139 810 l 139 670 "},ϊ:{x_min:-70,x_max:283,ha:361,o:"m 283 800 l 173 800 l 173 925 l 283 925 l 283 800 m 40 800 l -70 800 l -70 925 l 40 925 l 40 800 m 283 3 q 232 -10 257 
4724-5 q 181 -15 206 -15 q 84 26 118 -15 q 41 200 41 79 l 41 737 l 166 737 l 167 215 q 171 141 167 157 q 225 101 182 101 q 247 103 238 101 q 283 112 256 104 l 283 3 "},π:{x_min:-.21875,x_max:773.21875,ha:857,o:"m 773 -7 l 707 -11 q 575 40 607 -11 q 552 174 552 77 l 552 226 l 552 626 l 222 626 l 222 0 l 97 0 l 97 626 l 0 626 l 0 737 l 773 737 l 773 626 l 676 626 l 676 171 q 695 103 676 117 q 773 90 714 90 l 773 -7 "},ά:{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 727 407 760 q 563 637 524 695 l 563 738 l 685 738 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 95 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 m 604 1040 l 415 819 l 332 819 l 466 1040 l 604 1040 "},O:{x_min:0,x_max:958,ha:1057,o:"m 485 1041 q 834 882 702 1041 q 958 512 958 734 q 834 136 958 287 q 481 -26 702 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 728 q 485 1041 263 1041 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 669 q 480 912 640 912 q 226 784 321 912 q 142 504 142 670 q 226 224 142 339 q 480 98 319 98 "},n:{x_min:0,x_max:615,ha:724,o:"m 615 463 l 615 0 l 490 0 l 490 454 q 453 592 490 537 q 331 656 410 656 q 178 585 240 656 q 117 421 117 514 l 117 0 l 0 0 l 0 738 l 117 738 l 117 630 q 218 728 150 693 q 359 764 286 764 q 552 675 484 764 q 615 463 615 593 "},l:{x_min:41,x_max:166,ha:279,o:"m 166 0 l 41 0 l 41 1013 l 166 1013 l 166 0 "}
4724,"¤":{x_min:40.09375,x_max:728.796875,ha:825,o:"m 728 304 l 649 224 l 512 363 q 383 331 458 331 q 256 363 310 331 l 119 224 l 40 304 l 177 441 q 150 553 150 493 q 184 673 150 621 l 40 818 l 119 898 l 267 749 q 321 766 291 759 q 384 773 351 773 q 447 766 417 773 q 501 749 477 759 l 649 898 l 728 818 l 585 675 q 612 618 604 648 q 621 553 621 587 q 591 441 621 491 l 728 304 m 384 682 q 280 643 318 682 q 243 551 243 604 q 279 461 243 499 q 383 423 316 423 q 487 461 449 423 q 525 553 525 500 q 490 641 525 605 q 384 682 451 682 "},κ:{x_min:0,x_max:632.328125,ha:679,o:"m 632 0 l 482 0 l 225 384 l 124 288 l 124 0 l 0 0 l 0 738 l 124 738 l 124 446 l 433 738 l 596 738 l 312 466 l 632 0 "},p:{x_min:0,x_max:685,ha:786,o:"m 685 364 q 598 96 685 205 q 350 -23 504 -23 q 121 89 205 -23 l 121 -278 l 0 -278 l 0 738 l 121 738 l 121 633 q 220 726 159 691 q 351 761 280 761 q 598 636 504 761 q 685 364 685 522 m 557 371 q 501 560 557 481 q 330 651 437 651 q 162 559 223 651 q 108 366 108 479 q 162 177 108 254 q 333 87 224 87 q 502 178 441 87 q 557 371 557 258 "},"‡":{x_min:0,x_max:777,ha:835,o:"m 458 238 l 458 0 l 319 0 l 319 238 l 0 238 l 0 360 l 319 360 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 l 777 804 l 777 683 l 458 683 l 458 360 l 777 360 l 777 238 l 458 238 "},ψ:{x_min:0,x_max:808,ha:907,o:"m 465 -278 l 341 -278 l 341 -15 q 87 102 180 -15 q 0 378 0 210 l 0 739 l 133 739 l 133 379 q 182 195 133 275 q 341 98 242 98 l 341 922 l 465 922 l 465 98 q 623 195 563 98 q 675 382 675 278 l 675 742 l 808 742 l 808 381 q 720 104 808 213 q 466 -13 627 -13 l 465 -278 "},η:{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 720 124 755 q 200 630 193 686 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 "}},Hse="normal",Wse=1189,$se=-100,jse="normal",Xse={yMin:-334,xMin:-111,yMax:1189,xMax:1672},Yse=1e3,Qse={postscript_name:"Helvetiker-Regular",version_string:"Version 1.00 2004 initial release",vendor_url:"http://www.magenta.gr/",full_font_name:"Helvetiker",font_family_name:"Helvetiker",copyright:"Copyright (c) Μagenta ltd, 2004",description:"",trademark:"",designer:"",designer_url:"",unique_font_identifier:"Μagenta ltd:Helvetiker:22-10-104",license_url:"http://www.ellak.gr/fonts/MgOpen/license.html",license_description:`Copyright (c) 2004 by MAGENTA Ltd. All Rights Reserved.\r
4725\r
4726Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: \r
4727\r
4728The above copyright and this permission notice shall be included in all copies of one or more of the Font Software typefaces.\r
4729\r
4730The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing the word "MgOpen", or if the modifications are accepted for inclusion in the Font Software itself by the each appointed Administrator.\r
4731\r
4732This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "MgOpen" name.\r
4733\r
4734The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. \r
4735\r
4736THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL MAGENTA OR PERSONS OR BODIES IN CHARGE OF ADMINISTRATION AND MAINTENANCE OF THE FONT SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.`,manufacturer_name:"Μagenta ltd",font_sub_family_name:"Regular"},Zse=-334,Kse="Helvetiker",Jse=1522,eoe=50,toe={glyphs:qse,cssFontWeight:Hse,ascender:Wse,underlinePosition:$se,cssFontStyle:jse,boundingBox:Xse,resolution:Yse,original_font_information:Qse,descender:Zse,familyName:Kse,lineHeight:Jse,underlineThickness:eoe},Jo=ti(ti({},window.THREE?window.THREE:{BoxGeometry:Hf,CircleGeometry:I1,DoubleSide:ur,Group:ks,Mesh:qn,MeshLambertMaterial:Wl,TextGeometry:LC,Vector3:re}),{},{Font:Jre,TextGeometry:LC}),VI=wr({props:{labelsData:{default:[]},labelLat:{default:"lat"},labelLng:{default:"lng"},labelAltitude:{default:0},labelText:{default:"text"},labelSize:{default:.5},labelTypeFace:{default:toe,onChange:function(e,t){t.font=new Jo.Font(e)}},labelColor:{default:function(){return"lightgrey"}},labelRotation:{default:0},labelResolution:{default:3},labelIncludeDot:{default:!0},labelDotRadius:{default:.1},labelDotOrientation:{default:function(){return"bottom"}},labelsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;di(e),t.scene=e,t.tweenGroup=r;var s=new Jo.CircleGeometry(1,32);t.dataMapper=new to(e,{objBindAttr:"__threeObjLabel"}).onCreateObj(function(){var o=new Jo.MeshLambertMaterial;o.side=ur;var a=new Jo.Group;a.add(new Jo.Mesh(s,o));var l=new Jo.Mesh(void 0,o);a.add(l);var c=new Jo.Mesh;
4736return c.visible=!1,l.add(c),a.__globeObjType="label",a})},update:function(e){var t=At(e.labelLat),n=At(e.labelLng),r=At(e.labelAltitude),s=At(e.labelText),o=At(e.labelSize),a=At(e.labelRotation),l=At(e.labelColor),c=At(e.labelIncludeDot),u=At(e.labelDotRadius),p=At(e.labelDotOrientation),m=new Set(["right","top","bottom"]),g=2*Math.PI*bi/360;e.dataMapper.onUpdateObj(function(v,b){var M=Ei(v.children,2),x=M[0],w=M[1],R=Ei(w.children,1),C=R[0],N=l(b),D=pa(N);w.material.color.set(el(N)),w.material.transparent=D<1,w.material.opacity=D;var P=c(b),O=p(b);!P||!m.has(O)&&(O="bottom");var I=P?+u(b)*g:1e-12;x.scale.x=x.scale.y=I;var F=+o(b)*g;if(w.geometry&&w.geometry.dispose(),w.geometry=new Jo.TextGeometry(s(b),{font:e.font,size:F,depth:0,bevelEnabled:!0,bevelThickness:0,bevelSize:0,curveSegments:e.labelResolution}),C.geometry&&C.geometry.dispose(),w.geometry.computeBoundingBox(),C.geometry=Tw(Jo.BoxGeometry,ai(new Jo.Vector3().subVectors(w.geometry.boundingBox.max,w.geometry.boundingBox.min).toArray())),O!=="right"&&w.geometry.center(),P){var k=I+F/2;O==="right"&&(w.position.x=k),w.position.y={right:-F/2,top:k+F/2,bottom:-k-F/2}[O]}var Y=function(H){var $=v.__currentTargetD=H,K=$.lat,he=$.lng,ie=$.alt,de=$.rot,Ce=$.scale;Object.assign(v.position,Wo(K,he,ie)),v.lookAt(e.scene.localToWorld(new Jo.Vector3(0,0,0))),v.rotateY(Math.PI),v.rotateZ(-de*Math.PI/180),v.scale.x=v.scale.y=v.scale.z=Ce},W={lat:+t(b),lng:+n(b),alt:+r(b),rot:+a(b),scale:1},Q=v.__currentTargetD||Object.assign({},W,{scale:1e-12});Object.keys(W).some(function(J){return Q[J]!==W[J]})&&(!e.labelsTransitionDuration||e.labelsTransitionDuration<0?Y(W):e.tweenGroup.add(new us(Q).to(W,e.labelsTransitionDuration).easing(fr.Quadratic.InOut).onUpdate(Y).start()))}).digest(e.labelsData)}}),noe=ti(ti({},window.THREE?window.THREE:{}),{},{CSS2DObject:mH}),GI=wr({props:{htmlElementsData:{default:[]},htmlLat:{default:"lat"},htmlLng:{default:"lng"},htmlAltitude:{default:0},htmlElement:{},htmlElementVisibilityModifier:{triggerUpdate:!1},htmlTransitionDuration:{default:1e3,triggerUpdate:!1},isBehindGlobe:{onChange:function(){this.updateObjVisibility()},triggerUpdate:!1}},methods:{updateObjVisibility:function(e,t){if(e.dataMapper){var n=t?[t]:e.dataMapper.entries().map(function(r){var s=Ei(r,2),o=s[1];return o}
vendor: 4,071 bytes, line 4736
4736).filter(function(r){return r});n.forEach(function(r){var s=!e.isBehindGlobe||!e.isBehindGlobe(r.position);e.htmlElementVisibilityModifier?(r.visible=!0,e.htmlElementVisibilityModifier(r.element,s)):r.visible=s})}}},init:function(e,t,n){var r=n.tweenGroup;di(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new to(e,{objBindAttr:"__threeObjHtml"}).onCreateObj(function(s){var o=At(t.htmlElement)(s),a=new noe.CSS2DObject(o);return a.__globeObjType="html",a})},update:function(e,t){var n=this,r=At(e.htmlLat),s=At(e.htmlLng),o=At(e.htmlAltitude);t.hasOwnProperty("htmlElement")&&e.dataMapper.clear(),e.dataMapper.onUpdateObj(function(a,l){var c=function(m){var g=a.__currentTargetD=m,v=g.alt,b=g.lat,M=g.lng;Object.assign(a.position,Wo(b,M,v)),n.updateObjVisibility(a)},u={lat:+r(l),lng:+s(l),alt:+o(l)};!e.htmlTransitionDuration||e.htmlTransitionDuration<0||!a.__currentTargetD?c(u):e.tweenGroup.add(new us(a.__currentTargetD).to(u,e.htmlTransitionDuration).easing(fr.Quadratic.InOut).onUpdate(c).start())}).digest(e.htmlElementsData)}}),yg=window.THREE?window.THREE:{Group:ks,Mesh:qn,MeshLambertMaterial:Wl,SphereGeometry:sl},qI=wr({props:{objectsData:{default:[]},objectLat:{default:"lat"},objectLng:{default:"lng"},objectAltitude:{default:.01},objectFacesSurface:{default:!0},objectRotation:{},objectThreeObject:{default:new yg.Mesh(new yg.SphereGeometry(1,16,8),new yg.MeshLambertMaterial({color:"#ffffaa",transparent:!0,opacity:.7}))}},init:function(e,t){di(e),t.scene=e,t.dataMapper=new to(e,{objBindAttr:"__threeObjObject"}).onCreateObj(function(n){var r=At(t.objectThreeObject)(n);t.objectThreeObject===r&&(r=r.clone());var s=new yg.Group;return s.add(r),s.__globeObjType="object",s})},update:function(e,t){var n=At(e.objectLat),r=At(e.objectLng),s=At(e.objectAltitude),o=At(e.objectFacesSurface),a=At(e.objectRotation);t.hasOwnProperty("objectThreeObject")&&e.dataMapper.clear(),e.dataMapper.onUpdateObj(function(l,c){var u=+n(c),p=+r(c),m=+s(c);Object.assign(l.position,Wo(u,p,m)),o(c)?l.setRotationFromEuler(new Es(Fu(-u),Fu(p),0,"YXZ")):l.rotation.set(0,0,0);var g=l.children[0],v=a(c);v&&g.setRotationFromEuler(new Es(Fu(v.x||0),Fu(v.y||0),Fu(v.z||0)))}).digest(e.objectsData)}}),HI=wr({props:{customLayerData:{default:[]},customThreeObject:{},customThreeObjectUpdate:{triggerUpdate:!1}},init:function(e,t){di(e),t.scene=e,t.dataMapper=new to(e,{objBindAttr:"__threeObjCustom"}).onCreateObj(function(n){var r=At(t.customThreeObject)(n,bi);return r&&(t.customThreeObject===r&&(r=r.clone()),r.__globeObjType="custom"),r})},update:function(e,t){e.customThreeObjectUpdate||di(e.scene);var n=At(e.customThreeObjectUpdate);t.hasOwnProperty("customThreeObject")&&e.dataMapper.clear(),e.dataMapper.onUpdateObj(function(r,s){return n(r,s,bi)}).digest(e.customLayerData)}}),xg=window.THREE?window.THREE:{Camera:L0,Group:ks,Vector2:at,Vector3:re},ioe=["globeLayer","pointsLayer","arcsLayer","hexBinLayer","heatmapsLayer","polygonsLayer","hexedPolygonsLayer","pathsLayer","tilesLayer","particlesLayer","ringsLayer","labelsLayer","htmlElementsLayer","objectsLayer","customLayer"],WI=Ps("globeLayer",RI),roe=Object.assign.apply(Object,ai(["globeImageUrl","bumpImageUrl","globeTileEngineUrl","globeTileEngineMaxLevel","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude"].map(function(i){return kr({},i,WI.linkProp(i))}))),soe=Object.assign.apply(Object,ai(["globeMaterial"].map(function(i){return kr({},i,WI.linkMethod(i))}))),ooe=Ps("pointsLayer",CI),aoe=Object.assign.apply(Object,ai(["pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration"].map(function(i){return kr({},i,ooe.linkProp(i))}))),loe=Ps("arcsLayer",LI),coe=Object.assign.apply(Object,ai(["arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration"].map(function(i){return kr({},i,loe.linkProp(i))}
vendor: 4,067 bytes, line 4736
4736))),uoe=Ps("hexBinLayer",NI),hoe=Object.assign.apply(Object,ai(["hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration"].map(function(i){return kr({},i,uoe.linkProp(i))}))),doe=Ps("heatmapsLayer",II),foe=Object.assign.apply(Object,ai(["heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration"].map(function(i){return kr({},i,doe.linkProp(i))}))),poe=Ps("hexedPolygonsLayer",FI),Aoe=Object.assign.apply(Object,ai(["hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration"].map(function(i){return kr({},i,poe.linkProp(i))}))),moe=Ps("polygonsLayer",BI),goe=Object.assign.apply(Object,ai(["polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration"].map(function(i){return kr({},i,moe.linkProp(i))}))),_oe=Ps("pathsLayer",UI),voe=Object.assign.apply(Object,ai(["pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration"].map(function(i){return kr({},i,_oe.linkProp(i))}))),yoe=Ps("tilesLayer",OI),xoe=Object.assign.apply(Object,ai(["tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration"].map(function(i){return kr({},i,yoe.linkProp(i))}))),boe=Ps("particlesLayer",kI),Soe=Object.assign.apply(Object,ai(["particlesData","particlesList","particleLat","particleLng","particleAltitude","particlesSize","particlesSizeAttenuation","particlesColor","particlesTexture"].map(function(i){return kr({},i,boe.linkProp(i))}))),Moe=Ps("ringsLayer",zI),woe=Object.assign.apply(Object,ai(["ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod"].map(function(i){return kr({},i,Moe.linkProp(i))}))),Toe=Ps("labelsLayer",VI),Eoe=Object.assign.apply(Object,ai(["labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration"].map(function(i){return kr({},i,Toe.linkProp(i))}))),Roe=Ps("htmlElementsLayer",GI),Coe=Object.assign.apply(Object,ai(["htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlElementVisibilityModifier","htmlTransitionDuration"].map(function(i){return kr({},i,Roe.linkProp(i))}))),Poe=Ps("objectsLayer",qI),Loe=Object.assign.apply(Object,ai(["objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject"].map(function(i){return kr({},i,Poe.linkProp(i))}))),Noe=Ps("customLayer",HI),Doe=Object.assign.apply(Object,ai(["customLayerData","customThreeObject","customThreeObjectUpdate"].map(function(i){return kr({},i,Noe.linkProp(i))}))),Ioe=wr({props:ti(ti(ti(ti(ti(ti(ti(ti(ti(ti(ti(ti(ti(ti(ti({onGlobeReady:{triggerUpdate:!1},rendererSize:{default:new xg.Vector2(window.innerWidth,window.innerHeight),onChange:function(e,t){t.pathsLayer.rendererSize(e)},triggerUpdate:!1}},roe),aoe),coe),hoe),foe),goe),Aoe),voe),xoe),Soe),woe),Eoe),Coe),Loe),Doe),methods:ti({getGlobeRadius:IC,getCoords:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Wo.apply(void 0,n)},toGeoCoords:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return EI.apply(void 0,n)}
4736,setPointOfView:function(e,t){var n=t instanceof xg.Camera?t.position:t,r=IC(),s=void 0;if(e.scene&&n){var o,a,l,c;s=function(p){o===void 0&&(o=n.clone().applyMatrix4(e.scene.matrixWorld.clone().invert())),a===void 0&&(a=o.length()),l===void 0&&(l=Math.sqrt(Math.pow(a,2)-Math.pow(r,2))),c===void 0&&(c=Math.acos(l/a));var m=o.distanceTo(p);if(m<l)return!1;var g=p.length(),v=Math.acos((Math.pow(a,2)+Math.pow(m,2)-Math.pow(g,2))/(2*a*m));return v<c}}e.layersThatNeedUpdatePov.forEach(function(u){return u.updatePov(t)}),e.layersThatNeedBehindGlobeChecker.forEach(function(u){return u.isBehindGlobe(s)})},pauseAnimation:function(e){return e.animationFrameRequestId!==null&&(cancelAnimationFrame(e.animationFrameRequestId),e.animationFrameRequestId=null),e.pausableLayers.forEach(function(t){var n;return(n=t.pauseAnimation)===null||n===void 0?void 0:n.call(t)}),this},resumeAnimation:function(e){return e.animationFrameRequestId===null&&this._animationCycle(),e.pausableLayers.forEach(function(t){var n;return(n=t.resumeAnimation)===null||n===void 0?void 0:n.call(t)}),this},_animationCycle:function(e){e.animationFrameRequestId=requestAnimationFrame(this._animationCycle),e.tweenGroup.update()},_destructor:function(e){this.pauseAnimation(),e.destructableLayers.forEach(function(t){return t._destructor()})}},soe),stateInit:function(){var e=new O1,t={tweenGroup:e},n={globeLayer:RI(t),pointsLayer:CI(t),arcsLayer:LI(t),hexBinLayer:NI(t),heatmapsLayer:II(t),polygonsLayer:BI(t),hexedPolygonsLayer:FI(t),pathsLayer:UI(t),tilesLayer:OI(t),particlesLayer:kI(t),ringsLayer:zI(t),labelsLayer:VI(t),htmlElementsLayer:GI(t),objectsLayer:qI(t),customLayer:HI(t)};return ti(ti({tweenGroup:e},n),{},{layersThatNeedUpdatePov:Object.values(n).filter(function(r){return r.hasOwnProperty("updatePov")}),layersThatNeedBehindGlobeChecker:Object.values(n).filter(function(r){return r.hasOwnProperty("isBehindGlobe")}),destructableLayers:Object.values(n).filter(function(r){return r.hasOwnProperty("_destructor")}),pausableLayers:Object.values(n).filter(function(r){return r.hasOwnProperty("pauseAnimation")})})},init:function(e,t,n){var r=n.animateIn,s=r===void 0?!0:r,o=n.waitForGlobeReady,a=o===void 0?!0:o;di(e),t.scene=e,t.scene.visible=!1,ioe.forEach(function(c){var u=new xg.Group;t.scene.add(u),t[c](u)});var l=function(){if(s){t.scene.scale.set(1e-6,1e-6,1e-6),t.tweenGroup.add(new us({k:1e-6}).to({k:1},600).easing(fr.Quadratic.Out).onUpdate(function(p){var m=p.k;return t.scene.scale.set(m,m,m)}).start());var u=new xg.Vector3(0,1,0);t.tweenGroup.add(new us({rot:Math.PI*2}).to({rot:0},1200).easing(fr.Quintic.Out).onUpdate(function(p){var m=p.rot;return t.scene.setRotationFromAxisAngle(u,m)}).start())}t.scene.visible=!0,t.onGlobeReady&&t.onGlobeReady()};a?t.globeLayer.onReady(l):l(),this._animationCycle()},update:function(e){}});function Boe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Object,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=function(r){function s(){var o;Av(this,s);for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return o=pv(this,s,[].concat(l)),o.__kapsuleInstance=Tw(i,[].concat(ai(t?[o]:[]),l)),o}return gv(s,r),mv(s)}(e);return Object.keys(i()).forEach(function(r){return n.prototype[r]=function(){var s,o=(s=this.__kapsuleInstance)[r].apply(s,arguments);return o===this.__kapsuleInstance?this:o}}),n}var Foe=window.THREE?window.THREE:{Group:ks},$I=Boe(Ioe,Foe.Group,!0);const kx={type:"change"},Pw={type:"start"},Lw={type:"end"},qC=1e-6,Yn={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4},bg=new at,dc=new at,Uoe=new re,Sg=new re,zx=new re,sd=new ga,HC=new re,Mg=new re,Vx=new re,wg=new re;class Ooe extends tM{constructor(e,t=null){super(e,t),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:zo.ROTATE,MIDDLE:zo.DOLLY,RIGHT:zo.PAN},this.target=new re,this.state=Yn.NONE,this.keyState=Yn.NONE,this._lastPosition=new re,this._lastZoom=1,this._touchZoomDistanceStart=0,this._touchZoomDistanceEnd=0,this._lastAngle=0,this._eye=new re,this._movePrev=new at,this._moveCurr=new at,this._lastAxis=new re,this._zoomStart=new at,this._zoomEnd=new at,this._panStart=new at,this._panEnd=new at,this._pointers=[],this._pointerPositions={},this._onPointerMove=zoe.bind(this),this._onPointerDown=koe.bind(this),this._onPointerUp=Voe.bind(this),this._onPointerCancel=Goe.bind(this),this._onContextMenu=Yoe.bind(this),this._onMouseWheel=Xoe.bind(this),this._onKeyDown=Hoe.bind(this),this._onKeyUp=qoe.bind(this),this._onTouchStart=Qoe.bind(this),this._onTouchMove=Zoe.bind(this),this._onTouchEnd=Koe.bind(this),this._onMouseDown=Woe.b
4736ind(this),this._onMouseMove=$oe.bind(this),this._onMouseUp=joe.bind(this),this._target0=this.target.clone(),this._position0=this.object.position.clone(),this._up0=this.object.up.clone(),this._zoom0=this.object.zoom,t!==null&&(this.connect(t),this.handleResize()),this.update()}connect(e){super.connect(e),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 e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.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)>qC&&(this.dispatchEvent(kx),this._lastPosition.copy(this.object.position))):this.object.isOrthographicCamera?(this.object.lookAt(this.target),(this._lastPosition.distanceToSquared(this.object.position)>qC||this._lastZoom!==this.object.zoom)&&(this.dispatchEvent(kx),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type.")}reset(){this.state=Yn.NONE,this.keyState=Yn.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(kx),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom}_panCamera(){if(dc.copy(this._panEnd).sub(this._panStart),dc.lengthSq()){if(this.object.isOrthographicCamera){const e=(this.object.right-this.object.left)/this.object.zoom/this.domElement.clientWidth,t=(this.object.top-this.object.bottom)/this.object.zoom/this.domElement.clientWidth;dc.x*=e,dc.y*=t}dc.multiplyScalar(this._eye.length()*this.panSpeed),Sg.copy(this._eye).cross(this.object.up).setLength(dc.x),Sg.add(Uoe.copy(this.object.up).setLength(dc.y)),this.object.position.add(Sg),this.target.add(Sg),this.staticMoving?this._panStart.copy(this._panEnd):this._panStart.add(dc.subVectors(this._panEnd,this._panStart).multiplyScalar(this.dynamicDampingFactor))}}_rotateCamera(){wg.set(this._moveCurr.x-this._movePrev.x,this._moveCurr.y-this._movePrev.y,0);let e=wg.length();e?(this._eye.copy(this.object.position).sub(this.target),HC.copy(this._eye).normalize(),Mg.copy(this.object.up).normalize(),Vx.crossVectors(Mg,HC).normalize(),Mg.setLength(this._moveCurr.y-this._movePrev.y),Vx.setLength(this._moveCurr.x-this._movePrev.x),wg.copy(Mg.add(Vx)),zx.crossVectors(wg,this._eye).normalize(),e*=this.rotateSpeed,sd.setFromAxisAngle(zx,e),this._eye.applyQuaternion(sd),this.object.up.applyQuaternion(sd),this._lastAxis.copy(zx),this._lastAngle=e):!this.staticMoving&&this._lastAngle&&(this._lastAngle*=Math.sqrt(1-this.dynamicDampingFactor),this._eye.copy(this.object.position).sub(this.target),sd.setFromAxisAngle(this._lastAxis,this._lastAngle),this._eye.applyQuaternion(sd),this.object.up.applyQuaternion(sd)),this._movePrev.copy(this._moveCurr)}_zoomCamera(){let e;this.state===Yn.TOUCH_ZOOM_PAN?(e=this._touchZoomDistanceStart/this._touchZoomDistanceEnd,this._touchZoomDistanceStart=this._touchZoomDistanceEnd,this.object.isPerspectiveCamera?this._eye.multiplyScalar(e):this.object.isOrthographicCamera?(this.object.zoom=Sf.clamp(this.object.zoom/e,this.minZoom,this.maxZoom),this._lastZoom!==this.object.zoom&&this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")):(e=1+(this._zoomEnd.y-this._zoomStart.y)*this.zoomSpeed,e!==1&&e>0&&(this.object.isPerspectiveCamera?this._eye.multiplyScalar(e):this.object.isOrthographicCamera?(this.object.zoom=Sf.clamp(this.object.zoom/e,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(e,t){return bg.set((e-this.screen.left)/this.screen.width,(t-this.screen.top)/this.screen.height),bg}_getMouseOnCircle(e,t){return bg.set((e-this.screen.width*.5-this.screen.left)/(this.screen.width*.5),(this.screen.height+2*(this.screen.top-t))/this.screen.width),bg}_addPointer(e){this._pointers.push(e)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t].pointerId==e.pointerId){this._pointers.splice(t,1);return}}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new at,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0].pointerId?this._pointers[1]:this._pointers[0];return this._pointerPositions[t.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 koe(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 zoe(i){this.enabled!==!1&&(i.pointerType==="touch"?this._onTouchMove(i):this._onMouseMove(i))}function Voe(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 Goe(i){this._removePointer(i)}function qoe(){this.enabled!==!1&&(this.keyState=Yn.NONE,window.addEventListener("keydown",this._onKeyDown))}function Hoe(i){this.enabled!==!1&&(window.removeEventListener("keydown",this._onKeyDown),this.keyState===Yn.NONE&&(i.code===this.keys[Yn.ROTATE]&&!this.noRotate?this.keyState=Yn.ROTATE:i.
4736code===this.keys[Yn.ZOOM]&&!this.noZoom?this.keyState=Yn.ZOOM:i.code===this.keys[Yn.PAN]&&!this.noPan&&(this.keyState=Yn.PAN)))}function Woe(i){let e;switch(i.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case zo.DOLLY:this.state=Yn.ZOOM;break;case zo.ROTATE:this.state=Yn.ROTATE;break;case zo.PAN:this.state=Yn.PAN;break;default:this.state=Yn.NONE}const t=this.keyState!==Yn.NONE?this.keyState:this.state;t===Yn.ROTATE&&!this.noRotate?(this._moveCurr.copy(this._getMouseOnCircle(i.pageX,i.pageY)),this._movePrev.copy(this._moveCurr)):t===Yn.ZOOM&&!this.noZoom?(this._zoomStart.copy(this._getMouseOnScreen(i.pageX,i.pageY)),this._zoomEnd.copy(this._zoomStart)):t===Yn.PAN&&!this.noPan&&(this._panStart.copy(this._getMouseOnScreen(i.pageX,i.pageY)),this._panEnd.copy(this._panStart)),this.dispatchEvent(Pw)}function $oe(i){const e=this.keyState!==Yn.NONE?this.keyState:this.state;e===Yn.ROTATE&&!this.noRotate?(this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(i.pageX,i.pageY))):e===Yn.ZOOM&&!this.noZoom?this._zoomEnd.copy(this._getMouseOnScreen(i.pageX,i.pageY)):e===Yn.PAN&&!this.noPan&&this._panEnd.copy(this._getMouseOnScreen(i.pageX,i.pageY))}function joe(){this.state=Yn.NONE,this.dispatchEvent(Lw)}function Xoe(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(Pw),this.dispatchEvent(Lw)}}function Yoe(i){this.enabled!==!1&&i.preventDefault()}function Qoe(i){switch(this._trackPointer(i),this._pointers.length){case 1:this.state=Yn.TOUCH_ROTATE,this._moveCurr.copy(this._getMouseOnCircle(this._pointers[0].pageX,this._pointers[0].pageY)),this._movePrev.copy(this._moveCurr);break;default:this.state=Yn.TOUCH_ZOOM_PAN;const e=this._pointers[0].pageX-this._pointers[1].pageX,t=this._pointers[0].pageY-this._pointers[1].pageY;this._touchZoomDistanceEnd=this._touchZoomDistanceStart=Math.sqrt(e*e+t*t);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(Pw)}function Zoe(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 e=this._getSecondPointerPosition(i),t=i.pageX-e.x,n=i.pageY-e.y;this._touchZoomDistanceEnd=Math.sqrt(t*t+n*n);const r=(i.pageX+e.x)/2,s=(i.pageY+e.y)/2;this._panEnd.copy(this._getMouseOnScreen(r,s));break}}function Koe(i){switch(this._pointers.length){case 0:this.state=Yn.NONE;break;case 1:this.state=Yn.TOUCH_ROTATE,this._moveCurr.copy(this._getMouseOnCircle(i.pageX,i.pageY)),this._movePrev.copy(this._moveCurr);break;case 2:this.state=Yn.TOUCH_ZOOM_PAN;for(let e=0;e<this._pointers.length;e++)if(this._pointers[e].pointerId!==i.pointerId){const t=this._pointerPositions[this._pointers[e].pointerId];this._moveCurr.copy(this._getMouseOnCircle(t.x,t.y)),this._movePrev.copy(this._moveCurr);break}break}this.dispatchEvent(Lw)}const WC={type:"change"},Nw={type:"start"},jI={type:"end"},Tg=new P0,$C=new Da,Joe=Math.cos(70*Sf.DEG2RAD),gr=new re,Ds=2*Math.PI,hi={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Gx=1e-6;class eae extends tM{constructor(e,t=null){super(e,t),this.state=hi.NONE,this.target=new re,this.cursor=new re,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LE
vendor: 20,927 bytes, line 4736
4736FT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:zo.ROTATE,MIDDLE:zo.DOLLY,RIGHT:zo.PAN},this.touches={ONE:Pd.ROTATE,TWO:Pd.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new re,this._lastQuaternion=new ga,this._lastTargetPosition=new re,this._quat=new ga().setFromUnitVectors(e.up,new re(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new iE,this._sphericalDelta=new iE,this._scale=1,this._panOffset=new re,this._rotateStart=new at,this._rotateEnd=new at,this._rotateDelta=new at,this._panStart=new at,this._panEnd=new at,this._panDelta=new at,this._dollyStart=new at,this._dollyEnd=new at,this._dollyDelta=new at,this._dollyDirection=new re,this._mouse=new at,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=nae.bind(this),this._onPointerDown=tae.bind(this),this._onPointerUp=iae.bind(this),this._onContextMenu=uae.bind(this),this._onMouseWheel=oae.bind(this),this._onKeyDown=aae.bind(this),this._onTouchStart=lae.bind(this),this._onTouchMove=cae.bind(this),this._onMouseDown=rae.bind(this),this._onMouseMove=sae.bind(this),this._interceptControlDown=hae.bind(this),this._interceptControlUp=dae.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(e){super.connect(e),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(WC),this.update(),this.state=hi.NONE}update(e=null){const t=this.object.position;gr.copy(t).sub(this.target),gr.applyQuaternion(this._quat),this._spherical.setFromVector3(gr),this.autoRotate&&this.state===hi.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=Ds:n>Math.PI&&(n-=Ds),r<-Math.PI?r+=Ds:r>Math.PI&&(r-=Ds),n<=r?this._spherical.theta=Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let s=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const o=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),s=o!=this._spherical.radius}if(gr.setFromSpherical(this._spherical),gr.applyQuaternion(this._quatInverse),t.copy(this.target).add(gr),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let o=null;if(this.object.isPerspectiveCamera){const a=gr.length();o=this._clampDistance(a*this._scale);const l=a-o;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),s=!!l}else if(this.object.isOrthographicCamera){const a=new re(this._mouse.x,this._mouse.y,0);a.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),s=l!==this.object.zoom;const c=new re(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(a),this.object.updateMatrixWorld(),o=gr.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;o!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position):(Tg.origin.copy(this.object.position),Tg.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Tg.direction))<Joe?this.object.lookAt(this.target):($C.setFromNormalAndCoplanarPoint(this.object.up,this.target),Tg.intersectPlane($C,this.target))))}else if(this.object.isOrthographicCamera){const o=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),o!==this.object.zoom&&(this.object.updateProjectionMatrix(),s=!0)}return this._scale=1,this._performCursorZoom=!1,s||this._lastPosition.distanceToSquared(this.object.position)>Gx||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Gx||this._lastTargetPosition.distanceToSquared(this.target)>Gx?(this.dispatchEvent(WC),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?Ds/60*this.autoRotateSpeed*e:Ds/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){gr.setFromMatrixColumn(t,0),gr.multiplyScalar(-e),this._panOffset.add(gr)}_panUp(e,t){this.screenSpacePanning===!0?gr.setFromMatrixColumn(t,1):(gr.setFromMatrixColumn(t,0),gr.crossVectors(this.object.up,gr)),gr.multiplyScalar(e),this._panOffset.add(gr)}_pan(e,t){const n=this.domElement;if(this.object.isPerspectiveCamera){const r=this.object.position;gr.copy(r).sub(this.target);let s=gr.length();s*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*s/n.clientHeight,this.object.matrix),this._panUp(2*t*s/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const n=this.domElement.getBoundingClientRect(),r=e-n.left,s=t-n.top,o=n.width,a=n.height;this._mouse.x=r/o*2-1,this._mouse.y=-(s/a)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(Ds*this._rotateDelta.x/t.clientHeight),this._rotateUp(Ds*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(Ds*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-Ds*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(Ds*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-Ds*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,s=Math.sqrt(n*n+r*r);this._dollyStart.set(0,s)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),s=.5*(e.pageY+n.y);this._rotateEnd.set(r,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(Ds*this._rotateDelta.x/t.clientHeight),this._rotateUp(Ds*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,s=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,s),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const o=(e.pageX+t.x)*.5,a=(e.pageY+t.y)*.5;this._updateZoomParameters(o,a)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new at,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){const t=e.deltaMode,n={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}}function tae(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._isTrackingPointer(i)&&(this._addPointer(i),i.pointerType==="touch"?this._onTouchStart(i):this._onMouseDown(i)))}function nae(i){this.enabled!==!1&&(i.pointerType==="touch"?this._onTouchMove(i):this._onMouseMove(i))}function iae(i){switch(this._removePointer(i),this._pointers.length){case 0:this.domElement.releasePointerCapture(i.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(jI),this.state=hi.NONE;break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function rae(i){let e;switch(i.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case zo.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(i),this.state=hi.DOLLY;break;case zo.ROTATE:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=hi.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=hi.ROTATE}break;case zo.PAN:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=hi.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=hi.PAN}break;default:this.state=hi.NONE}this.state!==hi.NONE&&this.dispatchEvent(Nw)}function sae(i){switch(this.state){case hi.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(i);break;case hi.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(i);break;case hi.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(i);break}}function oae(i){this.enabled===!1||this.enableZoom===!1||this.state!==hi.NONE||(i.preventDefault(),this.dispatchEvent(Nw),this._handleMouseWheel(this._customWheelEvent(i)),this.dispatchEvent(jI))}function aae(i){this.enabled!==!1&&this._handleKeyDown(i)}function lae(i){switch(this._trackPointer(i),this._pointers.length){case 1:switch(this.touches.ONE){case Pd.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(i),this.state=hi.TOUCH_ROTATE;break;case Pd.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(i),this.state=hi.TOUCH_PAN;break;default:this.state=hi.NONE}break;case 2:switch(this.touches.TWO){case Pd.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(i),this.state=hi.TOUCH_DOLLY_PAN;break;case Pd.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(i),this.state=hi.TOUCH_DOLLY_ROTATE;break;default:this.state=hi.NONE}break;default:this.state=hi.NONE}this.state!==hi.NONE&&this.dispatchEvent(Nw)}function cae(i){switch(this._trackPointer(i),this.state){case hi.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(i),this.update();break;case hi.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(i),this.update();break;case hi.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(i),this.update();break;case hi.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(i),this.update();break;default:this.state=hi.NONE}}function uae(i){this.enabled!==!1&&i.preventDefault()}function hae(i){i.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function dae(i){i.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}const fae={type:"change"},jC=1e-6,XC=new ga;class pae extends tM{constructor(e,t=null){super(e,t),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this._moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this._moveVector=new re(0,0,0),this._rotationVector=new re(0,0,0),this._lastQuaternion=new ga,this._lastPosition=new re,this._status=0,this._onKeyDown=Aae.bind(this),this._onKeyUp=mae.bind(this),this._onPointerMove=_ae.bind(this),this._onPointerDown=gae.bind(this),this._onPointerUp=vae.bind(this),this._onPointerCancel=yae.bind(this),this._onContextMenu=xae.bind(this),t!==null&&this.connect(t)}connect(e){super.connect(e),window.addEventListener("keydown",this._onKeyDown),window.addEventListener("keyup",this._onKeyUp),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.addEventListener("pointercancel",this._onPointerCancel),this.domElement.addEventListener("contextmenu",this._onContextMenu)}disconnect(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerCancel),this.domElement.removeEventListener("contextmenu",this._onContextMenu)}dispose(){this.disconnect()}update(e){if(this.enabled===!1)return;const t=this.object,n=e*this.movementSpeed,r=e*this.rollSpeed;t.translateX(this._moveVector.x*n),t.translateY(this._moveVector.y*n),t.translateZ(this._moveVector.z*n),XC.set(this._rotationVector.x*r,this._rotationVector.y*r,this._rotationVector.z*r,1).normalize(),t.quaternion.multiply(XC),(this._lastPosition.distanceToSquared(t.position)>jC||8*(1-this._lastQuaternion.dot(t.quaternion))>jC)&&(this.dispatchEvent(fae),this._lastQuaternion.copy(t.quaternion),this._lastPosition.copy(t.position))}_updateMovementVector(){const e=this._moveState.forward||this.autoForward&&!this._moveState.back?1:0;this._moveVector.x=-this._moveState.left+this._moveState.right,this._moveVector.y=-this._moveState.down+this._moveState.up,this._moveVector.z=-e+this._moveState.back}_updateRotationVector(){this._rotationVector.x=-this._moveState.pitchDown+this._moveState.pitchUp,this._rotationVector.y=-this._moveState.yawRight+this._moveState.yaw
4736Left,this._rotationVector.z=-this._moveState.rollRight+this._moveState.rollLeft}_getContainerDimensions(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}}}function Aae(i){if(!(i.altKey||this.enabled===!1)){switch(i.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this._moveState.forward=1;break;case"KeyS":this._moveState.back=1;break;case"KeyA":this._moveState.left=1;break;case"KeyD":this._moveState.right=1;break;case"KeyR":this._moveState.up=1;break;case"KeyF":this._moveState.down=1;break;case"ArrowUp":this._moveState.pitchUp=1;break;case"ArrowDown":this._moveState.pitchDown=1;break;case"ArrowLeft":this._moveState.yawLeft=1;break;case"ArrowRight":this._moveState.yawRight=1;break;case"KeyQ":this._moveState.rollLeft=1;break;case"KeyE":this._moveState.rollRight=1;break}this._updateMovementVector(),this._updateRotationVector()}}function mae(i){if(this.enabled!==!1){switch(i.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this._moveState.forward=0;break;case"KeyS":this._moveState.back=0;break;case"KeyA":this._moveState.left=0;break;case"KeyD":this._moveState.right=0;break;case"KeyR":this._moveState.up=0;break;case"KeyF":this._moveState.down=0;break;case"ArrowUp":this._moveState.pitchUp=0;break;case"ArrowDown":this._moveState.pitchDown=0;break;case"ArrowLeft":this._moveState.yawLeft=0;break;case"ArrowRight":this._moveState.yawRight=0;break;case"KeyQ":this._moveState.rollLeft=0;break;case"KeyE":this._moveState.rollRight=0;break}this._updateMovementVector(),this._updateRotationVector()}}function gae(i){if(this.enabled!==!1)if(this.dragToLook)this._status++;else{switch(i.button){case 0:this._moveState.forward=1;break;case 2:this._moveState.back=1;break}this._updateMovementVector()}}function _ae(i){if(this.enabled!==!1&&(!this.dragToLook||this._status>0)){const e=this._getContainerDimensions(),t=e.size[0]/2,n=e.size[1]/2;this._moveState.yawLeft=-(i.pageX-e.offset[0]-t)/t,this._moveState.pitchDown=(i.pageY-e.offset[1]-n)/n,this._updateRotationVector()}}function vae(i){if(this.enabled!==!1){if(this.dragToLook)this._status--,this._moveState.yawLeft=this._moveState.pitchDown=0;else{switch(i.button){case 0:this._moveState.forward=0;break;case 2:this._moveState.back=0;break}this._updateMovementVector()}this._updateRotationVector()}}function yae(){this.enabled!==!1&&(this.dragToLook?(this._status=0,this._moveState.yawLeft=this._moveState.pitchDown=0):(this._moveState.forward=0,this._moveState.back=0,this._updateMovementVector()),this._updateRotationVector())}function xae(i){this.enabled!==!1&&i.preventDefault()}const bae={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:`
4737
4738		varying vec2 vUv;
4739
4740		void main() {
4741
4742			vUv = uv;
4743			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4744
4745		}`,fragmentShader:`
4746
4747		uniform float opacity;
4748
4749		uniform sampler2D tDiffuse;
4750
4751		varying vec2 vUv;
4752
4753		void main() {
4754
4755			vec4 texel = texture2D( tDiffuse, vUv );
4756			gl_FragColor = opacity * texel;
4757
4758
4759		}`};class _v{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const Sae=new N0(-1,1,1,-1,0,1);class Mae extends vi{constructor(){super(),this.setAttribute("position",new Gn([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Gn([0,2,0,0,2,0],2))}}const wae=new Mae;class Tae{constructor(e){this._mesh=new qn(wae,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,Sae)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}class Eae extends _v{constructor(e,t="tDiffuse"){super(),this.textureID=t,this.uniforms=null,this.material=null,e instanceof Xs?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=P1.clone(e.uniforms),this.material=new Xs({name:e.name!==void 0?e.name:"unspecified",defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this._fsQuad=new Tae(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this._fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this._fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this._fsQuad.render(e))}dispose(){this.material.dispose(),this._fsQuad.dispose()}}class YC extends _v{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,n){const r=e.getContext(),s=e.state;s.buffers.color.setMask(!1),s.buffers.depth.setMask(!1),s.buffers.color.setLocked(!0),s.buffers.depth.setLocked(!0);let o,a;this.inverse?(o=0,a=1):(o=1,a=0),s.buffers.stencil.setTest(!0),s.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),s.buffers.stencil.setFunc(r.ALWAYS,o,4294967295),s.buffers.stencil.setClear(a),s.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),s.buffers.color.setLocked(!1),s.buffers.depth.setLocked(!1),s.buffers.color.setMask(!0),s.buffers.depth.setMask(!0),s.buffers.stencil.setLocked(!1),s.buffers.stencil.setFunc(r.EQUAL,1,4294967295),s.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),s.buffers.stencil.setLocked(!0)}}class Rae extends _v{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class Cae{constructor(e,t){if(this.renderer=e,this._pixelRatio=e.getPixelRatio(),t===void 0){const n=e.getSize(new at);this._width=n.width,this._height=n.height,t=new Hc(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:dr}),t.texture.name="EffectComposer.rt1"}else this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new Eae(bae),this.copyPass.material.blending=Hs,this.clock=new zL}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);t!==-1&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){e===void 0&&(e=this.clock.getDelta());const t=this.renderer.getRenderTarget();let n=!1;for(let r=0,s=this.passes.length;r<s;r++){const o=this.passes[r];if(o.enabled!==!1){if(o.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(r),o.render(this.renderer,this.writeBuffer,this.readBuffer,e,n),o.needsSwap){if(n){const a=this.renderer.getContext(),l=this.renderer.state.buffers.stencil;
4759l.setFunc(a.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),l.setFunc(a.EQUAL,1,4294967295)}this.swapBuffers()}YC!==void 0&&(o instanceof YC?n=!0:o instanceof Rae&&(n=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(e===void 0){const t=this.renderer.getSize(new at);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,e=this.renderTarget1.clone(),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(n,r),this.renderTarget2.setSize(n,r);for(let s=0;s<this.passes.length;s++)this.passes[s].setSize(n,r)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}class Pae extends _v{constructor(e,t,n=null,r=null,s=null){super(),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=r,this.clearAlpha=s,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new qt}render(e,t,n){const r=e.autoClear;e.autoClear=!1;let s,o;this.overrideMaterial!==null&&(o=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor!==null&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor,e.getClearAlpha())),this.clearAlpha!==null&&(s=e.getClearAlpha(),e.setClearAlpha(this.clearAlpha)),this.clearDepth==!0&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),this.clear===!0&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor!==null&&e.setClearColor(this._oldClearColor),this.clearAlpha!==null&&e.setClearAlpha(s),this.overrideMaterial!==null&&(this.scene.overrideMaterial=o),e.autoClear=r}}function Ks(){return Ks=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},Ks.apply(this,arguments)}function Lae(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function g0(i,e){return g0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},g0(i,e)}function Nae(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,g0(i,e)}function jb(i){return jb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},jb(i)}function Dae(i){try{return Function.toString.call(i).indexOf("[native code]")!==-1}catch{return typeof i=="function"}}function XI(){try{var i=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(XI=function(){return!!i})()}function Iae(i,e,t){if(XI())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var r=new(i.bind.apply(i,n));return t&&g0(r,t.prototype),r}function Xb(i){var e=typeof Map=="function"?new Map:void 0;return Xb=function(n){if(n===null||!Dae(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,r)}function r(){return Iae(n,arguments,jb(this).constructor)}return r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),g0(r,n)},Xb(i)}var za=function(i){Nae(e,i);function e(t){var n;return n=i.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this,Lae(n)}return e}(Xb(Error));function qx(i){return Math.round(i*255)}function Bae(i,e,t){return qx(i)+","+qx(e)+","+qx(t)}function A1(i,e,t,n){if(n===void 0&&(n=Bae),e===0)return n(t,t,t);var r=(i%360+360)%360/60,s=(1-Math.abs(2*t-1))*e,o=s*(1-Math.abs(r%2-1)),a=0,l=0,c=0;r>=0&&r<1?(a=s,l=o):r>=1&&r<2?(a=o,l=s):r>=2&&r<3?(l=s,c=o):r>=3&&r<4?(l=o,c=s):r>=4&&r<5?(a=o,c=s):r>=5&&r<6&&(a=s,c=o);var u=t-s/2,p=a+u,m=l+u,g=c+u;return n(p,m,g)}var QC={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
47590",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};function Fae(i){if(typeof i!="string")return i;var e=i.toLowerCase();return QC[e]?"#"+QC[e]:i}var Uae=/^#[a-fA-F0-9]{6}$/,Oae=/^#[a-fA-F0-9]{8}$/,kae=/^#[a-fA-F0-9]{3}$/,zae=/^#[a-fA-F0-9]{4}$/,Hx=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,Vae=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,Gae=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,qae=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function If(i){if(typeof i!="string")throw new za(3);var e=Fae(i);if(e.match(Uae))return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16)};if(e.match(Oae)){var t=parseFloat((parseInt(""+e[7]+e[8],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16),alph
4759a:t}}if(e.match(kae))return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16)};if(e.match(zae)){var n=parseFloat((parseInt(""+e[4]+e[4],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16),alpha:n}}var r=Hx.exec(e);if(r)return{red:parseInt(""+r[1],10),green:parseInt(""+r[2],10),blue:parseInt(""+r[3],10)};var s=Vae.exec(e.substring(0,50));if(s)return{red:parseInt(""+s[1],10),green:parseInt(""+s[2],10),blue:parseInt(""+s[3],10),alpha:parseFloat(""+s[4])>1?parseFloat(""+s[4])/100:parseFloat(""+s[4])};var o=Gae.exec(e);if(o){var a=parseInt(""+o[1],10),l=parseInt(""+o[2],10)/100,c=parseInt(""+o[3],10)/100,u="rgb("+A1(a,l,c)+")",p=Hx.exec(u);if(!p)throw new za(4,e,u);return{red:parseInt(""+p[1],10),green:parseInt(""+p[2],10),blue:parseInt(""+p[3],10)}}var m=qae.exec(e.substring(0,50));if(m){var g=parseInt(""+m[1],10),v=parseInt(""+m[2],10)/100,b=parseInt(""+m[3],10)/100,M="rgb("+A1(g,v,b)+")",x=Hx.exec(M);if(!x)throw new za(4,e,M);return{red:parseInt(""+x[1],10),green:parseInt(""+x[2],10),blue:parseInt(""+x[3],10),alph
4759a:parseFloat(""+m[4])>1?parseFloat(""+m[4])/100:parseFloat(""+m[4])}}throw new za(5)}function Hae(i){var e=i.red/255,t=i.green/255,n=i.blue/255,r=Math.max(e,t,n),s=Math.min(e,t,n),o=(r+s)/2;if(r===s)return i.alpha!==void 0?{hue:0,saturation:0,lightness:o,alpha:i.alpha}:{hue:0,saturation:0,lightness:o};var a,l=r-s,c=o>.5?l/(2-r-s):l/(r+s);switch(r){case e:a=(t-n)/l+(t<n?6:0);break;case t:a=(n-e)/l+2;break;default:a=(e-t)/l+4;break}return a*=60,i.alpha!==void 0?{hue:a,saturation:c,lightness:o,alpha:i.alpha}:{hue:a,saturation:c,lightness:o}}function Jc(i){return Hae(If(i))}var Wae=function(e){return e.length===7&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e},Yb=Wae;function Lu(i){var e=i.toString(16);return e.length===1?"0"+e:e}function Wx(i){return Lu(Math.round(i*255))}function $ae(i,e,t){return Yb("#"+Wx(i)+Wx(e)+Wx(t))}function YI(i,e,t){return A1(i,e,t,$ae)}function jae(i,e,t){if(typeof i=="object"&&e===void 0&&t===void 0)return YI(i.hue,i.saturation,i.lightness);throw new za(1)}function Xae(i,e,t,n){if(typeof i=="object"&&e===void 0&&t===void 0&&n===void 0)return i.alpha>=1?YI(i.hue,i.saturation,i.lightness):"rgba("+A1(i.hue,i.saturation,i.lightness)+","+i.alpha+")";throw new za(2)}function QI(i,e,t){if(typeof i=="number"&&typeof e=="number"&&typeof t=="number")return Yb("#"+Lu(i)+Lu(e)+Lu(t));if(typeof i=="object"&&e===void 0&&t===void 0)return Yb("#"+Lu(i.red)+Lu(i.green)+Lu(i.blue));throw new za(6)}function vv(i,e,t,n){if(typeof i=="object"&&e===void 0&&t===void 0&&n===void 0)return i.alpha>=1?QI(i.red,i.green,i.blue):"rgba("+i.red+","+i.green+","+i.blue+","+i.alpha+")";throw new za(7)}var Yae=function(e){return typeof e.red=="number"&&typeof e.green=="number"&&typeof e.blue=="number"&&(typeof e.alpha!="number"||typeof e.alpha>"u")},Qae=function(e){return typeof e.red=="number"&&typeof e.green=="number"&&typeof e.blue=="number"&&typeof e.alpha=="number"},Zae=function(e){return typeof e.hue=="number"&&typeof e.saturation=="number"&&typeof e.lightness=="number"&&(typeof e.alpha!="number"||typeof e.alpha>"u")},Kae=function(e){return typeof e.hue=="number"&&typeof e.saturation=="number"&&typeof e.lightness=="number"&&typeof e.alpha=="number"};function eu(i){if(typeof i!="object")throw new za(8);if(Qae(i))return vv(i);if(Yae(i))return QI(i);if(Kae(i))return Xae(i);if(Zae(i))return jae(i);throw new za(8)}function ZI(i,e,t){return function(){var r=t.concat(Array.prototype.slice.call(arguments));return r.length>=e?i.apply(this,r):ZI(i,e,r)}}function wo(i){return ZI(i,i.length,[])}function Jae(i,e){if(e==="transparent")return e;var t=Jc(e);return eu(Ks({},t,{hue:t.hue+parseFloat(i)}))}wo(Jae);function Kf(i,e,t){return Math.max(i,Math.min(e,t))}function ele(i,e){if(e==="transparent")return e;var t=Jc(e);return eu(Ks({},t,{lightness:Kf(0,1,t.lightness-parseFloat(i))}))}wo(ele);function tle(i,e){if(e==="transparent")return e;var t=Jc(e);return eu(Ks({},t,{saturation:Kf(0,1,t.saturation-parseFloat(i))}))}wo(tle);function nle(i,e){if(e==="transparent")return e;var t=Jc(e);return eu(Ks({},t,{lightness:Kf(0,1,t.lightness+parseFloat(i))}))}wo(nle);function ile(i,e,t){if(e==="transparent")return t;if(t==="transparent")return e;if(i===0)return t;var n=If(e),r=Ks({},n,{alpha:typeof n.alpha=="number"?n.alpha:1}),s=If(t),o=Ks({},s,{alpha:typeof s.alpha=="number"?s.alpha:1}),a=r.alpha-o.alpha,l=parseFloat(i)*2-1,c=l*a===-1?l:l+a,u=1+l*a,p=(c/u+1)/2,m=1-p,g={red:Math.floor(r.red*p+o.red*m),green:Math.floor(r.green*p+o.green*m),blue:Math.floor(r.blue*p+o.blue*m),alpha:r.alpha*parseFloat(i)+o.alpha*(1-parseFloat(i))};return vv(g)}var rle=wo(ile),KI=rle;function sle(i,e){if(e==="transparent")return e;var t=If(e),n=typeof t.alpha=="number"?t.alpha:1,r=Ks({},t,{alpha:Kf(0,1,(n*100+parseFloat(i)*100)/100)});return vv(r)}var ole=wo(sle),ale=ole;function lle(i,e){if(e==="transparent")return e;var t=Jc(e);return eu(Ks({},t,{saturation:Kf(0,1,t.saturation+parseFloat(i))}))}wo(lle);function cle(i,e){return e==="transparent"?e:eu(Ks({},Jc(e),{hue:parseFloat(i)}))}wo(cle);function ule(i,e){return e==="transparent"?e:eu(Ks({},Jc(e),{lightness:parseFloat(i)}))}wo(ule);function hle(i,e){return e==="transparent"?e:eu(Ks({},Jc(e),{saturation:parseFloat(i)}))}wo(hle);function dle(i,e){return e==="transparent"?e:KI(parseFloat(i),"rgb(0, 0, 0)",e)}wo(dle);function fle(i,e){return e==="transparent"?e:KI(parseFloat(i),"rgb(255, 255, 255)",e)}wo(fle);function ple(i,e){if(e==="transparent")return e;var t=If(e),n=typeof t.alpha=="number"?t.alpha:1,r=Ks({},t,{alpha:Kf(0,1,+(n*100-parseFloat(i)*100).toFixed(2)/100)});return vv(r)}wo(ple);var Q0,Di,JI,e7,Uu,ZC,t7,n7,i7,Dw,Qb,Zb,_0={},r7=[],Ale=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,yv=Array.isArray;function Va(i,e){for(var t in e)i[t]=e[t];return i}function Iw(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function mle(i,e,t){var n,r,s,o={};for(s in e)s=="key"?n=e[s]:s=="ref"?r=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Q0.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(s in i.defaultProps)o[s]==null&&(o[s]=i.defaultProps[s]);return RA(i,o,n,r,null)}function RA(i,e,t,n,r){var s={type:i,props:e,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++JI,__i:-1,__u:0};return r==null&&Di.vnode!=null&&Di.vnode(s),s}function xv(i){return i.children}function M_(i,e){this.props=i,this.context=e}function Bf(i,e){if(e==null)return i.__?Bf(i.__,i.__i+1):null;for(var t;
vendor: 2,396 bytes, line 4759
4759e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?Bf(i):null}function s7(i){var e,t;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null){i.__e=i.__c.base=t.__e;break}return s7(i)}}function KC(i){(!i.__d&&(i.__d=!0)&&Uu.push(i)&&!m1.__r++||ZC!=Di.debounceRendering)&&((ZC=Di.debounceRendering)||t7)(m1)}function m1(){for(var i,e,t,n,r,s,o,a=1;Uu.length;)Uu.length>a&&Uu.sort(n7),i=Uu.shift(),a=Uu.length,i.__d&&(t=void 0,r=(n=(e=i).__v).__e,s=[],o=[],e.__P&&((t=Va({},n)).__v=n.__v+1,Di.vnode&&Di.vnode(t),Bw(e.__P,t,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,s,r??Bf(n),!!(32&n.__u),o),t.__v=n.__v,t.__.__k[t.__i]=t,l7(s,t,o),t.__e!=r&&s7(t)));m1.__r=0}function o7(i,e,t,n,r,s,o,a,l,c,u){var p,m,g,v,b,M,x=n&&n.__k||r7,w=e.length;for(l=gle(t,e,x,l,w),p=0;p<w;p++)(g=t.__k[p])!=null&&(m=g.__i==-1?_0:x[g.__i]||_0,g.__i=p,M=Bw(i,g,m,r,s,o,a,l,c,u),v=g.__e,g.ref&&m.ref!=g.ref&&(m.ref&&Fw(m.ref,null,g),u.push(g.ref,g.__c||v,g)),b==null&&v!=null&&(b=v),4&g.__u||m.__k===g.__k?l=a7(g,l,i):typeof g.type=="function"&&M!==void 0?l=M:v&&(l=v.nextSibling),g.__u&=-7);return t.__e=b,l}function gle(i,e,t,n,r){var s,o,a,l,c,u=t.length,p=u,m=0;for(i.__k=new Array(r),s=0;s<r;s++)(o=e[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(l=s+m,(o=i.__k[s]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?RA(null,o,null,null,null):yv(o)?RA(xv,{children:o},null,null,null):o.constructor==null&&o.__b>0?RA(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=i,o.__b=i.__b+1,a=null,(c=o.__i=_le(o,t,l,p))!=-1&&(p--,(a=t[c])&&(a.__u|=2)),a==null||a.__v==null?(c==-1&&(r>u?m--:r<u&&m++),typeof o.type!="function"&&(o.__u|=4)):c!=l&&(c==l-1?m--:c==l+1?m++:(c>l?m--:m++,o.__u|=4))):i.__k[s]=null;if(p)for(s=0;s<u;s++)(a=t[s])!=null&&(2&a.__u)==0&&(a.__e==n&&(n=Bf(a)),u7(a,a));return n}function a7(i,e,t){var n,r;if(typeof i.type=="function"){for(n=i.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=i,e=a7(n[r],e,t));return e}i.__e!=e&&(e&&i.type&&!t.contains(e)&&(e=Bf(i)),t.insertBefore(i.__e,e||null),e=i.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function _le(i,e,t,n){var r,s,o=i.key,a=i.type,l=e[t];if(l===null&&i.key==null||l&&o==l.key&&a==l.type&&(2&l.__u)==0)return t;if(n>(l!=null&&(2&l.__u)==0?1:0))for(r=t-1,s=t+1;r>=0||s<e.length;){if(r>
vendor: 4,249 bytes, line 4759
4759=0){if((l=e[r])&&(2&l.__u)==0&&o==l.key&&a==l.type)return r;r--}if(s<e.length){if((l=e[s])&&(2&l.__u)==0&&o==l.key&&a==l.type)return s;s++}}return-1}function JC(i,e,t){e[0]=="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||Ale.test(e)?t:t+"px"}function Eg(i,e,t,n,r){var s;e:if(e=="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof n=="string"&&(i.style.cssText=n=""),n)for(e in n)t&&e in t||JC(i.style,e,"");if(t)for(e in t)n&&t[e]==n[e]||JC(i.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(i7,"$1")),e=e.toLowerCase()in i||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),i.l||(i.l={}),i.l[e+s]=t,t?n?t.u=n.u:(t.u=Dw,i.addEventListener(e,s?Zb:Qb,s)):i.removeEventListener(e,s?Zb:Qb,s);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?i.removeAttribute(e):i.setAttribute(e,e=="popover"&&t==1?"":t))}}function e4(i){return function(e){if(this.l){var t=this.l[e.type+i];if(e.t==null)e.t=Dw++;else if(e.t<t.u)return;return t(Di.event?Di.event(e):e)}}}function Bw(i,e,t,n,r,s,o,a,l,c){var u,p,m,g,v,b,M,x,w,R,C,N,D,P,O,I,F,k=e.type;if(e.constructor!=null)return null;128&t.__u&&(l=!!(32&t.__u),s=[a=e.__e=t.__e]),(u=Di.__b)&&u(e);e:if(typeof k=="function")try{if(x=e.props,w="prototype"in k&&k.prototype.render,R=(u=k.contextType)&&n[u.__c],C=u?R?R.props.value:u.__:n,t.__c?M=(p=e.__c=t.__c).__=p.__E:(w?e.__c=p=new k(x,C):(e.__c=p=new M_(x,C),p.constructor=k,p.render=yle),R&&R.sub(p),p.props=x,p.state||(p.state={}),p.context=C,p.__n=n,m=p.__d=!0,p.__h=[],p._sb=[]),w&&p.__s==null&&(p.__s=p.state),w&&k.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=Va({},p.__s)),Va(p.__s,k.getDerivedStateFromProps(x,p.__s))),g=p.props,v=p.state,p.__v=e,m)w&&k.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),w&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(w&&k.getDerivedStateFromProps==null&&x!==g&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(x,C),!p.__e&&p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(x,p.__s,C)===!1||e.__v==t.__v){for(e.__v!=t.__v&&(p.props=x,p.state=p.__s,p.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(Y){Y&&(Y.__=e)}),N=0;N<p._sb.length;N++)p.__h.push(p._sb[N]);p._sb=[],p.__h.length&&o.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(x,p.__s,C),w&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(g,v,b)})}if(p.context=C,p.props=x,p.__P=i,p.__e=!1,D=Di.__r,P=0,w){for(p.state=p.__s,p.__d=!1,D&&D(e),u=p.render(p.props,p.state,p.context),O=0;O<p._sb.length;O++)p.__h.push(p._sb[O]);p._sb=[]}else do p.__d=!1,D&&D(e),u=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++P<25);p.state=p.__s,p.getChildContext!=null&&(n=Va(Va({},n),p.getChildContext())),w&&!m&&p.getSnapshotBeforeUpdate!=null&&(b=p.getSnapshotBeforeUpdate(g,v)),I=u,u!=null&&u.type===xv&&u.key==null&&(I=c7(u.props.children)),a=o7(i,yv(I)?I:[I],e,t,n,r,s,o,a,l,c),p.base=e.__e,e.__u&=-161,p.__h.length&&o.push(p),M&&(p.__E=p.__=null)}catch(Y){if(e.__v=null,l||s!=null)if(Y.then){for(e.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,e.__e=a}else for(F=s.length;F--;)Iw(s[F]);else e.__e=t.__e,e.__k=t.__k;Di.__e(Y,e,t)}else s==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):a=e.__e=vle(t.__e,e,t,n,r,s,o,l,c);return(u=Di.diffed)&&u(e),128&e.__u?void 0:a}function l7(i,e,t){for(var n=0;n<t.length;n++)Fw(t[n],t[++n],t[++n]);Di.__c&&Di.__c(e,i),i.some(function(r){try{i=r.__h,r.__h=[],i.some(function(s){s.call(r)})}catch(s){Di.__e(s,r.__v)}})}function c7(i){return typeof i!="object"||i==null||i.__b&&i.__b>0?i:yv(i)?i.map(c7):Va({},i)}function vle(i,e,t,n,r,s,o,a,l){var c,u,p,m,g,v,b,M=t.props,x=e.props,w=e.type;if(w=="svg"?r="http://www.w3.org/2000/svg":w=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),s!=null){for(c=0;c<s.length;c++)if((g=s[c])&&"setAttribute"in g==!!w&&(w?g.localName==w:g.nodeType==3)){
vendor: 3,028 bytes, line 4759
4759i=g,s[c]=null;break}}if(i==null){if(w==null)return document.createTextNode(x);i=document.createElementNS(r,w,x.is&&x),a&&(Di.__m&&Di.__m(e,s),a=!1),s=null}if(w==null)M===x||a&&i.data==x||(i.data=x);else{if(s=s&&Q0.call(i.childNodes),M=t.props||_0,!a&&s!=null)for(M={},c=0;c<i.attributes.length;c++)M[(g=i.attributes[c]).name]=g.value;for(c in M)if(g=M[c],c!="children"){if(c=="dangerouslySetInnerHTML")p=g;else if(!(c in x)){if(c=="value"&&"defaultValue"in x||c=="checked"&&"defaultChecked"in x)continue;Eg(i,c,null,g,r)}}for(c in x)g=x[c],c=="children"?m=g:c=="dangerouslySetInnerHTML"?u=g:c=="value"?v=g:c=="checked"?b=g:a&&typeof g!="function"||M[c]===g||Eg(i,c,g,M[c],r);if(u)a||p&&(u.__html==p.__html||u.__html==i.innerHTML)||(i.innerHTML=u.__html),e.__k=[];else if(p&&(i.innerHTML=""),o7(e.type=="template"?i.content:i,yv(m)?m:[m],e,t,n,w=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,o,s?s[0]:t.__k&&Bf(t,0),a,l),s!=null)for(c=s.length;c--;)Iw(s[c]);a||(c="value",w=="progress"&&v==null?i.removeAttribute("value"):v!=null&&(v!==i[c]||w=="progress"&&!v||w=="option"&&v!=M[c])&&Eg(i,c,v,M[c],r),c="checked",b!=null&&b!=i[c]&&Eg(i,c,b,M[c],r))}return i}function Fw(i,e,t){try{if(typeof i=="function"){var n=typeof i.__u=="function";n&&i.__u(),n&&e==null||(i.__u=i(e))}else i.current=e}catch(r){Di.__e(r,t)}}function u7(i,e,t){var n,r;if(Di.unmount&&Di.unmount(i),(n=i.ref)&&(n.current&&n.current!=i.__e||Fw(n,null,e)),(n=i.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){Di.__e(s,e)}n.base=n.__P=null}if(n=i.__k)for(r=0;r<n.length;r++)n[r]&&u7(n[r],e,t||typeof i.type!="function");t||Iw(i.__e),i.__c=i.__=i.__e=void 0}function yle(i,e,t){return this.constructor(i,t)}function xle(i,e,t){var n,r,s,o;e==document&&(e=document.documentElement),Di.__&&Di.__(i,e),r=(n=!1)?null:e.__k,s=[],o=[],Bw(e,i=e.__k=mle(xv,null,[i]),r||_0,_0,e.namespaceURI,r?null:e.firstChild?Q0.call(e.childNodes):null,s,r?r.__e:e.firstChild,n,o),l7(s,i,o)}function h7(i,e,t){var n,r,s,o,a=Va({},i.props);for(s in i.type&&i.type.defaultProps&&(o=i.type.defaultProps),e)s=="key"?n=e[s]:s=="ref"?r=e[s]:a[s]=e[s]==null&&o!=null?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?Q0.call(arguments,2):t),RA(i.type,a,n||i.key,r||i.ref,null)}Q0=r7.slice,Di={__e:function(i,e,t,n){for(var r,s,o;e=e.__;)if((r=e.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(i)),o=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(i,n||{}),o=r.__d),o)return r.__E=r}catch(a){i=a}throw i}},JI=0,e7=function(i){return i!=null&&i.constructor==null},M_.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Va({},this.state),typeof i=="function"&&(i=i(Va({},t),this.props)),i&&Va(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),KC(this))},M_.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),KC(this))},M_.prototype.render=xv,Uu=[],t7=typeof Promise=="function"?Promise.prototype.then.bind(Prom
4759ise.resolve()):setTimeout,n7=function(i,e){return i.__v.__b-e.__v.__b},m1.__r=0,i7=/(PointerCapture)$|Capture$/i,Dw=0,Qb=e4(!1),Zb=e4(!0);function t4(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}function ble(i){if(Array.isArray(i))return i}function Sle(i,e,t){return(e=Cle(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Mle(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,r,s,o,a=[],l=!0,c=!1;try{if(s=(t=t.call(i)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,r=u}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}function wle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4760In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n4(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function Tle(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?n4(Object(t),!0).forEach(function(n){Sle(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):n4(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function Ele(i,e){return ble(i)||Mle(i,e)||Ple(i,e)||wle()}function Rle(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function Cle(i){var e=Rle(i,"string");return typeof e=="symbol"?e:e+""}function g1(i){"@babel/helpers - typeof";return g1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g1(i)}function Ple(i,e){if(i){if(typeof i=="string")return t4(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?t4(i,e):void 0}}var Kb=function(e){if(g1(e)!=="object")return e;var t=h7(e);if(t.props){var n;t.props=Tle({},t.props),t!=null&&(n=t.props)!==null&&n!==void 0&&n.children&&(t.props.children=Array.isArray(t.props.children)?t.props.children.map(Kb):Kb(t.props.children))}return t},Lle=function(e){return e7(h7(e))},Nle=function(e,t){delete t.__k,xle(Kb(e),t)};function Dle(i,e){e===void 0&&(e={});var t=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=i:r.appendChild(document.createTextNode(i))}}var Ile=`.float-tooltip-kap {
4761  position: absolute;
4762  width: max-content; /* prevent shrinking near right edge */
4763  max-width: max(50%, 150px);
4764  padding: 3px 5px;
4765  border-radius: 3px;
4766  font: 12px sans-serif;
4767  color: #eee;
4768  background: rgba(0,0,0,0.6);
4769  pointer-events: none;
4770}
4771`;Dle(Ile);var Ble=wr({props:{content:{default:!1},offsetX:{triggerUpdate:!1},offsetY:{triggerUpdate:!1}},init:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.style,s=r===void 0?{}:r,o=!!e&&g1(e)==="object"&&!!e.node&&typeof e.node=="function",a=lU(o?e.node():e);a.style("position")==="static"&&a.style("position","relative"),t.tooltipEl=a.append("div").attr("class","float-tooltip-kap"),Object.entries(s).forEach(function(c){var u=Ele(c,2),p=u[0],m=u[1];return t.tooltipEl.style(p,m)}),t.tooltipEl.style("left","-10000px").style("display","none");var l="tooltip-".concat(Math.round(Math.random()*1e12));t.mouseInside=!1,a.on("mousemove.".concat(l),function(c){t.mouseInside=!0;var u=cU(c),p=a.node(),m=p.offsetWidth,g=p.offsetHeight,v=[t.offsetX===null||t.offsetX===void 0?"-".concat(u[0]/m*100,"%"):typeof t.offsetX=="number"?"calc(-50% + ".concat(t.offsetX,"px)"):t.offsetX,t.offsetY===null||t.offsetY===void 0?g>130&&g-u[1]<100?"calc(-100% - 6px)":"21px":typeof t.offsetY=="number"?t.offsetY<0?"calc(-100% - ".concat(Math.abs(t.offsetY),"px)"):"".concat(t.offsetY,"px"):t.offsetY];t.tooltipEl.style("left",u[0]+"px").style("top",u[1]+"px").style("transform","translate(".concat(v.join(","),")")),t.content&&t.tooltipEl.style("display","inline")}),a.on("mouseover.".concat(l),function(){t.mouseInside=!0,t.content&&t.tooltipEl.style("display","inline")}),a.on("mouseout.".concat(l),function(){t.mouseInside=!1,t.tooltipEl.style("display","none")})},update:function(e){e.tooltipEl.style("display",e.content&&e.mouseInside?"inline":"none"),e.content?e.content instanceof HTMLElement?(e.tooltipEl.text(""),e.tooltipEl.append(function(){return e.content})):typeof e.content=="string"?e.tooltipEl.html(e.content):Lle(e.content)?(e.tooltipEl.text(""),Nle(e.content,e.tooltipEl.node())):(e.tooltipEl.style("display","none"),console.warn("Tooltip content is invali
4771d, skipping.",e.content,e.content.toString())):e.tooltipEl.text("")}});function Fle(i,e){e===void 0&&(e={});var t=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=i:r.appendChild(document.createTextNode(i))}}var Ule=`.scene-nav-info {
4772  position: absolute;
4773  bottom: 5px;
4774  width: 100%;
4775  text-align: center;
4776  color: slategrey;
4777  opacity: 0.7;
4778  font-size: 10px;
4779  font-family: sans-serif;
4780  pointer-events: none;
4781  user-select: none;
4782}
4783
4784.scene-container canvas:focus {
4785  outline: none;
4786}`;Fle(Ule);function Jb(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}function Ole(i){if(Array.isArray(i))return i}function kle(i){if(Array.isArray(i))return Jb(i)}function zle(i,e,t){return(e=jle(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Vle(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function Gle(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,r,s,o,a=[],l=!0,c=!1;try{if(s=(t=t.call(i)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,r=u}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}function qle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4787In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hle(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4788In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wle(i,e){return Ole(i)||Gle(i,e)||d7(i,e)||qle()}function Su(i){return kle(i)||Vle(i)||d7(i)||Hle()}function $le(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function jle(i){var e=$le(i,"string");return typeof e=="symbol"?e:e+""}function d7(i,e){if(i){if(typeof i=="string")return Jb(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Jb(i,e):void 0}}var Pi=window.THREE?window.THREE:{WebGLRenderer:AH,Scene:N1,PerspectiveCamera:Br,Raycaster:Pk,SRGBColorSpace:Xt,TextureLoader:JS,Vector2:at,Vector3:re,Box3:Hl,Color:qt,Mesh:qn,SphereGeometry:sl,MeshBasicMaterial:Bo,BackSide:oi,Clock:zL},f7=wr({props:{width:{default:window.innerWidth,onChange:function(e,t,n){isNaN(e)&&(t.width=n)}},height:{default:window.innerHeight,onChange:function(e,t,n){isNaN(e)&&(t.height=n)}},viewOffset:{default:[0,0]},backgroundColor:{default:"#000011"},backgroundImageUrl:{},onBackgroundImageLoaded:{},showNavInfo:{default:!0},skyRadius:{default:5e4},objects:{default:[]},lights:{default:[]},enablePointerInteraction:{default:!0,onChange:function(e,t){t.hoverObj=null,t.tooltip&&t.tooltip.content(null)},triggerUpdate:!1},pointerRaycasterThrottleMs:{default:50,triggerUpdate:!1},lineHoverPrecision:{default:1,triggerUpdate:!1},pointsHoverPrecision:{default:1,triggerUpdate:!1},hoverOrderComparator:{triggerUpdate:!1},hoverFilter:{default:function(){return!0},triggerUpdate:!1},tooltipContent:{triggerUpdate:!1},hoverDuringDrag:{default:!1,triggerUpdate:!1},clickAfterDrag:{default:!1,triggerUpdate:!1},onHover:{default:function(){},triggerUpdate:!1},onClick:{default:function(){},triggerUpdate:!1},onRightClick:{triggerUpdate:!1}},methods:{tick:function(e){if(e.initialised){e.controls.update&&e.controls.update(Math.min(1,e.clock.getDelta())),e.postProcessingComposer?e.postProcessingComposer.render():e.renderer.render(e.scene,e.camera),e.extraRenderers.forEach(function(o){return o.render(e.scene,e.camera)});var t=+new Date;if(e.enablePointerInteraction&&t-e.lastRaycasterCheck>=e.pointerRaycasterThrottleMs){e.lastRaycasterCheck=t;var n=null;if(e.hoverDuringDrag||!e.isPointerDragging){var r=this.intersectingObjects(e.pointerPos.x,e.pointerPos.y);
4788e.hoverOrderComparator&&r.sort(function(o,a){return e.hoverOrderComparator(o.object,a.object)});var s=r.find(function(o){return e.hoverFilter(o.object)})||null;n=s?s.object:null,e.intersection=s||null}n!==e.hoverObj&&(e.onHover(n,e.hoverObj,e.intersection),e.tooltip.content(n&&At(e.tooltipContent)(n,e.intersection)||null),e.hoverObj=n)}e.tweenGroup.update()}return this},getPointerPos:function(e){var t=e.pointerPos,n=t.x,r=t.y;return{x:n,y:r}},cameraPosition:function(e,t,n,r){var s=e.camera;if(t&&e.initialised){var o=t,a=n||{x:0,y:0,z:0};if(!r)u(o),p(a);else{var l=Object.assign({},s.position),c=m();e.tweenGroup.add(new us(l).to(o,r).easing(fr.Quadratic.Out).onUpdate(u).start()),e.tweenGroup.add(new us(c).to(a,r/3).easing(fr.Quadratic.Out).onUpdate(p).start())}return this}return Object.assign({},s.position,{lookAt:m()});function u(g){var v=g.x,b=g.y,M=g.z;v!==void 0&&(s.position.x=v),b!==void 0&&(s.position.y=b),M!==void 0&&(s.position.z=M)}function p(g){var v=new Pi.Vector3(g.x,g.y,g.z);e.controls.target?e.controls.target=v:s.lookAt(v)}function m(){return Object.assign(new Pi.Vector3(0,0,-1e3).applyQuaternion(s.quaternion).add(s.position))}},zoomToFit:function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,r=arguments.length,s=new Array(r>3?r-3:0),o=3;o<r;o++)s[o-3]=arguments[o];return this.fitToBbox(this.getBbox.apply(this,s),t,n)},fitToBbox:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:10,s=e.camera;if(t){var o=new Pi.Vector3(0,0,0),a=Math.max.apply(Math,Su(Object.entries(t).map(function(g){var v=Wle(g,2),b=v[0],M=v[1];return Math.max.apply(Math,Su(M.map(function(x){return Math.abs(o[b]-x)})))})))*2,l=(1-r*2/e.height)*s.fov,c=a/Math.atan(l*Math.PI/180),u=c/s.aspect,p=Math.max(c,u);if(p>0){var m=o.clone().sub(s.position).normalize().multiplyScalar(-p);this.cameraPosition(m,o,n)}}return this},getBbox:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return!0},n=new Pi.Box3(new Pi.Vector3(0,0,0),new Pi.Vector3(0,0,0)),r=e.objects.filter(t);return r.length?(r.forEach(function(s){return n.expandByObject(s)}),Object.assign.apply(Object,Su(["x","y","z"].map(function(s){return zle({},s,[n.min[s],n.max[s]])})))):null},getScreenCoords:function(e,t,n,r){var s=new Pi.Vector3(t,n,r);
4788return s.project(this.camera()),{x:(s.x+1)*e.width/2,y:-(s.y-1)*e.height/2}},getSceneCoords:function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=new Pi.Vector2(t/e.width*2-1,-(n/e.height)*2+1),o=new Pi.Raycaster;return o.setFromCamera(s,e.camera),Object.assign({},o.ray.at(r,new Pi.Vector3))},intersectingObjects:function(e,t,n){var r=new Pi.Vector2(t/e.width*2-1,-(n/e.height)*2+1),s=new Pi.Raycaster;return s.params.Line.threshold=e.lineHoverPrecision,s.params.Points.threshold=e.pointsHoverPrecision,s.setFromCamera(r,e.camera),s.intersectObjects(e.objects,!0)},renderer:function(e){return e.renderer},scene:function(e){return e.scene},camera:function(e){return e.camera},postProcessingComposer:function(e){return e.postProcessingComposer},controls:function(e){return e.controls},tbControls:function(e){return e.controls}},stateInit:function(){return{scene:new Pi.Scene,camera:new Pi.PerspectiveCamera,clock:new Pi.Clock,tweenGroup:new O1,lastRaycasterCheck:0}},init:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.controlType,s=r===void 0?"trackball":r,o=n.useWebGPU,a=o===void 0?!1:o,l=n.rendererConfig,c=l===void 0?{}:l,u=n.extraRenderers,p=u===void 0?[]:u,m=n.waitForLoadComplete,g=m===void 0?!0:m;e.innerHTML="",e.appendChild(t.container=document.createElement("div")),t.container.className="scene-container",t.container.style.position="relative",t.container.appendChild(t.navInfo=document.createElement("div")),t.navInfo.className="scene-nav-info",t.navInfo.textContent={orbit:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",trackball:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",fly:"WASD: move, R|F: up | down, Q|E: roll, up|down: pitch, left|right: yaw"}[s]||"",t.navInfo.style.display=t.showNavInfo?null:"none",t.tooltip=new Ble(t.container),t.pointerPos=new Pi.Vector2,t.pointerPos.x=-2,t.pointerPos.y=-2,["pointermove","pointerdown"].forEach(function(v){return t.container.addEventListener(v,function(b){if(v==="pointerdown"&&(t.isPointerPressed=!0),!t.isPointerDragging&&b.type==="pointermove"&&(b.pressure>0||t.isPointerPressed)&&(b.pointerType!=="touch"||b.movementX===void 0||[b.movementX,b.movementY].some(function(w){return Math.abs(w)>1}))&&(t.isPointerDragging=!0),t.enablePointerInteraction){var M=x(t.container);t.pointerPos.x=b.pageX-M.left,t.pointerPos.y=b.pageY-M.top}function x(w){var R=w.getBoundingClientRect(),C=window.pageXOffset||document.documentElement.scrollLeft,N=window.pageYOffset||document.documentElement.scrollTop;return{top:R.top+N,left:R.left+C}}},{passive:!0})}),t.container.addEventListener("pointerup",function(v){t.isPointerPressed=!1,!(t.isPointerDragging&&(t.isPointerDragging=!1,!t.clickAfterDrag))&&requestAnimationFrame(function(){v.button===0&&t.onClick(t.hoverObj||null,v,t.intersection),v.button===2&&t.onRightClick&&t.onRightClick(t.hoverObj||null,v,t.intersection)})},{passive:!0,capture:!0}),t.container.addEventListener("contextmenu",function(v){t.onRightClick&&v.preventDefault()}),t.renderer=new(a?yI:Pi.WebGLRenderer)(Object.assign({antialias:!0,alpha:!0},c)),t.renderer.setPixelRatio(Math.min(2,window.devicePixelRatio)),t.container.appendChild(t.renderer.domElement),t.extraRenderers=p,t.extraRenderers.forEach(function(v){v.domElement.style.position="absolute",v.domElement.style.top="0px",v.domElement.style.pointerEvents="none",t.container.appendChild(v.domElement)}),t.postProcessingComposer=new Cae(t.renderer),t.postProcessingComposer.addPass(new Pae(t.scene,t.camera)),t.controls=new{trackball:Ooe,orbit:eae,fly:pae}[s](t.camera,t.renderer.domElement),s==="fly"&&(t.controls.movementSpeed=300,t.controls.rollSpeed=Math.PI/6,t.controls.dragToLook=!0),(s==="trackball"||s==="orbit")&&(t.controls.minDistance=.1,t.controls.maxDistance=t.skyRadius,t.controls.addEventListener("start",function(){t.controlsEngaged=!0}),t.controls.addEventListener("change",function(){t.controlsEngaged&&(t.controlsDragging=!0)}),t.controls.addEventListener("end",function(){t.controlsEngaged=!1,t.controlsDragging=!1})),[t.renderer,t.postProcessingComposer].concat(Su(t.extraRenderers)).forEac
4788h(function(v){return v.setSize(t.width,t.height)}),t.camera.aspect=t.width/t.height,t.camera.updateProjectionMatrix(),t.camera.position.z=1e3,t.scene.add(t.skysphere=new Pi.Mesh),t.skysphere.visible=!1,t.loadComplete=t.scene.visible=!g,window.scene=t.scene},update:function(e,t){if(e.width&&e.height&&(t.hasOwnProperty("width")||t.hasOwnProperty("height"))){var n,r=e.width,s=e.height;e.container.style.width="".concat(r,"px"),e.container.style.height="".concat(s,"px"),[e.renderer,e.postProcessingComposer].concat(Su(e.extraRenderers)).forEach(function(g){return g.setSize(r,s)}),e.camera.aspect=r/s;var o=e.viewOffset.slice(0,2);o.some(function(g){return g})&&(n=e.camera).setViewOffset.apply(n,[r,s].concat(Su(o),[r,s])),e.camera.updateProjectionMatrix()}if(t.hasOwnProperty("viewOffset")){var a,l=e.width,c=e.height,u=e.viewOffset.slice(0,2);u.some(function(g){return g})?(a=e.camera).setViewOffset.apply(a,[l,c].concat(Su(u),[l,c])):e.camera.clearViewOffset()}if(t.hasOwnProperty("skyRadius")&&e.skyRadius&&(e.controls.hasOwnProperty("maxDistance")&&t.skyRadius&&(e.controls.maxDistance=Math.min(e.controls.maxDistance,e.skyRadius)),e.camera.far=e.skyRadius*2.5,e.camera.updateProjectionMatrix(),e.skysphere.geometry=new Pi.SphereGeometry(e.skyRadius)),t.hasOwnProperty("backgroundColor")){var p=If(e.backgroundColor).alpha;p===void 0&&(p=1),e.renderer.setClearColor(new Pi.Color(ale(1,e.backgroundColor)),p)}t.hasOwnProperty("backgroundImageUrl")&&(e.backgroundImageUrl?new Pi.TextureLoader().load(e.backgroundImageUrl,function(g){g.colorSpace=Pi.SRGBColorSpace,e.skysphere.material=new Pi.MeshBasicMaterial({map:g,side:Pi.BackSide}),e.skysphere.visible=!0,e.onBackgroundImageLoaded&&setTimeout(e.onBackgroundImageLoaded),!e.loadComplete&&m()}):(e.skysphere.visible=!1,e.skysphere.material.map=null,!e.loadComplete&&m())),t.hasOwnProperty("showNavInfo")&&(e.navInfo.style.display=e.showNavInfo?null:"none"),t.hasOwnProperty("lights")&&((t.lights||[]).forEach(function(g){return e.scene.remove(g)}),e.lights.forEach(function(g){return e.scene.add(g)})),t.hasOwnProperty("objects")&&((t.objects||[]).forEach(function(g){return e.scene.remove(g)}),e.objects.forEach(function(g){return e.scene.add(g)}));function m(){e.loadComplete=e.scene.visible=!0}}});function Xle(i,e){e===void 0&&(e={});var t=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=i:r.appendChild(document.createTextNode(i))}}var Yle=`.scene-container .clickable {
4789  cursor: pointer;
4790}`;Xle(Yle);function eS(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}function Qle(i){if(Array.isArray(i))return eS(i)}function Z0(i,e,t){return(e=nce(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Zle(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function Kle(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4791In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i4(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function Ou(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?i4(Object(t),!0).forEach(function(n){Z0(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):i4(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function Jle(i,e){if(i==null)return{};var t,n,r=ece(i,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(n=0;n<s.length;n++)t=s[n],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(i,t)&&(r[t]=i[t])}return r}function ece(i,e){if(i==null)return{};var t={};for(var n in i)if({}.hasOwnProperty.call(i,n)){if(e.indexOf(n)!==-1)continue;t[n]=i[n]}return t}function bv(i){return Qle(i)||Zle(i)||ice(i)||Kle()}function tce(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function nce(i){var e=tce(i,"string");return typeof e=="symbol"?e:e+""}function ice(i,e){if(i){if(typeof i=="string")return eS(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?eS(i,e):void 0}}function p7(i,e){var t=new e;return t._destructor&&t._destructor(),{linkProp:function(r){return{default:t[r](),onChange:function(o,a){a[i][r](o)},triggerUpdate:!1}},linkMethod:function(r){return function(s){for(var o=s[i],a=arguments.length,l=new Array(a>1?a-1:0),c=1;c<a;c++)l[c-1]=arguments[c];var u=o[r].apply(o,l);return u===o?this:u}}}}var rce=["rendererConfig","waitForGlobeReady"],Wp=Ou(Ou({},window.THREE?window.THREE:{AmbientLight:OL,DirectionalLight:UL,Vector2:at,REVISION:zf}),{},{CSS2DRenderer:gH}),A7=p7("globe",$I),sce=Object.assign.apply(Object,bv(["globeImageUrl","bumpImageUrl","globeTileEngineUrl","globeTileEngineMaxLevel","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude","onGlobeReady","pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration","arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration","polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration","pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration","heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration","hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinRes
4791olution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration","hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration","tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration","particlesData","particlesList","particleLat","particleLng","particleAltitude","particlesSize","particlesSizeAttenuation","particlesColor","particlesTexture","ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod","labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration","htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlElementVisibilityModifier","htmlTransitionDuration","objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject","customLayerData","customThreeObject","customThreeObjectUpdate"].map(function(i){return Z0({},i,A7.linkProp(i))}))),oce=Object.assign.apply(Object,bv(["globeMaterial","getGlobeRadius","getCoords","toGeoCoords"].map(function(i){return Z0({},i,A7.linkMethod(i))}))),m7=p7("renderObjs",f7),ace=Object.assign.apply(Object,bv(["width","height","backgroundColor","backgroundImageUrl","enablePointerInteraction"].map(function(i){return Z0({},i,m7.linkProp(i))}))),lce=Object.assign.apply(Object,bv(["lights","postProcessingComposer"].map(function(i){return Z0({},i,m7.linkMethod(i))}))),cce=wr({props:Ou(Ou({onZoom:{triggerUpdate:!1},onGlobeClick:{triggerUpdate:!1},onGlobeRightClick:{triggerUpdate:!1},pointLabel:{default:"name",triggerUpdate:!1},onPointClick:{triggerUpdate:!1},onPointRightClick:{triggerUpdate:!1},onPointHover:{triggerUpdate:!1},arcLabel:{default:"name",triggerUpdate:!1},onArcClick:{triggerUpdate:!1},onArcRightClick:{triggerUpdate:!1},onArcHover:{triggerUpdate:!1},polygonLabel:{default:"name",triggerUpdate:!1},onPolygonClick:{triggerUpdate:!1},onPolygonRightClick:{triggerUpdate:!1},onPolygonHover:{triggerUpdate:!1},pathLabel:{default:"name",triggerUpdate:!1},onPathClick:{triggerUpdate:!1},onPathRightClick:{triggerUpdate:!1},onPathHover:{triggerUpdate:!1},onHeatmapClick:{triggerUpdate:!1},onHeatmapRightClick:{triggerUpdate:!1},onHeatmapHover:{triggerUpdate:!1},hexLabel:{triggerUpdate:!1},onHexClick:{triggerUpdate:!1},onHexRightClick:{triggerUpdate:!1},onHexHover:{triggerUpdate:!1},hexPolygonLabel:{triggerUpdate:!1},onHexPolygonClick:{triggerUpdate:!1},onHexPolygonRightClick:{triggerUpdate:!1},onHexPolygonHover:{triggerUpdate:!1},tileLabel:{default:"name",triggerUpdate:!1},onTileClick:{triggerUpdate:!1},onTileRightClick:{triggerUpdate:!1},onTileHover:{triggerUpdate:!1},particleLabel:{default:"name",triggerUpdate:!1},onParticleClick:{triggerUpdate:!1},onParticleRightClick:{triggerUpdate:!1},onParticleHover:{triggerUpdate:!1},labelLabel:{triggerUpdate:!1},onLabelClick:{triggerUpdate:!1},onLabelRightClick:{triggerUpdate:!1},onLabelHover:{triggerUpdate:!1},objectLabel:{default:"name",triggerUpdate:!1},onObjectClick:{triggerUpdate:!1},onObjectRightClick:{triggerUpdate:!1},onObjectHover:{triggerUpdate:!1},customLayerLabel:{default:"name",triggerUpdate:!1},onCustomLayerClick:{triggerUpdate:!1},onCustomLayerRightClick:{triggerUpdate:!1},onCustomLayerHover:{triggerUpdate:!1},pointerEventsFilter:{default:function(){return!0},triggerUpdate:!1},lineHoverPrecision:{default:.2,triggerUpdate:!1,onChange:function(e,t){t.renderObjs.lineHoverPrecision(e),t.renderObjs.pointsHoverPrecision(e)}},globeOffset:{default:[0,0],triggerUpdate:!1,onChange:function(e,t){return Array.isArray(e)&&e.length===2&&t.renderObjs.viewOffset(e.map(function(n){return-n}))}}},sce),ace),methods:Ou(Ou({pauseAnimation:function(e){var t;return e.animationFrameRequestId!==null&&(cancelAnimationFrame(e.animationFrameRequestId),e.animationFrameRequestId=null),(t=e.globe)===null||t===void 0||t.pauseAnimation(),this},resumeAnimation:function(e){var t;return e.animationFrameRequestId===null&&this._animationCycle(),(t=e.globe)===null||t===void 0||t.resumeAnimation(),this},_animationCycle:function(e){e.renderObjs.tick(),e.tweenGroup.update(),e.animationFrameRequestId=requestAnimationFrame(this._animationCycle)}
4791,pointOfView:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=o();if(t.lat===void 0&&t.lng===void 0&&t.altitude===void 0)return r;var s=Object.assign({},r,t);if(["lat","lng","altitude"].forEach(function(l){return s[l]=+s[l]}),!n)a(s);else{for(;r.lng-s.lng>180;)r.lng-=360;for(;r.lng-s.lng<-180;)r.lng+=360;e.tweenGroup.add(new us(r).to(s,n).easing(fr.Cubic.InOut).onUpdate(a).start())}return this;function o(){return e.globe.toGeoCoords(e.renderObjs.cameraPosition())}function a(l){var c=l.lat,u=l.lng,p=l.altitude;e.renderObjs.cameraPosition(e.globe.getCoords(c,u,p)),e.globe.setPointOfView(e.renderObjs.camera())}},getScreenCoords:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];var o=(t=e.globe).getCoords.apply(t,r);return e.renderObjs.getScreenCoords(o.x,o.y,o.z)},toGlobeCoords:function(e,t,n){var r=e.renderObjs.intersectingObjects(t,n).find(function(l){return(l.object.__globeObjType||l.object.parent.__globeObjType)==="globe"});if(!r)return null;var s=e.globe.toGeoCoords(r.point),o=s.lat,a=s.lng;return{lat:o,lng:a}},scene:function(e){return e.renderObjs.scene()},camera:function(e){return e.renderObjs.camera()},renderer:function(e){return e.renderObjs.renderer()},controls:function(e){return e.renderObjs.controls()},_destructor:function(e){e.globe._destructor(),this.pauseAnimation(),this.pointsData([]),this.arcsData([]),this.polygonsData([]),this.pathsData([]),this.heatmapsData([]),this.hexBinPointsData([]),this.hexPolygonsData([]),this.tilesData([]),this.particlesData([]),this.labelsData([]),this.htmlElementsData([]),this.objectsData([]),this.customLayerData([])}},oce),lce),stateInit:function(e){var t=e.rendererConfig,n=e.waitForGlobeReady,r=n===void 0?!0:n,s=Jle(e,rce),o=new $I(Ou({waitForGlobeReady:r},s));return{globe:o,renderObjs:f7({controlType:"orbit",rendererConfig:t,waitForLoadComplete:r,extraRenderers:[new Wp.CSS2DRenderer]}).skyRadius(o.getGlobeRadius()*500).showNavInfo(!1).objects([o]).lights([new Wp.AmbientLight(13421772,Math.PI),new Wp.DirectionalLight(16777215,.6*Math.PI)]),tweenGroup:new O1}},init:function(e,t){var n=this;e.innerHTML="",e.appendChild(t.container=document.createElement("div")),t.container.style.position="relative";var r=document.createElement("div");t.container.appendChild(r),t.renderObjs(r),t.globe.rendererSize(t.renderObjs.renderer().getSize(new Wp.Vector2)),this.pointOfView({altitude:2.5});var s=t.globe.getGlobeRadius(),o=t.renderObjs.controls();t.renderObjs.camera().near=.05,o.minDistance=s+Math.max(.001,t.renderObjs.camera().near*1.1),o.maxDistance=s*100,o.enablePan=!1,o.enableDamping=!0,o.dampingFactor=.1,o.rotateSpeed=.3,o.zoomSpeed=.3,o.zoomToCursor=!0,o.addEventListener("change",function(){o.target.setScalar(0);var c=n.pointOfView();o.rotateSpeed=c.altitude*.3,o.zoomSpeed=Math.sqrt(c.altitude)*.5,t.globe.setPointOfVie
4791w(t.renderObjs.camera()),t.onZoom&&t.onZoom(c)});var a=function(u){for(var p=u;p&&!p.hasOwnProperty("__globeObjType");)p=p.parent;return p},l={point:function(u){return u},arc:function(u){return u},polygon:function(u){return u.data},path:function(u){return u},heatmap:function(u){return u},hexbin:function(u){return u},hexPolygon:function(u){return u},tile:function(u){return u},particles:function(u,p){return!p||!p.hasOwnProperty("index")||u.length<=p.index?u:u[p.index]},label:function(u){return u},object:function(u){return u},custom:function(u){return u}};Wp.REVISION<155&&(t.renderObjs.renderer().useLegacyLights=!1),t.renderObjs.hoverFilter(function(c){var u=a(c);if(!u)return!1;var p=u.__globeObjType;if(p!=="globe"&&!l.hasOwnProperty(p))return!1;var m=l.hasOwnProperty(p)&&u.__data?l[p](u.__data):null;return["points","hexBinPoints"].some(function(g){return g===p})&&Array.isArray(m)?!1:t.pointerEventsFilter(u,m)}).tooltipContent(function(c,u){var p={point:t.pointLabel,arc:t.arcLabel,polygon:t.polygonLabel,path:t.pathLabel,hexbin:t.hexLabel,hexPolygon:t.hexPolygonLabel,tile:t.tileLabel,particles:t.particleLabel,label:t.labelLabel,object:t.objectLabel,custom:t.customLayerLabel},m=a(c),g=m&&m.__globeObjType;return m&&g&&p.hasOwnProperty(g)&&l.hasOwnProperty(g)&&At(p[g])(l[g](m.__data,u))||""}).onHover(function(c,u,p){var m={point:t.onPointHover,arc:t.onArcHover,polygon:t.onPolygonHover,path:t.onPathHover,heatmap:t.onHeatmapHover,hexbin:t.onHexHover,hexPolygon:t.onHexPolygonHover,tile:t.onTileHover,particles:t.onParticleHover,label:t.onLabelHover,object:t.onObjectHover,custom:t.onCustomLayerHover},g={globe:t.onGlobeClick,point:t.onPointClick,arc:t.onArcClick,polygon:t.onPolygonClick,path:t.onPathClick,heatmap:t.onHeatmapClick,hexbin:t.onHexClick,hexPolygon:t.onHexPolygonClick,tile:t.onTileClick,particles:t.onParticleClick,label:t.onLabelClick,object:t.onObjectClick,custom:t.onCustomLayerClick},v=a(c);if(v&&!m.hasOwnProperty(v.__globeObjType)&&(v=null),v!==t.hoverObj){var b=t.hoverObj?t.hoverObj.__globeObjType:null,M=t.hoverData,x=v?v.__globeObjType:null,w=v?l[x](v.__data,p):null;b&&b!==x&&m[b]&&m[b](null,M||null),x&&m[x]&&m[x](w,b===x?M:null),t.renderObjs.renderer().domElement.classList[x&&g[x]?"add":"remove"]("clickable"),t.hoverObj=v,t.hoverData=w}}).onClick(function(c,u,p){if(c){var m={globe:t.onGlobeClick,point:t.onPointClick,arc:t.onArcClick,polygon:t.onPolygonClick,path:t.onPathClick,heatmap:t.onHeatmapClick,hexbin:t.onHexClick,hexPolygon:t.onHexPolygonClick,tile:t.onTileClick,particles:t.onParticleClick,label:t.onLabelClick,object:t.onObjectClick,custom:t.onCustomLayerClick},g=a(c),v=g.__globeObjType;if(g&&m.hasOwnProperty(v)&&m[v]){var b=[u],M=p!=null&&p.isVector3?p:p==null?void 0:p.point;if(v==="globe"){var x=n.toGeoCoords(M),w=x.lat,R=x.lng;b.unshift({lat:w,lng:R})}else b.push(n.toGeoCoords(M));l.hasOwnProperty(v)&&b.unshift(l[v](g.__data,p)),m[v].apply(m,b)}}}).onRightClick(function(c,u,p){if(c){var m={globe:t.onGlobeRightClick,point:t.onPointRightClick,arc:t.onArcRightClick,polygon:t.onPolygonRightClick,path:t.onPathRightClick,heatmap:t.onHeatmapRightClick,hexbin:t.onHexRightClick,hexPolygon:t.onHexPolygonRightClick,tile:t.onTileRightClick,particles:t.onParticleRightClick,label:t.onLabelRightClick,object:t.onObjectRightClick,custom:t.onCustomLayerRightClick},g=a(c),v=g.__globeObjType;if(g&&m.hasOwnProperty(v)&&m[v]){var b=[u],M=p!=null&&p.isVector3?p:p==null?void 0:p.point;if(v==="globe"){var x=n.toGeoCoords(M),w=x.lat,R=x.lng;b.unshift({lat:w,lng:R})}else b.push(n.toGeoCoords(M));l.hasOwnProperty(v)&&b.unshift(l[v](g.__data,p)),m[v].apply(m,b)}}}),this._animationCycle()}});/**
4792 * @license
4793 * Copyright 2010-2021 Three.js Authors
4794 * SPDX-License-Identifier: MIT
4795 */const Uw="135",uce=0,r4=1,hce=2,g7=1,dce=2,dA=3,v0=0,_r=1,Ff=2,_7=1,Uc=0,CA=1,s4=2,o4=3,a4=4,fce=5,Rd=100,pce=101,Ace=102,l4=103,c4=104,mce=200,gce=201,_ce=202,vce=203,v7=204,y7=205,yce=206,xce=207,bce=208,Sce=209,Mce=210,wce=0,Tce=1,Ece=2,tS=3,Rce=4,Cce=5,Pce=6,Lce=7,Sv=0,Nce=1,Dce=2,Zu=0,Ice=1,Bce=2,Fce=3,Uce=4,Oce=5,x7=300,K0=301,J0=302,nS=303,iS=304,Mv=306,Ow=307,rS=1e3,yo=1001,sS=1002,Fr=1003,u4=1004,h4=1005,ko=1006,kce=1007,wv=1008,$c=1009,zce=1010,Vce=1011,y0=1012,Gce=1013,w_=1014,Ec=1015,Zd=1016,qce=1017,Hce=1018,Wce=1019,Kd=1020,$ce=1021,Ku=1022,Ts=1023,jce=1024,Xce=1025,Yce=Ts,Ju=1026,Uf=1027,Qce=1028,Zce=1029,Kce=1030,Jce=1031,eue=1032,tue=1033,d4=33776,f4=33777,p4=33778,A4=33779,m4=35840,g4=35841,_4=35842,v4=35843,nue=36196,y4=37492,x4=37496,iue=37808,rue=37809,sue=37810,oue=37811,aue=37812,lue=37813,cue=37814,uue=37815,hue=37816,due=37817,fue=37818,pue=37819,Aue=37820,mue=37821,gue=36492,_ue=37840,vue=37841,yue=37842,xue=37843,bue=37844,Sue=37845,Mue=37846,wue=37847,Tue=37848,Eue=37849,Rue=37850,Cue=37851,Pue=37852,Lue=37853,Nue=2200,Due=2201,Iue=2202,_1=2300,v1=2301,$x=2302,zd=2400,Vd=2401,y1=2402,kw=2500,b7=2501,Bue=0,Js=3e3,Tv=3001,zw=3007,Vw=3002,S7=3004,M7=3005,w7=3006,Fue=3200,Uue=3201,Jf=0,Oue=1,jx=7680,kue=519,x0=35044,x1=35048,b4="300 es";class vh{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e);e.target=null}}}const Hr=[];for(let i=0;i<256;i++)Hr[i]=(i<16?"0":"")+i.toString(16);const Xx=Math.PI/180,oS=180/Math.PI;function ja(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Hr[i&255]+Hr[i>>8&255]+Hr[i>>16&255]+Hr[i>>24&255]+"-"+Hr[e&255]+Hr[e>>8&255]+"-"+Hr[e>>16&15|64]+Hr[e>>24&255]+"-"+Hr[t&63|128]+Hr[t>>8&255]+"-"+Hr[t>>16&255]+Hr[t>>24&255]+Hr[n&255]+Hr[n>>8&255]+Hr[n>>16&255]+Hr[n>>24&255]).toUpperCase()}function _o(i,e,t){return Math.max(e,Math.min(t,i))}function zue(i,e){return(i%e+e)%e}function Yx(i,e,t){return(1-t)*i+t*e}function S4(i){return(i&i-1)===0&&i!==0}function Vue(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}class Mt{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}
vendor: 6,069 bytes, line 4795
4795applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*r+e.x,this.y=s*r+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}Mt.prototype.isVector2=!0;class $r{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,r,s,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],p=n[7],m=n[2],g=n[5],v=n[8],b=r[0],M=r[3],x=r[6],w=r[1],R=r[4],C=r[7],N=r[2],D=r[5],P=r[8];return s[0]=o*b+a*w+l*N,s[3]=o*M+a*R+l*D,s[6]=o*x+a*C+l*P,s[1]=c*b+u*w+p*N,s[4]=c*M+u*R+p*D,s[7]=c*x+u*C+p*P,s[2]=m*b+g*w+v*N,s[5]=m*M+g*R+v*D,s[8]=m*x+g*C+v*P,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],p=u*o-a*c,m=a*l-u*s,g=c*s-o*l,v=t*p+n*m+r*g;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const b=1/v;return e[0]=p*b,e[1]=(r*c-u*n)*b,e[2]=(a*n-r*o)*b,e[3]=m*b,e[4]=(u*t-r*l)*b,e[5]=(r*s-a*t)*b,e[6]=g*b,e[7]=(n*l-c*t)*b,e[8]=(o*t-n*s)*b,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,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+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),r=this.elements,s=r[0],o=r[3],a=r[6],l=r[1],c=r[4],u=r[7];return r[0]=t*s+n*l,r[3]=t*o+n*c,r[6]=t*a+n*u,r[1]=-n*s+t*l,r[4]=-n*o+t*c,r[7]=-n*a+t*u,this}translate(e,t){const n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}$r.prototype.isMatrix3=!0;function T7(i){if(i.length===0)return-1/0;let e=i[0];for(let t=1,n=i.length;t<n;++t)i[t]>e&&(e=i[t]);return e}function Ev(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function M4(i,e=0){let t=3735928559^e,n=1103547991^e;for(let r=0,s;r<i.length;r++)s=i.charCodeAt(r),t=Math.imul(t^s,2654435761),n=Math.imul(n^s,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&n)+(t>>>0)}let od;class ep{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;
4795else{od===void 0&&(od=Ev("canvas")),od.width=e.width,od.height=e.height;const n=od.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=od}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}}let Gue=0;class jr extends vh{constructor(e=jr.DEFAULT_IMAGE,t=jr.DEFAULT_MAPPING,n=yo,r=yo,s=ko,o=wv,a=Ts,l=$c,c=1,u=Js){super(),Object.defineProperty(this,"id",{value:Gue++}),this.uuid=ja(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,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 Mt(0,0),this.repeat=new Mt(1,1),this.center=new Mt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new $r,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}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(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this.userData=JSON.parse(JSON.stringify(e.userData)),this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,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,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){const r=this.image;if(r.uuid===void 0&&(r.uuid=ja()),!t&&e.images[r.uuid]===void 0){let s;if(Array.isArray(r)){s=[];for(let o=0,a=r.length;o<a;o++)r[o].isDataTexture?s.push(Qx(r[o].image)):s.push(Qx(r[o]))}else s=Qx(r);e.images[r.uuid]={uuid:r.uuid,url:s}}n.image=r.uuid}return JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==x7)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case rS:e.x=e.x-Math.floor(e.x);break;case yo:e.x=e.x<0?0:1;break;case sS:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case rS:e.y=e.y-Math.floor(e.y);break;case yo:e.y=e.y<0?0:1;break;case sS:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}}jr.DEFAULT_IMAGE=void 0;jr.DEFAULT_MAPPING=x7;jr.prototype.isTexture=!0;function Qx(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?ep.getDataURL(i):i.data?{data:Array.prototype.slice.call(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}class _i{constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.
4795y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,s;const l=e.elements,c=l[0],u=l[4],p=l[8],m=l[1],g=l[5],v=l[9],b=l[2],M=l[6],x=l[10];if(Math.abs(u-m)<.01&&Math.abs(p-b)<.01&&Math.abs(v-M)<.01){if(Math.abs(u+m)<.1&&Math.abs(p+b)<.1&&Math.abs(v+M)<.1&&Math.abs(c+g+x-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const R=(c+1)/2,C=(g+1)/2,N=(x+1)/2,D=(u+m)/4,P=(p+b)/4,O=(v+M)/4;return R>C&&R>N?R<.01?(n=0,r=.707106781,s=.707106781):(n=Math.sqrt(R),r=D/n,s=P/n):C>N?C<.01?(n=.707106781,r=0,s=.707106781):(r=Math.sqrt(C),n=D/r,s=O/r):N<.01?(n=.707106781,r=.707106781,s=0):(s=Math.sqrt(N),n=P/s,r=O/s),this.set(n,r,s,t),this}let w=Math.sqrt((M-v)*(M-v)+(p-b)*(p-b)+(m-u)*(m-u));return Math.abs(w)<.001&&(w=1),this.x=(M-v)/w,this.y=(p-b)/w,this.z=(m-u)/w,this.w=Math.acos((c+g+x-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}_i.prototype.isVector4=!0;class Go extends vh{constructor(e,t,n={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new _i(0,0,e,t),this.scissorTest=!1,this.viewport=new _i(0,0,e,t),this.texture=new jr(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.image={width:e,height:t,depth:1},this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.internalFormat=n.internalFormat!==void 0?n.internalFormat:null,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:ko,this.depthBuffer=n.depthBuffer!==void 0?n.depthBuffer:!0,this.stencilBuffer=n.stencilBuffer!==void 0?n.stencilBuffer:!1,this.depthTexture=n.depthTexture!==void 0?n.depthTexture:null}setTexture(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}setSize(e,t,n=1){(this.width!==e||this.height!==t||this.depth!==n)&&(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image={...this.texture.image},this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}Go.prototype.isWebGLRenderTarget=!0;class que extends Go{constructor(e,t,n){super(e,t);const r=this.texture;this.texture=[];for(let s=0;s<n;s++)this.texture[s]=r.clone()}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,s=this.texture.length;r<s;r++)this.texture[r].image.width=e,this.texture[r].image.height=t,this.texture[r].image.depth=n;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this.texture.length=0;for(let t=0,n=e.texture.length;t<n;t++)this.texture[t]=e.texture[t].clone();return this}}que.prototype.isWebGLMultipleRenderTargets=!0;class Gw extends Go{constructor(e,t,n={}){super(e,t,n),this.samples=4,this.ignoreDepthForMultisampleCopy=n.ignoreDepth!==void 0?n.ignoreDepth:!0,this.useRenderToTexture=n.useRenderToTexture!==void 0?n.useRenderToTexture:!1,this.useRenderbuffer=this.useRenderToTexture===!1}copy(e){return super.copy.call(this,e),this.samples=e.samples,this.useRenderToTexture=e.useRenderToTexture,this.useRenderbuffer=e.useRenderbuffer,this}}Gw.prototype.isWebGLMultisampleRenderTarget=!0;class js{constructor(e=0,t=0,n=0,r=1){this._x=e,this._y=t,this._z=n,this._w=r}static slerp(e,t,n,r){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),n.slerpQuaternions(e,t,r)}static slerpFlat(e,t,n,r,s,o,a){let l=n[r+0],c=n[r+1],u=n[r+2],p=n[r+3];const m=s[o+0],g=s[o+1],v=s[o+2],b=s[o+3];if(a===0){e[t+0]=l,e[t+1]=c,e[t+2]=u,e[t+3]=p;return}if(a===1){e[t+0]=m,e[t+1]=g,e[t+2]=v,e[t+3]=b;return}if(p!==b||l!==m||c!==g||u!==v){let M=1-a;const x=l*m+c*g+u*v+p*b,w=x>=0?1:-1,R=1-x*x;if(R>Number.EPSILON){const N=Math.sqrt(R),D=Math.atan2(N,x*w);M=Math.sin(M*D)/N,a=Math.sin(a*D)/N}const C=a*w;if(l=l*M+m*C,c=c*M+g*C,u=u*M+v*C,p=p*M+b*C,M===1-a){const N=1/Math.sqrt(l*l+c*c+u*u+p*p);l*=N,c*=N,u*=N,p*=N}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=p}static multiplyQuaternionsFlat(e,t,n,r,s,o){const a=n[r],l=n[r+1
vendor: 29,865 bytes, line 4795
4795],c=n[r+2],u=n[r+3],p=s[o],m=s[o+1],g=s[o+2],v=s[o+3];return e[t]=a*v+u*p+l*g-c*m,e[t+1]=l*v+u*m+c*p-a*g,e[t+2]=c*v+u*g+a*m-l*p,e[t+3]=u*v-a*p-l*m-c*g,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(r/2),p=a(s/2),m=l(n/2),g=l(r/2),v=l(s/2);switch(o){case"XYZ":this._x=m*u*p+c*g*v,this._y=c*g*p-m*u*v,this._z=c*u*v+m*g*p,this._w=c*u*p-m*g*v;break;case"YXZ":this._x=m*u*p+c*g*v,this._y=c*g*p-m*u*v,this._z=c*u*v-m*g*p,this._w=c*u*p+m*g*v;break;case"ZXY":this._x=m*u*p-c*g*v,this._y=c*g*p+m*u*v,this._z=c*u*v+m*g*p,this._w=c*u*p-m*g*v;break;case"ZYX":this._x=m*u*p-c*g*v,this._y=c*g*p+m*u*v,this._z=c*u*v-m*g*p,this._w=c*u*p+m*g*v;break;case"YZX":this._x=m*u*p+c*g*v,this._y=c*g*p+m*u*v,this._z=c*u*v-m*g*p,this._w=c*u*p-m*g*v;break;case"XZY":this._x=m*u*p-c*g*v,this._y=c*g*p-m*u*v,this._z=c*u*v+m*g*p,this._w=c*u*p+m*g*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],p=t[10],m=n+a+p;if(m>0){const g=.5/Math.sqrt(m+1);this._w=.25/g,this._x=(u-l)*g,this._y=(s-c)*g,this._z=(o-r)*g}else if(n>a&&n>p){const g=2*Math.sqrt(1+n-a-p);this._w=(u-l)/g,this._x=.25*g,this._y=(r+o)/g,this._z=(s+c)/g}else if(a>p){const g=2*Math.sqrt(1+a-n-p);this._w=(s-c)/g,this._x=(r+o)/g,this._y=.25*g,this._z=(l+u)/g}else{const g=2*Math.sqrt(1+p-n-a);this._w=(o-r)/g,this._x=(s+c)/g,this._y=(l+u)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(_o(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+r*c-s*l,this._y=r*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-r*a,this._w=o*u-n*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+n*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),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 g=1-t;return this._w=g*o+t*this._w,this._x=g*n+t*this._x,this._y=g*r+t*this._y,this._z=g*s+t*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),p=Math.sin((1-t)*u)/c,m=Math.sin(t*u)/c;return this._w=o*p+this._w*m,this._x=n*p+this._x*m,this._y=r*p+this._y*m,this._z=s*p+this._z*m,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),r=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(r),n*Math.sin(s),n*Math.cos(s),t*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}js.prototype.isQuaternion=!0;class _e{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(w4.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(w4.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*r,this.y=s[1]*t+s[4]*n+s[7]*r,this.z=s[2]*t+s[5]*n+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*r-a*n,u=l*n+a*t-s*r,p=l*r+s*n-o*t,m=-s*t-o*n-a*r;return this.x=c*l+m*-s+u*-a-p*-o,this.y=u*l+m*-o+p*-s-c*-a,this.z=p*l+m*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r,this.y=s[1]*t+s[5]*n+s[9]*r,this.z=s[2]*t+s[6]*n+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-n*l,this.z=n*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Zx.copy(this).projectOnVector(e),this.sub(Zx)}reflect(e){return this.sub(Zx.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(_o(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}_e.prototype.isVector3=!0;const Zx=new _e,w4=new js;class ba{constructor(e=new _e(1/0,1/0,1/0),t=new _e(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,r=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;l<c;l+=3){const u=e[l],p=e[l+1],m=e[l+2];u<t&&(t=u),p<n&&(n=p),m<r&&(r=m),u>s&&(s=u),p>o&&(o=p),m>a&&(a=m)}return this.min.set(t,n,r),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,r=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;l<c;l++){const u=e.getX(l),p=e.getY(l),m=e.getZ(l);u<t&&(t=u),p<n&&(n=p),m<r&&(r=m),u>s&&(s=u),p>o&&(o=p),m>a&&(a=m)}return this.min.set(t,n,r),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=$p.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e){return this.makeEmpty(),this.expandByObject(e)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){e.updateWorldMatrix(!1,!1);const t=e.geometry;t!==void 0&&(t.boundingBox===null&&t.computeBoundingBox(),Kx.copy(t.boundingBox),Kx.applyMatrix4(e.matrixWorld),this.union(Kx));const n=e.children;for(let r=0,s=n.length;r<s;r++)this.expandByObject(n[r]);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,$p),$p.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(jp),Rg.subVectors(this.max,jp),ad.subVectors(e.a,jp),ld.subVectors(e.b,jp),cd.subVectors(e.c,jp),fc.subVectors(ld,ad),pc.subVectors(cd,ld),Mu.subVectors(ad,cd);let t=[0,-fc.z,fc.y,0,-pc.z,pc.y,0,-Mu.z,Mu.y,fc.z,0,-fc.x,pc.z,0,-pc.x,Mu.z,0,-Mu.x,-fc.y,fc.x,0,-pc.y,pc.x,0,-Mu.y,Mu.x,0];return!Jx(t,ad,ld,cd,Rg)||(t=[1,0,0,0,1,0,0,0,1],!Jx(t,ad,ld,cd,Rg))?!1:(Cg.crossVectors(fc,pc),t=[Cg.x,Cg.y,Cg.z],Jx(t,ad,ld,cd,Rg))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return $p.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize($p).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ml[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ml[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ml[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ml[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ml[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ml[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ml[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ml[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ml),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}ba.prototype.isBox3=!0;const ml=[new _e,new _e,new _e,new _e,new _e,new _e,new _e,new _e],$p=new _e,Kx=new ba,ad=new _e,ld=new _e,cd=new _e,fc=new _e,pc=new _e,Mu=new _e,jp=new _e,Rg=new _e,Cg=new _e,wu=new _e;function Jx(i,e,t,n,r){for(let s=0,o=i.length-3;s<=o;s+=3){wu.fromArray(i,s);const a=r.x*Math.abs(wu.x)+r.y*Math.abs(wu.y)+r.z*Math.abs(wu.z),l=e.dot(wu),c=t.dot(wu),u=n.dot(wu);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const Hue=new ba,T4=new _e,e2=new _e,t2=new _e;class tp{constructor(e=new _e,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):Hue.setFromPoints(e).getCenter(n);let r=0;for(let s=0,o=e.length;s<o;s++)r=Math.max(r,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){t2.subVectors(e,this.center);const t=t2.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),r=(n-this.radius)*.5;this.center.add(t2.multiplyScalar(r/n)),this.radius+=r}return this}union(e){return e2.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(T4.copy(e.center).add(e2)),this.expandByPoint(T4.copy(e.center).sub(e2)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const gl=new _e,n2=new _e,Pg=new _e,Ac=new _e,i2=new _e,Lg=new _e,r2=new _e;class np{constructor(e=new _e,t=new _e(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,gl)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=gl.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(gl.copy(this.direction).multiplyScalar(t).add(this.origin),gl.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){n2.copy(e).add(t).multiplyScalar(.5),Pg.copy(t).sub(e).normalize(),Ac.copy(this.origin).sub(n2);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Pg),a=Ac.dot(this.direction),l=-Ac.dot(Pg),c=Ac.lengthSq(),u=Math.abs(1-o*o);let p,m,g,v;if(u>0)if(p=o*l-a,m=o*a-l,v=s*u,p>=0)if(m>=-v)if(m<=v){const b=1/u;p*=b,m*=b,g=p*(p+o*m+2*a)+m*(o*p+m+2*l)+c}else m=s,p=Math.max(0,-(o*m+a)),g=-p*p+m*(m+2*l)+c;else m=-s,p=Math.max(0,-(o*m+a)),g=-p*p+m*(m+2*l)+c;else m<=-v?(p=Math.max(0,-(-o*s+a)),m=p>0?-s:Math.min(Math.max(-s,-l),s),g=-p*p+m*(m+2*l)+c):m<=v?(p=0,m=Math.min(Math.max(-s,-l),s),g=m*(m+2*l)+c):(p=Math.max(0,-(o*s+a)),m=p>0?s:Math.min(Math.max(-s,-l),s),g=-p*p+m*(m+2*l)+c);else m=o>0?-s:s,p=Math.max(0,-(o*m+a)),g=-p*p+m*(m+2*l)+c;return n&&n.copy(this.direction).multiplyScalar(p).add(this.origin),r&&r.copy(Pg).multiplyScalar(m).add(n2),g}intersectSphere(e,t){gl.subVectors(e.center,this.origin);const n=gl.dot(this.direction),r=gl.dot(gl)-n*n,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,p=1/this.direction.z,m=this.origin;return c>=0?(n=(e.min.x-m.x)*c,r=(e.max.x-m.x)*c):(n=(e.max.x-m.x)*c,r=(e.min.x-m.x)*c),u>=0?(s=(e.min.y-m.y)*u,o=(e.max.y-m.y)*u):(s=(e.max.y-m.y)*u,o=(e.min.y-m.y)*u),n>o||s>r||((s>n||n!==n)&&(n=s),(o<r||r!==r)&&(r=o),p>=0?(a=(e.min.z-m.z)*p,l=(e.max.z-m.z)*p):(a=(e.max.z-m.z)*p,l=(e.min.z-m.z)*p),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,t)}intersectsBox(e){return this.intersectBox(e,gl)!==null}intersectTriangle(e,t,n,r,s){i2.subVectors(t,e),Lg.subVectors(n,e),r2.crossVectors(i2,Lg);let o=this.direction.dot(r2),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Ac.subVectors(this.origin,e);const l=a*this.direction.dot(Lg.crossVectors(Ac,Lg));if(l<0)return null;const c=a*this.direction.dot(i2.cross(Ac));if(c<0||l+c>o)return null;const u=-a*Ac.dot(r2);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class ln{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,r,s,o,a,l,c,u,p,m,g,v,b,M){const x=this.elements;return x[0]=e,x[4]=t,x[8]=n,x[12]=r,x[1]=s,x[5]=o,x[9]=a,x[13]=l,x[2]=c,x[6]=u,x[10]=p,x[14]=m,x[3]=g,x[7]=v,x[11]=b,x[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 ln().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/ud.setFromMatrixColumn(e,0).length(),s=1/ud.setFromMatrixColumn(e,1).length(),o=1/ud.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,n=e.x,r=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),p=Math.sin(s);if(e.order==="XYZ"){const m=o*u,g=o*p,v=a*u,b=a*p;t[0]=l*u,t[4]=-l*p,t[8]=c,t[1]=g+v*c,t[5]=m-b*c,t[9]=-a*l,t[2]=b-m*c,t[6]=v+g*c,t[10]=o*l}else if(e.order==="YXZ"){const m=l*u,g=l*p,v=c*u,b=c*p;t[0]=m+b*a,t[4]=v*a-g,t[8]=o*c,t[1]=o*p,t[5]=o*u,t[9]=-a,t[2]=g*a-v,t[6]=b+m*a,t[10]=o*l}else if(e.order==="ZXY"){const m=l*u,g=l*p,v=c*u,b=c*p;t[0]=m-b*a,t[4]=-o*p,t[8]=v+g*a,t[1]=g+v*a,t[5]=o*u,t[9]=b-m*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const m=o*u,g=o*p,v=a*u,b=a*p;t[0]=l*u,t[4]=v*c-g,t[8]=m*c+b,t[1]=l*p,t[5]=b*c+m,t[9]=g*c-v,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const m=o*l,g=o*c,v=a*l,b=a*c;t[0]=l*u,t[4]=b-m*p,t[8]=v*p+g,t[1]=p,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=g*p+v,t[10]=m-b*p}else if(e.order==="XZY"){const m=o*l,g=o*c,v=a*l,b=a*c;t[0]=l*u,t[4]=-p,t[8]=c*u,t[1]=m*p+b,t[5]=o*u,t[9]=g*p-v,t[2]=v*p-g,t[6]=a*u,t[10]=b*p+m}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Wue,e,$ue)}lookAt(e,t,n){const r=this.elements;return lo.subVectors(e,t),lo.lengthSq()===0&&(lo.z=1),lo.normalize(),mc.crossVectors(n,lo),mc.lengthSq()===0&&(Math.abs(n.z)===1?lo.x+=1e-4:lo.z+=1e-4,lo.normalize(),mc.crossVectors(n,lo)),mc.normalize(),Ng.crossVectors(lo,mc),r[0]=mc.x,r[4]=Ng.x,r[8]=lo.x,r[1]=mc.y,r[5]=Ng.y,r[9]=lo.y,r[2]=mc.z,r[6]=Ng.z,r[10]=lo.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],p=n[5],m=n[9],g=n[13],v=n[2],b=n[6],M=n[10],x=n[14],w=n[3],R=n[7],C=n[11],N=n[15],D=r[0],P=r[4],O=r[8],I=r[12],F=r[1],k=r[5],Y=r[9],W=r[13],Q=r[2],J=r[6],H=r[10],$=r[14],K=r[3],he=r[7],ie=r[11],de=r[15];return s[0]=o*D+a*F+l*Q+c*K,s[4]=o*P+a*k+l*J+c*he,s[8]=o*O+a*Y+l*H+c*ie,s[12]=o*I+a*W+l*$+c*de,s[1]=u*D+p*F+m*Q+g*K,s[5]=u*P+p*k+m*J+g*he,s[9]=u*O+p*Y+m*H+g*ie,s[13]=u*I+p*W+m*$+g*de,s[2]=v*D+b*F+M*Q+x*K,s[6]=v*P+b*k+M*J+x*he,s[10]=v*O+b*Y+M*H+x*ie,s[14]=v*I+b*W+M*$+x*de,s[3]=w*D+R*F+C*Q+N*K,s[7]=w*P+R*k+C*J+N*he,s[11]=w*O+R*Y+C*H+N*ie,s[15]=w*I+R*W+C*$+N*de,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],p=e[6],m=e[10],g=e[14],v=e[3],b=e[7],M=e[11],x=e[15];return v*(+s*l*p-r*c*p-s*a*m+n*c*m+r*a*g-n*l*g)+b*(+t*l*g-t*c*m+s*o*m-r*o*g+r*c*u-s*l*u)+M*(+t*c*p-t*a*g-s*o*p+n*o*g+s*a*u-n*c*u)+x*(-r*a*u-t*l*p+t*a*m+r*o*p-n*o*m+n*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],p=e[9],m=e[10],g=e[11],v=e[12],b=e[13],M=e[14],x=e[15],w=p*M*c-b*m*c+b*l*g-a*M*g-p*l*x+a*m*x,R=v*m*c-u*M*c-v*l*g+o*M*g+u*l*x-o*m*x,C=u*b*c-v*p*c+v*a*g-o*b*g-u*a*x+o*p*x,N=v*p*l-u*b*l-v*a*m+o*b*m+u*a*M-o*p*M,D=t*w+n*R+r*C+s*N;if(D===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/D;return e[0]=w*P,e[1]=(b*m*s-p*M*s-b*r*g+n*M*g+p*r*x-n*m*x)*P,e[2]=(a*M*s-b*l*s+b*r*c-n*M*c-a*r*x+n*l*x)*P,e[3]=(p*l*s-a*m*s-p*r*c+n*m*c+a*r*g-n*l*g)*P,e[4]=R*P,e[5]=(u*M*s-v*m*s+v*r*g-t*M*g-u*r*x+t*m*x)*P,e[6]=(v*l*s-o*M*s-v*r*c+t*M*c+o*r*x-t*l*x)*P,e[7]=(o*m*s-u*l*s+u*r*c-t*m*c-o*r*g+t*l*g)*P,e[8]=C*P,e[9]=(v*p*s-u*b*s-v*n*g+t*b*g+u*n*x-t*p*x)*P,e[10]=(o*b*s-v*a*s+v*n*c-t*b*c-o*n*x+t*a*x)*P,e[11]=(u*a*s-o*p*s-u*n*c+t*p*c+o*n*g-t*a*g)*P,e[12]=N*P,e[13]=(u*b*r-v*p*r+v*n*m-t*b*m-u*n*M+t*p*M)*P,e[14]=(v*a*r-o*b*r-v*n*l+t*b*l+o*n*M-t*a*M)*P,e[15]=(o*p*r-u*a*r+u*n*l-t*p*l-o*n*m+t*a*m)*P,this}scale(e){const t=this.elements,n=e.x,r=e.y,s=e.z;return t[0]*=n,t[4]*=r,t[8]*=s,t[1]*=n,t[5]*=r,t[9]*=s,t[2]*=n,t[6]*=r,t[10]*=s,t[3]*=n,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),s=1-n,o=e.x,a=e.
vendor: 5,224 bytes, line 4795
4795y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-r*l,c*l+r*a,0,c*a+r*l,u*a+n,u*l-r*o,0,c*l-r*a,u*l+r*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,s,o){return this.set(1,n,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,p=a+a,m=s*c,g=s*u,v=s*p,b=o*u,M=o*p,x=a*p,w=l*c,R=l*u,C=l*p,N=n.x,D=n.y,P=n.z;return r[0]=(1-(b+x))*N,r[1]=(g+C)*N,r[2]=(v-R)*N,r[3]=0,r[4]=(g-C)*D,r[5]=(1-(m+x))*D,r[6]=(M+w)*D,r[7]=0,r[8]=(v+R)*P,r[9]=(M-w)*P,r[10]=(1-(m+b))*P,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let s=ud.set(r[0],r[1],r[2]).length();const o=ud.set(r[4],r[5],r[6]).length(),a=ud.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],ea.copy(this);const c=1/s,u=1/o,p=1/a;return ea.elements[0]*=c,ea.elements[1]*=c,ea.elements[2]*=c,ea.elements[4]*=u,ea.elements[5]*=u,ea.elements[6]*=u,ea.elements[8]*=p,ea.elements[9]*=p,ea.elements[10]*=p,t.setFromRotationMatrix(ea),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,r,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,l=2*s/(t-e),c=2*s/(n-r),u=(t+e)/(t-e),p=(n+r)/(n-r),m=-(o+s)/(o-s),g=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=p,a[13]=0,a[2]=0,a[6]=0,a[10]=m,a[14]=g,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,r,s,o){const a=this.elements,l=1/(t-e),c=1/(n-r),u=1/(o-s),p=(t+e)*l,m=(n+r)*c,g=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-p,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-m,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-g,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}ln.prototype.isMatrix4=!0;const ud=new _e,ea=new ln,Wue=new _e(0,0,0),$ue=new _e(1,1,1),mc=new _e,Ng=new _e,lo=new _e,E4=new ln,R4=new js;class ip{constructor(e=0,t=0,n=0,r=ip.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],u=r[9],p=r[2],m=r[6],g=r[10];switch(t){case"XYZ":this._y=Math.asin(_o(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,g),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(m,c),this._z=0);break;case"YXZ":this._x=Math.asin(-_o(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,g),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-p,s),this._z=0);break;case"ZXY":this._x=Math.asin(_o(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-p,g),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-_o(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(m,g),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(_o(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-p,s)):(this._x=0,this._y=Math.atan2(a,g));break;case"XZY":this._z=Math.asin(-_o(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(m,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return E4.makeRotationFromQuaternion(e),this.setFromRotationMatrix(E4,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return R4.setFromEuler(this),this.setFromQuaternion(R4,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new _e(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}ip.prototype.isEuler=!0;ip.DefaultOrder="XYZ";ip.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class jue{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}
vendor: 20,744 bytes, line 4795
4795isEnabled(e){return(this.mask&(1<<e|0))!==0}}let Xue=0;const C4=new _e,hd=new js,_l=new ln,Dg=new _e,Xp=new _e,Yue=new _e,Que=new js,P4=new _e(1,0,0),L4=new _e(0,1,0),N4=new _e(0,0,1),Zue={type:"added"},D4={type:"removed"};class li extends vh{constructor(){super(),Object.defineProperty(this,"id",{value:Xue++}),this.uuid=ja(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=li.DefaultUp.clone();const e=new _e,t=new ip,n=new js,r=new _e(1,1,1);function s(){n.setFromEuler(t,!1)}function o(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new ln},normalMatrix:{value:new $r}}),this.matrix=new ln,this.matrixWorld=new ln,this.matrixAutoUpdate=li.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new jue,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return hd.setFromAxisAngle(e,t),this.quaternion.multiply(hd),this}rotateOnWorldAxis(e,t){return hd.setFromAxisAngle(e,t),this.quaternion.premultiply(hd),this}rotateX(e){return this.rotateOnAxis(P4,e)}rotateY(e){return this.rotateOnAxis(L4,e)}rotateZ(e){return this.rotateOnAxis(N4,e)}translateOnAxis(e,t){return C4.copy(e).applyQuaternion(this.quaternion),this.position.add(C4.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(P4,e)}translateY(e){return this.translateOnAxis(L4,e)}translateZ(e){return this.translateOnAxis(N4,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(_l.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Dg.copy(e):Dg.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Xp.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?_l.lookAt(Xp,Dg,this.up):_l.lookAt(Dg,Xp,this.up),this.quaternion.setFromRotationMatrix(_l),r&&(_l.extractRotation(r.matrixWorld),hd.setFromRotationMatrix(_l),this.quaternion.premultiply(hd.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(Zue)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(D4)),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(D4)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),_l.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),_l.multiply(e.parent.matrixWorld)),e.applyMatrix4(_l),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const o=this.children[n].getObjectByProperty(e,t);if(o!==void 0)return o}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Xp,e,Yue),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Xp,Que,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0){const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},n.metadata={version:4.5,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),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.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()));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.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,u=l.length;c<u;c++){const p=l[c];s(e.shapes,p)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.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(e.materials,this.material[l]));r.material=a}else r.material=s(e.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(e).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(e.animations,l))}}if(t){const a=o(e.geometries),l=o(e.materials),c=o(e.textures),u=o(e.images),p=o(e.shapes),m=o(e.skeletons),g=o(e.animations);a.length>0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),p.length>0&&(n.shapes=p),m.length>0&&(n.skeletons=m),g.length>0&&(n.animations=g)}return n.object=r,n;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const r=e.children[n];this.add(r.clone())}return this}}li.DefaultUp=new _e(0,1,0);li.DefaultMatrixAutoUpdate=!0;li.prototype.isObject3D=!0;const ta=new _e,vl=new _e,s2=new _e,yl=new _e,dd=new _e,fd=new _e,I4=new _e,o2=new _e,a2=new _e,l2=new _e;class yr{constructor(e=new _e,t=new _e,n=new _e){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),ta.subVectors(e,t),r.cross(ta);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,n,r,s){ta.subVectors(r,t),vl.subVectors(n,t),s2.subVectors(e,t);const o=ta.dot(ta),a=ta.dot(vl),l=ta.dot(s2),c=vl.dot(vl),u=vl.dot(s2),p=o*c-a*a;if(p===0)return s.set(-2,-1,-1);const m=1/p,g=(c*l-a*u)*m,v=(o*u-a*l)*m;return s.set(1-g-v,v,g)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,yl),yl.x>=0&&yl.y>=0&&yl.x+yl.y<=1}static getUV(e,t,n,r,s,o,a,l){return this.getBarycoord(e,t,n,r,yl),l.set(0,0),l.addScaledVector(s,yl.x),l.addScaledVector(o,yl.y),l.addScaledVector(a,yl.z),l}static isFrontFacing(e,t,n,r){return ta.subVectors(n,t),vl.subVectors(e,t),ta.cross(vl).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return ta.subVectors(this.c,this.b),vl.subVectors(this.a,this.b),ta.cross(vl).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return yr.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return yr.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,s){return yr.getUV(e,this.a,this.b,this.c,t,n,r,s)}containsPoint(e){return yr.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return yr.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,s=this.c;let o,a;dd.subVectors(r,n),fd.subVectors(s,n),o2.subVectors(e,n);const l=dd.dot(o2),c=fd.dot(o2);if(l<=0&&c<=0)return t.copy(n);a2.subVectors(e,r);const u=dd.dot(a2),p=fd.dot(a2);if(u>=0&&p<=u)return t.copy(r);const m=l*p-u*c;if(m<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(dd,o);l2.subVectors(e,s);const g=dd.dot(l2),v=fd.dot(l2);if(v>=0&&g<=v)return t.copy(s);const b=g*c-l*v;if(b<=0&&c>=0&&v<=0)return a=c/(c-v),t.copy(n).addScaledVector(fd,a);const M=u*v-g*p;if(M<=0&&p-u>=0&&g-v>=0)return I4.subVectors(s,r),a=(p-u)/(p-u+(g-v)),t.copy(r).addScaledVector(I4,a);const x=1/(M+b+m);return o=b*x,a=m*x,t.copy(n).addScaledVector(dd,o).addScaledVector(fd,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let Kue=0;class fs extends vh{constructor(){super(),Object.defineProperty(this,"id",{value:Kue++}),this.uuid=ja(),this.name="",this.type="Material",this.fog=!0,this.blending=CA,this.side=v0,this.vertexColors=!1,this.opacity=1,this.format=Ts,this.transparent=!1,this.blendSrc=v7,this.blendDst=y7,this.blendEquation=Rd,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=tS,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=kue,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=jx,this.stencilZFail=jx,this.stencilZPass=jx,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.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===_7;continue}const r=this[t];if(r===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.5,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&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(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!==CA&&(n.blending=this.blending),this.side!==v0&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.format!==Ts&&(n.format=this.format),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&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&&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.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),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=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(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(t){const s=r(e.textures),o=r(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.format=e.format,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const r=t.length;n=new Array(r);for(let s=0;s!==r;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipSh
4795adows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}fs.prototype.isMaterial=!0;const E7={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},na={h:0,s:0,l:0},Ig={h:0,s:0,l:0};function c2(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}function u2(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function h2(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}class en{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=zue(e,1),t=_o(t,0,1),n=_o(n,0,1),t===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,s=2*n-r;this.r=c2(s,r,e+1/3),this.g=c2(s,r,e),this.b=c2(s,r,e-1/3)}return this}setStyle(e){function t(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let r;const s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[4]),this;if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[4]),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){const a=parseFloat(r[1])/360,l=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return t(r[4]),this.setHSL(a,l,c)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=n[1],s=r.length;if(s===3)return this.r=parseInt(r.charAt(0)+r.charAt(0),16)/255,this.g=parseInt(r.charAt(1)+r.charAt(1),16)/255,this.b=parseInt(r.charAt(2)+r.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(r.charAt(0)+r.charAt(1),16)/255,this.g=parseInt(r.charAt(2)+r.charAt(3),16)/255,this.b=parseInt(r.charAt(4)+r.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=E7[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){const n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=u2(e.r),this.g=u2(e.g),this.b=u2(e.b),this}copyLinearToSRGB(e){return this.r=h2(e.r),this.g=h2(e.g),this.b=h2(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){const t=this.r,n=this.g,r=this.b,s=Math.max(t,n,r),o=Math.min(t,n,r);let a,l;const c=(o+s)/2;if(o===s)a=0,l=0;else{const u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(n-r)/u+(n<r?6:0);break;case n:a=(r-t)/u+2;break;case r:a=(t-n)/u+4;break}a/=6}return e.h=a,e.s=l,e.l=c,e}getStyle(){return"rgb("+(this.r*255|0)+","+(this.g*255|0)+","+(this.b*255|0)+")"}offsetHSL(e,t,n){return this.getHSL(na),na.h+=e,na.s+=t,na.l+=n,this.setHSL(na.h,na.s,na.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}
vendor: 4,821 bytes, line 4795
4795lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(na),e.getHSL(Ig);const n=Yx(na.h,Ig.h,t),r=Yx(na.s,Ig.s,t),s=Yx(na.l,Ig.l,t);return this.setHSL(n,r,s),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),e.normalized===!0&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}en.NAMES=E7;en.prototype.isColor=!0;en.prototype.r=1;en.prototype.g=1;en.prototype.b=1;class qw extends fs{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new en(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.combine=Sv,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}qw.prototype.isMeshBasicMaterial=!0;const yi=new _e,Bg=new Mt;class br{constructor(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n===!0,this.usage=x0,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}copyColorsArray(e){const t=this.array;let n=0;for(let r=0,s=e.length;r<s;r++){let o=e[r];o===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),o=new en),t[n++]=o.r,t[n++]=o.g,t[n++]=o.b}return this}copyVector2sArray(e){const t=this.array;let n=0;for(let r=0,s=e.length;r<s;r++){let o=e[r];o===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),o=new Mt),t[n++]=o.x,t[n++]=o.y}return this}copyVector3sArray(e){const t=this.array;let n=0;for(let r=0,s=e.length;r<s;r++){let o=e[r];o===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),o=new _e),t[n++]=o.x,t[n++]=o.y,t[n++]=o.z}return this}copyVector4sArray(e){const t=this.array;let n=0;for(let r=0,s=e.length;r<s;r++){let o=e[r];o===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),o=new _i),t[n++]=o.x,t[n++]=o.y,t[n++]=o.z,t[n++]=o.w}return this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Bg.fromBufferAttribute(this,t),Bg.applyMatrix3(e),this.setXY(t,Bg.x,Bg.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)yi.fromBufferAttribute(this,t),yi.applyMatrix3(e),this.setXYZ(t,yi.x,yi.y,yi.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)yi.x=this.getX(t),yi.y=this.getY(t),yi.z=this.getZ(t),yi.applyMatrix4(e),this.setXYZ(t,yi.x,yi.y,yi.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)yi.x=this.getX(t),yi.y=this.getY(t),yi.z=this.getZ(t),yi.applyNormalMatrix(e),this.setXYZ(t,yi.x,yi.y,yi.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)yi.x=this.getX(t),yi.y=this.getY(t),yi.z=this.getZ(t),yi.transformDirection(e),this.setXYZ(t,yi.x,yi.y,yi.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){return this.array[e*this.itemSize]}setX(e,t){return this.array[e*this.itemSize]=t,this}getY(e){return this.array[e*this.itemSize+1]}setY(e,t){return this.array[e*this.itemSize+1]=t,this}getZ(e){return this.array[e*this.itemSize+2]}setZ(e,t){return this.array[e*this.itemSize+2]=t,this}getW(e){return this.array[e*this.itemSize+3]}setW(e,t){return this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}
4795setXYZW(e,t,n,r,s){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==x0&&(e.usage=this.usage),(this.updateRange.offset!==0||this.updateRange.count!==-1)&&(e.updateRange=this.updateRange),e}}br.prototype.isBufferAttribute=!0;class R7 extends br{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class C7 extends br{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Jue extends br{constructor(e,t,n){super(new Uint16Array(e),t,n)}}Jue.prototype.isFloat16BufferAttribute=!0;class Or extends br{constructor(e,t,n){super(new Float32Array(e),t,n)}}let ehe=0;const Po=new ln,d2=new li,pd=new _e,co=new ba,Yp=new ba,Lr=new _e;class Fi extends vh{constructor(){super(),Object.defineProperty(this,"id",{value:ehe++}),this.uuid=ja(),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(e){return Array.isArray(e)?this.index=new(T7(e)>65535?C7:R7)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new $r().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Po.makeRotationFromQuaternion(e),this.applyMatrix4(Po),this}rotateX(e){return Po.makeRotationX(e),this.applyMatrix4(Po),this}rotateY(e){return Po.makeRotationY(e),this.applyMatrix4(Po),this}rotateZ(e){return Po.makeRotationZ(e),this.applyMatrix4(Po),this}translate(e,t,n){return Po.makeTranslation(e,t,n),this.applyMatrix4(Po),this}scale(e,t,n){return Po.makeScale(e,t,n),this.applyMatrix4(Po),this}lookAt(e){return d2.lookAt(e),d2.updateMatrix(),this.applyMatrix4(d2.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(pd).negate(),this.translate(pd.x,pd.y,pd.z),this}setFromPoints(e){const t=[];for(let n=0,r=e.length;n<r;n++){const s=e[n];t.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Or(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ba);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "fal
4795se".',this),this.boundingBox.set(new _e(-1/0,-1/0,-1/0),new _e(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const s=t[n];co.setFromBufferAttribute(s),this.morphTargetsRelative?(Lr.addVectors(this.boundingBox.min,co.min),this.boundingBox.expandByPoint(Lr),Lr.addVectors(this.boundingBox.max,co.max),this.boundingBox.expandByPoint(Lr)):(this.boundingBox.expandByPoint(co.min),this.boundingBox.expandByPoint(co.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 tp);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "fal
4795se".',this),this.boundingSphere.set(new _e,1/0);return}if(e){const n=this.boundingSphere.center;if(co.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const a=t[s];Yp.setFromBufferAttribute(a),this.morphTargetsRelative?(Lr.addVectors(co.min,Yp.min),co.expandByPoint(Lr),Lr.addVectors(co.max,Yp.max),co.expandByPoint(Lr)):(co.expandByPoint(Yp.min),co.expandByPoint(Yp.max))}co.getCenter(n);let r=0;for(let s=0,o=e.count;s<o;s++)Lr.fromBufferAttribute(e,s),r=Math.max(r,n.distanceToSquared(Lr));if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s],l=this.morphTargetsRelative;for(let c=0,u=a.count;c<u;c++)Lr.fromBufferAttribute(a,c),l&&(pd.fromBufferAttribute(e,c),Lr.add(pd)),r=Math.max(r,n.distanceToSquared(Lr))}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 e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=e.array,r=t.position.array,s=t.normal.array,o=t.uv.array,a=r.length/3;t.tangent===void 0&&this.setAttribute("tangent",new br(new Float32Array(4*a),4));const l=t.tangent.array,c=[],u=[];for(let F=0;F<a;F++)c[F]=new _e,u[F]=new _e;const p=new _e,m=new _e,g=new _e,v=new Mt,b=new Mt,M=new Mt,x=new _e,w=new _e;function R(F,k,Y){p.fromArray(r,F*3),m.fromArray(r,k*3),g.fromArray(r,Y*3),v.fromArray(o,F*2),b.fromArray(o,k*2),M.fromArray(o,Y*2),m.sub(p),g.sub(p),b.sub(v),M.sub(v);const W=1/(b.x*M.y-M.x*b.y);isFinite(W)&&(x.copy(m).multiplyScalar(M.y).addScaledVector(g,-b.y).multiplyScalar(W),w.copy(g).multiplyScalar(b.x).addScaledVector(m,-M.x).multiplyScalar(W),c[F].add(x),c[k].add(x),c[Y].add(x),u[F].add(w),u[k].add(w),u[Y].add(w))}let C=this.groups;C.length===0&&(C=[{start:0,count:n.length}]);for(let F=0,k=C.length;F<k;++F){const Y=C[F],W=Y.start,Q=Y.count;for(let J=W,H=W+Q;J<H;J+=3)R(n[J+0],n[J+1],n[J+2])}const N=new _e,D=new _e,P=new _e,O=new _e;function I(F){P.fromArray(s,F*3),O.copy(P);const k=c[F];N.copy(k),N.sub(P.multiplyScalar(P.dot(k))).normalize(),D.crossVectors(O,k);const W=D.dot(u[F])<0?-1:1;l[F*4]=N.x,l[F*4+1]=N.y,l[F*4+2]=N.z,l[F*4+3]=W}for(let F=0,k=C.length;F<k;++F){const Y=C[F],W=Y.start,Q=Y.count;for(let J=W,H=W+Q;J<H;J+=3)I(n[J+0]),I(n[J+1]),I(n[J+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new br(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let m=0,g=n.count;m<g;m++)n.setXYZ(m,0,0,0);const r=new _e,s=new _e,o=new _e,a=new _e,l=new _e,c=new _e,u=new _e,p=new _e;if(e)for(let m=0,g=e.count;m<g;m+=3){const v=e.getX(m+0),b=e.getX(m+1),M=e.getX(m+2);r.fromBufferAttribute(t,v),s.fromBufferAttribute(t,b),o.fromBufferAttribute(t,M),u.subVectors(o,s),p.subVectors(r,s),u.cross(p),a.fromBufferAttribute(n,v),l.fromBufferAttribute(n,b),c.fromBufferAttribute(n,M),a.add(u),l.add(u),c.add(u),n.setXYZ(v,a.x,a.y,a.z),n.setXYZ(b,l.x,l.y,l.z),n.setXYZ(M,c.x,c.y,c.z)}else for(let m=0,g=t.count;m<g;m+=3)r.fromBufferAttribute(t,m+0),s.fromBufferAttribute(t,m+1),o.fromBufferAttribute(t,m+2),u.subVectors(o,s),p.subVectors(r,s),u.cross(p),n.setXYZ(m+0,u.x,u.y,u.z),n.setXYZ(m+1,u.x,u.y,u.z),n.setXYZ(m+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(e,t){if(!(e&&e.isBufferGeometry)){console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);return}t===void 0&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const n=this.attributes;for(const r in n){if(e.attributes[r]===void 0)continue;const o=n[r].array,a=e.attributes[r],l=a.array,c=a.itemSize*t,u=Math.min(l.length,o.length-c);for(let p=0,m=c;p<u;p++,m++)o[m]=l[p]}return this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Lr.fromBufferAttribute(e,t),Lr.normalize(),e.setXYZ(t,Lr.x,Lr.y,Lr.z)}toNonIndexed(){function e(a,l){const c=a.array,u=a.itemSize,p=a.normalized,m=new c.constructor(l.length*u);let g=0,v=0;for(let b=0,M=l.length;b<M;b++){a.isInterleavedBufferAttribute?g=l[b]*a.data.stride+a.offset:g=l[b]*u;for(let x=0;x<u;x++)m[v++]=c[g++]}return new br(m,u,p)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Fi,n=this.index.array,r=this.attributes;for(const a in r){const l=r[a],c=e(l,n);t.setAttribute(a,c)}const s=this.morphAttributes;for(const a in s){const l=[],c=s[a];for(let u=0,p=c.length;u<p;u++){const m=c[u],g=e(m,n);l.push(g)}t.morphAttributes[a]=l}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,l=o.length;a<l;a++){const c=o[a];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};
vendor: 11,411 bytes, lines 4795-4799
4795if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let p=0,m=c.length;p<m;p++){const g=c[p];u.push(g.toJSON(e.data))}u.length>0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone(t));const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],p=s[c];for(let m=0,g=p.length;m<g;m++)u.push(p[m].clone(t));this.morphAttributes[c]=u}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let c=0,u=o.length;c<u;c++){const p=o[c];this.addGroup(p.start,p.count,p.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,e.parameters!==void 0&&(this.parameters=Object.assign({},e.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}Fi.prototype.isBufferGeometry=!0;const B4=new ln,Ad=new np,f2=new tp,gc=new _e,_c=new _e,vc=new _e,p2=new _e,A2=new _e,m2=new _e,Fg=new _e,Ug=new _e,Og=new _e,kg=new Mt,zg=new Mt,Vg=new Mt,g2=new _e,Gg=new _e;class Gs extends li{constructor(e=new Fi,t=new qw){super(),this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[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}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){const n=this.geometry,r=this.material,s=this.matrixWorld;if(r===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),f2.copy(n.boundingSphere),f2.applyMatrix4(s),e.ray.intersectsSphere(f2)===!1)||(B4.copy(s).invert(),Ad.copy(e.ray).applyMatrix4(B4),n.boundingBox!==null&&Ad.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){const a=n.index,l=n.attributes.position,c=n.morphAttributes.position,u=n.morphTargetsRelative,p=n.attributes.uv,m=n.attributes.uv2,g=n.groups,v=n.drawRange;if(a!==null)if(Array.isArray(r))for(let b=0,M=g.length;b<M;b++){const x=g[b],w=r[x.materialIndex],R=Math.max(x.start,v.start),C=Math.min(a.count,Math.min(x.start+x.count,v.start+v.count));for(let N=R,D=C;N<D;N+=3){const P=a.getX(N),O=a.getX(N+1),I=a.getX(N+2);o=qg(this,w,e,Ad,l,c,u,p,m,P,O,I),o&&(o.faceIndex=Math.floor(N/3),o.face.materialIndex=x.materialIndex,t.push(o))}}else{const b=Math.max(0,v.start),M=Math.min(a.count,v.start+v.count);for(let x=b,w=M;x<w;x+=3){const R=a.getX(x),C=a.getX(x+1),N=a.getX(x+2);o=qg(this,r,e,Ad,l,c,u,p,m,R,C,N),o&&(o.faceIndex=Math.floor(x/3),t.push(o))}}else if(l!==void 0)if(Array.isArray(r))for(let b=0,M=g.length;b<M;b++){const x=g[b],w=r[x.materialIndex],R=Math.max(x.start,v.start),C=Math.min(l.count,Math.min(x.start+x.count,v.start+v.count));for(let N=R,D=C;N<D;N+=3){const P=N,O=N+1,I=N+2;o=qg(this,w,e,Ad,l,c,u,p,m,P,O,I),o&&(o.faceIndex=Math.floor(N/3),o.face.materialIndex=x.materialIndex,t.push(o))}}else{const b=Math.max(0,v.start),M=Math.min(l.count,v.start+v.count);for(let x=b,w=M;x<w;x+=3){const R=x,C=x+1,N=x+2;o=qg(this,r,e,Ad,l,c,u,p,m,R,C,N),o&&(o.faceIndex=Math.floor(x/3),t.push(o))}}}else n.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}Gs.prototype.isMesh=!0;function the(i,e,t,n,r,s,o,a){let l;if(e.side===_r?l=n.intersectTriangle(o,s,r,!0,a):l=n.intersectTriangle(r,s,o,e.side!==Ff,a),l===null)return null;Gg.copy(a),Gg.applyMatrix4(i.matrixWorld);const c=t.ray.origin.distanceTo(Gg);return c<t.near||c>t.far?null:{distance:c,point:Gg.clone(),object:i}}function qg(i,e,t,n,r,s,o,a,l,c,u,p){gc.fromBufferAttribute(r,c),_c.fromBufferAttribute(r,u),vc.fromBufferAttribute(r,p);const m=i.morphTargetInfluences;if(s&&m){Fg.set(0,0,0),Ug.set(0,0,0),Og.set(0,0,0);for(let v=0,b=s.length;v<b;v++){const M=m[v],x=s[v];M!==0&&(p2.fromBufferAttribute(x,c),A2.fromBufferAttribute(x,u),m2.fromBufferAttribute(x,p),o?(Fg.addScaledVector(p2,M),Ug.addScaledVector(A2,M),Og.addScaledVector(m2,M)):(Fg.addScaledVector(p2.sub(gc),M),Ug.addScaledVector(A2.sub(_c),M),Og.addScaledVector(m2.sub(vc),M)))}gc.add(Fg),_c.add(Ug),vc.add(Og)}i.isSkinnedMesh&&(i.boneTransform(c,gc),i.boneTransform(u,_c),i.boneTransform(p,vc));const g=the(i,e,t,n,gc,_c,vc,g2);if(g){a&&(kg.fromBufferAttribute(a,c),zg.fromBufferAttribute(a,u),Vg.fromBufferAttribute(a,p),g.uv=yr.getUV(g2,gc,_c,vc,kg,zg,Vg,new Mt)),l&&(kg.fromBufferAttribute(l,c),zg.fromBufferAttribute(l,u),Vg.fromBufferAttribute(l,p),g.uv2=yr.getUV(g2,gc,_c,vc,kg,zg,Vg,new Mt));const v={a:c,b:u,c:p,normal:new _e,materialIndex:0};yr.getNormal(gc,_c,vc,v.normal),g.face=v}return g}class em extends Fi{constructor(e=1,t=1,n=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,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=[],u=[],p=[];let m=0,g=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,r,o,2),v("x","z","y",1,-1,e,n,-t,r,o,3),v("x","y","z",1,-1,e,t,n,r,s,4),v("x","y","z",-1,-1,e,t,-n,r,s,5),this.setIndex(l),this.setAttribute("position",new Or(c,3)),this.setAttribute("normal",new Or(u,3)),this.setAttribute("uv",new Or(p,2));function v(b,M,x,w,R,C,N,D,P,O,I){const F=C/P,k=N/O,Y=C/2,W=N/2,Q=D/2,J=P+1,H=O+1;let $=0,K=0;const he=new _e;for(let ie=0;ie<H;ie++){const de=ie*k-W;for(let Ce=0;Ce<J;Ce++){const Fe=Ce*F-Y;he[b]=Fe*w,he[M]=de*R,he[x]=Q,c.push(he.x,he.y,he.z),he[b]=0,he[M]=0,he[x]=D>0?1:-1,u.push(he.x,he.y,he.z),p.push(Ce/P),p.push(1-ie/O),$+=1}}for(let ie=0;ie<O;ie++)for(let de=0;de<P;de++){const Ce=m+de+J*ie,Fe=m+de+J*(ie+1),ge=m+(de+1)+J*(ie+1),Ge=m+(de+1)+J*ie;l.push(Ce,Fe,Ge),l.push(Fe,ge,Ge),K+=6}a.addGroup(g,K,I),g+=K,m+=$}}static fromJSON(e){return new em(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Of(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const r=i[t][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?e[t][n]=r.clone():Array.isArray(r)?e[t][n]=r.slice():e[t][n]=r}}return e}function ss(i){const e={};for(let t=0;t<i.length;t++){const n=Of(i[t]);for(const r in n)e[r]=n[r]}return e}const nhe={clone:Of,merge:ss};var ihe=`void main() {
4796	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4797}`,rhe=`void main() {
4798	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
4799}`;class uh extends fs{constructor(e){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=ihe,this.fragmentShader=rhe,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&(e.attributes!==void 0&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Of(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const o=this.uniforms[r].value;o&&o.isTexture?t.uniforms[r]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[r]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[r]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[r]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[r]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[r]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[r]={type:"m4",value:o.toArray()}:t.uniforms[r]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const n={};for(const r in this.extensions)this.extensions[r]===!0&&(n[r]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}uh.prototype.isShaderMaterial=!0;class Hw extends li{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new ln,this.projectionMatrix=new ln,this.projectionMatrixInverse=new ln}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}Hw.prototype.isCamera=!0;class Us extends Hw{constructor(e=50,t=1,n=.1,r=2e3){super(),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=oS*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Xx*.5*this.fov);return .5*this.getFilmHeight()/e}
4799getEffectiveFOV(){return oS*2*Math.atan(Math.tan(Xx*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Xx*.5*this.fov)/this.zoom,n=2*t,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,t-=o.offsetY*n/c,r*=o.width/l,n*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}Us.prototype.isPerspectiveCamera=!0;const md=90,gd=1;class Ww extends li{constructor(e,t,n){if(super(),this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;const r=new Us(md,gd,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new _e(1,0,0)),this.add(r);const s=new Us(md,gd,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new _e(-1,0,0)),this.add(s);const o=new Us(md,gd,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new _e(0,1,0)),this.add(o);const a=new Us(md,gd,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new _e(0,-1,0)),this.add(a);const l=new Us(md,gd,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new _e(0,0,1)),this.add(l);const c=new Us(md,gd,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new _e(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();const n=this.renderTarget,[r,s,o,a,l,c]=this.children,u=e.xr.enabled,p=e.getRenderTarget();e.xr.enabled=!1;const m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=m,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(p),e.xr.enabled=u}}class Rv extends jr{constructor(e,t,n,r,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:K0,super(e,t,n,r,s,o,a,l,c,u),this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}Rv.prototype.isCubeTexture=!0;class P7 extends Go{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),super(e,e,t),t=t||{},this.texture=new Rv(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:ko,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=Ts,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:`
4800
4801				varying vec3 vWorldDirection;
4802
4803				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
4804
4805					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
4806
4807				}
4808
4809				void main() {
4810
4811					vWorldDirection = transformDirection( position, modelMatrix );
4812
4813					#include <begin_vertex>
4814					#include <project_vertex>
4815
4816				}
4817			`,fragmentShader:`
4818
4819				uniform sampler2D tEquirect;
4820
4821				varying vec3 vWorldDirection;
4822
4823				#include <common>
4824
4825				void main() {
4826
4827					vec3 direction = normalize( vWorldDirection );
4828
4829					vec2 sampleUV = equirectUv( direction );
4830
4831					gl_FragColor = texture2D( tEquirect, sampleUV );
4832
4833				}
4834			`}
vendor: 4,469 bytes, line 4834
4834,r=new em(5,5,5),s=new uh({name:"CubemapFromEquirect",uniforms:Of(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:_r,blending:Uc});s.uniforms.tEquirect.value=t;const o=new Gs(r,s),a=t.minFilter;return t.minFilter===wv&&(t.minFilter=ko),new Ww(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,r){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,r);e.setRenderTarget(s)}}P7.prototype.isWebGLCubeRenderTarget=!0;const _2=new _e,she=new _e,ohe=new $r;class Tl{constructor(e=new _e(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=_2.subVectors(n,t).cross(she.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const n=e.delta(_2),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||ohe.getNormalMatrix(e),r=this.coplanarPoint(_2).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}Tl.prototype.isPlane=!0;const _d=new tp,Hg=new _e;class Cv{constructor(e=new Tl,t=new Tl,n=new Tl,r=new Tl,s=new Tl,o=new Tl){this.planes=[e,t,n,r,s,o]}set(e,t,n,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,r=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],p=n[7],m=n[8],g=n[9],v=n[10],b=n[11],M=n[12],x=n[13],w=n[14],R=n[15];return t[0].setComponents(a-r,p-l,b-m,R-M).normalize(),t[1].setComponents(a+r,p+l,b+m,R+M).normalize(),t[2].setComponents(a+s,p+c,b+g,R+x).normalize(),t[3].setComponents(a-s,p-c,b-g,R-x).normalize(),t[4].setComponents(a-o,p-u,b-v,R-w).normalize(),t[5].setComponents(a+o,p+u,b+v,R+w).normalize(),this}intersectsObject(e){const t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),_d.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(_d)}intersectsSprite(e){return _d.center.set(0,0,0),_d.radius=.7071067811865476,_d.applyMatrix4(e.matrixWorld),this.intersectsSphere(_d)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(Hg.x=r.normal.x>0?e.max.x:e.min.x,Hg.y=r.normal.y>0?e.max.y:e.min.y,Hg.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Hg)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function L7(){let i=null,e=!1,t=null,n=null;function r(s,o){t(s,o),n=i.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(n=i.requestAnimationFrame(r),e=!0)},stop:function(){i.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){i=s}}}function ahe(i,e){const t=e.isWebGL2,n=new WeakMap;function r(c,u){const p=c.array,m=c.usage,g=i.createBuffer();i.bindBuffer(u,g),i.bufferData(u,p,m),c.onUploadCallback();let v=5126;
4834return p instanceof Float32Array?v=5126:p instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):p instanceof Uint16Array?c.isFloat16BufferAttribute?t?v=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):v=5123:p instanceof Int16Array?v=5122:p instanceof Uint32Array?v=5125:p instanceof Int32Array?v=5124:p instanceof Int8Array?v=5120:(p instanceof Uint8Array||p instanceof Uint8ClampedArray)&&(v=5121),{buffer:g,type:v,bytesPerElement:p.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,p){const m=u.array,g=u.updateRange;i.bindBuffer(p,c),g.count===-1?i.bufferSubData(p,0,m):(t?i.bufferSubData(p,g.offset*m.BYTES_PER_ELEMENT,m,g.offset,g.count):i.bufferSubData(p,g.offset*m.BYTES_PER_ELEMENT,m.subarray(g.offset,g.offset+g.count)),g.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);const u=n.get(c);u&&(i.deleteBuffer(u.buffer),n.delete(c))}function l(c,u){if(c.isGLBufferAttribute){const m=n.get(c);(!m||m.version<c.version)&&n.set(c,{buffer:c.buffer,type:c.type,bytesPerElement:c.elementSize,version:c.version});return}c.isInterleavedBufferAttribute&&(c=c.data);const p=n.get(c);p===void 0?n.set(c,r(c,u)):p.version<c.version&&(s(p.buffer,c,u),p.version=c.version)}return{get:o,remove:a,update:l}}class $w extends Fi{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const s=e/2,o=t/2,a=Math.floor(n),l=Math.floor(r),c=a+1,u=l+1,p=e/a,m=t/l,g=[],v=[],b=[],M=[];for(let x=0;x<u;x++){const w=x*m-o;for(let R=0;R<c;R++){const C=R*p-s;v.push(C,-w,0),b.push(0,0,1),M.push(R/a),M.push(1-x/l)}}for(let x=0;x<l;x++)for(let w=0;w<a;w++){const R=w+c*x,C=w+c*(x+1),N=w+1+c*(x+1),D=w+1+c*x;g.push(R,C,D),g.push(C,N,D)}this.setIndex(g),this.setAttribute("position",new Or(v,3)),this.setAttribute("normal",new Or(b,3)),this.setAttribute("uv",new Or(M,2))}static fromJSON(e){return new $w(e.width,e.height,e.widthSegments,e.heightSegments)}}var lhe=`#ifdef USE_ALPHAMAP
4835	diffuseColor.a *= texture2D( alphaMap, vUv ).g;
4836#endif`,che=`#ifdef USE_ALPHAMAP
4837	uniform sampler2D alphaMap;
4838#endif`,uhe=`#ifdef USE_ALPHATEST
4839	if ( diffuseColor.a < alphaTest ) discard;
4840#endif`,hhe=`#ifdef USE_ALPHATEST
4841	uniform float alphaTest;
4842#endif`,dhe=`#ifdef USE_AOMAP
4843	float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;
4844	reflectedLight.indirectDiffuse *= ambientOcclusion;
4845	#if defined( USE_ENVMAP ) && defined( STANDARD )
4846		float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
4847		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
4848	#endif
4849#endif`,fhe=`#ifdef USE_AOMAP
4850	uniform sampler2D aoMap;
4851	uniform float aoMapIntensity;
4852#endif`,phe="vec3 transformed = vec3( position );",Ahe=`vec3 objectNormal = vec3( normal );
4853#ifdef USE_TANGENT
4854	vec3 objectTangent = vec3( tangent.xyz );
4855#endif`,mhe=`vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
4856	return RECIPROCAL_PI * diffuseColor;
4857}
4858vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
4859	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
4860	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
4861}
4862float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
4863	float a2 = pow2( alpha );
4864	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
4865	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
4866	return 0.5 / max( gv + gl, EPSILON );
4867}
4868float D_GGX( const in float alpha, const in float dotNH ) {
4869	float a2 = pow2( alpha );
4870	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
4871	return RECIPROCAL_PI * a2 / pow2( denom );
4872}
4873vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {
4874	float alpha = pow2( roughness );
4875	vec3 halfDir = normalize( lightDir + viewDir );
4876	float dotNL = saturate( dot( normal, lightDir ) );
4877	float dotNV = saturate( dot( normal, viewDir ) );
4878	float dotNH = saturate( dot( normal, halfDir ) );
4879	float dotVH = saturate( dot( viewDir, halfDir ) );
4880	vec3 F = F_Schlick( f0, f90, dotVH );
4881	float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
4882	float D = D_GGX( alpha, dotNH );
4883	return F * ( V * D );
4884}
4885vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
4886	const float LUT_SIZE = 64.0;
4887	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
4888	const float LUT_BIAS = 0.5 / LUT_SIZE;
4889	float dotNV = saturate( dot( N, V ) );
4890	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
4891	uv = uv * LUT_SCALE + LUT_BIAS;
4892	return uv;
4893}
4894float LTC_ClippedSphereFormFactor( const in vec3 f ) {
4895	float l = length( f );
4896	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
4897}
4898vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
4899	float x = dot( v1, v2 );
4900	float y = abs( x );
4901	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
4902	float b = 3.4175940 + ( 4.1616724 + y ) * y;
4903	float v = a / b;
4904	float theta_sintheta = ( x >
4904 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
4905	return cross( v1, v2 ) * theta_sintheta;
4906}
4907vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
4908	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
4909	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
4910	vec3 lightNormal = cross( v1, v2 );
4911	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
4912	vec3 T1, T2;
4913	T1 = normalize( V - N * dot( V, N ) );
4914	T2 = - cross( N, T1 );
4915	mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
4916	vec3 coords[ 4 ];
4917	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
4918	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
4919	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
4920	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
4921	coords[ 0 ] = normalize( coords[ 0 ] );
4922	coords[ 1 ] = normalize( coords[ 1 ] );
4923	coords[ 2 ] = normalize( coords[ 2 ] );
4924	coords[ 3 ] = normalize( coords[ 3 ] );
4925	vec3 vectorFormFactor = vec3( 0.0 );
4926	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
4927	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
4928	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
4929	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
4930	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
4931	return vec3( result );
4932}
4933float G_BlinnPhong_Implicit( ) {
4934	return 0.25;
4935}
4936float D_BlinnPhong( const in float shininess, const in float dotNH ) {
4937	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
4938}
4939vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
4940	vec3 halfDir = normalize( lightDir + viewDir );
4941	float dotNH = saturate( dot( normal, halfDir ) );
4942	float dotVH = saturate( dot( viewDir, halfDir ) );
4943	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
4944	float G = G_BlinnPhong_Implicit( );
4945	float D = D_BlinnPhong( shininess, dotNH );
4946	return F * ( G * D );
4947}
4948#if defined( USE_SHEEN )
4949float D_Charlie( float roughness, float dotNH ) {
4950	float alpha = pow2( roughness );
4951	float invAlpha = 1.0 / alpha;
4952	float cos2h = dotNH * dotNH;
4953	float sin2h = max( 1.0 - cos2h, 0.0078125 );
4954	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
4955}
4956float V_Neubelt( float dotNV, float dotNL ) {
4957	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
4958}
4959vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
4960	vec3 halfDir = normalize( lightDir + viewDir );
4961	float dotNL = saturate( dot( normal, lightDir ) );
4962	float dotNV = saturate( dot( normal, viewDir ) );
4963	float dotNH = saturate( dot( normal, halfDir ) );
4964	float D = D_Charlie( sheenRoughness, dotNH );
4965	float V = V_Neubelt( dotNV, dotNL );
4966	return sheenColor * ( D * V );
4967}
4968#endif`,ghe=`#ifdef USE_BUMPMAP
4969	uniform sampler2D bumpMap;
4970	uniform float bumpScale;
4971	vec2 dHdxy_fwd() {
4972		vec2 dSTdx = dFdx( vUv );
4973		vec2 dSTdy = dFdy( vUv );
4974		float Hll = bumpScale * texture2D( bumpMap, vUv ).x;
4975		float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;
4976		float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;
4977		return vec2( dBx, dBy );
4978	}
4979	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
4980		vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );
4981		vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );
4982		vec3 vN = surf_norm;
4983		vec3 R1 = cross( vSigmaY, vN );
4984		vec3 R2 = cross( vN, vSigmaX );
4985		float fDet = dot( vSigmaX, R1 ) * faceDirection;
4986		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
4987		return normalize( abs( fDet ) * surf_norm - vGrad );
4988	}
4989#endif`,_he=`#if NUM_CLIPPING_PLANES > 0
4990	vec4 plane;
4991	#pragma unroll_loop_start
4992	for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
4993		plane = clippingPlanes[ i ];
4994		if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
4995	}
4996	#pragma unroll_loop_end
4997	#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
4998		bool clipped = true;
4999		#pragma unroll_loop_start
5000		for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
5001			plane = clippingPlanes[ i ];
5002			clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
5003		}
5004		#pragma unroll_loop_end
5005		if ( clipped ) discard;
5006	#endif
5007#endif`,vhe=`#if NUM_CLIPPING_PLANES > 0
5008	varying vec3 vClipPosition;
5009	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
5010#endif`,yhe=`#if NUM_CLIPPING_PLANES > 0
5011	varying vec3 vClipPosition;
5012#endif`,xhe=`#if NUM_CLIPPING_PLANES > 0
5013	vClipPosition = - mvPosition.xyz;
5014#endif`,bhe=`#if defined( USE_COLOR_ALPHA )
5015	diffuseColor *= vColor;
5016#elif defined( USE_COLOR )
5017	diffuseColor.rgb *= vColor;
5018#endif`,She=`#if defined( USE_COLOR_ALPHA )
5019	varying vec4 vColor;
5020#elif defined( USE_COLOR )
5021	varying vec3 vColor;
5022#endif`,Mhe=`#if defined( USE_COLOR_ALPHA )
5023	varying vec4 vColor;
5024#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
5025	varying vec3 vColor;
5026#endif`,whe=`#if defined( USE_COLOR_ALPHA )
5027	vColor = vec4( 1.0 );
5028#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
5029	vColor = vec3( 1.0 );
5030#endif
5031#ifdef USE_COLOR
5032	vColor *= color;
5033#endif
5034#ifdef USE_INSTANCING_COLOR
5035	vColor.xyz *= instanceColor.xyz;
5036#endif`,The=`#define PI 3.141592653589793
5037#define PI2 6.283185307179586
5038#define PI_HALF 1.5707963267948966
5039#define RECIPROCAL_PI 0.3183098861837907
5040#define RECIPROCAL_PI2 0.15915494309189535
5041#define EPSILON 1e-6
5042#ifndef saturate
5043#define saturate( a ) clamp( a, 0.0, 1.0 )
5044#endif
5045#define whiteComplement( a ) ( 1.0 - saturate( a ) )
5046float pow2( const in float x ) { return x*x; }
5047float pow3( const in float x ) { return x*x*x; }
5048float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
5049float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
5050float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }
5051highp float rand( const in vec2 uv ) {
5052	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
5053	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
5054	return fract( sin( sn ) * c );
5055}
5056#ifdef HIGH_PRECISION
5057	float precisionSafeLength( vec3 v ) { return length( v ); }
5058#else
5059	float precisionSafeLength( vec3 v ) {
5060		float maxComponent = max3( abs( v ) );
5061		return length( v / maxComponent ) * maxComponent;
5062	}
5063#endif
5064struct IncidentLight {
5065	vec3 color;
5066	vec3 direction;
5067	bool visible;
5068};
5069struct ReflectedLight {
5070	vec3 directDiffuse;
5071	vec3 directSpecular;
5072	vec3 indirectDiffuse;
5073	vec3 indirectSpecular;
5074};
5075struct GeometricContext {
5076	vec3 position;
5077	vec3 normal;
5078	vec3 viewDir;
5079#ifdef USE_CLEARCOAT
5080	vec3 clearcoatNormal;
5081#endif
5082};
5083vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
5084	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
5085}
5086vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
5087	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
5088}
5089mat3 transposeMat3( const in mat3 m ) {
5090	mat3 tmp;
5091	tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
5092	tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
5093	tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
5094	return tmp;
5095}
5096float linearToRelativeLuminance( const in vec3 color ) {
5097	vec3 weights = vec3( 0.2126, 0.7152, 0.0722 );
5098	return dot( weights, color.rgb );
5099}
5100bool isPerspectiveMatrix( mat4 m ) {
5101	return m[ 2 ][ 3 ] == - 1.0;
5102}
5103vec2 equirectUv( in vec3 dir ) {
5104	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
5105	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
5106	return vec2( u, v );
5107}`,Ehe=`#ifdef ENVMAP_TYPE_CUBE_UV
5108	#define cubeUV_maxMipLevel 8.0
5109	#define cubeUV_minMipLevel 4.0
5110	#define cubeUV_maxTileSize 256.0
5111	#define cubeUV_minTileSize 16.0
5112	float getFace( vec3 direction ) {
5113		vec3 absDirection = abs( direction );
5114		float face = - 1.0;
5115		if ( absDirection.x > absDirection.z ) {
5116			if ( absDirection.x > absDirection.y )
5117				face = direction.x > 0.0 ? 0.0 : 3.0;
5118			else
5119				face = direction.y > 0.0 ? 1.0 : 4.0;
5120		} else {
5121			if ( absDirection.z > absDirection.y )
5122				face = direction.z > 0.0 ? 2.0 : 5.0;
5123			else
5124				face = direction.y > 0.0 ? 1.0 : 4.0;
5125		}
5126		return face;
5127	}
5128	vec2 getUV( vec3 direction, float face ) {
5129		vec2 uv;
5130		if ( face == 0.0 ) {
5131			uv = vec2( direction.z, direction.y ) / abs( direction.x );
5132		} else if ( face == 1.0 ) {
5133			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
5134		} else if ( face == 2.0 ) {
5135			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
5136		} else if ( face == 3.0 ) {
5137			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
5138		} else if ( face == 4.0 ) {
5139			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
5140		} else {
5141			uv = vec2( direction.x, direction.y ) / abs( direction.z );
5142		}
5143		return 0.5 * ( uv + 1.0 );
5144	}
5145	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
5146		float face = getFace( direction );
5147		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
5148		mipInt = max( mipInt, cubeUV_minMipLevel );
5149		float faceSize = exp2( mipInt );
5150		float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );
5151		vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );
5152		vec2 f = fract( uv );
5153		uv += 0.5 - f;
5154		if ( face > 2.0 ) {
5155			uv.y += faceSize;
5156			face -= 3.0;
5157		}
5158		uv.x += face * faceSize;
5159		if ( mipInt < cubeUV_maxMipLevel ) {
5160			uv.y += 2.0 * cubeUV_maxTileSize;
5161		}
5162		uv.y += filterInt * 2.0 * cubeUV_minTileSize;
5163		uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );
5164		uv *= texelSize;
5165		vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;
5166		uv.x += texelSize;
5167		vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;
5168		uv.y += texelSize;
5169		vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;
5170		uv.x -= texelSize;
5171		vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;
5172		vec3 tm = mix( tl, tr, f.x );
5173		vec3 bm = mix( bl, br, f.x );
5174		return mix( tm, bm, f.y );
5175	}
5176	#define r0 1.0
5177	#define v0 0.339
5178	#define m0 - 2.0
5179	#define r1 0.8
5180	#define v1 0.276
5181	#define m1 - 1.0
5182	#define r4 0.4
5183	#define v4 0.046
5184	#define m4 2.0
5185	#define r5 0.305
5186	#define v5 0.016
5187	#define m5 3.0
5188	#define r6 0.21
5189	#define v6 0.0038
5190	#define m6 4.0
5191	float roughnessToMip( float roughness ) {
5192		float mip = 0.0;
5193		if ( roughness >= r1 ) {
5194			mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;
5195		} else if ( roughness >= r4 ) {
5196			mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;
5197		} else if ( roughness >= r5 ) {
5198			mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;
5199		} else if ( roughness >= r6 ) {
5200			mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;
5201		} else {
5202			mip = - 2.0 * log2( 1.16 * roughness );		}
5203		return mip;
5204	}
5205	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
5206		float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );
5207		float mipF = fract( mip );
5208		float mipInt = floor( mip );
5209		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
5210		if ( mipF == 0.0 ) {
5211			return vec4( color0, 1.0 );
5212		} else {
5213			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
5214			return vec4( mix( color0, color1, mipF ), 1.0 );
5215		}
5216	}
5217#endif`,Rhe=`vec3 transformedNormal = objectNormal;
5218#ifdef USE_INSTANCING
5219	mat3 m = mat3( instanceMatrix );
5220	transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );
5221	transformedNormal = m * transformedNormal;
5222#endif
5223transformedNormal = normalMatrix * transformedNormal;
5224#ifdef FLIP_SIDED
5225	transformedNormal = - transformedNormal;
5226#endif
5227#ifdef USE_TANGENT
5228	vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;
5229	#ifdef FLIP_SIDED
5230		transformedTangent = - transformedTangent;
5231	#endif
5232#endif`,Che=`#ifdef USE_DISPLACEMENTMAP
5233	uniform sampler2D displacementMap;
5234	uniform float displacementScale;
5235	uniform float displacementBias;
5236#endif`,Phe=`#ifdef USE_DISPLACEMENTMAP
5237	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );
5238#endif`,Lhe=`#ifdef USE_EMISSIVEMAP
5239	vec4 emissiveColor = texture2D( emissiveMap, vUv );
5240	emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;
5241	totalEmissiveRadiance *= emissiveColor.rgb;
5242#endif`,Nhe=`#ifdef USE_EMISSIVEMAP
5243	uniform sampler2D emissiveMap;
5244#endif`,Dhe="gl_FragColor = linearToOutputTexel( gl_FragColor );",Ihe=`
5245vec4 LinearToLinear( in vec4 value ) {
5246	return value;
5247}
5248vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {
5249	return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );
5250}
5251vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {
5252	return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );
5253}
5254vec4 sRGBToLinear( in vec4 value ) {
5255	return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
5256}
5257vec4 LinearTosRGB( in vec4 value ) {
5258	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 );
5259}
5260vec4 RGBEToLinear( in vec4 value ) {
5261	return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );
5262}
5263vec4 LinearToRGBE( in vec4 value ) {
5264	float maxComponent = max( max( value.r, value.g ), value.b );
5265	float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );
5266	return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );
5267}
5268vec4 RGBMToLinear( in vec4 value, in float maxRange ) {
5269	return vec4( value.rgb * value.a * maxRange, 1.0 );
5270}
5271vec4 LinearToRGBM( in vec4 value, in float maxRange ) {
5272	float maxRGB = max( value.r, max( value.g, value.b ) );
5273	float M = clamp( maxRGB / maxRange, 0.0, 1.0 );
5274	M = ceil( M * 255.0 ) / 255.0;
5275	return vec4( value.rgb / ( M * maxRange ), M );
5276}
5277vec4 RGBDToLinear( in vec4 value, in float maxRange ) {
5278	return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );
5279}
5280vec4 LinearToRGBD( in vec4 value, in float maxRange ) {
5281	float maxRGB = max( value.r, max( value.g, value.b ) );
5282	float D = max( maxRange / maxRGB, 1.0 );
5283	D = clamp( floor( D ) / 255.0, 0.0, 1.0 );
5284	return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );
5285}`,Bhe=`#ifdef USE_ENVMAP
5286	#ifdef ENV_WORLDPOS
5287		vec3 cameraToFrag;
5288		if ( isOrthographic ) {
5289			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
5290		} else {
5291			cameraToFrag = normalize( vWorldPosition - cameraPosition );
5292		}
5293		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
5294		#ifdef ENVMAP_MODE_REFLECTION
5295			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
5296		#else
5297			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
5298		#endif
5299	#else
5300		vec3 reflectVec = vReflect;
5301	#endif
5302	#ifdef ENVMAP_TYPE_CUBE
5303		vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
5304		envColor = envMapTexelToLinear( envColor );
5305	#elif defined( ENVMAP_TYPE_CUBE_UV )
5306		vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );
5307	#else
5308		vec4 envColor = vec4( 0.0 );
5309	#endif
5310	#ifdef ENVMAP_BLENDING_MULTIPLY
5311		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
5312	#elif defined( ENVMAP_BLENDING_MIX )
5313		outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
5314	#elif defined( ENVMAP_BLENDING_ADD )
5315		outgoingLight += envColor.xyz * specularStrength * reflectivity;
5316	#endif
5317#endif`,Fhe=`#ifdef USE_ENVMAP
5318	uniform float envMapIntensity;
5319	uniform float flipEnvMap;
5320	#ifdef ENVMAP_TYPE_CUBE
5321		uniform samplerCube envMap;
5322	#else
5323		uniform sampler2D envMap;
5324	#endif
5325	
5326#endif`,Uhe=`#ifdef USE_ENVMAP
5327	uniform float reflectivity;
5328	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )
5329		#define ENV_WORLDPOS
5330	#endif
5331	#ifdef ENV_WORLDPOS
5332		varying vec3 vWorldPosition;
5333		uniform float refractionRatio;
5334	#else
5335		varying vec3 vReflect;
5336	#endif
5337#endif`,Ohe=`#ifdef USE_ENVMAP
5338	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )
5339		#define ENV_WORLDPOS
5340	#endif
5341	#ifdef ENV_WORLDPOS
5342		
5343		varying vec3 vWorldPosition;
5344	#else
5345		varying vec3 vReflect;
5346		uniform float refractionRatio;
5347	#endif
5348#endif`,khe=`#ifdef USE_ENVMAP
5349	#ifdef ENV_WORLDPOS
5350		vWorldPosition = worldPosition.xyz;
5351	#else
5352		vec3 cameraToVertex;
5353		if ( isOrthographic ) {
5354			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
5355		} else {
5356			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
5357		}
5358		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
5359		#ifdef ENVMAP_MODE_REFLECTION
5360			vReflect = reflect( cameraToVertex, worldNormal );
5361		#else
5362			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
5363		#endif
5364	#endif
5365#endif`,zhe=`#ifdef USE_FOG
5366	vFogDepth = - mvPosition.z;
5367#endif`,Vhe=`#ifdef USE_FOG
5368	varying float vFogDepth;
5369#endif`,Ghe=`#ifdef USE_FOG
5370	#ifdef FOG_EXP2
5371		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
5372	#else
5373		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
5374	#endif
5375	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
5376#endif`,qhe=`#ifdef USE_FOG
5377	uniform vec3 fogColor;
5378	varying float vFogDepth;
5379	#ifdef FOG_EXP2
5380		uniform float fogDensity;
5381	#else
5382		uniform float fogNear;
5383		uniform float fogFar;
5384	#endif
5385#endif`,Hhe=`#ifdef USE_GRADIENTMAP
5386	uniform sampler2D gradientMap;
5387#endif
5388vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
5389	float dotNL = dot( normal, lightDirection );
5390	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
5391	#ifdef USE_GRADIENTMAP
5392		return texture2D( gradientMap, coord ).rgb;
5393	#else
5394		return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );
5395	#endif
5396}`,Whe=`#ifdef USE_LIGHTMAP
5397	vec4 lightMapTexel = texture2D( lightMap, vUv2 );
5398	vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
5399	#ifndef PHYSICALLY_CORRECT_LIGHTS
5400		lightMapIrradiance *= PI;
5401	#endif
5402	reflectedLight.indirectDiffuse += lightMapIrradiance;
5403#endif`,$he=`#ifdef USE_LIGHTMAP
5404	uniform sampler2D lightMap;
5405	uniform float lightMapIntensity;
5406#endif`,jhe=`vec3 diffuse = vec3( 1.0 );
5407GeometricContext geometry;
5408geometry.position = mvPosition.xyz;
5409geometry.normal = normalize( transformedNormal );
5410geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );
5411GeometricContext backGeometry;
5412backGeometry.position = geometry.position;
5413backGeometry.normal = -geometry.normal;
5414backGeometry.viewDir = geometry.viewDir;
5415vLightFront = vec3( 0.0 );
5416vIndirectFront = vec3( 0.0 );
5417#ifdef DOUBLE_SIDED
5418	vLightBack = vec3( 0.0 );
5419	vIndirectBack = vec3( 0.0 );
5420#endif
5421IncidentLight directLight;
5422float dotNL;
5423vec3 directLightColor_Diffuse;
5424vIndirectFront += getAmbientLightIrradiance( ambientLightColor );
5425vIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );
5426#ifdef DOUBLE_SIDED
5427	vIndirectBack += getAmbientLightIrradiance( ambientLightColor );
5428	vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );
5429#endif
5430#if NUM_POINT_LIGHTS > 0
5431	#pragma unroll_loop_start
5432	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
5433		getPointLightInfo( pointLights[ i ], geometry, directLight );
5434		dotNL = dot( geometry.normal, directLight.direction );
5435		directLightColor_Diffuse = directLight.color;
5436		vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
5437		#ifdef DOUBLE_SIDED
5438			vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;
5439		#endif
5440	}
5441	#pragma unroll_loop_end
5442#endif
5443#if NUM_SPOT_LIGHTS > 0
5444	#pragma unroll_loop_start
5445	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
5446		getSpotLightInfo( spotLights[ i ], geometry, directLight );
5447		dotNL = dot( geometry.normal, directLight.direction );
5448		directLightColor_Diffuse = directLight.color;
5449		vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
5450		#ifdef DOUBLE_SIDED
5451			vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;
5452		#endif
5453	}
5454	#pragma unroll_loop_end
5455#endif
5456#if NUM_DIR_LIGHTS > 0
5457	#pragma unroll_loop_start
5458	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
5459		getDirectionalLightInfo( directionalLights[ i ], geometry, directLight );
5460		dotNL = dot( geometry.normal, directLight.direction );
5461		directLightColor_Diffuse = directLight.color;
5462		vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
5463		#ifdef DOUBLE_SIDED
5464			vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;
5465		#endif
5466	}
5467	#pragma unroll_loop_end
5468#endif
5469#if NUM_HEMI_LIGHTS > 0
5470	#pragma unroll_loop_start
5471	for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
5472		vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );
5473		#ifdef DOUBLE_SIDED
5474			vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );
5475		#endif
5476	}
5477	#pragma unroll_loop_end
5478#endif`,Xhe=`uniform bool receiveShadow;
5479uniform vec3 ambientLightColor;
5480uniform vec3 lightProbe[ 9 ];
5481vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
5482	float x = normal.x, y = normal.y, z = normal.z;
5483	vec3 result = shCoefficients[ 0 ] * 0.886227;
5484	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
5485	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
5486	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
5487	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
5488	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
5489	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
5490	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
5491	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
5492	return result;
5493}
5494vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
5495	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
5496	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
5497	return irradiance;
5498}
5499vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
5500	vec3 irradiance = ambientLightColor;
5501	return irradiance;
5502}
5503float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
5504	#if defined ( PHYSICALLY_CORRECT_LIGHTS )
5505		float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
5506		if ( cutoffDistance > 0.0 ) {
5507			distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
5508		}
5509		return distanceFalloff;
5510	#else
5511		if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {
5512			return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );
5513		}
5514		return 1.0;
5515	#endif
5516}
5517float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
5518	return smoothstep( coneCosine, penumbraCosine, angleCosine );
5519}
5520#if NUM_DIR_LIGHTS > 0
5521	struct DirectionalLight {
5522		vec3 direction;
5523		vec3 color;
5524	};
5525	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
5526	void getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {
5527		light.color = directionalLight.color;
5528		light.direction = directionalLight.direction;
5529		light.visible = true;
5530	}
5531#endif
5532#if NUM_POINT_LIGHTS > 0
5533	struct PointLight {
5534		vec3 position;
5535		vec3 color;
5536		float distance;
5537		float decay;
5538	};
5539	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
5540	void getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {
5541		vec3 lVector = pointLight.position - geometry.position;
5542		light.direction = normalize( lVector );
5543		float lightDistance = length( lVector );
5544		light.color = pointLight.color;
5545		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
5546		light.visible = ( light.color != vec3( 0.0 ) );
5547	}
5548#endif
5549#if NUM_SPOT_LIGHTS > 0
5550	struct SpotLight {
5551		vec3 position;
5552		vec3 direction;
5553		vec3 color;
5554		float distance;
5555		float decay;
5556		float coneCos;
5557		float penumbraCos;
5558	};
5559	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
5560	void getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {
5561		vec3 lVector = spotLight.position - geometry.position;
5562		light.direction = normalize( lVector );
5563		float angleCos = dot( light.direction, spotLight.direction );
5564		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
5565		if ( spotAttenuation > 0.0 ) {
5566			float lightDistance = length( lVector );
5567			light.color = spotLight.color * spotAttenuation;
5568			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
5569			light.visible = ( light.color != vec3( 0.0 ) );
5570		} else {
5571			light.color = vec3( 0.0 );
5572			light.visible = false;
5573		}
5574	}
5575#endif
5576#if NUM_RECT_AREA_LIGHTS > 0
5577	struct RectAreaLight {
5578		vec3 color;
5579		vec3 position;
5580		vec3 halfWidth;
5581		vec3 halfHeight;
5582	};
5583	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
5584	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
5585#endif
5586#if NUM_HEMI_LIGHTS > 0
5587	struct HemisphereLight {
5588		vec3 direction;
5589		vec3 skyColor;
5590		vec3 groundColor;
5591	};
5592	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
5593	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
5594		float dotNL = dot( normal, hemiLight.direction );
5595		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
5596		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
5597		return irradiance;
5598	}
5599#endif`,Yhe=`#if defined( USE_ENVMAP )
5600	#ifdef ENVMAP_MODE_REFRACTION
5601		uniform float refractionRatio;
5602	#endif
5603	vec3 getIBLIrradiance( const in vec3 normal ) {
5604		#if defined( ENVMAP_TYPE_CUBE_UV )
5605			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
5606			vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );
5607			return PI * envMapColor.rgb * envMapIntensity;
5608		#else
5609			return vec3( 0.0 );
5610		#endif
5611	}
5612	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
5613		#if defined( ENVMAP_TYPE_CUBE_UV )
5614			vec3 reflectVec;
5615			#ifdef ENVMAP_MODE_REFLECTION
5616				reflectVec = reflect( - viewDir, normal );
5617				reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
5618			#else
5619				reflectVec = refract( - viewDir, normal, refractionRatio );
5620			#endif
5621			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
5622			vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );
5623			return envMapColor.rgb * envMapIntensity;
5624		#else
5625			return vec3( 0.0 );
5626		#endif
5627	}
5628#endif`,Qhe=`ToonMaterial material;
5629material.diffuseColor = diffuseColor.rgb;`,Zhe=`varying vec3 vViewPosition;
5630struct ToonMaterial {
5631	vec3 diffuseColor;
5632};
5633void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
5634	vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;
5635	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
5636}
5637void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
5638	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
5639}
5640#define RE_Direct				RE_Direct_Toon
5641#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon
5642#define Material_LightProbeLOD( material )	(0)`,Khe=`BlinnPhongMaterial material;
5643material.diffuseColor = diffuseColor.rgb;
5644material.specularColor = specular;
5645material.specularShininess = shininess;
5646material.specularStrength = specularStrength;`,Jhe=`varying vec3 vViewPosition;
5647struct BlinnPhongMaterial {
5648	vec3 diffuseColor;
5649	vec3 specularColor;
5650	float specularShininess;
5651	float specularStrength;
5652};
5653void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
5654	float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
5655	vec3 irradiance = dotNL * directLight.color;
5656	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
5657	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;
5658}
5659void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
5660	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
5661}
5662#define RE_Direct				RE_Direct_BlinnPhong
5663#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong
5664#define Material_LightProbeLOD( material )	(0)`,ede=`PhysicalMaterial material;
5665material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
5666vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );
5667float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
5668material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
5669material.roughness = min( material.roughness, 1.0 );
5670#ifdef IOR
5671	#ifdef SPECULAR
5672		float specularIntensityFactor = specularIntensity;
5673		vec3 specularColorFactor = specularColor;
5674		#ifdef USE_SPECULARINTENSITYMAP
5675			specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;
5676		#endif
5677		#ifdef USE_SPECULARCOLORMAP
5678			specularColorFactor *= specularColorMapTexelToLinear( texture2D( specularColorMap, vUv ) ).rgb;
5679		#endif
5680		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
5681	#else
5682		float specularIntensityFactor = 1.0;
5683		vec3 specularColorFactor = vec3( 1.0 );
5684		material.specularF90 = 1.0;
5685	#endif
5686	material.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
5687#else
5688	material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
5689	material.specularF90 = 1.0;
5690#endif
5691#ifdef USE_CLEARCOAT
5692	material.clearcoat = clearcoat;
5693	material.clearcoatRoughness = clearcoatRoughness;
5694	material.clearcoatF0 = vec3( 0.04 );
5695	material.clearcoatF90 = 1.0;
5696	#ifdef USE_CLEARCOATMAP
5697		material.clearcoat *= texture2D( clearcoatMap, vUv ).x;
5698	#endif
5699	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
5700		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;
5701	#endif
5702	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
5703	material.clearcoatRoughness += geometryRoughness;
5704	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
5705#endif
5706#ifdef USE_SHEEN
5707	material.sheenColor = sheenColor;
5708	#ifdef USE_SHEENCOLORMAP
5709		material.sheenColor *= sheenColorMapTexelToLinear( texture2D( sheenColorMap, vUv ) ).rgb;
5710	#endif
5711	material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
5712	#ifdef USE_SHEENROUGHNESSMAP
5713		material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;
5714	#endif
5715#endif`,tde=`struct PhysicalMaterial {
5716	vec3 diffuseColor;
5717	float roughness;
5718	vec3 specularColor;
5719	float specularF90;
5720	#ifdef USE_CLEARCOAT
5721		float clearcoat;
5722		float clearcoatRoughness;
5723		vec3 clearcoatF0;
5724		float clearcoatF90;
5725	#endif
5726	#ifdef USE_SHEEN
5727		vec3 sheenColor;
5728		float sheenRoughness;
5729	#endif
5730};
5731vec3 clearcoatSpecular = vec3( 0.0 );
5732vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
5733	float dotNV = saturate( dot( normal, viewDir ) );
5734	const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
5735	const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
5736	vec4 r = roughness * c0 + c1;
5737	float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
5738	vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
5739	return fab;
5740}
5741vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
5742	vec2 fab = DFGApprox( normal, viewDir, roughness );
5743	return specularColor * fab.x + specularF90 * fab.y;
5744}
5745void 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 ) {
5746	vec2 fab = DFGApprox( normal, viewDir, roughness );
5747	vec3 FssEss = specularColor * fab.x + specularF90 * fab.y;
5748	float Ess = fab.x + fab.y;
5749	float Ems = 1.0 - Ess;
5750	vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
5751	singleScatter += FssEss;
5752	multiScatter += Fms * Ems;
5753}
5754#if NUM_RECT_AREA_LIGHTS > 0
5755	void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
5756		vec3 normal = geometry.normal;
5757		vec3 viewDir = geometry.viewDir;
5758		vec3 position = geometry.position;
5759		vec3 lightPos = rectAreaLight.position;
5760		vec3 halfWidth = rectAreaLight.halfWidth;
5761		vec3 halfHeight = rectAreaLight.halfHeight;
5762		vec3 lightColor = rectAreaLight.color;
5763		float roughness = material.roughness;
5764		vec3 rectCoords[ 4 ];
5765		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
5766		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
5767		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
5768		vec2 uv = LTC_Uv( normal, viewDir, roughness );
5769		vec4 t1 = texture2D( ltc_1, uv );
5770		vec4 t2 = texture2D( ltc_2, uv );
5771		mat3 mInv = mat3(
5772			vec3( t1.x, 0, t1.y ),
5773			vec3(    0, 1,    0 ),
5774			vec3( t1.z, 0, t1.w )
5775		);
5776		vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
5777		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
5778		reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
5779	}
5780#endif
5781void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
5782	float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
5783	vec3 irradiance = dotNL * directLight.color;
5784	#ifdef USE_CLEARCOAT
5785		float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );
5786		vec3 ccIrradiance = dotNLcc * directLight.color;
5787		clearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
5788	#endif
5789	#ifdef USE_SHEEN
5790		reflectedLight.directSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );
5791	#endif
5792	reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );
5793	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
5794}
5795void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
5796	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
5797}
5798void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
5799	#ifdef USE_CLEARCOAT
5800		clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
5801	#endif
5802	vec3 singleScattering = vec3( 0.0 );
5803	vec3 multiScattering = vec3( 0.0 );
5804	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
5805	computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
5806	vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );
5807	reflectedLight.indirectSpecular += radiance * singleScattering;
5808	reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
5809	reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
5810}
5811#define RE_Direct				RE_Direct_Physical
5812#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
5813#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
5814#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
5815float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
5816	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
5817}`,nde=`
5818GeometricContext geometry;
5819geometry.position = - vViewPosition;
5820geometry.normal = normal;
5821geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
5822#ifdef USE_CLEARCOAT
5823	geometry.clearcoatNormal = clearcoatNormal;
5824#endif
5825IncidentLight directLight;
5826#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
5827	PointLight pointLight;
5828	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
5829	PointLightShadow pointLightShadow;
5830	#endif
5831	#pragma unroll_loop_start
5832	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
5833		pointLight = pointLights[ i ];
5834		getPointLightInfo( pointLight, geometry, directLight );
5835		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
5836		pointLightShadow = pointLightShadows[ i ];
5837		directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
5838		#endif
5839		RE_Direct( directLight, geometry, material, reflectedLight );
5840	}
5841	#pragma unroll_loop_end
5842#endif
5843#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
5844	SpotLight spotLight;
5845	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
5846	SpotLightShadow spotLightShadow;
5847	#endif
5848	#pragma unroll_loop_start
5849	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
5850		spotLight = spotLights[ i ];
5851		getSpotLightInfo( spotLight, geometry, directLight );
5852		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
5853		spotLightShadow = spotLightShadows[ i ];
5854		directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;
5855		#endif
5856		RE_Direct( directLight, geometry, material, reflectedLight );
5857	}
5858	#pragma unroll_loop_end
5859#endif
5860#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
5861	DirectionalLight directionalLight;
5862	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
5863	DirectionalLightShadow directionalLightShadow;
5864	#endif
5865	#pragma unroll_loop_start
5866	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
5867		directionalLight = directionalLights[ i ];
5868		getDirectionalLightInfo( directionalLight, geometry, directLight );
5869		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
5870		directionalLightShadow = directionalLightShadows[ i ];
5871		directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
5872		#endif
5873		RE_Direct( directLight, geometry, material, reflectedLight );
5874	}
5875	#pragma unroll_loop_end
5876#endif
5877#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
5878	RectAreaLight rectAreaLight;
5879	#pragma unroll_loop_start
5880	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
5881		rectAreaLight = rectAreaLights[ i ];
5882		RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );
5883	}
5884	#pragma unroll_loop_end
5885#endif
5886#if defined( RE_IndirectDiffuse )
5887	vec3 iblIrradiance = vec3( 0.0 );
5888	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
5889	irradiance += getLightProbeIrradiance( lightProbe, geometry.normal );
5890	#if ( NUM_HEMI_LIGHTS > 0 )
5891		#pragma unroll_loop_start
5892		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
5893			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );
5894		}
5895		#pragma unroll_loop_end
5896	#endif
5897#endif
5898#if defined( RE_IndirectSpecular )
5899	vec3 radiance = vec3( 0.0 );
5900	vec3 clearcoatRadiance = vec3( 0.0 );
5901#endif`,ide=`#if defined( RE_IndirectDiffuse )
5902	#ifdef USE_LIGHTMAP
5903		vec4 lightMapTexel = texture2D( lightMap, vUv2 );
5904		vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
5905		#ifndef PHYSICALLY_CORRECT_LIGHTS
5906			lightMapIrradiance *= PI;
5907		#endif
5908		irradiance += lightMapIrradiance;
5909	#endif
5910	#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
5911		iblIrradiance += getIBLIrradiance( geometry.normal );
5912	#endif
5913#endif
5914#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
5915	radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );
5916	#ifdef USE_CLEARCOAT
5917		clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );
5918	#endif
5919#endif`,rde=`#if defined( RE_IndirectDiffuse )
5920	RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );
5921#endif
5922#if defined( RE_IndirectSpecular )
5923	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );
5924#endif`,sde=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
5925	gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
5926#endif`,ode=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
5927	uniform float logDepthBufFC;
5928	varying float vFragDepth;
5929	varying float vIsPerspective;
5930#endif`,ade=`#ifdef USE_LOGDEPTHBUF
5931	#ifdef USE_LOGDEPTHBUF_EXT
5932		varying float vFragDepth;
5933		varying float vIsPerspective;
5934	#else
5935		uniform float logDepthBufFC;
5936	#endif
5937#endif`,lde=`#ifdef USE_LOGDEPTHBUF
5938	#ifdef USE_LOGDEPTHBUF_EXT
5939		vFragDepth = 1.0 + gl_Position.w;
5940		vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
5941	#else
5942		if ( isPerspectiveMatrix( projectionMatrix ) ) {
5943			gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;
5944			gl_Position.z *= gl_Position.w;
5945		}
5946	#endif
5947#endif`,cde=`#ifdef USE_MAP
5948	vec4 texelColor = texture2D( map, vUv );
5949	texelColor = mapTexelToLinear( texelColor );
5950	diffuseColor *= texelColor;
5951#endif`,ude=`#ifdef USE_MAP
5952	uniform sampler2D map;
5953#endif`,hde=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
5954	vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
5955#endif
5956#ifdef USE_MAP
5957	vec4 mapTexel = texture2D( map, uv );
5958	diffuseColor *= mapTexelToLinear( mapTexel );
5959#endif
5960#ifdef USE_ALPHAMAP
5961	diffuseColor.a *= texture2D( alphaMap, uv ).g;
5962#endif`,dde=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
5963	uniform mat3 uvTransform;
5964#endif
5965#ifdef USE_MAP
5966	uniform sampler2D map;
5967#endif
5968#ifdef USE_ALPHAMAP
5969	uniform sampler2D alphaMap;
5970#endif`,fde=`float metalnessFactor = metalness;
5971#ifdef USE_METALNESSMAP
5972	vec4 texelMetalness = texture2D( metalnessMap, vUv );
5973	metalnessFactor *= texelMetalness.b;
5974#endif`,pde=`#ifdef USE_METALNESSMAP
5975	uniform sampler2D metalnessMap;
5976#endif`,Ade=`#ifdef USE_MORPHNORMALS
5977	objectNormal *= morphTargetBaseInfluence;
5978	#ifdef MORPHTARGETS_TEXTURE
5979		for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
5980			if ( morphTargetInfluences[ i ] > 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ];
5981		}
5982	#else
5983		objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];
5984		objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];
5985		objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];
5986		objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];
5987	#endif
5988#endif`,mde=`#ifdef USE_MORPHTARGETS
5989	uniform float morphTargetBaseInfluence;
5990	#ifdef MORPHTARGETS_TEXTURE
5991		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
5992		uniform sampler2DArray morphTargetsTexture;
5993		uniform vec2 morphTargetsTextureSize;
5994		vec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) {
5995			float texelIndex = float( vertexIndex * stride + offset );
5996			float y = floor( texelIndex / morphTargetsTextureSize.x );
5997			float x = texelIndex - y * morphTargetsTextureSize.x;
5998			vec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );
5999			return texture( morphTargetsTexture, morphUV ).xyz;
6000		}
6001	#else
6002		#ifndef USE_MORPHNORMALS
6003			uniform float morphTargetInfluences[ 8 ];
6004		#else
6005			uniform float morphTargetInfluences[ 4 ];
6006		#endif
6007	#endif
6008#endif`,gde=`#ifdef USE_MORPHTARGETS
6009	transformed *= morphTargetBaseInfluence;
6010	#ifdef MORPHTARGETS_TEXTURE
6011		for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
6012			#ifndef USE_MORPHNORMALS
6013				if ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ];
6014			#else
6015				if ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ];
6016			#endif
6017		}
6018	#else
6019		transformed += morphTarget0 * morphTargetInfluences[ 0 ];
6020		transformed += morphTarget1 * morphTargetInfluences[ 1 ];
6021		transformed += morphTarget2 * morphTargetInfluences[ 2 ];
6022		transformed += morphTarget3 * morphTargetInfluences[ 3 ];
6023		#ifndef USE_MORPHNORMALS
6024			transformed += morphTarget4 * morphTargetInfluences[ 4 ];
6025			transformed += morphTarget5 * morphTargetInfluences[ 5 ];
6026			transformed += morphTarget6 * morphTargetInfluences[ 6 ];
6027			transformed += morphTarget7 * morphTargetInfluences[ 7 ];
6028		#endif
6029	#endif
6030#endif`,_de=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
6031#ifdef FLAT_SHADED
6032	vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );
6033	vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );
6034	vec3 normal = normalize( cross( fdx, fdy ) );
6035#else
6036	vec3 normal = normalize( vNormal );
6037	#ifdef DOUBLE_SIDED
6038		normal = normal * faceDirection;
6039	#endif
6040	#ifdef USE_TANGENT
6041		vec3 tangent = normalize( vTangent );
6042		vec3 bitangent = normalize( vBitangent );
6043		#ifdef DOUBLE_SIDED
6044			tangent = tangent * faceDirection;
6045			bitangent = bitangent * faceDirection;
6046		#endif
6047		#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )
6048			mat3 vTBN = mat3( tangent, bitangent, normal );
6049		#endif
6050	#endif
6051#endif
6052vec3 geometryNormal = normal;`,vde=`#ifdef OBJECTSPACE_NORMALMAP
6053	normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
6054	#ifdef FLIP_SIDED
6055		normal = - normal;
6056	#endif
6057	#ifdef DOUBLE_SIDED
6058		normal = normal * faceDirection;
6059	#endif
6060	normal = normalize( normalMatrix * normal );
6061#elif defined( TANGENTSPACE_NORMALMAP )
6062	vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
6063	mapN.xy *= normalScale;
6064	#ifdef USE_TANGENT
6065		normal = normalize( vTBN * mapN );
6066	#else
6067		normal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );
6068	#endif
6069#elif defined( USE_BUMPMAP )
6070	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
6071#endif`,yde=`#ifndef FLAT_SHADED
6072	varying vec3 vNormal;
6073	#ifdef USE_TANGENT
6074		varying vec3 vTangent;
6075		varying vec3 vBitangent;
6076	#endif
6077#endif`,xde=`#ifndef FLAT_SHADED
6078	varying vec3 vNormal;
6079	#ifdef USE_TANGENT
6080		varying vec3 vTangent;
6081		varying vec3 vBitangent;
6082	#endif
6083#endif`,bde=`#ifndef FLAT_SHADED
6084	vNormal = normalize( transformedNormal );
6085	#ifdef USE_TANGENT
6086		vTangent = normalize( transformedTangent );
6087		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
6088	#endif
6089#endif`,Sde=`#ifdef USE_NORMALMAP
6090	uniform sampler2D normalMap;
6091	uniform vec2 normalScale;
6092#endif
6093#ifdef OBJECTSPACE_NORMALMAP
6094	uniform mat3 normalMatrix;
6095#endif
6096#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )
6097	vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {
6098		vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );
6099		vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );
6100		vec2 st0 = dFdx( vUv.st );
6101		vec2 st1 = dFdy( vUv.st );
6102		vec3 N = surf_norm;
6103		vec3 q1perp = cross( q1, N );
6104		vec3 q0perp = cross( N, q0 );
6105		vec3 T = q1perp * st0.x + q0perp * st1.x;
6106		vec3 B = q1perp * st0.y + q0perp * st1.y;
6107		float det = max( dot( T, T ), dot( B, B ) );
6108		float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );
6109		return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );
6110	}
6111#endif`,Mde=`#ifdef USE_CLEARCOAT
6112	vec3 clearcoatNormal = geometryNormal;
6113#endif`,wde=`#ifdef USE_CLEARCOAT_NORMALMAP
6114	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;
6115	clearcoatMapN.xy *= clearcoatNormalScale;
6116	#ifdef USE_TANGENT
6117		clearcoatNormal = normalize( vTBN * clearcoatMapN );
6118	#else
6119		clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );
6120	#endif
6121#endif`,Tde=`#ifdef USE_CLEARCOATMAP
6122	uniform sampler2D clearcoatMap;
6123#endif
6124#ifdef USE_CLEARCOAT_ROUGHNESSMAP
6125	uniform sampler2D clearcoatRoughnessMap;
6126#endif
6127#ifdef USE_CLEARCOAT_NORMALMAP
6128	uniform sampler2D clearcoatNormalMap;
6129	uniform vec2 clearcoatNormalScale;
6130#endif`,Ede=`#ifdef OPAQUE
6131diffuseColor.a = 1.0;
6132#endif
6133#ifdef USE_TRANSMISSION
6134diffuseColor.a *= transmissionAlpha + 0.1;
6135#endif
6136gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Rde=`vec3 packNormalToRGB( const in vec3 normal ) {
6137	return normalize( normal ) * 0.5 + 0.5;
6138}
6139vec3 unpackRGBToNormal( const in vec3 rgb ) {
6140	return 2.0 * rgb.xyz - 1.0;
6141}
6142const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;
6143const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
6144const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
6145const float ShiftRight8 = 1. / 256.;
6146vec4 packDepthToRGBA( const in float v ) {
6147	vec4 r = vec4( fract( v * PackFactors ), v );
6148	r.yzw -= r.xyz * ShiftRight8;	return r * PackUpscale;
6149}
6150float unpackRGBAToDepth( const in vec4 v ) {
6151	return dot( v, UnpackFactors );
6152}
6153vec4 pack2HalfToRGBA( vec2 v ) {
6154	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
6155	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
6156}
6157vec2 unpackRGBATo2Half( vec4 v ) {
6158	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
6159}
6160float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
6161	return ( viewZ + near ) / ( near - far );
6162}
6163float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {
6164	return linearClipZ * ( near - far ) - near;
6165}
6166float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
6167	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
6168}
6169float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {
6170	return ( near * far ) / ( ( far - near ) * invClipZ - far );
6171}`,Cde=`#ifdef PREMULTIPLIED_ALPHA
6172	gl_FragColor.rgb *= gl_FragColor.a;
6173#endif`,Pde=`vec4 mvPosition = vec4( transformed, 1.0 );
6174#ifdef USE_INSTANCING
6175	mvPosition = instanceMatrix * mvPosition;
6176#endif
6177mvPosition = modelViewMatrix * mvPosition;
6178gl_Position = projectionMatrix * mvPosition;`,Lde=`#ifdef DITHERING
6179	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
6180#endif`,Nde=`#ifdef DITHERING
6181	vec3 dithering( vec3 color ) {
6182		float grid_position = rand( gl_FragCoord.xy );
6183		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
6184		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
6185		return color + dither_shift_RGB;
6186	}
6187#endif`,Dde=`float roughnessFactor = roughness;
6188#ifdef USE_ROUGHNESSMAP
6189	vec4 texelRoughness = texture2D( roughnessMap, vUv );
6190	roughnessFactor *= texelRoughness.g;
6191#endif`,Ide=`#ifdef USE_ROUGHNESSMAP
6192	uniform sampler2D roughnessMap;
6193#endif`,Bde
vendor: 8,456 bytes, lines 6193-6367
6193=`#ifdef USE_SHADOWMAP
6194	#if NUM_DIR_LIGHT_SHADOWS > 0
6195		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
6196		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
6197		struct DirectionalLightShadow {
6198			float shadowBias;
6199			float shadowNormalBias;
6200			float shadowRadius;
6201			vec2 shadowMapSize;
6202		};
6203		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
6204	#endif
6205	#if NUM_SPOT_LIGHT_SHADOWS > 0
6206		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
6207		varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];
6208		struct SpotLightShadow {
6209			float shadowBias;
6210			float shadowNormalBias;
6211			float shadowRadius;
6212			vec2 shadowMapSize;
6213		};
6214		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
6215	#endif
6216	#if NUM_POINT_LIGHT_SHADOWS > 0
6217		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
6218		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
6219		struct PointLightShadow {
6220			float shadowBias;
6221			float shadowNormalBias;
6222			float shadowRadius;
6223			vec2 shadowMapSize;
6224			float shadowCameraNear;
6225			float shadowCameraFar;
6226		};
6227		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
6228	#endif
6229	float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
6230		return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
6231	}
6232	vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
6233		return unpackRGBATo2Half( texture2D( shadow, uv ) );
6234	}
6235	float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
6236		float occlusion = 1.0;
6237		vec2 distribution = texture2DDistribution( shadow, uv );
6238		float hard_shadow = step( compare , distribution.x );
6239		if (hard_shadow != 1.0 ) {
6240			float distance = compare - distribution.x ;
6241			float variance = max( 0.00000, distribution.y * distribution.y );
6242			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 );
6243		}
6244		return occlusion;
6245	}
6246	float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
6247		float shadow = 1.0;
6248		shadowCoord.xyz /= shadowCoord.w;
6249		shadowCoord.z += shadowBias;
6250		bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );
6251		bool inFrustum = all( inFrustumVec );
6252		bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );
6253		bool frustumTest = all( frustumTestVec );
6254		if ( frustumTest ) {
6255		#if defined( SHADOWMAP_TYPE_PCF )
6256			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
6257			float dx0 = - texelSize.x * shadowRadius;
6258			float dy0 = - texelSize.y * shadowRadius;
6259			float dx1 = + texelSize.x * shadowRadius;
6260			float dy1 = + texelSize.y * shadowRadius;
6261			float dx2 = dx0 / 2.0;
6262			float dy2 = dy0 / 2.0;
6263			float dx3 = dx1 / 2.0;
6264			float dy3 = dy1 / 2.0;
6265			shadow = (
6266				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
6267				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
6268				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
6269				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
6270				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
6271				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
6272				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
6273				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
6274				texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
6275				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
6276				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
6277				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
6278				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
6279				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
6280				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
6281				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
6282				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
6283			) * ( 1.0 / 17.0 );
6284		#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
6285			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
6286			float dx = texelSize.x;
6287			float dy = texelSize.y;
6288			vec2 uv = shadowCoord.xy;
6289			vec2 f = fract( uv * shadowMapSize + 0.5 );
6290			uv -= f * texelSize;
6291			shadow = (
6292				texture2DCompare( shadowMap, uv, shadowCoord.z ) +
6293				texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
6294				texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
6295				texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
6296				mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), 
6297					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
6298					 f.x ) +
6299				mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), 
6300					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
6301					 f.x ) +
6302				mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), 
6303					 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
6304					 f.y ) +
6305				mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), 
6306					 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
6307					 f.y ) +
6308				mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), 
6309						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
6310						  f.x ),
6311					 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), 
6312						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
6313						  f.x ),
6314					 f.y )
6315			) * ( 1.0 / 9.0 );
6316		#elif defined( SHADOWMAP_TYPE_VSM )
6317			shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
6318		#else
6319			shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
6320		#endif
6321		}
6322		return shadow;
6323	}
6324	vec2 cubeToUV( vec3 v, float texelSizeY ) {
6325		vec3 absV = abs( v );
6326		float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
6327		absV *= scaleToCube;
6328		v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
6329		vec2 planar = v.xy;
6330		float almostATexel = 1.5 * texelSizeY;
6331		float almostOne = 1.0 - almostATexel;
6332		if ( absV.z >= almostOne ) {
6333			if ( v.z > 0.0 )
6334				planar.x = 4.0 - v.x;
6335		} else if ( absV.x >= almostOne ) {
6336			float signX = sign( v.x );
6337			planar.x = v.z * signX + 2.0 * signX;
6338		} else if ( absV.y >= almostOne ) {
6339			float signY = sign( v.y );
6340			planar.x = v.x + 2.0 * signY + 2.0;
6341			planar.y = v.z * signY - 2.0;
6342		}
6343		return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
6344	}
6345	float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
6346		vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
6347		vec3 lightToPosition = shadowCoord.xyz;
6348		float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );		dp += shadowBias;
6349		vec3 bd3D = normalize( lightToPosition );
6350		#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
6351			vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
6352			return (
6353				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
6354				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
6355				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
6356				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
6357				texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
6358				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
6359				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
6360				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
6361				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
6362			) * ( 1.0 / 9.0 );
6363		#else
6364			return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
6365		#endif
6366	}
6367#endif`,
6367Fde=`#ifdef USE_SHADOWMAP
6368	#if NUM_DIR_LIGHT_SHADOWS > 0
6369		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
6370		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
6371		struct DirectionalLightShadow {
6372			float shadowBias;
6373			float shadowNormalBias;
6374			float shadowRadius;
6375			vec2 shadowMapSize;
6376		};
6377		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
6378	#endif
6379	#if NUM_SPOT_LIGHT_SHADOWS > 0
6380		uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];
6381		varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];
6382		struct SpotLightShadow {
6383			float shadowBias;
6384			float shadowNormalBias;
6385			float shadowRadius;
6386			vec2 shadowMapSize;
6387		};
6388		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
6389	#endif
6390	#if NUM_POINT_LIGHT_SHADOWS > 0
6391		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
6392		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
6393		struct PointLightShadow {
6394			float shadowBias;
6395			float shadowNormalBias;
6396			float shadowRadius;
6397			vec2 shadowMapSize;
6398			float shadowCameraNear;
6399			float shadowCameraFar;
6400		};
6401		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
6402	#endif
6403#endif`,Ude=`#ifdef USE_SHADOWMAP
6404	#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0
6405		vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
6406		vec4 shadowWorldPosition;
6407	#endif
6408	#if NUM_DIR_LIGHT_SHADOWS > 0
6409	#pragma unroll_loop_start
6410	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
6411		shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
6412		vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
6413	}
6414	#pragma unroll_loop_end
6415	#endif
6416	#if NUM_SPOT_LIGHT_SHADOWS > 0
6417	#pragma unroll_loop_start
6418	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
6419		shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );
6420		vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;
6421	}
6422	#pragma unroll_loop_end
6423	#endif
6424	#if NUM_POINT_LIGHT_SHADOWS > 0
6425	#pragma unroll_loop_start
6426	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
6427		shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
6428		vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
6429	}
6430	#pragma unroll_loop_end
6431	#endif
6432#endif`,Ode=`float getShadowMask() {
6433	float shadow = 1.0;
6434	#ifdef USE_SHADOWMAP
6435	#if NUM_DIR_LIGHT_SHADOWS > 0
6436	DirectionalLightShadow directionalLight;
6437	#pragma unroll_loop_start
6438	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
6439		directionalLight = directionalLightShadows[ i ];
6440		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
6441	}
6442	#pragma unroll_loop_end
6443	#endif
6444	#if NUM_SPOT_LIGHT_SHADOWS > 0
6445	SpotLightShadow spotLight;
6446	#pragma unroll_loop_start
6447	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
6448		spotLight = spotLightShadows[ i ];
6449		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;
6450	}
6451	#pragma unroll_loop_end
6452	#endif
6453	#if NUM_POINT_LIGHT_SHADOWS > 0
6454	PointLightShadow pointLight;
6455	#pragma unroll_loop_start
6456	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
6457		pointLight = pointLightShadows[ i ];
6458		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
6459	}
6460	#pragma unroll_loop_end
6461	#endif
6462	#endif
6463	return shadow;
6464}`,kde=`#ifdef USE_SKINNING
6465	mat4 boneMatX = getBoneMatrix( skinIndex.x );
6466	mat4 boneMatY = getBoneMatrix( skinIndex.y );
6467	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
6468	mat4 boneMatW = getBoneMatrix( skinIndex.w );
6469#endif`,zde=`#ifdef USE_SKINNING
6470	uniform mat4 bindMatrix;
6471	uniform mat4 bindMatrixInverse;
6472	#ifdef BONE_TEXTURE
6473		uniform highp sampler2D boneTexture;
6474		uniform int boneTextureSize;
6475		mat4 getBoneMatrix( const in float i ) {
6476			float j = i * 4.0;
6477			float x = mod( j, float( boneTextureSize ) );
6478			float y = floor( j / float( boneTextureSize ) );
6479			float dx = 1.0 / float( boneTextureSize );
6480			float dy = 1.0 / float( boneTextureSize );
6481			y = dy * ( y + 0.5 );
6482			vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );
6483			vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );
6484			vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );
6485			vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );
6486			mat4 bone = mat4( v1, v2, v3, v4 );
6487			return bone;
6488		}
6489	#else
6490		uniform mat4 boneMatrices[ MAX_BONES ];
6491		mat4 getBoneMatrix( const in float i ) {
6492			mat4 bone = boneMatrices[ int(i) ];
6493			return bone;
6494		}
6495	#endif
6496#endif`,Vde=`#ifdef USE_SKINNING
6497	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
6498	vec4 skinned = vec4( 0.0 );
6499	skinned += boneMatX * skinVertex * skinWeight.x;
6500	skinned += boneMatY * skinVertex * skinWeight.y;
6501	skinned += boneMatZ * skinVertex * skinWeight.z;
6502	skinned += boneMatW * skinVertex * skinWeight.w;
6503	transformed = ( bindMatrixInverse * skinned ).xyz;
6504#endif`,Gde=`#ifdef USE_SKINNING
6505	mat4 skinMatrix = mat4( 0.0 );
6506	skinMatrix += skinWeight.x * boneMatX;
6507	skinMatrix += skinWeight.y * boneMatY;
6508	skinMatrix += skinWeight.z * boneMatZ;
6509	skinMatrix += skinWeight.w * boneMatW;
6510	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
6511	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
6512	#ifdef USE_TANGENT
6513		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
6514	#endif
6515#endif`,qde=`float specularStrength;
6516#ifdef USE_SPECULARMAP
6517	vec4 texelSpecular = texture2D( specularMap, vUv );
6518	specularStrength = texelSpecular.r;
6519#else
6520	specularStrength = 1.0;
6521#endif`,Hde=`#ifdef USE_SPECULARMAP
6522	uniform sampler2D specularMap;
6523#endif`,Wde=`#if defined( TONE_MAPPING )
6524	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
6525#endif`,$de=`#ifndef saturate
6526#define saturate( a ) clamp( a, 0.0, 1.0 )
6527#endif
6528uniform float toneMappingExposure;
6529vec3 LinearToneMapping( vec3 color ) {
6530	return toneMappingExposure * color;
6531}
6532vec3 ReinhardToneMapping( vec3 color ) {
6533	color *= toneMappingExposure;
6534	return saturate( color / ( vec3( 1.0 ) + color ) );
6535}
6536vec3 OptimizedCineonToneMapping( vec3 color ) {
6537	color *= toneMappingExposure;
6538	color = max( vec3( 0.0 ), color - 0.004 );
6539	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
6540}
6541vec3 RRTAndODTFit( vec3 v ) {
6542	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
6543	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
6544	return a / b;
6545}
6546vec3 ACESFilmicToneMapping( vec3 color ) {
6547	const mat3 ACESInputMat = mat3(
6548		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
6549		vec3( 0.04823, 0.01566, 0.83777 )
6550	);
6551	const mat3 ACESOutputMat = mat3(
6552		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
6553		vec3( -0.07367, -0.00605,  1.07602 )
6554	);
6555	color *= toneMappingExposure / 0.6;
6556	color = ACESInputMat * color;
6557	color = RRTAndODTFit( color );
6558	color = ACESOutputMat * color;
6559	return saturate( color );
6560}
6561vec3 CustomToneMapping( vec3 color ) { return color; }`,jde=`#ifdef USE_TRANSMISSION
6562	float transmissionAlpha = 1.0;
6563	float transmissionFactor = transmission;
6564	float thicknessFactor = thickness;
6565	#ifdef USE_TRANSMISSIONMAP
6566		transmissionFactor *= texture2D( transmissionMap, vUv ).r;
6567	#endif
6568	#ifdef USE_THICKNESSMAP
6569		thicknessFactor *= texture2D( thicknessMap, vUv ).g;
6570	#endif
6571	vec3 pos = vWorldPosition;
6572	vec3 v = normalize( cameraPosition - pos );
6573	vec3 n = inverseTransformDirection( normal, viewMatrix );
6574	vec4 transmission = getIBLVolumeRefraction(
6575		n, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,
6576		pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,
6577		attenuationColor, attenuationDistance );
6578	totalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );
6579	transmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );
6580#endif`,Xde=`#ifdef USE_TRANSMISSION
6581	uniform float transmission;
6582	uniform float thickness;
6583	uniform float attenuationDistance;
6584	uniform vec3 attenuationColor;
6585	#ifdef USE_TRANSMISSIONMAP
6586		uniform sampler2D transmissionMap;
6587	#endif
6588	#ifdef USE_THICKNESSMAP
6589		uniform sampler2D thicknessMap;
6590	#endif
6591	uniform vec2 transmissionSamplerSize;
6592	uniform sampler2D transmissionSamplerMap;
6593	uniform mat4 modelMatrix;
6594	uniform mat4 projectionMatrix;
6595	varying vec3 vWorldPosition;
6596	vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) {
6597		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
6598		vec3 modelScale;
6599		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
6600		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
6601		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
6602		return normalize( refractionVector ) * thickness * modelScale;
6603	}
6604	float applyIorToRoughness( float roughness, float ior ) {
6605		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
6606	}
6607	vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior ) {
6608		float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
6609		#ifdef TEXTURE_LOD_EXT
6610			return texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );
6611		#else
6612			return texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );
6613		#endif
6614	}
6615	vec3 applyVolumeAttenuation( vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance ) {
6616		if ( attenuationDistance == 0.0 ) {
6617			return radiance;
6618		} else {
6619			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
6620			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance * radiance;
6621		}
6622	}
6623	vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 diffuseColor, vec3 specularColor, float specularF90,
6624		vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,
6625		vec3 attenuationColor, float attenuationDistance ) {
6626		vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
6627		vec3 refractedRayExit = position + transmissionRay;
6628		vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
6629		vec2 refractionCoords = ndcPos.xy / ndcPos.w;
6630		refractionCoords += 1.0;
6631		refractionCoords /= 2.0;
6632		vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
6633		vec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );
6634		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
6635		return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );
6636	}
6637#endif`,Yde=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )
6638	varying vec2 vUv;
6639#endif`,Qde=`#ifdef USE_UV
6640	#ifdef UVS_VERTEX_ONLY
6641		vec2 vUv;
6642	#else
6643		varying vec2 vUv;
6644	#endif
6645	uniform mat3 uvTransform;
6646#endif`,Zde=`#ifdef USE_UV
6647	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
6648#endif`,Kde=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
6649	varying vec2 vUv2;
6650#endif`,Jde=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
6651	attribute vec2 uv2;
6652	varying vec2 vUv2;
6653	uniform mat3 uv2Transform;
6654#endif`,efe=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
6655	vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;
6656#endif`,tfe=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )
6657	vec4 worldPosition = vec4( transformed, 1.0 );
6658	#ifdef USE_INSTANCING
6659		worldPosition = instanceMatrix * worldPosition;
6660	#endif
6661	worldPosition = modelMatrix * worldPosition;
6662#endif`;const nfe=`varying vec2 vUv;
6663uniform mat3 uvTransform;
6664void main() {
6665	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
6666	gl_Position = vec4( position.xy, 1.0, 1.0 );
6667}`,ife=`uniform sampler2D t2D;
6668varying vec2 vUv;
6669void main() {
6670	vec4 texColor = texture2D( t2D, vUv );
6671	gl_FragColor = mapTexelToLinear( texColor );
6672	#include <tonemapping_fragment>
6673	#include <encodings_fragment>
6674}`,rfe=`varying vec3 vWorldDirection;
6675#include <common>
6676void main() {
6677	vWorldDirection = transformDirection( position, modelMatrix );
6678	#include <begin_vertex>
6679	#include <project_vertex>
6680	gl_Position.z = gl_Position.w;
6681}`,sfe=`#include <envmap_common_pars_fragment>
6682uniform float opacity;
6683varying vec3 vWorldDirection;
6684#include <cube_uv_reflection_fragment>
6685void main() {
6686	vec3 vReflect = vWorldDirection;
6687	#include <envmap_fragment>
6688	gl_FragColor = envColor;
6689	gl_FragColor.a *= opacity;
6690	#include <tonemapping_fragment>
6691	#include <encodings_fragment>
6692}`,ofe=`#include <common>
6693#include <uv_pars_vertex>
6694#include <displacementmap_pars_vertex>
6695#include <morphtarget_pars_vertex>
6696#include <skinning_pars_vertex>
6697#include <logdepthbuf_pars_vertex>
6698#include <clipping_planes_pars_vertex>
6699varying vec2 vHighPrecisionZW;
6700void main() {
6701	#include <uv_vertex>
6702	#include <skinbase_vertex>
6703	#ifdef USE_DISPLACEMENTMAP
6704		#include <beginnormal_vertex>
6705		#include <morphnormal_vertex>
6706		#include <skinnormal_vertex>
6707	#endif
6708	#include <begin_vertex>
6709	#include <morphtarget_vertex>
6710	#include <skinning_vertex>
6711	#include <displacementmap_vertex>
6712	#include <project_vertex>
6713	#include <logdepthbuf_vertex>
6714	#include <clipping_planes_vertex>
6715	vHighPrecisionZW = gl_Position.zw;
6716}`,afe=`#if DEPTH_PACKING == 3200
6717	uniform float opacity;
6718#endif
6719#include <common>
6720#include <packing>
6721#include <uv_pars_fragment>
6722#include <map_pars_fragment>
6723#include <alphamap_pars_fragment>
6724#include <alphatest_pars_fragment>
6725#include <logdepthbuf_pars_fragment>
6726#include <clipping_planes_pars_fragment>
6727varying vec2 vHighPrecisionZW;
6728void main() {
6729	#include <clipping_planes_fragment>
6730	vec4 diffuseColor = vec4( 1.0 );
6731	#if DEPTH_PACKING == 3200
6732		diffuseColor.a = opacity;
6733	#endif
6734	#include <map_fragment>
6735	#include <alphamap_fragment>
6736	#include <alphatest_fragment>
6737	#include <logdepthbuf_fragment>
6738	float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
6739	#if DEPTH_PACKING == 3200
6740		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
6741	#elif DEPTH_PACKING == 3201
6742		gl_FragColor = packDepthToRGBA( fragCoordZ );
6743	#endif
6744}`,lfe=`#define DISTANCE
6745varying vec3 vWorldPosition;
6746#include <common>
6747#include <uv_pars_vertex>
6748#include <displacementmap_pars_vertex>
6749#include <morphtarget_pars_vertex>
6750#include <skinning_pars_vertex>
6751#include <clipping_planes_pars_vertex>
6752void main() {
6753	#include <uv_vertex>
6754	#include <skinbase_vertex>
6755	#ifdef USE_DISPLACEMENTMAP
6756		#include <beginnormal_vertex>
6757		#include <morphnormal_vertex>
6758		#include <skinnormal_vertex>
6759	#endif
6760	#include <begin_vertex>
6761	#include <morphtarget_vertex>
6762	#include <skinning_vertex>
6763	#include <displacementmap_vertex>
6764	#include <project_vertex>
6765	#include <worldpos_vertex>
6766	#include <clipping_planes_vertex>
6767	vWorldPosition = worldPosition.xyz;
6768}`,cfe=`#define DISTANCE
6769uniform vec3 referencePosition;
6770uniform float nearDistance;
6771uniform float farDistance;
6772varying vec3 vWorldPosition;
6773#include <common>
6774#include <packing>
6775#include <uv_pars_fragment>
6776#include <map_pars_fragment>
6777#include <alphamap_pars_fragment>
6778#include <alphatest_pars_fragment>
6779#include <clipping_planes_pars_fragment>
6780void main () {
6781	#include <clipping_planes_fragment>
6782	vec4 diffuseColor = vec4( 1.0 );
6783	#include <map_fragment>
6784	#include <alphamap_fragment>
6785	#include <alphatest_fragment>
6786	float dist = length( vWorldPosition - referencePosition );
6787	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
6788	dist = saturate( dist );
6789	gl_FragColor = packDepthToRGBA( dist );
6790}`,ufe=`varying vec3 vWorldDirection;
6791#include <common>
6792void main() {
6793	vWorldDirection = transformDirection( position, modelMatrix );
6794	#include <begin_vertex>
6795	#include <project_vertex>
6796}`,hfe=`uniform sampler2D tEquirect;
6797varying vec3 vWorldDirection;
6798#include <common>
6799void main() {
6800	vec3 direction = normalize( vWorldDirection );
6801	vec2 sampleUV = equirectUv( direction );
6802	vec4 texColor = texture2D( tEquirect, sampleUV );
6803	gl_FragColor = mapTexelToLinear( texColor );
6804	#include <tonemapping_fragment>
6805	#include <encodings_fragment>
6806}`,dfe=`uniform float scale;
6807attribute float lineDistance;
6808varying float vLineDistance;
6809#include <common>
6810#include <color_pars_vertex>
6811#include <fog_pars_vertex>
6812#include <morphtarget_pars_vertex>
6813#include <logdepthbuf_pars_vertex>
6814#include <clipping_planes_pars_vertex>
6815void main() {
6816	vLineDistance = scale * lineDistance;
6817	#include <color_vertex>
6818	#include <begin_vertex>
6819	#include <morphtarget_vertex>
6820	#include <project_vertex>
6821	#include <logdepthbuf_vertex>
6822	#include <clipping_planes_vertex>
6823	#include <fog_vertex>
6824}`,ffe=`uniform vec3 diffuse;
6825uniform float opacity;
6826uniform float dashSize;
6827uniform float totalSize;
6828varying float vLineDistance;
6829#include <common>
6830#include <color_pars_fragment>
6831#include <fog_pars_fragment>
6832#include <logdepthbuf_pars_fragment>
6833#include <clipping_planes_pars_fragment>
6834void main() {
6835	#include <clipping_planes_fragment>
6836	if ( mod( vLineDistance, totalSize ) > dashSize ) {
6837		discard;
6838	}
6839	vec3 outgoingLight = vec3( 0.0 );
6840	vec4 diffuseColor = vec4( diffuse, opacity );
6841	#include <logdepthbuf_fragment>
6842	#include <color_fragment>
6843	outgoingLight = diffuseColor.rgb;
6844	#include <output_fragment>
6845	#include <tonemapping_fragment>
6846	#include <encodings_fragment>
6847	#include <fog_fragment>
6848	#include <premultiplied_alpha_fragment>
6849}`,pfe=`#include <common>
6850#include <uv_pars_vertex>
6851#include <uv2_pars_vertex>
6852#include <envmap_pars_vertex>
6853#include <color_pars_vertex>
6854#include <fog_pars_vertex>
6855#include <morphtarget_pars_vertex>
6856#include <skinning_pars_vertex>
6857#include <logdepthbuf_pars_vertex>
6858#include <clipping_planes_pars_vertex>
6859void main() {
6860	#include <uv_vertex>
6861	#include <uv2_vertex>
6862	#include <color_vertex>
6863	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
6864		#include <beginnormal_vertex>
6865		#include <morphnormal_vertex>
6866		#include <skinbase_vertex>
6867		#include <skinnormal_vertex>
6868		#include <defaultnormal_vertex>
6869	#endif
6870	#include <begin_vertex>
6871	#include <morphtarget_vertex>
6872	#include <skinning_vertex>
6873	#include <project_vertex>
6874	#include <logdepthbuf_vertex>
6875	#include <clipping_planes_vertex>
6876	#include <worldpos_vertex>
6877	#include <envmap_vertex>
6878	#include <fog_vertex>
6879}`,Afe=`uniform vec3 diffuse;
6880uniform float opacity;
6881#ifndef FLAT_SHADED
6882	varying vec3 vNormal;
6883#endif
6884#include <common>
6885#include <dithering_pars_fragment>
6886#include <color_pars_fragment>
6887#include <uv_pars_fragment>
6888#include <uv2_pars_fragment>
6889#include <map_pars_fragment>
6890#include <alphamap_pars_fragment>
6891#include <alphatest_pars_fragment>
6892#include <aomap_pars_fragment>
6893#include <lightmap_pars_fragment>
6894#include <envmap_common_pars_fragment>
6895#include <envmap_pars_fragment>
6896#include <cube_uv_reflection_fragment>
6897#include <fog_pars_fragment>
6898#include <specularmap_pars_fragment>
6899#include <logdepthbuf_pars_fragment>
6900#include <clipping_planes_pars_fragment>
6901void main() {
6902	#include <clipping_planes_fragment>
6903	vec4 diffuseColor = vec4( diffuse, opacity );
6904	#include <logdepthbuf_fragment>
6905	#include <map_fragment>
6906	#include <color_fragment>
6907	#include <alphamap_fragment>
6908	#include <alphatest_fragment>
6909	#include <specularmap_fragment>
6910	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
6911	#ifdef USE_LIGHTMAP
6912		vec4 lightMapTexel= texture2D( lightMap, vUv2 );
6913		reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
6914	#else
6915		reflectedLight.indirectDiffuse += vec3( 1.0 );
6916	#endif
6917	#include <aomap_fragment>
6918	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
6919	vec3 outgoingLight = reflectedLight.indirectDiffuse;
6920	#include <envmap_fragment>
6921	#include <output_fragment>
6922	#include <tonemapping_fragment>
6923	#include <encodings_fragment>
6924	#include <fog_fragment>
6925	#include <premultiplied_alpha_fragment>
6926	#include <dithering_fragment>
6927}`,mfe=`#define LAMBERT
6928varying vec3 vLightFront;
6929varying vec3 vIndirectFront;
6930#ifdef DOUBLE_SIDED
6931	varying vec3 vLightBack;
6932	varying vec3 vIndirectBack;
6933#endif
6934#include <common>
6935#include <uv_pars_vertex>
6936#include <uv2_pars_vertex>
6937#include <envmap_pars_vertex>
6938#include <bsdfs>
6939#include <lights_pars_begin>
6940#include <color_pars_vertex>
6941#include <fog_pars_vertex>
6942#include <morphtarget_pars_vertex>
6943#include <skinning_pars_vertex>
6944#include <shadowmap_pars_vertex>
6945#include <logdepthbuf_pars_vertex>
6946#include <clipping_planes_pars_vertex>
6947void main() {
6948	#include <uv_vertex>
6949	#include <uv2_vertex>
6950	#include <color_vertex>
6951	#include <beginnormal_vertex>
6952	#include <morphnormal_vertex>
6953	#include <skinbase_vertex>
6954	#include <skinnormal_vertex>
6955	#include <defaultnormal_vertex>
6956	#include <begin_vertex>
6957	#include <morphtarget_vertex>
6958	#include <skinning_vertex>
6959	#include <project_vertex>
6960	#include <logdepthbuf_vertex>
6961	#include <clipping_planes_vertex>
6962	#include <worldpos_vertex>
6963	#include <envmap_vertex>
6964	#include <lights_lambert_vertex>
6965	#include <shadowmap_vertex>
6966	#include <fog_vertex>
6967}`,gfe=`uniform vec3 diffuse;
6968uniform vec3 emissive;
6969uniform float opacity;
6970varying vec3 vLightFront;
6971varying vec3 vIndirectFront;
6972#ifdef DOUBLE_SIDED
6973	varying vec3 vLightBack;
6974	varying vec3 vIndirectBack;
6975#endif
6976#include <common>
6977#include <packing>
6978#include <dithering_pars_fragment>
6979#include <color_pars_fragment>
6980#include <uv_pars_fragment>
6981#include <uv2_pars_fragment>
6982#include <map_pars_fragment>
6983#include <alphamap_pars_fragment>
6984#include <alphatest_pars_fragment>
6985#include <aomap_pars_fragment>
6986#include <lightmap_pars_fragment>
6987#include <emissivemap_pars_fragment>
6988#include <envmap_common_pars_fragment>
6989#include <envmap_pars_fragment>
6990#include <cube_uv_reflection_fragment>
6991#include <bsdfs>
6992#include <lights_pars_begin>
6993#include <fog_pars_fragment>
6994#include <shadowmap_pars_fragment>
6995#include <shadowmask_pars_fragment>
6996#include <specularmap_pars_fragment>
6997#include <logdepthbuf_pars_fragment>
6998#include <clipping_planes_pars_fragment>
6999void main() {
7000	#include <clipping_planes_fragment>
7001	vec4 diffuseColor = vec4( diffuse, opacity );
7002	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
7003	vec3 totalEmissiveRadiance = emissive;
7004	#include <logdepthbuf_fragment>
7005	#include <map_fragment>
7006	#include <color_fragment>
7007	#include <alphamap_fragment>
7008	#include <alphatest_fragment>
7009	#include <specularmap_fragment>
7010	#include <emissivemap_fragment>
7011	#ifdef DOUBLE_SIDED
7012		reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;
7013	#else
7014		reflectedLight.indirectDiffuse += vIndirectFront;
7015	#endif
7016	#include <lightmap_fragment>
7017	reflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );
7018	#ifdef DOUBLE_SIDED
7019		reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;
7020	#else
7021		reflectedLight.directDiffuse = vLightFront;
7022	#endif
7023	reflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();
7024	#include <aomap_fragment>
7025	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
7026	#include <envmap_fragment>
7027	#include <output_fragment>
7028	#include <tonemapping_fragment>
7029	#include <encodings_fragment>
7030	#include <fog_fragment>
7031	#include <premultiplied_alpha_fragment>
7032	#include <dithering_fragment>
7033}`,_fe=`#define MATCAP
7034varying vec3 vViewPosition;
7035#include <common>
7036#include <uv_pars_vertex>
7037#include <color_pars_vertex>
7038#include <displacementmap_pars_vertex>
7039#include <fog_pars_vertex>
7040#include <normal_pars_vertex>
7041#include <morphtarget_pars_vertex>
7042#include <skinning_pars_vertex>
7043#include <logdepthbuf_pars_vertex>
7044#include <clipping_planes_pars_vertex>
7045void main() {
7046	#include <uv_vertex>
7047	#include <color_vertex>
7048	#include <beginnormal_vertex>
7049	#include <morphnormal_vertex>
7050	#include <skinbase_vertex>
7051	#include <skinnormal_vertex>
7052	#include <defaultnormal_vertex>
7053	#include <normal_vertex>
7054	#include <be
7054gin_vertex>
7055	#include <morphtarget_vertex>
7056	#include <skinning_vertex>
7057	#include <displacementmap_vertex>
7058	#include <project_vertex>
7059	#include <logdepthbuf_vertex>
7060	#include <clipping_planes_vertex>
7061	#include <fog_vertex>
7062	vViewPosition = - mvPosition.xyz;
7063}`,vfe=`#define MATCAP
7064uniform vec3 diffuse;
7065uniform float opacity;
7066uniform sampler2D matcap;
7067varying vec3 vViewPosition;
7068#include <common>
7069#include <dithering_pars_fragment>
7070#include <color_pars_fragment>
7071#include <uv_pars_fragment>
7072#include <map_pars_fragment>
7073#include <alphamap_pars_fragment>
7074#include <alphatest_pars_fragment>
7075#include <fog_pars_fragment>
7076#include <normal_pars_fragment>
7077#include <bumpmap_pars_fragment>
7078#include <normalmap_pars_fragment>
7079#include <logdepthbuf_pars_fragment>
7080#include <clipping_planes_pars_fragment>
7081void main() {
7082	#include <clipping_planes_fragment>
7083	vec4 diffuseColor = vec4( diffuse, opacity );
7084	#include <logdepthbuf_fragment>
7085	#include <map_fragment>
7086	#include <color_fragment>
7087	#include <alphamap_fragment>
7088	#include <alphatest_fragment>
7089	#include <normal_fragment_begin>
7090	#include <normal_fragment_maps>
7091	vec3 viewDir = normalize( vViewPosition );
7092	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
7093	vec3 y = cross( viewDir, x );
7094	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
7095	#ifdef USE_MATCAP
7096		vec4 matcapColor = texture2D( matcap, uv );
7097		matcapColor = matcapTexelToLinear( matcapColor );
7098	#else
7099		vec4 matcapColor = vec4( 1.0 );
7100	#endif
7101	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
7102	#include <output_fragment>
7103	#include <tonemapping_fragment>
7104	#include <encodings_fragment>
7105	#include <fog_fragment>
7106	#include <premultiplied_alpha_fragment>
7107	#include <dithering_fragment>
7108}`,yfe=`#define NORMAL
7109#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
7110	varying vec3 vViewPosition;
7111#endif
7112#include <common>
7113#include <uv_pars_vertex>
7114#include <displacementmap_pars_vertex>
7115#include <normal_pars_vertex>
7116#include <morphtarget_pars_vertex>
7117#include <skinning_pars_vertex>
7118#include <logdepthbuf_pars_vertex>
7119#include <clipping_planes_pars_vertex>
7120void main() {
7121	#include <uv_vertex>
7122	#include <beginnormal_vertex>
7123	#include <morphnormal_vertex>
7124	#include <skinbase_vertex>
7125	#include <skinnormal_vertex>
7126	#include <defaultnormal_vertex>
7127	#include <normal_vertex>
7128	#include <begin_vertex>
7129	#include <morphtarget_vertex>
7130	#include <skinning_vertex>
7131	#include <displacementmap_vertex>
7132	#include <project_vertex>
7133	#include <logdepthbuf_vertex>
7134	#include <clipping_planes_vertex>
7135#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
7136	vViewPosition = - mvPosition.xyz;
7137#endif
7138}`,xfe=`#define NORMAL
7139uniform float opacity;
7140#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
7141	varying vec3 vViewPosition;
7142#endif
7143#include <packing>
7144#include <uv_pars_fragment>
7145#include <normal_pars_fragment>
7146#include <bumpmap_pars_fragment>
7147#include <normalmap_pars_fragment>
7148#include <logdepthbuf_pars_fragment>
7149#include <clipping_planes_pars_fragment>
7150void main() {
7151	#include <clipping_planes_fragment>
7152	#include <logdepthbuf_fragment>
7153	#include <normal_fragment_begin>
7154	#include <normal_fragment_maps>
7155	gl_FragColor = vec4( packNormalToRGB( normal ), opacity );
7156}`,bfe=`#define PHONG
7157varying vec3 vViewPosition;
7158#include <common>
7159#include <uv_pars_vertex>
7160#include <uv2_pars_vertex>
7161#include <displacementmap_pars_vertex>
7162#include <envmap_pars_vertex>
7163#include <color_pars_vertex>
7164#include <fog_pars_vertex>
7165#include <normal_pars_vertex>
7166#include <morphtarget_pars_vertex>
7167#include <skinning_pars_vertex>
7168#include <shadowmap_pars_vertex>
7169#include <logdepthbuf_pars_vertex>
7170#include <clipping_planes_pars_vertex>
7171void main() {
7172	#include <uv_vertex>
7173	#include <uv2_vertex>
7174	#include <color_vertex>
7175	#include <beginnormal_vertex>
7176	#include <morphnormal_vertex>
7177	#include <skinbase_vertex>
7178	#include <skinnormal_vertex>
7179	#include <defaultnormal_vertex>
7180	#include <normal_vertex>
7181	#include <begin_vertex>
7182	#include <morphtarget_vertex>
7183	#include <skinning_vertex>
7184	#include <displacementmap_vertex>
7185	#include <project_vertex>
7186	#include <logdepthbuf_vertex>
7187	#include <clipping_planes_vertex>
7188	vViewPosition = - mvPosition.xyz;
7189	#include <worldpos_vertex>
7190	#include <envmap_vertex>
7191	#include <shadowmap_vertex>
7192	#include <fog_vertex>
7193}`,Sfe=`#define PHONG
7194uniform vec3 diffuse;
7195uniform vec3 emissive;
7196uniform vec3 specular;
7197uniform float shininess;
7198uniform float opacity;
7199#include <common>
7200#include <packing>
7201#include <dithering_pars_fragment>
7202#include <color_pars_fragment>
7203#include <uv_pars_fragment>
7204#include <uv2_pars_fragment>
7205#include <map_pars_fragment>
7206#include <alphamap_pars_fragment>
7207#include <alphatest_pars_fragment>
7208#include <aomap_pars_fragment>
7209#include <lightmap_pars_fragment>
7210#include <emissivemap_pars_fragment>
7211#include <envmap_common_pars_fragment>
7212#include <envmap_pars_fragment>
7213#include <cube_uv_reflection_fragment>
7214#include <fog_pars_fragment>
7215#include <bsdfs>
7216#include <lights_pars_begin>
7217#include <normal_pars_fragment>
7218#include <lights_phong_pars_fragment>
7219#include <shadowmap_pars_fragment>
7220#include <bumpmap_pars_fragment>
7221#include <normalmap_pars_fragment>
7222#include <specularmap_pars_fragment>
7223#include <logdepthbuf_pars_fragment>
7224#include <clipping_planes_pars_fragment>
7225void main() {
7226	#include <clipping_planes_fragment>
7227	vec4 diffuseColor = vec4( diffuse, opacity );
7228	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
7229	vec3 totalEmissiveRadiance = emissive;
7230	#include <logdepthbuf_fragment>
7231	#include <map_fragment>
7232	#include <color_fragment>
7233	#include <alphamap_fragment>
7234	#include <alphatest_fragment>
7235	#include <specularmap_fragment>
7236	#include <normal_fragment_begin>
7237	#include <normal_fragment_maps>
7238	#include <emissivemap_fragment>
7239	#include <lights_phong_fragment>
7240	#include <lights_fragment_begin>
7241	#include <lights_fragment_maps>
7242	#include <lights_fragment_end>
7243	#include <aomap_fragment>
7244	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
7245	#include <envmap_fragment>
7246	#include <output_fragment>
7247	#include <tonemapping_fragment>
7248	#include <encodings_fragment>
7249	#include <fog_fragment>
7250	#include <premultiplied_alpha_fragment>
7251	#include <dithering_fragment>
7252}`,Mfe=`#define STANDARD
7253varying vec3 vViewPosition;
7254#ifdef USE_TRANSMISSION
7255	varying vec3 vWorldPosition;
7256#endif
7257#include <common>
7258#include <uv_pars_vertex>
7259#include <uv2_pars_vertex>
7260#include <displacementmap_pars_vertex>
7261#include <color_pars_vertex>
7262#include <fog_pars_vertex>
7263#include <normal_pars_vertex>
7264#include <morphtarget_pars_vertex>
7265#include <skinning_pars_vertex>
7266#include <shadowmap_pars_vertex>
7267#include <logdepthbuf_pars_vertex>
7268#include <clipping_planes_pars_vertex>
7269void main() {
7270	#include <uv_vertex>
7271	#include <uv2_vertex>
7272	#include <color_vertex>
7273	#include <beginnormal_vertex>
7274	#include <morphnormal_vertex>
7275	#include <skinbase_vertex>
7276	#include <skinnormal_vertex>
7277	#include <defaultnormal_vertex>
7278	#include <normal_vertex>
7279	#include <begin_vertex>
7280	#include <morphtarget_vertex>
7281	#include <skinning_vertex>
7282	#include <displacementmap_vertex>
7283	#include <project_vertex>
7284	#include <logdepthbuf_vertex>
7285	#include <clipping_planes_vertex>
7286	vViewPosition = - mvPosition.xyz;
7287	#include <worldpos_vertex>
7288	#include <shadowmap_vertex>
7289	#include <fog_vertex>
7290#ifdef USE_TRANSMISSION
7291	vWorldPosition = worldPosition.xyz;
7292#endif
7293}`,wfe=`#define STANDARD
7294#ifdef PHYSICAL
7295	#define IOR
7296	#define SPECULAR
7297#endif
7298uniform vec3 diffuse;
7299uniform vec3 emissive;
7300uniform float roughness;
7301uniform float metalness;
7302uniform float opacity;
7303#ifdef IOR
7304	uniform float ior;
7305#endif
7306#ifdef SPECULAR
7307	uniform float specularIntensity;
7308	uniform vec3 specularColor;
7309	#ifdef USE_SPECULARINTENSITYMAP
7310		uniform sampler2D specularIntensityMap;
7311	#endif
7312	#ifdef USE_SPECULARCOLORMAP
7313		uniform sampler2D specularColorMap;
7314	#endif
7315#endif
7316#ifdef USE_CLEARCOAT
7317	uniform float clearcoat;
7318	uniform float clearcoatRoughness;
7319#endif
7320#ifdef USE_SHEEN
7321	uniform vec3 sheenColor;
7322	uniform float sheenRoughness;
7323	#ifdef USE_SHEENCOLORMAP
7324		uniform sampler2D sheenColorMap;
7325	#endif
7326	#ifdef USE_SHEENROUGHNESSMAP
7327		uniform sampler2D sheenRoughnessMap;
7328	#endif
7329#endif
7330varying vec3 vViewPosition;
7331#include <common>
7332#include <packing>
7333#include <dithering_pars_fragment>
7334#include <color_pars_fragment>
7335#include <uv_pars_fragment>
7336#include <uv2_pars_fragment>
7337#include <map_pars_fragment>
7338#include <alphamap_pars_fragment>
7339#include <alphatest_pars_fragment>
7340#include <aomap_pars_fragment>
7341#include <lightmap_pars_fragment>
7342#include <emissivemap_pars_fragment>
7343#include <bsdfs>
7344#include <cube_uv_reflection_fragment>
7345#include <envmap_common_pars_fragment>
7346#include <envmap_physical_pars_fragment>
7347#include <fog_pars_fragment>
7348#include <lights_pars_begin>
7349#include <normal_pars_fragment>
7350#include <lights_physical_pars_fragment>
7351#include <transmission_pars_fragment>
7352#include <shadowmap_pars_fragment>
7353#include <bumpmap_pars_fragment>
7354#include <normalmap_pars_fragment>
7355#include <clearcoat_pars_fragment>
7356#include <roughnessmap_pars_fragment>
7357#include <metalnessmap_pars_fragment>
7358#include <logdepthbuf_pars_fragment>
7359#include <clipping_planes_pars_fragment>
7360void main() {
7361	#include <clipping_planes_fragment>
7362	vec4 diffuseColor = vec4( diffuse, opacity );
7363	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
7364	vec3 totalEmissiveRadiance = emissive;
7365	#include <logdepthbuf_fragment>
7366	#include <map_fragment>
7367	#include <color_fragment>
7368	#include <alphamap_fragment>
7369	#include <alphatest_fragment>
7370	#include <roughnessmap_fragment>
7371	#include <metalnessmap_fragment>
7372	#include <normal_fragment_begin>
7373	#include <normal_fragment_maps>
7374	#include <clearcoat_normal_fragment_begin>
7375	#include <clearcoat_normal_fragment_maps>
7376	#include <emissivemap_fragment>
7377	#include <lights_physical_fragment>
7378	#include <lights_fragment_begin>
7379	#include <lights_fragment_maps>
7380	#include <lights_fragment_end>
7381	#include <aomap_fragment>
7382	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
7383	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
7384	#include <transmission_fragment>
7385	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
7386	#ifdef USE_CLEARCOAT
7387		float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );
7388		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
7389		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;
7390	#endif
7391	#include <output_fragment>
7392	#include <tonemapping_fragment>
7393	#include <encodings_fragment>
7394	#include <fog_fragment>
7395	#include <premultiplied_alpha_fragment>
7396	#include <dithering_fragment>
7397}`,Tfe=`#define TOON
7398varying vec3 vViewPosition;
7399#include <common>
7400#include <uv_pars_vertex>
7401#include <uv2_pars_vertex>
7402#include <displacementmap_pars_vertex>
7403#include <color_pars_vertex>
7404#include <fog_pars_vertex>
7405#include <normal_pars_vertex>
7406#include <morphtarget_pars_vertex>
7407#include <skinning_pars_vertex>
7408#include <shadowmap_pars_vertex>
7409#include <logdepthbuf_pars_vertex>
7410#include <clipping_planes_pars_vertex>
7411void main() {
7412	#include <uv_vertex>
7413	#include <uv2_vertex>
7414	#include <color_vertex>
7415	#include <beginnormal_vertex>
7416	#include <morphnormal_vertex>
7417	#include <skinbase_vertex>
7418	#include <skinnormal_vertex>
7419	#include <defaultnormal_vertex>
7420	#include <normal_vertex>
7421	#include <begin_vertex>
7422	#include <morphtarget_vertex>
7423	#include <skinning_vertex>
7424	#include <displacementmap_vertex>
7425	#include <project_vertex>
7426	#include <logdepthbuf_vertex>
7427	#include <clipping_planes_vertex>
7428	vViewPosition = - mvPosition.xyz;
7429	#include <worldpos_vertex>
7430	#include <shadowmap_vertex>
7431	#include <fog_vertex>
7432}`,Efe=`#define TOON
7433uniform vec3 diffuse;
7434uniform vec3 emissive;
7435uniform float opacity;
7436#include <common>
7437#include <packing>
7438#include <dithering_pars_fragment>
7439#include <color_pars_fragment>
7440#include <uv_pars_fragment>
7441#include <uv2_pars_fragment>
7442#include <map_pars_fragment>
7443#include <alphamap_pars_fragment>
7444#include <alphatest_pars_fragment>
7445#include <aomap_pars_fragment>
7446#include <lightmap_pars_fragment>
7447#include <emissivemap_pars_fragment>
7448#include <gradientmap_pars_fragment>
7449#include <fog_pars_fragment>
7450#include <bsdfs>
7451#include <lights_pars_begin>
7452#include <normal_pars_fragment>
7453#include <lights_toon_pars_fragment>
7454#include <shadowmap_pars_fragment>
7455#include <bumpmap_pars_fragment>
7456#include <normalmap_pars_fragment>
7457#include <logdepthbuf_pars_fragment>
7458#include <clipping_planes_pars_fragment>
7459void main() {
7460	#include <clipping_planes_fragment>
7461	vec4 diffuseColor = vec4( diffuse, opacity );
7462	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
7463	vec3 totalEmissiveRadiance = emissive;
7464	#include <logdepthbuf_fragment>
7465	#include <map_fragment>
7466	#include <color_fragment>
7467	#include <alphamap_fragment>
7468	#include <alphatest_fragment>
7469	#include <normal_fragment_begin>
7470	#include <normal_fragment_maps>
7471	#include <emissivemap_fragment>
7472	#include <lights_toon_fragment>
7473	#include <lights_fragment_begin>
7474	#include <lights_fragment_maps>
7475	#include <lights_fragment_end>
7476	#include <aomap_fragment>
7477	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
7478	#include <output_fragment>
7479	#include <tonemapping_fragment>
7480	#include <encodings_fragment>
7481	#include <fog_fragment>
7482	#include <premultiplied_alpha_fragment>
7483	#include <dithering_fragment>
7484}`,Rfe=`uniform float size;
7485uniform float scale;
7486#include <common>
7487#include <color_pars_vertex>
7488#include <fog_pars_vertex>
7489#include <morphtarget_pars_vertex>
7490#include <logdepthbuf_pars_vertex>
7491#include <clipping_planes_pars_vertex>
7492void main() {
7493	#include <color_vertex>
7494	#include <begin_vertex>
7495	#include <morphtarget_vertex>
7496	#include <project_vertex>
7497	gl_PointSize = size;
7498	#ifdef USE_SIZEATTENUATION
7499		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
7500		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
7501	#endif
7502	#include <logdepthbuf_vertex>
7503	#include <clipping_planes_vertex>
7504	#include <worldpos_vertex>
7505	#include <fog_vertex>
7506}`,Cfe=`uniform vec3 diffuse;
7507uniform float opacity;
7508#include <common>
7509#include <color_pars_fragment>
7510#include <map_particle_pars_fragment>
7511#include <alphatest_pars_fragment>
7512#include <fog_pars_fragment>
7513#include <logdepthbuf_pars_fragment>
7514#include <clipping_planes_pars_fragment>
7515void main() {
7516	#include <clipping_planes_fragment>
7517	vec3 outgoingLight = vec3( 0.0 );
7518	vec4 diffuseColor = vec4( diffuse, opacity );
7519	#include <logdepthbuf_fragment>
7520	#include <map_particle_fragment>
7521	#include <color_fragment>
7522	#include <alphatest_fragment>
7523	outgoingLight = diffuseColor.rgb;
7524	#include <output_fragment>
7525	#include <tonemapping_fragment>
7526	#include <encodings_fragment>
7527	#include <fog_fragment>
7528	#include <premultiplied_alpha_fragment>
7529}`,Pfe=`#include <common>
7530#include <fog_pars_vertex>
7531#include <morphtarget_pars_vertex>
7532#include <skinning_pars_vertex>
7533#include <shadowmap_pars_vertex>
7534void main() {
7535	#include <beginnormal_vertex>
7536	#include <morphnormal_vertex>
7537	#include <skinbase_vertex>
7538	#include <skinnormal_vertex>
7539	#include <defaultnormal_vertex>
7540	#include <begin_vertex>
7541	#include <morphtarget_vertex>
7542	#include <skinning_vertex>
7543	#include <project_vertex>
7544	#include <worldpos_vertex>
7545	#include <shadowmap_vertex>
7546	#include <fog_vertex>
7547}`,Lfe=`uniform vec3 color;
7548uniform float opacity;
7549#include <common>
7550#include <packing>
7551#include <fog_pars_fragment>
7552#include <bsdfs>
7553#include <lights_pars_begin>
7554#include <shadowmap_pars_fragment>
7555#include <shadowmask_pars_fragment>
7556void main() {
7557	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
7558	#include <tonemapping_fragment>
7559	#include <encodings_fragment>
7560	#include <fog_fragment>
7561}`,Nfe=`uniform float rotation;
7562uniform vec2 center;
7563#include <common>
7564#include <uv_pars_vertex>
7565#include <fog_pars_vertex>
7566#include <logdepthbuf_pars_vertex>
7567#include <clipping_planes_pars_vertex>
7568void main() {
7569	#include <uv_vertex>
7570	vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
7571	vec2 scale;
7572	scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
7573	scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
7574	#ifndef USE_SIZEATTENUATION
7575		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
7576		if ( isPerspective ) scale *= - mvPosition.z;
7577	#endif
7578	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
7579	vec2 rotatedPosition;
7580	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
7581	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
7582	mvPosition.xy += rotatedPosition;
7583	gl_Position = projectionMatrix * mvPosition;
7584	#include <logdepthbuf_vertex>
7585	#include <clipping_planes_vertex>
7586	#include <fog_vertex>
7587}`,Dfe=`uniform vec3 diffuse;
7588uniform float opacity;
7589#include <common>
7590#include <uv_pars_fragment>
7591#include <map_pars_fragment>
7592#include <alphamap_pars_fragment>
7593#include <alphatest_pars_fragment>
7594#include <fog_pars_fragment>
7595#include <logdepthbuf_pars_fragment>
7596#include <clipping_planes_pars_fragment>
7597void main() {
7598	#include <clipping_planes_fragment>
7599	vec3 outgoingLight = vec3( 0.0 );
7600	vec4 diffuseColor = vec4( diffuse, opacity );
7601	#include <logdepthbuf_fragment>
7602	#include <map_fragment>
7603	#include <alphamap_fragment>
7604	#include <alphatest_fragment>
7605	outgoingLight = diffuseColor.rgb;
7606	#include <output_fragment>
7607	#include <tonemapping_fragment>
7608	#include <encodings_fragment>
7609	#include <fog_fragment>
7610}`,Fn={alphamap_fragment:lhe,alphamap_pars_fragment:che,alphatest_fragment:uhe,alphatest_pars_fragment:hhe,aomap_fragment:dhe,aomap_pars_fragment:fhe,begin_vertex:phe,beginnormal_vertex:Ahe,bsdfs:mhe,bumpmap_pars_fragment:ghe,clipping_planes_fragment:_he,clipping_planes_pars_fragment:vhe,clipping_planes_pars_vertex:yhe,clipping_planes_vertex:xhe,color_fragment:bhe,color_pars_fragment:She,color_pars_vertex:Mhe,color_vertex:whe,common:The,cube_uv_reflection_fragment:Ehe,defaultnormal_vertex:Rhe,displacementmap_pars_vertex:Che,displacementmap_vertex:Phe,emissivemap_fragment:Lhe,emissivemap_pars_fragment:Nhe,encodings_fragment:Dhe,encodings_pars_fragment:Ihe,envmap_fragment:Bhe,envmap_common_pars_fragment:Fhe,envmap_pars_fragment:Uhe,envmap_pars_vertex:Ohe,envmap_physical_pars_fragment:Yhe,envmap_vertex:khe,fog_vertex:zhe,fog_pars_vertex:Vhe,fog_fragment:Ghe,fog_pars_fragment:qhe,gradientmap_pars_fragment:Hhe,lightmap_fragment:Whe,lightmap_pars_fragment:$he,lights_lambert_vertex:jhe,lights_pars_begin:Xhe,lights_toon_fragment:Qhe,lights_toon_pars_fragment:Zhe,lights_phong_fragment:Khe,lights_phong_pars_fragment:Jhe,lights_physical_fragment:ede,lights_physical_pars_fragment:tde,lights_fragment_begin:nde,lights_fragment_maps:ide,lights_fragment_end:rde,logdepthbuf_fragment:sde,logdepthbuf_pars_fragment:ode,logdepthbuf_pars_vertex:ade,logdepthbuf_vertex:lde,map_fragment:cde,map_pars_fragment:ude,map_particle_fragment:hde,map_particle_pars_fragment:dde,metalnessmap_fragment:fde,metalnessmap_pars_fragment:pde,morphnormal_vertex:Ade,morphtarget_pars_vertex:mde,morphtarget_vertex:gde,normal_fragment_begin:_de,normal_fragment_maps:vde,normal_pars_fragment:yde,normal_pars_vertex:xde,normal_vertex:bde,normalmap_pars_fragment:Sde,clearcoat_normal_fragment_begin:Mde,clearcoat_normal_fragment_maps:wde,clearcoat_pars_fragment:Tde,output_fragment:Ede,packing:Rde,premultiplied_alpha_fragment:Cde,project_vertex:Pde,dithering_fragment:Lde,dithering_pars_fragment:Nde,roughnessmap_fragment:Dde,roughnessmap_pars_fragment:Ide,shadowmap_pars_fragment:Bde,shadowmap_pars_vertex:Fde,shadowmap_vertex:Ude,shadowmask_pars_fragment:Ode,skinbase_vertex:kde,skinning_pars_vertex:zde,skinning_vertex:Vde,skinnormal_vertex:Gde,specularmap_fragment:qde,specularmap_pars_fragment:Hde,tonemapping_fragment:Wde,tonemapping_pars_fragment:$de,transmission_fragment:jde,transmission_pars_fragment:Xde,uv_pars_fragment:Yde,uv_pars_vertex:Qde,uv_vertex:Zde,uv2_pars_fragment:Kde,uv2_pars_vertex:Jde,uv2_vertex:efe,worldpos_vertex:tfe,background_vert:nfe,background_frag:ife,cube_vert:rfe,cube_frag:sfe,depth_vert:ofe,depth_frag:afe,distanceRGBA_vert:lfe,distanceRGBA_frag:cfe,equirect_vert:ufe,equirect_frag:hfe,linedashed_vert:dfe,linedashed_frag:ffe,meshbasic_vert:pfe,meshbasic_frag:Afe,meshlambert_vert:mfe,meshlambert_frag:gfe,meshmatcap_vert:_fe,meshmatcap_frag:vfe,meshnormal_vert:yfe,meshnormal_frag:xfe,meshphong_vert:bfe,meshphong_frag:Sfe,meshphysical_vert:Mfe,meshphysical_frag:wfe,meshtoon_vert:Tfe,meshtoon_frag:Efe,points_vert:Rfe,points_frag:Cfe,shadow_vert:Pfe,shadow_frag:Lfe,sprite_vert:Nfe,sprite_frag:Dfe},Ft={common:{diffuse:{value:new en(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new $r},uv2Transform:{value:new $r},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Mt(1,1)}}
vendor: 5,465 bytes, line 7610
7610,displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new en(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new en(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new $r}},sprite:{diffuse:{value:new en(16777215)},opacity:{value:1},center:{value:new Mt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new $r}}},Fa={basic:{uniforms:ss([Ft.common,Ft.specularmap,Ft.envmap,Ft.aomap,Ft.lightmap,Ft.fog]),vertexShader:Fn.meshbasic_vert,fragmentShader:Fn.meshbasic_frag},lambert:{uniforms:ss([Ft.common,Ft.specularmap,Ft.envmap,Ft.aomap,Ft.lightmap,Ft.emissivemap,Ft.fog,Ft.lights,{emissive:{value:new en(0)}}]),vertexShader:Fn.meshlambert_vert,fragmentShader:Fn.meshlambert_frag},phong:{uniforms:ss([Ft.common,Ft.specularmap,Ft.envmap,Ft.aomap,Ft.lightmap,Ft.emissivemap,Ft.bumpmap,Ft.normalmap,Ft.displacementmap,Ft.fog,Ft.lights,{emissive:{value:new en(0)},specular:{value:new en(1118481)},shininess:{value:30}}]),vertexShader:Fn.meshphong_vert,fragmentShader:Fn.meshphong_frag},standard:{uniforms:ss([Ft.common,Ft.envmap,Ft.aomap,Ft.lightmap,Ft.emissivemap,Ft.bumpmap,Ft.normalmap,Ft.displacementmap,Ft.roughnessmap,Ft.metalnessmap,Ft.fog,Ft.lights,{emissive:{value:new en(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Fn.meshphysical_vert,fragmentShader:Fn.meshphysical_frag},toon:{uniforms:ss([Ft.common,Ft.aomap,Ft.lightmap,Ft.emissivemap,Ft.bumpmap,Ft.normalmap,Ft.displacementmap,Ft.gradientmap,Ft.fog,Ft.lights,{emissive:{value:new en(0)}}]),vertexShader:Fn.meshtoon_vert,fragmentShader:Fn.meshtoon_frag},matcap:{uniforms:ss([Ft.common,Ft.bumpmap,Ft.normalmap,Ft.displacementmap,Ft.fog,{matcap:{value:null}}]),vertexShader:Fn.meshmatcap_vert,fragmentShader:Fn.meshmatcap_frag},points:{uniforms:ss([Ft.points,Ft.fog]),vertexShader:Fn.points_vert,fragmentShader:Fn.points_frag},dashed:{uniforms:ss([Ft.common,Ft.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Fn.linedashed_vert,fragmentShader:Fn.linedashed_frag},depth:{uniforms:ss([Ft.common,Ft.displacementmap]),vertexShader:Fn.depth_vert,fragmentShader:Fn.depth_frag},normal:{uniforms:ss([Ft.common,Ft.bumpmap,Ft.normalmap,Ft.displacementmap,{opacity:{value:1}}]),vertexShader:Fn.meshnormal_vert,fragmentShader:Fn.meshnormal_frag},sprite:{uniforms:ss([Ft.sprite,Ft.fog]),vertexShader:Fn.sprite_vert,fragmentShader:Fn.sprite_frag},background:{uniforms:{uvTransform:{value:new $r},t2D:{value:null}},vertexShader:Fn.background_vert,fragmentShader:Fn.background_frag},cube:{uniforms:ss([Ft.envmap,{opacity:{value:1}}]),vertexShader:Fn.cube_vert,fragmentShader:Fn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Fn.equirect_vert,fragmentShader:Fn.equirect_frag},distanceRGBA:{uniforms:ss([Ft.common,Ft.displacementmap,{referencePosition:{value:new _e},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Fn.distanceRGBA_vert,fragmentShader:Fn.distanceRGBA_frag},shadow:{uniforms:ss([Ft.lights,Ft.fog,{color:{value:new en(0)},opacity:{value:1}}]),vertexShader:Fn.shadow_vert,fragmentShader:Fn.shadow_frag}};Fa.physical={uniforms:ss([Fa.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Mt(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new en(0)},sheenColorMap:{value:null},sheenRoughness:{value:0},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Mt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new en(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularColor:{value:new en(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Fn.meshphysical_vert,fragmentShader:Fn.meshphysical_frag};function Ife(i,e,t,n,r){const s=new en(0);let o=0,a,l,c=null,u=0,p=null;function m(v,b){let M=!1,x=b.isScene===!0?b.background:null;x&&x.isTexture&&(x=e.get(x));
7610const w=i.xr,R=w.getSession&&w.getSession();R&&R.environmentBlendMode==="additive"&&(x=null),x===null?g(s,o):x&&x.isColor&&(g(x,1),M=!0),(i.autoClear||M)&&i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil),x&&(x.isCubeTexture||x.mapping===Mv)?(l===void 0&&(l=new Gs(new em(1,1,1),new uh({name:"BackgroundCubeMaterial",uniforms:Of(Fa.cube.uniforms),vertexShader:Fa.cube.vertexShader,fragmentShader:Fa.cube.fragmentShader,side:_r,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(C,N,D){this.matrixWorld.copyPosition(D.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=x,l.material.uniforms.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,(c!==x||u!==x.version||p!==i.toneMapping)&&(l.material.needsUpdate=!0,c=x,u=x.version,p=i.toneMapping),v.unshift(l,l.geometry,l.material,0,0,null)):x&&x.isTexture&&(a===void 0&&(a=new Gs(new $w(2,2),new uh({name:"BackgroundMaterial",uniforms:Of(Fa.background.uniforms),vertexShader:Fa.background.vertexShader,fragmentShader:Fa.background.fragmentShader,side:v0,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=x,x.matrixAutoUpdate===!0&&x.updateMatrix(),a.material.uniforms.uvTransform.value.copy(x.matrix),(c!==x||u!==x.version||p!==i.toneMapping)&&(a.material.needsUpdate=!0,c=x,u=x.version,p=i.toneMapping),v.unshift(a,a.geometry,a.material,0,0,null))}function g(v,b){t.buffers.color.setClear(v.r,v.g,v.b,b,r)}return{getClearColor:function(){return s},setClearColor:function(v,b=1){s.set(v),o=b,g(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(v){o=v,g(s,o)},render:m}}function Bfe(i,e,t,n){const r=i.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=b(null);let c=l;function u(W,Q,J,H,$){let K=!1;if(o){const he=v(H,J,Q);c!==he&&(c=he,m(c.object)),K=M(H,$),K&&x(H,$)}else{const he=Q.wireframe===!0;(c.geometry!==H.id||c.program!==J.id||c.wireframe!==he)&&(c.geometry=H.id,c.program=J.id,c.wireframe=he,K=!0)}W.isInstancedMesh===!0&&(K=!0),$!==null&&t.update($,34963),K&&(P(W,Q,J,H),$!==null&&i.bindBuffer(34963,t.get($).buffer))}function p(){return n.isWebGL2?i.createVertexArray():s.createVertexArrayOES()}function m(W){return n.isWebGL2?i.bindVertexArray(W):s.bindVertexArrayOES(W)}function g(W){return n.isWebGL2?i.deleteVertexArray(W):s.deleteVertexArrayOES(W)}function v(W,Q,J){const H=J.wireframe===!0;let $=a[W.id];$===void 0&&($={},a[W.id]=$);let K=$[Q.id];K===void 0&&(K={},$[Q.id]=K);let he=K[H];return he===void 0&&(he=b(p()),K[H]=he),he}function b(W){const Q=[],J=[],H=[];for(let $=0;$<r;$++)Q[$]=0,J[$]=0,H[$]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:Q,enabledAttributes:J,attributeDivisors:H,object:W,attributes:{},index:null}}function M(W,Q){const J=c.attributes,H=W.attributes;let $=0;for(const K in H){const he=J[K],ie=H[K];if(he===void 0||he.attribute!==ie||he.data!==ie.data)return!0;$++}return c.attributesNum!==$||c.index!==Q}function x(W,Q){const J={},H=W.attributes;let $=0;for(const K in H){const he=H[K],ie={};ie.attribute=he,he.data&&(ie.data=he.data),J[K]=ie,$++}c.attributes=J,c.attributesNum=$,c.index=Q}function w(){const W=c.newAttributes;for(let Q=0,J=W.length;Q<J;Q++)W[Q]=0}function R(W){C(W,0)}function C(W,Q){const J=c.newAttributes,H=c.enabledAttributes,$=c.attributeDivisors;J[W]=1,H[W]===0&&(i.enableVertexAttribArray(W),H[W]=1),$[W]!==Q&&((n.isWebGL2?i:e.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](W,Q),$[W]=Q)}function N(){const W=c.newAttributes,Q=c.enabledAttributes;for(let J=0,H=Q.length;J<H;J++)Q[J]!==W[J]&&(i.disableVertexAttribArray(J),Q[J]=0)}function D(W,Q,J,H,$,K){n.isWebGL2===!0&&(J===5124||J===5125)?i.vertexAttribIPointer(W,Q,J,$,K):i.vertexAttribPointer(W,Q,J,H,$,K)}
vendor: 5,438 bytes, line 7610
7610function P(W,Q,J,H){if(n.isWebGL2===!1&&(W.isInstancedMesh||H.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;w();const $=H.attributes,K=J.getAttributes(),he=Q.defaultAttributeValues;for(const ie in K){const de=K[ie];if(de.location>=0){let Ce=$[ie];if(Ce===void 0&&(ie==="instanceMatrix"&&W.instanceMatrix&&(Ce=W.instanceMatrix),ie==="instanceColor"&&W.instanceColor&&(Ce=W.instanceColor)),Ce!==void 0){const Fe=Ce.normalized,ge=Ce.itemSize,Ge=t.get(Ce);if(Ge===void 0)continue;const Me=Ge.buffer,Ye=Ge.type,ct=Ge.bytesPerElement;if(Ce.isInterleavedBufferAttribute){const Je=Ce.data,Ke=Je.stride,Rt=Ce.offset;if(Je&&Je.isInstancedInterleavedBuffer){for(let Ue=0;Ue<de.locationSize;Ue++)C(de.location+Ue,Je.meshPerAttribute);W.isInstancedMesh!==!0&&H._maxInstanceCount===void 0&&(H._maxInstanceCount=Je.meshPerAttribute*Je.count)}else for(let Ue=0;Ue<de.locationSize;Ue++)R(de.location+Ue);i.bindBuffer(34962,Me);for(let Ue=0;Ue<de.locationSize;Ue++)D(de.location+Ue,ge/de.locationSize,Ye,Fe,Ke*ct,(Rt+ge/de.locationSize*Ue)*ct)}else{if(Ce.isInstancedBufferAttribute){for(let Je=0;Je<de.locationSize;Je++)C(de.location+Je,Ce.meshPerAttribute);W.isInstancedMesh!==!0&&H._maxInstanceCount===void 0&&(H._maxInstanceCount=Ce.meshPerAttribute*Ce.count)}else for(let Je=0;Je<de.locationSize;Je++)R(de.location+Je);i.bindBuffer(34962,Me);for(let Je=0;Je<de.locationSize;Je++)D(de.location+Je,ge/de.locationSize,Ye,Fe,ge*ct,ge/de.locationSize*Je*ct)}}else if(he!==void 0){const Fe=he[ie];if(Fe!==void 0)switch(Fe.length){case 2:i.vertexAttrib2fv(de.location,Fe);break;case 3:i.vertexAttrib3fv(de.location,Fe);break;case 4:i.vertexAttrib4fv(de.location,Fe);break;default:i.vertexAttrib1fv(de.location,Fe)}}}}N()}function O(){k();for(const W in a){const Q=a[W];for(const J in Q){const H=Q[J];for(const $ in H)g(H[$].object),delete H[$];delete Q[J]}delete a[W]}}function I(W){if(a[W.id]===void 0)return;const Q=a[W.id];for(const J in Q){const H=Q[J];for(const $ in H)g(H[$].object),delete H[$];delete Q[J]}delete a[W.id]}function F(W){for(const Q in a){const J=a[Q];if(J[W.id]===void 0)continue;const H=J[W.id];for(const $ in H)g(H[$].object),delete H[$];delete J[W.id]}}function k(){Y(),c!==l&&(c=l,m(c.object))}function Y(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:u,reset:k,resetDefaultState:Y,dispose:O,releaseStatesOfGeometry:I,releaseStatesOfProgram:F,initAttributes:w,enableAttribute:R,disableUnusedAttributes:N}}function Ffe(i,e,t,n){const r=n.isWebGL2;let s;function o(c){s=c}function a(c,u){i.drawArrays(s,c,u),t.update(u,s,1)}function l(c,u,p){if(p===0)return;let m,g;if(r)m=i,g="drawArraysInstanced";else if(m=e.get("ANGLE_instanced_arrays"),g="drawArraysInstancedANGLE",m===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}m[g](s,c,u,p),t.update(u,s,p)}this.setMode=o,this.render=a,this.renderInstances=l}function Ufe(i,e,t){let n;function r(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){const P=e.get("EXT_texture_filter_anisotropic");n=i.getParameter(P.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(P){if(P==="highp"){if(i.getShaderPrecisionFormat(35633,36338).precision>0&&i.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";P="mediump"}return P==="mediump"&&i.getShaderPrecisionFormat(35633,36337).precision>0&&i.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&i instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&i instanceof WebGL2ComputeRenderingContext;let a=t.precision!==void 0?t.precision:"highp";const l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,p=i.getParameter(34930),m=i.getParameter(35660),g=i.getParameter(3379),v=i.getParameter(34076),b=i.getParameter(34921),M=i.getParameter(36347),x=i.getParameter(36348),w=i.getParameter(36349),R=m>0,C=o||e.has("OES_texture_float"),N=R&&C,D=o?i.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:r,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:p,maxVertexTextures:m,maxTextureSize:g,maxCubemapSize:v,maxAttributes:b,maxVertexUniforms:M,maxVaryings:x,maxFragmentUniforms:w,vertexTextures:R,floatFragmentTextures:C,floatVertexTextures:N,maxSamples:D}}function Ofe(i){const e=this;let t=null,n=0,r=!1,s=!1;const o=new Tl,a=new $r,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(p,m,g){const v=p.length!==0||m||n!==0||r;return r=m,t=u(p,g,0),n=p.length,v},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(p,m,g){const v=p.clippingPlanes,b=p.clipIntersection,M=p.clipShadows,x=i.get(p);if(!r||v===null||v.length===0||s&&!M)s?u(null):c();else{const w=s?0:n,R=w*4;let C=x.clippingState||null;l.value=C,C=u(v,m,R,g);for(let N=0;N!==R;++N)C[N]=t[N];x.clippingState=C,this.numIntersection=b?this.numPlanes:0,this.numPlanes+=w}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(p,m,g,v){const b=p!==null?p.length:0;let M=null;if(b!==0){if(M=l.value,v!==!0||M===null){const x=g+b*4,w=m.matrixWorldInverse;a.getNormalMatrix(w),(M===null||M.length<x)&&(M=new Float32Array(x)
7610);for(let R=0,C=g;R!==b;++R,C+=4)o.copy(p[R]).applyMatrix4(w,a),o.normal.toArray(M,C),M[C+3]=o.constant}l.value=M,l.needsUpdate=!0}return e.numPlanes=b,e.numIntersection=0,M}}function kfe(i){let e=new WeakMap;function t(o,a){return a===nS?o.mapping=K0:a===iS&&(o.mapping=J0),o}function n(o){if(o&&o.isTexture&&o.isRenderTargetTexture===!1){const a=o.mapping;if(a===nS||a===iS)if(e.has(o)){const l=e.get(o).texture;return t(l,o.mapping)}else{const l=o.image;if(l&&l.height>0){const c=i.getRenderTarget(),u=new P7(l.height/2);return u.fromEquirectangularTexture(i,o),e.set(o,u),i.setRenderTarget(c),o.addEventListener("dispose",r),t(u.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}class jw extends Hw{constructor(e=-1,t=1,n=1,r=-1,s=.1,o=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,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=e,this.view.fullHeight=t,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 e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=n-e,o=n+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}jw.prototype.isOrthographicCamera=!0;class Pv extends uh{constructor(e){super(e),this.type="RawShaderMaterial"}}Pv.prototype.isRawShaderMaterial=!0;const Jd=4,Oc=8,Na=Math.pow(2,Oc),N7=[.125,.215,.35,.446,.526,.582],D7=Oc-Jd+1+N7.length,vd=20,hh={[Js]:0,[Tv]:1,[Vw]:2,[S7]:3,[M7]:4,[w7]:5,[zw]:6},v2=new jw,{_lodPlanes:Qp,_sizeLods:F4,_sigmas:Wg}=Gfe(),U4=new en;let y2=null;const Nu=(1+Math.sqrt(5))/2,yd=1/Nu,O4=[new _e(1,1,1),new _e(-1,1,1),new _e(1,1,-1),new _e(-1,1,-1),new _e(0,Nu,yd),new _e(0,Nu,-yd),new _e(yd,0,Nu),new _e(-yd,0,Nu),new _e(Nu,yd,0),new _e(-Nu,yd,0)];class zfe{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=qfe(vd),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,r=100){y2=this._renderer.getRenderTarget();const s=this._allocateTargets();return this._sceneToCubeUV(e,n,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=V4(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=z4(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e<Qp.length;e++)Qp[e].dispose()}_cleanup(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(y2),e.scissorTest=!1,$g(e,0,0,e.width,e.height)}_fromTexture(e){y2=this._renderer.getRenderTarget();const t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t}_allocateTargets(e){const t={magFilter:Fr,minFilter:Fr,generateMipmaps:!1,type:$c,format:Yce,encoding:Vfe(e)?e.encoding:Vw,depthBuffer:!1},n=k4(t);return n.depthBuffer=!e,this._pingPongRenderTarget=k4(t),n}_compileMaterial(e){const t=new Gs(Qp[0],e);this._renderer.compile(t,v2)}_sceneToCubeUV(e,t,n,r){const a=new Us(90,1,t,n),l=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],u=this._renderer,p=u.autoClear,m=u.outputEncoding,g=u.toneMapping;u.getClearColor(U4),u.toneMapping=Zu,u.outputEncoding=Js,u.autoClear=!1;
7610const v=new qw({name:"PMREM.Background",side:_r,depthWrite:!1,depthTest:!1}),b=new Gs(new em,v);let M=!1;const x=e.background;x?x.isColor&&(v.color.copy(x),e.background=null,M=!0):(v.color.copy(U4),M=!0);for(let w=0;w<6;w++){const R=w%3;R==0?(a.up.set(0,l[w],0),a.lookAt(c[w],0,0)):R==1?(a.up.set(0,0,l[w]),a.lookAt(0,c[w],0)):(a.up.set(0,l[w],0),a.lookAt(0,0,c[w])),$g(r,R*Na,w>2?Na:0,Na,Na),u.setRenderTarget(r),M&&u.render(b,a),u.render(e,a)}b.geometry.dispose(),b.material.dispose(),u.toneMapping=g,u.outputEncoding=m,u.autoClear=p,e.background=x}_setEncoding(e,t){e.value=hh[t.encoding]}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===K0||e.mapping===J0;r?this._cubemapShader==null&&(this._cubemapShader=V4()):this._equirectShader==null&&(this._equirectShader=z4());const s=r?this._cubemapShader:this._equirectShader,o=new Gs(Qp[0],s),a=s.uniforms;a.envMap.value=e,r||a.texelSize.value.set(1/e.image.width,1/e.image.height),this._setEncoding(a.inputEncoding,e),this._setEncoding(a.outputEncoding,t.texture),$g(t,0,0,3*Na,2*Na),n.setRenderTarget(t),n.render(o,v2)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let r=1;r<D7;r++){const s=Math.sqrt(Wg[r]*Wg[r]-Wg[r-1]*Wg[r-1]),o=O4[(r-1)%O4.length];this._blur(e,r-1,r,s,o)}t.autoClear=n}_blur(e,t,n,r,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,r,"latitudinal",s),this._halfBlur(o,e,n,n,r,"longitudinal",s)}_halfBlur(e,t,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 u=3,p=new Gs(Qp[r],c),m=c.uniforms,g=F4[n]-1,v=isFinite(s)?Math.PI/(2*g):2*Math.PI/(2*vd-1),b=s/v,M=isFinite(s)?1+Math.floor(u*b):vd;M>vd&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${M} samples when the maximum is set to ${vd}`);const x=[];let w=0;for(let D=0;D<vd;++D){const P=D/b,O=Math.exp(-P*P/2);x.push(O),D==0?w+=O:D<M&&(w+=2*O)}for(let D=0;D<x.length;D++)x[D]=x[D]/w;m.envMap.value=e.texture,m.samples.value=M,m.weights.value=x,m.latitudinal.value=o==="latitudinal",a&&(m.poleAxis.value=a),m.dTheta.value=v,m.mipInt.value=Oc-n,this._setEncoding(m.inputEncoding,e.texture),this._setEncoding(m.outputEncoding,e.texture);const R=F4[r],C=3*Math.max(0,Na-2*R),N=(r===0?0:2*Na)+2*R*(r>Oc-Jd?r-Oc+Jd:0);$g(t,C,N,3*R,2*R),l.setRenderTarget(t),l.render(p,v2)}}function Vfe(i){return i===void 0||i.type!==$c?!1:i.encoding===Js||i.encoding===Tv||i.encoding===zw}function Gfe(){const i=[],e=[],t=[];let n=Oc;for(let r=0;r<D7;r++){const s=Math.pow(2,n);e.push(s);let o=1/s;r>Oc-Jd?o=N7[r-Oc+Jd-1]:r==0&&(o=0),t.push(o);const a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],p=6,m=6,g=3,v=2,b=1,M=new Float32Array(g*m*p),x=new Float32Array(v*m*p),w=new Float32Array(b*m*p);for(let C=0;C<p;C++){const N=C%3*2/3-1,D=C>2?0:-1,P=[N,D,0,N+2/3,D,0,N+2/3,D+1,0,N,D,0,N+2/3,D+1,0,N,D+1,0];M.set(P,g*m*C),x.set(u,v*m*C);const O=[C,C,C,C,C,C];w.set(O,b*m*C)}const R=new Fi;R.setAttribute("position",new br(M,g)),R.setAttribute("uv",new br(x,v)),R.setAttribute("faceIndex",new br(w,b)),i.push(R),n>Jd&&n--}return{_lodPlanes:i,_sizeLods:e,_sigmas:t}}function k4(i){const e=new Go(3*Na,3*Na,i);return e.texture.mapping=Mv,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function $g(i,e,t,n,r){i.viewport.set(e,t,n,r),i.scissor.set(e,t,n,r)}function qfe(i){const e=new Float32Array(i),t=new _e(0,1,0);return new Pv({name:"SphericalGaussianBlur",defines:{n:i},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:hh[Js]},outputEncoding:{value:hh[Js]}},vertexShader:Xw(),fragmentShader:`
7611
7612			precision mediump float;
7613			precision mediump int;
7614
7615			varying vec3 vOutputDirection;
7616
7617			uniform sampler2D envMap;
7618			uniform int samples;
7619			uniform float weights[ n ];
7620			uniform bool latitudinal;
7621			uniform float dTheta;
7622			uniform float mipInt;
7623			uniform vec3 poleAxis;
7624
7625			${Yw()}
7626
7627			#define ENVMAP_TYPE_CUBE_UV
7628			#include <cube_uv_reflection_fragment>
7629
7630			vec3 getSample( float theta, vec3 axis ) {
7631
7632				float cosTheta = cos( theta );
7633				// Rodrigues' axis-angle rotation
7634				vec3 sampleDirection = vOutputDirection * cosTheta
7635					+ cross( axis, vOutputDirection ) * sin( theta )
7636					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
7637
7638				return bilinearCubeUV( envMap, sampleDirection, mipInt );
7639
7640			}
7641
7642			void main() {
7643
7644				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
7645
7646				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
7647
7648					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
7649
7650				}
7651
7652				axis = normalize( axis );
7653
7654				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
7655				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
7656
7657				for ( int i = 1; i < n; i++ ) {
7658
7659					if ( i >= samples ) {
7660
7661						break;
7662
7663					}
7664
7665					float theta = dTheta * float( i );
7666					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
7667					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
7668
7669				}
7670
7671				gl_FragColor = linearToOutputTexel( gl_FragColor );
7672
7673			}
7674		`,blending:Uc,depthTest:!1,depthWrite:!1})}function z4(){const i=new Mt(1,1);
vendor: 7,483 bytes, lines 7674-7867
7674return new Pv({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:i},inputEncoding:{value:hh[Js]},outputEncoding:{value:hh[Js]}},vertexShader:Xw(),fragmentShader:`
7675
7676			precision mediump float;
7677			precision mediump int;
7678
7679			varying vec3 vOutputDirection;
7680
7681			uniform sampler2D envMap;
7682			uniform vec2 texelSize;
7683
7684			${Yw()}
7685
7686			#include <common>
7687
7688			void main() {
7689
7690				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
7691
7692				vec3 outputDirection = normalize( vOutputDirection );
7693				vec2 uv = equirectUv( outputDirection );
7694
7695				vec2 f = fract( uv / texelSize - 0.5 );
7696				uv -= f * texelSize;
7697				vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;
7698				uv.x += texelSize.x;
7699				vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;
7700				uv.y += texelSize.y;
7701				vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;
7702				uv.x -= texelSize.x;
7703				vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;
7704
7705				vec3 tm = mix( tl, tr, f.x );
7706				vec3 bm = mix( bl, br, f.x );
7707				gl_FragColor.rgb = mix( tm, bm, f.y );
7708
7709				gl_FragColor = linearToOutputTexel( gl_FragColor );
7710
7711			}
7712		`,blending:Uc,depthTest:!1,depthWrite:!1})}function V4(){return new Pv({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:hh[Js]},outputEncoding:{value:hh[Js]}},vertexShader:Xw(),fragmentShader:`
7713
7714			precision mediump float;
7715			precision mediump int;
7716
7717			varying vec3 vOutputDirection;
7718
7719			uniform samplerCube envMap;
7720
7721			${Yw()}
7722
7723			void main() {
7724
7725				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
7726				gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;
7727				gl_FragColor = linearToOutputTexel( gl_FragColor );
7728
7729			}
7730		`,blending:Uc,depthTest:!1,depthWrite:!1})}function Xw(){return`
7731
7732		precision mediump float;
7733		precision mediump int;
7734
7735		attribute vec3 position;
7736		attribute vec2 uv;
7737		attribute float faceIndex;
7738
7739		varying vec3 vOutputDirection;
7740
7741		// RH coordinate system; PMREM face-indexing convention
7742		vec3 getDirection( vec2 uv, float face ) {
7743
7744			uv = 2.0 * uv - 1.0;
7745
7746			vec3 direction = vec3( uv, 1.0 );
7747
7748			if ( face == 0.0 ) {
7749
7750				direction = direction.zyx; // ( 1, v, u ) pos x
7751
7752			} else if ( face == 1.0 ) {
7753
7754				direction = direction.xzy;
7755				direction.xz *= -1.0; // ( -u, 1, -v ) pos y
7756
7757			} else if ( face == 2.0 ) {
7758
7759				direction.x *= -1.0; // ( -u, v, 1 ) pos z
7760
7761			} else if ( face == 3.0 ) {
7762
7763				direction = direction.zyx;
7764				direction.xz *= -1.0; // ( -1, v, -u ) neg x
7765
7766			} else if ( face == 4.0 ) {
7767
7768				direction = direction.xzy;
7769				direction.xy *= -1.0; // ( -u, -1, v ) neg y
7770
7771			} else if ( face == 5.0 ) {
7772
7773				direction.z *= -1.0; // ( u, v, -1 ) neg z
7774
7775			}
7776
7777			return direction;
7778
7779		}
7780
7781		void main() {
7782
7783			vOutputDirection = getDirection( uv, faceIndex );
7784			gl_Position = vec4( position, 1.0 );
7785
7786		}
7787	`}function Yw(){return`
7788
7789		uniform int inputEncoding;
7790		uniform int outputEncoding;
7791
7792		#include <encodings_pars_fragment>
7793
7794		vec4 inputTexelToLinear( vec4 value ) {
7795
7796			if ( inputEncoding == 0 ) {
7797
7798				return value;
7799
7800			} else if ( inputEncoding == 1 ) {
7801
7802				return sRGBToLinear( value );
7803
7804			} else if ( inputEncoding == 2 ) {
7805
7806				return RGBEToLinear( value );
7807
7808			} else if ( inputEncoding == 3 ) {
7809
7810				return RGBMToLinear( value, 7.0 );
7811
7812			} else if ( inputEncoding == 4 ) {
7813
7814				return RGBMToLinear( value, 16.0 );
7815
7816			} else if ( inputEncoding == 5 ) {
7817
7818				return RGBDToLinear( value, 256.0 );
7819
7820			} else {
7821
7822				return GammaToLinear( value, 2.2 );
7823
7824			}
7825
7826		}
7827
7828		vec4 linearToOutputTexel( vec4 value ) {
7829
7830			if ( outputEncoding == 0 ) {
7831
7832				return value;
7833
7834			} else if ( outputEncoding == 1 ) {
7835
7836				return LinearTosRGB( value );
7837
7838			} else if ( outputEncoding == 2 ) {
7839
7840				return LinearToRGBE( value );
7841
7842			} else if ( outputEncoding == 3 ) {
7843
7844				return LinearToRGBM( value, 7.0 );
7845
7846			} else if ( outputEncoding == 4 ) {
7847
7848				return LinearToRGBM( value, 16.0 );
7849
7850			} else if ( outputEncoding == 5 ) {
7851
7852				return LinearToRGBD( value, 256.0 );
7853
7854			} else {
7855
7856				return LinearToGamma( value, 2.2 );
7857
7858			}
7859
7860		}
7861
7862		vec4 envMapTexelToLinear( vec4 color ) {
7863
7864			return inputTexelToLinear( color );
7865
7866		}
7867	`}function Hfe(i){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){const l=a.mapping,c=l===nS||l===iS,u=l===K0||l===J0;if(c||u){if(e.has(a))return e.get(a).texture;{const p=a.image;if(c&&p&&p.height>0||u&&p&&r(p)){const m=i.getRenderTarget();t===null&&(t=new zfe(i));const g=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,g),i.setRenderTarget(m),a.addEventListener("dispose",s),g.texture}else return null}}}return a}function r(a){let l=0;const c=6;for(let u=0;u<c;u++)a[u]!==void 0&&l++;return l===c}function s(a){const l=a.target;l.removeEventListener("dispose",s);const c=e.get(l);c!==void 0&&(e.delete(l),c.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:o}}function Wfe(i){const e={};function t(n){if(e[n]!==void 0)return e[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 e[n]=r,r}return{has:function(n){return t(n)!==null},init:function(n){n.isWebGL2?t("EXT_color_buffer_float"):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture")},get:function(n){const r=t(n);return r===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),r}}}function $fe(i,e,t,n){const r={},s=new WeakMap;function o(p){const m=p.target;m.index!==null&&e.remove(m.index);for(const v in m.attributes)e.remove(m.attributes[v]);m.removeEventListener("dispose",o),delete r[m.id];const g=s.get(m);g&&(e.remove(g),s.delete(m)),n.releaseStatesOfGeometry(m),m.isInstancedBufferGeometry===!0&&delete m._maxInstanceCount,t.memory.geometries--}function a(p,m){return r[m.id]===!0||(m.addEventListener("dispose",o),r[m.id]=!0,t.memory.geometries++),m}function l(p){const m=p.attributes;for(const v in m)e.update(m[v],34962);const g=p.morphAttributes;for(const v in g){const b=g[v];for(let M=0,x=b.length;M<x;M++)e.update(b[M],34962)}}function c(p){const m=[],g=p.index,v=p.attributes.position;let b=0;if(g!==null){const w=g.array;b=g.version;for(let R=0,C=w.length;R<C;R+=3){const N=w[R+0],D=w[R+1],P=w[R+2];m.push(N,D,D,P,P,N)}}else{const w=v.array;b=v.version;for(let R=0,C=w.length/3-1;R<C;R+=3){const N=R+0,D=R+1,P=R+2;m.push(N,D,D,P,P,N)}}const M=new(T7(m)>65535?C7:R7)(m,1);M.version=b;const x=s.get(p);x&&e.remove(x),s.set(p,M)}function u(p){const m=s.get(p);if(m){const g=p.index;g!==null&&m.version<g.version&&c(p)}
7867else c(p);return s.get(p)}return{get:a,update:l,getWireframeAttribute:u}}function jfe(i,e,t,n){const r=n.isWebGL2;let s;function o(m){s=m}let a,l;function c(m){a=m.type,l=m.bytesPerElement}function u(m,g){i.drawElements(s,g,a,m*l),t.update(g,s,1)}function p(m,g,v){if(v===0)return;let b,M;if(r)b=i,M="drawElementsInstanced";else if(b=e.get("ANGLE_instanced_arrays"),M="drawElementsInstancedANGLE",b===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}b[M](s,g,a,m*l,v),t.update(g,s,v)}this.setMode=o,this.setIndex=c,this.render=u,this.renderInstances=p}function Xfe(i){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,o,a){switch(t.calls++,o){case 4:t.triangles+=a*(s/3);break;case 1:t.lines+=a*(s/2);break;case 3:t.lines+=a*(s-1);break;case 2:t.lines+=a*s;break;case 0:t.points+=a*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function r(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:r,update:n}}class Qw extends jr{constructor(e=null,t=1,n=1,r=1){super(null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=Fr,this.minFilter=Fr,this.wrapR=yo,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Qw.prototype.isDataTexture2DArray=!0;function Yfe(i,e){return i[0]-e[0]}function Qfe(i,e){return Math.abs(e[1])-Math.abs(i[1])}function G4(i,e){let t=1;const n=e.isInterleavedBufferAttribute?e.data.array:e.array;n instanceof Int8Array?t=127:n instanceof Int16Array?t=32767:n instanceof Int32Array?t=2147483647:console.error("THREE.WebGLMorphtargets: Unsupported morph attribute data type: ",n),i.divideScalar(t)}function Zfe(i,e,t){const n={},r=new Float32Array(8),s=new WeakMap,o=new _e,a=[];for(let c=0;c<8;c++)a[c]=[c,0];function l(c,u,p,m){const g=c.morphTargetInfluences;if(e.isWebGL2===!0){const v=u.morphAttributes.position.length;let b=s.get(u);if(b===void 0||b.count!==v){b!==void 0&&b.texture.dispose();const w=u.morphAttributes.normal!==void 0,R=u.morphAttributes.position,C=u.morphAttributes.normal||[],N=u.attributes.position.count,D=w===!0?2:1;let P=N*D,O=1;P>e.maxTextureSize&&(O=Math.ceil(P/e.maxTextureSize),P=e.maxTextureSize);const I=new Float32Array(P*O*4*v),F=new Qw(I,P,O,v);F.format=Ts,F.type=Ec;const k=D*4;for(let Y=0;Y<v;Y++){const W=R[Y],Q=C[Y],J=P*O*4*Y;for(let H=0;H<W.count;H++){o.fromBufferAttribute(W,H),W.normalized===!0&&G4(o,W);const $=H*k;I[J+$+0]=o.x,I[J+$+1]=o.y,I[J+$+2]=o.z,I[J+$+3]=0,w===!0&&(o.fromBufferAttribute(Q,H),Q.normalized===!0&&G4(o,Q),I[J+$+4]=o.x,I[J+$+5]=o.y,I[J+$+6]=o.z,I[J+$+7]=0)}}b={count:v,texture:F,size:new Mt(P,O)},s.set(u,b)}let M=0;for(let w=0;w<g.length;w++)M+=g[w];const x=u.morphTargetsRelative?1:1-M;m.getUniforms().setValue(i,"morphTargetBaseInfluence",x),m.getUniforms().setValue(i,"morphTargetInfluences",g),m.getUniforms().setValue(i,"morphTargetsTexture",b.texture,t),m.getUniforms().setValue(i,"morphTargetsTextureSize",b.size)}else{const v=g===void 0?0:g.length;let b=n[u.id];if(b===void 0||b.length!==v){b=[];for(let C=0;C<v;C++)b[C]=[C,0];n[u.id]=b}for(let C=0;C<v;C++){const N=b[C];N[0]=C,N[1]=g[C]}b.sort(Qfe);for(let C=0;C<8;C++)C<v&&b[C][1]?(a[C][0]=b[C][0],a[C][1]=b[C][1]):(a[C][0]=Number.MAX_SAFE_INTEGER,a[C][1]=0);a.sort(Yfe);const M=u.morphAttributes.position,x=u.morphAttributes.normal;let w=0;for(let C=0;C<8;C++){const N=a[C],D=N[0],P=N[1];D!==Number.MAX_SAFE_INTEGER&&P?(M&&u.getAttribute("morphTarget"+C)!==M[D]&&u.setAttribute("morphTarget"+C,M[D]),x&&u.getAttribute("morphNormal"+C)!==x[D]&&u.setAttribute("morphNormal"+C,x[D]),r[C]=P,w+=P):(M&&u.hasAttribute("morphTarget"+C)===!0&&u.deleteAttribute("morphTarget"+C),x&&u.hasAttribute("morphNormal"+C)===!0&&u.deleteAttribute("morphNormal"+C),r[C]=0)}const R=u.morphTargetsRelative?1:1-w;m.getUniforms().setValue(i,"morphTargetBaseInfluence",R),m.getUniforms().setValue(i,"morphTargetInfluences",r)}}return{update:l}}function Kfe(i,e,t,n){let r=new WeakMap;function s(l){const c=n.render.frame,u=l.geometry,p=e.get(l,u);return r.get(p)!==c&&(e.update(p),r.set(p,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",a)===!1&&l.addEventListener("dispose",a),t.update(l.instanceMatrix,34962),l.instanceColor!==null&&t.update(l.instanceColor,34962)),p}function o(){r=new WeakMap}function a(l){const c=l.target;c.removeEventListener("dispose",a),t.remove(c.instanceMatrix),c.instanceColor!==null&&t.remove(c.instanceColor)}return{update:s,dispose:o}}class I7 extends jr{constructor(e=null,t=1,n=1,r=1){super(null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=Fr,this.minFilter=Fr,this.wrapR=yo,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}I7.prototype.isDataTexture3D=!0;const B7=new jr,F7=new Qw,U7=new I7,O7=new Rv,q4=[],H4=[],W4=new Float32Array(16),$4=new Float32Array(9),j4=new Float32Array(4);function rp(i,e,t){const n=i[0];if(n<=0||n>0)return i;const r=e*t;let s=q4[r];if(s===void 0&&(s=new Float32Array(r),q4[r]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,i[o].toArray(s,a)}return s}function Rs(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t<n;t++)if(i[t]!==e[t])return!1;return!0}function ds(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function Lv(i,e){let t=H4[e];t===void 0&&(t=new Int32Array(e),H4[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function Jfe(i,e){const t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function epe(i,e){const t=this.cache;
vendor: 4,614 bytes, line 7867
7867if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Rs(t,e))return;i.uniform2fv(this.addr,e),ds(t,e)}}function tpe(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(i.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Rs(t,e))return;i.uniform3fv(this.addr,e),ds(t,e)}}function npe(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Rs(t,e))return;i.uniform4fv(this.addr,e),ds(t,e)}}function ipe(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Rs(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),ds(t,e)}else{if(Rs(t,n))return;j4.set(n),i.uniformMatrix2fv(this.addr,!1,j4),ds(t,n)}}function rpe(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Rs(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),ds(t,e)}else{if(Rs(t,n))return;$4.set(n),i.uniformMatrix3fv(this.addr,!1,$4),ds(t,n)}}function spe(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Rs(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),ds(t,e)}else{if(Rs(t,n))return;W4.set(n),i.uniformMatrix4fv(this.addr,!1,W4),ds(t,n)}}function ope(i,e){const t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function ape(i,e){const t=this.cache;Rs(t,e)||(i.uniform2iv(this.addr,e),ds(t,e))}function lpe(i,e){const t=this.cache;Rs(t,e)||(i.uniform3iv(this.addr,e),ds(t,e))}function cpe(i,e){const t=this.cache;Rs(t,e)||(i.uniform4iv(this.addr,e),ds(t,e))}function upe(i,e){const t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function hpe(i,e){const t=this.cache;Rs(t,e)||(i.uniform2uiv(this.addr,e),ds(t,e))}function dpe(i,e){const t=this.cache;Rs(t,e)||(i.uniform3uiv(this.addr,e),ds(t,e))}function fpe(i,e){const t=this.cache;Rs(t,e)||(i.uniform4uiv(this.addr,e),ds(t,e))}function ppe(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.safeSetTexture2D(e||B7,r)}function Ape(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture3D(e||U7,r)}function mpe(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.safeSetTextureCube(e||O7,r)}function gpe(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture2DArray(e||F7,r)}function _pe(i){switch(i){case 5126:return Jfe;case 35664:return epe;case 35665:return tpe;case 35666:return npe;case 35674:return ipe;case 35675:return rpe;case 35676:return spe;case 5124:case 35670:return ope;case 35667:case 35671:return ape;case 35668:case 35672:return lpe;case 35669:case 35673:return cpe;case 5125:return upe;case 36294:return hpe;case 36295:return dpe;case 36296:return fpe;case 35678:case 36198:case 36298:case 36306:case 35682:return ppe;case 35679:case 36299:case 36307:return Ape;case 35680:case 36300:case 36308:case 36293:return mpe;case 36289:case 36303:case 36311:case 36292:return gpe}}function vpe(i,e){i.uniform1fv(this.addr,e)}function ype(i,e){const t=rp(e,this.size,2);i.uniform2fv(this.addr,t)}function xpe(i,e){const t=rp(e,this.size,3);i.uniform3fv(this.addr,t)}function bpe(i,e){const t=rp(e,this.size,4);i.uniform4fv(this.addr,t)}function Spe(i,e){const t=rp(e,this.size,4);i.uniformMatrix2fv(this.addr,!1,t)}function Mpe(i,e){const t=rp(e,this.size,9);i.uniformMatrix3fv(this.addr,!1,t)}function wpe(i,e){const t=rp(e,this.size,16);i.uniformMatrix4fv(this.addr,!1,t)}function Tpe(i,e){i.uniform1iv(this.addr,e)}function Epe(i,e){i.uniform2iv(this.addr,e)}function Rpe(i,e){i.uniform3iv(this.addr,e)}function Cpe(i,e){i.uniform4iv(this.addr,e)}function Ppe(i,e){i.uniform1uiv(this.addr,e)}function Lpe(i,e){i.uniform2uiv(this.addr,e)}function Npe(i,e){i.uniform3uiv(this.addr,e)}function Dpe(i,e){i.uniform4uiv(this.addr,e)}function Ipe(i,e,t){const n=e.length,r=Lv(t,n);i.uniform1iv(this.addr,r);for(let s=0;s!==n;++s)t.safeSetTexture2D(e[s]||B7,r[s])}function Bpe(i,e,t){const n=e.length,r=Lv(t,n);i.uniform1iv(this.addr,r);for(let s=0;s!==n;++s)t.setTexture3D(e[s]||U7,r[s])}function Fpe(i,e,t){const n=e.length,r=Lv(t,n);i.uniform1iv(this.addr,r);for(let s=0;s!==n;++s)t.safeSetTextureCube(e[s]||O7,r[s])}function Upe(i,e,t){const n=e.length,r=Lv(t,n);i.uniform1iv(this.addr,r);for(let s=0;s!==n;++s)t.setTexture2DArray(e[s]||F7,r[s])}function Ope(i){switch(i){case 5126:return vpe;case 35664:return ype;case 35665:return xpe;
7867case 35666:return bpe;case 35674:return Spe;case 35675:return Mpe;case 35676:return wpe;case 5124:case 35670:return Tpe;case 35667:case 35671:return Epe;case 35668:case 35672:return Rpe;case 35669:case 35673:return Cpe;case 5125:return Ppe;case 36294:return Lpe;case 36295:return Npe;case 36296:return Dpe;case 35678:case 36198:case 36298:case 36306:case 35682:return Ipe;case 35679:case 36299:case 36307:return Bpe;case 35680:case 36300:case 36308:case 36293:return Fpe;case 36289:case 36303:case 36311:case 36292:return Upe}}function kpe(i,e,t){this.id=i,this.addr=t,this.cache=[],this.setValue=_pe(e.type)}function k7(i,e,t){this.id=i,this.addr=t,this.cache=[],this.size=e.size,this.setValue=Ope(e.type)}k7.prototype.updateCache=function(i){const e=this.cache;i instanceof Float32Array&&e.length!==i.length&&(this.cache=new Float32Array(i.length)),ds(e,i)};function z7(i){this.id=i,this.seq=[],this.map={}}z7.prototype.setValue=function(i,e,t){const n=this.seq;for(let r=0,s=n.length;r!==s;++r){const o=n[r];o.setValue(i,e[o.id],t)}};const x2=/(\w+)(\])?(\[|\.)?/g;function X4(i,e){i.seq.push(e),i.map[e.id]=e}function zpe(i,e,t){const n=i.name,r=n.length;for(x2.lastIndex=0;;){const s=x2.exec(n),o=x2.lastIndex;let a=s[1];const l=s[2]==="]",c=s[3];if(l&&(a=a|0),c===void 0||c==="["&&o+2===r){X4(t,c===void 0?new kpe(a,i,e):new k7(a,i,e));break}else{let p=t.map[a];p===void 0&&(p=new z7(a),X4(t,p)),t=p}}}function kc(i,e){this.seq=[],this.map={};const t=i.getProgramParameter(e,35718);for(let n=0;n<t;++n){const r=i.getActiveUniform(e,n),s=i.getUniformLocation(e,r.name);zpe(r,s,this)}}kc.prototype.setValue=function(i,e,t,n){const r=this.map[e];r!==void 0&&r.setValue(i,t,n)};kc.prototype.setOptional=function(i,e,t){const n=e[t];n!==void 0&&this.setValue(i,t,n)};kc.upload=function(i,e,t,n){for(let r=0,s=e.length;r!==s;++r){const o=e[r],a=t[o.id];a.needsUpdate!==!1&&o.setValue(i,a.value,n)}};kc.seqWithValue=function(i,e){const t=[];for(let n=0,r=i.length;n!==r;++n){const s=i[n];s.id in e&&t.push(s)}return t};function Y4(i,e,t){const n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}let Vpe=0;function Gpe(i){const e=i.split(`
7868`);for(let t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join(`
7869`)}function V7(i){switch(i){case Js:return["Linear","( value )"];case Tv:return["sRGB","( value )"];case Vw:return["RGBE","( value )"];case S7:return["RGBM","( value, 7.0 )"];case M7:return["RGBM","( value, 16.0 )"];case w7:return["RGBD","( value, 256.0 )"];case zw:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",i),["Linear","( value )"]}}function Q4(i,e,t){const n=i.getShaderParameter(e,35713),r=i.getShaderInfoLog(e).trim();return n&&r===""?"":t.toUpperCase()+`
7870
7871`+r+`
7872
7873`+Gpe(i.getShaderSource(e))}function Tu(i,e){const t=V7(e);return"vec4 "+i+"( vec4 value ) { return "+t[0]+"ToLinear"+t[1]+"; }"}function qpe(i,e){const t=V7(e);return"vec4 "+i+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function Hpe(i,e){let t;switch(e){case Ice:t="Linear";break;case Bce:t="Reinhard";break;case Fce:t="OptimizedCineon";break;case Uce:t="ACESFilmic";break;case Oce:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+i+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function Wpe(i){return[i.extensionDerivatives||i.envMapCubeUV||i.bumpMap||i.tangentSpaceNormalMap||i.clearcoatNormalMap||i.flatShading||i.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(i.extensionFragDepth||i.logarithmicDepthBuffer)&&i.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",i.extensionDrawBuffers&&i.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(i.extensionShaderTextureLOD||i.envMap||i.transmission)&&i.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(fA).join(`
7874`)}function $pe(i){const e=[];for(const t in i){const n=i[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`
7875`)}function jpe(i,e){const t={}
7875,n=i.getProgramParameter(e,35721);for(let r=0;r<n;r++){const s=i.getActiveAttrib(e,r),o=s.name;let a=1;s.type===35674&&(a=2),s.type===35675&&(a=3),s.type===35676&&(a=4),t[o]={type:s.type,location:i.getAttribLocation(e,o),locationSize:a}}return t}function fA(i){return i!==""}function Z4(i,e){return i.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function K4(i,e){return i.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Xpe=/^[ \t]*#include +<([\w\d./]+)>/gm;function aS(i){return i.replace(Xpe,Ype)}function Ype(i,e){const t=Fn[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return aS(t)}const Qpe=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Zpe=/#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 J4(i){return i.replace(Zpe,G7).replace(Qpe,Kpe)}function Kpe(i,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),G7(i,e,t,n)}function G7(i,e,t,n){let r="";for(let s=parseInt(e);s<parseInt(t);s++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return r}function eP(i){let e="precision "+i.precision+` float;
7876precision `+i.precision+" int;";return i.precision==="highp"?e+=`
7877#define HIGH_PRECISION`:i.precision==="mediump"?e+=`
7878#define MEDIUM_PRECISION`:i.precision==="lowp"&&(e+=`
7879#define LOW_PRECISION`),e}function Jpe(i){let e="SHADOWMAP_TYPE_BASIC";return i.shadowMapType===g7?e="SHADOWMAP_TYPE_PCF":i.shadowMapType===dce?e="SHADOWMAP_TYPE_PCF_SOFT":i.shadowMapType===dA&&(e="SHADOWMAP_TYPE_VSM"),e}function eAe(i){let e="ENVMAP_TYPE_CUBE";if(i.envMap)switch(i.envMapMode){case K0:case J0:e="ENVMAP_TYPE_CUBE";break;case Mv:case Ow:e="ENVMAP_TYPE_CUBE_UV";break}return e}function tAe(i){let e="ENVMAP_MODE_REFLECTION";if(i.envMap)switch(i.envMapMode){case J0:case Ow:e="ENVMAP_MODE_REFRACTION";break}return e}function nAe(i){let e="ENVMAP_BLENDING_NONE";if(i.envMap)switch(i.combine){case Sv:e="ENVMAP_BLENDING_MULTIPLY";break;case Nce:e="ENVMAP_BLENDING_MIX";break;case Dce:e="ENVMAP_BLENDING_ADD";break}return e}function iAe(i,e,t,n){const r=i.getContext(),s=t.defines;let o=t.vertexShader,a=t.fragmentShader;const l=Jpe(t),c=eAe(t),u=tAe(t),p=nAe(t),m=i.gammaFactor>0?i.gammaFactor:1,g=t.isWebGL2?"":Wpe(t),v=$pe(s),b=r.createProgram();let M,x,w=t.glslVersion?"#version "+t.glslVersion+`
7880`:"";t.isRawShaderMaterial?(M=[v].filter(fA).join(`
7881`),M.length>0&&(M+=`
7882`),x=[g,v].filter(fA).join(`
7883`),x.length>0&&(x+=`
7884`)):(M=[eP(t),"#define SHADER_NAME "+t.shaderName,v,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+m,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphTargets&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargets&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","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","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","	attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","	attribute vec4 color;","#elif defined( USE_COLOR )","	attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","	attribute vec3 morphTarget0;","	attribute vec3 morphTarget1;","	attribute vec3 morphTarget2;","	attribute vec3 morphTarget3;","	#ifdef USE_MORPHNORMALS","		attribute vec3 morphNormal0;","		attribute vec3 morphNormal1;","		attribute vec3 morphNormal2;","		attribute vec3 morphNormal3;","	#else","		attribute vec3 morphTarget4;","		attribute vec3 morphTarget5;","		attribute vec3 morphTarget6;","		attribute vec3 morphTarget7;","	#endif","#endif","#ifdef USE_SKINNING","	attribute vec4 skinIndex;","	attribute vec4 skinWeight;","#endif",`
7885`].filter(fA).join(`
7886`),x=[g,eP(t),"#define SHADER_NAME "+t.shaderName,v,"#define GAMMA_FACTOR "+m,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+p:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Zu?"#define TONE_MAPPING":"",t.toneMapping!==Zu?Fn.tonemapping_pars_fragment:"",t.toneMapping!==Zu?Hpe("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.format===Ku?"#define OPAQUE":"",Fn.encodings_pars_fragment,t.map?Tu("mapTexelToLinear",t.mapEncoding):"",t.matcap?Tu("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?Tu("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?Tu("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularColorMap?Tu("specularColorMapTexelToLinear",t.specularColorMapEncoding):"",t.sheenColorMap?Tu("sheenColorMapTexelToLinear",t.sheenColorMapEncoding):"",t.lightMap?Tu("lightMapTexelToLinear",t.lightMapEncoding):"",qpe("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
7887`].filter(fA).join(`
7888`)),o=aS(o),o=Z4(o,t),o=K4(o,t),a=aS(a),a=Z4(a,t),a=K4(a,t),o=J4(o),a=J4(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(w=`#version 300 es
7889`,M=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(`
7890`)+`
7891`+M,x=["#define varying in",t.glslVersion===b4?"":"out highp vec4 pc_fragColor;",t.glslVersion===b4?"":"#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(`
7892`)+`
7893`+x);const R=w+M+o,C=w+x+a,N=Y4(r,35633,R),D=Y4(r,35632,C);if(r.attachShader(b,N),r.attachShader(b,D),t.index0AttributeName!==void 0?r.bindAttribLocation(b,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(b,0,"position"),r.linkProgram(b),i.debug.checkSha
7893derErrors){const I=r.getProgramInfoLog(b).trim(),F=r.getShaderInfoLog(N).trim(),k=r.getShaderInfoLog(D).trim();let Y=!0,W=!0;if(r.getProgramParameter(b,35714)===!1){Y=!1;const Q=Q4(r,N,"vertex"),J=Q4(r,D,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(b,35715)+`
7894
7895Program Info Log: `+I+`
7896`+Q+`
7897`+J)}else I!==""?console.warn("THREE.WebGLProgram: Program Info Log:",I):(F===""||k==="")&&(W=!1);W&&(this.diagnostics={runnable:Y,programLog:I,vertexShader:{log:F,prefix:M},fragmentShader:{log:k,prefix:x}})}r.deleteShader(N),r.deleteShader(D);let P;this.getUniforms=function(){return P===void 0&&(P=new kc(r,b)),P};let O;return this.getAttributes=function(){return O===void 0&&(O=jpe(r,b)),O},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(b),this.program=void 0},this.name=t.shaderName,this.id=Vpe++,this.cacheKey=e,this.usedTimes=1,this.program=b,this.vertexShader=N,this.fragmentShader=D,this}function rAe(i,e,t,n,r,s,o){const a=[],l=r.isWebGL2,c=r.logarithmicDepthBuffer,u=r.floatVertexTextures,p=r.maxVertexUniforms,m=r.vertexTextures;let g=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"},b=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoat","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap",,"roughnessMap","metalnessMap","gradientMap","alphaMap","alphaTest","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","morphTargetsCount","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","format","specularIntensityMap","specularColorMap","specularColorMapEncoding","transmission","transmissionMap","thicknessMap","sheen","sheenColorMap","sheenColorMapEncoding","sheenRoughnessMap"];function M(P){const I=P.skeleton.bones;if(u)return 1024;{const k=Math.floor((p-20)/4),Y=Math.min(k,I.length);return Y<I.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+I.length+" bones. This GPU supports "+Y+"."),0):Y}}function x(P){let O;return P&&P.isTexture?O=P.encoding:P&&P.isWebGLRenderTarget?(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),O=P.texture.encoding):O=Js,O}function w(P,O,I,F,k){const Y=F.fog,W=P.isMeshStandardMaterial?F.environment:null,Q=(P.isMeshStandardMaterial?t:e).get(P.envMap||W),J=v[P.type],H=k.isSkinnedMesh?M(k):0;P.precision!==null&&(g=r.getMaxPrecision(P.precision),g!==P.precision&&console.warn("THREE.WebGLProgram.getParameters:",P.precision,"not supported, using",g,"instead."));let $,K;if(J){const Fe=Fa[J];$=Fe.vertexShader,K=Fe.fragmentShader}else $=P.vertexShader,K=P.fragmentShader;const he=i.getRenderTarget(),ie=P.alphaTest>0,de=P.clearcoat>0;return{isWebGL2:l,shaderID:J,shaderName:P.type,vertexShader:$,fragmentShader:K,defines:P.defines,isRawShaderMaterial:P.isRawShaderMaterial===!0,glslVersion:P.glslVersion,precision:g,instancing:k.isInstancedMesh===!0,instancingColor:k.isInstancedMesh===!0&&k.instanceColor!==null,supportsVertexTextures:m,outputEncoding:he!==null?x(he.texture):i.outputEncoding,map:!!P.map,mapEncoding:x(P.map),matcap:!!P.matcap,matc
7897apEncoding:x(P.matcap),envMap:!!Q,envMapMode:Q&&Q.mapping,envMapEncoding:x(Q),envMapCubeUV:!!Q&&(Q.mapping===Mv||Q.mapping===Ow),lightMap:!!P.lightMap,lightMapEncoding:x(P.lightMap),aoMap:!!P.aoMap,emissiveMap:!!P.emissiveMap,emissiveMapEncoding:x(P.emissiveMap),bumpMap:!!P.bumpMap,normalMap:!!P.normalMap,objectSpaceNormalMap:P.normalMapType===Oue,tangentSpaceNormalMap:P.normalMapType===Jf,clearcoat:de,clearcoatMap:de&&!!P.clearcoatMap,clearcoatRoughnessMap:de&&!!P.clearcoatRoughnessMap,clearcoatNormalMap:de&&!!P.clearcoatNormalMap,displacementMap:!!P.displacementMap,roughnessMap:!!P.roughnessMap,metalnessMap:!!P.metalnessMap,specularMap:!!P.specularMap,specularIntensityMap:!!P.specularIntensityMap,specularColorMap:!!P.specularColorMap,specularColorMapEncoding:x(P.specularColorMap),alphaMap:!!P.alphaMap,alphaTest:ie,gradientMap:!!P.gradientMap,sheen:P.sheen>0,sheenColorMap:!!P.sheenColorMap,sheenColorMapEncoding:x(P.sheenColorMap),sheenRoughnessMap:!!P.sheenRoughnessMap,transmission:P.transmission>0,transmissionMap:!!P.transmissionMap,thicknessMap:!!P.thicknessMap,combine:P.combine,vertexTangents:!!P.normalMap&&!!k.geometry&&!!k.geometry.attributes.tangent,vertexColors:P.vertexColors,vertexAlphas:P.vertexColors===!0&&!!k.geometry&&!!k.geometry.attributes.color&&k.geometry.attributes.color.itemSize===4,vertexUvs:!!P.map||!!P.bumpMap||!!P.normalMap||!!P.specularMap||!!P.alphaMap||!!P.emissiveMap||!!P.roughnessMap||!!P.metalnessMap||!!P.clearcoatMap||!!P.clearcoatRoughnessMap||!!P.clearcoatNormalMap||!!P.displacementMap||!!P.transmissionMap||!!P.thicknessMap||!!P.specularIntensityMap||!!P.specularColorMap||!!P.sheenColorMap||P.sheenRoughnessMap,uvsVertexOnly:!(P.map||P.bumpMap||P.normalMap||P.specularMap||P.alphaMap||P.emissiveMap||P.roughnessMap||P.metalnessMap||P.clearcoatNormalMap||P.transmission>0||P.transmissionMap||P.thicknessMap||P.specularIntensityMap||P.specularColorMap||P.sheen>0||P.sheenColorMap||P.sheenRoughnessMap)&&!!P.displacementMap,fog:!!Y,useFog:P.fog,fogExp2:Y&&Y.isFogExp2,flatShading:!!P.flatShading,sizeAttenuation:P.sizeAttenuation,logarithmicDepthBuffer:c,skinning:k.isSkinnedMesh===!0&&H>0,maxBones:H,useVertexTexture:u,morphTargets:!!k.geometry&&!!k.geometry.morphAttributes.position,morphNormals:!!k.geometry&&!!k.geometry.morphAttributes.normal,morphTargetsCount:k.geometry&&k.geometry.morphAttributes.position?k.geometry.morphAttributes.position.length:0,numDirLights:O.directional.length,numPointLights:O.point.length,numSpotLights:O.spot.length,numRectAreaLights:O.rectArea.length,numHemiLights:O.hemi.length,numDirLightShadows:O.directionalShadowMap.length,numPointLightShadows:O.pointShadowMap.length,numSpotLightShadows:O.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,format:P.format,dithering:P.dithering,shadowMapEnabled:i.shadowMap.enabled&&I.length>0,shadowMapType:i.shadowMap.type,toneMapping:P.toneMapped?i.toneMapping:Zu,physicallyCorrectLights:i.physicallyCorrectLights,premultipliedAlpha:P.premultipliedAlpha,doubleSided:P.side===Ff,flipSided:P.side===_r,depthPacking:P.depthPacking!==void 0?P.depthPacking:!1,index0AttributeName:P.index0AttributeName,extensionDerivatives:P.extensions&&P.extensions.derivatives,extensionFragDepth:P.extensions&&P.extensions.fragDepth,extensionDrawBuffers:P.extensions&&P.extensions.drawBuffers,extensionShaderTextureLOD:P.extensions&&P.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:P.customProgramCacheKey()}}function R(P){const O=[];if(P.shaderID?O.push(P.shaderID):(O.push(M4(P.fragmentShader)),O.push(M4(P.vertexShader))),P.defines!==void 0)for(const I in P.defines)O.push(I),O.push(P.defines[I]);if(P.isRawShaderMaterial===!1){for(let I=0;I<b.length;I++)O.push(P[b[I]]);O.push(i.outputEncoding),O.push(i.gammaFactor)}return O.push(P.customProgramCacheKey),O.join()}function C(P){const O=v[P.type];let I;if(O){const F=Fa[O];I=nhe.clone(F.uniforms)}else I=P.uniforms;return I}function N(P,O){let I;for(let F=0,k=a.length;F<k;F++){const Y=a[F];if(Y.cacheKey===O){I=Y,++I.usedTimes;break}}return I===void 0&&(I=new iAe(i,O,P,s),a.push(I)),I}function D(P){if(--P.usedTimes===0){const O=a.indexOf(P);a[O]=a[a.length-1],a.pop(),P.destroy()}}return{getParameters:w,getProgramCacheKey:R,getUniforms:C,acquireProgram:N,releaseProgram:D,programs:a}}function sAe(){let i=new WeakMap;function e(s){let o=i.get(s);return o===void 0&&(o={},i.set(s,o)),o}function t(s){i.delete(s)}function n(s,o,a){i.get(s)[o]=a}function r(){i=new WeakMap}return{get:e,remove:t,update:n,dispose:r}}function oAe(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.program!==e.program?i.program.id-e.program.id:i.material.id!==e.material.id?i.material.id-e.material.id:i.z!==e.z?i.z-e.z:i.id-e.id}function tP(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.z!==e.z?e.z-i.z:i.id-e.id}function nP(i){const e=[];let t=0;const n=[],r=[],s=[],o={id:-1};function a(){t=0,n.length=0,r.length=0,s.length=0}function l(g,v,b,M,x,w){let R=e[t];const C=i.get(b);return R===void 0?(R={id:g.id,object:g,geometry:v,material:b,program:C.program||o,groupOrder:M,renderOrder:g.renderOrder,z:x,group:w},e[t]=R):(R.id=g.id,R.object=g,R.geometry=v,R.material=b,R.program=C.program||o,R.groupOrder=M,R.renderOrder=g.renderOrder,R.z=x,R.group=w),t++,R}function c(g,v,b,M,x,w){const R=l(g,v,b,M,x,w);b.transmission>0?r.push(R):b.transparent===!0?s.push(R):n.push(R)}function u(g,v,b,M,x,w){const R=l(g,v,b,M,x,w);b.transmission>0?r.unshift(R):b.transparent===!0?s.unshift(R):n.unshift(R)}function p(g,v){n.length>1&&n.sort(g||oAe),r.length>1&&r.sort(v||tP),s.length>1&&s.sort(v||tP)}function m(){for(let g=t,v=e.length;g<v;g++){const b=e[g];if(b.id===null)break;b.id=null,b.object=null,b.geometry=null,b.material=null,b.program=null,b.group=null}}return{opaque:n,transmissive:r,transparent:s,init:a,push:c,unshift:u,finish:m,sort:p}}function aAe(i){let e=new WeakMap;function t(r,s){let o;return e.has(r)===!1?(o=new nP(i),e.set(r,[o])):s>=e.get(r).length?(o=new nP(i),e.get(r).push(o)):o=e.get(r)[s],o}
vendor: 8,006 bytes, lines 7897-7903
7897function n(){e=new WeakMap}return{get:t,dispose:n}}function lAe(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new _e,color:new en};break;case"SpotLight":t={position:new _e,direction:new _e,color:new en,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new _e,color:new en,distance:0,decay:0};break;case"HemisphereLight":t={direction:new _e,skyColor:new en,groundColor:new en};break;case"RectAreaLight":t={color:new en,position:new _e,halfWidth:new _e,halfHeight:new _e};break}return i[e.id]=t,t}}}function cAe(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Mt};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Mt};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Mt,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[e.id]=t,t}}}let uAe=0;function hAe(i,e){return(e.castShadow?1:0)-(i.castShadow?1:0)}function dAe(i,e){const t=new lAe,n=cAe(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)r.probe.push(new _e);const s=new _e,o=new ln,a=new ln;function l(u,p){let m=0,g=0,v=0;for(let I=0;I<9;I++)r.probe[I].set(0,0,0);let b=0,M=0,x=0,w=0,R=0,C=0,N=0,D=0;u.sort(hAe);const P=p!==!0?Math.PI:1;for(let I=0,F=u.length;I<F;I++){const k=u[I],Y=k.color,W=k.intensity,Q=k.distance,J=k.shadow&&k.shadow.map?k.shadow.map.texture:null;if(k.isAmbientLight)m+=Y.r*W*P,g+=Y.g*W*P,v+=Y.b*W*P;else if(k.isLightProbe)for(let H=0;H<9;H++)r.probe[H].addScaledVector(k.sh.coefficients[H],W);else if(k.isDirectionalLight){const H=t.get(k);if(H.color.copy(k.color).multiplyScalar(k.intensity*P),k.castShadow){const $=k.shadow,K=n.get(k);K.shadowBias=$.bias,K.shadowNormalBias=$.normalBias,K.shadowRadius=$.radius,K.shadowMapSize=$.mapSize,r.directionalShadow[b]=K,r.directionalShadowMap[b]=J,r.directionalShadowMatrix[b]=k.shadow.matrix,C++}r.directional[b]=H,b++}else if(k.isSpotLight){const H=t.get(k);if(H.position.setFromMatrixPosition(k.matrixWorld),H.color.copy(Y).multiplyScalar(W*P),H.distance=Q,H.coneCos=Math.cos(k.angle),H.penumbraCos=Math.cos(k.angle*(1-k.penumbra)),H.decay=k.decay,k.castShadow){const $=k.shadow,K=n.get(k);K.shadowBias=$.bias,K.shadowNormalBias=$.normalBias,K.shadowRadius=$.radius,K.shadowMapSize=$.mapSize,r.spotShadow[x]=K,r.spotShadowMap[x]=J,r.spotShadowMatrix[x]=k.shadow.matrix,D++}r.spot[x]=H,x++}else if(k.isRectAreaLight){const H=t.get(k);H.color.copy(Y).multiplyScalar(W),H.halfWidth.set(k.width*.5,0,0),H.halfHeight.set(0,k.height*.5,0),r.rectArea[w]=H,w++}else if(k.isPointLight){const H=t.get(k);if(H.color.copy(k.color).multiplyScalar(k.intensity*P),H.distance=k.distance,H.decay=k.decay,k.castShadow){const $=k.shadow,K=n.get(k);K.shadowBias=$.bias,K.shadowNormalBias=$.normalBias,K.shadowRadius=$.radius,K.shadowMapSize=$.mapSize,K.shadowCameraNear=$.camera.near,K.shadowCameraFar=$.camera.far,r.pointShadow[M]=K,r.pointShadowMap[M]=J,r.pointShadowMatrix[M]=k.shadow.matrix,N++}r.point[M]=H,M++}else if(k.isHemisphereLight){const H=t.get(k);H.skyColor.copy(k.color).multiplyScalar(W*P),H.groundColor.copy(k.groundColor).multiplyScalar(W*P),r.hemi[R]=H,R++}}w>0&&(e.isWebGL2||i.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Ft.LTC_FLOAT_1,r.rectAreaLTC2=Ft.LTC_FLOAT_2):i.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=Ft.LTC_HALF_1,r.rectAreaLTC2=Ft.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=m,r.ambient[1]=g,r.ambient[2]=v;const O=r.hash;(O.directionalLength!==b||O.pointLength!==M||O.spotLength!==x||O.rectAreaLength!==w||O.hemiLength!==R||O.numDirectionalShadows!==C||O.numPointShadows!==N||O.numSpotShadows!==D)&&(r.directional.length=b,r.spot.length=x,r.rectArea.length=w,r.point.length=M,r.hemi.length=R,r.directionalShadow.length=C,r.directionalShadowMap.length=C,r.pointShadow.length=N,r.pointShadowMap.length=N,r.spotShadow.length=D,r.spotShadowMap.length=D,r.directionalShadowMatrix.length=C,r.pointShadowMatrix.length=N,r.spotShadowMatrix.length=D,O.directionalLength=b,O.pointLength=M,O.spotLength=x,O.rectAreaLength=w,O.hemiLength=R,O.numDirectionalShadows=C,O.numPointShadows=N,O.numSpotShadows=D,r.version=uAe++)}function c(u,p){let m=0,g=0,v=0,b=0,M=0;const x=p.matrixWorldInverse;for(let w=0,R=u.length;w<R;w++){const C=u[w];if(C.isDirectionalLight){const N=r.directional[m];N.direction.setFromMatrixPosition(C.matrixWorld),s.setFromMatrixPosition(C.target.matrixWorld),N.direction.sub(s),N.direction.transformDirection(x),m++}else if(C.isSpotLight){const N=r.spot[v];N.position.setFromMatrixPosition(C.matrixWorld),N.position.applyMatrix4(x),N.direction.setFromMatrixPosition(C.matrixWorld),s.setFromMatrixPosition(C.target.matrixWorld),N.direction.sub(s),N.direction.transformDirection(x),v++}else if(C.isRectAreaLight){const N=r.rectArea[b];N.position.setFromMatrixPosition(C.matrixWorld),N.position.applyMatrix4(x),a.identity(),o.copy(C.matrixWorld),o.premultiply(x),a.extractRotation(o),N.halfWidth.set(C.width*.5,0,0),N.halfHeight.set(0,C.height*.5,0),N.halfWidth.applyMatrix4(a),N.halfHeight.applyMatrix4(a),b++}else if(C.isPointLight){const N=r.point[g];N.position.setFromMatrixPosition(C.matrixWorld),N.position.applyMatrix4(x),g++}else if(C.isHemisphereLight){const N=r.hemi[M];N.direction.setFromMatrixPosition(C.matrixWorld),N.direction.transformDirection(x),N.direction.normalize(),M++}}}return{setup:l,setupView:c,state:r}}function iP(i,e){const t=new dAe(i,e),n=[],r=[];function s(){n.length=0,r.length=0}function o(p){n.push(p)}function a(p){r.push(p)}function l(p){t.setup(n,p)}function c(p){t.setupView(n,p)}return{init:s,state:{lightsArray:n,shadowsArray:r,lights:t},setupLights:l,setupLightsView:c,pushLight:o,pushShadow:a}}function fAe(i,e){let t=new WeakMap;function n(s,o=0){let a;return t.has(s)===!1?(a=new iP(i,e),t.set(s,[a])):o>=t.get(s).length?(a=new iP(i,e),t.get(s).push(a)):a=t.get(s)[o],a}function r(){t=new WeakMap}return{get:n,dispose:r}}class q7 extends fs{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=Fue,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}q7.prototype.isMeshDepthMaterial=!0;class H7 extends fs{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new _e,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}H7.prototype.isMeshDistanceMaterial=!0;const pAe=`void main() {
7898	gl_Position = vec4( position, 1.0 );
7899}`,AAe=`uniform sampler2D shadow_pass;
7900uniform vec2 resolution;
7901uniform float radius;
7902#include <packing>
7903void main() {
7904	const float samples = float( VSM_SAMPLES );
7905	float mean = 0.0;
7906	float squared_mean = 0.0;
7907	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
7908	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
7909	for ( float i = 0.0; i < samples; i ++ ) {
7910		float uvOffset = uvStart + i * uvStride;
7911		#ifdef HORIZONTAL_PASS
7912			vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
7913			mean += distribution.x;
7914			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
7915		#else
7916			float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
7917			mean += depth;
7918			squared_mean += depth * depth;
7919		#endif
7920	}
7921	mean = mean / samples;
7922	squared_mean = squared_mean / samples;
7923	float std_dev = sqrt( squared_mean - mean * mean );
7924	gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
7925}`;function W7(i,e,t){let n=new Cv;const r=new Mt,s=new Mt,o=new _i,a=new q7({depthPacking:Uue}),l=new H7,c={},u=t.maxTextureSize,p={0:_r,1:v0,2:Ff},m=new uh({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Mt},radius:{value:4}},vertexShader:pAe,fragmentShader:AAe}),g=m.clone();g.defines.HORIZONTAL_PASS=1;const v=new Fi;v.setAttribute("position",new br(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new Gs(v,m),M=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=g7,this.render=function(C,N,D){if(M.enabled===!1||M.autoUpdate===!1&&M.needsUpdate===!1||C.length===0)return;const P=i.getRenderTarget(),O=i.getActiveCubeFace(),I=i.getActiveMipmapLevel(),F=i.state;F.setBlending(Uc),F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);for(let k=0,Y=C.length;k<Y;k++){const W=C[k],Q=W.shadow;if(Q===void 0){console.warn("THREE.WebGLShadowMap:",W,"has no shadow.");continue}if(Q.autoUpdate===!1&&Q.needsUpdate===!1)continue;r.copy(Q.mapSize);const J=Q.getFrameExtents();if(r.multiply(J),s.copy(Q.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/J.x),r.x=s.x*J.x,Q.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/J.y),r.y=s.y*J.y,Q.mapSize.y=s.y)),Q.map===null&&!Q.isPointLightShadow&&this.type===dA){const $={minFilter:ko,magFilter:ko,format:Ts};Q.map=new Go(r.x,r.y,$),Q.map.texture.name=W.name+".shadowMap",Q.mapPass=new Go(r.x,r.y,$),Q.camera.updateProjectionMatrix()}if(Q.map===null){const $={minFilter:Fr,magFilter:Fr,format:Ts};Q.map=new Go(r.x,r.y,$),Q.map.texture.name=W.name+".shadowMap",Q.camera.updateProjectionMatrix()}i.setRenderTarget(Q.map),i.clear();const H=Q.getViewportCount();for(let $=0;$<H;$++){const K=Q.getViewport($);o.set(s.x*K.x,s.y*K.y,s.x*K.z,s.y*K.w),F.viewport(o),Q.updateMatrices(W,$),n=Q.getFrustum(),R(N,D,Q.camera,W,this.type)}!Q.isPointLightShadow&&this.type===dA&&x(Q,D),Q.needsUpdate=!1}M.needsUpdate=!1,i.setRenderTarget(P,O,I)};function x(C,N){const D=e.update(b);m.defines.VSM_SAMPLES!==C.blurSamples&&(m.defines.VSM_SAMPLES=C.blurSamples,g.defines.VSM_SAMPLES=C.blurSamples,m.needsUpdate=!0,g.needsUpdate=!0),m.uniforms.shadow_pass.value=C.map.texture,m.uniforms.resolution.value=C.mapSize,m.uniforms.radius.value=C.radius,i.setRenderTarget(C.mapPass),i.clear(),i.renderBufferDirect(N,null,D,m,b,null),g.uniforms.shadow_pass.value=C.mapPass.texture,g.uniforms.resolution.value=C.mapSize,g.uniforms.radius.value=C.radius,i.setRenderTarget(C.map),i.clear(),i.renderBufferDirect(N,null,D,g,b,null)}function w(C,N,D,P,O,I,F){let k=null;const Y=P.isPointLight===!0?C.customDistanceMaterial:C.customDepthMaterial;if(Y!==void 0?k=Y:k=P.isPointLight===!0?l:a,i.localClippingEnabled&&D.clipShadows===!0&&D.clippingPlanes.length!==0||D.displacementMap&&D.displacementScale!==0||D.alphaMap&&D.alphaTest>0){const W=k.uuid,Q=D.uuid;let J=c[W];J===void 0&&(J={},c[W]=J);let H=J[Q];H===void 0&&(H=k.clone(),J[Q]=H),k=H}return k.visible=D.visible,k.wireframe=D.wireframe,F===dA?k.side=D.shadowSide!==null?D.shadowSide:D.side:k.side=D.shadowSide!==null?D.shadowSide:p[D.side],k.alphaMap=D.alphaMap,k.alphaTest=D.alphaTest,k.clipShadows=D.clipShadows,k.clippingPlanes=D.clippingPlanes,k.clipIntersection=D.clipIntersection,k.displacementMap=D.displacementMap,k.displacementScale=D.displacementScale,k.displacementBias=D.displacementBias,k.wireframeLinewidth=D.wireframeLinewidth,k.linewidth=D.linewidth,P.isPointLight===!0&&k.isMeshDistanceMaterial===!0&&(k.referencePosition.setFromMatrixPosition(P.matrixWorld),k.nearDistance=O,k.farDistance=I),k}function R(C,N,D,P,O){if(C.visible===!1)return;if(C.layers.test(N.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&O===dA)&&(!C.frustumCulled||n.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,C.matrixWorld);const k=e.update(C),Y=C.material;if(Array.isArray(Y)){const W=k.groups;for(let Q=0,J=W.length;Q<J;Q++){const H=W[Q],$=Y[H.materialIndex];if($&&$.visible){const K=w(C,k,$,P,D.near,D.far,O);i.renderBufferDirect(D,null,k,K,C,H)}}}else if(Y.visible){const W=w(C,k,Y,P,D.near,D.far,O);i.renderBufferDirect(D,null,k,W,C,null)}}const F=C.children;for(let k=0,Y=F.length;k<Y;k++)R(F[k],N,D,P,O)}}function mAe(i,e,t){const n=t.isWebGL2;function r(){let pe=!1;const qe=new _i;let Ve=null;const st=new _i(0,0,0,0);return{setMask:function(Ie){Ve!==Ie&&!pe&&(i.colorMask(Ie,Ie,Ie,Ie),Ve=Ie)},setLocked:function(Ie){pe=Ie},setClear:function(Ie,nt,ft,wt,Tt){Tt===!0&&(Ie*=wt,nt*=wt,ft*=wt),qe.set(Ie,nt,ft,wt),st.equals(qe)===!1&&(i.clearColor(Ie,nt,ft,wt),st.copy(qe))},reset:function(){pe=!1,Ve=null,st.set(-1,0,0,0)}}}function s(){let pe=!1,qe=null,Ve=null,st=null;return{setTest:function(Ie){Ie?Fe(2929):ge(2929)},setMask:function(Ie){qe!==Ie&&!pe&&(i.depthMask(Ie),qe=Ie)},setFunc:function(Ie){if(Ve!==Ie){if(Ie)switch(Ie){case wce:i.depthFunc(512);break;case Tce:i.depthFunc(519);break;case Ece:i.depthFunc(513);break;
7925case tS:i.depthFunc(515);break;case Rce:i.depthFunc(514);break;case Cce:i.depthFunc(518);break;case Pce:i.depthFunc(516);break;case Lce:i.depthFunc(517);break;default:i.depthFunc(515)}else i.depthFunc(515);Ve=Ie}},setLocked:function(Ie){pe=Ie},setClear:function(Ie){st!==Ie&&(i.clearDepth(Ie),st=Ie)},reset:function(){pe=!1,qe=null,Ve=null,st=null}}}function o(){let pe=!1,qe=null,Ve=null,st=null,Ie=null,nt=null,ft=null,wt=null,Tt=null;return{setTest:function(zt){pe||(zt?Fe(2960):ge(2960))},setMask:function(zt){qe!==zt&&!pe&&(i.stencilMask(zt),qe=zt)},setFunc:function(zt,tn,Rn){(Ve!==zt||st!==tn||Ie!==Rn)&&(i.stencilFunc(zt,tn,Rn),Ve=zt,st=tn,Ie=Rn)},setOp:function(zt,tn,Rn){(nt!==zt||ft!==tn||wt!==Rn)&&(i.stencilOp(zt,tn,Rn),nt=zt,ft=tn,wt=Rn)},setLocked:function(zt){pe=zt},setClear:function(zt){Tt!==zt&&(i.clearStencil(zt),Tt=zt)},reset:function(){pe=!1,qe=null,Ve=null,st=null,Ie=null,nt=null,ft=null,wt=null,Tt=null}}}const a=new r,l=new s,c=new o;let u={},p={},m=null,g=!1,v=null,b=null,M=null,x=null,w=null,R=null,C=null,N=!1,D=null,P=null,O=null,I=null,F=null;const k=i.getParameter(35661);let Y=!1,W=0;const Q=i.getParameter(7938);Q.indexOf("WebGL")!==-1?(W=parseFloat(/^WebGL (\d)/.exec(Q)[1]),Y=W>=1):Q.indexOf("OpenGL ES")!==-1&&(W=parseFloat(/^OpenGL ES (\d)/.exec(Q)[1]),Y=W>=2);let J=null,H={};const $=i.getParameter(3088),K=i.getParameter(2978),he=new _i().fromArray($),ie=new _i().fromArray(K);function de(pe,qe,Ve){const st=new Uint8Array(4),Ie=i.createTexture();i.bindTexture(pe,Ie),i.texParameteri(pe,10241,9728),i.texParameteri(pe,10240,9728);for(let nt=0;nt<Ve;nt++)i.texImage2D(qe+nt,0,6408,1,1,0,6408,5121,st);return Ie}const Ce={};Ce[3553]=de(3553,3553,1),Ce[34067]=de(34067,34069,6),a.setClear(0,0,0,1),l.setClear(1),c.setClear(0),Fe(2929),l.setFunc(tS),Rt(!1),Ue(r4),Fe(2884),Je(Uc);function Fe(pe){u[pe]!==!0&&(i.enable(pe),u[pe]=!0)}function ge(pe){u[pe]!==!1&&(i.disable(pe),u[pe]=!1)}function Ge(pe,qe){return p[pe]!==qe?(i.bindFramebuffer(pe,qe),p[pe]=qe,n&&(pe===36009&&(p[36160]=qe),pe===36160&&(p[36009]=qe)),!0):!1}function Me(pe){return m!==pe?(i.useProgram(pe),m=pe,!0):!1}const Ye={[Rd]:32774,[pce]:32778,[Ace]:32779};if(n)Ye[l4]=32775,Ye[c4]=32776;else{const pe=e.get("EXT_blend_minmax");pe!==null&&(Ye[l4]=pe.MIN_EXT,Ye[c4]=pe.MAX_EXT)}const ct={[mce]:0,[gce]:1,[_ce]:768,[v7]:770,[Mce]:776,[bce]:774,[yce]:772,[vce]:769,[y7]:771,[Sce]:775,[xce]:773};function Je(pe,qe,Ve,st,Ie,nt,ft,wt){if(pe===Uc){g===!0&&(ge(3042),g=!1);return}if(g===!1&&(Fe(3042),g=!0),pe!==fce){if(pe!==v||wt!==N){if((b!==Rd||w!==Rd)&&(i.blendEquation(32774),b=Rd,w=Rd),wt)switch(pe){case CA:i.blendFuncSeparate(1,771,1,771);break;case s4:i.blendFunc(1,1);break;case o4:i.blendFuncSeparate(0,0,769,771);break;case a4:i.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",pe);break}else switch(pe){case CA:i.blendFuncSeparate(770,771,1,771);break;case s4:i.blendFunc(770,1);break;case o4:i.blendFunc(0,769);break;case a4:i.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",pe);break}M=null,x=null,R=null,C=null,v=pe,N=wt}return}Ie=Ie||qe,nt=nt||Ve,ft=ft||st,(qe!==b||Ie!==w)&&(i.blendEquationSeparate(Ye[qe],Ye[Ie]),b=qe,w=Ie),(Ve!==M||st!==x||nt!==R||ft!==C)&&(i.blendFuncSeparate(ct[Ve],ct[st],ct[nt],ct[ft]),M=Ve,x=st,R=nt,C=ft),v=pe,N=null}function Ke(pe,qe){pe.side===Ff?ge(2884):Fe(2884);let Ve=pe.side===_r;qe&&(Ve=!Ve),Rt(Ve),pe.blending===CA&&pe.transparent===!1?Je(Uc):Je(pe.blending,pe.blendEquation,pe.blendSrc,pe.blendDst,pe.blendEquationAlpha,pe.blendSrcAlpha,pe.blendDstAlpha,pe.premultipliedAlpha),l.setFunc(pe.depthFunc),l.setTest(pe.depthTest),l.setMask(pe.depthWrite),a.setMask(pe.colorWrite);const st=pe.stencilWrite;c.setTest(st),st&&(c.setMask(pe.stencilWriteMask),c.setFunc(pe.stencilFunc,pe.stencilRef,pe.stencilFuncMask),c.setOp(pe.stencilFail,pe.stencilZFail,pe.stencilZPass)),Z(pe.polygonOffset,pe.polygonOffsetFactor,pe.polygonOffsetUnits),pe.alphaToCoverage===!0?Fe(32926):ge(32926)}function Rt(pe){D!==pe&&(pe?i.frontFace(2304):i.frontFace(2305),D=pe)}function Ue(pe){pe!==uce?(Fe(2884),pe!==P&&(pe===r4?i.cullFace(1029):pe===hce?i.cullFace(1028):i.cullFace(1032))):ge(2884),P=pe}function Xe(pe){pe!==O&&(Y&&i.lineWidth(pe),O=pe)}function Z(pe,qe,Ve){pe?(Fe(32823),(I!==qe||F!==Ve)&&(i.polygonOffset(qe,Ve),I=qe,F=Ve)):ge(32823)}function We(pe){pe?Fe(3089):ge(3089)}function Pe(pe){pe===void 0&&(pe=33984+k-1),J!==pe&&(i.activeTexture(pe),J=pe)}function Qe(pe,qe){J===null&&Pe();let Ve=H[J];Ve===void 0&&(Ve={type:void 0,texture:void 0},H[J]=Ve),(Ve.type!==pe||Ve.texture!==qe)&&(i.bindTexture(pe,qe||
7925Ce[pe]),Ve.type=pe,Ve.texture=qe)}function Oe(){const pe=H[J];pe!==void 0&&pe.type!==void 0&&(i.bindTexture(pe.type,null),pe.type=void 0,pe.texture=void 0)}function vt(){try{i.compressedTexImage2D.apply(i,arguments)}catch(pe){console.error("THREE.WebGLState:",pe)}}function ot(){try{i.texSubImage2D.apply(i,arguments)}catch(pe){console.error("THREE.WebGLState:",pe)}}function q(){try{i.texStorage2D.apply(i,arguments)}catch(pe){console.error("THREE.WebGLState:",pe)}}function U(){try{i.texImage2D.apply(i,arguments)}catch(pe){console.error("THREE.WebGLState:",pe)}}function ue(){try{i.texImage3D.apply(i,arguments)}catch(pe){console.error("THREE.WebGLState:",pe)}}function Ae(pe){he.equals(pe)===!1&&(i.scissor(pe.x,pe.y,pe.z,pe.w),he.copy(pe))}function Be(pe){ie.equals(pe)===!1&&(i.viewport(pe.x,pe.y,pe.z,pe.w),ie.copy(pe))}function we(){i.disable(3042),i.disable(2884),i.disable(2929),i.disable(32823),i.disable(3089),i.disable(2960),i.disable(32926),i.blendEquation(32774),i.blendFunc(1,0),i.blendFuncSeparate(1,0,1,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(513),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(519,0,4294967295),i.stencilOp(7680,7680,7680),i.clearStencil(0),i.cullFace(1029),i.frontFace(2305),i.polygonOffset(0,0),i.activeTexture(33984),i.bindFramebuffer(36160,null),n===!0&&(i.bindFramebuffer(36009,null),i.bindFramebuffer(36008,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),u={},J=null,H={},p={},m=null,g=!1,v=null,b=null,M=null,x=null,w=null,R=null,C=null,N=!1,D=null,P=null,O=null,I=null,F=null,he.set(0,0,i.canvas.width,i.canvas.height),ie.set(0,0,i.canvas.width,i.canvas.height),a.reset(),l.reset(),c.reset()}return{buffers:{color:a,depth:l,stencil:c},enable:Fe,disable:ge,bindFramebuffer:Ge,useProgram:Me,setBlending:Je,setMaterial:Ke,setFlipSided:Rt,setCullFace:Ue,setLineWidth:Xe,setPolygonOffset:Z,setScissorTest:We,activeTexture:Pe,bindTexture:Qe,unbindTexture:Oe,compressedTexImage2D:vt,texImage2D:U,texImage3D:ue,texStorage2D:q,texSubImage2D:ot,scissor:Ae,viewport:Be,reset:we}}function gAe(i,e,t,n,r,s,o){const a=r.isWebGL2,l=r.maxTextures,c=r.maxCubemapSize,u=r.maxTextureSize,p=r.maxSamples,g=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):void 0,v=new WeakMap;let b,M=!1;try{M=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function x(q,U){return M?new OffscreenCanvas(q,U):Ev("canvas")}function w(q,U,ue,Ae){let Be=1;if((q.width>Ae||q.height>Ae)&&(Be=Ae/Math.max(q.width,q.height)),Be<1||U===!0)if(typeof HTMLImageElement<"u"&&q instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&q instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&q instanceof ImageBitmap){const we=U?Vue:Math.floor,pe=we(Be*q.width),qe=we(Be*q.height);b===void 0&&(b=x(pe,qe));const Ve=ue?x(pe,qe):b;return Ve.width=pe,Ve.height=qe,Ve.getContext("2d").drawImage(q,0,0,pe,qe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+q.width+"x"+q.height+") to ("+pe+"x"+qe+")."),Ve}else return"data"in q&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+q.width+"x"+q.height+")."),q;return q}function R(q){return S4(q.width)&&S4(q.height)}function C(q){return a?!1:q.wrapS!==yo||q.wrapT!==yo||q.minFilter!==Fr&&q.minFilter!==ko}function N(q,U){return q.generateMipmaps&&U&&q.minFilter!==Fr&&q.minFilter!==ko}function D(q){i.generateMipmap(q)}function P(q,U,ue){if(a===!1)return U;if(q!==null){if(i[q]!==void 0)return i[q];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+q+"'")}let Ae=U;return U===6403&&(ue===5126&&(Ae=33326),ue===5131&&(Ae=33325),ue===5121&&(Ae=33321)),U===6407&&(ue===5126&&(Ae=34837),ue===5131&&(Ae=34843),ue===5121&&(Ae=32849)),U===6408&&(ue===5126&&(Ae=34836),ue===5131&&(Ae=34842),ue===5121&&(Ae=32856)),(Ae===33325||Ae===33326||Ae===34842||Ae===34836)&&e.get("EXT_color_buffer_float"),Ae}function O(q,U,ue){return N(q,ue)===!0?Math.log2(Math.max(U.width,U.height))+1:q.mipmaps.length>0?q.mipmaps.length:1}function I(q){return q===Fr||q===u4||q===h4?9728:9729}function F(q){const U=q.target;U.removeEventListener("dispose",F),Y(U),U.isVideoTexture&&v.delete(U),o.memory.textures--}function k(q){const U=q.target;U.removeEventListener("dispose",k),W(U)}function Y(q){const U=n.get(q);U.__webglInit!==void 0&&(i.deleteTexture(U.__webglTexture),n.remove(q))}function W(q){const U=q.texture,ue=n.get(q),Ae=n.get(U);if(q){if(Ae.__webglTexture!==void 0&&(i.deleteTexture(Ae.__webglTexture),o.memory.textures--),q.depthTexture&&q.depthTexture.dispose(),q.isWebGLCubeRen
7925derTarget)for(let Be=0;Be<6;Be++)i.deleteFramebuffer(ue.__webglFramebuffer[Be]),ue.__webglDepthbuffer&&i.deleteRenderbuffer(ue.__webglDepthbuffer[Be]);else i.deleteFramebuffer(ue.__webglFramebuffer),ue.__webglDepthbuffer&&i.deleteRenderbuffer(ue.__webglDepthbuffer),ue.__webglMultisampledFramebuffer&&i.deleteFramebuffer(ue.__webglMultisampledFramebuffer),ue.__webglColorRenderbuffer&&i.deleteRenderbuffer(ue.__webglColorRenderbuffer),ue.__webglDepthRenderbuffer&&i.deleteRenderbuffer(ue.__webglDepthRenderbuffer);if(q.isWebGLMultipleRenderTargets)for(let Be=0,we=U.length;Be<we;Be++){const pe=n.get(U[Be]);pe.__webglTexture&&(i.deleteTexture(pe.__webglTexture),o.memory.textures--),n.remove(U[Be])}n.remove(U),n.remove(q)}}let Q=0;function J(){Q=0}function H(){const q=Q;return q>=l&&console.warn("THREE.WebGLTextures: Trying to use "+q+" texture units while this GPU supports only "+l),Q+=1,q}function $(q,U){const ue=n.get(q);if(q.isVideoTexture&&Pe(q),q.version>0&&ue.__version!==q.version){const Ae=q.image;if(Ae===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(Ae.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Ge(ue,q,U);return}}t.activeTexture(33984+U),t.bindTexture(3553,ue.__webglTexture)}function K(q,U){const ue=n.get(q);if(q.version>0&&ue.__version!==q.version){Ge(ue,q,U);return}t.activeTexture(33984+U),t.bindTexture(35866,ue.__webglTexture)}function he(q,U){const ue=n.get(q);if(q.version>0&&ue.__version!==q.version){Ge(ue,q,U);return}t.activeTexture(33984+U),t.bindTexture(32879,ue.__webglTexture)}function ie(q,U){const ue=n.get(q);if(q.version>0&&ue.__version!==q.version){Me(ue,q,U);return}t.activeTexture(33984+U),t.bindTexture(34067,ue.__webglTexture)}const de={[rS]:10497,[yo]:33071,[sS]:33648},Ce={[Fr]:9728,[u4]:9984,[h4]:9986,[ko]:9729,[kce]:9985,[wv]:9987};function Fe(q,U,ue){if(ue?(i.texParameteri(q,10242,de[U.wrapS]),i.texParameteri(q,10243,de[U.wrapT]),(q===32879||q===35866)&&i.texParameteri(q,32882,de[U.wrapR]),i.texParameteri(q,10240,Ce[U.magFilter]),i.texParameteri(q,10241,Ce[U.minFilter])):(i.texParameteri(q,10242,33071),i.texParameteri(q,10243,33071),(q===32879||q===35866)&&i.texParameteri(q,32882,33071),(U.wrapS!==yo||U.wrapT!==yo)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),i.texParameteri(q,10240,I(U.magFilter)),i.texParameteri(q,10241,I(U.minFilter)),U.minFilter!==Fr&&U.minFilter!==ko&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const Ae=e.get("EXT_texture_filter_anisotropic");if(U.type===Ec&&e.has("OES_texture_float_linear")===!1||a===!1&&U.type===Zd&&e.has("OES_texture_half_float_linear")===!1)return;(U.anisotropy>1||n.get(U).__currentAnisotropy)&&(i.texParameterf(q,Ae.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(U.anisotropy,r.getMaxAnisotropy())),n.get(U).__currentAnisotropy=U.anisotropy)}}function ge(q,U){q.__webglInit===void 0&&(q.__webglInit=!0,U.addEventListener("dispose",F),q.__webglTexture=i.createTexture(),o.memory.textures++)}function Ge(q,U,ue){let Ae=3553;U.isDataTexture2DArray&&(Ae=35866),U.isDataTexture3D&&(Ae=32879),ge(q,U),t.activeTexture(33984+ue),t.bindTexture(Ae,q.__webglTexture),i.pixelStorei(37440,U.flipY),i.pixelStorei(37441,U.premultiplyAlpha),i.pixelStorei(3317,U.unpackAlignment),i.pixelStorei(37443,0);const Be=C(U)&&R(U.image)===!1,we=w(U.image,Be,!1,u),pe=R(we)||a,qe=s.convert(U.format);let Ve=s.convert(U.type),st=P(U.internalFormat,qe,Ve,U.encoding);Fe(Ae,U,pe);let Ie;const nt=U.mipmaps;if(U.isDepthTexture)st=6402,a?U.type===Ec?st=36012:U.type===w_?st=33190:U.type===Kd?st=35056:st=33189:U.type===Ec&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),U.format===Ju&&st===6402&&U.type!==y0&&U.type!==w_&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),U.type=y0,Ve=s.convert(U.type)),U.format===Uf&&st===6402&&(st=34041,U.type!==Kd&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),U.type=Kd,Ve=s.convert(U.type))),t.texImage2D(3553,0,st,we.width,we.height,0,qe,Ve,null);else if(U.isDataTexture)if(nt.length>0&&pe){for(let ft=0,wt=nt.length;ft<wt;
7925ft++)Ie=nt[ft],t.texImage2D(3553,ft,st,Ie.width,Ie.height,0,qe,Ve,Ie.data);U.generateMipmaps=!1}else t.texImage2D(3553,0,st,we.width,we.height,0,qe,Ve,we.data);else if(U.isCompressedTexture)for(let ft=0,wt=nt.length;ft<wt;ft++)Ie=nt[ft],U.format!==Ts&&U.format!==Ku?qe!==null?t.compressedTexImage2D(3553,ft,st,Ie.width,Ie.height,0,Ie.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(3553,ft,st,Ie.width,Ie.height,0,qe,Ve,Ie.data);else if(U.isDataTexture2DArray)t.texImage3D(35866,0,st,we.width,we.height,we.depth,0,qe,Ve,we.data);else if(U.isDataTexture3D)t.texImage3D(32879,0,st,we.width,we.height,we.depth,0,qe,Ve,we.data);else{const ft=O(U,we,pe),wt=a&&U.isVideoTexture!==!0,Tt=q.__version===void 0;if(nt.length>0&&pe){wt&&Tt&&t.texStorage2D(3553,ft,st,nt[0].width,nt[0].height);for(let zt=0,tn=nt.length;zt<tn;zt++)Ie=nt[zt],wt?t.texSubImage2D(3553,zt,0,0,qe,Ve,Ie):t.texImage2D(3553,zt,st,qe,Ve,Ie);U.generateMipmaps=!1}else wt?(Tt&&t.texStorage2D(3553,ft,st,we.width,we.height),t.texSubImage2D(3553,0,0,0,qe,Ve,we)):t.texImage2D(3553,0,st,qe,Ve,we)}N(U,pe)&&D(Ae),q.__version=U.version,U.onUpdate&&U.onUpdate(U)}function Me(q,U,ue){if(U.image.length!==6)return;ge(q,U),t.activeTexture(33984+ue),t.bindTexture(34067,q.__webglTexture),i.pixelStorei(37440,U.flipY),i.pixelStorei(37441,U.premultiplyAlpha),i.pixelStorei(3317,U.unpackAlignment),i.pixelStorei(37443,0);const Ae=U&&(U.isCompressedTexture||U.image[0].isCompressedTexture),Be=U.image[0]&&U.image[0].isDataTexture,we=[];for(let ft=0;ft<6;ft++)!Ae&&!Be?we[ft]=w(U.image[ft],!1,!0,c):we[ft]=Be?U.image[ft].image:U.image[ft];const pe=we[0],qe=R(pe)||a,Ve=s.convert(U.format),st=s.convert(U.type),Ie=P(U.internalFormat,Ve,st,U.encoding);Fe(34067,U,qe);let nt;if(Ae)for(let ft=0;ft<6;ft++){nt=we[ft].mipmaps;for(let wt=0;wt<nt.length;wt++){const Tt=nt[wt];U.format!==Ts&&U.format!==Ku?Ve!==null?t.compressedTexImage2D(34069+ft,wt,Ie,Tt.width,Tt.height,0,Tt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(34069+ft,wt,Ie,Tt.width,Tt.height,0,Ve,st,Tt.data)}}else{nt=U.mipmaps;for(let ft=0;ft<6;ft++)if(Be){t.texImage2D(34069+ft,0,Ie,we[ft].width,we[ft].height,0,Ve,st,we[ft].data);for(let wt=0;wt<nt.length;
7925wt++){const zt=nt[wt].image[ft].image;t.texImage2D(34069+ft,wt+1,Ie,zt.width,zt.height,0,Ve,st,zt.data)}}else{t.texImage2D(34069+ft,0,Ie,Ve,st,we[ft]);for(let wt=0;wt<nt.length;wt++){const Tt=nt[wt];t.texImage2D(34069+ft,wt+1,Ie,Ve,st,Tt.image[ft])}}}N(U,qe)&&D(34067),q.__version=U.version,U.onUpdate&&U.onUpdate(U)}function Ye(q,U,ue,Ae,Be){const we=s.convert(ue.format),pe=s.convert(ue.type),qe=P(ue.internalFormat,we,pe,ue.encoding);n.get(U).__hasExternalTextures||(Be===32879||Be===35866?t.texImage3D(Be,0,qe,U.width,U.height,U.depth,0,we,pe,null):t.texImage2D(Be,0,qe,U.width,U.height,0,we,pe,null)),t.bindFramebuffer(36160,q),U.useRenderToTexture?g.framebufferTexture2DMultisampleEXT(36160,Ae,Be,n.get(ue).__webglTexture,0,We(U)):i.framebufferTexture2D(36160,Ae,Be,n.get(ue).__webglTexture,0),t.bindFramebuffer(36160,null)}function ct(q,U,ue){if(i.bindRenderbuffer(36161,q),U.depthBuffer&&!U.stencilBuffer){let Ae=33189;if(ue||U.useRenderToTexture){const Be=U.depthTexture;Be&&Be.isDepthTexture&&(Be.type===Ec?Ae=36012:Be.type===w_&&(Ae=33190));const we=We(U);U.useRenderToTexture?g.renderbufferStorageMultisampleEXT(36161,we,Ae,U.width,U.height):i.renderbufferStorageMultisample(36161,we,Ae,U.width,U.height)}else i.renderbufferStorage(36161,Ae,U.width,U.height);i.framebufferRenderbuffer(36160,36096,36161,q)}else if(U.depthBuffer&&U.stencilBuffer){const Ae=We(U);ue&&U.useRenderbuffer?i.renderbufferStorageMultisample(36161,Ae,35056,U.width,U.height):U.useRenderToTexture?g.renderbufferStorageMultisampleEXT(36161,Ae,35056,U.width,U.height):i.renderbufferStorage(36161,34041,U.width,U.height),i.framebufferRenderbuffer(36160,33306,36161,q)}else{const Ae=U.isWebGLMultipleRenderTargets===!0?U.texture[0]:U.texture,Be=s.convert(Ae.format),we=s.convert(Ae.type),pe=P(Ae.internalFormat,Be,we,Ae.encoding),qe=We(U);ue&&U.useRenderbuffer?i.renderbufferStorageMultisample(36161,qe,pe,U.width,U.height):U.useRenderToTexture?g.renderbufferStorageMultisampleEXT(36161,qe,pe,U.width,U.height):i.renderbufferStorage(36161,pe,U.width,U.height)}i.bindRenderbuffer(36161,null)}function Je(q,U){if(U&&U.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,q),!(U.depthTexture&&U.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(U.depthTexture).__webglTexture||U.depthTexture.image.width!==U.width||U.depthTexture.image.height!==U.height)&&(U.depthTexture.image.width=U.width,U.depthTexture.image.height=U.height,U.depthTexture.needsUpdate=!0),$(U.depthTexture,0);const Ae=n.get(U.depthTexture).__webglTexture,Be=We(U);if(U.depthTexture.format===Ju)U.useRenderToTexture?g.framebufferTexture2DMultisampleEXT(36160,36096,3553,Ae,0,Be):i.framebufferTexture2D(36160,36096,3553,Ae,0);else if(U.depthTexture.format===Uf)U.useRenderToTexture?g.framebufferTexture2DMultisampleEXT(36160,33306,3553,Ae,0,Be):i.framebufferTexture2D(36160,33306,3553,Ae,0);else throw new Error("Unknown depthTexture format")}function Ke(q){const U=n.get(q),ue=q.isWebGLCubeRenderTarget===!0;if(q.depthTexture&&!U.__autoAllocateDepthBuffer){if(ue)throw new Error("target.depthTexture not supported in Cube render targets");Je(U.__webglFramebuffer,q)}else if(ue){U.__webglDepthbuffer=[];for(let Ae=0;Ae<6;Ae++)t.bindFramebuffer(36160,U.__webglFramebuffer[Ae]),U.__webglDepthbuffer[Ae]=i.createRenderbuffer(),ct(U.__webglDepthbuffer[Ae],q,!1)}else t.bindFramebuffer(36160,U.__webglFramebuffer),U.__webglDepthbuffer=i.createRenderbuffer(),ct(U.__webglDepthbuffer,q,!1);t.bindFramebuffer(36160,null)}function Rt(q,U,ue){const Ae=n.get(q);U!==void 0&&Ye(Ae.__webglFramebuffer,q,q.texture,36064,3553),ue!==void 0&&Ke(q)}function Ue(q){const U=q.texture,ue=n.get(q),Ae=n.get(U);q.addEventListener("dispose",k),q.isWebGLMultipleRenderTargets!==!0&&(Ae.__webglTexture===void 0&&(Ae.__webglTexture=i.createTexture()),Ae.__version=U.version,o.memory.textures++);const Be=q.isWebGLCubeRenderTarget===!0,we=q.isWebGLMultipleRenderTargets===!0,pe=U.isDataTexture3D||U.isDataTexture2DArray,qe=R(q)||a;
7925if(a&&U.format===Ku&&(U.type===Ec||U.type===Zd)&&(U.format=Ts,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),Be){ue.__webglFramebuffer=[];for(let Ve=0;Ve<6;Ve++)ue.__webglFramebuffer[Ve]=i.createFramebuffer()}else if(ue.__webglFramebuffer=i.createFramebuffer(),we)if(r.drawBuffers){const Ve=q.texture;for(let st=0,Ie=Ve.length;st<Ie;st++){const nt=n.get(Ve[st]);nt.__webglTexture===void 0&&(nt.__webglTexture=i.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(q.useRenderbuffer)if(a){ue.__webglMultisampledFramebuffer=i.createFramebuffer(),ue.__webglColorRenderbuffer=i.createRenderbuffer(),i.bindRenderbuffer(36161,ue.__webglColorRenderbuffer);const Ve=s.convert(U.format),st=s.convert(U.type),Ie=P(U.internalFormat,Ve,st,U.encoding),nt=We(q);i.renderbufferStorageMultisample(36161,nt,Ie,q.width,q.height),t.bindFramebuffer(36160,ue.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(36160,36064,36161,ue.__webglColorRenderbuffer),i.bindRenderbuffer(36161,null),q.depthBuffer&&(ue.__webglDepthRenderbuffer=i.createRenderbuffer(),ct(ue.__webglDepthRenderbuffer,q,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(Be){t.bindTexture(34067,Ae.__webglTexture),Fe(34067,U,qe);for(let Ve=0;Ve<6;Ve++)Ye(ue.__webglFramebuffer[Ve],q,U,36064,34069+Ve);N(U,qe)&&D(34067),t.unbindTexture()}else if(we){const Ve=q.texture;for(let st=0,Ie=Ve.length;st<Ie;st++){const nt=Ve[st],ft=n.get(nt);t.bindTexture(3553,ft.__webglTexture),Fe(3553,nt,qe),Ye(ue.__webglFramebuffer,q,nt,36064+st,3553),N(nt,qe)&&D(3553)}t.unbindTexture()}else{let Ve=3553;pe&&(a?Ve=U.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),t.bindTexture(Ve,Ae.__webglTexture),Fe(Ve,U,qe),Ye(ue.__webglFramebuffer,q,U,36064,Ve),N(U,qe)&&D(Ve),t.unbindTexture()}q.depthBuffer&&Ke(q)}function Xe(q){const U=R(q)||a,ue=q.isWebGLMultipleRenderTargets===!0?q.texture:[q.texture];for(let Ae=0,Be=ue.length;Ae<Be;Ae++){const we=ue[Ae];if(N(we,U)){const pe=q.isWebGLCubeRenderTarget?34067:3553,qe=n.get(we).__webglTexture;t.bindTexture(pe,qe),D(pe),t.unbindTexture()}}}function Z(q){if(q.useRenderbuffer)if(a){const U=q.width,ue=q.height;let Ae=16384;const Be=[36064],we=q.stencilBuffer?33306:36096;q.depthBuffer&&Be.push(we),q.ignoreDepthForMultisampleCopy||(q.depthBuffer&&(Ae|=256),q.stencilBuffer&&(Ae|=1024));const pe=n.get(q);t.bindFramebuffer(36008,pe.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,pe.__webglFramebuffer),q.ignoreDepthForMultisampleCopy&&(i.invalidateFramebuffer(36008,[we]),i.invalidateFramebuffer(36009,[we])),i.blitFramebuffer(0,0,U,ue,0,0,U,ue,Ae,9728),i.invalidateFramebuffer(36008,Be),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,pe.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function We(q){return a&&(q.useRenderbuffer||q.useRenderToTexture)?Math.min(p,q.samples):0}function Pe(q){const U=o.render.frame;v.get(q)!==U&&(v.set(q,U),q.update())}let Qe=!1,Oe=!1;function vt(q,U){q&&q.isWebGLRenderTarget&&(Qe===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),Qe=!0),q=q.texture),$(q,U)}function ot(q,U){q&&q.isWebGLCubeRenderTarget&&(Oe===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),Oe=!0),q=q.texture),ie(q,U)}this.allocateTextureUnit=H,this.resetTextureUnits=J,this.setTexture2D=$,this.setTexture2DArray=K,this.setTexture3D=he,this.setTextureCube=ie,this.rebindTextures=Rt,this.setupRenderTarget=Ue,this.updateRenderTargetMipmap=Xe,this.updateMultisampleRenderTarget=Z,this.setupDepthRenderbuffer=Ke,this.setupFrameBufferTexture=Ye,this.safeSetTexture2D=vt,this.safeSetTextureCube=ot}function _Ae(i,e,t){const n=t.isWebGL2;function r(s){let o;if(s===$c)return 5121;if(s===qce)return 32819;if(s===Hce)return 32820;if(s===Wce)return 33635;if(s===zce)return 5120;if(s===Vce)return 5122;if(s===y0)return 5123;if(s===Gce)return 5124;if(s===w_)return 5125;if(s===Ec)return 5126;if(s===Zd)return n?5131:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(s===$ce)return 6406;if(s===Ku)return 6407;if(s===Ts)return 6408;if(s===jce)return 6409;if(s===Xce)return 6410;if(s===Ju)return 6402;if(s===Uf)return 34041;if(s===Qce)return 6403;if(s===Zce)return 36244;if(s===Kce)return 33319;if(s===Jce)return 33320;if(s===eue)return 36248;if(s===tue)return 36249;if(s===d4||s===f4||s===p4||s===A4)if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(s===d4)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===f4)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===p4)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===A4)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===m4||s===g4||s===_4||s===v4)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(s===m4)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===g4)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===_4)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===v4)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===nue)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((s===y4||s===x4)&&(o=e.get("WEBGL_compressed_texture_etc"),o!==null)){if(s===y4)return o.COMPRESSED_RGB8_ETC2;if(s===x4)return o.COMPRESSED_RGBA8_ETC2_EAC}if(s===iue||s===rue||s===sue||s===oue||s===aue||s===lue||s===cue||s===uue||s===hue||s===due||s===fue||s===pue||s===Aue||s===mue||s===_ue||s===vue||s===yue||s===xue||s===bue||s===Sue||s===Mue||s===wue||s===Tue||s===Eue||s===Rue||s===Cue||s===Pue||s===Lue)return o=e.get("WEBGL_compressed_texture_astc"),o!==null?s:null;if(s===gue)return o=e.get("EXT_texture_compression_bptc"),o!==null?s:null;if(s===Kd)return n?34042:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null)}return{convert:r}}class $7 extends Us{constructor(e=[]){super(),this.cameras=e}}$7.prototype.isArrayCamera=!0;class pA extends li{constructor(){super(),this.type="Group"}}pA.prototype.isGroup=!0;const vAe={type:"move"};class b2{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new pA,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 pA,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new _e,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new _e),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new pA,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new _e,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new _e),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(a!==null&&(r=t.getPose(e.targetRaySpace,n),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),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(vAe))),c&&e.hand){o=!0;for(const b of e.hand.values()){const M=t.getJointPose(b,n);if(c.joints[b.jointName]===void 0){const w=new pA;
7925w.matrixAutoUpdate=!1,w.visible=!1,c.joints[b.jointName]=w,c.add(w)}const x=c.joints[b.jointName];M!==null&&(x.matrix.fromArray(M.transform.matrix),x.matrix.decompose(x.position,x.rotation,x.scale),x.jointRadius=M.radius),x.visible=M!==null}const u=c.joints["index-finger-tip"],p=c.joints["thumb-tip"],m=u.position.distanceTo(p.position),g=.02,v=.005;c.inputState.pinching&&m>g+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&m<=g-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),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));return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}}class lS extends jr{constructor(e,t,n,r,s,o,a,l,c,u){if(u=u!==void 0?u:Ju,u!==Ju&&u!==Uf)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Ju&&(n=y0),n===void 0&&u===Uf&&(n=Kd),super(null,r,s,o,a,l,u,n,c),this.image={width:e,height:t},this.magFilter=a!==void 0?a:Fr,this.minFilter=l!==void 0?l:Fr,this.flipY=!1,this.generateMipmaps=!1}}lS.prototype.isDepthTexture=!0;class yAe extends vh{constructor(e,t){super();const n=this;let r=null,s=1,o=null,a="local-floor";const l=e.extensions.has("WEBGL_multisampled_render_to_texture");let c=null,u=null,p=null,m=null,g=!1,v=null;const b=t.getContextAttributes();let M=null,x=null;const w=[],R=new Map,C=new Us;C.layers.enable(1),C.viewport=new _i;const N=new Us;N.layers.enable(2),N.viewport=new _i;const D=[C,N],P=new $7;P.layers.enable(1),P.layers.enable(2);let O=null,I=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ie){let de=w[ie];return de===void 0&&(de=new b2,w[ie]=de),de.getTargetRaySpace()},this.getControllerGrip=function(ie){let de=w[ie];return de===void 0&&(de=new b2,w[ie]=de),de.getGripSpace()},this.getHand=function(ie){let de=w[ie];return de===void 0&&(de=new b2,w[ie]=de),de.getHandSpace()};function F(ie){const de=R.get(ie.inputSource);de&&de.dispatchEvent({type:ie.type,data:ie.inputSource})}function k(){R.forEach(function(ie,de){ie.disconnect(de)}),R.clear(),O=null,I=null,e.setRenderTarget(M),m=null,p=null,u=null,r=null,x=null,he.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ie){s=ie,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ie){a=ie,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o},this.getBaseLayer=function(){return p!==null?p:m},this.getBinding=function(){return u},this.getFrame=function(){return v},this.getSession=function(){return r},this.setSession=async function(ie){if(r=ie,r!==null){if(M=e.getRenderTarget(),r.addEventListener("select",F),r.addEventListener("selectstart",F),r.addEventListener("selectend",F),r.addEventListener("squeeze",F),r.addEventListener("squeezestart",F),r.addEventListener("squeezeend",F),r.addEventListener("end",k),r.addEventListener("inputsourceschange",Y),b.xrCompatible!==!0&&await t.makeXRCompatible(),r.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const de={antialias:r.renderState.layers===void 0?b.antialias:!0,alpha:b.alpha,depth:b.depth,stencil:b.stencil,framebufferScaleFactor:s};m=new XRWebGLLayer(r,t,de),r.updateRenderState({baseLayer:m}),x=new Go(m.framebufferWidth,m.framebufferHeight)}else{g=b.antialias;let de=null,Ce=null,Fe=null;b.depth&&(Fe=b.stencil?35056:33189,de=b.stencil?Uf:Ju,Ce=b.stencil?Kd:y0);const ge={colorFormat:b.alpha||g?32856:32849,depthFormat:Fe,scaleFactor:s};
7925u=new XRWebGLBinding(r,t),p=u.createProjectionLayer(ge),r.updateRenderState({layers:[p]}),g?x=new Gw(p.textureWidth,p.textureHeight,{format:Ts,type:$c,depthTexture:new lS(p.textureWidth,p.textureHeight,Ce,void 0,void 0,void 0,void 0,void 0,void 0,de),stencilBuffer:b.stencil,ignoreDepth:p.ignoreDepthValues,useRenderToTexture:l}):x=new Go(p.textureWidth,p.textureHeight,{format:b.alpha?Ts:Ku,type:$c,depthTexture:new lS(p.textureWidth,p.textureHeight,Ce,void 0,void 0,void 0,void 0,void 0,void 0,de),stencilBuffer:b.stencil,ignoreDepth:p.ignoreDepthValues})}this.setFoveation(0),o=await r.requestReferenceSpace(a),he.setContext(r),he.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function Y(ie){const de=r.inputSources;for(let Ce=0;Ce<w.length;Ce++)R.set(de[Ce],w[Ce]);for(let Ce=0;Ce<ie.removed.length;Ce++){const Fe=ie.removed[Ce],ge=R.get(Fe);ge&&(ge.dispatchEvent({type:"disconnected",data:Fe}),R.delete(Fe))}for(let Ce=0;Ce<ie.added.length;Ce++){const Fe=ie.added[Ce],ge=R.get(Fe);ge&&ge.dispatchEvent({type:"connected",data:Fe})}}const W=new _e,Q=new _e;function J(ie,de,Ce){W.setFromMatrixPosition(de.matrixWorld),Q.setFromMatrixPosition(Ce.matrixWorld);const Fe=W.distanceTo(Q),ge=de.projectionMatrix.elements,Ge=Ce.projectionMatrix.elements,Me=ge[14]/(ge[10]-1),Ye=ge[14]/(ge[10]+1),ct=(ge[9]+1)/ge[5],Je=(ge[9]-1)/ge[5],Ke=(ge[8]-1)/ge[0],Rt=(Ge[8]+1)/Ge[0],Ue=Me*Ke,Xe=Me*Rt,Z=Fe/(-Ke+Rt),We=Z*-Ke;de.matrixWorld.decompose(ie.position,ie.quaternion,ie.scale),ie.translateX(We),ie.translateZ(Z),ie.matrixWorld.compose(ie.position,ie.quaternion,ie.scale),ie.matrixWorldInverse.copy(ie.matrixWorld).invert();const Pe=Me+Z,Qe=Ye+Z,Oe=Ue-We,vt=Xe+(Fe-We),ot=ct*Ye/Qe*Pe,q=Je*Ye/Qe*Pe;ie.projectionMatrix.makePerspective(Oe,vt,ot,q,Pe,Qe)}function H(ie,de){de===null?ie.matrixWorld.copy(ie.matrix):ie.matrixWorld.multiplyMatrices(de.matrixWorld,ie.matrix),ie.matrixWorldInverse.copy(ie.matrixWorld).invert()}this.updateCamera=function(ie){if(r===null)return;P.near=N.near=C.near=ie.near,P.far=N.far=C.far=ie.far,(O!==P.near||I!==P.far)&&(r.updateRenderState({depthNear:P.near,depthFar:P.far}),O=P.near,I=P.far);const de=ie.parent,Ce=P.cameras;H(P,de);for(let ge=0;ge<Ce.length;ge++)H(Ce[ge],de);P.matrixWorld.decompose(P.position,P.quaternion,P.scale),ie.position.copy(P.position),ie.quaternion.copy(P.quaternion),ie.scale.copy(P.scale),ie.matrix.copy(P.matrix),ie.matrixWorld.copy(P.matrixWorld);const Fe=ie.children;for(let ge=0,Ge=Fe.length;ge<Ge;ge++)Fe[ge].updateMatrixWorld(!0);Ce.length===2?J(P,C,N):P.projectionMatrix.copy(C.projectionMatrix)},this.getCamera=function(){return P},this.getFoveation=function(){if(p!==null)return p.fixedFoveation;if(m!==null)return m.fixedFoveation},this.setFoveation=function(ie){p!==null&&(p.fixedFoveation=ie),m!==null&&m.fixedFoveation!==void 0&&(m.fixedFoveation=ie)};let $=null;function K(ie,de){if(c=de.getViewerPose(o),v=de,c!==null){const Fe=c.views;m!==null&&(e.setRenderTargetFramebuffer(x,m.framebuffer),e.setRenderTarget(x));let ge=!1;Fe.length!==P.cameras.length&&(P.cameras.length=0,ge=!0);for(let Ge=0;Ge<Fe.length;Ge++){const Me=Fe[Ge];let Ye=null;if(m!==null)Ye=m.getViewport(Me);else{const Je=u.getViewSubImage(p,Me);Ye=Je.viewport,Ge===0&&(e.setRenderTargetTextures(x,Je.colorTexture,p.ignoreDepthValues?void 0:Je.depthStencilTexture),e.setRenderTarget(x))}const ct=D[Ge];ct.matrix.fromArray(Me.transform.matrix),ct.projectionMatrix.fromArray(Me.projectionMatrix),ct.viewport.set(Ye.x,Ye.y,Ye.width,Ye.height),Ge===0&&P.matrix.copy(ct.matrix),ge===!0&&P.cameras.push(ct)}}const Ce=r.inputSources;for(let Fe=0;Fe<w.length;Fe++){const ge=w[Fe],Ge=Ce[Fe];ge.update(Ge,de,o)}$&&$(ie,de),v=null}const he=new L7;he.setAnimationLoop(K),this.setAnimationLoop=function(ie){$=ie},this.dispose=function(){}}}function xAe(i){function e(x,w){x.fogColor.value.copy(w.color),w.isFog?(x.fogNear.value=w.near,x.fogFar.value=w.far):w.isFogExp2&&(x.fogDensity.value=w.density)}function t(x,w,R,C,N){w.isMeshBasicMaterial?n(x,w):w.isMeshLambertMaterial?(n(x,w),l(x,w)):w.isMeshToonMaterial?(n(x,w),u(x,w)):w.isMeshPhongMaterial?(n(x,w),c(x,w)):w.isMeshStandardMaterial?(n(x,w),w.isMeshPhysicalMaterial?m(x,w,N):p(x,w)):w.isMeshMat
7925capMaterial?(n(x,w),g(x,w)):w.isMeshDepthMaterial?(n(x,w),v(x,w)):w.isMeshDistanceMaterial?(n(x,w),b(x,w)):w.isMeshNormalMaterial?(n(x,w),M(x,w)):w.isLineBasicMaterial?(r(x,w),w.isLineDashedMaterial&&s(x,w)):w.isPointsMaterial?o(x,w,R,C):w.isSpriteMaterial?a(x,w):w.isShadowMaterial?(x.color.value.copy(w.color),x.opacity.value=w.opacity):w.isShaderMaterial&&(w.uniformsNeedUpdate=!1)}function n(x,w){x.opacity.value=w.opacity,w.color&&x.diffuse.value.copy(w.color),w.emissive&&x.emissive.value.copy(w.emissive).multiplyScalar(w.emissiveIntensity),w.map&&(x.map.value=w.map),w.alphaMap&&(x.alphaMap.value=w.alphaMap),w.specularMap&&(x.specularMap.value=w.specularMap),w.alphaTest>0&&(x.alphaTest.value=w.alphaTest);const R=i.get(w).envMap;R&&(x.envMap.value=R,x.flipEnvMap.value=R.isCubeTexture&&R.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=w.reflectivity,x.ior.value=w.ior,x.refractionRatio.value=w.refractionRatio),w.lightMap&&(x.lightMap.value=w.lightMap,x.lightMapIntensity.value=w.lightMapIntensity),w.aoMap&&(x.aoMap.value=w.aoMap,x.aoMapIntensity.value=w.aoMapIntensity);let C;w.map?C=w.map:w.specularMap?C=w.specularMap:w.displacementMap?C=w.displacementMap:w.normalMap?C=w.normalMap:w.bumpMap?C=w.bumpMap:w.roughnessMap?C=w.roughnessMap:w.metalnessMap?C=w.metalnessMap:w.alphaMap?C=w.alphaMap:w.emissiveMap?C=w.emissiveMap:w.clearcoatMap?C=w.clearcoatMap:w.clearcoatNormalMap?C=w.clearcoatNormalMap:w.clearcoatRoughnessMap?C=w.clearcoatRoughnessMap:w.specularIntensityMap?C=w.specularIntensityMap:w.specularColorMap?C=w.specularColorMap:w.transmissionMap?C=w.transmissionMap:w.thicknessMap?C=w.thicknessMap:w.sheenColorMap?C=w.sheenColorMap:w.sheenRoughnessMap&&(C=w.sheenRoughnessMap),C!==void 0&&(C.isWebGLRenderTarget&&(C=C.texture),C.matrixAutoUpdate===!0&&C.updateMatrix(),x.uvTransform.value.copy(C.matrix));let N;w.aoMap?N=w.aoMap:w.lightMap&&(N=w.lightMap),N!==void 0&&(N.isWebGLRenderTarget&&(N=N.texture),N.matrixAutoUpdate===!0&&N.updateMatrix(),x.uv2Transform.value.copy(N.matrix))}function r(x,w){x.diffuse.value.copy(w.color),x.opacity.value=w.opacity}function s(x,w){x.dashSize.value=w.dashSize,x.totalSize.value=w.dashSize+w.gapSize,x.scale.value=w.scale}function o(x,w,R,C){x.diffuse.value.copy(w.color),x.opacity.value=w.opacity,x.size.value=w.size*R,x.scale.value=C*.5,w.map&&(x.map.value=w.map),w.alphaMap&&(x.alphaMap.value=w.alphaMap),w.alphaTest>0&&(x.alphaTest.value=w.alphaTest);let N;w.map?N=w.map:w.alphaMap&&(N=w.alphaMap),N!==void 0&&(N.matrixAutoUpdate===!0&&N.updateMatrix(),x.uvTransform.value.copy(N.matrix))}function a(x,w){x.diffuse.value.copy(w.color),x.opacity.value=w.opacity,x.rotation.value=w.rotation,w.map&&(x.map.value=w.map),w.alphaMap&&(x.alphaMap.value=w.alphaMap),w.alphaTest>0&&(x.alphaTest.value=w.alphaTest);let R;w.map?R=w.map:w.alphaMap&&(R=w.alphaMap),R!==void 0&&(R.matrixAutoUpdate===!0&&R.updateMatrix(),x.uvTransform.value.copy(R.matrix))}function l(x,w){w.emissiveMap&&(x.emissiveMap.value=w.emissiveMap)}function c(x,w){x.specular.value.copy(w.specular),x.shininess.value=Math.max(w.shininess,1e-4),w.emissiveMap&&(x.emissiveMap.value=w.emissiveMap),w.bumpMap&&(x.bumpMap.value=w.bumpMap,x.bumpScale.value=w.bumpScale,w.side===_r&&(x.bumpScale.value*=-1)),w.normalMap&&(x.normalMap.value=w.normalMap,x.normalScale.value.copy(w.normalScale),w.side===_r&&x.normalScale.value.negate()),w.displacementMap&&(x.displacementMap.value=w.displacementMap,x.displacementScale.value=w.displacementScale,x.displacementBias.value=w.displacementBias)}function u(x,w){w.gradientMap&&(x.gradientMap.value=w.gradientMap),w.emissiveMap&&(x.emissiveMap.value=w.emissiveMap),w.bumpMap&&(x.bumpMap.value=w.bumpMap,x.bumpScale.value=w.bumpScale,w.side===_r&&(x.bumpScale.value*=-1)),w.normalMap&&(x.normalMap.value=w.normalMap,x.normalScale.value.copy(w.normalScale),w.side===_r&&x.normalScale.value.negate()),w.displacementMap&&(x.displacementMap.value=w.displacementMap,x.displacementScale.value=w.displacementScale,x.displacementBias.value=w.displacementBias)}function p(x,w){x.roughness.value=w.roughness,x.metalness.value=w.metalness,w.roughnessMap&&(x.roughnessMap.value=w.roughnessMap),w.metalnessMap&&(x.metalnessMap.value=w.metalnessMap),w.emissiveMap&&(x.emissiveMap.value=w.emissiveMap),w.bumpMap&&(x.bumpMap.value=w.bumpMap,x.bumpScale.value=w.bumpScale,w.side===_r&&(x.bumpScale.value*=-1)),w.normalMap&&(x.normalMap.value=w.normalMap,x.normalScale.value.copy(w.normalScale),w.side===_r&&x.normalScale.value.negate()),w.displacementMap&&(x.displacementMap.value=w.displacementMap,x.displacementScale.value=w.displacementScale,x.displacementBias.value=w.displacementBias),i.get(w).envMap&&(x.envMapIntensity.value=w.envMapIntensity)}function m(x,w,R){p(x,w),x.ior.value=w.ior,w.sheen>0&&(x.sheenColor.value.copy(w.sheenColor).multiplyScalar(w.sheen),x.sheenRoughness.value=w.sheenRoughness,w.sheenColorMap&&(x.sheenColorMap.value=w.sheenColorMap),w.sheenRoughnessMap&&(x.sheenRoughnessMap.value=w.sheenRoughnessMap)),w.clearcoat>0&&(x.clearcoat.value=w.clearcoat,x.clearcoatRoughness.value=w.clearcoatRoughness,w.clearcoatMap&&(x.clearcoatMap.value=w.clearcoatMap),w.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=w.clearcoatRoughnessMap),w.clearcoatNormalMap&&(x.clearcoatNormalScale.value.copy(w.clearcoatNormalScale),x.clearcoatNormalMap.value=w.clearcoatNormalMap,w.side===_r&&x.clearcoatNormalScale.value.negate())),w.transmission>0&&(x.transmission.value=w.transmission,x.transmissionSamplerMap.value=R.texture,x.transmissionSamplerSize.value.set(R.width,R.height),w.transmissionMap&&(x.transmissionMap.value=w.transmissionMap),x.thickness.value=w.thickness,w.thicknessMap&&(x.thicknessMap.value=w.thicknessMap),x.attenuationDistance.value=w.attenuationDistance,x.attenuationColor.value.copy(w.attenuationColor)),x.specularIntensity.value=w.specularIntensity,x.specularColor.value.copy(w.specularColor),w.specularIntensityMap&&(x.specularIntensityMap.value=w.specularIntensityMap),w.specularColorMap&&(x.specularColorMap.value=w.specularColorMap)}
7925function g(x,w){w.matcap&&(x.matcap.value=w.matcap),w.bumpMap&&(x.bumpMap.value=w.bumpMap,x.bumpScale.value=w.bumpScale,w.side===_r&&(x.bumpScale.value*=-1)),w.normalMap&&(x.normalMap.value=w.normalMap,x.normalScale.value.copy(w.normalScale),w.side===_r&&x.normalScale.value.negate()),w.displacementMap&&(x.displacementMap.value=w.displacementMap,x.displacementScale.value=w.displacementScale,x.displacementBias.value=w.displacementBias)}function v(x,w){w.displacementMap&&(x.displacementMap.value=w.displacementMap,x.displacementScale.value=w.displacementScale,x.displacementBias.value=w.displacementBias)}function b(x,w){w.displacementMap&&(x.displacementMap.value=w.displacementMap,x.displacementScale.value=w.displacementScale,x.displacementBias.value=w.displacementBias),x.referencePosition.value.copy(w.referencePosition),x.nearDistance.value=w.nearDistance,x.farDistance.value=w.farDistance}function M(x,w){w.bumpMap&&(x.bumpMap.value=w.bumpMap,x.bumpScale.value=w.bumpScale,w.side===_r&&(x.bumpScale.value*=-1)),w.normalMap&&(x.normalMap.value=w.normalMap,x.normalScale.value.copy(w.normalScale),w.side===_r&&x.normalScale.value.negate()),w.displacementMap&&(x.displacementMap.value=w.displacementMap,x.displacementScale.value=w.displacementScale,x.displacementBias.value=w.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function bAe(){const i=Ev("canvas");return i.style.display="block",i}function fi(i={}){const e=i.canvas!==void 0?i.canvas:bAe(),t=i.context!==void 0?i.context:null,n=i.alpha!==void 0?i.alpha:!1,r=i.depth!==void 0?i.depth:!0,s=i.stencil!==void 0?i.stencil:!0,o=i.antialias!==void 0?i.antialias:!1,a=i.premultipliedAlpha!==void 0?i.premultipliedAlpha:!0,l=i.preserveDrawingBuffer!==void 0?i.preserveDrawingBuffer:!1,c=i.powerPreference!==void 0?i.powerPreference:"default",u=i.failIfMajorPerformanceCaveat!==void 0?i.failIfMajorPerformanceCaveat:!1;let p=null,m=null;const g=[],v=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=Js,this.physicallyCorrectLights=!1,this.toneMapping=Zu,this.toneMappingExposure=1;const b=this;let M=!1,x=0,w=0,R=null,C=-1,N=null;const D=new _i,P=new _i;let O=null,I=e.width,F=e.height,k=1,Y=null,W=null;const Q=new _i(0,0,I,F),J=new _i(0,0,I,F);let H=!1;const $=[],K=new Cv;let he=!1,ie=!1,de=null;const Ce=new ln,Fe=new _e,ge={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ge(){return R===null?k:1}let Me=t;function Ye(te,fe){for(let h=0;h<te.length;h++){const V=te[h],je=e.getContext(V,fe);if(je!==null)return je}return null}try{const te={alpha:n,depth:r,stencil:s,antialias:o,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Uw}`),e.addEventListener("webglcontextlost",ft,!1),e.addEventListener("webglcontextrestored",wt,!1),Me===null){const fe=["webgl2","webgl","experimental-webgl"];if(b.isWebGL1Renderer===!0&&fe.shift(),Me=Ye(fe,te),Me===null)throw Ye(fe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}Me.getShaderPrecisionFormat===void 0&&(Me.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(te){throw console.error("THREE.WebGLRenderer: "+te.message),te}let ct,Je,Ke,Rt,Ue,Xe,Z,We,Pe,Qe,Oe,vt,ot,q,U,ue,Ae,Be,we,pe,qe,Ve,st;function Ie(){ct=new Wfe(Me),Je=new Ufe(Me,ct,i),ct.init(Je),Ve=new _Ae(Me,ct,Je),Ke=new mAe(Me,ct,Je),$[0]=1029,Rt=new Xfe,Ue=new sAe,Xe=new gAe(Me,ct,Ke,Ue,Je,Ve,Rt),Z=new kfe(b),We=new Hfe(b),Pe=new ahe(Me,Je),st=new Bfe(Me,ct,Pe,Je),Qe=new $fe(Me,Pe,Rt,st),Oe=new Kfe(Me,Qe,Pe,Rt),we=new Zfe(Me,Je,Xe),ue=new Ofe(Ue),vt=new rAe(b,Z,We,ct,Je,st,ue),ot=new xAe(Ue),q=new aAe(Ue),U=new fAe(ct,Je),Be=new Ife(b,Z,Ke,Oe,a),Ae=new W7(b,Oe,Je),pe=new Ffe(Me,ct,Rt,Je),qe=new jfe(Me,ct,Rt,Je),Rt.programs=vt.programs,b.capabilities=Je,b.extensions=ct,b.properties=Ue,b.renderLists=q,b.shadowMap=Ae,b.state=Ke,b.info=Rt}Ie();const nt=new yAe(b,Me);this.xr=nt,this.getContext=function(){return Me},this.getContextAttributes=function(){return Me.getContextAttributes()},this.forceContextLoss=function(){const te=ct.get("WEBGL_lose_context");te&&te.loseContext()},this.forceContextRestore=function(){const te=ct.get("WEBGL_lose_context");te&&te.restoreContext()},this.getPixelRatio=function(){return k},this.setPixelRatio=function(te){te!==void 0&&(k=te,this.setSize(I,F,!1))}
vendor: 3,775 bytes, line 7925
7925,this.getSize=function(te){return te.set(I,F)},this.setSize=function(te,fe,h){if(nt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}I=te,F=fe,e.width=Math.floor(te*k),e.height=Math.floor(fe*k),h!==!1&&(e.style.width=te+"px",e.style.height=fe+"px"),this.setViewport(0,0,te,fe)},this.getDrawingBufferSize=function(te){return te.set(I*k,F*k).floor()},this.setDrawingBufferSize=function(te,fe,h){I=te,F=fe,k=h,e.width=Math.floor(te*h),e.height=Math.floor(fe*h),this.setViewport(0,0,te,fe)},this.getCurrentViewport=function(te){return te.copy(D)},this.getViewport=function(te){return te.copy(Q)},this.setViewport=function(te,fe,h,V){te.isVector4?Q.set(te.x,te.y,te.z,te.w):Q.set(te,fe,h,V),Ke.viewport(D.copy(Q).multiplyScalar(k).floor())},this.getScissor=function(te){return te.copy(J)},this.setScissor=function(te,fe,h,V){te.isVector4?J.set(te.x,te.y,te.z,te.w):J.set(te,fe,h,V),Ke.scissor(P.copy(J).multiplyScalar(k).floor())},this.getScissorTest=function(){return H},this.setScissorTest=function(te){Ke.setScissorTest(H=te)},this.setOpaqueSort=function(te){Y=te},this.setTransparentSort=function(te){W=te},this.getClearColor=function(te){return te.copy(Be.getClearColor())},this.setClearColor=function(){Be.setClearColor.apply(Be,arguments)},this.getClearAlpha=function(){return Be.getClearAlpha()},this.setClearAlpha=function(){Be.setClearAlpha.apply(Be,arguments)},this.clear=function(te,fe,h){let V=0;(te===void 0||te)&&(V|=16384),(fe===void 0||fe)&&(V|=256),(h===void 0||h)&&(V|=1024),Me.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",ft,!1),e.removeEventListener("webglcontextrestored",wt,!1),q.dispose(),U.dispose(),Ue.dispose(),Z.dispose(),We.dispose(),Oe.dispose(),st.dispose(),nt.dispose(),nt.removeEventListener("sessionstart",Bt),nt.removeEventListener("sessionend",tt),de&&(de.dispose(),de=null),ut.stop()};function ft(te){te.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function wt(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;const te=Rt.autoReset,fe=Ae.enabled,h=Ae.autoUpdate,V=Ae.needsUpdate,je=Ae.type;Ie(),Rt.autoReset=te,Ae.enabled=fe,Ae.autoUpdate=h,Ae.needsUpdate=V,Ae.type=je}function Tt(te){const fe=te.target;fe.removeEventListener("dispose",Tt),zt(fe)}function zt(te){tn(te),Ue.remove(te)}function tn(te){const fe=Ue.get(te).programs;fe!==void 0&&fe.forEach(function(h){vt.releaseProgram(h)})}this.renderBufferDirect=function(te,fe,h,V,je,It){fe===null&&(fe=ge);const Ot=je.isMesh&&je.matrixWorld.determinant()<0,Et=Rr(te,fe,h,V,je);Ke.setMaterial(V,Ot);let Ct=h.index;const bn=h.attributes.position;if(Ct===null){if(bn===void 0||bn.count===0)return}else if(Ct.count===0)return;let kt=1;V.wireframe===!0&&(Ct=Qe.getWireframeAttribute(h),kt=2),st.setup(je,V,Et,h,Ct);let Pt,Bn=pe;Ct!==null&&(Pt=Pe.get(Ct),Bn=qe,Bn.setIndex(Pt));const Ls=Ct!==null?Ct.count:bn.count,kn=h.drawRange.start*kt,ne=h.drawRange.count*kt,ye=It!==null?It.start*kt:0,ze=It!==null?It.count*kt:1/0,ke=Math.max(kn,ye),Re=Math.min(Ls,kn+ne,ye+ze)-1,gt=Math.max(0,Re-ke+1);if(gt!==0){if(je.isMesh)V.wireframe===!0?(Ke.setLineWidth(V.wireframeLinewidth*Ge()),Bn.setMode(1)):Bn.setMode(4);else if(je.isLine){let mt=V.linewidth;mt===void 0&&(mt=1),Ke.setLineWidth(mt*Ge()),je.isLineSegments?Bn.setMode(1):je.isLineLoop?Bn.setMode(2):Bn.setMode(3)}else je.isPoints?Bn.setMode(0):je.isSprite&&Bn.setMode(4);if(je.isInstancedMesh)Bn.renderInstances(ke,gt,je.count);else if(h.isInstancedBufferGeometry){const mt=Math.min(h.instanceCount,h._maxInstanceCount);Bn.renderInstances(ke,gt,mt)}else Bn.render(ke,gt)}}
7925,this.compile=function(te,fe){m=U.get(te),m.init(),v.push(m),te.traverseVisible(function(h){h.isLight&&h.layers.test(fe.layers)&&(m.pushLight(h),h.castShadow&&m.pushShadow(h))}),m.setupLights(b.physicallyCorrectLights),te.traverse(function(h){const V=h.material;if(V)if(Array.isArray(V))for(let je=0;je<V.length;je++){const It=V[je];Nn(It,te,h)}else Nn(V,te,h)}),v.pop(),m=null};let Rn=null;function le(te){Rn&&Rn(te)}function Bt(){ut.stop()}function tt(){ut.start()}const ut=new L7;ut.setAnimationLoop(le),typeof window<"u"&&ut.setContext(window),this.setAnimationLoop=function(te){Rn=te,nt.setAnimationLoop(te),te===null?ut.stop():ut.start()},nt.addEventListener("sessionstart",Bt),nt.addEventListener("sessionend",tt),this.render=function(te,fe){if(fe!==void 0&&fe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;te.autoUpdate===!0&&te.updateMatrixWorld(),fe.parent===null&&fe.updateMatrixWorld(),nt.enabled===!0&&nt.isPresenting===!0&&(nt.cameraAutoUpdate===!0&&nt.updateCamera(fe),fe=nt.getCamera()),te.isScene===!0&&te.onBeforeRender(b,te,fe,R),m=U.get(te,v.length),m.init(),v.push(m),Ce.multiplyMatrices(fe.projectionMatrix,fe.matrixWorldInverse),K.setFromProjectionMatrix(Ce),ie=this.localClippingEnabled,he=ue.init(this.clippingPlanes,ie,fe),p=q.get(te,g.length),p.init(),g.push(p),Ut(te,fe,0,b.sortObjects),p.finish(),b.sortObjects===!0&&p.sort(Y,W),he===!0&&ue.beginShadows();const h=m.state.shadowsArray;if(Ae.render(h,te,fe),he===!0&&ue.endShadows(),this.info.autoReset===!0&&this.info.reset(),Be.render(p,te),m.setupLights(b.physicallyCorrectLights),fe.isArrayCamera){const V=fe.cameras;for(let je=0,It=V.length;je<It;je++){const Ot=V[je];Dt(p,te,Ot,Ot.viewport)}}else Dt(p,te,fe);R!==null&&(Xe.updateMultisampleRenderTarget(R),Xe.updateRenderTargetMipmap(R)),te.isScene===!0&&te.onAfterRender(b,te,fe),Ke.buffers.depth.setTest(!0),Ke.buffers.depth.setMask(!0),Ke.buffers.color.setMask(!0),Ke.setPolygonOffset(!1),st.resetDefaultState(),C=-1,N=null,v.pop(),v.length>0?m=v[v.length-1]:m=null,g.pop(),g.length>0?p=g[g.length-1]:p=null};function Ut(te,fe,h,V){if(te.visible===!1)return;if(te.layers.test(fe.layers)){if(te.isGroup)h=te.renderOrder;else if(te.isLOD)te.autoUpdate===!0&&te.update(fe);else if(te.isLight)m.pushLight(te),te.castShadow&&m.pushShadow(te);else if(te.isSprite){if(!te.frustumCulled||K.intersectsSprite(te)){V&&Fe.setFromMatrixPosition(te.matrixWorld).applyMatrix4(Ce);const Ot=Oe.update(te),Et=te.material;Et.visible&&p.push(te,Ot,Et,h,Fe.z,null)}}else if((te.isMesh||te.isLine||te.isPoints)&&(te.isSkinnedMesh&&te.skeleton.frame!==Rt.render.frame&&(te.skeleton.update(),te.skeleton.frame=Rt.render.frame),!te.frustumCulled||K.intersectsObject(te))){V&&Fe.setFromMatrixPosition(te.matrixWorld).applyMatrix4(Ce);const Ot=Oe.update(te),Et=te.material;if(Array.isArray(Et)){const Ct=Ot.groups;for(let bn=0,kt=Ct.length;bn<kt;bn++){const Pt=Ct[bn],Bn=Et[Pt.materialIndex];Bn&&Bn.visible&&p.push(te,Ot,Bn,h,Fe.z,Pt)}}else Et.visible&&p.push(te,Ot,Et,h,Fe.z,null)}}const It=te.children;for(let Ot=0,Et=It.length;Ot<Et;Ot++)Ut(It[Ot],fe,h,V)}function Dt(te,fe,h,V){const je=te.opaque,It=te.transmissive,Ot=te.transparent;m.setupLightsView(h),It.length>0&&An(je,fe,h),V&&Ke.viewport(D.copy(V)),je.length>0&&Jn(je,fe,h),It.length>0&&Jn(It,fe,h),Ot.length>0&&Jn(Ot,fe,h)}function An(te,fe,h){if(de===null){const Ot=o===!0&&Je.isWebGL2===!0?Gw:Go;de=new Ot(1024,1024,{generateMipmaps:!0,type:Ve.convert(Zd)!==null?Zd:$c,minFilter:wv,magFilter:Fr,wrapS:yo,wrapT:yo,useRenderToTexture:ct.has("WEBGL_multisampled_render_to_texture")})}const V=b.getRenderTarget();b.setRenderTarget(de),b.clear();const je=b.toneMapping;b.toneMapping=Zu,Jn(te,fe,h),b.toneMapping=je,Xe.updateMultisampleRenderTarget(de),Xe.updateRenderTargetMipmap(de),b.setRenderTarget(V)}function Jn(te,fe,h){const V=fe.isScene===!0?fe.overrideMaterial:null;for(let je=0,It=te.length;je<It;je++){const Ot=te[je],Et=Ot.object,Ct=Ot.geometry,bn=V===null?Ot.material:V,kt=Ot.group;Et.layers.test(h.layers)&&Ki(Et,fe,h,Ct,bn,kt)}}function Ki(te,fe,h,V,je,It){te.onBeforeRender(b,fe,h,V,je,It),te.modelViewMatrix.multiplyMatrices(h.matrixWorldInverse,te.matrixWorld),te.normalMatrix.getNormalMatrix(te.modelViewMatrix),je.onBeforeRender(b,fe,h,V,te,It),je.transparent===!0&&je.side===Ff?(je.side=_r,je.needsUpdate=!0,b.renderBufferDirect(h,fe,V,je,te,It),je.side=v0,je.needsUpdate=!0,b.renderBufferDirect(h,fe,V,je,te,It),je.side=Ff):b.renderBufferDirect(h,fe,V,je,te,It),te.onAfterRender(b,fe,h,V,je,It)}function Nn(te,fe,h){fe.isScene!==!0&&(fe=ge);const V=Ue.get(te),je=m.state.lights,It=m.state.shadowsArray,Ot=je.state.ver
vendor: 7,070 bytes, line 7925
7925sion,Et=vt.getParameters(te,je.state,It,fe,h),Ct=vt.getProgramCacheKey(Et);let bn=V.programs;V.environment=te.isMeshStandardMaterial?fe.environment:null,V.fog=fe.fog,V.envMap=(te.isMeshStandardMaterial?We:Z).get(te.envMap||V.environment),bn===void 0&&(te.addEventListener("dispose",Tt),bn=new Map,V.programs=bn);let kt=bn.get(Ct);if(kt!==void 0){if(V.currentProgram===kt&&V.lightsStateVersion===Ot)return Er(te,Et),kt}else Et.uniforms=vt.getUniforms(te),te.onBuild(h,Et,b),te.onBeforeCompile(Et,b),kt=vt.acquireProgram(Et,Ct),bn.set(Ct,kt),V.uniforms=Et.uniforms;const Pt=V.uniforms;(!te.isShaderMaterial&&!te.isRawShaderMaterial||te.clipping===!0)&&(Pt.clippingPlanes=ue.uniform),Er(te,Et),V.needsLights=ht(te),V.lightsStateVersion=Ot,V.needsLights&&(Pt.ambientLightColor.value=je.state.ambient,Pt.lightProbe.value=je.state.probe,Pt.directionalLights.value=je.state.directional,Pt.directionalLightShadows.value=je.state.directionalShadow,Pt.spotLights.value=je.state.spot,Pt.spotLightShadows.value=je.state.spotShadow,Pt.rectAreaLights.value=je.state.rectArea,Pt.ltc_1.value=je.state.rectAreaLTC1,Pt.ltc_2.value=je.state.rectAreaLTC2,Pt.pointLights.value=je.state.point,Pt.pointLightShadows.value=je.state.pointShadow,Pt.hemisphereLights.value=je.state.hemi,Pt.directionalShadowMap.value=je.state.directionalShadowMap,Pt.directionalShadowMatrix.value=je.state.directionalShadowMatrix,Pt.spotShadowMap.value=je.state.spotShadowMap,Pt.spotShadowMatrix.value=je.state.spotShadowMatrix,Pt.pointShadowMap.value=je.state.pointShadowMap,Pt.pointShadowMatrix.value=je.state.pointShadowMatrix);const Bn=kt.getUniforms(),Ls=kc.seqWithValue(Bn.seq,Pt);return V.currentProgram=kt,V.uniformsList=Ls,kt}function Er(te,fe){const h=Ue.get(te);h.outputEncoding=fe.outputEncoding,h.instancing=fe.instancing,h.skinning=fe.skinning,h.morphTargets=fe.morphTargets,h.morphNormals=fe.morphNormals,h.morphTargetsCount=fe.morphTargetsCount,h.numClippingPlanes=fe.numClippingPlanes,h.numIntersection=fe.numClipIntersection,h.vertexAlphas=fe.vertexAlphas,h.vertexTangents=fe.vertexTangents}function Rr(te,fe,h,V,je){fe.isScene!==!0&&(fe=ge),Xe.resetTextureUnits();const It=fe.fog,Ot=V.isMeshStandardMaterial?fe.environment:null,Et=R===null?b.outputEncoding:R.texture.encoding,Ct=(V.isMeshStandardMaterial?We:Z).get(V.envMap||Ot),bn=V.vertexColors===!0&&!!h.attributes.color&&h.attributes.color.itemSize===4,kt=!!V.normalMap&&!!h.attributes.tangent,Pt=!!h.morphAttributes.position,Bn=!!h.morphAttributes.normal,Ls=h.morphAttributes.position?h.morphAttributes.position.length:0,kn=Ue.get(V),ne=m.state.lights;if(he===!0&&(ie===!0||te!==N)){const X=te===N&&V.id===C;ue.setState(V,te,X)}let ye=!1;V.version===kn.__version?(kn.needsLights&&kn.lightsStateVersion!==ne.state.version||kn.outputEncoding!==Et||je.isInstancedMesh&&kn.instancing===!1||!je.isInstancedMesh&&kn.instancing===!0||je.isSkinnedMesh&&kn.skinning===!1||!je.isSkinnedMesh&&kn.skinning===!0||kn.envMap!==Ct||V.fog&&kn.fog!==It||kn.numClippingPlanes!==void 0&&(kn.numClippingPlanes!==ue.numPlanes||kn.numIntersection!==ue.numIntersection)||kn.vertexAlphas!==bn||kn.vertexTangents!==kt||kn.morphTargets!==Pt||kn.morphNormals!==Bn||Je.isWebGL2===!0&&kn.morphTargetsCount!==Ls)&&(ye=!0):(ye=!0,kn.__version=V.version);let ze=kn.currentProgram;ye===!0&&(ze=Nn(V,fe,je));let ke=!1,Re=!1,gt=!1;const mt=ze.getUniforms(),lt=kn.uniforms;if(Ke.useProgram(ze.program)&&(ke=!0,Re=!0,gt=!0),V.id!==C&&(C=V.id,Re=!0),ke||N!==te){if(mt.setValue(Me,"projectionMatrix",te.projectionMatrix),Je.logarithmicDepthBuffer&&mt.setValue(Me,"logDepthBufFC",2/(Math.log(te.far+1)/Math.LN2)),N!==te&&(N=te,Re=!0,gt=!0),V.isShaderMaterial||V.isMeshPhongMaterial||V.isMeshToonMaterial||V.isMeshStandardMaterial||V.envMap){const X=mt.map.cameraPosition;X!==void 0&&X.setValue(Me,Fe.setFromMatrixPosition(te.matrixWorld))}(V.isMeshPhongMaterial||V.isMeshToonMaterial||V.isMeshLambertMaterial||V.isMeshBasicMaterial||V.isMeshStandardMaterial||V.isShaderMaterial)&&mt.setValue(Me,"isOrthographic",te.isOrthographicCamera===!0),(V.isMeshPhongMaterial||V.isMeshToonMaterial||V.isMeshLambertMaterial||V.isMeshBasicMaterial||V.isMeshStandardMaterial||V.isShaderMaterial||V.isShadowMaterial||je.isSkinnedMesh)&&mt.setValue(Me,"viewMatrix",te.matrixWorldInverse)}if(je.isSkinnedMesh){mt.setOptional(Me,je,"bindMatrix"),mt.setOptional(Me,je,"bindMatrixInverse");const X=je.skeleton;X&&(Je.floatVertexTextures?(X.boneTexture===null&&X.computeBoneTexture(),mt.setValue(Me,"boneTexture",X.boneTexture,Xe),mt.setValue(Me,"boneTextureSize",X.boneTextureSize)):mt.setOptional(Me,X,"boneMatrices"))}return h&&(h.morphAttributes.position!==void 0||h.morphAttributes.normal!==void 0)&&we.update(je,h,V,ze),(Re||kn.receiveShadow!==je.receiveShadow)&&(kn.receiveShadow=je.receiveShadow,mt.setValue(Me,"receiveShadow",je.receiveShadow)),Re&&(mt.setValue(Me,"toneMappingExposure",b.toneMappingExposure),kn.needsLights&&$e(lt,gt),It&&V.fog&&ot.refreshFogUniforms(lt,It),ot.refreshMaterialUniforms(lt,V,k,F,de),kc.upload(Me,kn.uniformsList,lt,Xe)),V.isShaderMaterial&&V.uniformsNeedUpdate===!0&&(kc.upload(Me,kn.uniformsList,lt,Xe),V.uniformsNeedUpdate=!1),V.isSpriteMaterial&&mt.setValue(Me,"center",je.center),mt.setValue(Me,"modelViewMatrix",je.modelViewMatrix),mt.setValue(Me,"normalMatrix",je.normalMatrix),mt.setValue(Me,"modelMatrix",je.matrixWorld),ze}function $e(te,fe){te.ambientLightColor.needsUpdate=fe,te.lightProbe.needsUpdate=fe,te.directionalLights.needsUpdate=fe,te.directionalLightShadows.needsUpdate=fe,te.pointLights.needsUpdate=fe,te.pointLightShadows.needsUpdate=fe,te.spotLights.needsUpdate=fe,te.spotLightShadows.needsUpdate=fe,te.rectAreaLights.needsUpdate=fe,te.hemisphereLights.needsUpdate=fe}function ht(te){return te.isMeshLambertMaterial||te.isMeshToonMaterial||te.isMeshPhongMaterial||te.isMeshStandardMaterial||te.isShadowMaterial||te.isShaderMaterial&&te.lights===!0}this.getActiveCubeFace=function(){return x},this.getActiveMipmapLevel=function(){return w},this.getRenderTarget=function(){return R},this.setRenderTargetTextures=function(te,fe,h){Ue.get(te.texture).__webglTexture=fe,Ue.get(te.depthTexture).__webglTexture=h;const V=Ue.get(te);V.__hasExternalTextures=!0,V.__hasExternalTextures&&(V.__autoAllocateDepthBuffer=h===void 0,V.__autoAllocateDepthBuffer||te.useRenderToTexture&&(console.warn("render-to-texture extension was disabled because an external texture was provided"),te.useRenderToTexture=!1,te.useRenderbuffer=!0))},this.setRenderTargetFramebuffer=function(te,fe){const h=Ue.get(te);h.__webglFramebuffer=fe,h.__useDefaultFramebuffer=fe===void 0},this.setRenderTarget=function(te,fe=0,h=0){R=te,x=fe,w=h;let V=!0;if(te){const Ct=Ue.get(te);Ct.__useDefaultFramebuffer!==void 0?(Ke.bindFramebuffer(36160,null),V=!1):Ct.__webglFramebuffer===void 0?Xe.setupRenderTarget(te):Ct.__hasExternalTextures&&Xe.rebindTextures(te,Ue.get(te.texture).__webglTexture,Ue.get(te.depthTexture).__webglTexture)}let je=null,It=!1,Ot=!1;if(te){const Ct=te.texture;(Ct.isDataTexture3D||Ct.isDataTexture2DArray)&&(Ot=!0);const bn=Ue.get(te).__webglFramebuffer;
7925te.isWebGLCubeRenderTarget?(je=bn[fe],It=!0):te.useRenderbuffer?je=Ue.get(te).__webglMultisampledFramebuffer:je=bn,D.copy(te.viewport),P.copy(te.scissor),O=te.scissorTest}else D.copy(Q).multiplyScalar(k).floor(),P.copy(J).multiplyScalar(k).floor(),O=H;if(Ke.bindFramebuffer(36160,je)&&Je.drawBuffers&&V){let Ct=!1;if(te)if(te.isWebGLMultipleRenderTargets){const bn=te.texture;if($.length!==bn.length||$[0]!==36064){for(let kt=0,Pt=bn.length;kt<Pt;kt++)$[kt]=36064+kt;$.length=bn.length,Ct=!0}}else($.length!==1||$[0]!==36064)&&($[0]=36064,$.length=1,Ct=!0);else($.length!==1||$[0]!==1029)&&($[0]=1029,$.length=1,Ct=!0);Ct&&(Je.isWebGL2?Me.drawBuffers($):ct.get("WEBGL_draw_buffers").drawBuffersWEBGL($))}if(Ke.viewport(D),Ke.scissor(P),Ke.setScissorTest(O),It){const Ct=Ue.get(te.texture);Me.framebufferTexture2D(36160,36064,34069+fe,Ct.__webglTexture,h)}else if(Ot){const Ct=Ue.get(te.texture),bn=fe||0;Me.framebufferTextureLayer(36160,36064,Ct.__webglTexture,h||0,bn)}C=-1},this.readRenderTargetPixels=function(te,fe,h,V,je,It,Ot){if(!(te&&te.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Et=Ue.get(te).__webglFramebuffer;if(te.isWebGLCubeRenderTarget&&Ot!==void 0&&(Et=Et[Ot]),Et){Ke.bindFramebuffer(36160,Et);try{const Ct=te.texture,bn=Ct.format,kt=Ct.type;if(bn!==Ts&&Ve.convert(bn)!==Me.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Pt=kt===Zd&&(ct.has("EXT_color_buffer_half_float")||Je.isWebGL2&&ct.has("EXT_color_buffer_float"));if(kt!==$c&&Ve.convert(kt)!==Me.getParameter(35738)&&!(kt===Ec&&(Je.isWebGL2||ct.has("OES_texture_float")||ct.has("WEBGL_color_buffer_float")))&&!Pt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Me.checkFramebufferStatus(36160)===36053?fe>=0&&fe<=te.width-V&&h>=0&&h<=te.height-je&&Me.readPixels(fe,h,V,je,Ve.convert(bn),Ve.convert(kt),It):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Ct=R!==null?Ue.get(R).__webglFramebuffer:null;Ke.bindFramebuffer(36160,Ct)}}},this.copyFramebufferToTexture=function(te,fe,h=0){const V=Math.pow(2,-h),je=Math.floor(fe.image.width*V),It=Math.floor(fe.image.height*V);let Ot=Ve.convert(fe.format);Je.isWebGL2&&(Ot===6407&&(Ot=32849),Ot===6408&&(Ot=32856)),Xe.setTexture2D(fe,0),Me.copyTexImage2D(3553,h,Ot,te.x,te.y,je,It,0),Ke.unbindTexture()},this.copyTextureToTexture=function(te,fe,h,V=0){const je=fe.image.width,It=fe.image.height,Ot=Ve.convert(h.format),Et=Ve.convert(h.type);Xe.setTexture2D(h,0),Me.pixelStorei(37440,h.flipY),Me.pixelStorei(37441,h.premultiplyAlpha),Me.pixelStorei(3317,h.unpackAlignment),fe.isDataTexture?Me.texSubImage2D(3553,V,te.x,te.y,je,It,Ot,Et,fe.image.data):fe.isCompressedTexture?Me.compressedTexSubImage2D(3553,V,te.x,te.y,fe.mipmaps[0].width,fe.mipmaps[0].height,Ot,fe.mipmaps[0].data):Me.texSubImage2D(3553,V,te.x,te.y,Ot,Et,fe.image),V===0&&h.generateMipmaps&&Me.generateMipmap(3553),Ke.unbindTexture()},this.copyTextureToTexture3D=function(te,fe,h,V,je=0){if(b.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const It=te.max.x-te.min.x+1,Ot=te.max.y-te.min.y+1,Et=te.max.z-te.min.z+1,Ct=Ve.convert(V.format),bn=Ve.convert(V.type);let kt;if(V.isDataTexture3D)Xe.setTexture3D(V,0),kt=32879;else if(V.isDataTexture2DArray)Xe.setTexture2DArray(V,0),kt=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Me.pixelStorei(37440,V.flipY),Me.pixelStorei(37441,V.premultiplyAlpha),Me.pixelStorei(3317,V.unpackAlignment);const Pt=Me.getParameter(3314),Bn=Me.getParameter(32878),Ls=Me.getParameter(3316),kn=Me.getParameter(3315),ne=Me.getParameter(32877),ye=h.isCompressedTexture?h.mipmaps[0]:h.image;Me.pixelStorei(3314,ye.width),Me.pixelStorei(32878,ye.height),Me.pixelStorei(3316,te.min.x),Me.pixelStorei(3315,te.min.y),Me.pixelStorei(32877,te.min.z),h.isDataTexture||h.isDataTexture3D?Me.texSubImage3D(kt,je,fe.x,fe.y,fe.z,It,Ot,Et,Ct,bn,ye.data):h.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Me.compressedTexSubImage3D(kt,je,fe.x,fe.y,fe.z,It,Ot,Et,Ct,ye.data)):Me.texSubImage3D(kt,je,fe.x,fe.y,fe.z,It,Ot,Et,Ct,bn,ye),Me.pixelStorei(3314,Pt),Me.pixelStorei(32878,Bn),Me.pixelStorei(3316,Ls),Me.pixelStorei(3315,kn),Me.pixelStorei(32877,ne),je===0&&V.generateMipmaps&&Me.generateMipmap(kt),Ke.unbindTexture()},this.initTexture=function(te){Xe.setTexture2D(te,0),Ke.unbindTexture()},this.resetState=function(){x=0,w=0,R=null,Ke.reset(),st.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}fi.prototype.isWebGLRenderer=!0;class SAe extends fi{}SAe.prototype.isWebGL1Renderer=!0;class j7 extends li{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}j7.prototype.isScene=!0;class tm{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=x0,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=ja()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=ja()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=ja()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}tm.prototype.isInterleavedBuffer=!0;const Ji=new _e;class b0{constructor(e,t,n,r=!1){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r===!0}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)Ji.x=this.getX(t),Ji.y=this.getY(t),Ji.z=this.getZ(t),Ji.applyMatrix4(e),this.setXYZ(t,Ji.x,Ji.y,Ji.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Ji.x=this.getX(t),Ji.y=this.getY(t),Ji.z=this.getZ(t),Ji.applyNormalMatrix(e),this.setXYZ(t,Ji.x,Ji.y,Ji.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Ji.x=this.getX(t),Ji.y=this.getY(t),Ji.z=this.getZ(t),Ji.transformDirection(e),this.setXYZ(t,Ji.x,Ji.y,Ji.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}
vendor: 5,271 bytes, line 7925
7925setXYZW(e,t,n,r,s){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new br(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new b0(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}b0.prototype.isInterleavedBufferAttribute=!0;class X7 extends fs{constructor(e){super(),this.type="SpriteMaterial",this.color=new en(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}X7.prototype.isSpriteMaterial=!0;let xd;const Zp=new _e,bd=new _e,Sd=new _e,Md=new Mt,Kp=new Mt,Y7=new ln,jg=new _e,Jp=new _e,Xg=new _e,rP=new Mt,S2=new Mt,sP=new Mt;class MAe extends li{constructor(e){if(super(),this.type="Sprite",xd===void 0){xd=new Fi;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new tm(t,5);xd.setIndex([0,1,2,0,2,3]),xd.setAttribute("position",new b0(n,3,0,!1)),xd.setAttribute("uv",new b0(n,2,3,!1))}this.geometry=xd,this.material=e!==void 0?e:new X7,this.center=new Mt(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),bd.setFromMatrixScale(this.matrixWorld),Y7.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Sd.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&bd.multiplyScalar(-Sd.z);const n=this.material.rotation;let r,s;n!==0&&(s=Math.cos(n),r=Math.sin(n));const o=this.center;Yg(jg.set(-.5,-.5,0),Sd,o,bd,r,s),Yg(Jp.set(.5,-.5,0),Sd,o,bd,r,s),Yg(Xg.set(.5,.5,0),Sd,o,bd,r,s),rP.set(0,0),S2.set(1,0),sP.set(1,1);let a=e.ray.intersectTriangle(jg,Jp,Xg,!1,Zp);if(a===null&&(Yg(Jp.set(-.5,.5,0),Sd,o,bd,r,s),S2.set(0,1),a=e.ray.intersectTriangle(jg,Xg,Jp,!1,Zp),a===null))return;const l=e.ray.origin.distanceTo(Zp);l<e.near||l>e.far||t.push({distance:l,point:Zp.clone(),uv:yr.getUV(Zp,jg,Jp,Xg,rP,S2,sP,new Mt),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}MAe.prototype.isSprite=!0;function Yg(i,e,t,n,r,s){Md.subVectors(i,t).addScalar(.5).multiply(n),r!==void 0?(Kp.x=s*Md.x-r*Md.y,Kp.y=r*Md.x+s*Md.y):Kp.copy(Md),i.copy(e),i.x+=Kp.x,i.y+=Kp.y,i.applyMatrix4(Y7)}const oP=new _e,aP=new _i,lP=new _i,wAe=new _e,cP=new ln;class Q7 extends Gs{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new ln,this.bindMatrixInverse=new ln}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new _i,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const n=this.skeleton,r=this.geometry;aP.fromBufferAttribute(r.attributes.skinIndex,e),lP.fromBufferAttribute(r.attributes.skinWeight,e),oP.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=lP.getComponent(s);if(o!==0){const a=aP.getComponent(s);cP.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),t.addScaledVector(wAe.copy(oP).applyMatrix4(cP),o)}}
7925return t.applyMatrix4(this.bindMatrixInverse)}}Q7.prototype.isSkinnedMesh=!0;class TAe extends li{constructor(){super(),this.type="Bone"}}TAe.prototype.isBone=!0;class EAe extends jr{constructor(e=null,t=1,n=1,r,s,o,a,l,c=Fr,u=Fr,p,m){super(null,o,a,l,c,u,r,s,p,m),this.image={data:e,width:t,height:n},this.magFilter=c,this.minFilter=u,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}EAe.prototype.isDataTexture=!0;class cS extends br{constructor(e,t,n,r=1){typeof n=="number"&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,n),this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}cS.prototype.isInstancedBufferAttribute=!0;const uP=new ln,hP=new ln,Qg=[],eA=new Gs;class RAe extends Gs{constructor(e,t,n){super(e,t),this.instanceMatrix=new cS(new Float32Array(n*16),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}raycast(e,t){const n=this.matrixWorld,r=this.count;if(eA.geometry=this.geometry,eA.material=this.material,eA.material!==void 0)for(let s=0;s<r;s++){this.getMatrixAt(s,uP),hP.multiplyMatrices(n,uP),eA.matrixWorld=hP,eA.raycast(e,Qg);for(let o=0,a=Qg.length;o<a;o++){const l=Qg[o];l.instanceId=s,l.object=this,t.push(l)}Qg.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new cS(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}RAe.prototype.isInstancedMesh=!0;class nm extends fs{constructor(e){super(),this.type="LineBasicMaterial",this.color=new en(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this}}nm.prototype.isLineBasicMaterial=!0;const dP=new _e,fP=new _e,pP=new ln,M2=new np,Zg=new tp;class Zw extends li{constructor(e=new Fi,t=new nm){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,n=[0];for(let r=1,s=t.count;r<s;r++)dP.fromBufferAttribute(t,r-1),fP.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=dP.distanceTo(fP);e.setAttribute("lineDistance",new Or(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Zg.copy(n.boundingSphere),Zg.applyMatrix4(r),Zg.radius+=s,e.ray.intersectsSphere(Zg)===!1)return;pP.copy(r).invert(),M2.copy(e.ray).applyMatrix4(pP);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=new _e,u=new _e,p=new _e,m=new _e,g=this.isLineSegments?2:1;if(n.isBufferGeometry){const v=n.index,M=n.attributes.position;if(v!==null){const x=Math.max(0,o.start),w=Math.min(v.count,o.start+o.count);for(let R=x,C=w-1;R<C;R+=g){const N=v.getX(R),D=v.getX(R+1);if(c.fromBufferAttribute(M,N),u.fromBufferAttribute(M,D),M2.distanceSqToSegment(c,u,m,p)>l)continue;m.applyMatrix4(this.matrixWorld);const O=e.ray.origin.distanceTo(m);O<e.near||O>e.far||t.push({distance:O,point:p.clone().applyMatrix4(this.matrixWorld),index:R,face:null,faceIndex:null,object:this})}}else{const x=Math.max(0,o.start),w=Math.min(M.count,o.start+o.count);for(let R=x,C=w-1;R<C;R+=g){if(c.fromBufferAttribute(M,R),u.fromBufferAttribute(M,R+1),M2.distanceSqToSegment(c,u,m,p)>l)continue;m.applyMatrix4(this.matrixWorld);const D=e.ray.origin.distanceTo(m);D<e.near||D>e.far||t.push({distance:D,point:p.clone().applyMatrix4(this.matrixWorld),index:R,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[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}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}Zw.prototype.isLine=!0;const AP=new _e,mP=new _e;class Kw extends Zw{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,n=[];for(let r=0,s=t.count;r<s;r+=2)AP.fromBufferAttribute(t,r),mP.fromBufferAttribute(t,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+AP.distanceTo(mP);e.setAttribute("lineDistance",new Or(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() n
7925o longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}Kw.prototype.isLineSegments=!0;class CAe extends Zw{constructor(e,t){super(e,t),this.type="LineLoop"}}CAe.prototype.isLineLoop=!0;class Z7 extends fs{constructor(e){super(),this.type="PointsMaterial",this.color=new en(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this}}Z7.prototype.isPointsMaterial=!0;const gP=new ln,uS=new np,Kg=new tp,Jg=new _e;class PAe extends li{constructor(e=new Fi,t=new Z7){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Kg.copy(n.boundingSphere),Kg.applyMatrix4(r),Kg.radius+=s,e.ray.intersectsSphere(Kg)===!1)return;gP.copy(r).invert(),uS.copy(e.ray).applyMatrix4(gP);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a;if(n.isBufferGeometry){const c=n.index,p=n.attributes.position;if(c!==null){const m=Math.max(0,o.start),g=Math.min(c.count,o.start+o.count);for(let v=m,b=g;v<b;v++){const M=c.getX(v);Jg.fromBufferAttribute(p,M),_P(Jg,M,l,r,e,t,this)}}else{const m=Math.max(0,o.start),g=Math.min(p.count,o.start+o.count);for(let v=m,b=g;v<b;v++)Jg.fromBufferAttribute(p,v),_P(Jg,v,l,r,e,t,this)}}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[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}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}PAe.prototype.isPoints=!0;function _P(i,e,t,n,r,s,o){const a=uS.distanceSqToPoint(i);if(a<t){const l=new _e;uS.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:e,face:null,object:o})}}class LAe extends jr{constructor(e,t,n,r,s,o,a,l,c){super(e,t,n,r,s,o,a,l,c),this.format=a!==void 0?a:Ku,this.minFilter=o!==void 0?o:ko,this.magFilter=s!==void 0?s:ko,this.generateMipmaps=!1;const u=this;function p(){u.needsUpdate=!0,e.requestVideoFrameCallback(p)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(p)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}LAe.prototype.isVideoTexture=!0;class NAe extends jr{constructor(e,t,n,r,s,o,a,l,c,u,p,m){super(null,o,a,l,c,u,r,s,p,m),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}NAe.prototype.isCompressedTexture=!0;class DAe extends jr{constructor(e,t,n,r,s,o,a,l,c){super(e,t,n,r,s,o,a,l,c),this.needsUpdate=!0}}DAe.prototype.isCanvasTexture=!0;class $o{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)n=this.getPoint(o/e),s+=n.distanceTo(r),t.push(s),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let r=0;const s=n.length;let o;t?o=t:o=e*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);
vendor: 11,953 bytes, line 7925
7925const u=n[r],m=n[r+1]-u,g=(o-u)/m;return(r+g)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new Mt:new _e);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new _e,r=[],s=[],o=[],a=new _e,l=new ln;for(let g=0;g<=e;g++){const v=g/e;r[g]=this.getTangentAt(v,new _e)}s[0]=new _e,o[0]=new _e;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),p=Math.abs(r[0].y),m=Math.abs(r[0].z);u<=c&&(c=u,n.set(1,0,0)),p<=c&&(c=p,n.set(0,1,0)),m<=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 g=1;g<=e;g++){if(s[g]=s[g-1].clone(),o[g]=o[g-1].clone(),a.crossVectors(r[g-1],r[g]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos(_o(r[g-1].dot(r[g]),-1,1));s[g].applyMatrix4(l.makeRotationAxis(a,v))}o[g].crossVectors(r[g],s[g])}if(t===!0){let g=Math.acos(_o(s[0].dot(s[e]),-1,1));g/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(g=-g);for(let v=1;v<=e;v++)s[v].applyMatrix4(l.makeRotationAxis(r[v],g*v)),o[v].crossVectors(r[v],s[v])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Nv extends $o{constructor(e=0,t=0,n=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const n=t||new Mt,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+e*s;let l=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const u=Math.cos(this.aRotation),p=Math.sin(this.aRotation),m=l-this.aX,g=c-this.aY;l=m*u-g*p+this.aX,c=m*p+g*u+this.aY}return n.set(l,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}Nv.prototype.isEllipseCurve=!0;class K7 extends Nv{constructor(e,t,n,r,s,o){super(e,t,n,n,r,s,o),this.type="ArcCurve"}}K7.prototype.isArcCurve=!0;function Jw(){let i=0,e=0,t=0,n=0;function r(s,o,a,l){i=s,e=a,t=-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,u,p){let m=(o-s)/c-(a-s)/(c+u)+(a-o)/u,g=(a-o)/u-(l-o)/(u+p)+(l-a)/p;m*=u,g*=u,r(o,a,m,g)},calc:function(s){const o=s*s,a=o*s;return i+e*s+t*o+n*a}}}const e_=new _e,w2=new Jw,T2=new Jw,E2=new Jw;class J7 extends $o{constructor(e=[],t=!1,n="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new _e){const n=t,r=this.points,s=r.length,o=(s-(this.closed?0:1))*e;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,u;this.closed||a>0?c=r[(a-1)%s]:(e_.subVectors(r[0],r[1]).add(r[0]),c=e_);const p=r[a%s],m=r[(a+1)%s];if(this.closed||a+2<s?u=r[(a+2)%s]:(e_.subVectors(r[s-1],r[s-2]).add(r[s-1]),u=e_),this.curveType==="centripetal"||this.curveType==="chordal"){const g=this.curveType==="chordal"?.5:.25;let v=Math.pow(c.distanceToSquared(p),g),b=Math.pow(p.distanceToSquared(m),g),M=Math.pow(m.distanceToSquared(u),g);b<1e-4&&(b=1),v<1e-4&&(v=b),M<1e-4&&(M=b),w2.initNonuniformCatmullRom(c.x,p.x,m.x,u.x,v,b,M),T2.initNonuniformCatmullRom(c.y,p.y,m.y,u.y,v,b,M),E2.initNonuniformCatmullRom(c.z,p.z,m.z,u.z,v,b,M)}else this.curveType==="catmullrom"&&(w2.initCatmullRom(c.x,p.x,m.x,u.x,this.tension),T2.initCatmullRom(c.y,p.y,m.y,u.y,this.tension),E2.initCatmullRom(c.z,p.z,m.z,u.z,this.tension));return n.set(w2.calc(l),T2.calc(l),E2.calc(l)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(new _e().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}J7.prototype.isCatmullRomCurve3=!0;function vP(i,e,t,n,r){const s=(n-e)*.5,o=(r-t)*.5,a=i*i,l=i*a;return(2*t-2*n+s+o)*l+(-3*t+3*n-2*s-o)*a+s*i+t}function IAe(i,e){const t=1-i;return t*t*e}function BAe(i,e){return 2*(1-i)*i*e}function FAe(i,e){return i*i*e}function PA(i,e,t,n){return IAe(i,e)+BAe(i,t)+FAe(i,n)}function UAe(i,e){const t=1-i;return t*t*t*e}function OAe(i,e){const t=1-i;return 3*t*t*i*e}function kAe(i,e){return 3*(1-i)*i*i*e}function zAe(i,e){return i*i*i*e}function LA(i,e,t,n,r){return UAe(i,e)+OAe(i,t)+kAe(i,n)+zAe(i,r)}class eT extends $o{constructor(e=new Mt,t=new Mt,n=new Mt,r=new Mt){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new Mt){const n=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return n.set(LA(e,r.x,s.x,o.x,a.x),LA(e,r.y,s.y,o.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}eT.prototype.isCubicBezierCurve=!0;class eB extends $o{constructor(e=new _e,t=new _e,n=new _e,r=new _e){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new _e){const n=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return n.set(LA(e,r.x,s.x,o.x,a.x),LA(e,r.y,s.y,o.y,a.y),LA(e,r.z,s.z,o.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}eB.prototype.isCubicBezierCurve3=!0;class Dv extends $o{constructor(e=new Mt,t=new Mt){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Mt){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const n=t||new Mt;return n.copy(this.v2).sub(this.v1).normalize(),n}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Dv.prototype.isLineCurve=!0;class VAe extends $o{constructor(e=new _e,t=new _e){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new _e){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class tT extends $o{constructor(e=new Mt,t=new Mt,n=new Mt){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Mt){const n=t,r=this.v0,s=this.v1,o=this.v2;return n.set(PA(e,r.x,s.x,o.x),PA(e,r.y,s.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}tT.prototype.isQuadraticBezierCurve=!0;class tB extends $o{constructor(e=new _e,t=new _e,n=new _e){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new _e){const n=t,r=this.v0,s=this.v1,o=this.v2;return n.set(PA(e,r.x,s.x,o.x),PA(e,r.y,s.y,o.y),PA(e,r.z,s.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}tB.prototype.isQuadraticBezierCurve3=!0;class nT extends $o{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new Mt){const n=t,r=this.points,s=(r.length-1)*e,o=Math.floor(s),a=s-o,l=r[o===0?o:o-1],c=r[o],u=r[o>r.length-2?r.length-1:o+1],p=r[o>r.length-3?r.length-1:o+2];return n.set(vP(a,l.x,c.x,u.x,p.x),vP(a,l.y,c.y,u.y,p.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(new Mt().fromArray(r))}return this}}nT.prototype.isSplineCurve=!0;var nB=Object.freeze({__proto__:null,ArcCurve:K7,CatmullRomCurve3:J7,CubicBezierCurve:eT,CubicBezierCurve3:eB,EllipseCurve:Nv,LineCurve:Dv,LineCurve3:VAe,QuadraticBezierCurve:tT,QuadraticBezierCurve3:tB,SplineCurve:nT});class GAe extends $o{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Dv(t,e))}getPoint(e,t){const n=e*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,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],a=o&&o.isEllipseCurve?e*2:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?e*o.points.length:e,l=o.getPoints(a);for(let c=0;c<l.length;c++){const u=l[c];n&&n.equals(u)||(t.push(u),n=u)}}return this.autoClose&&t.length>
79251&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const r=e.curves[t];this.curves.push(new nB[r.type]().fromJSON(r))}return this}}class hS extends GAe{constructor(e){super(),this.type="Path",this.currentPoint=new Mt,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new Dv(this.currentPoint.clone(),new Mt(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){const s=new tT(this.currentPoint.clone(),new Mt(e,t),new Mt(n,r));return this.curves.push(s),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,s,o){const a=new eT(this.currentPoint.clone(),new Mt(e,t),new Mt(n,r),new Mt(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new nT(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,s,o){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+a,t+l,n,r,s,o),this}absarc(e,t,n,r,s,o){return this.absellipse(e,t,n,n,r,s,o),this}ellipse(e,t,n,r,s,o,a,l){const c=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(e+c,t+u,n,r,s,o,a,l),this}absellipse(e,t,n,r,s,o,a,l){const c=new Nv(e,t,n,r,s,o,a,l);if(this.curves.length>0){const p=c.getPoint(0);p.equals(this.currentPoint)||this.lineTo(p.x,p.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class im extends hS{constructor(e){super(e),this.uuid=ja(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const r=e.holes[t];this.holes.push(new hS().fromJSON(r))}return this}}const qAe={triangulate:function(i,e,t=2){const n=e&&e.length,r=n?e[0]*t:i.length;let s=iB(i,0,r,t,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,c,u,p,m,g;if(n&&(s=XAe(i,e,s,t)),i.length>80*t){a=c=i[0],l=u=i[1];for(let v=t;v<r;v+=t)p=i[v],m=i[v+1],p<a&&(a=p),m<l&&(l=m),p>c&&(c=p),m>u&&(u=m);g=Math.max(c-a,u-l),g=g!==0?1/g:0}return S0(s,o,t,a,l,g),o}};function iB(i,e,t,n,r){let s,o;if(r===s0e(i,e,t,n)>0)for(s=e;s<t;s+=n)o=yP(s,i[s],i[s+1],o);else for(s=t-n;s>=e;s-=n)o=yP(s,i[s],i[s+1],o);return o&&Iv(o,o.next)&&(w0(o),o=o.next),o}function jc(i,e){if(!i)return i;e||(e=i);let t=i,n;do if(n=!1,!t.steiner&&(Iv(t,t.next)||Vi(t.prev,t,t.next)===0)){if(w0(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function S0(i,e,t,n,r,s,o){if(!i)return;!o&&s&&JAe(i,n,r,s);let a=i,l,c;for(;i.prev!==i.next;){if(l=i.prev,c=i.next,s?WAe(i,n,r,s):HAe(i)){e.push(l.i/t),e.push(i.i/t),e.push(c.i/t),w0(i),i=c.next,a=c.next;continue}if(i=c,i===a){o?o===1?(i=$Ae(jc(i),e,t),S0(i,e,t,n,r,s,2)):o===2&&jAe(i,e,t,n,r,s):S0(jc(i),e,t,n,r,s,1);break}}}function HAe(i){const e=i.prev,t=i,n=i.next;if(Vi(e,t,n)>=0)return!1;let r=i.next.next;for(;r!==i.prev;){if(Gd(e.x,e.y,t.x,t.y,n.x,n.y,r.x,r.y)&&Vi(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function WAe(i,e,t,n){const r=i.prev,s=i,o=i.next;if(Vi(r,s,o)>=0)return!1;const a=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,l=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,c=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,u=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,p=dS(a,l,e,t,n),m=dS(c,u,e,t,n);let g=i.prevZ,v=i.nextZ;for(;g&&g.z>=p&&v&&v.z<=m;){if(g!==i.prev&&g!==i.next&&Gd(r.x,r.y,s.x,s.y,o.x,o.y,g.x,g.y)&&Vi(g.prev,g,g.next)>=0||(g=g.prevZ,v!==i.prev&&v!==i.next&&Gd(r.x,r.y,s.x,s.y,o.x,o.y,v.x,v.y)&&Vi(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;g&&g.z>=p;){if(g!==i.prev&&g!==i.next&&Gd(r.x,r.y,s.x,s.y,o.x,o.y,g.x,g.y)&&Vi(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;v&&v.z<=m;){if(v!==i.prev&&v!==i.next&&Gd(r.x,r.y,s.x,s.y,o.x,o.y,v.x,v.y)&&Vi(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function $Ae(i,e,t){let n=i;do{const r=n.prev,s=n.next.next;!Iv(r,s)&&rB(r,n,n.next,s)&&M0(r,s)&&M0(s,r)&&(e.push(r.i/t),e.push(n.i/t),e.push(s.i/t),w0(n),w0(n.next),n=i=s),n=n.next}while(n!==i);return jc(n)}
7925function jAe(i,e,t,n,r,s){let o=i;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&n0e(o,a)){let l=sB(o,a);o=jc(o,o.next),l=jc(l,l.next),S0(o,e,t,n,r,s),S0(l,e,t,n,r,s);return}a=a.next}o=o.next}while(o!==i)}function XAe(i,e,t,n){const r=[];let s,o,a,l,c;for(s=0,o=e.length;s<o;s++)a=e[s]*n,l=s<o-1?e[s+1]*n:i.length,c=iB(i,a,l,n,!1),c===c.next&&(c.steiner=!0),r.push(t0e(c));for(r.sort(YAe),s=0;s<r.length;s++)QAe(r[s],t),t=jc(t,t.next);return t}function YAe(i,e){return i.x-e.x}function QAe(i,e){if(e=ZAe(i,e),e){const t=sB(e,i);jc(e,e.next),jc(t,t.next)}}function ZAe(i,e){let t=e;const n=i.x,r=i.y;let s=-1/0,o;do{if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const m=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(m<=n&&m>s){if(s=m,m===n){if(r===t.y)return t;if(r===t.next.y)return t.next}o=t.x<t.next.x?t:t.next}}t=t.next}while(t!==e);if(!o)return null;if(n===s)return o;const a=o,l=o.x,c=o.y;let u=1/0,p;t=o;do n>=t.x&&t.x>=l&&n!==t.x&&Gd(r<c?n:s,r,l,c,r<c?s:n,r,t.x,t.y)&&(p=Math.abs(r-t.y)/(n-t.x),M0(t,i)&&(p<u||p===u&&(t.x>o.x||t.x===o.x&&KAe(o,t)))&&(o=t,u=p)),t=t.next;while(t!==a);return o}function KAe(i,e){return Vi(i.prev,i,e.prev)<0&&Vi(e.next,i,i.next)<0}function JAe(i,e,t,n){let r=i;do r.z===null&&(r.z=dS(r.x,r.y,e,t,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==i);r.prevZ.nextZ=null,r.prevZ=null,e0e(r)}function e0e(i){let e,t,n,r,s,o,a,l,c=1;do{for(t=i,i=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e<c&&(a++,n=n.nextZ,!!n);e++);for(l=c;a>0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(r=t,t=t.nextZ,a--):(r=n,n=n.nextZ,l--),s?s.nextZ=r:i=r,r.prevZ=s,s=r;t=n}s.nextZ=null,c*=2}while(o>1);return i}function dS(i,e,t,n,r){return i=32767*(i-t)*r,e=32767*(e-n)*r,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,i|e<<1}function t0e(i){let e=i,t=i;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==i);return t}function Gd(i,e,t,n,r,s,o,a){return(r-o)*(e-a)-(i-o)*(s-a)>=0&&(i-o)*(n-a)-(t-o)*(e-a)>
vendor: 19,823 bytes, line 7925
7925=0&&(t-o)*(s-a)-(r-o)*(n-a)>=0}function n0e(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!i0e(i,e)&&(M0(i,e)&&M0(e,i)&&r0e(i,e)&&(Vi(i.prev,i,e.prev)||Vi(i,e.prev,e))||Iv(i,e)&&Vi(i.prev,i,i.next)>0&&Vi(e.prev,e,e.next)>0)}function Vi(i,e,t){return(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y)}function Iv(i,e){return i.x===e.x&&i.y===e.y}function rB(i,e,t,n){const r=n_(Vi(i,e,t)),s=n_(Vi(i,e,n)),o=n_(Vi(t,n,i)),a=n_(Vi(t,n,e));return!!(r!==s&&o!==a||r===0&&t_(i,t,e)||s===0&&t_(i,n,e)||o===0&&t_(t,i,n)||a===0&&t_(t,e,n))}function t_(i,e,t){return e.x<=Math.max(i.x,t.x)&&e.x>=Math.min(i.x,t.x)&&e.y<=Math.max(i.y,t.y)&&e.y>=Math.min(i.y,t.y)}function n_(i){return i>0?1:i<0?-1:0}function i0e(i,e){let t=i;do{if(t.i!==i.i&&t.next.i!==i.i&&t.i!==e.i&&t.next.i!==e.i&&rB(t,t.next,i,e))return!0;t=t.next}while(t!==i);return!1}function M0(i,e){return Vi(i.prev,i,i.next)<0?Vi(i,e,i.next)>=0&&Vi(i,i.prev,e)>=0:Vi(i,e,i.prev)<0||Vi(i,i.next,e)<0}function r0e(i,e){let t=i,n=!1;const r=(i.x+e.x)/2,s=(i.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==i);return n}function sB(i,e){const t=new fS(i.i,i.x,i.y),n=new fS(e.i,e.x,e.y),r=i.next,s=e.prev;return i.next=e,e.prev=i,t.next=r,r.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function yP(i,e,t,n){const r=new fS(i,e,t);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function w0(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function fS(i,e,t){this.i=i,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function s0e(i,e,t,n){let r=0;for(let s=e,o=t-n;s<t;s+=n)r+=(i[o]-i[s])*(i[s+1]+i[o+1]),o=s;return r}class zc{static area(e){const t=e.length;let n=0;for(let r=t-1,s=0;s<t;r=s++)n+=e[r].x*e[s].y-e[s].x*e[r].y;return n*.5}static isClockWise(e){return zc.area(e)<0}static triangulateShape(e,t){const n=[],r=[],s=[];xP(e),bP(n,e);let o=e.length;t.forEach(xP);for(let l=0;l<t.length;l++)r.push(o),o+=t[l].length,bP(n,t[l]);const a=qAe.triangulate(n,r);for(let l=0;l<a.length;l+=3)s.push(a.slice(l,l+3));return s}}function xP(i){const e=i.length;e>2&&i[e-1].equals(i[0])&&i.pop()}function bP(i,e){for(let t=0;t<e.length;t++)i.push(e[t].x),i.push(e[t].y)}class sp extends Fi{constructor(e=new im([new Mt(.5,.5),new Mt(-.5,.5),new Mt(-.5,-.5),new Mt(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,r=[],s=[];for(let a=0,l=e.length;a<l;a++){const c=e[a];o(c)}this.setAttribute("position",new Or(r,3)),this.setAttribute("uv",new Or(s,2)),this.computeVertexNormals();function o(a){const l=[],c=t.curveSegments!==void 0?t.curveSegments:12,u=t.steps!==void 0?t.steps:1;let p=t.depth!==void 0?t.depth:1,m=t.bevelEnabled!==void 0?t.bevelEnabled:!0,g=t.bevelThickness!==void 0?t.bevelThickness:.2,v=t.bevelSize!==void 0?t.bevelSize:g-.1,b=t.bevelOffset!==void 0?t.bevelOffset:0,M=t.bevelSegments!==void 0?t.bevelSegments:3;const x=t.extrudePath,w=t.UVGenerator!==void 0?t.UVGenerator:o0e;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),p=t.amount);let R,C=!1,N,D,P,O;x&&(R=x.getSpacedPoints(u),C=!0,m=!1,N=x.computeFrenetFrames(u,!1),D=new _e,P=new _e,O=new _e),m||(M=0,g=0,v=0,b=0);const I=a.extractPoints(c);let F=I.shape;const k=I.holes;if(!zc.isClockWise(F)){F=F.reverse();for(let Ue=0,Xe=k.length;Ue<Xe;Ue++){const Z=k[Ue];zc.isClockWise(Z)&&(k[Ue]=Z.reverse())}}const W=zc.triangulateShape(F,k),Q=F;for(let Ue=0,Xe=k.length;Ue<Xe;Ue++){const Z=k[Ue];F=F.concat(Z)}function J(Ue,Xe,Z){return Xe||console.error("THREE.ExtrudeGeometry: vec does not exist"),Xe.clone().multiplyScalar(Z).add(Ue)}const H=F.length,$=W.length;function K(Ue,Xe,Z){let We,Pe,Qe;const Oe=Ue.x-Xe.x,vt=Ue.y-Xe.y,ot=Z.x-Ue.x,q=Z.y-Ue.y,U=Oe*Oe+vt*vt,ue=Oe*q-vt*ot;if(Math.abs(ue)>Number.EPSILON){const Ae=Math.sqrt(U),Be=Math.sqrt(ot*ot+q*q),we=Xe.x-vt/Ae,pe=Xe.y+Oe/Ae,qe=Z.x-q/Be,Ve=Z.y+ot/Be,st=((qe-we)*q-(Ve-pe)*ot)/(Oe*q-vt*ot);We=we+Oe*st-Ue.x,Pe=pe+vt*st-Ue.y;const Ie=We*We+Pe*Pe;if(Ie<=2)return new Mt(We,Pe);Qe=Math.sqrt(Ie/2)}else{let Ae=!1;Oe>Number.EPSILON?ot>Number.EPSILON&&(Ae=!0):Oe<-Number.EPSILON?ot<-Number.EPSILON&&(Ae=!0):Math.sign(vt)===Math.sign(q)&&(Ae=!0),Ae?(We=-vt,Pe=Oe,Qe=Math.sqrt(U)):(We=Oe,Pe=vt,Qe=Math.sqrt(U/2))}return new Mt(We/Qe,Pe/Qe)}const he=[];for(let Ue=0,Xe=Q.length,Z=Xe-1,We=Ue+1;Ue<Xe;Ue++,Z++,We++)Z===Xe&&(Z=0),We===Xe&&(We=0),he[Ue]=K(Q[Ue],Q[Z],Q[We]);const ie=[];let de,Ce=he.concat();for(let Ue=0,Xe=k.length;Ue<Xe;Ue++){const Z=k[Ue];de=[];for(let We=0,Pe=Z.length,Qe=Pe-1,Oe=We+1;We<Pe;We++,Qe++,Oe++)Qe===Pe&&(Qe=0),Oe===Pe&&(Oe=0),de[We]=K(Z[We],Z[Qe],Z[Oe]);ie.push(de),Ce=Ce.concat(de)}for(let Ue=0;Ue<M;Ue++){const Xe=Ue/M,Z=g*Math.cos(Xe*Math.PI/2),We=v*Math.sin(Xe*Math.PI/2)+b;for(let Pe=0,Qe=Q.length;Pe<Qe;Pe++){const Oe=J(Q[Pe],he[Pe],We);Ye(Oe.x,Oe.y,-Z)}for(let Pe=0,Qe=k.length;Pe<Qe;Pe++){const Oe=k[Pe];de=ie[Pe];for(let vt=0,ot=Oe.length;vt<ot;vt++){const q=J(Oe[vt],de[vt],We);Ye(q.x,q.y,-Z)}}}const Fe=v+b;for(let Ue=0;Ue<H;Ue++){const Xe=m?J(F[Ue],Ce[Ue],Fe):F[Ue];C?(P.copy(N.normals[0]).multiplyScalar(Xe.x),D.copy(N.binormals[0]).multiplyScalar(Xe.y),O.copy(R[0]).add(P).add(D),Ye(O.x,O.y,O.z)):Ye(Xe.x,Xe.y,0)}for(let Ue=1;Ue<=u;Ue++)for(let Xe=0;Xe<H;Xe++){const Z=m?J(F[Xe],Ce[Xe],Fe):F[Xe];C?(P.copy(N.normals[Ue]).multiplyScalar(Z.x),D.copy(N.binormals[Ue]).multiplyScalar(Z.y),O.copy(R[Ue]).add(P).add(D),Ye(O.x,O.y,O.z)):Ye(Z.x,Z.y,p/u*Ue)}for(let Ue=M-1;Ue>=0;Ue--){const Xe=Ue/M,Z=g*Math.cos(Xe*Math.PI/2),We=v*Math.sin(Xe*Math.PI/2)+b;for(let Pe=0,Qe=Q.length;Pe<Qe;Pe++){const Oe=J(Q[Pe],he[Pe],We);Ye(Oe.x,Oe.y,p+Z)}for(let Pe=0,Qe=k.length;Pe<Qe;Pe++){const Oe=k[Pe];de=ie[Pe];for(let vt=0,ot=Oe.length;vt<ot;vt++){const q=J(Oe[vt],de[vt],We);C?Ye(q.x,q.y+R[u-1].y,R[u-1].x+Z):Ye(q.x,q.y,p+Z)}}}ge(),Ge();function ge(){const Ue=r.length/3;if(m){let Xe=0,Z=H*Xe;for(let We=0;We<$;We++){const Pe=W[We];ct(Pe[2]+Z,Pe[1]+Z,Pe[0]+Z)}Xe=u+M*2,Z=H*Xe;for(let We=0;We<$;We++){const Pe=W[We];ct(Pe[0]+Z,Pe[1]+Z,Pe[2]+Z)}}else{for(let Xe=0;Xe<$;Xe++){const Z=W[Xe];ct(Z[2],Z[1],Z[0])}for(let Xe=0;Xe<$;Xe++){const Z=W[Xe];ct(Z[0]+H*u,Z[1]+H*u,Z[2]+H*u)}}n.addGroup(Ue,r.length/3-Ue,0)}function Ge(){const Ue=r.length/3;let Xe=0;Me(Q,Xe),Xe+=Q.length;for(let Z=0,We=k.length;Z<We;Z++){const Pe=k[Z];Me(Pe,Xe),Xe+=Pe.length}n.addGroup(Ue,r.length/3-Ue,1)}function Me(Ue,Xe){let Z=Ue.length;for(;--Z>=0;){const We=Z;let Pe=Z-1;Pe<0&&(Pe=Ue.length-1);for(let Qe=0,Oe=u+M*2;Qe<Oe;Qe++){const vt=H*Qe,ot=H*(Qe+1),q=Xe+We+vt,U=Xe+Pe+vt,ue=Xe+Pe+ot,Ae=Xe+We+ot;Je(q,U,ue,Ae)}}}function Ye(Ue,Xe,Z){l.push(Ue),l.push(Xe),l.push(Z)}function ct(Ue,Xe,Z){Ke(Ue),Ke(Xe),Ke(Z);const We=r.length/3,Pe=w.generateTopUV(n,r,We-3,We-2,We-1);Rt(Pe[0]),Rt(Pe[1]),Rt(Pe[2])}function Je(Ue,Xe,Z,We){Ke(Ue),Ke(Xe),Ke(We),Ke(Xe),Ke(Z),Ke(We);const Pe=r.length/3,Qe=w.generateSideWallUV(n,r,Pe-6,Pe-3,Pe-2,Pe-1);Rt(Qe[0]),Rt(Qe[1]),Rt(Qe[3]),Rt(Qe[1]),Rt(Qe[2]),Rt(Qe[3])}function Ke(Ue){r.push(l[Ue*3+0]),r.push(l[Ue*3+1]),r.push(l[Ue*3+2])}function Rt(Ue){s.push(Ue.x),s.push(Ue.y)}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return a0e(t,n,e)}static fromJSON(e,t){const n=[];for(let s=0,o=e.shapes.length;s<o;s++){const a=t[e.shapes[s]];n.push(a)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new nB[r.type]().fromJSON(r)),new sp(n,e.options)}}const o0e={generateTopUV:function(i,e,t,n,r){const s=e[t*3],o=e[t*3+1],a=e[n*3],l=e[n*3+1],c=e[r*3],u=e[r*3+1];return[new Mt(s,o),new Mt(a,l),new Mt(c,u)]},generateSideWallUV:function(i,e,t,n,r,s){const o=e[t*3],a=e[t*3+1],l=e[t*3+2],c=e[n*3],u=e[n*3+1],p=e[n*3+2],m=e[r*3],g=e[r*3+1],v=e[r*3+2],b=e[s*3],M=e[s*3+1],x=e[s*3+2];return Math.abs(a-u)<Math.abs(o-c)?[new Mt(o,1-l),new Mt(c,1-p),new Mt(m,1-v),new Mt(b,1-x)]:[new Mt(a,1-l),new Mt(u,1-p),new Mt(g,1-v),new Mt(M,1-x)]}};function a0e(i,e,t){if(t.shapes=[],Array.isArray(i))for(let n=0,r=i.length;n<r;n++){const s=i[n];t.shapes.push(s.uuid)}else t.shapes.push(i.uuid);return e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class iT extends Fi{constructor(e=new im([new Mt(0,.5),new Mt(-.5,-.5),new Mt(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],r=[],s=[],o=[];let a=0,l=0;if(Array.isArray(e)===!1)c(e);else for(let u=0;u<e.length;u++)c(e[u]),this.addGroup(a,l,u),a+=l,l=0;this.setIndex(n),this.setAttribute("position",new Or(r,3)),this.setAttribute("normal",new Or(s,3)),this.setAttribute("uv",new Or(o,2));function c(u){const p=r.length/3,m=u.extractPoints(t);let g=m.shape;const v=m.holes;zc.isClockWise(g)===!1&&(g=g.reverse());for(let M=0,x=v.length;M<x;M++){const w=v[M];zc.isClockWise(w)===!0&&(v[M]=w.reverse())}const b=zc.triangulateShape(g,v);for(let M=0,x=v.length;M<x;M++){const w=v[M];g=g.concat(w)}for(let M=0,x=g.length;M<x;M++){const w=g[M];r.push(w.x,w.y,0),s.push(0,0,1),o.push(w.x,w.y)}for(let M=0,x=b.length;M<x;M++){const w=b[M],R=w[0]+p,C=w[1]+p,N=w[2]+p;n.push(R,C,N),l+=3}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return l0e(t,e)}static fromJSON(e,t){const n=[];for(let r=0,s=e.shapes.length;r<s;r++){const o=t[e.shapes[r]];n.push(o)}return new iT(n,e.curveSegments)}}function l0e(i,e){if(e.shapes=[],Array.isArray(i))for(let t=0,n=i.length;t<n;t++){const r=i[t];e.shapes.push(r.uuid)}else e.shapes.push(i.uuid);return e}class c0e extends fs{constructor(e){super(),this.type="ShadowMaterial",this.color=new en(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}c0e.prototype.isShadowMaterial=!0;class oB extends fs{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new en(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new en(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Jf,this.normalScale=new Mt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}oB.prototype.isMeshStandardMaterial=!0;class u0e extends oB{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Mt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return _o(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.sheenColor=new en(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new en(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new en(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}u0e.prototype.isMeshPhysicalMaterial=!0;class aB extends fs{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new en(16777215),this.specular=new en(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new en(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Jf,this.normalScale=new Mt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Sv,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}aB.prototype.isMeshPhongMaterial=!0;class h0e extends fs{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new en(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new en(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Jf,this.normalScale=new Mt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}h0e.prototype.isMeshToonMaterial=!0;class d0e extends fs{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Jf,this.normalScale=new Mt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}d0e.prototype.isMeshNormalMaterial=!0;class f0e extends fs{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new en(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new en(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Sv,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}f0e.prototype.isMeshLambertMaterial=!0;class p0e extends fs{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new en(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Jf,this.normalScale=new Mt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this}}
7925p0e.prototype.isMeshMatcapMaterial=!0;class A0e extends nm{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}A0e.prototype.isLineDashedMaterial=!0;const Li={arraySlice:function(i,e,t){return Li.isTypedArray(i)?new i.constructor(i.subarray(e,t!==void 0?t:i.length)):i.slice(e,t)},convertArray:function(i,e,t){return!i||!t&&i.constructor===e?i:typeof e.BYTES_PER_ELEMENT=="number"?new e(i):Array.prototype.slice.call(i)},isTypedArray:function(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)},getKeyframeOrder:function(i){function e(r,s){return i[r]-i[s]}const t=i.length,n=new Array(t);for(let r=0;r!==t;++r)n[r]=r;return n.sort(e),n},sortedArray:function(i,e,t){const n=i.length,r=new i.constructor(n);for(let s=0,o=0;o!==n;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=i[a+l]}return r},flattenJSON:function(i,e,t,n){let r=1,s=i[0];for(;s!==void 0&&s[n]===void 0;)s=i[r++];if(s===void 0)return;let o=s[n];if(o!==void 0)if(Array.isArray(o))do o=s[n],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=i[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[n],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=i[r++];while(s!==void 0);else do o=s[n],o!==void 0&&(e.push(s.time),t.push(o)),s=i[r++];while(s!==void 0)},subclip:function(i,e,t,n,r=30){const s=i.clone();s.name=e;const o=[];for(let l=0;l<s.tracks.length;++l){const c=s.tracks[l],u=c.getValueSize(),p=[],m=[];for(let g=0;g<c.times.length;++g){const v=c.times[g]*r;if(!(v<t||v>=n)){p.push(c.times[g]);for(let b=0;b<u;++b)m.push(c.values[g*u+b])}}p.length!==0&&(c.times=Li.convertArray(p,c.times.constructor),c.values=Li.convertArray(m,c.values.constructor),o.push(c))}s.tracks=o;let a=1/0;for(let l=0;l<s.tracks.length;++l)a>s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l<s.tracks.length;++l)s.tracks[l].shift(-1*a);return s.resetDuration(),s},makeClipAdditive:function(i,e=0,t=i,n=30){n<=0&&(n=30);const r=t.tracks.length,s=e/n;for(let o=0;o<r;++o){const a=t.tracks[o],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;const c=i.tracks.find(function(x){return x.name===a.name&&x.ValueTypeName===l});if(c===void 0)continue;let u=0;const p=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(u=p/3);let m=0;const g=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(m=g/3);const v=a.times.length-1;let b;if(s<=a.times[0]){const x=u,w=p-u;b=Li.arraySlice(a.values,x,w)}else if(s>=a.times[v]){const x=v*p+u,w=x+p-u;b=Li.arraySlice(a.values,x,w)}else{const x=a.createInterpolant(),w=u,R=p-u;x.evaluate(s),b=Li.arraySlice(x.resultBuffer,w,R)}l==="quaternion"&&new js().fromArray(b).normalize().conjugate().toArray(b);const M=c.times.length;for(let x=0;x<M;++x){const w=x*g+m;if(l==="quaternion")js.multiplyQuaternionsFlat(c.values,w,b,0,c.values,w);else{const R=g-m*2;for(let C=0;C<R;++C)c.values[w+C]-=b[C]}}}return i.blendMode=b7,i}};class Xc{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,r=t[n],s=t[n-1];e:{t:{let o;n:{i:if(!(e<r)){for(let a=n+2;;){if(r===void 0){if(e<s)break i;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,s)}if(n===a)break;if(s=r,r=t[++n],e<r)break t}o=t.length;break n}if(!(e>=s)){const a=t[1];e<a&&(n=2,s=a);for(let l=n-2;;){if(s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===l)break;if(r=s,s=t[--n-1],e>=s)break t}o=n,n=0;break n}break e}for(;n<o;){const a=n+o>>>1;e<t[a]?o=a:n=a+1}if(r=t[n],s=t[n-1],s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(r===void 0)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,s,e)}this._cachedIndex=n,this.intervalChanged_(n,s,r)}return this.interpolate_(n,s,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,s=e*r;for(let o=0;o!==r;++o)t[o]=n[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}Xc.prototype.beforeStart_=Xc.prototype.copySampleValue_;Xc.prototype.afterEnd_=Xc.prototype.copySampleValue_;class m0e extends Xc{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:zd,endingEnd:zd}}intervalChanged_(e,t,n){const r=this.parameterPositions;
vendor: 9,522 bytes, line 7925
7925let s=e-2,o=e+1,a=r[s],l=r[o];if(a===void 0)switch(this.getSettings_().endingStart){case Vd:s=e,a=2*t-n;break;case y1:s=r.length-2,a=t+r[s]-r[s+1];break;default:s=e,a=n}if(l===void 0)switch(this.getSettings_().endingEnd){case Vd:o=e,l=2*n-t;break;case y1:o=1,l=n+r[1]-r[0];break;default:o=e-1,l=t}const c=(n-t)*.5,u=this.valueSize;this._weightPrev=c/(t-a),this._weightNext=c/(l-n),this._offsetPrev=s*u,this._offsetNext=o*u}interpolate_(e,t,n,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,c=l-a,u=this._offsetPrev,p=this._offsetNext,m=this._weightPrev,g=this._weightNext,v=(n-t)/(r-t),b=v*v,M=b*v,x=-m*M+2*m*b-m*v,w=(1+m)*M+(-1.5-2*m)*b+(-.5+m)*v+1,R=(-1-g)*M+(1.5+g)*b+.5*v,C=g*M-g*b;for(let N=0;N!==a;++N)s[N]=x*o[u+N]+w*o[c+N]+R*o[l+N]+C*o[p+N];return s}}class lB extends Xc{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,c=l-a,u=(n-t)/(r-t),p=1-u;for(let m=0;m!==a;++m)s[m]=o[c+m]*p+o[l+m]*u;return s}}class g0e extends Xc{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class ll{constructor(e,t,n,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Li.convertArray(t,this.TimeBufferType),this.values=Li.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Li.convertArray(e.times,Array),values:Li.convertArray(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(n.interpolation=r)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new g0e(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new lB(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new m0e(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case _1:t=this.InterpolantFactoryMethodDiscrete;break;case v1:t=this.InterpolantFactoryMethodLinear;break;case $x:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return _1;case this.InterpolantFactoryMethodLinear:return v1;case this.InterpolantFactoryMethodSmooth:return $x}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){const n=this.times,r=n.length;let s=0,o=r-1;for(;s!==r&&n[s]<e;)++s;for(;o!==-1&&n[o]>t;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=Li.arraySlice(n,s,o),this.values=Li.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,r=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&Li.isTypedArray(r))for(let a=0,l=r.length;a!==l;++a){const c=r[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=Li.arraySlice(this.times),t=Li.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===$x,s=e.length-1;let o=1;for(let a=1;a<s;++a){let l=!1;const c=e[a],u=e[a+1];if(c!==u&&(a!==1||c!==e[0]))if(r)l=!0;else{const p=a*n,m=p-n,g=p+n;for(let v=0;v!==n;++v){const b=t[p+v];if(b!==t[m+v]||b!==t[g+v]){l=!0;break}}}if(l){if(a!==o){e[o]=e[a];const p=a*n,m=o*n;for(let g=0;g!==n;++g)t[m+g]=t[p+g]}++o}}if(s>0){e[o]=e[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Li.arraySlice(e,0,o),this.values=Li.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){const e=Li.arraySlice(this.times,0),t=Li.arraySlice(this.values,0),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}ll.prototype.TimeBufferType=Float32Array;ll.prototype.ValueBufferType=Float32Array;ll.prototype.DefaultInterpolation=v1;class op extends ll{}op.prototype.ValueTypeName="bool";op.prototype.ValueBufferType=Array;op.prototype.DefaultInterpolation=_1;op.prototype.InterpolantFactoryMethodLinear=void 0;op.prototype.InterpolantFactoryMethodSmooth=void 0;class cB extends ll{}cB.prototype.ValueTypeName="color";class b1 extends ll{}b1.prototype.ValueTypeName="number";class _0e extends Xc{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(r-t);let c=e*a;for(let u=c+a;c!==u;c+=4)js.slerpFlat(s,0,o,c-a,o,c,l);return s}}class rm extends ll{InterpolantFactoryMethodLinear(e){return new _0e(this.times,this.values,this.getValueSize(),e)}}rm.prototype.ValueTypeName="quaternion";rm.prototype.DefaultInterpolation=v1;rm.prototype.InterpolantFactoryMethodSmooth=void 0;class ap extends ll{}ap.prototype.ValueTypeName="string";ap.prototype.ValueBufferType=Array;ap.prototype.DefaultInterpolation=_1;ap.prototype.InterpolantFactoryMethodLinear=void 0;ap.prototype.InterpolantFactoryMethodSmooth=void 0;class S1 extends ll{}S1.prototype.ValueTypeName="vector";class SP{constructor(e,t=-1,n,r=kw){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=ja(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(y0e(n[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(ll.toJSON(n[s]));return r}static CreateFromMorphTargetSequence(e,t,n,r){const s=t.length,o=[];for(let a=0;a<s;a++){let l=[],c=[];l.push((a+s-1)%s,a,(a+1)%s),c.push(0,1,0);const u=Li.getKeyframeOrder(l);l=Li.sortedArray(l,1,u),c=Li.sortedArray(c,1,u),!r&&l[0]===0&&(l.push(s),c.push(c[0])),o.push(new b1(".morphTargetInfluences["+t[a].name+"]",l,c).scale(1/n))}return new this(e,-1,o)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const r=e;n=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<n.length;r++)if(n[r].name===t)return n[r];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const r={},s=/^([\w-]*?)([\d]+)$/;for(let a=0,l=e.length;a<l;a++){const c=e[a],u=c.name.match(s);if(u&&u.length>1){const p=u[1];let m=r[p];m||(r[p]=m=[]),m.push(c)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(p,m,g,v,b){if(g.length!==0){const M=[],x=[];Li.flattenJSON(g,M,x,v),M.length!==0&&b.push(new p(m,M,x))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let p=0;p<c.length;p++){const m=c[p].keys;if(!(!m||m.length===0))if(m[0].morphTargets){const g={};let v;for(v=0;v<m.length;v++)if(m[v].morphTargets)for(let b=0;b<m[v].morphTargets.length;b++)g[m[v].morphTargets[b]]=-1;for(const b in g){const M=[],x=[];for(let w=0;w!==m[v].morphTargets.length;++w){const R=m[v];M.push(R.time),x.push(R.morphTarget===b?1:0)}r.push(new b1(".morphTargetInfluence["+b+"]",M,x))}l=g.length*o}else{const g=".bones["+t[p].name+"]";n(S1,g+".position",m,"pos",r),n(rm,g+".quaternion",m,"rot",r),n(S1,g+".scale",m,"scl",r)}}return r.length===0?null:new this(s,l,r,a)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,r=e.length;n!==r;++n){const s=this.tracks[n];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function v0e(i){switch(i.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return b1;case"vector":case"vector2":case"vector3":case"vector4":return S1;case"color":return cB;case"quaternion":return rm;case"bool":case"boolean":return op;case"string":return ap}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+i)}function y0e(i){if(i.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=v0e(i.type);if(i.times===void 0){const t=[],n=[];
7925Li.flattenJSON(i.keys,t,n,"value"),i.times=t,i.values=n}return e.parse!==void 0?e.parse(i):new e(i.name,i.times,i.values,i.interpolation)}const kf={enabled:!1,files:{},add:function(i,e){this.enabled!==!1&&(this.files[i]=e)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class x0e{constructor(e,t,n){const r=this;let s=!1,o=0,a=0,l;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(u){a++,s===!1&&r.onStart!==void 0&&r.onStart(u,o,a),s=!0},this.itemEnd=function(u){o++,r.onProgress!==void 0&&r.onProgress(u,o,a),o===a&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(u){r.onError!==void 0&&r.onError(u)},this.resolveURL=function(u){return l?l(u):u},this.setURLModifier=function(u){return l=u,this},this.addHandler=function(u,p){return c.push(u,p),this},this.removeHandler=function(u){const p=c.indexOf(u);return p!==-1&&c.splice(p,2),this},this.getHandler=function(u){for(let p=0,m=c.length;p<m;p+=2){const g=c[p],v=c[p+1];if(g.global&&(g.lastIndex=0),g.test(u))return v}return null}}}const b0e=new x0e;class tu{constructor(e){this.manager=e!==void 0?e:b0e,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(r,s){n.load(e,r,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const xl={};class S0e extends tu{constructor(e){super(e)}load(e,t,n,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=kf.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(xl[e]!==void 0){xl[e].push({onLoad:t,onProgress:n,onError:r});return}xl[e]=[],xl[e].push({onLoad:t,onProgress:n,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"});fetch(o).then(a=>{if(a.status===200||a.status===0){a.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received.");const l=xl[e],c=a.body.getReader(),u=a.headers.get("Content-Length"),p=u?parseInt(u):0,m=p!==0;let g=0;return new ReadableStream({start(v){b();function b(){c.read().then(({done:M,value:x})=>{if(M)v.close();else{g+=x.byteLength;const w=new ProgressEvent("progress",{lengthComputable:m,loaded:g,total:p});for(let R=0,C=l.length;R<C;R++){const N=l[R];N.onProgress&&N.onProgress(w)}v.enqueue(x),b()}})}}})}else throw Error(`fetch for "${a.url}" responded with ${a.status}: ${a.statusText}`)}).then(a=>
7925{const l=new Response(a);switch(this.responseType){case"arraybuffer":return l.arrayBuffer();case"blob":return l.blob();case"document":return l.text().then(c=>new DOMParser().parseFromString(c,this.mimeType));case"json":return l.json();default:return l.text()}}).then(a=>{kf.add(e,a);const l=xl[e];delete xl[e];for(let c=0,u=l.length;c<u;c++){const p=l[c];p.onLoad&&p.onLoad(a)}this.manager.itemEnd(e)}).catch(a=>{const l=xl[e];delete xl[e];for(let c=0,u=l.length;c<u;c++){const p=l[c];p.onError&&p.onError(a)}this.manager.itemError(e),this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class uB extends tu{constructor(e){super(e)}load(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=kf.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a=Ev("img");function l(){u(),kf.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(p){u(),r&&r(p),s.manager.itemError(e),s.manager.itemEnd(e)}function u(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(e),a.src=e,a}}class M0e extends tu{constructor(e){super(e)}load(e,t,n,r){const s=new Rv,o=new uB(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function l(c){o.load(e[c],function(u){s.images[c]=u,a++,a===6&&(s.needsUpdate=!0,t&&t(s))},void 0,r)}for(let c=0;c<e.length;++c)l(c);return s}}class w0e extends tu{constructor(e){super(e)}load(e,t,n,r){const s=new jr,o=new uB(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){s.image=a,s.needsUpdate=!0,t!==void 0&&t(s)},n,r),s}}class nl extends li{constructor(e,t=1){super(),this.type="Light",this.color=new en(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}nl.prototype.isLight=!0;class T0e extends nl{constructor(e,t,n){super(e,n),this.type="HemisphereLight",this.position.copy(li.DefaultUp),this.updateMatrix(),this.groundColor=new en(t)}copy(e){return nl.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}T0e.prototype.isHemisphereLight=!0;const MP=new ln,wP=new _e,TP=new _e;class rT{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Mt(512,512),this.map=null,this.mapPass=null,this.matrix=new ln,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Cv,this._frameExtents=new Mt(1,1),this._viewportCount=1,this._viewports=[new _i(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;wP.setFromMatrixPosition(e.matrixWorld),t.position.copy(wP),TP.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(TP),t.updateMatrixWorld(),MP.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(MP),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radiu
vendor: 4,455 bytes, line 7925
7925s=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class hB extends rT{constructor(){super(new Us(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,n=oS*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(n!==t.fov||r!==t.aspect||s!==t.far)&&(t.fov=n,t.aspect=r,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}hB.prototype.isSpotLightShadow=!0;class E0e extends nl{constructor(e,t,n=0,r=Math.PI/3,s=0,o=1){super(e,t),this.type="SpotLight",this.position.copy(li.DefaultUp),this.updateMatrix(),this.target=new li,this.distance=n,this.angle=r,this.penumbra=s,this.decay=o,this.shadow=new hB}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}E0e.prototype.isSpotLight=!0;const EP=new ln,tA=new _e,R2=new _e;class dB extends rT{constructor(){super(new Us(90,1,.5,500)),this._frameExtents=new Mt(4,2),this._viewportCount=6,this._viewports=[new _i(2,1,1,1),new _i(0,1,1,1),new _i(3,1,1,1),new _i(1,1,1,1),new _i(3,0,1,1),new _i(1,0,1,1)],this._cubeDirections=[new _e(1,0,0),new _e(-1,0,0),new _e(0,0,1),new _e(0,0,-1),new _e(0,1,0),new _e(0,-1,0)],this._cubeUps=[new _e(0,1,0),new _e(0,1,0),new _e(0,1,0),new _e(0,1,0),new _e(0,0,1),new _e(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,r=this.matrix,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),tA.setFromMatrixPosition(e.matrixWorld),n.position.copy(tA),R2.copy(n.position),R2.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(R2),n.updateMatrixWorld(),r.makeTranslation(-tA.x,-tA.y,-tA.z),EP.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(EP)}}dB.prototype.isPointLightShadow=!0;class R0e extends nl{constructor(e,t,n=0,r=1){super(e,t),this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new dB}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}R0e.prototype.isPointLight=!0;class fB extends rT{constructor(){super(new jw(-5,5,5,-5,.5,500))}}fB.prototype.isDirectionalLightShadow=!0;class C0e extends nl{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(li.DefaultUp),this.updateMatrix(),this.target=new li,this.shadow=new fB}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}C0e.prototype.isDirectionalLight=!0;class P0e extends nl{constructor(e,t){super(e,t),this.type="AmbientLight"}}P0e.prototype.isAmbientLight=!0;class L0e extends nl{constructor(e,t,n=10,r=10){super(e,t),this.type="RectAreaLight",this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}L0e.prototype.isRectAreaLight=!0;class pB{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new _e)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*n),t.addScaledVector(o[4],1.092548*(n*r)),t.addScaledVector(o[5],1.092548*(r*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(n*s)),t.addScaledVector(o[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){const n=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*r),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*n),t.addScaledVector(o[4],2*.429043*n*r),t.addScaledVector(o[5],2*.429043*r*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7
7925],2*.429043*n*s),t.addScaledVector(o[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const n=e.x,r=e.y,s=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*s,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*n*s,t[8]=.546274*(n*n-r*r)}}pB.prototype.isSphericalHarmonics3=!0;class sT extends nl{constructor(e=new pB,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}sT.prototype.isLightProbe=!0;class N0e{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.substr(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class D0e extends Fi{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}D0e.prototype.isInstancedBufferGeometry=!0;class I0e extends tu{constructor(e){super(e),typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=kf.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(l){kf.add(e,l),t&&t(l),s.manager.itemEnd(e)}).catch(function(l){r&&r(l),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}I0e.prototype.isImageBitmapLoader=!0;let i_;const B0e={getContext:function(){return i_===void 0&&(i_=new(window.AudioContext||window.webkitAudioContext)),i_},setContext:function(i){i_=i}};class F0e extends tu{constructor(e){super(e)}load(e,t,n,r){const s=this,o=new S0e(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{const l=a.slice(0);B0e.getContext().decodeAudioData(l,function(u){t(u)})}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},n,r)}}class U0e extends sT{constructor(e,t,n=1){super(void 0,n);const r=new en().set(e),s=new en().set(t),o=new _e(r.r,r.g,r.b),a=new _e(s.r,s.g,s.b),l=Math.sqrt(Math.PI),c=l*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(c)}}U0e.prototype.isHemisphereLightProbe=!0;class O0e extends sT{constructor(e,t=1){super(void 0,t);const n=new en().set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}}O0e.prototype.isAmbientLightProbe=!0;class k0e extends li{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl
vendor: 28,053 bytes, line 7925
7925=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}class z0e{constructor(e,t,n){this.binding=e,this.valueSize=n;let r,s,o;switch(t){case"quaternion":r=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case"string":case"bool":r=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(n*5);break;default:r=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=s,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,r=this.valueSize,s=e*r+r;let o=this.cumulativeWeight;if(o===0){for(let a=0;a!==r;++a)n[s+a]=n[a];o=t}else{o+=t;const a=t/o;this._mixBufferRegion(n,s,0,a,r)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,r=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,r=e*t+t,s=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const l=t*this._origIndex;this._mixBufferRegion(n,r,l,1-s,t)}o>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let s=n,o=r;s!==o;++s)t[s]=t[r+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,r,s){if(r>=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,r){js.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,s){const o=this._workIndex*s;js.multiplyQuaternionsFlat(e,o,e,t,e,n),js.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,n,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[n+a]*r}}_lerpAdditive(e,t,n,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[n+o]*r}}}const oT="\\[\\]\\.:\\/",V0e=new RegExp("["+oT+"]","g"),aT="[^"+oT+"]",G0e="[^"+oT.replace("\\.","")+"]",q0e=/((?:WC+[\/:])*)/.source.replace("WC",aT),H0e=/(WCOD+)?/.source.replace("WCOD",G0e),W0e=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",aT),$0e=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",aT),j0e=new RegExp("^"+q0e+H0e+W0e+$0e+"$"),X0e=["material","materials","bones"];class Y0e{constructor(e,t,n){const r=n||si.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=n.length;r!==s;++r)n[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class si{constructor(e,t,n){this.path=t,this.parsedPath=n||si.parseTrackName(t),this.node=si.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new si.Composite(e,t,n):new si(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(V0e,"")}static parseTrackName(e){const t=j0e.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=n.nodeName.substring(r+1);X0e.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(s){for(let o=0;o<s.length;o++){const a=s[o];if(a.name===t||a.uuid===t)return a;const l=n(a.children);if(l)return l}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,r=t.propertyName;let s=t.propertyIndex;if(e||(e=si.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");return}if(n){let c=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let u=0;u<e.length;u++)if(e[u].name===c){c=u;break}break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(c!==void 0){if(e[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[c]}}const o=e[r];if(o===void 0){const c=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+r+" but it wasn't found.",e);return}let a=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}else{console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);return}}l=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}si.Composite=Y0e;si.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};si.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};si.prototype.GetterByBindingType=[si.prototype._getValue_direct,si.prototype._getValue_array,si.prototype._getValue_arrayElement,si.prototype._getValue_toArray];si.prototype.SetterByBindingTypeAndVersioning=[[si.prototype._setValue_direct,si.prototype._setValue_direct_setNeedsUpdate,si.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[si.prototype._setValue_array,si.prototype._setValue_array_setNeedsUpdate,si.prototype._setValue_array_setMatrixWorldNeedsUpdate],[si.prototype._setValue_arrayElement,si.prototype._setValue_arrayElement_setNeedsUpdate,si.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[si.prototype._setValue_fromArray,si.prototype._setValue_fromArray_setNeedsUpdate,si.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Q0e{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:zd,endingEnd:zd};for(let c=0;c!==o;++c){const u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Due,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case b7:for(let u=0,p=l.length;u!==p;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case kw:default:for(let u=0,p=l.length;u!==p;++u)l[u].evaluate(o),c[u].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let r=this.time+e,s=this._loopCount;const o=n===Iue;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(n===Nue){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=Vd,r.endingEnd=Vd):(e?r.endingStart=this.zeroSlopeAtStart?Vd:zd:r.endingStart=y1,t?r.endingEnd=this.zeroSlopeAtEnd?Vd:zd:r.endingEnd=y1)}_scheduleFading(e,t,n){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}}class Z0e extends vh{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let p=0;p!==s;++p){const m=r[p],g=m.name;let v=u[g];if(v!==void 0)o[p]=v;else{if(v=o[p],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,l,g));continue}const b=t&&t._propertyBindings[p].binding.parsedPath;v=new z0e(si.create(n,g,b),m.ValueTypeName,m.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,l,g),o[p]=v}a[p].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,n)}const t=e._propertyBindings;for(let n=0,r=t.length;n!==r;++n){const s=t[n];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,r=t.length;n!==r;++n){const s=t[n];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,n){const r=this._actions,s=this._actionsByClip;let o=s[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=o;else{const a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=r.length,r.push(e),o.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;const s=e._clip.uuid,o=this._actionsByClip,a=o[s],l=a.knownActions,c=l[l.length-1],u=e._byClipCacheIndex;c._byClipCacheIndex=u,l[u]=c,l.pop(),e._byClipCacheIndex=null;const p=a.actionByRoot,m=(e._localRoot||this._root).uuid;delete p[m],l.length===0&&delete o[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,r=t.length;n!==r;++n){const s=t[n];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=n,t[n]=s}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=n,t[n]=s}_addInactiveBinding(e,t,n){const r=this._bindingsByRootAndName,s=this._bindings;let o=r[t];o===void 0&&(o={},r[t]=o),o[n]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,r=n.rootNode.uuid,s=n.path,o=this._bindingsByRootAndName,a=o[r],l=t[t.length-1],c=e._cacheIndex;l._cacheIndex=c,t[c]=l,t.pop(),delete a[s],Object.keys(a).length===0&&delete o[r]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=n,t[n]=s}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=n,t[n]=s}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return n===void 0&&(n=new lB(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,s=t[r];e.__cacheIndex=r,t[r]=e,s.__cacheIndex=n,t[n]=s}clipAction(e,t,n){const r=t||this._root,s=r.uuid;let o=typeof e=="string"?SP.findByName(r,e):e;const a=o!==null?o.uuid:e,l=this._actionsByClip[a];let c=null;if(n===void 0&&(o!==null?n=o.blendMode:n=kw),l!==void 0){const p=l.actionByRoot[s];if(p!==void 0&&p.blendMode===n)return p;c=l.knownActions[0],o===null&&(o=c._clip)}if(o===null)return null;const u=new Q0e(this,o,t,n);return this._bindAction(u,c),this._addInactiveAction(u,a,s),u}existingAction(e,t){const n=t||this._root,r=n.uuid,s=typeof e=="string"?SP.findByName(n,e):e,o=s?s.uuid:e,a=this._actionsByClip[o];return a!==void 0&&a.actionByRoot[r]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let n=t-1;n>=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,r=this._actionsByClip,s=r[n];if(s!==void 0){const o=s.knownActions;for(let a=0,l=o.length;a!==l;++a){const c=o[a];this._deactivateAction(c);const u=c._cacheIndex,p=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,p._cacheIndex=u,t[u]=p,t.pop(),this._removeInactiveBindingsForAction(c)}delete r[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const o in n){const a=n[o].actionByRoot,l=a[t];l!==void 0&&(this._deactivateAction(l),this._removeInactiveAction(l))}const r=this._bindingsByRootAndName,s=r[t];if(s!==void 0)for(const o in s){const a=s[o];a.restoreOriginalState(),this._removeInactiveBinding(a)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}Z0e.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class K0e extends tm{constructor(e,t,n=1){super(e,t),this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}K0e.prototype.isInstancedInterleavedBuffer=!0;const yc=new _e,r_=new ln,C2=new ln;class J0e extends Kw{constructor(e){const t=AB(e),n=new Fi,r=[],s=[],o=new en(0,0,1),a=new en(0,1,0);for(let c=0;c<t.length;c++){const u=t[c];u.parent&&u.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),s.push(o.r,o.g,o.b),s.push(a.r,a.g,a.b))}n.setAttribute("position",new Or(r,3)),n.setAttribute("color",new Or(s,3));const l=new nm({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(n,l),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,r=n.getAttribute("position");C2.copy(this.root.matrixWorld).invert();for(let s=0,o=0;s<t.length;s++){const a=t[s];a.parent&&a.parent.isBone&&(r_.multiplyMatrices(C2,a.matrixWorld),yc.setFromMatrixPosition(r_),r.setXYZ(o,yc.x,yc.y,yc.z),r_.multiplyMatrices(C2,a.parent.matrixWorld),yc.setFromMatrixPosition(r_),r.setXYZ(o+1,yc.x,yc.y,yc.z),o+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}function AB(i){const e=[];i&&i.isBone&&e.push(i);for(let t=0;t<i.children.length;t++)e.push.apply(e,AB(i.children[t]));return e}class eme extends Kw{constructor(e=10,t=10,n=4473924,r=8947848){n=new en(n),r=new en(r);const s=t/2,o=e/t,a=e/2,l=[],c=[];for(let m=0,g=0,v=-a;m<=t;m++,v+=o){l.push(-a,0,v,a,0,v),l.push(v,0,-a,v,0,a);const b=m===s?n:r;b.toArray(c,g),g+=3,b.toArray(c,g),g+=3,b.toArray(c,g),g+=3,b.toArray(c,g),g+=3}const u=new Fi;u.setAttribute("position",new Or(l,3)),u.setAttribute("color",new Or(c,3));const p=new nm({vertexColors:!0,toneMapped:!1});super(u,p),this.type="GridHelper"}}const tme=new Float32Array(1);new Int32Array(tme.buffer);$o.create=function(i,e){return console.log("THREE.Curve.create() has been deprecated"),i.prototype=Object.create($o.prototype),i.prototype.constructor=i,i.prototype.getPoint=e,i};hS.prototype.fromPoints=function(i){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(i)};eme.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")};J0e.prototype.update=function(){console.error("THREE.SkeletonHelper: update(
7925) no longer needs to be called.")};tu.prototype.extractUrlBase=function(i){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),N0e.extractUrlBase(i)};tu.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}};ba.prototype.center=function(i){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(i)};ba.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()};ba.prototype.isIntersectionBox=function(i){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)};ba.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)};ba.prototype.size=function(i){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(i)};tp.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()};Cv.prototype.setFromMatrix=function(i){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(i)};$r.prototype.flattenToArrayOffset=function(i,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,e)};$r.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix3: .multiplyVector3(
7925) has been removed. Use vector.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)};$r.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")};$r.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)};$r.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")};$r.prototype.getInverse=function(i){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()};ln.prototype.extractPosition=function(i){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(i)};ln.prototype.flattenToArrayOffset=function(i,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,e)};ln.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new _e().setFromMatrixColumn(this,3)};ln.prototype.setRotationFromQuaternion=function(i){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(i)};ln.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")};ln.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix4: .multiplyVector3(
7925) has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)};ln.prototype.multiplyVector4=function(i){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)};ln.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")};ln.prototype.rotateAxis=function(i){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),i.transformDirection(this)};ln.prototype.crossVector=function(i){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)};ln.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")};ln.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")};ln.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")};ln.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")};ln.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")};ln.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)};ln.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")};ln.prototype.makeFrustum=function(i,e,t,n,r,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(i,e,n,t,r,s)};ln.prototype.getInverse=function(i){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()};Tl.prototype.isIntersectionLine=function(i){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(i)};js.prototype.multiplyVector3=function(i){return console.warn("THREE.Quaternion: .multiplyVector3(
7925) has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),i.applyQuaternion(this)};js.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()};np.prototype.isIntersectionBox=function(i){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)};np.prototype.isIntersectionPlane=function(i){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(i)};np.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)};yr.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()};yr.prototype.barycoordFromPoint=function(i,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(i,e)};yr.prototype.midpoint=function(i){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(i)};yr.prototypenormal=function(i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(i)};yr.prototype.plane=function(i){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(i)};yr.barycoordFromPoint=function(i,e,t,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),yr.getBarycoord(i,e,t,n,r)};yr.normal=function(i,e,t,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),yr.getNormal(i,e,t,n)};im.prototype.extractAllPoints=function(i){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(i)};im.prototype.extrude=function(i){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new sp(this,i)};im.prototype.makeGeometry=function(i){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new iT(this,i)};Mt.prototype.fromAttribute=function(i,e,t){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,e,t)};Mt.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)};Mt.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};_e.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")};_e.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")};_e.prototype.getPositionFromMatrix=function(i){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(i)};_e.prototype.getScaleFromMatrix=function(i){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(i)};_e.prototype.getColumnFromMatrix=function(i,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,i)};_e.prototype.applyProjection=function(i){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(i)};_e.prototype.fromAttribute=function(i,e,t){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,e,t)};_e.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)};_e.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};_i.prototype.fromAttribute=function(i,e,t){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,e,t)};_i.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};li.prototype.getChildByName=function(i){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(i)};li.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")};li.prototype.translate=function(i,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,i)};li.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")};
7925li.prototype.applyMatrix=function(i){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)};Object.defineProperties(li.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(i){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=i}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}});Gs.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")};Object.defineProperties(Gs.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),Bue},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}});Q7.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")};Us.prototype.setLens=function(i,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),e!==void 0&&(this.filmGauge=e),this.setFocalLength(i)};Object.defineProperties(nl.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(i){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=i}},shadowCameraLeft:{set:function(i){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=i}},shadowCameraRight:{set:function(i){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=i}},shadowCameraTop:{set:function(i){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=i}},shadowCameraBottom:{set:function(i){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=i}},shadowCameraNear:{set:function(i){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=i}},shadowCameraFar:{set:function(i){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=i}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(i){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=i}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(i){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=i}},shadowMapHeight:{set:function(i){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=i}}});Object.defineProperties(br.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===x1},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(x1)}}});br.prototype.setDynamic=function(i){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?x1:x0),this};br.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},br.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};Fi.prototype.addIndex=function(i){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(i)};Fi.prototype.addAttribute=function(i,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),!(e&&e.isBufferAttribute)&&!(e&&e.isInterleavedBufferAttribute)?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(i,new br(arguments[1],arguments[2]))):i==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(i,e)};Fi.prototype.addDrawCall=function(i,e,t){t!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(i,e)};Fi.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()};Fi.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")};Fi.prototype.removeAttribute=function(i){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(i)};
7925Fi.prototype.applyMatrix=function(i){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)};Object.defineProperties(Fi.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}});tm.prototype.setDynamic=function(i){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?x1:x0),this};tm.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};sp.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")};sp.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")};sp.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")};j7.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")};Object.defineProperties(fs.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")}
7925,set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new en}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(i){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===_7}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(i){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=i}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}});Object.defineProperties(uh.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(i){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=i}}});fi.prototype.clearTarget=function(i,e,t,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(i),this.clear(e,t,n)};fi.prototype.animate=function(i){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(i)};fi.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()};fi.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()};fi.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision};fi.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()};fi.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")};fi.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")};fi.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")};fi.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")};fi.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")};fi.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")};fi.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures};fi.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_
7925instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")};fi.prototype.enableScissorTest=function(i){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(i)};fi.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};fi.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};fi.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};fi.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};fi.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")};fi.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")};fi.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")};fi.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")};fi.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")};fi.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()};Object.defineProperties(fi.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=i}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=i}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(i){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=i===!0?Tv:Js}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}});Object.defineProperties(W7.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}});Object.defineProperties(Go.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=i}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=i}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=i}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=i}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy 
7925is now .texture.anisotropy."),this.texture.anisotropy},set:function(i){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=i}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(i){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=i}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(i){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=i}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(i){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=i}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(i){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=i}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(i){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=i}}});k0e.prototype.load=function(i){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return new F0e().load(i,function(n){e.setBuffer(n)}),this};Ww.prototype.updateCubeMap=function(i,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update(
7925)."),this.update(i,e)};Ww.prototype.clear=function(i,e,t,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(i,e,t,n)};ep.crossOrigin=void 0;ep.loadTexture=function(i,e,t,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const r=new w0e;r.setCrossOrigin(this.crossOrigin);const s=r.load(i,t,void 0,n);return e&&(s.mapping=e),s};ep.loadTextureCube=function(i,e,t,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const r=new M0e;r.setCrossOrigin(this.crossOrigin);const s=r.load(i,t,void 0,n);return e&&(s.mapping=e),s};ep.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")};ep.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Uw}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Uw);const o_e={__name:"DashboardRealtimeGlobe",props:{minutes:{type:Number,default:60}},setup(i){const e=i,t=YT("time"),n=YT("filters"),r=Eh({}),s=Eh([]),o=Eh({}),a=Eh({}),l=YF("globeEl"),{width:c}=QF(l),u=QT(()=>({width:c.value,height:c.value>768?c.value*.6:c.value})),p=Eh(),m=Eh(.001),g=QT(()=>s.value.reduce((I,F)=>Math.max(I,F.count),0)||1);let v=null;async function b(){const I=await $fetch("/countries.geojson");r.value=I}async function M(){const I=await $fetch("/colos.json");o.value=I}async function x(){const I=await ZT("/api/location");a.value=I}async function w(){const{data:I}=await ZT("/api/logs/locations",{query:{startAt:t.value.startAt,endAt:t.value.endAt,...n.value}});s.value=I==null?void 0:I.map(F=>({lat:F.latitude,lng:F.longitude,count:Math.max(1,+F.count/g.value)}))}let R=null;function C({props:I},{delay:F=0}){var J,H;const k={startLat:I.item.latitude,startLng:I.item.longitude,endLat:(J=o.value[I.item.COLO])==null?void 0:J.lat,endLng:(H=o.value[I.item.COLO])==null?void 0:H.lon,color:"darkOrange",arcAltitude:.2};if(console.info(`from ${I.item.city}(${k.startLat}, ${k.startLng}) to ${I.item.COLO}(${k.endLat}, ${k.endLng})`),Math.abs(k.endLat-k.startLat)<5&&Math.abs(k.endLng-k.startLng)<5){console.info(`from ${I.item.city} to ${I.item.COLO} is near, skip`);return}const W=Math.random();v.arcsData([k]).arcColor("color").arcDashLength(()=>W).arcDashGap(()=>1-W).arcDashAnimateTime(F*2).ringRepeatPeriod(F*2);const Q={lat:k.startLat,lng:k.startLng};v.ringsData([...v.ringsData(),Q]),setTimeout(()=>v.ringsData(v.ringsData().filter($=>$!==Q)),F*2),setTimeout(()=>{const $={lat:k.endLat,lng:k.endLng};v.ringsData([...v.ringsData(),$]),setTimeout(()=>v.ringsData(v.ringsData().filter(K=>K!==$)),F*2)},F*2),clearTimeout(R),R=setTimeout(()=>{v.arcsData([])},F*2)}const N=5/e.minutes,D=uU(uO).domain([0,g.value*N*15]);function P(){v=new cce(p.value).width(u.value.width).height(u.value.height).atmosphereColor("rgba(170, 170, 200, 0.8)").globeMaterial(new aB({color:"rgb(228, 228, 231)",transparent:!1,opacity:1})).backgroundColor("rgba(0,0,0,0)").hexPolygonsData(r.value.features).hexPolygonResolution(3).hexPolygonMargin(.2).hexBinResolution(3).hexBinPointsData(s.value).hexPolygonAltitude(()=>m.value).hexBinMerge(!0).hexBinPointWeight("count").hexPolygonColor(()=>`rgba(54, 211, 153, ${Math.random()/1.5+.5})`).ringColor(()=>I=>`rgba(255,100,50,${1-I})`).ringMaxRadius(3).ringPropagationSpeed(3).onGlobeReady(()=>{v.pointOfView({lat:a.value.latitude,lng:a.value.longitude,altitude:c.value>768?2:3}),v.controls().autoRotate=!0,v.controls().autoRotateSpeed=.3}),v.controls().addEventListener("end",$L(()=>{const I=Math.round(v.controls().getDistance());let F=.005;I<=300?F=.001:I>=600&&(F=.02),F!==m.value&&(m.value=F)},200)),t3.on(C)}function O(){v&&(v.controls().autoRotate=!1)}return oy([t,n],w,{deep:!0}),oy(c,()=>{v&&(v.width(u.value.width),v.height(u.value.height))}),oy(s,()=>{v&&(v.hexBinPointsData(s.value),v.hexTopColor(I=>D(I.sumWeight)),v.hexSideColor(I=>D(I.sumWeight)))}),ZF(async()=>{await Promise.all([w(),x(),b(),M()]),P()}),KF(()=>{var I;t3.off(C),v&&((I=v._destructor)==null||I.call(v),v=null)}),(I,F)=>(eU(),JF("div",{ref_key:"globeEl",ref:p,onMousedown:O},null,544))}};export{o_e 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.