vendor: 43,444 bytes, line 1
1(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"02b00fabbe1395f3354278c4bba153e90d8fe508"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7a78a42d-91fa-4b99-8d68-43baac04eadf",e._sentryDebugIdIdentifier="sentry-dbid-7a78a42d-91fa-4b99-8d68-43baac04eadf")}catch{}})();var Cg=Object.create,_d=Object.defineProperty,Dg=Object.getOwnPropertyDescriptor,zg=Object.getOwnPropertyNames,Rg=Object.getPrototypeOf,kg=Object.prototype.hasOwnProperty,Mu=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),Lg=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=zg(t),s=0,o=a.length,n;s<o;s++)n=a[s],!kg.call(e,n)&&n!==i&&_d(e,n,{get:(l=>t[l]).bind(null,n),enumerable:!(r=Dg(t,n))||r.enumerable});return e},Fg=(e,t,i)=>(i=e==null?{}:Cg(Rg(e)),Lg(_d(i,"default",{value:e,enumerable:!0}),e));function E(e,t){this.x=e,this.y=t}E.prototype={clone(){return new E(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let t=e.x-this.x,i=e.y-this.y;return t*t+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){let t=e[0]*this.x+e[1]*this.y,i=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=i,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let t=Math.cos(e),i=Math.sin(e),r=t*this.x-i*this.y,a=i*this.x+t*this.y;return this.x=r,this.y=a,this},_rotateAround(e,t){let i=Math.cos(e),r=Math.sin(e),a=t.x+i*(this.x-t.x)-r*(this.y-t.y),s=t.y+r*(this.x-t.x)+i*(this.y-t.y);return this.x=a,this.y=s,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:E},E.convert=function(e){if(e instanceof E)return e;if(Array.isArray(e))return new E(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new E(+e.x,+e.y);throw Error("Expected [x, y] or {x, y} point format")};function Bg(e,t,i,r){let a=3*e,s=3*(i-e)-a,o=1-a-s,n=3*t,l=3*(r-t)-n,u=1-n-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let m=0;m<8;m++){let _=((o*p+s)*p+a)*p-h;if(Math.abs(_)<c)return((u*p+l)*p+n)*p;let g=(3*o*p+2*s)*p+a;if(Math.abs(g)<1e-6)break;p-=_/g}let d=0,f=1;p=h;for(let m=0;m<20;m++){let _=((o*p+s)*p+a)*p;if(Math.abs(_-h)<c)break;h>_?d=p:f=p,p=(d+f)*.5}return((u*p+l)*p+n)*p}}let jh;function gd(){return jh??=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function",jh}let ws;function Og(){if(ws==null&&(ws=!1,gd())){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let i=0;i<25;i++){let r=i*4;e.fillStyle=`rgb(${r},${r+1},${r+2})`,e.fillRect(i%5,Math.floor(i/5),1,1)}let t=e.getImageData(0,0,5,5).data;for(let i=0;i<100;i++)if(i%4!=3&&t[i]!==i){ws=!0;break}}}return ws||!1}var Ye=typeof Float32Array<"u"?Float32Array:Array;function yd(){var e=new Ye(9);return Ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function $g(e){var t=e[0],i=e[1],r=e[2],a=e[3],s=e[4],o=e[5],n=e[6],l=e[7],u=e[8];return t*(u*s-o*l)+i*(-u*a+o*n)+r*(l*a-s*n)}function Vg(e,t){var i=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=i,e[2]=0,e[3]=-i,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function jg(e,t){var i=t[0],r=t[1],a=t[2],s=t[3],o=i+i,n=r+r,l=a+a,u=i*o,h=r*o,c=r*n,p=a*o,d=a*n,f=a*l,m=s*o,_=s*n,g=s*l;return e[0]=1-c-f,e[3]=h-g,e[6]=p+_,e[1]=h+g,e[4]=1-u-f,e[7]=d-m,e[2]=p-_,e[5]=d+m,e[8]=1-u-c,e}function Wi(){var e=new Ye(16);return Ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function sl(e){var t=new Ye(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ng(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Xt(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function oo(e,t){var i=t[0],r=t[1],a=t[2],s=t[3],o=t[4],n=t[5],l=t[6],u=t[7],h=t[8],c=t[9],p=t[10],d=t[11],f=t[12],m=t[13],_=t[14],g=t[15],x=i*n-r*o,y=i*l-a*o,v=i*u-s*o,w=r*l-a*n,b=r*u-s*n,T=a*u-s*l,I=h*m-c*f,M=h*_-p*f,D=h*g-d*f,L=c*_-p*m,z=c*g-d*m,P=p*g-d*_,S=x*P-y*z+v*L+w*D-b*M+T*I;return S?(S=1/S,e[0]=(n*P-l*z+u*L)*S,e[1]=(a*z-r*P-s*L)*S,e[2]=(m*T-_*b+g*w)*S,e[3]=(p*b-c*T-d*w)*S,e[4]=(l*D-o*P-u*M)*S,e[5]=(i*P-a*D+s*M)*S,e[6]=(_*v-f*T-g*y)*S,e[7]=(h*T-p*v+d*y)*S,e[8]=(o*z-n*D+u*I)*S,e[9]=(r*D-i*z-s*I)*S,e[10]=(f*b-m*v+g*x)*S,e[11]=(c*v-h*b-d*x)*S,e[12]=(n*M-o*L-l*I)*S,e[13]=(i*L-r*M+a*I)*S,e[14]=(m*y-f*w-_*x)*S,e[15]=(h*w-c*y+p*x)*S,e):null}function Mr(e,t,i){var r=t[0],a=t[1],s=t[2],o=t[3],n=t[4],l=t[5],u=t[6],h=t[7],c=t[8],p=t[9],d=t[10],f=t[11],m=t[12],_=t[13],g=t[14],x=t[15],y=i[0],v=i[1],w=i[2],b=i[3];return e[0]=y*r+v*n+w*c+b*m,e[1]=y*a+v*l+w*p+b*_,e[2]=y*s+v*u+w*d+b*g,e[3]=y*o+v*h+w*f+b*x,y=i[4],v=i[5],w=i[6],b=i[7],e[4]=y*r+v*n+w*c+b*m,e[5]=y*a+v*l+w*p+b*_,e[6]=y*s+v*u+w*d+b*g,e[7]=y*o+v*h+w*f+b*x,y=i[8],v=i[9],w=i[10],b=i[11],e[8]=y*r+v*n+w*c+b*m,e[9]=y*a+v*l+w*p+b*_,e[10]=y*s+v*u+w*d+b*g,e[11]=y*o+v*h+w*f+b*x,y=i[12],v=i[13],w=i[14],b=i[15],e[12]=y*r+v*n+w*c+b*m,e[13]=y*a+v*l+w*p+b*_,e[14]=y*s+v*u+w*d+b*g,e[15]=y*o+v*h+w*f+b*x,e}function Fe(e,t,i){var r=i[0],a=i[1],s=i[2],o,n,l,u,h,c,p,d,f,m,_,g;return t===e?(e[12]=t[0]*r+t[4]*a+t[8]*s+t[12],e[13]=t[1]*r+t[5]*a+t[9]*s+t[13],e[14]=t[2]*r+t[6]*a+t[10]*s+t[14],e[15]=t[3]*r+t[7]*a+t[11]*s+t[15]):(o=t[0],n=t[1],l=t[2],u=t[3],h=t[4],c=t[5],p=t[6],d=t[7],f=t[8],m=t[9],_=t[10],g=t[11],e[0]=o,e[1]=n,e[2]=l,e[3]=u,e[4]=h,e[5]=c,e[6]=p,e[7]=d,e[8]=f,e[9]=m,e[10]=_,e[11]=g,e[12]=o*r+h*a+f*s+t[12],e[13]=n*r+c*a+m*s+t[13],e[14]=l*r+p*a+_*s+t[14],e[15]=u*r+d*a+g*s+t[15]),e}function tt(e,t,i){var r=i[0],a=i[1],s=i[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*a,e[5]=t[5]*a,e[6]=t[6]*a,e[7]=t[7]*a,e[8]=t[8]*s,e[9]=t[9]*s,e[10]=t[10]*s,e[11]=t[11]*s,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Nr(e,t,i){var r=Math.sin(i),a=Math.cos(i),s=t[4],o=t[5],n=t[6],l=t[7],u=t[8],h=t[9],c=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=s*a+u*r,e[5]=o*a+h*r,e[6]=n*a+c*r,e[7]=l*a+p*r,e[8]=u*a-s*r,e[9]=h*a-o*r,e[10]=c*a-n*r,e[11]=p*a-l*r,e}function vd(e,t,i){var r=Math.sin(i),a=Math.cos(i),s=t[0],o=t[1],n=t[2],l=t[3],u=t[8],h=t[9],c=t[10],p=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=s*a-u*r,e[1]=o*a-h*r,e[2]=n*a-c*r,e[3]=l*a-p*r,e[8]=s*r+u*a,e[9]=o*r+h*a,e[10]=n*r+c*a,e[11]=l*r+p*a,e}function Fi(e,t,i){var r=Math.sin(i),a=Math.cos(i),s=t[0],o=t[1],n=t[2],l=t[3],u=t[4],h=t[5],c=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=s*a+u*r,e[1]=o*a+h*r,e[2]=n*a+c*r,e[3]=l*a+p*r,e[4]=u*a-s*r,e[5]=h*a-o*r,e[6]=c*a-n*r,e[7]=p*a-l*r,e}function Ug(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Gg(e,t,i,r,a){var s=1/Math.tan(t/2);if(e[0]=s/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){var o=1/(r-a);e[10]=(a+r)*o,e[14]=2*a*r*o}else e[10]=-1,e[14]=-2*r;return e}var ol=Gg;function Zg(e,t,i,r,a,s,o){var n=1/(t-i),l=1/(r-a),u=1/(s-o);return e[0]=-2*n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+i)*n,e[13]=(a+r)*l,e[14]=(o+s)*u,e[15]=1,e}var Jt=Zg;function qg(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function Wg(e,t){var i=e[0],r=e[1],a=e[2],s=e[3],o=e[4],n=e[5],l=e[6],u=e[7],h=e[8],c=e[9],p=e[10],d=e[11],f=e[12],m=e[13],_=e[14],g=e[15],x=t[0],y=t[1],v=t[2],w=t[3],b=t[4],T=t[5],I=t[6],M=t[7],D=t[8],L=t[9],z=t[10],P=t[11],S=t[12],F=t[13],O=t[14],H=t[15];return Math.abs(i-x)<=1e-6*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-v)<=1e-6*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(s-w)<=1e-6*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(o-b)<=1e-6*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(n-T)<=1e-6*Math.max(1,Math.abs(n),Math.abs(T))&&Math.abs(l-I)<=1e-6*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(u-M)<=1e-6*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(h-D)<=1e-6*Math.max(1,Math.abs(h),Math.abs(D))&&Math.abs(c-L)<=1e-6*Math.max(1,Math.abs(c),Math.abs(L))&&Math.abs(p-z)<=1e-6*Math.max(1,Math.abs(p),Math.abs(z))&&Math.abs(d-P)<=1e-6*Math.max(1,Math.abs(d),Math.abs(P))&&Math.abs(f-S)<=1e-6*Math.max(1,Math.abs(f),Math.abs(S))&&Math.abs(m-F)<=1e-6*Math.max(1,Math.abs(m),Math.abs(F))&&Math.abs(_-O)<=1e-6*Math.max(1,Math.abs(_),Math.abs(O))&&Math.abs(g-H)<=1e-6*Math.max(1,Math.abs(g),Math.abs(H))}function xd(){var e=new Ye(3);return Ye!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function nl(e){var t=new Ye(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ro(e){var t=e[0],i=e[1],r=e[2];return Math.sqrt(t*t+i*i+r*r)}function Nh(e,t,i){var r=new Ye(3);return r[0]=e,r[1]=t,r[2]=i,r}function Lt(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e}function Hg(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e}function Be(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function Xg(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e}function Yg(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function kt(e,t){var i=t[0],r=t[1],a=t[2],s=i*i+r*r+a*a;return s>0&&(s=1/Math.sqrt(s)),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e}function it(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function bt(e,t,i){var r=t[0],a=t[1],s=t[2],o=i[0],n=i[1],l=i[2];return e[0]=a*l-s*n,e[1]=s*o-r*l,e[2]=r*n-a*o,e}function Kg(e,t,i){var r=t[0],a=t[1],s=t[2],o=i[3]*r+i[7]*a+i[11]*s+i[15];return o||=1,e[0]=(i[0]*r+i[4]*a+i[8]*s+i[12])/o,e[1]=(i[1]*r+i[5]*a+i[9]*s+i[13])/o,e[2]=(i[2]*r+i[6]*a+i[10]*s+i[14])/o,e}function Jg(e,t,i){var r=t[0],a=t[1],s=t[2];return e[0]=r*i[0]+a*i[3]+s*i[6],e[1]=r*i[1]+a*i[4]+s*i[7],e[2]=r*i[2]+a*i[5]+s*i[8],e}function vn(e,t,i){var r=i[0],a=i[1],s=i[2],o=i[3],n=t[0],l=t[1],u=t[2],h=a*u-s*l,c=s*n-r*u,p=r*l-a*n;return h+=h,c+=c,p+=p,e[0]=n+o*h+a*p-s*c,e[1]=l+o*c+s*h-r*p,e[2]=u+o*p+r*c-a*h,e}function Ts(e,t,i,r){var a=[],s=[];return a[0]=t[0]-i[0],a[1]=t[1]-i[1],a[2]=t[2]-i[2],s[0]=a[0],s[1]=a[1]*Math.cos(r)-a[2]*Math.sin(r),s[2]=a[1]*Math.sin(r)+a[2]*Math.cos(r),e[0]=s[0]+i[0],e[1]=s[1]+i[1],e[2]=s[2]+i[2],e}function oa(e,t,i,r){var a=[],s=[];return a[0]=t[0]-i[0],a[1]=t[1]-i[1],a[2]=t[2]-i[2],s[0]=a[2]*Math.sin(r)+a[0]*Math.cos(r),s[1]=a[1],s[2]=a[2]*Math.cos(r)-a[0]*Math.sin(r),e[0]=s[0]+i[0],e[1]=s[1]+i[1],e[2]=s[2]+i[2],e}function xn(e,t,i,r){var a=[],s=[];return a[0]=t[0]-i[0],a[1]=t[1]-i[1],a[2]=t[2]-i[2],s[0]=a[0]*Math.cos(r)-a[1]*Math.sin(r),s[1]=a[0]*Math.sin(r)+a[1]*Math.cos(r),s[2]=a[2],e[0]=s[0]+i[0],e[1]=s[1]+i[1],e[2]=s[2]+i[2],e}function Qg(e){return e[0]=0,e[1]=0,e[2]=0,e}var Si=Hg,no=Ro;(function(){var e=xd();return function(t,i,r,a,s,o){var n,l;for(i||=3,r||=0,l=a?Math.min(a*i+r,t.length):t.length,n=r;n<l;n+=i)e[0]=t[n],e[1]=t[n+1],e[2]=t[n+2],s(e,e,o),t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2];return t}})();function ey(){var e=new Ye(4);return Ye!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function ty(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e[2]=t[2]*i[2],e[3]=t[3]*i[3],e}function iy(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e}function ry(e,t){var i=t[0],r=t[1],a=t[2],s=t[3],o=i*i+r*r+a*a+s*s;return o>0&&(o=1/Math.sqrt(o)),e[0]=i*o,e[1]=r*o,e[2]=a*o,e[3]=s*o,e}function Ue(e,t,i){var r=t[0],a=t[1],s=t[2],o=t[3];return e[0]=i[0]*r+i[4]*a+i[8]*s+i[12]*o,e[1]=i[1]*r+i[5]*a+i[9]*s+i[13]*o,e[2]=i[2]*r+i[6]*a+i[10]*s+i[14]*o,e[3]=i[3]*r+i[7]*a+i[11]*s+i[15]*o,e}var ay=ty;(function(){var e=ey();return function(t,i,r,a,s,o){var n,l;for(i||=4,r||=0,l=a?Math.min(a*i+r,t.length):t.length,n=r;n<l;n+=i)e[0]=t[n],e[1]=t[n+1],e[2]=t[n+2],e[3]=t[n+3],s(e,e,o),t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3];return t}})();function Uh(){var e=new Ye(4);return Ye!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function sy(e,t,i){i*=.5;var r=Math.sin(i);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(i),e}function Hs(e,t,i,r){var a=t[0],s=t[1],o=t[2],n=t[3],l=i[0],u=i[1],h=i[2],c=i[3],p,d=a*l+s*u+o*h+n*c,f,m,_;return d<0&&(d=-d,l=-l,u=-u,h=-h,c=-c),1-d>1e-6?(p=Math.acos(d),f=Math.sin(p),m=Math.sin((1-r)*p)/f,_=Math.sin(r*p)/f):(m=1-r,_=r),e[0]=m*a+_*l,e[1]=m*s+_*u,e[2]=m*o+_*h,e[3]=m*n+_*c,e}function oy(e,t){var i=t[0]+t[4]+t[8],r;if(i>0)r=Math.sqrt(i+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var a=0;t[4]>t[0]&&(a=1),t[8]>t[a*3+a]&&(a=2);var s=(a+1)%3,o=(a+2)%3;r=Math.sqrt(t[a*3+a]-t[s*3+s]-t[o*3+o]+1),e[a]=.5*r,r=.5/r,e[3]=(t[s*3+o]-t[o*3+s])*r,e[s]=(t[s*3+a]+t[a*3+s])*r,e[o]=(t[o*3+a]+t[a*3+o])*r}return e}function bd(e,t,i,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",s=Math.PI/360;t*=s,r*=s,i*=s;var o=Math.sin(t),n=Math.cos(t),l=Math.sin(i),u=Math.cos(i),h=Math.sin(r),c=Math.cos(r);switch(a){case"xyz":e[0]=o*u*c+n*l*h,e[1]=n*l*c-o*u*h,e[2]=n*u*h+o*l*c,e[3]=n*u*c-o*l*h;break;case"xzy":e[0]=o*u*c-n*l*h,e[1]=n*l*c-o*u*h,e[2]=n*u*h+o*l*c,e[3]=n*u*c+o*l*h;break;case"yxz":e[0]=o*u*c+n*l*h,e[1]=n*l*c-o*u*h,e[2]=n*u*h-o*l*c,e[3]=n*u*c+o*l*h;break;case"yzx":e[0]=o*u*c+n*l*h,e[1]=n*l*c+o*u*h,e[2]=n*u*h-o*l*c,e[3]=n*u*c-o*l*h;break;case"zxy":e[0]=o*u*c-n*l*h,e[1]=n*l*c+o*u*h,e[2]=n*u*h+o*l*c,e[3]=n*u*c-o*l*h;break;case"zyx":e[0]=o*u*c-n*l*h,e[1]=n*l*c+o*u*h,e[2]=n*u*h-o*l*c,e[3]=n*u*c+o*l*h;break;default:throw Error("Unknown angle order "+a)}return e}var Gh=ry;(function(){var e=xd(),t=Nh(1,0,0),i=Nh(0,1,0);return function(r,a,s){var o=it(a,s);return o<-.999999?(bt(e,t,a),no(e)<1e-6&&bt(e,i,a),kt(e,e),sy(r,e,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(bt(e,a,s),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+o,Gh(r,r))}})(),(function(){var e=Uh(),t=Uh();return function(i,r,a,s,o,n){return Hs(e,r,o,n),Hs(t,a,s,n),Hs(i,e,t,2*n*(1-n)),i}})(),(function(){var e=yd();return function(t,i,r,a){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=a[0],e[4]=a[1],e[7]=a[2],e[2]=-i[0],e[5]=-i[1],e[8]=-i[2],Gh(t,oy(t,e))}})();function ll(){var e=new Ye(2);return Ye!=Float32Array&&(e[0]=0,e[1]=0),e}function Zh(e,t){var i=new Ye(2);return i[0]=e,i[1]=t,i}function qh(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e}function Wh(e){var t=e[0],i=e[1];return Math.sqrt(t*t+i*i)}function ny(e){var t=e[0],i=e[1];return t*t+i*i}function ly(e,t){return e[0]*t[0]+e[1]*t[1]}function uy(e,t,i){var r=t[0],a=t[1];return e[0]=i[0]*r+i[4]*a+i[12],e[1]=i[1]*r+i[5]*a+i[13],e}function Hh(e){return e[0]=0,e[1]=0,e}var hy=ny;(function(){var e=ll();return function(t,i,r,a,s,o){var n,l;for(i||=2,r||=0,l=a?Math.min(a*i+r,t.length):t.length,n=r;n<l;n+=i)e[0]=t[n],e[1]=t[n+1],s(e,e,o),t[n]=e[0],t[n+1]=e[1];return t}})();const C=8192;function St(e,t,i){return t*(C/(e.tileSize*2**(i-e.tileID.overscaledZ)))}function ht(e){return e instanceof Error?e:Error(typeof e=="string"?e:String(e))}function na(){return new Float64Array(4)}function Le(){return new Float64Array(3)}function tr(){return new Float64Array(16)}function Ss(){let e=new Float64Array(16);return Xt(e),e}function wd(){let e=new Float32Array(16);return Xt(e),e}function Ni(e,t,i,r,a=!1){if(!i[0]&&!i[1])return[0,0];let s=a?r==="map"?-e.bearingInRadians:0:r==="viewport"?e.bearingInRadians:0;if(s){let o=Math.sin(s),n=Math.cos(s);i=[i[0]*n-i[1]*o,i[0]*o+i[1]*n]}return[a?i[0]:St(t,i[0],e.zoom),a?i[1]:St(t,i[1],e.zoom)]}function ul(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]}function Mt(e,t,i){let r=$g([e[0],e[1],e[2],t[0],t[1],t[2],i[0],i[1],i[2]]);if(r===0)return null;let a=bt([],[t[0],t[1],t[2]],[i[0],i[1],i[2]]),s=bt([],[i[0],i[1],i[2]],[e[0],e[1],e[2]]),o=bt([],[e[0],e[1],e[2]],[t[0],t[1],t[2]]),n=Be([],a,-e[3]);return Lt(n,n,Be([],s,-t[3])),Lt(n,n,Be([],o,-i[3])),Be(n,n,1/r),n}function cy(e,t,i){let r=e[0]*i[0]+e[1]*i[1]+e[2]*i[2],a=t[0]*i[0]+t[1]*i[1]+t[2]*i[2];return a===0?null:(-r-i[3])/a}function Ps(e,t,i,r){let a=Math.sqrt(e*e+t*t),s=Math.sqrt(i*i+r*r);e/=a,t/=a,i/=s,r/=s;let o=e*i+t*r,n=Math.acos(o);return-t*i+e*r>0?n:-n}function vt(e,t){let i=Ur(e,360),r=Ur(t,360),a=r-i,s=r>i?a-360:a+360;return Math.abs(a)<Math.abs(s)?a:s}function Is(e,t){let i=Ur(e,Math.PI*2),r=Ur(t,Math.PI*2);return Math.min(Math.abs(i-r),Math.abs(i-r+Math.PI*2),Math.abs(i-r-Math.PI*2))}function Ur(e,t){return(e%t+t)%t}function Xs(e,t,i,r,a){return Ma(r,a,oe((e-t)/(i-t),0,1))}function Ma(e,t,i){return e*(1-i)+t*i}function py(e){let t=1/0,i=1/0,r=-1/0,a=-1/0;for(let s of e)t=Math.min(t,s.x),i=Math.min(i,s.y),r=Math.max(r,s.x),a=Math.max(a,s.y);return[t,i,r,a]}function dy(e){if(!e.length)return new Set;let t=Math.max(...e.map(l=>l.canonical.z)),i=1/0,r=-1/0,a=1/0,s=-1/0,o=[];for(let l of e){let{x:u,y:h,z:c}=l.canonical,p=2**(t-c),d=u*p,f=h*p;o.push({id:l,x:d,y:f}),d<i&&(i=d),d>r&&(r=d),f<a&&(a=f),f>s&&(s=f)}let n=new Set;for(let l of o)(l.x===i||l.x===r||l.y===a||l.y===s)&&n.add(l.id);return n}function fy(e){if(e<=0)return 0;if(e>=1)return 1;let t=e*e,i=t*e;return 4*(e<.5?i:3*(e-t)+i-.75)}function Au(e,t,i,r){return Bg(e,t,i,r)}const hl=Au(.25,.1,.25,1);function oe(e,t,i){return Math.min(i,Math.max(t,e))}function Zt(e,t,i){let r=i-t,a=((e-t)%r+r)%r+t;return a===t?i:a}function j(e,...t){for(let i of t)for(let r in i)e[r]=i[r];return e}function as(e,t){let i={};for(let r of t)r in e&&(i[r]=e[r]);return i}let my=1;function Td(){return my++}function _y(e){return Math.log(e)/Math.LN2%1==0}function gy(e){return e<=1?1:2**Math.ceil(Math.log(e)/Math.LN2)}function dt(e){return 2**e}function lt(e){return Math.log(e)/Math.LN2}function xt(e,t,i){if(t<=0)return e;let r=1/t;return i===void 0||Math.abs(i)<1e-10?Math.round(e*r)/r:(i>0?Math.ceil(e*r-1e-9):Math.floor(e*r+1e-10))/r}function Cu(e,t,i){let r={};for(let a in e)r[a]=t.call(this,e[a],a,e);return r}function Sd(e,t,i){let r={};for(let a in e)t.call(this,e[a],a,e)&&(r[a]=e[a]);return r}function Qt(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!Qt(e[i],t[i]))return!1;return!0}if(typeof e=="object"&&e&&t!==null){if(typeof t!="object"||Object.keys(e).length!==Object.keys(t).length)return!1;for(let i in e)if(!Qt(e[i],t[i]))return!1;return!0}return e===t}function gt(e){return Array.isArray(e)?e.map(gt):typeof e=="object"&&e?Cu(e,gt):e}const Xh={};function ge(e){Xh[e]||(typeof console<"u"&&console.warn(e),Xh[e]=!0)}function Bi(e,t,i){return(i.y-e.y)*(t.x-e.x)>(t.y-e.y)*(i.x-e.x)}function yy(e,t,i,r){let a=t.y-e.y,s=t.x-e.x,o=r.y-i.y,n=r.x-i.x,l=o*s-n*a;if(l===0)return null;let u=e.y-i.y,h=e.x-i.x,c=(n*u-o*h)/l;return new E(e.x+c*s,e.y+c*a)}function vy([e,t,i]){return t+=90,t*=Math.PI/180,i*=Math.PI/180,[e*Math.cos(t)*Math.sin(i),e*Math.sin(t)*Math.sin(i),e*Math.cos(i)]}function Gr(e){return typeof WorkerGlobalScope<"u"&&e!==void 0&&e instanceof WorkerGlobalScope}function xy(e){let t=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,i={};if(e.replace(t,(r,a,s,o)=>{let n=s||o;return i[a]=!n||n.toLowerCase(),""}),i["max-age"]){let r=parseInt(i["max-age"],10);isNaN(r)?delete i["max-age"]:i["max-age"]=r}return i}let bn=null;function by(e){if(bn==null){let t=e.navigator?e.navigator.userAgent:null;bn=!!e.safari||!!(t&&(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return bn}function ar(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap}const wy=async(e,t)=>{if(e.byteLength===0)return createImageBitmap(new ImageData(1,1),t);let i=new Blob([new Uint8Array(e)],{type:"image/png"});try{return createImageBitmap(i,t)}catch(r){throw Error(`Could not load image because of ${ht(r).message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}},Yh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",Ty=e=>new Promise((t,i)=>{let r=new Image;r.onload=()=>{t(r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>r.src=Yh)},r.onerror=()=>i(Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let a=new Blob([new Uint8Array(e)],{type:"image/png"});r.src=e.byteLength?URL.createObjectURL(a):Yh});function Sy(e,t,i,r,a){let s=Math.max(-t,0)*4,o=(Math.max(0,i)-i)*r*4+s,n=r*4,l=Math.max(0,t),u=Math.max(0,i),h=Math.min(e.width,t+r),c=Math.min(e.height,i+a);return{rect:{x:l,y:u,width:h-l,height:c-u},layout:[{offset:o,stride:n}]}}async function Py(e,t,i,r,a){if(typeof VideoFrame>"u")throw Error("VideoFrame not supported");let s=new VideoFrame(e,{timestamp:0});try{let o=s?.format;if(!o||!(o.startsWith("BGR")||o.startsWith("RGB")))throw Error(`Unrecognized format ${o}`);let n=o.startsWith("BGR"),l=new Uint8ClampedArray(r*a*4);if(await s.copyTo(l,Sy(e,t,i,r,a)),n)for(let u=0;u<l.length;u+=4){let h=l[u];l[u]=l[u+2],l[u+2]=h}return l}finally{s.close()}}function cl(e,t,i,r){return e.addEventListener(t,i,r),{unsubscribe:()=>{e.removeEventListener(t,i,r)}}}function De(e){return e*Math.PI/180}function Rr(e){return e/Math.PI*180}function Pd(e,t){return e.roll==t.roll&&e.pitch==t.pitch&&e.bearing==t.bearing}function Iy(e){let t=new Float64Array(9);jg(t,e);let i=Rr(-Math.asin(oe(t[2],-1,1))),r,a;return Math.hypot(t[5],t[8])<.001?(r=0,a=-Rr(Math.atan2(t[3],t[4]))):(r=Rr(t[5]===0&&t[8]===0?0:Math.atan2(t[5],t[8])),a=Rr(t[1]===0&&t[0]===0?0:Math.atan2(t[1],t[0]))),{roll:r,pitch:i+90,bearing:a}}function Id(e,t,i){let r=Zh(t.x-i.x,t.y-i.y),a=Zh(e.x-i.x,e.y-i.y),s=r[0]*a[1]-r[1]*a[0];return Rr(Math.atan2(s,ly(r,a)))}function Kh(e,t,i){let r=new Float64Array(4);return bd(r,e,t-90,i),r}const si=85.051129,Ed={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},Md={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0};function Ey(e,t){return Ed[t]&&"touches"in e}function My(e,t){if(!Md[t])return!1;let i=e,r=i?.target?.ownerDocument?.defaultView||window;return i instanceof r.MouseEvent||i instanceof r.WheelEvent}function Ay(e){return Ed[e]||Md[e]}const Jh="AbortError";var ss=class extends Error{constructor(e=Jh){super(e instanceof Error?e.message:e),this.name=Jh,e instanceof Error&&e.stack&&(this.stack=e.stack)}};function Ui(e){return e instanceof Error&&e.name==="AbortError"}function Ad(e){if(e.aborted)throw new ss(e.reason)}const Bt={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Cd(e){return Bt.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))]}function aC(e,t){Bt.REGISTERED_PROTOCOLS[e]=t}function sC(e){delete Bt.REGISTERED_PROTOCOLS[e]}const pl="global-dispatcher";var lo=class extends Error{constructor(e,t,i,r){super(`AJAXError: ${t} (${e}): ${i}`),this.status=e,this.statusText=t,this.url=i,this.body=r}};function Du(){if(Gr(self))return self.worker?.referrer;if(window.location.protocol==="blob:")try{return window.parent.location.href}catch{}return window.location.href}const Cy=e=>e.startsWith("file:")||Du()?.startsWith("file:")&&!/^\w+:/.test(e);async function Dy(e,t){let i=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:Du(),referrerPolicy:e.referrerPolicy,signal:t.signal});e.type==="json"&&!i.headers.has("Accept")&&i.headers.set("Accept","application/json");let r;try{r=await fetch(i)}catch(o){throw Ui(o)?o:new lo(0,ht(o).message,e.url,new Blob)}if(!r.ok){let o=await r.blob();throw new lo(r.status,r.statusText,e.url,o)}let a;a=e.type==="arrayBuffer"||e.type==="image"?r.arrayBuffer():e.type==="json"?r.json():r.text();let s=await a;return Ad(t.signal),{data:s,cacheControl:r.headers.get("Cache-Control"),expires:r.headers.get("Expires"),etag:r.headers.get("ETag")}}function zy(e,t){return new Promise((i,r)=>{let a=new XMLHttpRequest;a.open(e.method||"GET",e.url,!0),(e.type==="arrayBuffer"||e.type==="image")&&(a.responseType="arraybuffer");for(let s in e.headers)a.setRequestHeader(s,e.headers[s]);e.type==="json"&&(a.responseType="text",e.headers?.Accept||a.setRequestHeader("Accept","application/json")),a.withCredentials=e.credentials==="include",a.onerror=()=>{r(Error(a.statusText))},a.onload=()=>{if(!t.signal.aborted)if((a.status>=200&&a.status<300||a.status===0)&&a.response!==null){let s=a.response;if(e.type==="json")try{s=JSON.parse(a.response)}catch(o){r(o);return}i({data:s,cacheControl:a.getResponseHeader("Cache-Control"),expires:a.getResponseHeader("Expires"),etag:a.getResponseHeader("ETag")})}else{let s=new Blob([a.response],{type:a.getResponseHeader("Content-Type")});r(new lo(a.status,a.statusText,e.url,s))}},t.signal.addEventListener("abort",()=>{a.abort(),r(new ss(t.signal.reason))}),a.send(e.body)})}const ko=async function(e,t){if(e.url.includes("://")&&!/^https?:|^file:/.test(e.url)){let i=Cd(e.url);if(i){let r=await i(e,t);return!r.data&&e.type==="arrayBuffer"?j(r,{data:new ArrayBuffer(0)}):r}if(Gr(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:e,targetMapId:pl},t)}if(!Cy(e.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return Dy(e,t);if(Gr(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:e,mustQueue:!0,targetMapId:pl},t)}return zy(e,t)},Lo=(e,t)=>ko(j(e,{type:"json"}),t),Ry=(e,t)=>ko(j(e,{type:"arrayBuffer"}),t);function Dd(e){if(!e||e.startsWith("data:image/"))return!0;if(e.startsWith("blob:")&&(e=e.slice(5),e.startsWith("null")))return!1;if(e.indexOf("://")<=0)return!0;let t=new URL(e),i=window.location;return t.protocol===i.protocol&&t.host===i.host}const ky=e=>{let t=window.document.createElement("video");return t.muted=!0,new Promise(i=>{t.onloadstart=()=>{i(t)};for(let r of e){let a=window.document.createElement("source");Dd(r)||(t.crossOrigin="Anonymous"),a.src=r,t.appendChild(a)}})};function Qh(e,t,i){i[e]?.includes(t)||(i[e]||=[],i[e].push(t))}function wn(e,t,i){if(i?.[e]){let r=i[e].indexOf(t);r!==-1&&i[e].splice(r,1)}}var Ot=class{constructor(e,t={}){j(this,t),this.type=e}},G=class extends Ot{constructor(e,t={}){super("error",j({error:e},t))}},Ze=class{on(e,t){return this._listeners||={},Qh(e,t,this._listeners),{unsubscribe:()=>{this.off(e,t)}}}off(e,t){return wn(e,t,this._listeners),wn(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners||={},Qh(e,t,this._oneTimeListeners),this):new Promise(i=>this.once(e,i))}fire(e,t){typeof e=="string"&&(e=new Ot(e,t||{}));let i=e.type;if(this.listens(i)){e.target=this;let r=this._listeners?.[i]?this._listeners[i].slice():[];for(let o of r)o.call(this,e);let a=this._oneTimeListeners?.[i]?this._oneTimeListeners[i].slice():[];for(let o of a)wn(i,o,this._oneTimeListeners),o.call(this,e);let s=this._eventedParent;s&&(j(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),s.fire(e))}else e instanceof G&&console.error(e.error);return this}listens(e){return this._listeners?.[e]?.length>0||this._oneTimeListeners?.[e]?.length>0||this._eventedParent?.listens(e)}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}};const A={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"},"fill-extrusion-rounded-corner-distance":{type:"number",default:0,minimum:0,units:"meters","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image
vendor: 19,782 bytes, line 1
1"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"fill-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}}
1,Ly=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Fy(e,t){let i={};for(let r in e)r!=="ref"&&(i[r]=e[r]);return Ly.forEach(r=>{r in t&&(i[r]=t[r])}),i}function ec(e){e=e.slice();let t=Object.create(null);for(let i=0;i<e.length;i++)t[e[i].id]=e[i];for(let i=0;i<e.length;i++)"ref"in e[i]&&(e[i]=Fy(e[i],t[e[i].ref]));return e}function fe(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!fe(e[i],t[i]))return!1;return!0}if(typeof e=="object"&&e&&t!==null){if(typeof t!="object"||Object.keys(e).length!==Object.keys(t).length)return!1;for(let i in e)if(!fe(e[i],t[i]))return!1;return!0}return e===t}function zt(e,t){e.push(t)}function zd(e,t,i){zt(i,{command:"addSource",args:[e,t[e]]})}function Rd(e,t,i){zt(t,{command:"removeSource",args:[e]}),i[e]=!0}function By(e,t,i,r){Rd(e,i,r),zd(e,t,i)}function Oy(e,t,i){let r;for(r in e[i])if(Object.prototype.hasOwnProperty.call(e[i],r)&&r!=="data"&&!fe(e[i][r],t[i][r]))return!1;for(r in t[i])if(Object.prototype.hasOwnProperty.call(t[i],r)&&r!=="data"&&!fe(e[i][r],t[i][r]))return!1;return!0}function $y(e,t,i,r){e||={},t||={};let a;for(a in e)Object.prototype.hasOwnProperty.call(e,a)&&(Object.prototype.hasOwnProperty.call(t,a)||Rd(a,i,r));for(a in t)Object.prototype.hasOwnProperty.call(t,a)&&(Object.prototype.hasOwnProperty.call(e,a)?fe(e[a],t[a])||(e[a].type==="geojson"&&t[a].type==="geojson"&&Oy(e,t,a)?zt(i,{command:"setGeoJSONSourceData",args:[a,t[a].data]}):By(a,t,i,r)):zd(a,t,i))}function Es(e,t,i,r,a,s){e||={},t||={};for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(fe(e[o],t[o])||i.push({command:s,args:[r,o,t[o],a]}));for(let o in t)!Object.prototype.hasOwnProperty.call(t,o)||Object.prototype.hasOwnProperty.call(e,o)||fe(e[o],t[o])||i.push({command:s,args:[r,o,t[o],a]})}function tc(e){return e.id}function ic(e,t){return e[t.id]=t,e}function Vy(e,t,i){e||=[],t||=[];let r=e.map(tc),a=t.map(tc),s=e.reduce(ic,{}),o=t.reduce(ic,{}),n=r.slice(),l=Object.create(null),u,h,c,p,d;for(let f=0,m=0;f<r.length;f++)u=r[f],Object.prototype.hasOwnProperty.call(o,u)?m++:(zt(i,{command:"removeLayer",args:[u]}),n.splice(n.indexOf(u,m),1));for(let f=0,m=0;f<a.length;f++)u=a[a.length-1-f],n[n.length-1-f]!==u&&(Object.prototype.hasOwnProperty.call(s,u)?(zt(i,{command:"removeLayer",args:[u]}),n.splice(n.lastIndexOf(u,n.length-m),1)):m++,p=n[n.length-f],zt(i,{command:"addLayer",args:[o[u],p]}),n.splice(n.length-f,0,u),l[u]=!0);for(let f=0;f<a.length;
1f++)if(u=a[f],h=s[u],c=o[u],!(l[u]||fe(h,c))){if(!fe(h.source,c.source)||!fe(h["source-layer"],c["source-layer"])||!fe(h.type,c.type)){zt(i,{command:"removeLayer",args:[u]}),p=n[n.lastIndexOf(u)+1],zt(i,{command:"addLayer",args:[c,p]});continue}for(d in Es(h.layout,c.layout,i,u,null,"setLayoutProperty"),Es(h.paint,c.paint,i,u,null,"setPaintProperty"),fe(h.filter,c.filter)||zt(i,{command:"setFilter",args:[u,c.filter]}),(!fe(h.minzoom,c.minzoom)||!fe(h.maxzoom,c.maxzoom))&&zt(i,{command:"setLayerZoomRange",args:[u,c.minzoom,c.maxzoom]}),h)Object.prototype.hasOwnProperty.call(h,d)&&d!=="layout"&&d!=="paint"&&d!=="filter"&&d!=="metadata"&&d!=="minzoom"&&d!=="maxzoom"&&(d.indexOf("paint.")===0?Es(h[d],c[d],i,u,d.slice(6),"setPaintProperty"):fe(h[d],c[d])||zt(i,{command:"setLayerProperty",args:[u,d,c[d]]}));for(d in c)!Object.prototype.hasOwnProperty.call(c,d)||Object.prototype.hasOwnProperty.call(h,d)||d!=="layout"&&d!=="paint"&&d!=="filter"&&d!=="metadata"&&d!=="minzoom"&&d!=="maxzoom"&&(d.indexOf("paint.")===0?Es(h[d],c[d],i,u,d.slice(6),"setPaintProperty"):fe(h[d],c[d])||zt(i,{command:"setLayerProperty",args:[u,d,c[d]]}))}}function jy(e,t){if(!e)return[{command:"setStyle",args:[t]}];let i=[];try{if(!fe(e.version,t.version))return[{command:"setStyle",args:[t]}];fe(e.center,t.center)||i.push({command:"setCenter",args:[t.center]}),fe(e.state,t.state)||i.push({command:"setGlobalState",args:[t.state]}),fe(e.centerAltitude,t.centerAltitude)||i.push({command:"setCenterAltitude",args:[t.centerAltitude]}),fe(e.zoom,t.zoom)||i.push({command:"setZoom",args:[t.zoom]}),fe(e.bearing,t.bearing)||i.push({command:"setBearing",args:[t.bearing]}),fe(e.pitch,t.pitch)||i.push({command:"setPitch",args:[t.pitch]}),fe(e.roll,t.roll)||i.push({command:"setRoll",args:[t.roll]}),fe(e.sprite,t.sprite)||i.push({command:"setSprite",args:[t.sprite]}),fe(e.glyphs,t.glyphs)||i.push({command:"setGlyphs",args:[t.glyphs]}),fe(e.transition,t.transition)||i.push({command:"setTransition",args:[t.transition]}),fe(e.light,t.light)||i.push({command:"setLight",args:[t.light]}),fe(e.terrain,t.terrain)||i.push({command:"setTerrain",args:[t.terrain]}),fe(e.sky,t.sky)||i.push({command:"setSky",args:[t.sky]}),fe(e.projection,t.projection)||i.push({command:"setProjection",args:[t.projection]});let r={},a=[];$y(e.sources,t.sources,a,r);let s=[];e.layers&&e.layers.forEach(o=>{"source"in o&&r[o.source]?i.push({command:"removeLayer",args:[o.id]}):s.push(o)}),i=i.concat(a),Vy(s,t.layers,i)}catch(r){console.warn("Unable to compute style diff:",r),i=[{command:"setStyle",args:[t]}]}return i}var R=class{constructor(e,t,i,r,a="error"){this.message=(e?`${e}: `:"")+i,r&&(this.identifier=r),this.severity=a,t!=null&&t.__line__&&(this.line=t.__line__)}},ei=class extends Error{constructor(e,t){super(t),this.message=t,this.key=e}},Ny=class kd{constructor(t,i=[]){this.parent=t,this.bindings={};for(let[r,a]of i)this.bindings[r]=a}concat(t){return new kd(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw Error(`${t} not found in scope.`)}has(t){return this.bindings[t]?!0:this.parent?this.parent.has(t):!1}};const os={kind:"null"},B={kind:"number"},J={kind:"string"},re={kind:"boolean"},Wt={kind:"color"},Fo={kind:"projectionDefinition"},sr={kind:"object"},ee={kind:"value"},Uy={kind:"error"},Bo={kind:"collator"},ns={kind:"formatted"},Oo={kind:"padding"},Fa={kind:"colorArray"},$o={kind:"numberArray"},ls={kind:"resolvedImage"},Vo={kind:"variableAnchorOffsetCollection"};function ct(e,t){return{kind:"array",itemType:e,N:t}}function Ae(e){if(e.kind==="array"){let t=Ae(e.itemType);return typeof e.N=="number"?`array<${t}, ${e.N}>`:e.itemType.kind==="value"?"array":`array<${t}>`}else return e.kind}const Gy=[os,B,J,re,Wt,Fo,ns,sr,ct(ee),Oo,$o,Fa,ls,Vo];function Ba(e,t){if(t.kind==="error")return null;if(e.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Ba(e.itemType,t.itemType))&&(typeof e.N!="number"||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind==="value"){for(let i of Gy)if(!Ba(i,t))return null}}return`Expected ${Ae(e)} but found ${Ae(t)}
1 instead.`}function zu(e,t){return t.some(i=>i.kind===e.kind)}function or(e,t){return t.some(i=>i==="null"?e===null:i==="array"?Array.isArray(e):i==="object"?e&&!Array.isArray(e)&&typeof e=="object":i===typeof e)}function zi(e,t){return e.kind==="array"&&t.kind==="array"?e.itemType.kind===t.itemType.kind&&typeof e.N=="number":e.kind===t.kind}const Ld=.96422,Fd=.82521,Bd=4/29,dl=6/29,Od=3*dl*dl,Zy=Math.PI/180,qy=180/Math.PI;function $d(e){return e%=360,e<0&&(e+=360),e}function Vd([e,t,i,r]){e=Tn(e),t=Tn(t),i=Tn(i);let a,s,o=Sn((.2225045*e+.7168786*t+.0606169*i)/1);e===t&&t===i?a=s=o:(a=Sn((.4360747*e+.3850649*t+.1430804*i)/Ld),s=Sn((.0139322*e+.0971045*t+.7141733*i)/Fd));let n=116*o-16;return[n<0?0:n,500*(a-o),200*(o-s),r]}function Tn(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Sn(e){return e>.008856451679035631?e**(1/3):e/Od+Bd}function jd([e,t,i,r]){let a=(e+16)/116,s=isNaN(t)?a:a+t/500,o=isNaN(i)?a:a-i/200;return a=1*In(a),s=Ld*In(s),o=Fd*In(o),[Pn(3.1338561*s-1.6168667*a-.4906146*o),Pn(-.9787684*s+1.9161415*a+.033454*o),Pn(.0719453*s-.2289914*a+1.4052427*o),r]}function Pn(e){return e=e<=.00304?12.92*e:1.055*e**(1/2.4)-.055,e<0?0:e>1?1:e}function In(e){return e>dl?e*e*e:Od*(e-Bd)}function Wy(e){let[t,i,r,a]=Vd(e),s=Math.sqrt(i*i+r*r);return[Math.round(s*1e4)?$d(Math.atan2(r,i)*qy):NaN,s,t,a]}function Hy([e,t,i,r]){return e=isNaN(e)?0:e*Zy,jd([i,Math.cos(e)*t,Math.sin(e)*t,r])}function Xy([e,t,i,r]){e=$d(e),t/=100,i/=100;function a(s){let o=(s+e/30)%12,n=t*Math.min(i,1-i);return i-n*Math.max(-1,Math.min(o-3,9-o,1))}return[a(0),a(8),a(4),r]}const Yy=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function Aa(e,t){return Yy(e,t)?e[t]:void 0}function Ky(e){if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t=Aa(Jy,e);if(t){let[r,a,s]=t;return[r/255,a/255,s/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let r=e.length<6?1:2,a=1;return[Ms(e.slice(a,a+=r)),Ms(e.slice(a,a+=r)),Ms(e.slice(a,a+=r)),Ms(e.slice(a,a+r)||"ff")]}if(e.startsWith("rgb")){let r=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){let[a,s,o,n,l,u,h,c,p,d,f,m]=r,_=[n||" ",h||" ",d].join("");if(_===" "||_===" /"||_===",,"||_===",,,"){let g=[o,u,p].join(""),x=g==="%%%"?100:g===""?255:0;if(x){let y=[Ar(+s/x,0,1),Ar(+l/x,0,1),Ar(+c/x,0,1),f?rc(+f,m):1];if(ac(y))return y}}return}}let i=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){let[r,a,s,o,n,l,u,h,c]=i,p=[s||" ",n||" ",u].join("");if(p===" "||p===" /"||p===",,"||p===",,,"){let d=[+a,Ar(+o,0,100),Ar(+l,0,100),h?rc(+h,c):1];if(ac(d))return Xy(d)}}}function Ms(e){return parseInt(e.padEnd(2,e),16)/255}function rc(e,t){return Ar(t?e/100:e,0,1)}function Ar(e,t,i){return Math.min(Math.max(t,e),i)}function ac(e){return!e.some(Number.isNaN)}const Jy={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],ol
vendor: 9,617 bytes, line 1
1ive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function $i(e,t,i){return e+i*(t-e)}function Zr(e,t,i){return e.map((r,a)=>$i(r,t[a],i))}function Qy(e){return e==="rgb"||e==="hcl"||e==="lab"}var He,K=(He=class{constructor(t,i,r,a=1,s=!0){this.r=t,this.g=i,this.b=r,this.a=a,s||(this.r*=a,this.g*=a,this.b*=a,a||this.overwriteGetter("rgb",[t,i,r,a]))}static parse(t){if(t instanceof He)return t;if(typeof t!="string")return;let i=Ky(t);if(i)return new He(...i,!1)}get rgb(){let{r:t,g:i,b:r,a}=this,s=a||1/0;return this.overwriteGetter("rgb",[t/s,i/s,r/s,a])}get hcl(){return this.overwriteGetter("hcl",Wy(this.rgb))}get lab(){return this.overwriteGetter("lab",Vd(this.rgb))}overwriteGetter(t,i){return Object.defineProperty(this,t,{value:i}),i}toString(){let[t,i,r,a]=this.rgb;return`rgba(${[t,i,r].map(s=>Math.round(s*255)).join(",")},${a})`}static interpolate(t,i,r,a="rgb"){switch(a){case"rgb":{let[s,o,n,l]=Zr(t.rgb,i.rgb,r);return new He(s,o,n,l,!1)}case"hcl":{let[s,o,n,l]=t.hcl,[u,h,c,p]=i.hcl,d,f;if(!isNaN(s)&&!isNaN(u)){let y=u-s;u>s&&y>180?y-=360:u<s&&s-u>180&&(y+=360),d=s+r*y}else isNaN(s)?isNaN(u)?d=NaN:(d=u,(n===1||n===0)&&(f=h)):(d=s,(c===1||c===0)&&(f=o));let[m,_,g,x]=Hy([d,f??$i(o,h,r),$i(n,c,r),$i(l,p,r)]);return new He(m,_,g,x,!1)}case"lab":{let[s,o,n,l]=jd(Zr(t.lab,i.lab,r));return new He(s,o,n,l,!1)}}}},He.black=new He(0,0,0,1),He.white=new He(1,1,1,1),He.transparent=new He(0,0,0,0),He.red=new He(1,0,0,1),He),Ru=class{constructor(t,i,r){t?this.sensitivity=i?"variant":"case":this.sensitivity=i?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,i){return this.collator.compare(t,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}};const ev=["bottom","center","top"];var fl=class{constructor(t,i,r,a,s,o){this.text=t,this.image=i,this.scale=r,this.fontStack=a,this.textColor=s,this.verticalAlign=o}},Pi=class Ys{constructor(t){this.sections=t}static fromString(t){return new Ys([new fl(t,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof Ys?t:Ys.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}},li=class wa{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof wa)return t;if(typeof t=="number")return new wa([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let i of t)if(typeof i!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]];break}return new wa(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,i,r){return new wa(Zr(t.values,i.values,r))}},ui=class Ta{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Ta)return t;if(typeof t=="number")return new Ta([t]);if(Array.isArray(t)){for(let i of t)if(typeof i!="number")return;return new Ta(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,i,r){return new Ta(Zr(t.values,i.values,r))}},Ft=class Sa{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Sa)return t;if(typeof t=="string"){let r=K.parse(t);return r?new Sa([r]):void 0}if(!Array.isArray(t))return;let i=[];for(let r of t){if(typeof r!="string")return;let a=K.parse(r);if(!a)return;i.push(a)}return new Sa(i)}toString(){return JSON.stringify(this.values)}static interpolate(t,i,r,a="rgb"){let s=[];if(t.values.length!=i.values.length)throw Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${i.values.length}), cannot interpolate.`);for(let o=0;o<t.values.length;o++)s.push(K.interpolate(t.values[o],i.values[o],r,a));return new Sa(s)}},we=class extends Error{constructor(e,t){super(e),this.name="RuntimeError",this.path=t}toJSON(){return this.message}};const tv=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);var Hi=class Ks{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Ks)return t;if(!(!Array.isArray(t)||t.length<1||t.length%2!=0)){for(let i=0;i<t.length;i+=2){let r=t[i],a=t[i+1];if(typeof r!="string"||!tv.has(r)||!Array.isArray(a)||a.length!==2||typeof a[0]!="number"||typeof a[1]!="number")return}return new Ks(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,i,r,a){let s=t.values,o=i.values;if(s.length!==o.length)throw new we(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${i.toString()}`,a);let n=[];for(let l=0;l<s.length;l+=2){if(s[l]!==o[l])throw new we(`Cannot interpolate values containing mismatched anchors. from[${l}]: ${s[l]}, to[${l}]: ${o[l]}`,a);n.push(s[l]);let[u,h]=s[l+1],[c,p]=o[l+1];n.push([$i(u,c,r),$i(h,p,r)])}return new Ks(n)}},oi=class Nd{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new Nd({name:t,available:!1}):null}},Xi=class Cr{constructor(t,i,r){this.from=t,this.to=i,this.transition=r}toString(){return this.from===this.to&&this.transition===1?this.from:JSON.stringify([this.from,this.to,this.transition])}static interpolate(t,i,r){return new Cr(t,i,r)}static parse(t){if(t instanceof Cr)return t;if(Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number")return new Cr(t[0],t[1],t[2]);if(typeof t=="object"&&typeof t.from=="string"&&typeof t.to=="string"&&typeof t.transition=="number")return new Cr(t.from,t.to,t.transition);if(typeof t=="string")return new Cr(t,t,1)}};function Ud(e,t,i,r){return typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof i=="number"&&i>=0&&i<=255?r===void 0||typeof r=="number"&&r>=0&&r<=1?null:`Invalid rgba value [${[e,t,i,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof r=="number"?[e,t,i,r]:[e,t,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Oa(e){if(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||e instanceof Xi||e instanceof K||e instanceof Ru||e instanceof Pi||e instanceof li||e instanceof ui||e instanceof Ft||e instanceof Hi||e instanceof oi)return!0;if(Array.isArray(e)){for(let t of e)if(!Oa(t))return!1;return!0}else if(typeof e=="object"){for(let t in e)if(!Oa(e[t]))return!1;return!0}else return!1}function Oe(e){if(e===null)return os;if(typeof e=="string")return J;if(typeof e=="boolean")return re;if(typeof e=="number")return B;if(e instanceof K)return Wt;if(e instanceof Xi)return Fo;if(e instanceof Ru)return Bo;if(e instanceof Pi)return ns;if(e instanceof li)return Oo;if(e instanceof ui)return $o;if(e instanceof Ft)return Fa;if(e instanceof Hi)return Vo;if(e instanceof oi)return ls;if(Array.isArray(e)){let t=e.length,i;for(let r of e){let a=Oe(r);if(!i)i=a;else{if(i===a)continue;i=ee;break}}return ct(i||ee,t)}else return sr}function Ca(e){let t=typeof e;return e===null?"":t==="string"||t==="number"||t==="boolean"?String(e):e instanceof K||e instanceof Xi||e instanceof Pi||e instanceof li||e instanceof ui||e instanceof Ft||e instanceof Hi||e instanceof oi?e.toString():JSON.stringify(e)}var $a=class Gd{constructor(t,i){this.type=t,this.value=i}static parse(t,i){if(t.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Oa(t[1]))return i.error("invalid value");let r=t[1],a=Oe(r),s=i.expectedType;return a.kind==="array"&&a.N===0&&s&&s.kind==="array"&&(typeof s.N!="number"||s.N===0)&&(a=s),new Gd(a,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}};const As={string:J,number:B,boolean:re,object:sr};var mi=class Zd{constructor(t,i,r){this.type=t,this.args=i,this.key=r}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let r=1,a,s=t[0];if(s==="array"){let n;if(t.length>2){let u=t[1];if(typeof u!="string"||!(u in As)||u==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);n=As[u],r++}else n=ee;let l;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return i.error('The length argument to "array" must be a positive integer literal',2);l=t[2],r++}a=ct(n,l)}else{if(!As[s])throw Error(`Types doesn't contain name = ${s}`);a=As[s]}let o=[];for(;r<t.length;r++){let n=i.parse(t[r],r,ee);if(!n)return null;o.push(n)}return new Zd(a,o,i.key)}evaluate(t){for(let i=0;i<this.args.length;i++){let r=this.args[i].evaluate(t);if(!Ba(this.type,Oe(r)))return r;if(i===this.args.length-1)throw new we(`Expected value to be of type ${Ae(this.t
1ype)}, but found ${Ae(Oe(r))} instead.`,this.key)}throw Error()}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}};const sc={"to-boolean":re,"to-color":Wt,"to-number":B,"to-string":J};var kr=class qd{constructor(t,i,r){this.type=t,this.args=i,this.key=r}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let r=t[0];if(!sc[r])throw Error(`Can't parse ${r} as it is not part of the known types`);if((r==="to-boolean"||r==="to-string")&&t.length!==2)return i.error("Expected one argument.");let a=sc[r],s=[];for(let o=1;o<t.length;o++){let n=i.parse(t[o],o,ee);if(!n)return null;s.push(n)}return new qd(a,s,i.key)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let i,r;for(let a of this.args){if(i=a.evaluate(t),r=null,i instanceof K)return i;if(typeof i=="string"){let s=t.parseColor(i);if(s)return s}else if(Array.isArray(i)&&(r=i.length<3||i.length>4?`Invalid rgba value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:Ud(i[0],i[1],i[2],i[3]),!r))return new K(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new we(r||`Could not parse color from value '${typeof i=="string"?i:JSON.stringify(i)}'`,this.key)}case"padding":{let i;for(let r of this.args){i=r.evaluate(t);let a=li.parse(i);if(a)return a}throw new we(`Could not parse padding from value '${typeof i=="string"?i:JSON.stringify(i)}'`,this.key)}case"numberArray":{let i;for(let r of this.args){i=r.evaluate(t);let a=ui.parse(i);if(a)return a}throw new we(`Could not parse numberArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`,this.key)}case"colorArray":{let i;for(let r of this.args){i=r.evaluate(t);let a=Ft.parse(i);if(a)return a}throw new we(`Could not parse colorArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`,this.key)}case"variableAnchorOffsetCollection":{let i;for(let r of this.args){i=r.evaluate(t);let a=Hi.parse(i);if(a)return a}throw new we(`Could not parse variableAnchorOffsetCollection from value '${typeof i=="string"?i:JSON.stringify(i)}'`,this.key)}case"number":{let i=null;for(let r of this.args){if(i=r.evaluate(t),i===null)return 0;let a=Number(i);if(!isNaN(a))return a}throw new we(`Could not convert ${JSON.stringify(i)} to number.`,this.key)}case"formatted":return Pi.fromString(Ca(this.args[0].evaluate(t)));case"resolvedImage":return oi.fromString(Ca(this.args[0].evaluate(t)));case"projectionDefinition":{let i=this.args[0].evaluate(t);if(Xi.parse(i))return i;throw new we(`Could not parse projectionDefinition from value '${typeof i=="string"?i:JSON.stringify(i)}'`,this.key)}default:return Ca(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}};const iv=["Unknown","Point","LineString","Polygon"];var Wd=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?iv[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let i=this._parseColorCache.get(t);return i||(i=K.parse(t),this._parseColorCache.set(t,i)),i}},Hd=class Xd{constructor(t,i,r=[],a,s=new Ny,o=[]){this.registry=t,this.path=r,this.key=r.map(n=>`[${n}]`).join(""),this.scope=s,this.errors=o,this.expectedType=a,this._isConstant=i}parse(t,i,r,a,s={}){return i?this.concat(i,r,a)._parse(t,s):this._parse(t,s)}_parse(t,i){(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number")&&(t=["literal",t]);let r=this.key;function a(s,o,n){return n==="assert"?new mi(o,[s],r):n==="coerce"?new kr(o,[s],r):s}if(Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let s=t[0];
vendor: 41,496 bytes, line 1
1if(typeof s!="string")return this.error(`Expression name must be a string, but found ${typeof s} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let o=this.registry[s];if(o){let n=o.parse(t,this);if(!n)return null;if(this.expectedType){let l=this.expectedType,u=n.type;if((l.kind==="string"||l.kind==="number"||l.kind==="boolean"||l.kind==="object"||l.kind==="array")&&u.kind==="value")n=a(n,l,i.typeAnnotation||"assert");else if(l.kind==="projectionDefinition"&&["string","array","value"].includes(u.kind)||["color","formatted","resolvedImage"].includes(l.kind)&&["value","string"].includes(u.kind)||["padding","numberArray"].includes(l.kind)&&["value","number","array"].includes(u.kind)||l.kind==="colorArray"&&["value","string","array"].includes(u.kind)||l.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(u.kind))n=a(n,l,i.typeAnnotation||"coerce");else if(this.checkSubtype(l,u))return null}if(!(n instanceof $a)&&n.type.kind!=="resolvedImage"&&this._isConstant(n)){let l=new Wd;try{n=new $a(n.type,n.evaluate(l))}catch(u){return this.error(u.message),null}}return n}return this.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0)}else return t===void 0?this.error("'undefined' value invalid. Use null instead."):typeof t=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof t} instead.`)}concat(t,i,r){let a=typeof t=="number"?this.path.concat(t):this.path,s=r?this.scope.concat(r):this.scope;return new Xd(this.registry,this._isConstant,a,i||null,s,this.errors)}error(t,...i){let r=`${this.key}${i.map(a=>`[${a}]`).join("")}`;this.errors.push(new ei(r,t))}checkSubtype(t,i){let r=Ba(t,i);return r&&this.error(r),r}},Yd=class Kd{constructor(t,i){this.type=i.type,this.bindings=[].concat(t),this.result=i}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(let i of this.bindings)t(i[1]);t(this.result)}static parse(t,i){if(t.length<4)return i.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let r=[];for(let s=1;s<t.length-1;s+=2){let o=t[s];if(typeof o!="string")return i.error(`Expected string, but found ${typeof o} instead.`,s);if(/[^a-zA-Z0-9_]/.test(o))return i.error("Variable names must contain only alphanumeric characters or '_'.",s);let n=i.parse(t[s+1],s+1);if(!n)return null;r.push([o,n])}let a=i.parse(t[t.length-1],t.length-1,i.expectedType,r);return a?new Kd(r,a):null}outputDefined(){return this.result.outputDefined()}},Jd=class Qd{constructor(t,i){this.type=i.type,this.name=t,this.boundExpression=i}static parse(t,i){if(t.length!==2||typeof t[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");let r=t[1];return i.scope.has(r)?new Qd(r,i.scope.get(r)):i.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}},rv=class ef{constructor(t,i,r,a){this.type=t,this.index=i,this.input=r,this.key=a}static parse(t,i){if(t.length!==3)return i.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let r=i.parse(t[1],1,B),a=i.parse(t[2],2,ct(i.expectedType||ee));if(!r||!a)return null;let s=a.type;return new ef(s.itemType,r,a,i.key)}evaluate(t){let i=this.index.evaluate(t),r=this.input.evaluate(t);if(i<0)throw new we(`Array index out of bounds: ${i} < 0.`,this.key);if(i>=r.length)throw new we(`Array index out of bounds: ${i} > ${r.length-1}.`,this.key);if(i!==Math.floor(i))throw new we(`Array index must be an integer, but found ${i} instead.`,this.key);return r[i]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}},av=class tf{constructor(t,i,r){this.needle=t,this.haystack=i,this.key=r,this.type=re}static parse(t,i){if(t.length!==3)return i.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let r=i.parse(t[1],1,ee),a=i.parse(t[2],2,ee);return!r||!a?null:zu(r.type,[re,J,B,os,ee])?new tf(r,a,i.key):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ae(r.type)} instead`)}evaluate(t){let i=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!or(i,["boolean","string","number","null"]))throw new we(`Expected first argument to be of type boolean, string, number or null, but found ${Ae(Oe(i))} instead.`,this.key);if(!or(r,["string","array"]))throw new we(`Expected second argument to be of type array or string, but found ${Ae(Oe(r))} instead.`,this.key);return r.indexOf(i)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}},sv=class ml{constructor(t,i,r,a){this.needle=t,this.haystack=i,this.key=r,this.fromIndex=a,this.type=B}static parse(t,i){if(t.length<=2||t.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let r=i.parse(t[1],1,ee),a=i.parse(t[2],2,ee);if(!r||!a)return null;if(!zu(r.type,[re,J,B,os,ee]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ae(r.type)} instead`);if(t.length===4){let s=i.parse(t[3],3,B);return s?new ml(r,a,i.key,s):null}else return new ml(r,a,i.key)}evaluate(t){let i=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!or(i,["boolean","string","number","null"]))throw new we(`Expected first argument to be of type boolean, string, number or null, but found ${Ae(Oe(i))} instead.`,this.key);let a;if(this.fromIndex&&(a=this.fromIndex.evaluate(t)),or(r,["string"])){let s=r.indexOf(i,a);return s===-1?-1:[...r.slice(0,s)].length}else{if(or(r,["array"]))return r.indexOf(i,a);throw new we(`Expected second argument to be of type array or string, but found ${Ae(Oe(r))} instead.`,this.key)}}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}},ov=class rf{constructor(t,i,r,a,s,o){this.inputType=t,this.type=i,this.input=r,this.cases=a,this.outputs=s,this.otherwise=o}static parse(t,i){if(t.length<5)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return i.error("Expected an even number of arguments.");let r,a;i.expectedType&&i.expectedType.kind!=="value"&&(a=i.expectedType);let s={},o=[];for(let u=2;u<t.length-1;u+=2){let h=t[u],c=t[u+1];Array.isArray(h)||(h=[h]);let p=i.concat(u);if(h.length===0)return p.error("Expected at least one branch label.");for(let f of h){if(typeof f!="number"&&typeof f!="string")return p.error("Branch labels must be numbers or strings.");if(typeof f=="number"&&Math.abs(f)>2**53-1)return p.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof f=="number"&&Math.floor(f)!==f)return p.error("Numeric branch labels must be integer values.");if(!r)r=Oe(f);else if(p.checkSubtype(r,Oe(f)))return null;if(s[String(f)]!==void 0)return p.error("Branch labels must be unique.");s[String(f)]=o.length}let d=i.parse(c,u,a);if(!d)return null;a||=d.type,o.push(d)}let n=i.parse(t[1],1,ee);if(!n)return null;let l=i.parse(t[t.length-1],t.length-1,a);return!l||n.type.kind!=="value"&&i.concat(1).checkSubtype(r,n.type)?null:new rf(r,a,n,s,o,l)}evaluate(t){let i=this.input.evaluate(t);return(Oe(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}},nv=class af{constructor(t,i,r){this.type=t,this.branches=i,this.otherwise=r}static parse(t,i){if(t.length<4)return i.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return i.error("Expected an odd number of arguments.");let r;i.expectedType&&i.expectedType.kind!=="value"&&(r=i.expectedType);let a=[];for(let o=1;o<t.length-1;o+=2){let n=i.parse(t[o],o,re);if(!n)return null;let l=i.parse(t[o+1],o+1,r);if(!l)return null;a.push([n,l]),r||=l.type}let s=i.parse(t[t.length-1],t.length-1,r);if(!s)return null;if(!r)throw Error("Can't infer output type");return new af(r,a,s)}evaluate(t){for(let[i,r]of this.branches)if(i.evaluate(t))return r.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(let[i,r]of this.branches)t(i),t(r);t(this.otherwise)}outputDefined(){return this.branches.every(([t,i])=>i.outputDefined())&&this.otherwise.outputDefined()}},lv=class _l{constructor(t,i,r,a,s){this.type=t,this.input=i,this.beginIndex=r,this.key=a,this.endIndex=s}static parse(t,i){if(t.length<=2||t.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let r=i.parse(t[1],1,ee),a=i.parse(t[2],2,B);if(!r||!a)return null;if(!zu(r.type,[ct(ee),J,ee]))return i.error(`Expected first argument to be of type array or string, but found ${Ae(r.type)} instead`);if(t.length===4){let s=i.parse(t[3],3,B);return s?new _l(r.type,r,a,i.key,s):null}else return new _l(r.type,r,a,i.key)}evaluate(t){let i=this.input.evaluate(t),r=this.beginIndex.evaluate(t),a;if(this.endIndex&&(a=this.endIndex.evaluate(t)),or(i,["string"]))return[...i].slice(r,a).join("");if(or(i,["array"]))return i.slice(r,a);throw new we(`Expected first argument to be of type array or string, but found ${Ae(Oe(i))} instead.`,this.key)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}};function jo(e,t,i){let r=e.length-1,a=0,s=r,o=0,n,l;for(;a<=s;)if(o=Math.floor((a+s)/2),n=e[o],l=e[o+1],n<=t){if(o===r||t<l)return o;a=o+1}else if(n>t)s=o-1;else throw new we("Input is not a number.",i);return 0}var ku=class sf{constructor(t,i,r,a){this.type=t,this.input=i,this.key=a,this.labels=[],this.outputs=[];for(let[s,o]of r)this.labels.push(s),this.outputs.push(o)}static parse(t,i){if(t.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");let r=i.parse(t[1],1,B);if(!r)return null;let a=[],s=null;i.expectedType&&i.expectedType.kind!=="value"&&(s=i.expectedType);for(let o=1;o<t.length;o+=2){let n=o===1?-1/0:t[o],l=t[o+1],u=o,h=o+1;if(typeof n!="number")return i.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(a.length&&a[a.length-1][0]>=n)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);let c=i.parse(l,h,s);if(!c)return null;s||=c.type,a.push([n,c])}return new sf(s,r,a,i.key)}evaluate(t){let i=this.labels,r=this.outputs;if(i.length===1)return r[0].evaluate(t);let a=this.input.evaluate(t);if(a<=i[0])return r[0].evaluate(t);let s=i.length;return a>=i[s-1]?r[s-1].evaluate(t):r[jo(i,a,this.key)].evaluate(t)}eachChild(t){t(this.input);for(let i of this.outputs)t(i)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}};function uv(e,t,i,r){let a=3*e,s=3*(i-e)-a,o=1-a-s,n=3*t,l=3*(r-t)-n,u=1-n-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let m=0;m<8;m++){let _=((o*p+s)*p+a)*p-h;if(Math.abs(_)<c)return((u*p+l)*p+n)*p;let g=(3*o*p+2*s)*p+a;if(Math.abs(g)<1e-6)break;p-=_/g}let d=0,f=1;p=h;for(let m=0;m<20;m++){let _=((o*p+s)*p+a)*p;if(Math.abs(_-h)<c)break;h>_?d=p:f=p,p=(d+f)*.5}return((u*p+l)*p+n)*p}}var Ht=class gl{constructor(t,i,r,a,s,o){this.type=t,this.operator=i,this.interpolation=r,this.input=a,this.key=o,this.labels=[],this.outputs=[];for(let[n,l]of s)this.labels.push(n),this.outputs.push(l)}static interpolationFactor(t,i,r,a){let s=0;if(t.name==="exponential")s=En(i,t.base,r,a);else if(t.name==="linear")s=En(i,1,r,a);else if(t.name==="cubic-bezier"){let o=t.controlPoints;s=uv(o[0],o[1],o[2],o[3])(En(i,1,r,a))}return s}static parse(t,i){let[r,a,s,...o]=t;if(!Array.isArray(a)||a.length===0)return i.error("Expected an interpolation type expression.",1);if(a[0]==="linear")a={name:"linear"};else if(a[0]==="exponential"){let u=a[1];if(typeof u!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:u}}else if(a[0]==="cubic-bezier"){let u=a.slice(1);if(u.length!==4||u.some(h=>typeof h!="number"||h<0||h>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:u}}else return i.error(`Unknown interpolation type ${String(a[0])}`,1,0);if(t.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(s=i.parse(s,2,B),!s)return null;let n=[],l=null;(r==="interpolate-hcl"||r==="interpolate-lab")&&i.expectedType!=Fa?l=Wt:i.expectedType&&i.expectedType.kind!=="value"&&(l=i.expectedType);for(let u=0;u<o.length;u+=2){let h=o[u],c=o[u+1],p=u+3,d=u+4;if(typeof h!="number")return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(n.length&&n[n.length-1][0]>=h)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);let f=i.parse(c,d,l);if(!f)return null;l||=f.type,n.push([h,f])}return!zi(l,B)&&!zi(l,Fo)&&!zi(l,Wt)&&!zi(l,Oo)&&!zi(l,$o)&&!zi(l,Fa)&&!zi(l,Vo)&&!zi(l,ct(B))?i.error(`Type ${Ae(l)} is not interpolatable.`):new gl(l,r,a,s,n,i.key)}evaluate(t){let i=this.labels,r=this.outputs;if(i.length===1)return r[0].evaluate(t);let a=this.input.evaluate(t);if(a<=i[0])return r[0].evaluate(t);let s=i.length;if(a>=i[s-1])return r[s-1].evaluate(t);let o=jo(i,a,this.key),n=i[o],l=i[o+1],u=gl.interpolationFactor(this.interpolation,a,n,l),h=r[o].evaluate(t),c=r[o+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return $i(h,c,u);case"color":return K.interpolate(h,c,u);case"padding":return li.interpolate(h,c,u);case"colorArray":return Ft.interpolate(h,c,u);case"numberArray":return ui.interpolate(h,c,u);case"variableAnchorOffsetCollection":return Hi.interpolate(h,c,u,this.key);case"array":return Zr(h,c,u);case"projectionDefinition":return Xi.interpolate(h,c,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return K.interpolate(h,c,u,"hcl");case"colorArray":return Ft.interpolate(h,c,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return K.interpolate(h,c,u,"lab");case"colorArray":return Ft.interpolate(h,c,u,"lab")}}}eachChild(t){t(this.input);for(let i of this.outputs)t(i)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}};function En(e,t,i,r){let a=r-i,s=e-i;return a===0?0:t===1?s/a:(t**+s-1)/(t**+a-1)}const $e={color:K.interpolate,number:$i,padding:li.interpolate,numberArray:ui.interpolate,colorArray:Ft.interpolate,variableAnchorOffsetCollection:Hi.interpolate,array:Zr};var of=class yl{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let r=null,a=i.expectedType;a&&a.kind!=="value"&&(r=a);let s=[];for(let o of t.slice(1)){let n=i.parse(o,1+s.length,r,void 0,{typeAnnotation:"omit"});if(!n)return null;r||=n.type,s.push(n)}if(!r)throw Error("No output type");return a&&s.some(o=>Ba(a,o.type))?new yl(ee,s):new yl(r,s)}evaluate(t){let i=null,r=0,a;for(let s of this.args)if(r++,i=s.evaluate(t),i&&i instanceof oi&&!i.available&&(a||=i.name,i=null,r===this.args.length&&(i=a)),i!==null)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}};function oc(e,t){return e==="=="||e==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function hv(e,t,i){return t===i}function cv(e,t,i){return t!==i}function pv(e,t,i){return t<i}function dv(e,t,i){return t>i}function fv(e,t,i){return t<=i}function mv(e,t,i){return t>=i}function nf(e,t,i,r){return r.compare(t,i)===0}function _v(e,t,i,r){return!nf(e,t,i,r)}function gv(e,t,i,r){return r.compare(t,i)<0}function yv(e,t,i,r){return r.compare(t,i)>0}function vv(e,t,i,r){return r.compare(t,i)<=0}function xv(e,t,i,r){return r.compare(t,i)>=0}function Qr(e,t,i){let r=e!=="=="&&e!=="!=";return class lf{constructor(s,o,n,l){this.lhs=s,this.rhs=o,this.key=n,this.collator=l,this.type=re,this.hasUntypedArgument=s.type.kind==="value"||o.type.kind==="value"}static parse(s,o){if(s.length!==3&&s.length!==4)return o.error("Expected two or three arguments.");let n=s[0],l=o.parse(s[1],1,ee);if(!l)return null;if(!oc(n,l.type))return o.concat(1).error(`"${n}" comparisons are not supported for type '${Ae(l.type)}'.`);let u=o.parse(s[2],2,ee);if(!u)return null;if(!oc(n,u.type))return o.concat(2).error(`"${n}" comparisons are not supported for type '${Ae(u.type)}'.`);if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return o.error(`Cannot compare types '${Ae(l.type)}' and '${Ae(u.type)}'.`);r&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new mi(u.type,[l],o.key):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new mi(l.type,[u],o.key)));let h=null;if(s.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return o.error("Cannot use collator to compare non-string types.");if(h=o.parse(s[3],3,Bo),!h)return null}return new lf(l,u,o.key,h)}evaluate(s){let o=this.lhs.evaluate(s),n=this.rhs.evaluate(s);if(r&&this.hasUntypedArgument){let l=Oe(o),u=Oe(n);if(l.kind!==u.kind||l.kind!=="string"&&l.kind!=="number")throw new we(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`,this.key)}if(this.collator&&!r&&this.hasUntypedArgument){let l=Oe(o),u=Oe(n);if(l.kind!=="string"||u.kind!=="string")return t(s,o,n)}return this.collator?i(s,o,n,this.collator.evaluate(s)):t(s,o,n)}eachChild(s){s(this.lhs),s(this.rhs),this.collator&&s(this.collator)}outputDefined(){return!0}}}const bv=Qr("==",hv,nf),wv=Qr("!=",cv,_v),Tv=Qr("<",pv,gv),Sv=Qr(">",dv,yv),Pv=Qr("<=",fv,vv),Iv=Qr(">=",mv,xv);var uf=class hf{constructor(t,i,r){this.type=Bo,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=i}static parse(t,i){if(t.length!==2)return i.error("Expected one argument.");let r=t[1];if(typeof r!="object"||Array.isArray(r))return i.error("Collator options argument must be an object.");let a=i.parse(r["case-sensitive"]!==void 0&&r["case-sensitive"],1,re);if(!a)return null;let s=i.parse(r["diacritic-sensitive"]!==void 0&&r["diacritic-sensitive"],1,re);if(!s)return null;let o=null;return r.locale&&(o=i.parse(r.locale,1,J),!o)?null:new hf(a,s,o)}evaluate(t){return new Ru(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}},Ev=class cf{constructor(t,i,r,a,s,o){this.type=J,this.number=t,this.locale=i,this.currency=r,this.unit=a,this.minFractionDigits=s,this.maxFractionDigits=o}static parse(t,i){if(t.length!==3)return i.error("Expected two arguments.");let r=i.parse(t[1],1,B);if(!r)return null;let a=t[2];if(typeof a!="object"||Array.isArray(a))return i.error("NumberFormat options argument must be an object.");let s=null;if(a.locale&&(s=i.parse(a.locale,1,J),!s))return null;let o=null;if(a.currency&&(o=i.parse(a.currency,1,J),!o))return null;let n=null;if(a.unit&&(n=i.parse(a.unit,1,J),!n))return null;if(o&&n)return i.error("NumberFormat options `currency` and `unit` are mutually exclusive");let l=null;if(a["min-fraction-digits"]&&(l=i.parse(a["min-fraction-digits"],1,B),!l))return null;let u=null;return a["max-fraction-digits"]&&(u=i.parse(a["max-fraction-digits"],1,B),!u)?null:new cf(r,s,o,n,l,u)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}},pf=class df{constructor(t){this.type=ns,this.sections=t}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let r=t[1];if(!Array.isArray(r)&&typeof r=="object")return i.error("First argument must be an image or text section.");let a=[],s=!1;for(let o=1;o<=t.length-1;++o){let n=t[o];if(s&&typeof n=="object"&&!Array.isArray(n)){s=!1;let l=null;if(n["font-scale"]&&(l=i.parse(n["font-scale"],1,B),!l))return null;let u=null;if(n["text-font"]&&(u=i.parse(n["text-font"],1,ct(J)),!u))return null;let h=null;if(n["text-color"]&&(h=i.parse(n["text-color"],1,Wt),!h))return null;let c=null;if(n["vertical-align"]){if(typeof n["vertical-align"]=="string"&&!ev.includes(n["vertical-align"]))return i.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${n["vertical-align"]}' instead.`);if(c=i.parse(n["vertical-align"],1,J),!c)return null}let p=a[a.length-1];p.scale=l,p.font=u,p.textColor=h,p.verticalAlign=c}else{let l=i.parse(t[o],1,ee);if(!l)return null;let u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");s=!0,a.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new df(a)}evaluate(t){return new Pi(this.sections.map(i=>{let r=i.content.evaluate(t);return Oe(r)===ls?new fl("",r,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(t):null):new fl(Ca(r),null,i.scale?i.scale.evaluate(t):null,i.font?i.font.evaluate(t).join(","):null,i.textColor?i.textColor.evaluate(t):null,i.verticalAlign?i.verticalAlign.evaluate(t):null)}))}eachChild(t){for(let i of this.sections)t(i.content),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor),i.verticalAlign&&t(i.verticalAlign)}outputDefined(){return!1}},Mv=class ff{constructor(t){this.type=ls,this.input=t}static parse(t,i){if(t.length!==2)return i.error("Expected two arguments.");let r=i.parse(t[1],1,J);return r?new ff(r):i.error("No image name provided.")}evaluate(t){let i=this.input.evaluate(t),r=oi.fromString(i);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(i)>-1),r}eachChild(t){t(this.input)}outputDefined(){return!1}},Av=class mf{constructor(t,i){this.input=t,this.key=i,this.type=B}static parse(t,i){if(t.length!==2)return i.error(`Expected 1 argument, but found ${t.length-1} instead.`);let r=i.parse(t[1],1);return r?r.type.kind!=="array"&&r.type.kind!=="string"&&r.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${Ae(r.type)} instead.`):new mf(r,i.key):null}evaluate(t){let i=this.input.evaluate(t);if(typeof i=="string")return[...i].length;if(Array.isArray(i))return i.length;throw new we(`Expected value to be of type string or array, but found ${Ae(Oe(i))} instead.`,this.key)}eachChild(t){t(this.input)}outputDefined(){return!1}};const ri=8192;function Cv(e,t){let i=Dv(e[0]),r=Rv(e[1]),a=2**t.z;return[Math.round(i*a*ri),Math.round(r*a*ri)]}function Lu(e,t){let i=2**t.z,r=(e[0]/ri+t.x)/i,a=(e[1]/ri+t.y)/i;return[zv(r),kv(a)]}function Dv(e){return(180+e)/360}function zv(e){return e*360-180}function Rv(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function kv(e){return 360/Math.PI*Math.atan(Math.exp((180-e*360)*Math.PI/180))-90}function us(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Va(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Lv(e,t,i){return t[1]>e[1]!=i[1]>e[1]&&e[0]<(i[0]-t[0])*(e[1]-t[1])/(i[1]-t[1])+t[0]}function Fv(e,t,i){let r=e[0]-t[0],a=e[1]-t[1],s=e[0]-i[0],o=e[1]-i[1];return r*o-s*a===0&&r*s<=0&&a*o<=0}function No(e,t,i,r){let a=[t[0]-e[0],t[1]-e[1]];return Vv([r[0]-i[0],r[1]-i[1]],a)!==0&&!!(nc(e,t,i,r)&&nc(i,r,e,t))}function Bv(e,t,i){for(let r of i)for(let a=0;a<r.length-1;++a)if(No(e,t,r[a],r[a+1]))return!0;return!1}function ea(e,t,i=!1){let r=!1;for(let a of t)for(let s=0;s<a.length-1;s++){if(Fv(e,a[s],a[s+1]))return i;Lv(e,a[s],a[s+1])&&(r=!r)}return r}function Ov(e,t){for(let i of t)if(ea(e,i))return!0;return!1}function _f(e,t){for(let i of e)if(!ea(i,t))return!1;for(let i=0;i<e.length-1;++i)if(Bv(e[i],e[i+1],t))return!1;return!0}function $v(e,t){for(let i of t)if(_f(e,i))return!0;return!1}function Vv(e,t){return e[0]*t[1]-e[1]*t[0]}function nc(e,t,i,r){let a=e[0]-i[0],s=e[1]-i[1],o=t[0]-i[0],n=t[1]-i[1],l=r[0]-i[0],u=r[1]-i[1],h=a*u-l*s,c=o*u-l*n;return h>0&&c<0||h<0&&c>0}function Fu(e,t,i){let r=[];for(let a=0;a<e.length;a++){let s=[];for(let o=0;o<e[a].length;o++){let n=Cv(e[a][o],i);us(t,n),s.push(n)}r.push(s)}return r}function gf(e,t,i){let r=[];for(let a=0;a<e.length;a++){let s=Fu(e[a],t,i);r.push(s)}return r}function yf(e,t,i,r){if(e[0]<i[0]||e[0]>i[2]){let a=r*.5,s=e[0]-i[0]>a?-r:i[0]-e[0]>a?r:0;s===0&&(s=e[0]-i[2]>a?-r:i[2]-e[0]>a?r:0),e[0]+=s}us(t,e)}function jv(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function lc(e,t,i,r){let a=2**r.z*ri,s=[r.x*ri,r.y*ri],o=[];for(let n of e)for(let l of n){let u=[l.x+s[0],l.y+s[1]];yf(u,t,i,a),o.push(u)}return o}function uc(e,t,i,r){let a=2**r.z*ri,s=[r.x*ri,r.y*ri],o=[];for(let n of e){let l=[];for(let u of n){let h=[u.x+s[0],u.y+s[1]];us(t,h),l.push(h)}o.push(l)}if(t[2]-t[0]<=a/2){jv(t);for(let n of o)for(let l of n)yf(l,t,i,a)}return o}function Nv(e,t){let i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],a=e.canonicalID();if(t.type==="Polygon"){let s=Fu(t.coordinates,r,a),o=lc(e.geometry(),i,r,a);if(!Va(i,r))return!1;for(let n of o)if(!ea(n,s))return!1}if(t.type==="MultiPolygon"){let s=gf(t.coordinates,r,a),o=lc(e.geometry(),i,r,a);if(!Va(i,r))return!1;for(let n of o)if(!Ov(n,s))return!1}return!0}function Uv(e,t){let i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],a=e.canonicalID();if(t.type==="Polygon"){let s=Fu(t.coordinates,r,a),o=uc(e.geometry(),i,r,a);if(!Va(i,r))return!1;for(let n of o)if(!_f(n,s))return!1}if(t.type==="MultiPolygon"){let s=gf(t.coordinates,r,a),o=uc(e.geometry(),i,r,a);if(!Va(i,r))return!1;for(let n of o)if(!$v(n,s))return!1}return!0}var Bu=class Js{constructor(t,i){this.type=re,this.geojson=t,this.geometries=i}static parse(t,i){if(t.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Oa(t[1])){let r=t[1];if(r.type==="FeatureCollection"){let a=[];for(let s of r.features){let{type:o,coordinates:n}=s.geometry;o==="Polygon"&&a.push(n),o==="MultiPolygon"&&a.push(...n)}if(a.length)return new Js(r,{type:"MultiPolygon",coordinates:a})}else if(r.type==="Feature"){let a=r.geometry.type;if(a==="Polygon"||a==="MultiPolygon")return new Js(r,r.geometry)}else if(r.type==="Polygon"||r.type==="MultiPolygon")return new Js(r,r)}return i.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return Nv(t,this.geometries);if(t.geometryType()==="LineString")return Uv(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},vf=class{constructor(t=[],i=(r,a)=>r<a?-1:+(r>a)){if(this.data=t,this.length=this.data.length,this.compare=i,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],i=this.data.pop();return--this.length>0&&(this.data[0]=i,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:i,compare:r}=this,a=i[t];for(;t>0;){let s=t-1>>1,o=i[s];if(r(a,o)>=0)break;i[t]=o,t=s}i[t]=a}_down(t){let{data:i,compare:r}=this,a=this.length>>1,s=i[t];for(;t<a;){let o=(t<<1)+1,n=o+1;if(n<this.length&&r(i[n],i[o])<0&&(o=n),r(i[o],s)>=0)break;i[t]=i[o],t=o}i[t]=s}};function xf(e,t,i=0,r=e.length-1,a=Gv){for(;r>i;){if(r-i>600){let l=r-i+1,u=t-i+1,h=Math.log(l),c=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*c*(l-c)/l)*(u-l/2<0?-1:1);xf(e,t,Math.max(i,Math.floor(t-u*c/l+p)),Math.min(r,Math.floor(t+(l-u)*c/l+p)),a)}let s=e[t],o=i,n=r;for(la(e,i,t),a(e[r],s)>0&&la(e,i,r);o<n;){for(la(e,o,n),o++,n--;a(e[o],s)<0;)o++;for(;a(e[n],s)>0;)n--}a(e[i],s)===0?la(e,i,n):(n++,la(e,n,r)),n<=t&&(i=n+1),t<=n&&(r=n-1)}}function la(e,t,i){let r=e[t];e[t]=e[i],e[i]=r}function Gv(e,t){return e<t?-1:+(e>t)}function Ou(e,t){if(e.length<=1)return[e];let i=[],r,a;for(let s of e){let o=qv(s);o!==0&&(s.area=Math.abs(o),a===void 0&&(a=o<0),a===o<0?(r&&i.push(r),r=[s]):r.push(s))}if(r&&i.push(r),t>1)for(let s=0;s<i.length;s++)i[s].length<=t||(xf(i[s],t,1,i[s].length-1,Zv),i[s]=i[s].slice(0,t));return i}function Zv(e,t){return t.area-e.area}function qv(e){let t=0;for(let i=0,r=e.length,a=r-1,s,o;i<r;a=i++)s=e[i],o=e[a],t+=(o.x-s.x)*(s.y+o.y);return t}const hc=1/298.257223563,cc=hc*(2-hc),pc=Math.PI/180;var $u=class{constructor(t){let i=pc*6378.137*1e3,r=Math.cos(t*pc),a=1/(1-cc*(1-r*r)),s=Math.sqrt(a);this.kx=i*s*r,this.ky=i*s*a*(1-cc)}distance(t,i){let r=this.wrap(t[0]-i[0])*this.kx,a=(t[1]-i[1])*this.ky;return Math.sqrt(r*r+a*a)}pointOnLine(t,i){let r=1/0,a,s,o,n;for(let l=0;l<t.length-1;l++){let u=t[l][0],h=t[l][1],c=this.wrap(t[l+1][0]-u)*this.kx,p=(t[l+1][1]-h)*this.ky,d=0;(c!==0||p!==0)&&(d=(this.wrap(i[0]-u)*this.kx*c+(i[1]-h)*this.ky*p)/(c*c+p*p),d>1?(u=t[l+1][0],h=t[l+1][1]):d>0&&(u+=c/this.kx*d,h+=p/this.ky*d)),c=this.wrap(i[0]-u)*this.kx,p=(i[1]-h)*this.ky;let f=c*c+p*p;f<r&&(r=f,a=u,s=h,o=l,n=d)}return{point:[a,s],index:o,t:Math.max(0,Math.min(1,n))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}};function bf(e,t){return t[0]-e[0]}function uo(e){return e[1]-e[0]+1}function Ii(e,t){return e[1]>=e[0]&&e[1]<t}function vl(e,t){if(e[0]>e[1])return[null,null];let i=uo(e);if(t){if(i===2)return[e,null];let a=Math.floor(i/2);return[[e[0],e[0]+a],[e[0]+a,e[1]]]}if(i===1)return[e,null];let r=Math.floor(i/2)-1;return[[e[0],e[0]+r],[e[0]+r+1,e[1]]]}function xl(e,t){if(!Ii(t,e.length))return[1/0,1/0,-1/0,-1/0];let i=[1/0,1/0,-1/0,-1/0];for(let r=t[0];r<=t[1];++r)us(i,e[r]);return i}function bl(e){let t=[1/0,1/0,-1/0,-1/0];for(let i of e)for(let r of i)us(t,r);return t}function dc(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function Vu(e,t,i){if(!dc(e)||!dc(t))return NaN;let r=0,a=0;return e[2]<t[0]&&(r=t[0]-e[2]),e[0]>t[2]&&(r=e[0]-t[2]),e[1]>t[3]&&(a=e[1]-t[3]),e[3]<t[1]&&(a=t[1]-e[3]),i.distance([0,0],[r,a])}function ir(e,t,i){let r=i.pointOnLine(t,e);return i.distance(e,r.point)}function ju(e,t,i,r,a){let s=Math.min(ir(e,[i,r],a),ir(t,[i,r],a)),o=Math.min(ir(i,[e,t],a),ir(r,[e,t],a));return Math.min(s,o)}function Wv(e,t,i,r,a){if(!(Ii(t,e.length)&&Ii(r,i.length)))return 1/0;let s=1/0;for(let o=t[0];o<t[1];++o){let n=e[o],l=e[o+1];for(let u=r[0];u<r[1];++u){let h=i[u],c=i[u+1];if(No(n,l,h,c))return 0;s=Math.min(s,ju(n,l,h,c,a))}}return s}function Hv(e,t,i,r,a){if(!(Ii(t,e.length)&&Ii(r,i.length)))return NaN;let s=1/0;for(let o=t[0];o<=t[1];++o)for(let n=r[0];n<=r[1];++n)if(s=Math.min(s,a.distance(e[o],i[n])),s===0)return s;return s}function Xv(e,t,i){if(ea(e,t,!0))return 0;let r=1/0;for(let a of t){let s=a[0],o=a[a.length-1];if(s!==o&&(r=Math.min(r,ir(e,[o,s],i)),r===0))return r;let n=i.pointOnLine(a,e);if(r=Math.min(r,i.distance(e,n.point)),r===0)return r}return r}function Yv(e,t,i,r){if(!Ii(t,e.length))return NaN;for(let s=t[0];s<=t[1];++s)if(ea(e[s],i,!0))return 0;let a=1/0;for(let s=t[0];s<t[1];++s){let o=e[s],n=e[s+1];for(let l of i)for(let u=0,h=l.length,c=h-1;u<h;c=u++){let p=l[c],d=l[u];if(No(o,n,p,d))return 0;a=Math.min(a,ju(o,n,p,d,r))}}return a}function fc(e,t){for(let i of e)for(let r of i)if(ea(r,t,!0))return!0;return!1}function Kv(e,t,i,r=1/0){let a=bl(e),s=bl(t);if(r!==1/0&&Vu(a,s,i)>=r)return r;if(Va(a,s)){if(fc(e,t))return 0}else if(fc(t,e))return 0;let o=1/0;for(let n of e)for(let l=0,u=n.length,h=u-1;l<u;h=l++){let c=n[h],p=n[l];for(let d of t)for(let f=0,m=d.length,_=m-1;f<m;_=f++){let g=d[_],x=d[f];if(No(c,p,g,x))return 0;o=Math.min(o,ju(c,p,g,x,i))}}return o}function mc(e,t,i,r,a,s){if(!s)return;let o=Vu(xl(r,s),a,i);o<t&&e.push([o,s,[0,0]])}function Cs(e,t,i,r,a,s,o){if(!s||!o)return;let n=Vu(xl(r,s),xl(a,o),i);n<t&&e.push([n,s,o])}function ho(e,t,i,r,a=1/0){let s=Math.min(r.distance(e[0],i[0][0]),a);if(s===0)return s;let o=new vf([[0,[0,e.length-1],[0,0]]],bf),n=bl(i);for(;o.length>0;){let l=o.pop();if(l[0]>=s)continue;let u=l[1],h=t?50:100;if(uo(u)<=h){if(!Ii(u,e.length))return NaN;if(t){let c=Yv(e,u,i,r);if(isNaN(c)||c===0)return c;s=Math.min(s,c)}else for(let c=u[0];c<=u[1];++c){let p=Xv(e[c],i,r);if(s=Math.min(s,p),s===0)return 0}}else{let c=vl(u,t);mc(o,s,r,e,n,c[0]),mc(o,s,r,e,n,c[1])}}return s}function co(e,t,i,r,a,s=1/0){let o=Math.min(s,a.distance(e[0],i[0]));if(o===0)return o;let n=new vf([[0,[0,e.length-1],[0,i.length-1]]],bf);for(;n.length>0;){let l=n.pop();if(l[0]>=o)continue;let u=l[1],h=l[2],c=t?50:100,p=r?50:100;if(uo(u)<=c&&uo(h)<=p){if(!Ii(u,e.length)&&Ii(h,i.length))return NaN;let d;if(t&&r)d=Wv(e,u,i,h,a),o=Math.min(o,d);else if(t&&!r){let f=e.slice(u[0],u[1]+1);for(let m=h[0];m<=h[1];++m)if(d=ir(i[m],f,a),o=Math.min(o,d),o===0)return o}else if(!t&&r){let f=i.slice(h[0],h[1]+1);for(let m=u[0];m<=u[1];++m)if(d=ir(e[m],f,a),o=Math.min(o,d),o===0)return o}else d=Hv(e,u,i,h,a),o=Math.min(o,d)}else{let d=vl(u,t),f=vl(h,r);Cs(n,o,a,e,i,d[0],f[0]),Cs(n,o,a,e,i,d[0],f[1]),Cs(n,o,a,e,i,d[1],f[0]),Cs(n,o,a,e,i,d[1],f[1])}}return o}function Jv(e,t){let i=e.geometry(),r=i.flat().map(o=>Lu([o.x,o.y],e.canonical));if(i.length===0)return NaN;let a=new $u(r[0][1]),s=1/0;for(let o of t){switch(o.type){case"Point":s=Math.min(s,co(r,!1,[o.coordinates],!1,a,s));break;case"LineString":s=Math.min(s,co(r,!1,o.coordinates,!0,a,s));break;case"Polygon":s=Math.min(s,ho(r,!1,o.coordinates,a,s));break}if(s===0)return s}return s}function Qv(e,t){let i=e.geometry(),r=i.flat().map(o=>Lu([o.x,o.y],e.canonical));if(i.length===0)return NaN;let a=new $u(r[0][1]),s=1/0;for(let o of t){switch(o.type){case"Point":s=Math.min(s,co(r,!0,[o.coordinates],!1,a,s));break;case"LineString":s=Math.min(s,co(r,!0,o.coordinates,!0,a,s));break;case"Polygon":s=Math.min(s,ho(r,!0,o.coordinates,a,s));break}if(s===0)return s}return s}function e0(e,t){let i=e.geometry();if(i.length===0||i[0].length===0)return NaN;let r=Ou(i,0).map(o=>o.map(n=>n.map(l=>Lu([l.x,l.y],e.canonical)))),a=new $u(r[0][0][0][1]),s=1/0;for(let o of t)for(let n of r){switch(o.type){case"Point":s=Math.min(s,ho([o.coordinates],!1,n,a,s));break;case"LineString":s=Math.min(s,ho(o.coordinates,!0,n,a,s));break;case"Polygon":s=Math.min(s,Kv(n,o.coordinates,a,s));break}if(s===0)return s}return s}function Mn(e){return e.type==="MultiPolygon"?e.coordinates.map(t=>({type:"Polygon",coordinates:t})):e.type==="MultiLineString"?e.coordinates.map(t=>({type:"LineString",coordinates:t})):e.type==="MultiPoint"?e.coordinates.map(t=>({type:"Point",coordinates:t})):[e]}var Nu=class Qs{constructor(t,i){this.type=B,this.geojson=t,this.geometries=i}static parse(t,i){if(t.length!==2)return i.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Oa(t[1])){let r=t[1];if(r.type==="FeatureCollection")return new Qs(r,r.features.map(a=>Mn(a.geometry)).flat());if(r.type==="Feature")return new Qs(r,Mn(r.geometry));if("type"in r&&"coordinates"in r)return new Qs(r,Mn(r))}return i.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return Jv(t,this.geometries);if(t.geometryType()==="LineString")return Qv(t,this.geometries);if(t.geometryType()==="Polygon")return e0(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},Uu=class wf{constructor(t){this.key=t,this.type=ee}static parse(t,i){if(t.length!==2)return i.error(`Expected 1 argument, but found ${t.length-1} instead.`);let r=t[1];return r==null?i.error("Global state property must be defined."):typeof r=="string"?new wf(r):i.error(`Global state property must be string, but found ${typeof t[1]} instead.`)}evaluate(t){let i=t.globals?.globalState;return!i||Object.keys(i).length===0?null:Aa(i,this.key)??null}eachChild(){}outputDefined(){return!1}};const Fr={"==":bv,"!=":wv,">":Sv,"<":Tv,">=":Iv,"<=":Pv,array:mi,at:rv,boolean:mi,case:nv,coalesce:of,collator:uf,format:pf,image:Mv,in:av,"index-of":sv,interpolate:Ht,"interpolate-hcl":Ht,"interpolate-lab":Ht,length:Av,let:Yd,literal:$a,match:ov,number:mi,"number-format":Ev,object:mi,slice:lv,step:ku,string:mi,"to-boolean":kr,"to-color":kr,"to-number":kr,"to-string":kr,var:Jd,within:Bu,distance:Nu,"global-state":Uu};var fr=class Pa{constructor(t,i,r,a,s){this.name=t,this.type=i,this._evaluate=r,this.args=a,this.key=s}evaluate(t){return this._evaluate(t,this.args,this.key)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,i){let r=t[0],a=Pa.definitions[r];if(!a)return i.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);let s=Array.isArray(a)?a[0]:a.type,o=Array.isArray(a)?[[a[1],a[2]]]:a.overloads,n=o.filter(([u])=>!Array.isArray(u)||u.length===t.length-1),l=null;for(let[u,h]of n){l=new Hd(i.registry,po,i.path,null,i.scope);let c=[],p=!1;for(let d=1;d<t.length;d++){let f=t[d],m=Array.isArray(u)?u[d-1]:u.type,_=l.parse(f,1+c.length,m);if(!_){p=!0;break}c.push(_)}if(!p){if(Array.isArray(u)&&u.length!==c.length){l.error(`Expected ${u.length} arguments, but found ${c.length} instead.`);continue}for(let d=0;d<c.length;d++){let f=Array.isArray(u)?u[d]:u.type,m=c[d];l.concat(d+1).checkSubtype(f,m.type)}if(l.errors.length===0)return new Pa(r,s,h,c,i.key)}}if(n.length===1)i.errors.push(...l.errors);else{let u=(n.length?n:o).map(([c])=>i0(c)).join(" | "),h=[];for(let c=1;c<t.length;c++){let p=i.parse(t[c],1+h.length);if(!p)return null;h.push(Ae(p.type))}i.error(`Expected arguments of type ${u}, but found (${h.join(", ")}) instead.`)}return null}static register(t,i){Pa.definitions=i;for(let r in i)t[r]=Pa}};function _c(e,[t,i,r,a],s){t=t.evaluate(e),i=i.evaluate(e),r=r.evaluate(e);let o=a?a.evaluate(e):1,n=Ud(t,i,r,o);if(n)throw new we(n,s);return new K(t/255,i/255,r/255,o,!1)}function gc(e,t){return e in t&&t[e]!==void 0}function An(e,t){let i=t[e];return i===void 0?null:i}function t0(e,t,i,r){for(;i<=r;){let a=i+r>>1;if(t[a]===e)return!0;t[a]>e?r=a-1:i=a+1}return!1}function Yi(e){return{type:e}}fr.register(Fr,{error:[Uy,[J],(e,[t],i)=>{throw new we(t.evaluate(e),i)}],typeof:[J,[ee],(e,[t])=>Ae(Oe(t.evaluate(e)))],"to-rgba":[ct(B,4),[Wt],(e,[t])=>{let[i,r,a,s]=t.evaluate(e).rgb;return[i*255,r*255,a*255,s]}],rgb:[Wt,[B,B,B],_c],rgba:[Wt,[B,B,B,B],_c],has:{type:re,overloads:[[[J],(e,[t])=>gc(t.evaluate(e),e.properties())],[[J,sr],(e,[t,i])=>gc(t.evaluate(e),i.evaluate(e))]]},get:{type:ee,overloads:[[[J],(e,[t])=>An(t.evaluate(e),e.properties())],[[J,sr],(e,[t,i])=>An(t.evaluate(e),i.evaluate(e))]]},"feature-state":[ee,[J],(e,[t])=>An(t.evaluate(e),e.featureState||{})],properties:[sr,[],e=>e.properties()],"geometry-type":[J,[],e=>e.geometryType()],id:[ee,[],e=>e.id()],zoom:[B,[],e=>e.globals.zoom],"heatmap-density":[B,[],e=>e.globals.heatmapDensity||0],elevation:[B,[],e=>e.globals.elevation||0],"line-progress":[B,[],e=>e.globals.lineProgress||0],accumulated:[ee,[],e=>e.globals.accumulated===void 0?null:e.globals.accumulated],"+":[B,Yi(B),(e,t)=>{let i=0;for(let r of t)i+=r.evaluate(e);return i}],"*":[B,Yi(B),(e,t)=>{let i=1;for(let r of t)i*=r.evaluate(e);return i}],"-":{type:B,overloads:[[[B,B],(e,[t,i])=>t.evaluate(e)-i.evaluate(e)],[[B],(e,[t])=>-t.evaluate(e)]]},"/":[B,[B,B],(e,[t,i])=>t.evaluate(e)/i.evaluate(e)],"%":[B,[B,B],(e,[t,i])=>t.evaluate(e)%i.evaluate(e)],ln2:[B,[],()=>Math.LN2],pi:[B,[],()=>Math.PI],e:[B,[],()=>Math.E],"^":[B,[B,B],(e,[t,i])=>t.evaluate(e)**+i.evaluate(e)],sqrt:[B,[B],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[B,[B],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[B,[B],(e,[t])=>Math.log(t.evaluate(e))],log2:[B,[B],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[B,[B],(e,[t])=>Math.sin(t.evaluate(e))],cos:[B,[B],(e,[t])=>Math.cos(t.evaluate(e))],tan:[B,[B],(e,[t])=>Math.tan(t.evaluate(e))],asin:[B,[B],(e,[t])=>Math.asin(t.evaluate(e))],acos:[B,[B],(e,[t])=>Math.acos(t.evaluate(e))],atan:[B,[B],(e,[t])=>Math.atan(t.evaluate(e))],min:[B,Yi(B),(e,t)=>Math.min(...t.map(i=>i.evaluate(e)))],max:[B,Yi(B),(e,t)=>Math.max(...t.map(i=>i.evaluate(e)))],abs:[B,[B],(e,[t])=>Math.abs(t.evaluate(e))],round:[B,[B],(e,[t])=>{let i=t.evaluate(e);return i<0?-Math.round(-i):Math.round(i)}],floor:[B,[B],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[B,[B],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[re,[J,ee],(e,[t,i])=>e.properties()[t.value]===i.value],"filter-id-==":[re,[ee],(e,[t])=>e.id()===t.value],"filter-type-==":[re,[J],(e,[t])=>e.geometryType()===t.value],"filter-<":[re,[J,ee],(e,[t,i])=>{let r=e.properties()[t.value],a=i.value;return typeof r==typeof a&&r<a}],"filter-id-<":[re,[ee],(e,[t])=>{let i=e.id(),r=t.value;return typeof i==typeof r&&i<r}],"filter->":[re,[J,ee],(e,[t,i])=>{let r=e.properties()[t.value],a=i.value;return typeof r==typeof a&&r>a}],"filter-id->":[re,[ee],(e,[t])=>{let i=e.id(),r=t.value;return typeof i==typeof r&&i>r}
vendor: 4,981 bytes, line 1
1],"filter-<=":[re,[J,ee],(e,[t,i])=>{let r=e.properties()[t.value],a=i.value;return typeof r==typeof a&&r<=a}],"filter-id-<=":[re,[ee],(e,[t])=>{let i=e.id(),r=t.value;return typeof i==typeof r&&i<=r}],"filter->=":[re,[J,ee],(e,[t,i])=>{let r=e.properties()[t.value],a=i.value;return typeof r==typeof a&&r>=a}],"filter-id->=":[re,[ee],(e,[t])=>{let i=e.id(),r=t.value;return typeof i==typeof r&&i>=r}],"filter-has":[re,[ee],(e,[t])=>{let i=t.value,r=e.properties();return i in r&&r[i]!==void 0}],"filter-has-id":[re,[],e=>e.id()!==null&&e.id()!==void 0],"filter-type-in":[re,[ct(J)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[re,[ct(ee)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[re,[J,ct(ee)],(e,[t,i])=>i.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[re,[J,ct(ee)],(e,[t,i])=>t0(e.properties()[t.value],i.value,0,i.value.length-1)],all:{type:re,overloads:[[[re,re],(e,[t,i])=>t.evaluate(e)&&i.evaluate(e)],[Yi(re),(e,t)=>{for(let i of t)if(!i.evaluate(e))return!1;return!0}]]},any:{type:re,overloads:[[[re,re],(e,[t,i])=>t.evaluate(e)||i.evaluate(e)],[Yi(re),(e,t)=>{for(let i of t)if(i.evaluate(e))return!0;return!1}]]},"!":[re,[re],(e,[t])=>!t.evaluate(e)],"is-supported-script":[re,[J],(e,[t])=>{let i=e.globals&&e.globals.isSupportedScript;return!i||i(t.evaluate(e))}],upcase:[J,[J],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[J,[J],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[J,Yi(ee),(e,t)=>t.map(i=>Ca(i.evaluate(e))).join("")],split:[ct(J),[J,J],(e,[t,i])=>t.evaluate(e).split(i.evaluate(e))],join:[J,[ct(J),J],(e,[t,i])=>t.evaluate(e).join(i.evaluate(e))],"resolved-locale":[J,[Bo],(e,[t])=>t.evaluate(e).resolvedLocale()]});function i0(e){return Array.isArray(e)?`(${e.map(Ae).join(", ")})`:`(${Ae(e.type)}...)`}function po(e){if(e instanceof Jd)return po(e.boundExpression);if(e instanceof fr&&e.name==="error"||e instanceof uf||e instanceof Bu||e instanceof Nu||e instanceof Uu)return!1;let t=e instanceof kr||e instanceof mi,i=!0;return e.eachChild(r=>{t?i&&=po(r):i&&=r instanceof $a}),i?Uo(e)&&Go(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function Uo(e){if(e instanceof fr&&(e.name==="get"&&e.args.length===1||e.name==="feature-state"||e.name==="has"&&e.args.length===1||e.name==="properties"||e.name==="geometry-type"||e.name==="id"||/^filter-/.test(e.name))||e instanceof Bu||e instanceof Nu)return!1;let t=!0;return e.eachChild(i=>{t&&!Uo(i)&&(t=!1)}),t}function ja(e){if(e instanceof fr&&e.name==="feature-state")return!1;let t=!0;return e.eachChild(i=>{t&&!ja(i)&&(t=!1)}),t}function Go(e,t){if(e instanceof fr&&t.indexOf(e.name)>=0)return!1;let i=!0;return e.eachChild(r=>{i&&!Go(r,t)&&(i=!1)}),i}function wl(e){return{result:"success",value:e}}function Dr(e){return{result:"error",value:e}}function qr(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function Tf(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Gu(e){return!!e.expression&&e.expression.interpolated}function Na(e,...t){for(let i of t)for(let r in i)e[r]=i[r];return e}function ae(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":e===null?"null":typeof e}function Zo(e){return typeof e=="object"&&!!e&&!Array.isArray(e)&&Oe(e)===sr}function r0(e){return e}function a0(e){switch(e.type){case"color":return K.parse;case"padding":return li.parse;case"numberArray":return ui.parse;case"colorArray":return Ft.parse;default:return null}}function s0(e){switch(e){case"exponential":return Pf;case"interval":return n0;case"categorical":return o0;case"identity":return l0;default:throw Error(`Unknown function type "${e}"`)}}function Sf(e,t){let i=e.stops&&typeof e.stops[0][0]=="object",r=i||e.property!==void 0,a=i||!r,s=e.type||(Gu(t)?"exponential":"interval"),o=a0(t);if(o&&(e=Na({},e),e.stops&&=e.stops.map(h=>[h[0],o(h[1])]),e.default?e.default=o(e.default):e.default=o(t.default)),e.colorSpace&&!Qy(e.colorSpace))throw Error(`Unknown color space: "${e.colorSpace}"`);let n=s0(s),l,u;if(s==="categorical"){l=Object.create(null);for(let h of e.stops)l[h[0]]=h[1];u=typeof e.stops[0][0]}if(i){let h={},c=[];for(let f=0;f<e.stops.length;f++){let m=e.stops[f],_=m[0].zoom;h[_]===void 0&&(h[_]={zoom:_,type:e.type,property:e.property,default:e.default,stops:[]},c.push(_)),h[_].stops.push([m[0].value,m[1]])}let p=[];for(let f of c)p.push([h[f].zoom,Sf(h[f],t)]);let d={name:"linear"};return{kind:"composite",interpolationType:d,interpolationFactor:Ht.interpolationFactor.bind(void 0,d),zoomStops:p.map(f=>f[0]),evaluate({zoom:f},m){return Pf({stops:p,base:e.base},t,f).evaluate(f,m)}}}else if(a){let h=s==="exponential"?{name:"exponential",base:e.base===void 0?1:e.base}:null;return{kind:"camera",interpolationType:h,interpolationFactor:Ht.interpolationFactor.bind(void 0,h),zoomStops:e.stops.map(c=>c[0]),evaluate:({zoom:c})=>n(e,t,c,l,u)}}
vendor: 8,871 bytes, line 1
1else return{kind:"source",evaluate(h,c){let p=c&&c.properties?c.properties[e.property]:void 0;return p===void 0?hs(e.default,t.default):n(e,t,p,l,u)}}}function hs(e,t,i){if(e!==void 0)return e;if(t!==void 0)return t;if(i!==void 0)return i}function o0(e,t,i,r,a){return hs(typeof i===a?r[i]:void 0,e.default,t.default)}function n0(e,t,i){if(ae(i)!=="number")return hs(e.default,t.default);let r=e.stops.length;if(r===1||i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[r-1][0])return e.stops[r-1][1];let a=jo(e.stops.map(s=>s[0]),i,"");return e.stops[a][1]}function Pf(e,t,i){let r=e.base===void 0?1:e.base;if(ae(i)!=="number")return hs(e.default,t.default);let a=e.stops.length;if(a===1||i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[a-1][0])return e.stops[a-1][1];let s=jo(e.stops.map(h=>h[0]),i,""),o=u0(i,r,e.stops[s][0],e.stops[s+1][0]),n=e.stops[s][1],l=e.stops[s+1][1],u=$e[t.type]||r0;return typeof n.evaluate=="function"?{evaluate(...h){let c=n.evaluate.apply(void 0,h),p=l.evaluate.apply(void 0,h);if(c!==void 0&&p!==void 0)return u(c,p,o,e.colorSpace)}}:u(n,l,o,e.colorSpace)}function l0(e,t,i){switch(t.type){case"color":i=K.parse(i);break;case"formatted":i=Pi.fromString(i.toString());break;case"resolvedImage":i=oi.fromString(i.toString());break;case"padding":i=li.parse(i);break;case"colorArray":i=Ft.parse(i);break;case"numberArray":i=ui.parse(i);break;default:ae(i)!==t.type&&(t.type!=="enum"||!t.values[i])&&(i=void 0)}return hs(i,e.default,t.default)}function u0(e,t,i,r){let a=r-i,s=e-i;return a===0?0:t===1?s/a:(t**+s-1)/(t**+a-1)}var Zu=class{constructor(t,i,r,a){this.expression=t,this._warningHistory={},this._evaluator=new Wd,this._defaultValue=r?Df(r):null,this._enumValues=r&&r.type==="enum"?r.values:null,this._globalState=a,this._rootKey=i}evaluateWithoutErrorHandling(t,i,r,a,s,o){return this._globalState&&(t=Wr(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=i,this._evaluator.featureState=r,this._evaluator.canonical=a,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(t,i,r,a,s,o){this._globalState&&(t=Wr(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=i||null,this._evaluator.featureState=r||null,this._evaluator.canonical=a,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=o||null;try{let n=this.expression.evaluate(this._evaluator);if(n==null||typeof n=="number"&&n!==n)return this._defaultValue;if(this._enumValues&&!(n in this._enumValues))throw new we(`Expected value to be one of ${Object.keys(this._enumValues).map(l=>JSON.stringify(l)).join(", ")}, but found ${JSON.stringify(n)} instead.`,"");return n}catch(n){let l=n instanceof we?n.path:"",u=`${l}|${n.message}`;return this._warningHistory[u]||(this._warningHistory[u]=!0,typeof console<"u"&&console.warn(If(this._rootKey,l,n.message,this._defaultValue))),this._defaultValue}}};function If(e,t,i,r){return`${e}${t}: ${i}${r==null?"":` Falling back to ${String(r)}.`}`}function Ef(e){if(!e)throw Error('rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".')}function qo(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in Fr}function Wo(e,t,i,r){Ef(t);let a=new Hd(Fr,po,[],i?p0(i):void 0),s=a.parse(e,void 0,void 0,void 0,i&&i.type==="string"?{typeAnnotation:"coerce"}:void 0);return s?wl(new Zu(s,t,i,r)):Dr(a.errors)}var Ua=class{constructor(t,i,r){this.kind=t,this._styleExpression=i,this.isStateDependent=t!=="constant"&&!ja(i.expression),this.globalStateRefs=cs(i.expression),this._globalState=r}evaluateWithoutErrorHandling(t,i,r,a,s,o){return this._globalState&&(t=Wr(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,i,r,a,s,o)}evaluate(t,i,r,a,s,o){return this._globalState&&(t=Wr(t,this._globalState)),this._styleExpression.evaluate(t,i,r,a,s,o)}},fo=class{constructor(t,i,r,a,s){this.kind=t,this.zoomStops=r,this._styleExpression=i,this.isStateDependent=t!=="camera"&&!ja(i.expression),this.globalStateRefs=cs(i.expression),this.interpolationType=a,this._globalState=s}evaluateWithoutErrorHandling(t,i,r,a,s,o){return this._globalState&&(t=Wr(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,i,r,a,s,o)}evaluate(t,i,r,a,s,o){return this._globalState&&(t=Wr(t,this._globalState)),this._styleExpression.evaluate(t,i,r,a,s,o)}interpolationFactor(t,i,r){return this.interpolationType?Ht.interpolationFactor(this.interpolationType,t,i,r):0}};function h0(e){return e._styleExpression!==void 0}function Mf(e,t,i,r){let a=Wo(e,t,i,r);if(a.result==="error")return a;let s=a.value.expression,o=Uo(s);if(!o&&!qr(i))return Dr([new ei("","data expressions not supported")]);let n=Go(s,["zoom"]);if(!n&&!Tf(i))return Dr([new ei("","zoom expressions not supported")]);let l=eo(s);if(!l&&!n)return Dr([new ei("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof ei)return Dr([l]);if(l instanceof Ht&&!Gu(i))return Dr([new ei("",'"interpolate" expressions cannot be used with this property')]);if(!l)return wl(o?new Ua("constant",a.value,r):new Ua("source",a.value,r));let u=l instanceof Ht?l.interpolation:void 0;return wl(o?new fo("camera",a.value,l.labels,u,r):new fo("composite",a.value,l.labels,u,r))}var Af=class Cf{constructor(t,i,r){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,Ef(i),this._parameters=t,this._specification=r,this._rootKey=i,this._defaultValue=Df(r),this._warningHistory={};let a=Sf(this._parameters,this._specification);this.kind=a.kind,this.interpolationFactor=a.interpolationFactor,this.zoomStops=a.zoomStops,this.interpolationType=a.interpolationType,this._innerEvaluate=a.evaluate}evaluate(t,i){try{return this._innerEvaluate(t,i)}catch(r){let a=r instanceof Error?r.message:String(r),s=`|${a}`;return this._warningHistory[s]||(this._warningHistory[s]=!0,typeof console<"u"&&console.warn(If(this._rootKey,"",a,this._defaultValue))),this._defaultValue}}static deserialize(t){return new Cf(t._parameters,t._rootKey,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification,_rootKey:t._rootKey}}};function c0(e,t,i,r){if(Zo(e))return new Af(e,t,i);if(qo(e)){let a=Mf(e,t,i,r);if(a.result==="error")throw Error(a.value.map(s=>`${s.key}: ${s.message}`).join(", "));return a.value}else{let a=e;return i.type==="color"&&typeof e=="string"?a=K.parse(e):i.type==="padding"&&(typeof e=="number"||Array.isArray(e))?a=li.parse(e):i.type==="numberArray"&&(typeof e=="number"||Array.isArray(e))?a=ui.parse(e):i.type==="colorArray"&&(typeof e=="string"||Array.isArray(e))?a=Ft.parse(e):i.type==="variableAnchorOffsetCollection"&&Array.isArray(e)?a=Hi.parse(e):i.type==="projectionDefinition"&&typeof e=="string"&&(a=Xi.parse(e)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>a}}}function eo(e){let t=null;if(e instanceof Yd)t=eo(e.result);else if(e instanceof of){for(let i of e.args)if(t=eo(i),t)break}else(e instanceof ku||e instanceof Ht)&&e.input instanceof fr&&e.input.name==="zoom"&&(t=e);return t instanceof ei||e.eachChild(i=>{let r=eo(i);r instanceof ei?t=r:!t&&r?t=new ei("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new ei("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function cs(e,t=new Set){return e instanceof Uu&&t.add(e.key),e.eachChild(i=>{cs(i,t)}),t}function p0(e){let t={color:Wt,string:J,number:B,enum:J,boolean:re,formatted:ns,padding:Oo,numberArray:$o,colorArray:Fa,projectionDefinition:Fo,resolvedImage:ls,variableAnchorOffsetCollection:Vo};return e.type==="array"?ct(t[e.value]||ee,e.length):t[e.type]}function Df(e){if(e.type==="color"&&Zo(e.default))return new K(0,0,0,0);switch(e.type){case"color":return K.parse(e.default)||null;case"padding":return li.parse(e.default)||null;case"numberArray":return ui.parse(e.default)||null;case"colorArray":return Ft.parse(e.default)||null;case"variableAnchorOffsetCollection":return Hi.parse(e.default)||null;case"projectionDefinition":return Xi.parse(e.default)||null;default:return e.default===void 0?null:e.default}}function Wr(e,t){let{zoom:i,heatmapDensity:r,elevation:a,lineProgress:s,isSupportedScript:o,accumulated:n}=e??{};return{zoom:i,heatmapDensity:r,elevation:a,lineProgress:s,isSupportedScript:o,accumulated:n,globalState:t}}function d0(e){let t=!1;for(let i of e){let r=zf(i);if(r==="expression")return"expression";r==="legacy"&&(t=!0)}return t?"legacy":"neutral"}function zf(e){if(typeof e=="boolean")return"neutral";if(!Array.isArray(e)||e.length===0)return"legacy";switch(e[0]){case"has":return e.length<2||e[1]==="$id"||e[1]==="$type"?"legacy":e.length===2?"neutral":"expression";case"in":return e.length>
vendor: 4,396 bytes, line 1
1=3&&(typeof e[1]!="string"||Array.isArray(e[2]))?"expression":"legacy";case"!in":case"!has":return"legacy";case"==":case"!=":case">":case">=":case"<":case"<=":return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2])?"expression":"legacy";case"none":return"legacy";case"any":case"all":return d0(e.slice(1));default:return"expression"}}function qu(e){return zf(e)!=="legacy"}function yc(e){return e==="$type"?["geometry-type"]:e==="$id"?["id"]:["get",e]}function f0(e){switch(e[0]){case"==":case"!=":case"<":case"<=":case">":case">=":return e.length!==3||typeof e[1]!="string"?null:[e[0],yc(e[1]),e[2]];case"in":case"!in":{if(e.length<2||typeof e[1]!="string")return null;let t=["in",yc(e[1]),["literal",e.slice(2)]];return e[0]==="!in"?["!",t]:t}case"has":case"!has":{if(e.length!==2||typeof e[1]!="string"||e[1]==="$type"||e[1]==="$id")return null;let t=["has",e[1]];return e[0]==="!has"?["!",t]:t}default:return null}}function Rf(e){if((e[0]==="<"||e[0]==="<="||e[0]===">"||e[0]===">=")&&e[1]==="$type")return`"$type" cannot be use with operator "${e[0]}"`;let t=f0(e);return t?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(e)} with ${JSON.stringify(t)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(e)} to expression syntax.`}function Cn(e,t,i){let r=i[e];return Array.isArray(r)?qu(r)?Wu(r,t.concat(e)):{path:t.concat(e),legacyFilter:r}:null}function Wu(e,t=[]){if(!Array.isArray(e)||e.length<1)return null;switch(e[0]){case"all":case"any":case"none":for(let i=1;i<e.length;i++){let r=Cn(i,t,e);if(r)return r}break;case"!":{let i=Cn(1,t,e);if(i)return i;break}case"case":for(let i=1;i<e.length-1;i+=2){let r=Cn(i,t,e);if(r)return r}break}return null}function m0(e,t){let i=Wu(e);if(!i||typeof console>"u")return;let r=i.path.map(a=>`[${a}]`).join("");console.warn(`${t}${r}: ${Rf(i.legacyFilter)}`)}const _0={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ga(e,t,i){if(e==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};qu(e)?m0(e,t):e=mo(e);let r=Wo(e,t,_0,i);if(r.result==="error")throw Error(r.value.map(a=>`${a.key}: ${a.message}`).join(", "));return{filter:(a,s,o)=>r.value.evaluate(a,s,{},o),needGeometry:kf(e),getGlobalStateRefs:()=>cs(r.value.expression)}}function g0(e,t){return e<t?-1:+(e>t)}function kf(e){if(!Array.isArray(e))return!1;if(e[0]==="within"||e[0]==="distance")return!0;for(let t=1;t<e.length;t++)if(kf(e[t]))return!0;return!1}function mo(e){if(!e)return!0;let t=e[0];return e.length<=1?t!=="any":t==="=="?Dn(e[1],e[2],"=="):t==="!="?Ds(Dn(e[1],e[2],"==")):t==="<"||t===">"||t==="<="||t===">="?Dn(e[1],e[2],t):t==="any"?y0(e.slice(1)):t==="all"?["all"].concat(e.slice(1).map(mo)):t==="none"?["all"].concat(e.slice(1).map(mo).map(Ds)):t==="in"?vc(e[1],e.slice(2)):t==="!in"?Ds(vc(e[1],e.slice(2))):t==="has"?xc(e[1]):t!=="!has"||Ds(xc(e[1]))}function Dn(e,t,i){switch(e){case"$type":return[`filter-type-${i}`,t];case"$id":return[`filter-id-${i}`,t];default:return[`filter-${i}`,e,t]}}function y0(e){return["any"].concat(e.map(mo))}function vc(e,t){if(t.length===0)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(i=>typeof i!=typeof t[0])?["filter-in-large",e,["literal",t.sort(g0)]]:["filter-in-small",e,["literal",t]]}}function xc(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Ds(e){return["!",e]}function v0(){let e={},t=A.$version;for(let i in A.$root){let r=A.$root[i];if(r.required){let a=null;a=i==="version"?t:r.type==="array"?[]:{},a!=null&&(e[i]=a)}}return e}function Lf(e){let t=e.key,i=e.value;return i?[new R(t,i,"constants have been deprecated as of v8")]:[]}function Re(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function hr(e){if(Array.isArray(e))return e.map(hr);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let i in e)t[i]=hr(e[i]);return t}return Re(e)}function wt(e){let t=e.key,i=e.value,r=e.valueSpec||{},a=e.objectElementValidators||{},s=e.style,o=e.styleSpec,n=e.validateSpec,l=[],u=ae(i);if(u!=="object")return[new R(t,i,`object expected, ${u}
1 found`)];for(let h in i){let c=h.split(".")[0],p=Aa(r,c)||r["*"],d;if(Aa(a,c))d=a[c];else if(Aa(r,c)){if(i[h]===void 0)continue;d=n}else if(a["*"])d=a["*"];else if(r["*"])d=n;else{l.push(new R(t,i[h],`unknown property "${h}"`));continue}l=l.concat(d({key:(t&&`${t}.`)+h,value:i[h],valueSpec:p,style:s,styleSpec:o,object:i,objectKey:h,validateSpec:n},i))}for(let h in r)a[h]||r[h].required&&r[h].default===void 0&&i[h]===void 0&&l.push(new R(t,i,`missing required property "${h}"`));return l}function Hu(e){let t=e.value,i=e.valueSpec,r=e.validateSpec,a=e.style,s=e.styleSpec,o=e.key,n=e.arrayElementValidator||r;if(ae(t)!=="array")return[new R(o,t,`array expected, ${ae(t)} found`)];if(i.length&&t.length!==i.length)return[new R(o,t,`array length ${i.length} expected, length ${t.length} found`)];let l={type:i.value,values:i.values};s.$version<7&&(l.function=i.function),ae(i.value)==="object"&&(l=i.value);let u=[];for(let h=0;h<t.length;h++)u=u.concat(n({array:t,arrayIndex:h,value:t[h],valueSpec:l,validateSpec:e.validateSpec,style:a,styleSpec:s,key:`${o}[${h}]`}));return u}function Ho(e){let t=e.key,i=e.value,r=e.valueSpec,a=ae(i);return a==="number"&&i!==i&&(a="NaN"),a==="number"?"minimum"in r&&i<r.minimum?[new R(t,i,`${i} is less than the minimum value ${r.minimum}`)]:"maximum"in r&&i>r.maximum?[new R(t,i,`${i} is greater than the maximum value ${r.maximum}`)]:[]:[new R(t,i,`number expected, ${a} found`)]}function Ff(e){let t=e.valueSpec,i=Re(e.value.type),r,a={},s,o,n=i!=="categorical"&&e.value.property===void 0,l=!n,u=ae(e.value.stops)==="array"&&ae(e.value.stops[0])==="array"&&ae(e.value.stops[0][0])==="object",h=wt({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:c,default:f}});return i==="identity"&&n&&h.push(new R(e.key,e.value,'missing required property "property"')),i!=="identity"&&!e.value.stops&&h.push(new R(e.key,e.value,'missing required property "stops"')),i==="exponential"&&e.valueSpec.expression&&!Gu(e.valueSpec)&&h.push(new R(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!qr(e.valueSpec)?h.push(new R(e.key,e.value,"property functions not supported")):n&&!Tf(e.valueSpec)&&h.push(new R(e.key,e.value,"zoom functions not supported"))),(i==="categorical"||u)&&e.value.property===void 0&&h.push(new R(e.key,e.value,'"property" property is required')),h;function c(m){if(i==="identity")return[new R(m.key,m.value,'identity function may not have a "stops" property')];let _=[],g=m.value;return _=_.concat(Hu({key:m.key,value:g,valueSpec:m.valueSpec,validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec,arrayElementValidator:p})),ae(g)==="array"&&g.length===0&&_.push(new R(m.key,g,"array must have at least one stop")),_}function p(m){let _=[],g=m.value,x=m.key;if(ae(g)!=="array")return[new R(x,g,`array expected, ${ae(g)} found`)];if(g.length!==2)return[new R(x,g,`array length 2 expected, length ${g.length} found`)];if(u){if(ae(g[0])!=="object")return[new R(x,g,`object expected, ${ae(g[0])} found`)];if(g[0].zoom===void 0)return[new R(x,g,"object stop key must have zoom")];if(g[0].value===void 0)return[new R(x,g,"object stop key must have value")];if(o&&o>Re(g[0].zoom))return[new R(x,g[0].zoom,"stop zoom values must appear in ascending order")];Re(g[0].zoom)!==o&&(o=Re(g[0].zoom),s=void 0,a={}),_=_.concat(wt({key:`${x}[0]`,value:g[0],valueSpec:{zoom:{}},validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec,objectElementValidators:{zoom:Ho,value:d}}))}else _=_.concat(d({key:`${x}[0]`,value:g[0],validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec},g));return qo(hr(g[1]))?_.concat([new R(`${x}[1]`,g[1],"expressions are not allowed in function stops.")]):_.concat(m.validateSpec({key:`${x}[1]`,value:g[1],valueSpec:t,validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec}))}function d(m,_){let g=ae(m.value),x=Re(m.value),y=m.value===null?_:m.value;if(!r)r=g;else if(g!==r)return[new R(m.key,y,`${g} stop domain type must match previous stop domain type ${r}`)];if(g!=="number"&&g!=="string"&&g!=="boolean")return[new R(m.key,y,"stop domain value must be a number, string, or boolean")];
vendor: 27,244 bytes, lines 1-2
1if(g!=="number"&&i!=="categorical"){let v=`number expected, ${g} found`;return qr(t)&&i===void 0&&(v+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new R(m.key,y,v)]}return i==="categorical"&&g==="number"&&(!isFinite(x)||Math.floor(x)!==x)?[new R(m.key,y,`integer expected, found ${x}`)]:i!=="categorical"&&g==="number"&&s!==void 0&&x<s?[new R(m.key,y,"stop domain values must appear in ascending order")]:(s=x,i==="categorical"&&x in a?[new R(m.key,y,"stop domain values must be unique")]:(a[x]=!0,[]))}function f(m){return m.validateSpec({key:m.key,value:m.value,valueSpec:t,validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec})}}function Hr(e){let t=(e.expressionContext==="property"?Mf:Wo)(hr(e.value),e.key,e.valueSpec);if(t.result==="error")return t.value.map(r=>new R(`${e.key}${r.key}`,e.value,r.message));let i=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext==="property"&&e.propertyKey==="text-font"&&!i.outputDefined())return[new R(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if(e.expressionContext==="property"&&e.propertyType==="layout"&&!ja(i))return[new R(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if(e.expressionContext==="filter"&&!ja(i))return[new R(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!Go(i,["zoom","feature-state"]))return[new R(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(e.expressionContext==="cluster-initial"&&!Uo(i))return[new R(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function x0(e){let t=e.value,i=e.key,r=ae(t);return r==="boolean"?[]:[new R(i,t,`boolean expected, ${r} found`)]}function Tl(e){let t=e.key,i=e.value,r=ae(i);return r==="string"?K.parse(String(i))?[]:[new R(t,i,`color expected, "${i}" found`)]:[new R(t,i,`color expected, ${r} found`)]}function Za(e){let t=e.key,i=e.value,r=e.valueSpec,a=[];return Array.isArray(r.values)?r.values.indexOf(Re(i))===-1&&a.push(new R(t,i,`expected one of [${r.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(r.values).indexOf(Re(i))===-1&&a.push(new R(t,i,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(i)} found`)),a}function b0(e,t){let i=e;for(let r of t)i=i[r];return i}function w0(e,t){let i=Wu(t);return i?[new R(`${e.key}${i.path.map(r=>`[${r}]`).join("")}`,b0(e.value,i.path),Rf(i.legacyFilter),null,"warning")]:[]}function Xu(e){let t=hr(e.value);return qu(t)?[...w0(e,t),...Hr(Na({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}}))]:Bf(e)}function Bf(e){let t=e.value,i=e.key;if(ae(t)!=="array")return[new R(i,t,`array expected, ${ae(t)} found`)];let r=e.styleSpec,a,s=[];if(t.length<1)return[new R(i,t,"filter array must have at least 1 element")];switch(s=s.concat(Za({key:`${i}[0]`,value:t[0],valueSpec:r.filter_operator,style:e.style,styleSpec:e.styleSpec})),Re(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&Re(t[1])==="$type"&&s.push(new R(i,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&s.push(new R(i,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(a=ae(t[1]),a!=="string"&&s.push(new R(`${i}[1]`,t[1],`string expected, ${a} found`)));for(let o=2;o<t.length;o++)a=ae(t[o]),Re(t[1])==="$type"?s=s.concat(Za({key:`${i}[${o}]`,value:t[o],valueSpec:r.geometry_type,style:e.style,styleSpec:e.styleSpec})):a!=="string"&&a!=="number"&&a!=="boolean"&&s.push(new R(`${i}[${o}]`,t[o],`string, number, or boolean expected, ${a} found`));break;case"any":case"all":case"none":for(let o=1;o<t.length;o++)s=s.concat(Bf({key:`${i}[${o}]`,value:t[o],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":a=ae(t[1]),t.length===2?a!=="string"&&s.push(new R(`${i}[1]`,t[1],`string expected, ${a} found`)):s.push(new R(i,t,`filter array for "${t[0]}" operator must have 2 elements`));break}return s}function Of(e,t){let i=e.key,r=e.validateSpec,a=e.style,s=e.styleSpec,o=e.value,n=e.objectKey,l=s[`${t}_${e.layerType}`];if(!l)return[];let u=n.match(/^(.*)-transition$/);if(t==="paint"&&u&&l[u[1]]&&l[u[1]].transition)return r({key:i,value:o,valueSpec:s.transition,style:a,styleSpec:s});let h=e.valueSpec||l[n];if(!h)return[new R(i,o,`unknown property "${n}"`)];let c;if(ae(o)==="string"&&qr(h)&&!h.tokens&&(c=/^{([^}]+)}$/.exec(o)))return[new R(i,o,`"${n}" does not support interpolation syntax 2Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(c[1])} }\`.`)];let p=[];return e.layerType==="symbol"&&n==="text-font"&&Zo(hr(o))&&Re(o.type)==="identity"&&p.push(new R(i,o,'"text-font" does not support identity functions')),p.concat(r({key:e.key,value:o,valueSpec:h,style:a,styleSpec:s,expressionContext:"property",propertyType:t,propertyKey:n}))}function $f(e){return Of(e,"paint")}function Vf(e){return Of(e,"layout")}function jf(e){let t=[],i=e.value,r=e.key,a=e.style,s=e.styleSpec;if(ae(i)!=="object")return[new R(r,i,`object expected, ${ae(i)} found`)];!i.type&&!i.ref&&t.push(new R(r,i,'either "type" or "ref" is required'));let o=Re(i.type),n=Re(i.ref);if(i.id){let l=Re(i.id);for(let u=0;u<e.arrayIndex;u++){let h=a.layers[u];Re(h.id)===l&&t.push(new R(r,i.id,`duplicate layer id "${i.id}", previously used at line ${h.id.__line__}`))}}if("ref"in i){["type","source","source-layer","filter","layout"].forEach(u=>{u in i&&t.push(new R(r,i[u],`"${u}" is prohibited for ref layers`))});let l;a.layers.forEach(u=>{Re(u.id)===n&&(l=u)}),l?l.ref?t.push(new R(r,i.ref,"ref cannot reference another ref layer")):o=Re(l.type):t.push(new R(r,i.ref,`ref layer "${n}" not found`))}else if(o!=="background")if(!i.source)t.push(new R(r,i,'missing required property "source"'));else{let l=a.sources&&a.sources[i.source],u=l&&Re(l.type);l?u==="vector"&&o==="raster"?t.push(new R(r,i.source,`layer "${i.id}" requires a raster source`)):u!=="raster-dem"&&o==="hillshade"||u!=="raster-dem"&&o==="color-relief"?t.push(new R(r,i.source,`layer "${i.id}" requires a raster-dem source`)):u==="raster"&&o!=="raster"?t.push(new R(r,i.source,`layer "${i.id}" requires a vector source`)):u==="vector"&&!i["source-layer"]?t.push(new R(r,i,`layer "${i.id}" must specify a "source-layer"`)):u==="raster-dem"&&o!=="hillshade"&&o!=="color-relief"?t.push(new R(r,i.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):o==="line"&&i.paint&&i.paint["line-gradient"]&&(u!=="geojson"||!l.lineMetrics)&&t.push(new R(r,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new R(r,i.source,`source "${i.source}" not found`))}return o==="raster"&&i.paint?.resampling&&i.paint?.["raster-resampling"]&&t.push(new R(r,i.paint,`layer "${i.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),t=t.concat(wt({key:r,value:i,valueSpec:s.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(){return[]},type(){return e.validateSpec({key:`${r}.type`,value:i.type,valueSpec:s.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:i,objectKey:"type"})},filter:Xu,layout(l){return wt({layer:i,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return Vf(Na({layerType:o},u))}}})},paint(l){return wt({layer:i,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return $f(Na({layerType:o},u))}}})}}})),t}function Gi(e){let t=e.value,i=e.key,r=ae(t);return r==="string"?[]:[new R(i,t,`string expected, ${r} found`)]}function T0(e){let t=e.sourceName??"",i=e.value,r=e.styleSpec,a=r.source_raster_dem,s=e.style,o=[],n=ae(i);if(i===void 0)return o;if(n!=="object")return o.push(new R("source_raster_dem",i,`object expected, ${n} found`)),o;let l=Re(i.encoding)==="custom",u=["redFactor","greenFactor","blueFactor","baseShift"],h=e.value.encoding?`"${e.value.encoding}"`:"Default";for(let c in i)!l&&u.includes(c)?o.push(new R(c,i[c],`In "${t}": "${c}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):a[c]?o=o.concat(e.validateSpec({key:c,value:i[c],valueSpec:a[c],validateSpec:e.validateSpec,style:s,styleSpec:r})):o.push(new R(c,i[c],`unknown property "${c}"`));return o}const bc={promoteId:S0};function Nf(e){let t=e.value,i=e.key,r=e.styleSpec,a=e.style,s=e.validateSpec;if(!t.type)return[new R(i,t,'"type" is required')];let o=Re(t.type),n;switch(o){case"vector":case"raster":return n=wt({key:i,value:t,valueSpec:r[`source_${o.replace("-","_")}`],style:e.style,styleSpec:r,objectElementValidators:bc,validateSpec:s}),n;case"raster-dem":return n=T0({sourceName:i,value:t,style:e.style,styleSpec:r,validateSpec:s}),n;case"geojson":if(n=wt({key:i,value:t,valueSpec:r.source_geojson,style:a,styleSpec:r,validateSpec:s,objectElementValidators:bc}),t.cluster)for(let l in t.clusterProperties){let[u,h]=t.clusterProperties[l],c=typeof u=="string"?[u,["accumulated"],["get",l]]:u;n.push(...Hr({key:`${i}.${l}.map`,value:h,expressionContext:"cluster-map"})),n.push(...Hr({key:`${i}.${l}.reduce`,value:c,expressionContext:"cluster-reduce"}))}return n;case"video":return wt({key:i,value:t,valueSpec:r.source_video,style:a,validateSpec:s,styleSpec:r});case"image":return wt({key:i,value:t,valueSpec:r.source_image,style:a,validateSpec:s,styleSpec:r});case"canvas":return[new R(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Za({key:`${i}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function S0({key:e,value:t}){if(ae(t)==="string")return Gi({key:e,value:t});{let i=[];for(let r in t)i.push(...Gi({key:`${e}.${r}`,value:t[r]}));return i}}function Uf(e){let t=e.value,i=e.styleSpec,r=i.light,a=e.style,s=[],o=ae(t);if(t===void 0)return s;if(o!=="object")return s=s.concat([new R("light",t,`object expected, ${o} found`)]),s;for(let n in t){let l=n.match(/^(.*)-transition$/);s=l&&r[l[1]]&&r[l[1]].transition?s.concat(e.validateSpec({key:n,value:t[n],valueSpec:i.transition,validateSpec:e.validateSpec,style:a,styleSpec:i})):r[n]?s.concat(e.validateSpec({key:n,value:t[n],valueSpec:r[n],validateSpec:e.validateSpec,style:a,styleSpec:i})):s.concat([new R(n,t[n],`unknown property "${n}"`)])}return s}function Gf(e){let t=e.value,i=e.styleSpec,r=i.sky,a=e.style,s=ae(t);if(t===void 0)return[];if(s!=="object")return[new R("sky",t,`object expected, ${s} found`)];let o=[];for(let n in t)o=r[n]?o.concat(e.validateSpec({key:n,value:t[n],valueSpec:r[n],style:a,styleSpec:i})):o.concat([new R(n,t[n],`unknown property "${n}"`)]);return o}function Zf(e){let t=e.value,i=e.styleSpec,r=i.terrain,a=e.style,s=[],o=ae(t);if(t===void 0)return s;if(o!=="object")return s=s.concat([new R("terrain",t,`object expected, ${o} found`)]),s;for(let n in t)s=r[n]?s.concat(e.validateSpec({key:n,value:t[n],valueSpec:r[n],validateSpec:e.validateSpec,style:a,styleSpec:i})):s.concat([new R(n,t[n],`unknown property "${n}"`)]);return s}function P0(e){return Gi(e).length===0?[]:Hr(e)}function I0(e){return Gi(e).length===0?[]:Hr(e)}function E0(e){let t=e.key,i=e.value;if(ae(i)==="array"){if(i.length<1||i.length>4)return[new R(t,i,`padding requires 1 to 4 values; ${i.length} values found`)];let r={type:"number"},a=[];for(let s=0;s<i.length;s++)a=a.concat(e.validateSpec({key:`${t}[${s}]`,value:i[s],validateSpec:e.validateSpec,valueSpec:r}));return a}else return Ho({key:t,value:i,valueSpec:{}})}function M0(e){let t=e.key,i=e.value;if(ae(i)==="array"){let r={type:"number"};if(i.length<1)return[new R(t,i,"array length at least 1 expected, length 0 found")];let a=[];for(let s=0;s<i.length;s++)a=a.concat(e.validateSpec({key:`${t}[${s}]`,value:i[s],validateSpec:e.validateSpec,valueSpec:r}));return a}else return Ho({key:t,value:i,valueSpec:{}})}function A0(e){let t=e.key,i=e.value;if(ae(i)==="array"){if(i.length<1)return[new R(t,i,"array length at least 1 expected, length 0 found")];let r=[];for(let a=0;a<i.length;a++)r=r.concat(Tl({key:`${t}[${a}]`,value:i[a]}));return r}else return Tl({key:t,value:i})}function C0(e){let t=e.key,i=e.value,r=ae(i),a=e.styleSpec;if(r!=="array"||i.length<1||i.length%2!=0)return[new R(t,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let s=[];for(let o=0;o<i.length;o+=2)s=s.concat(Za({key:`${t}[${o}]`,value:i[o],valueSpec:a.layout_symbol["text-anchor"]})),s=s.concat(Hu({key:`${t}[${o+1}]`,value:i[o+1],valueSpec:{length:2,value:"number"},validateSpec:e.validateSpec,style:e.style,styleSpec:a}));return s}function qf(e){let t=[],i=e.value,r=e.key;if(Array.isArray(i)){let a=[],s=[];for(let o in i)i[o].id&&a.includes(i[o].id)&&t.push(new R(r,i,`all the sprites' ids must be unique, but ${i[o].id} is duplicated`)),a.push(i[o].id),i[o].url&&s.includes(i[o].url)&&t.push(new R(r,i,`all the sprites' URLs must be unique, but ${i[o].url} is duplicated`)),s.push(i[o].url),t=t.concat(wt({key:`${r}[${o}]`,value:i[o],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:e.validateSpec}));return t}else return Gi({key:r,value:i})}function D0(e){let t=e.value,i=e.styleSpec,r=i.projection,a=e.style,s=ae(t);if(t===void 0)return[];if(s!=="object")return[new R("projection",t,`object expected, ${s} found`)];let o=[];for(let n in t)o=r[n]?o.concat(e.validateSpec({key:n,value:t[n],valueSpec:r[n],style:a,styleSpec:i})):o.concat([new R(n,t[n],`unknown property "${n}"`)]);return o}function z0(e){let t=e.key,i=e.value;i=i instanceof String?i.valueOf():i;let r=ae(i);return r==="array"&&!k0(i)&&!R0(i)?[new R(t,i,`projection expected, invalid array ${JSON.stringify(i)} found`)]:["array","string"].includes(r)?[]:[new R(t,i,`projection expected, invalid type "${r}" found`)]}function R0(e){return!!["interpolate","step","literal"].includes(e[0])}function k0(e){return Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number"}function Wf(e){return!!e&&e.constructor===Object}function Hf(e){return Wf(e.value)?[]:[new R(e.key,e.value,`object expected, ${ae(e.value)} found`)]}function L0(e){let t=e.key,i=e.value,r=e.validateSpec,a=e.styleSpec,s=e.style;if(!Wf(i))return[new R(t,i,`object expected, ${ae(i)} found`)];let o=[];for(let n in i){let l=i[n],u=ae(l);if(u==="string")o.push(...Gi({key:`${t}.${n}`,value:l}));else if(u==="array"){let h={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[c,p]of l.entries())o.push(...wt({key:`${t}.${n}[${c}]`,value:p,valueSpec:h,styleSpec:a,style:s,validateSpec:r}))}else o.push(new R(`${t}.${n}`,l,`string or array expected, ${u} found`))}return o}const wc={"*"(){return[]},array:Hu,boolean:x0,number:Ho,color:Tl,constants:Lf,enum:Za,filter:Xu,function:Ff,layer:jf,object:wt,source:Nf,light:Uf,sky:Gf,terrain:Zf,projection:D0,projectionDefinition:z0,string:Gi,formatted:P0,resolvedImage:I0,padding:E0,numberArray:M0,colorArray:A0,variableAnchorOffsetCollection:C0,sprite:qf,state:Hf,fontFaces:L0};function _o(e){let t=e.value,i=e.valueSpec,r=e.styleSpec;return e.validateSpec=_o,i.expression&&Zo(Re(t))?Ff(e):i.expression&&qo(hr(t))?Hr(e):i.type&&wc[i.type]?wc[i.type](e):wt(Na({},e,{valueSpec:i.type?r[i.type]:i}))}function Xf(e){let t=e.value,i=e.key,r=Gi(e);return r.length||(t.indexOf("{fontstack}")===-1&&r.push(new R(i,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&r.push(new R(i,t,'"glyphs" url must include a "{range}" token'))),r}function At(e,t=A){let i=[];return i=i.concat(_o({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:_o,objectElementValidators:{glyphs:Xf,"*"(){return[]}}})),e.constants&&(i=i.concat(Lf({key:"constants",value:e.constants}))),Yf(i)}At.source=Nt(jt(Nf)),At.sprite=Nt(jt(qf)),At.glyphs=Nt(jt(Xf)),At.light=Nt(jt(Uf)),At.sky=Nt(jt(Gf)),At.terrain=Nt(jt(Zf)),At.state=Nt(jt(Hf)),At.layer=Nt(jt(jf)),At.filter=Nt(jt(Xu)),At.paintProperty=Nt(jt($f)),At.layoutProperty=Nt(jt(Vf));function jt(e){return function(t){return e(Object.assign({},t,{validateSpec:_o}))}}function Yf(e){return[].concat(e).sort((t,i)=>t.line-i.line)}function Nt(e){return function(...t){return Yf(e.apply(this,t))}}const F0={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"};var B0=class{constructor(t,i,r){this._rootKey=i,this._globalState=r,this.setValue(t)}evaluate(){return this._literalValue??this._compiledValue.evaluate({})}setValue(t){if(t==null||t==="visible"||t==="none"){this._literalValue=t==="none"?"none":"visible",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let i=Wo(t,this._rootKey,F0,this._globalState);if(i.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,Error(i.value.map(r=>`${r.key}: ${r.message}`).join(", "));this._literalValue=void 0,this._compiledValue=i.value,this._globalStateRefs=cs(i.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};function O0(e,t,i){return new B0(e,t,i)}const _t=At,Kf=new Set(Object.keys(A).filter(e=>e.startsWith("source_")).map(e=>e.slice(7).replaceAll("_","-")));function $0(e){return Object.entries(e.sources??{}).filter(([,t])=>!Kf.has(t.type)).map(([t])=>`sources.${t}`)}function Tc(e,t){let i=$0(t);return Yu(e,_t(t).filter(({message:r})=>!i.some(a=>r.startsWith(`${a}:`)||r.startsWith(`${a}.`))))}function Yu(e,t){let i=!1;for(let r of t){if(r.severity==="warning"){ge(r.message);continue}e.fire(new G(Error(r.message))),i=!0}return i}function ps(e,t,i,r){return r?.validate!==!1&&Yu(e,t({styleSpec:A,...i}))}var Sl=class Jf{constructor(t,i,r){let a=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;let o=new Int32Array(this.arrayBuffer);t=o[0],i=o[1],r=o[2],this.d=i+2*r;for(let u=0;u<this.d*this.d;u++){let h=o[3+u],c=o[3+u+1];a.push(h===c?null:o.subarray(h,c))}let n=o[3+a.length],l=o[3+a.length+1];this.keys=o.subarray(n,l),this.bboxes=o.subarray(l),this.insert=this._insertReadonly}else{this.d=i+2*r;for(let o=0;o<this.d*this.d;o++)a.push([]);this.keys=[],this.bboxes=[]}this.n=i,this.extent=t,this.padding=r,this.scale=i/t,this.uid=0;let s=r/i*t;this.min=-s,this.max=t+s}insert(t,i,r,a,s){this._forEachCell(i,r,a,s,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(a),this.bboxes.push(s)}_insertReadonly(){throw Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,i,r,a,s,o){this.cells[s].push(o)}query(t,i,r,a,s){let o=this.min,n=this.max;if(t<=o&&i<=o&&n<=r&&n<=a&&!s)return[...this.keys];{let l=[];return this._forEachCell(t,i,r,a,this._queryCell,l,{},s),l}}_queryCell(t,i,r,a,s,o,n,l){let u=this.cells[s];if(u!==null){let h=this.keys,c=this.bboxes;for(let p of u)if(n[p]===void 0){let d=p*4;(l?l(c[d+0],c[d+1],c[d+2],c[d+3]):t<=c[d+2]&&i<=c[d+3]&&r>=c[d+0]&&a>=c[d+1])?(n[p]=!0,o.push(h[p])):n[p]=!1}}}_forEachCell(t,i,r,a,s,o,n,l){let u=this._convertToCellCoord(t),h=this._convertToCellCoord(i),c=this._convertToCellCoord(r),p=this._convertToCellCoord(a);for(let d=u;d<=c;d++)for(let f=h;f<=p;f++){let m=this.d*f+d;if(!(l&&!l(this._convertFromCellCoord(d),this._convertFromCellCoord(f),this._convertFromCellCoord(d+1),this._convertFromCellCoord(f+1)))&&s.call(this,t,i,r,a,m,o,n,l))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let t=this.cells,i=3+this.cells.length+1+1,r=0;for(let o of this.cells)r+=o.length;let a=new Int32Array(i+r+this.keys.length+this.bboxes.length);a[0]=this.extent,a[1]=this.n,a[2]=this.padding;let s=i;for(let o=0;o<t.length;o++){let n=t[o];a[3+o]=s,a.set(n,s),s+=n.length}return a[3+t.length]=s,a.set(this.keys,s),s+=this.keys.length,a[3+t.length+1]=s,a.set(this.bboxes,s),s+=this.bboxes.length,a.buffer}static serialize(t,i){let r=t.toArrayBuffer();return i&&i.push(r),{buffer:r}}static deserialize(t){return new Jf(t.buffer)}};const _i={};function V(e,t,i={}){if(_i[e])throw Error(`${e} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),_i[e]={klass:t,omit:i.omit||[],shallow:i.shallow||[]}}V("Object",Object),V("Set",Set),V("TransferableGridIndex",Sl),V("Color",K),V("Error",Error),V("AJAXError",lo),V("ResolvedImage",oi),V("StylePropertyFunction",Af),V("StyleExpression",Zu,{omit:["_evaluator"]}),V("ZoomDependentExpression",fo),V("ZoomConstantExpression",Ua),V("CompoundExpression",fr,{omit:["_evaluate"]});for(let e in Fr)Fr[e]._classRegistryKey||V(`Expression_${e}`,Fr[e]);function Qf(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor?.name==="ArrayBuffer")}function Ku(e){let t=e.constructor;return e.$name||t._classRegistryKey}function V0(e){if(typeof e!="object"||!e)return!1;let t=Ku(e);return t&&t!=="Object"}function em(e){return!V0(e)&&(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||e instanceof Error||Qf(e)||ar(e)||ArrayBuffer.isView(e)||e instanceof ImageData)}function Da(e,t){if(em(e))return(Qf(e)||ar(e))&&t&&t.push(e),ArrayBuffer.isView(e)&&t&&t.push(e.buffer),e instanceof ImageData&&t&&t.push(e.data.buffer),e;if(Array.isArray(e)){let s=[];for(let o of e)s.push(Da(o,t));return s}if(typeof e!="object")throw Error(`can't serialize object of type ${typeof e}`);let i=Ku(e);if(!i)throw Error(`can't serialize object of unregistered class ${e.constructor.name}`);if(!_i[i])throw Error(`${i} is not registered.`);let{klass:r}=_i[i],a=r.serialize?r.serialize(e,t):{};if(r.serialize){if(a===t?.[t.length-1])throw Error("statically serialized object won't survive transfer of $name property")}else{for(let s in e){if(!e.hasOwnProperty(s)||_i[i].omit.includes(s))continue;let o=e[s];o!==void 0&&(a[s]=_i[i].shallow.includes(s)?o:Da(o,t))}e instanceof Error&&(a.message=e.message)}if(a.$name)throw Error("$name property is reserved for worker serialization logic.");return i!=="Object"&&(a.$name=i),a}function za(e){if(em(e))return e;if(Array.isArray(e))return e.map(za);if(typeof e!="object")throw Error(`can't deserialize object of type ${typeof e}`);let t=Ku(e)||"Object";if(!_i[t])throw Error(`can't deserialize unregistered class ${t}`);let{klass:i}=_i[t];if(!i)throw Error(`can't deserialize unregistered class ${t}`);if(i.deserialize)return i.deserialize(e);let r=Object.create(i.prototype);for(let a of Object.keys(e)){if(a==="$name")continue;let s=e[a];r[a]=_i[t].shallow.includes(a)?s:za(s)}return r}var Pl=class{constructor(){this.first=!0}update(t,i){let r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=i):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=i),t===this.lastZoom?!1:(this.lastZoom=t,this.lastFloorZoom=r,!0))}};function j0(e){return/[\u02EA\u02EB\u1100-\u11FF\u2E80-\u2FDF\u3000-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(e))}function N0(e){return/[\u02EA\u02EB\u1100-\u11FF\u1400-\u167F\u18B0-\u18F5\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303F\u3041-\u3096\u309D-\u30FB\u30FD-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE48\uFE50-\uFE57\uFE5F-\uFE62\uFE67-\uFE6F\uFF00-\uFF07\uFF0A-\uFF0C\uFF0E-\uFF19\uFF1F-\uFF3A\uFF3C\uFF3E\uFF40-\uFF5A\uFFE0-\uFFE2\uFFE4-\uFFE7]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFE4\uDFF0-\uDFF6]|[\uD81C-\uD822\uD83D\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD30-\uDEFB]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83C[\uDC00-\uDE00\uDF00-\uDFFF]|\uD83E[\uDD00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(e))}function U0(e){return/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(e))}function G0(e){for(let t of e)if(N0(t.codePointAt(0)))return!0;return!1}function tm(e){let t=e.map(i=>{try{return RegExp(`\\p{sc=${i}}`,"u").source}catch{return null}}).filter(i=>i);return new RegExp(t.join("|"),"u")}tm(["Arab","Dupl","Mong","Ougr","Syrc"]);const Z0=tm("Adlm.Arab.Armi.Avst.Chrs.Cprt.Egyp.Elym.Gara.Hatr.Hebr.Hung.Khar.Lydi.Mand.Mani.Mend.Merc.Mero.Narb.Nbat.Nkoo.Orkh.Palm.Phli.Phlp.Phnx.Prti.Rohg.Samr.Sarb.Sogo.Syrc.Thaa.Todr.Yezi".split("."));function im(e){return Z0.test(String.fromCodePoint(e))}function q0(e,t){return!t&&im(e)?!1:!U0(e)}function W0(e){for(let t of e)if(im(t.codePointAt(0)))return!0;return!1}function H0(e,t){for(let i of e)if(!q0(i.codePointAt(0),t))return!1;return!0}const Xr=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){if(Xr.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}
2async syncState(e,t){if(this.isParsed())return this.getState();if(e.pluginStatus!=="loading")return this.setState(e),e;let i=e.pluginURL,r=new Promise(s=>{this.loadScriptResolve=s}),a=new Promise(s=>setTimeout(()=>s(),this.TIMEOUT));if(await t(i),await Promise.race([r,a]),this.isParsed()){let s={pluginStatus:"loaded",pluginURL:i};return this.setState(s),s}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${i}`)}};var Se=class{constructor(t,i){this.isSupportedScript=X0,this.zoom=t,i?(this.now=i.now||0,this.fadeDuration=i.fadeDuration||0,this.zoomHistory=i.zoomHistory||new Pl,this.transition=i.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Pl,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let t=this.zoom,i=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:i+(1-i)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*i}}};function X0(e){return H0(e,Xr.getRTLTextPluginStatus()==="loaded")}const Ju="-transition";
vendor: 5,664 bytes, line 2
2var Xo=class{constructor(t,i,r,a){this.property=t,this.value=i,this.expression=c0(i===void 0?t.specification.default:i,r,t.specification,a)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(t,i,r){return this.property.possiblyEvaluate(this,t,i,r)}},Il=class{constructor(t,i,r){this.property=t,this.value=new Xo(t,void 0,i,r)}transitioned(t,i){return new Sc(this.property,this.value,i,j({},t.transition,this.transition),t.now)}untransitioned(){return new Sc(this.property,this.value,null,{},0)}},Yo=class{constructor(t,i,r){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=r,this._rootKey=i}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasProperty(t){return t in this._properties.defaultTransitionablePropertyValues}getValue(t){return gt(this._values[t].value.value)}setValue(t,i){Object.hasOwn(this._values,t)||(this._values[t]=new Il(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].value=new Xo(this._values[t].property,i===null?void 0:gt(i),this._propertyRootKey(t),this._globalState)}getTransition(t){return gt(this._values[t].transition)}setTransition(t,i){Object.hasOwn(this._values,t)||(this._values[t]=new Il(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].transition=gt(i)||void 0}serialize(){let t={};for(let i of Object.keys(this._values)){let r=this.getValue(i);r!==void 0&&(t[i]=r);let a=this.getTransition(i);a!==void 0&&(t[`${i}${Ju}`]=a)}return t}transitioned(t,i){let r=new Pc(this._properties);for(let a of Object.keys(this._values))r._values[a]=this._values[a].transitioned(t,i._values[a]);return r}untransitioned(){let t=new Pc(this._properties);for(let i of Object.keys(this._values))t._values[i]=this._values[i].untransitioned();return t}},Sc=class{constructor(t,i,r,a,s){this.property=t,this.value=i,this.begin=s+a.delay||0,this.end=this.begin+a.duration||0,t.specification.transition&&(a.delay||a.duration)&&(this.prior=r)}possiblyEvaluate(t,i,r){let a=t.now||0,s=this.value.possiblyEvaluate(t,i,r),o=this.prior;if(!o)return s;if(a>this.end||this.value.isDataDriven())return this.prior=null,s;if(a<this.begin)return o.possiblyEvaluate(t,i,r);{let n=(a-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,i,r),s,fy(n))}}},Pc=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,i,r){let a=new Ko(this._properties);for(let s of Object.keys(this._values))a._values[s]=this._values[s].possiblyEvaluate(t,i,r);return a}hasTransition(){for(let t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}},Y0=class{constructor(t,i,r){this._properties=t,this._values=Object.create(t.defaultPropertyValues),this._globalState=r,this._rootKey=i}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasValue(t){return this._values[t].value!==void 0}hasProperty(t){return t in this._properties.defaultPropertyValues}getValue(t){return gt(this._values[t].value)}setValue(t,i){this._values[t]=new Xo(this._values[t].property,i===null?void 0:gt(i),this._propertyRootKey(t),this._globalState)}serialize(){let t={};for(let i of Object.keys(this._values)){let r=this.getValue(i);r!==void 0&&(t[i]=r)}return t}possiblyEvaluate(t,i,r){let a=new Ko(this._properties);for(let s of Object.keys(this._values))a._values[s]=this._values[s].possiblyEvaluate(t,i,r);return a}},qt=class{constructor(t,i,r){this.property=t,this.value=i,this.parameters=r}isConstant(){return this.value.kind==="constant"}constantOr(t){return this.value.kind==="constant"?this.value.value:t}evaluate(t,i,r,a){return this.property.evaluate(this.value,this.parameters,t,i,r,a)}},Ko=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}};function Ic(e){if(Array.isArray(e))return e.length;let t=e?.values;return Array.isArray(t)?t.length:void 0}function rm(e,t){let i=Ic(e),r=Ic(t);return i!==void 0&&r!==void 0&&i!==r}var $=class{constructor(t,i){this.specification=t,this.name=i}possiblyEvaluate(t,i){if(t.isDataDriven())throw Error("Value should not be data driven");return t.expression.evaluate(i)}interpolate(t,i,r){if(rm(t,i))return ge(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),i;let a=$e[this.specification.type];return a?a(t,i,r):t}},Z=class{constructor(t,i,r){this.specification=t,this.name=i,this.overrides=r}possiblyEvaluate(t,i,r,a){return t.expression.kind==="constant"||t.expression.kind==="camera"?new qt(this,{kind:"constant",value:t.expression.evaluate(i,null,{},r,a)},i):new qt(this,t.expression,i)}interpolate(t,i,r){if(t.value.kind!=="constant"||i.value.kind!=="constant")return t;if(t.value.value===void 0||i.value.value===void 0)return new qt(this,{kind:"constant",value:void 0},t.parameters);if(rm(t.value.value,i.value.value))return ge(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),i;let a=$e[this.specification.type];if(a){let s=a(t.value.value,i.value.value,r);return new qt(this,{kind:"constant",value:s},t.parameters)}else return t}evaluate(t,i,r,a,s,o){return t.kind==="constant"?t.value:t.evaluate(i,r,a,s,o)}},qa=class extends Z{possiblyEvaluate(t,i,r,a){if(t.value===void 0)return new qt(this,{kind:"constant",value:void 0},i);if(t.expression.kind==="constant"){let s=t.expression.evaluate(i,null,{},r,a),o=t.property.specification.type==="resolvedImage"&&typeof s!="str
2ing"?s.name:s,n=this._calculate(o,o,o,i);return new qt(this,{kind:"constant",value:n},i)}else if(t.expression.kind==="camera"){let s=this._calculate(t.expression.evaluate({zoom:i.zoom-1}),t.expression.evaluate({zoom:i.zoom}),t.expression.evaluate({zoom:i.zoom+1}),i);return new qt(this,{kind:"constant",value:s},i)}else return new qt(this,t.expression,i)}evaluate(t,i,r,a,s,o){if(t.kind==="source"){let n=t.evaluate(i,r,a,s,o);return this._calculate(n,n,n,i)}else return t.kind==="composite"?this._calculate(t.evaluate({zoom:Math.floor(i.zoom)-1},r,a),t.evaluate({zoom:Math.floor(i.zoom)},r,a),t.evaluate({zoom:Math.floor(i.zoom)+1},r,a),i):t.value}_calculate(t,i,r,a){return a.zoom>a.zoomHistory.lastIntegerZoom?{from:t,to:i}:{from:r,to:i}}interpolate(t){return t}},am=class{constructor(t,i){this.specification=t,this.name=i}possiblyEvaluate(t,i,r,a){if(t.value!==void 0)if(t.expression.kind==="constant"){let s=t.expression.evaluate(i,null,{},r,a);return this._calculate(s,s,s,i)}else return this._calculate(t.expression.evaluate(new Se(Math.floor(i.zoom-1),i)),t.expression.evaluate(new Se(Math.floor(i.zoom),i)),t.expression.evaluate(new Se(Math.floor(i.zoom+1),i)),i)}_calculate(t,i,r,a){return a.zoom>a.zoomHistory.lastIntegerZoom?{from:t,to:i}:{from:r,to:i}}interpolate(t){return t}},Jo=class{constructor(t,i){this.specification=t,this.name=i}possiblyEvaluate(t,i,r,a){return!!t.expression.evaluate(i,null,{},r,a)}interpolate(){return!1}},Ke=class{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let i in t){let r=t[i];r.specification.overridable&&this.overridableProperties.push(i);let a=this.defaultPropertyValues[i]=new Xo(r,void 0,r.name,void 0),s=this.defaultTransitionablePropertyValues[i]=new Il(r,r.name,void 0);this.defaultTransitioningPropertyValues[i]=s.untransitioned(),this.defaultPossiblyEvaluatedValues[i]=a.possiblyEvaluate({})}}};V("DataDrivenProperty",Z),V("DataConstantProperty",$),V("CrossFadedDataDrivenProperty",qa),V("CrossFadedProperty",am),V("ColorRampProperty",Jo);const Ec=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",zn=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?";var Yt=class extends Ze{constructor(t,i,r){if(super(),this.id=t.id,this.type=t.type,this._globalState=r,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=O0(this.visibility,`layers[${this.id}].layout.visibility`,r),t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter,this._featureFilter=Ga(t.filter,`layers[${this.id}].filter`,r)),i.layout&&(this._unevaluatedLayout=new Y0(i.layout,`layers[${this.id}].layout`,r)),i.paint)){this._transitionablePaint=new Yo(i.paint,`layers[${this.id}].paint`,r);for(let a in t.paint)this.setPaintProperty(a,t.paint[a],{validate:!1});for(let a in t.layout)this.setLayoutProperty(a,t.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ko(i.paint)}}setFilter(t){this.filter=t,this._featureFilter=Ga(t,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){if(t==="visibility")return this.visibility;if(this._transitionablePaint?.hasProperty(t))throw Error(t+Ec);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${t}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){let t=new Set;for(let i of this._visibilityExpression.getGlobalStateRefs())t.add(i);if(this._unevaluatedLayout)for(let i in this._unevaluatedLayout._values){let r=this._unevaluatedLayout._values[i];for(let a of r.getGlobalStateRefs())t.add(a)}for(let i of this._featureFilter.getGlobalStateRefs())t.add(i);return t}getPaintAffectingGlobalStateRefs(){let t=new globalThis.Map;if(this._transitionablePaint)for(let i in this._transitionablePaint._values){let r=this._transitionablePaint._values[i].value;for(let a of r.getGlobalStateRefs()){let s=t.get(a)??[];s.push({name:i,value:r.value}),t.set(a,s)}}return t}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(t,i,r={}){if(t==="visibility"){this.visibility=i,this._visibilityExpression.setValue(i),this.recalculateVisibility();return}if(this._transitionablePaint?.hasProperty(t)){this.fire(new G(Error(t+Ec)));return}
vendor: 1,914 bytes, line 2
2i!=null&&this._validate(_t.layoutProperty,`layers.${this.id}.layout.${t}`,t,i,r)||this._unevaluatedLayout.setValue(t,i)}getPaintProperty(t){if(t.endsWith("-transition")){let i=t.slice(0,-11);if(i==="visibility"||this._unevaluatedLayout?.hasProperty(i))throw Error(t+zn);return this._transitionablePaint.getTransition(i)}else{if(t==="visibility"||this._unevaluatedLayout?.hasProperty(t))throw Error(t+zn);return this._transitionablePaint.getValue(t)}}setPaintProperty(t,i,r={}){if(t==="visibility"||this._unevaluatedLayout?.hasProperty(t))return this.fire(new G(Error(t+zn))),!1;if(i!=null&&this._validate(_t.paintProperty,`layers.${this.id}.paint.${t}`,t,i,r))return!1;if(t.endsWith("-transition"))return this._transitionablePaint.setTransition(t.slice(0,-11),i||void 0),!1;{let a=this._transitionablePaint._values[t],s=a.property.specification["property-type"]==="cross-faded-data-driven",o=a.value.isDataDriven(),n=a.value;this._transitionablePaint.setValue(t,i),this._handleSpecialPaintPropertyUpdate(t);let l=this._transitionablePaint._values[t].value;return l.isDataDriven()||o||s||this._handleOverridablePaintPropertyUpdate(t,n,l)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,i,r){return!1}isHidden(t=this.minzoom,i=!1){return this.minzoom&&t<(i?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&t>=this.maxzoom?!0:this._evaluatedVisibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(t,i){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,i)}
vendor: 20,610 bytes, line 2
2serialize(){let t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout?.serialize(),paint:this._transitionablePaint?.serialize()};return this.visibility&&(t.layout||={},t.layout.visibility=this.visibility),Sd(t,(i,r)=>i!==void 0&&!(r==="layout"&&!Object.keys(i).length)&&!(r==="paint"&&!Object.keys(i).length))}_validate(t,i,r,a,s={}){return ps(this,t,{key:i,layerType:this.type,objectKey:r,value:a},s)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let i=this.paint.get(t);if(!(!(i instanceof qt)||!qr(i.property.specification))&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}};let K0;const J0=()=>K0||=new Ke({"raster-opacity":new $(A.paint_raster["raster-opacity"],"raster-opacity"),"raster-hue-rotate":new $(A.paint_raster["raster-hue-rotate"],"raster-hue-rotate"),"raster-brightness-min":new $(A.paint_raster["raster-brightness-min"],"raster-brightness-min"),"raster-brightness-max":new $(A.paint_raster["raster-brightness-max"],"raster-brightness-max"),"raster-saturation":new $(A.paint_raster["raster-saturation"],"raster-saturation"),"raster-contrast":new $(A.paint_raster["raster-contrast"],"raster-contrast"),resampling:new $(A.paint_raster.resampling,"resampling"),"raster-resampling":new $(A.paint_raster["raster-resampling"],"raster-resampling"),"raster-fade-duration":new $(A.paint_raster["raster-fade-duration"],"raster-fade-duration")});var Q0={get paint(){return J0()}};const El=e=>e.type==="raster";var ex=class extends Yt{constructor(t,i){super(t,Q0,i)}};const tx={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};var ds=class{constructor(t,i){this._structArray=t,this._pos1=i*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},Ce=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,i){return t._trim(),i&&(t.isTransferred=!0,i.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let i=Object.create(this.prototype);return i.arrayBuffer=t.arrayBuffer,i.length=t.length,i.capacity=t.arrayBuffer.byteLength/i.bytesPerElement,i._refreshViews(),i}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*5),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function Me(e,t=1){let i=0,r=0;return{members:e.map(a=>{let s=ix(a.type),o=i=Mc(i,Math.max(t,s)),n=a.components||1;return r=Math.max(r,s),i+=s*n,{name:a.name,type:a.type,components:n,offset:o}}),size:Mc(i,Math.max(r,t)),alignment:t}}function ix(e){return tx[e].BYTES_PER_ELEMENT}function Mc(e,t){return Math.ceil(e/t)*t}var Wa=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i){let r=this.length;return this.resize(r+1),this.emplace(r,t,i)}emplace(t,i,r){let a=t*2;return this.int16[a+0]=i,this.int16[a+1]=r,t}};Wa.prototype.bytesPerElement=4,V("StructArrayLayout2i4",Wa);var go=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,r){let a=this.length;return this.resize(a+1),this.emplace(a,t,i,r)}emplace(t,i,r,a){let s=t*3;return this.int16[s+0]=i,this.int16[s+1]=r,this.int16[s+2]=a,t}};go.prototype.bytesPerElement=6,V("StructArrayLayout3i6",go);var Ml=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,r,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,i,r,a)}emplace(t,i,r,a,s){let o=t*4;return this.int16[o+0]=i,this.int16[o+1]=r,this.int16[o+2]=a,this.int16[o+3]=s,t}};Ml.prototype.bytesPerElement=8,V("StructArrayLayout4i8",Ml);var Al=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,r,a,s,o){let n=this.length;return this.resize(n+1),this.emplace(n,t,i,r,a,s,o)}emplace(t,i,r,a,s,o,n){let l=t*6;return this.int16[l+0]=i,this.int16[l+1]=r,this.int16[l+2]=a,this.int16[l+3]=s,this.int16[l+4]=o,this.int16[l+5]=n,t}};Al.prototype.bytesPerElement=12,V("StructArrayLayout2i4i12",Al);var Cl=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,r,a,s,o){let n=this.length;return this.resize(n+1),this.emplace(n,t,i,r,a,s,o)}emplace(t,i,r,a,s,o,n){let l=t*4,u=t*8;return this.int16[l+0]=i,this.int16[l+1]=r,this.uint8[u+4]=a,this.uint8[u+5]=s,this.uint8[u+6]=o,this.uint8[u+7]=n,t}};Cl.prototype.bytesPerElement=8,V("StructArrayLayout2i4ub8",Cl);var Ha=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i){let r=this.length;return this.resize(r+1),this.emplace(r,t,i)}emplace(t,i,r){let a=t*2;return this.float32[a+0]=i,this.float32[a+1]=r,t}};Ha.prototype.bytesPerElement=8,V("StructArrayLayout2f8",Ha);var Dl=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,r,a,s,o,n,l,u,h){let c=this.length;return this.resize(c+1),this.emplace(c,t,i,r,a,s,o,n,l,u,h)}emplace(t,i,r,a,s,o,n,l,u,h,c){let p=t*10;return this.uint16[p+0]=i,this.uint16[p+1]=r,this.uint16[p+2]=a,this.uint16[p+3]=s,this.uint16[p+4]=o,this.uint16[p+5]=n,this.uint16[p+6]=l,this.uint16[p+7]=u,this.uint16[p+8]=h,this.uint16[p+9]=c,t}};Dl.prototype.bytesPerElement=20,V("StructArrayLayout10ui20",Dl);var zl=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,r,a,s,o,n,l){let u=this.length;return this.resize(u+1),this.emplace(u,t,i,r,a,s,o,n,l)}emplace(t,i,r,a,s,o,n,l,u){let h=t*8;return this.uint16[h+0]=i,this.uint16[h+1]=r,this.uint16[h+2]=a,this.uint16[h+3]=s,this.uint16[h+4]=o,this.uint16[h+5]=n,this.uint16[h+6]=l,this.uint16[h+7]=u,t}};zl.prototype.bytesPerElement=16,V("StructArrayLayout8ui16",zl);var Rl=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,r,a,s,o,n,l,u,h,c,p){let d=this.length;return this.resize(d+1),this.emplace(d,t,i,r,a,s,o,n,l,u,h,c,p)}emplace(t,i,r,a,s,o,n,l,u,h,c,p,d){let f=t*12;return this.int16[f+0]=i,this.int16[f+1]=r,this.int16[f+2]=a,this.int16[f+3]=s,this.uint16[f+4]=o,this.uint16[f+5]=n,this.uint16[f+6]=l,this.uint16[f+7]=u,this.int16[f+8]=h,this.int16[f+9]=c,this.int16[f+10]=p,this.int16[f+11]=d,t}};Rl.prototype.bytesPerElement=24,V("StructArrayLayout4i4ui4i24",Rl);var kl=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,r){let a=this.length;return this.resize(a+1),this.emplace(a,t,i,r)}emplace(t,i,r,a){let s=t*3;return this.float32[s+0]=i,this.float32[s+1]=r,this.float32[s+2]=a,t}};kl.prototype.bytesPerElement=12,V("StructArrayLayout3f12",kl);var Ll=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){let r=t*1;return this.uint32[r+0]=i,t}};Ll.prototype.bytesPerElement=4,V("StructArrayLayout1ul4",Ll);var Fl=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,r,a,s,o,n,l,u){let h=this.length;return this.resize(h+1),this.emplace(h,t,i,r,a,s,o,n,l,u)}emplace(t,i,r,a,s,o,n,l,u,h){let c=t*10,p=t*5;return this.int16[c+0]=i,this.int16[c+1]=r,this.int16[c+2]=a,this.int16[c+3]=s,this.int16[c+4]=o,this.int16[c+5]=n,this.uint32[p+3]=l,this.uint16[c+8]=u,this.uint16[c+9]=h,t}};Fl.prototype.bytesPerElement=20,V("StructArrayLayout6i1ul2ui20",Fl);var Bl=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,r,a,s,o){let n=this.length;return this.resize(n+1),this.emplace(n,t,i,r,a,s,o)}emplace(t,i,r,a,s,o,n){let l=t*6;return this.int16[l+0]=i,this.int16[l+1]=r,this.int16[l+2]=a,this.int16[l+3]=s,this.int16[l+4]=o,this.int16[l+5]=n,t}};Bl.prototype.bytesPerElement=12,V("StructArrayLayout2i2i2i12",Bl);var Ol=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,r,a,s){let o=this.length;return this.resize(o+1),this.emplace(o,t,i,r,a,s)}emplace(t,i,r,a,s,o){let n=t*4,l=t*8;return this.float32[n+0]=i,this.float32[n+1]=r,this.float32[n+2]=a,this.int16[l+6]=s,this.int16[l+7]=o,t}};Ol.prototype.bytesPerElement=16,V("StructArrayLayout2f1f2i16",Ol);var $l=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,r,a,s,o){let n=this.length;return this.resize(n+1),this.emplace(n,t,i,r,a,s,o)}emplace(t,i,r,a,s,o,n){let l=t*16,u=t*4,h=t*8;return this.uint8[l+0]=i,this.uint8[l+1]=r,this.float32[u+1]=a,this.float32[u+2]=s,this.int16[h+6]=o,this.int16[h+7]=n,t}};$l.prototype.bytesPerElement=16,V("StructArrayLayout2ub2f2i16",$l);var yo=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,r){let a=this.length;return this.resize(a+1),this.emplace(a,t,i,r)}emplace(t,i,r,a){let s=t*3;return this.uint16[s+0]=i,this.uint16[s+1]=r,this.uint16[s+2]=a,t}};yo.prototype.bytesPerElement=6,V("StructArrayLayout3ui6",yo);var Vl=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,r,a,s,o,n,l,u,h,c,p,d,f,m,_,g){let x=this.length;return this.resize(x+1),this.emplace(x,t,i,r,a,s,o,n,l,u,h,c,p,d,f,m,_,g)}emplace(t,i,r,a,s,o,n,l,u,h,c,p,d,f,m,_,g,x){let y=t*24,v=t*12,w=t*48;return this.int16[y+0]=i,this.int16[y+1]=r,this.uint16[y+2]=a,this.uint16[y+3]=s,this.uint32[v+2]=o,this.uint32[v+3]=n,this.uint32[v+4]=l,this.uint16[y+10]=u,this.uint16[y+11]=h,this.uint16[y+12]=c,this.float32[v+7]=p,this.float32[v+8]=d,this.uint8[w+36]=f,this.uint8[w+37]=m,this.uint8[w+38]=_,this.uint32[v+10]=g,this.int16[y+22]=x,t}};Vl.prototype.bytesPerElement=48,V("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Vl);var jl=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,r,a,s,o,n,l,u,h,c,p,d,f,m,_,g,x,y,v,w,b,T,I,M,D,L,z){let P=this.length;return this.resize(P+1),this.emplace(P,t,i,r,a,s,o,n,l,u,h,c,p,d,f,m,_,g,x,y,v,w,b,T,I,M,D,L,z)}emplace(t,i,r,a,s,o,n,l,u,h,c,p,d,f,m,_,g,x,y,v,w,b,T,I,M,D,L,z,P){let S=t*32,F=t*16;return this.int16[S+0]=i,this.int16[S+1]=r,this.int16[S+2]=a,this.int16[S+3]=s,this.int16[S+4]=o,this.int16[S+5]=n,this.int16[S+6]=l,this.int16[S+7]=u,this.uint16[S+8]=h,this.uint16[S+9]=c,this.uint16[S+10]=p,this.uint16[S+11]=d,this.uint16[S+12]=f,this.uint16[S+13]=m,this.uint16[S+14]=_,this.uint16[S+15]=g,this.uint16[S+16]=x,this.uint16[S+17]=y,this.uint16[S+18]=v,this.uint16[S+19]=w,this.uint16[S+20]=b,this.uint16[S+21]=T,this.uint16[S+22]=I,this.uint32[F+12]=M,this.float32[F+13]=D,this.float32[F+14]=L,this.uint16[S+30]=z,this.uint16[S+31]=P,t}};jl.prototype.bytesPerElement=64,V("StructArrayLayout8i15ui1ul2f2ui64",jl);var vo=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){let r=t*1;return this.float32[r+0]=i,t}};vo.prototype.bytesPerElement=4,V("StructArrayLayout1f4",vo);var Nl=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,r){let a=this.length;return this.resize(a+1),this.emplace(a,t,i,r)}emplace(t,i,r,a){let s=t*6,o=t*3;return this.uint16[s+0]=i,this.float32[o+1]=r,this.float32[o+2]=a,t}};Nl.prototype.bytesPerElement=12,V("StructArrayLayout1ui2f12",Nl);var Ul=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,r){let a=this.length;return this.resize(a+1),this.emplace(a,t,i,r)}emplace(t,i,r,a){let s=t*2,o=t*4;return this.uint32[s+0]=i,this.uint16[o+2]=r,this.uint16[o+3]=a,t}};Ul.prototype.bytesPerElement=8,V("StructArrayLayout1ul2ui8",Ul);var Gl=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i){let r=this.length;return this.resize(r+1),this.emplace(r,t,i)}emplace(t,i,r){let a=t*2;return this.uint16[a+0]=i,this.uint16[a+1]=r,t}};Gl.prototype.bytesPerElement=4,V("StructArrayLayout2ui4",Gl);var Zl=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){let r=t*1;return this.uint16[r+0]=i,t}};Zl.prototype.bytesPerElement=2,V("StructArrayLayout1ui2",Zl);var ql=class extends Ce{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,r,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,i,r,a)}emplace(t,i,r,a,s){let o=t*4;return this.float32[o+0]=i,this.float32[o+1]=r,this.float32[o+2]=a,this.float32[o+3]=s,t}};ql.prototype.bytesPerElement=16,V("StructArrayLayout4f16",ql);var sm=class extends ds{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new E(this.anchorPointX,this.anchorPointY)}};sm.prototype.size=20;var om=class extends Fl{get(t){return new sm(this,t)}};V("CollisionBoxArray",om);var nm=class extends ds{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}};nm.prototype.size=48;var lm=class extends Vl{get(t){return new nm(this,t)}};V("PlacedSymbolArray",lm);var um=class extends ds{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}};um.prototype.size=64;var hm=class extends jl{get(t){return new um(this,t)}};V("SymbolInstanceArray",hm);var cm=class extends vo{getoffsetX(t){return this.float32[t*1+0]}};V("GlyphOffsetArray",cm);var pm=class extends go{getx(t){return this.int16[t*3+0]}gety(t){return this.int16[t*3+1]}gettileUnitDistanceFromAnchor(t){return this.int16[t*3+2]}};V("SymbolLineVertexArray",pm);var dm=class extends ds{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};dm.prototype.size=12;var fm=class extends Nl{get(t){return new dm(this,t)}};V("TextAnchorOffsetArray",fm);var mm=class extends ds{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}};mm.prototype.size=8;var _m=class extends Ul{get(t){return new mm(this,t)}};V("FeatureIndexArray",_m);var Oi=class extends Wa{},rx=class extends go{},ax=class extends Ml{},sx=class extends Wa{},ox=class extends Wa{},nx=class extends Al{},lx=class extends Cl{},ux=class extends Ha{},Tr=class extends Dl{},Ac=class extends zl{},hx=class extends Rl{},cx=class extends kl{},px=class extends Ll{},Cc=class extends Bl{},dx=class extends Ol{},fx=class extends $l{},mx=class extends yo{},hi=class extends yo{},Wl=class extends Gl{},_x=class extends Zl{};const gx=Me([{name:"a_pos",components:2,type:"Int16"}],4),yx=gx.members;
vendor: 7,972 bytes, line 2
2var Te=class zr{constructor(t=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=t}prepareSegment(t,i,r,a){let s=this.segments[this.segments.length-1];return t>zr.MAX_VERTEX_ARRAY_LENGTH&&ge(`Max vertices per segment is ${zr.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${zr.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!s||s.vertexLength+t>zr.MAX_VERTEX_ARRAY_LENGTH||s.sortKey!==a?this.createNewSegment(i,r,a):s}createNewSegment(t,i,r){let a={vertexOffset:t.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0,vaos:{}};return r!==void 0&&(a.sortKey=r),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(a),a}getOrCreateLatestSegment(t,i,r){return this.prepareSegment(0,t,i,r)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let t of this.segments)for(let i in t.vaos)t.vaos[i].destroy()}static simpleSegment(t,i,r,a){return new zr([{vertexOffset:t,primitiveOffset:i,vertexLength:r,primitiveLength:a,vaos:{},sortKey:0}])}};Te.MAX_VERTEX_ARRAY_LENGTH=2**16-1,V("SegmentVector",Te);function Dc(e,t){return e=oe(Math.floor(e),0,255),t=oe(Math.floor(t),0,255),256*e+t}const vx=Me([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),xx=Me([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var bx=Mu(((e,t)=>{function i(r,a){for(var s=r.length&3,o=r.length-s,n=a,l,u=3432918353,h=461845907,c,p=0;p<o;)c=r.charCodeAt(p)&255|(r.charCodeAt(++p)&255)<<8|(r.charCodeAt(++p)&255)<<16|(r.charCodeAt(++p)&255)<<24,++p,c=(c&65535)*u+(((c>>>16)*u&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)&4294967295,n^=c,n=n<<13|n>>>19,l=(n&65535)*5+(((n>>>16)*5&65535)<<16)&4294967295,n=(l&65535)+27492+(((l>>>16)+58964&65535)<<16);switch(c=0,s){case 3:c^=(r.charCodeAt(p+2)&255)<<16;case 2:c^=(r.charCodeAt(p+1)&255)<<8;case 1:c^=r.charCodeAt(p)&255,c=(c&65535)*u+(((c>>>16)*u&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)&4294967295,n^=c}return n^=r.length,n^=n>>>16,n=(n&65535)*2246822507+(((n>>>16)*2246822507&65535)<<16)&4294967295,n^=n>>>13,n=(n&65535)*3266489909+(((n>>>16)*3266489909&65535)<<16)&4294967295,n^=n>>>16,n>>>0}t!==void 0&&(t.exports=i)})),wx=Mu(((e,t)=>{function i(r,a){for(var s=r.length,o=a^s,n=0,l;s>=4;)l=r.charCodeAt(n)&255|(r.charCodeAt(++n)&255)<<8|(r.charCodeAt(++n)&255)<<16|(r.charCodeAt(++n)&255)<<24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),l^=l>>>24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16)^l,s-=4,++n;switch(s){case 3:o^=(r.charCodeAt(n+2)&255)<<16;case 2:o^=(r.charCodeAt(n+1)&255)<<8;case 1:o^=r.charCodeAt(n)&255,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16)}return o^=o>>>13,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),o^=o>>>15,o>>>0}t.exports=i})),Tx=Fg(Mu(((e,t)=>{var i=bx(),r=wx();t.exports=i,t.exports.murmur3=i,t.exports.murmur2=r}))()),gm=class ym{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,i,r,a){this.ids.push(zc(t)),this.positions.push(i,r,a)}getPositions(t){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let i=zc(t),r=0,a=this.ids.length-1;for(;r<a;){let o=r+a>>1;this.ids[o]>=i?a=o:r=o+1}let s=[];for(;this.ids[r]===i;){let o=this.positions[3*r],n=this.positions[3*r+1],l=this.positions[3*r+2];s.push({index:o,start:n,end:l}),r++}return s}static serialize(t,i){let r=new Float64Array(t.ids),a=new Uint32Array(t.positions);return Hl(r,a,0,r.length-1),i&&i.push(r.buffer,a.buffer),{ids:r,positions:a}}static deserialize(t){let i=new ym;return i.ids=t.ids,i.positions=t.positions,i.indexed=!0,i}};function zc(e){let t=+e;return!isNaN(t)&&t<=2**53-1?t:(0,Tx.default)(String(e))}function Hl(e,t,i,r){for(;i<r;){let a=e[i+r>>1],s=i-1,o=r+1;for(;;){do s++;while(e[s]<a);do o--;while(e[o]>a);if(s>=o)break;zs(e,s,o),zs(t,3*s,3*o),zs(t,3*s+1,3*o+1),zs(t,3*s+2,3*o+2)}o-i<r-o?(Hl(e,t,i,o),i=o+1):(Hl(e,t,o+1,r),r=o)}}function zs(e,t,i){let r=e[t];e[t]=e[i],e[i]=r}V("FeaturePositionMap",gm);var Mi=class{constructor(t,i){this.gl=t.gl,this.location=i}},q=class extends Mi{constructor(t,i){super(t,i),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))}},k=class extends Mi{constructor(t,i){super(t,i),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}},X=class extends Mi{constructor(t,i){super(t,i),this.current=[0,0]}set(t){(t[0]!==this.current[0]||t[1]!==this.current[1])&&(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))}},Tt=class extends Mi{constructor(t,i){super(t,i),this.current=[0,0,0]}set(t){(t[0]!==this.current[0]||t[1]!==this.current[1]||t[2]!==this.current[2])&&(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))}},Zi=class extends Mi{constructor(t,i){super(t,i),this.current=[0,0,0,0]}set(t){(t[0]!==this.current[0]||t[1]!==this.current[1]||t[2]!==this.current[2]||t[3]!==this.current[3])&&(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}},qi=class extends Mi{constructor(t,i){super(t,i),this.current=K.transparent}set(t){(t.r!==this.current.r||t.g!==this.current.g||t.b!==this.current.b||t.a!==this.current.a)&&(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}},Rc=class extends Mi{constructor(t,i){super(t,i),this.current=[]}set(t){if(t!=this.current){this.current=t;let i=new Float32Array(t.length*4);for(let r=0;r<t.length;r++)i[4*r]=t[r].r,i[4*r+1]=t[r].g,i[4*r+2]=t[r].b,i[4*r+3]=t[r].a;this.gl.uniform4fv(this.location,i)}}},kc=class extends Mi{constructor(t,i){super(t,i),this.current=[]}set(t){if(t!=this.current){this.current=t;let i=new Float32Array(t);this.gl.uniform1fv(this.location,i)}}};const Sx=new Float32Array(16);var Pt=class extends Mi{constructor(t,i){super(t,i),this.current=Sx}set(t){if(t[12]!==this.current[12]||t[0]!==this.current[0]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);return}for(let i=1;i<16;i++)if(t[i]!==this.current[i]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}}};function Xl(e){return[Dc(255*e.r,255*e.g),Dc(255*e.b,255*e.a)]}var Ia=class{constructor(t,i,r){this.value=t,this.uniformNames=i.map(a=>`u_${a}`),this.type=r}setUniform(t,i,r){t.set(r.constantOr(this.value))}getBinding(t,i,r){return this.type==="color"?new qi(t,i):new k(t,i)}},Qi=class{constructor(t,i){this.uniformNames=i.map(r=>`u_${r}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,i){this.pixelRatioFrom=i.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=i.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,i){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,i.y,i.height,i.width]}setUniform(t,i,r,a){let s=null;a==="u_pattern_to"?s=this.patternTo:a==="u_pattern_from"?s=this.patternFrom:a==="u_dasharray_to"?s=this.dashTo:a==="u_dasharray_from"?s=this.dashFrom:a==="u_pixel_ratio_to"?s=this.pixelRatioTo:a==="u_pixel_ratio_from"&&(s=this.pixelRatioFrom),s!==null&&t.set(s)}getBinding(t,i,r){return r.startsWith("u_pattern")||r.startsWith("u_dasharray_")?new Zi(t,i):new k(t,i)}},pi=class{constructor(t,i,r,a){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=i.map(s=>({name:`a_${s}`,type:"Float32",components:r==="color"?2:1,offset:0})),this.paintVertexArray=new a}populatePaintArray(t,i,r){let a=this.paintVertexArray.length,s=this.expression.evaluate(new Se(0,r),i,{},r.canonical,[],r.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(a,t,s)}updatePaintArray(t,i,r,a,s){let o=this.expression.evaluate(new Se(0,s),r,a);this._setPaintValue(t,i,o)}
vendor: 17,035 bytes, line 2
2_setPaintValue(t,i,r){if(this.type==="color"){let a=Xl(r);for(let s=t;s<i;s++)this.paintVertexArray.emplace(s,a[0],a[1])}else{for(let a=t;a<i;a++)this.paintVertexArray.emplace(a,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(t){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},Ut=class{constructor(t,i,r,a,s,o){this.expression=t,this.uniformNames=i.map(n=>`u_${n}_t`),this.type=r,this.useIntegerZoom=a,this.zoom=s,this.maxValue=0,this.paintVertexAttributes=i.map(n=>({name:`a_${n}`,type:"Float32",components:r==="color"?4:2,offset:0})),this.paintVertexArray=new o}populatePaintArray(t,i,r){let a=this.expression.evaluate(new Se(this.zoom,r),i,{},r.canonical,[],r.formattedSection),s=this.expression.evaluate(new Se(this.zoom+1,r),i,{},r.canonical,[],r.formattedSection),o=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(o,t,a,s)}updatePaintArray(t,i,r,a,s){let o=this.expression.evaluate(new Se(this.zoom,s),r,a),n=this.expression.evaluate(new Se(this.zoom+1,s),r,a);this._setPaintValue(t,i,o,n)}_setPaintValue(t,i,r,a){if(this.type==="color"){let s=Xl(r),o=Xl(a);for(let n=t;n<i;n++)this.paintVertexArray.emplace(n,s[0],s[1],o[0],o[1])}else{for(let s=t;s<i;s++)this.paintVertexArray.emplace(s,r,a);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(a))}}upload(t){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,i){let r=this.useIntegerZoom?Math.floor(i.zoom):i.zoom,a=oe(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(a)}getBinding(t,i,r){return new k(t,i)}},ki=class{constructor(t,i,r,a,s,o){this.expression=t,this.type=i,this.useIntegerZoom=r,this.zoom=a,this.layerId=o,this.zoomInPaintVertexArray=new s,this.zoomOutPaintVertexArray=new s}populatePaintArray(t,i,r){let a=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(a,t,this.getPositionIds(i),r)}updatePaintArray(t,i,r,a,s){this._setPaintValues(t,i,this.getPositionIds(r),s)}_setPaintValues(t,i,r,a){let s=this.getPositions(a);if(!s||!r)return;let o=s[r.min],n=s[r.mid],l=s[r.max];if(!(!o||!n||!l))for(let u=t;u<i;u++)this.emplace(this.zoomInPaintVertexArray,u,o,n),this.emplace(this.zoomOutPaintVertexArray,u,l,n)}upload(t){if(this.zoomInPaintVertexArray?.arrayBuffer.byteLength&&this.zoomOutPaintVertexArray?.arrayBuffer.byteLength){let i=this.getVertexAttributes();this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,i,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,i,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},vm=class extends ki{getPositions(t){return t.imagePositions}getPositionIds(t){return t.patterns?.[this.layerId]}getVertexAttributes(){return vx.members}emplace(t,i,r,a){t.emplace(i,r.tlbr[0],r.tlbr[1],r.tlbr[2],r.tlbr[3],a.tlbr[0],a.tlbr[1],a.tlbr[2],a.tlbr[3],r.pixelRatio,a.pixelRatio)}},xm=class extends ki{getPositions(t){return t.dashPositions}getPositionIds(t){return t.dashes?.[this.layerId]}getVertexAttributes(){return xx.members}emplace(t,i,r,a){t.emplace(i,0,r.y,r.height,r.width,0,a.y,a.height,a.width)}},bm=class{constructor(t,i,r){this.binders={},this._buffers=[];let a=[];for(let s in t.paint._values){if(!r(s))continue;let o=t.paint.get(s);if(!(o instanceof qt)||!qr(o.property.specification))continue;let n=Px(s,t.type),l=o.value,u=o.property.specification.type,h=o.property.useIntegerZoom,c=o.property.specification["property-type"],p=c==="cross-faded"||c==="cross-faded-data-driven";if(l.kind==="constant")this.binders[s]=p?new Qi(l.value,n):new Ia(l.value,n,u),a.push(`/u_${s}`);else if(l.kind==="source"||p){let d=Lc(s,u,"source");this.binders[s]=p?s==="line-dasharray"?new xm(l,u,h,i,d,t.id):new vm(l,u,h,i,d,t.id):new pi(l,n,u,d),a.push(`/a_${s}`)}else{let d=Lc(s,u,"composite");this.binders[s]=new Ut(l,n,u,h,i,d),a.push(`/z_${s}`)}}this.cacheKey=a.sort().join("")}getMaxValue(t){let i=this.binders[t];return i instanceof pi||i instanceof Ut?i.maxValue:0}populatePaintArrays(t,i,r){for(let a in this.binders){let s=this.binders[a];(s instanceof pi||s instanceof Ut||s instanceof ki)&&s.populatePaintArray(t,i,r)}}setConstantPatternPositions(t,i){for(let r in this.binders){let a=this.binders[r];a instanceof Qi&&a.setConstantPatternPositions(t,i)}}setConstantDashPositions(t,i){for(let r in this.binders){let a=this.binders[r];a instanceof Qi&&a.setConstantDashPositions(t,i)}}updatePaintArrays(t,i,r,a,s){let o=!1;for(let n of t){let l=i.getPositions(n.id);for(let u of l){let h=r.feature(u.index);for(let c in this.binders){let p=this.binders[c];(p instanceof pi||p instanceof Ut||p instanceof ki)&&p.expression.isStateDependent===!0&&(p.expression=a.paint.get(c).value,p.updatePaintArray(u.start,u.end,h,n.state,s),o=!0)}}}return o}defines(){let t=[];for(let i in this.binders){let r=this.binders[i];(r instanceof Ia||r instanceof Qi)&&t.push(...r.uniformNames.map(a=>`#define HAS_UNIFORM_${a}`))}return t}getBinderAttributes(){let t=[];for(let i in this.binders){let r=this.binders[i];if(r instanceof pi||r instanceof Ut)for(let a of r.paintVertexAttributes)t.push(a.name);else if(r instanceof ki){let a=r.getVertexAttributes();for(let s of a)t.push(s.name)}}return t}getBinderUniforms(){let t=[];for(let i in this.binders){let r=this.binders[i];if(r instanceof Ia||r instanceof Qi||r instanceof Ut)for(let a of r.uniformNames)t.push(a)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,i){let r=[];for(let a in this.binders){let s=this.binders[a];if(s instanceof Ia||s instanceof Qi||s instanceof Ut){for(let o of s.uniformNames)if(i[o]){let n=s.getBinding(t,i[o],o);r.push({name:o,property:a,binding:n})}}}return r}setUniforms(t,i,r,a){for(let{name:s,property:o,binding:n}of i)this.binders[o].setUniform(n,a,r.get(o),s)}updatePaintBuffers(t){this._buffers=[];for(let i in this.binders){let r=this.binders[i];if(t&&r instanceof ki){let a=t.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;a&&this._buffers.push(a)}else(r instanceof pi||r instanceof Ut)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(t){for(let i in this.binders){let r=this.binders[i];(r instanceof pi||r instanceof Ut||r instanceof ki)&&r.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let i=this.binders[t];(i instanceof pi||i instanceof Ut||i instanceof ki)&&i.destroy()}}},cr=class{constructor(t,i,r=()=>!0){this.programConfigurations={};for(let a of t)this.programConfigurations[a.id]=new bm(a,i,r);this.needsUpload=!1,this._featureMap=new gm,this._bufferOffset=0}populatePaintArrays(t,i,r,a){for(let s in this.programConfigurations)this.programConfigurations[s].populatePaintArrays(t,i,a);i.id!==void 0&&this._featureMap.add(i.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,i,r,a){for(let s of r)this.needsUpload=this.programConfigurations[s.id].updatePaintArrays(t,this._featureMap,i,s,a)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let i in this.programConfigurations)this.programConfigurations[i].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}};function Px(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}function Ix(e){return{"line-pattern":{source:Tr,composite:Tr},"fill-pattern":{source:Tr,composite:Tr},"fill-extrusion-pattern":{source:Tr,composite:Tr},"line-dasharray":{source:Ac,composite:Ac}}[e]}function Lc(e,t,i){let r={color:{source:Ha,composite:ql},number:{source:vo,composite:Ha}};return Ix(e)?.[i]||r[t][i]}V("ConstantBinder",Ia),V("CrossFadedConstantBinder",Qi),V("SourceExpressionBinder",pi),V("CrossFadedPatternBinder",vm),V("CrossFadedDasharrayBinder",xm),V("CompositeExpressionBinder",Ut),V("ProgramConfiguration",bm,{omit:["_buffers"]}),V("ProgramConfigurationSet",cr);const Yl=2**14-1,Fc=-Yl-1;function mr(e){let t=C/e.extent,i=e.loadGeometry();for(let r of i)for(let a of r){let s=Math.round(a.x*t),o=Math.round(a.y*t);a.x=oe(s,Fc,Yl),a.y=oe(o,Fc,Yl),(s<a.x||s>a.x+1||o<a.y||o>a.y+1)&&ge("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return i}function _r(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?mr(e):[]}}const Bc=-32768;function Ex(e,t,i,r,a){e.emplaceBack(Bc+t*8+r,Bc+i*8+a)}var Qu=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new sx,this.indexArray=new hi,this.segments=new Te,this.programConfigurations=new cr(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,r){let a=this.layers[0],s=[],o=null,n=!1,l=a.type==="heatmap";if(a.type==="circle"){let p=a;o=p.layout.get("circle-sort-key"),n=!o.isConstant(),l||=p.paint.get("circle-pitch-alignment")==="map"}let u=l?i.subdivisionGranularity.circle:1,h=new Se(this.zoom),c=this.layers[0]._featureFilter.needGeometry;for(let{feature:p,id:d,index:f,sourceLayerIndex:m}of t){let _=_r(p,c);if(!this.layers[0]._featureFilter.filter(h,_,r))continue;let g=n?o.evaluate(_,{},r):void 0,x={id:d,properties:p.properties,type:p.type,sourceLayerIndex:m,index:f,geometry:c?_.geometry:mr(p),patterns:{},sortKey:g};s.push(x)}n&&s.sort((p,d)=>p.sortKey-d.sortKey);for(let p of s){let{geometry:d,index:f,sourceLayerIndex:m}=p,_=t[f].feature;this.addFeature(p,d,f,r,u),i.featureIndex.insert(_,d,f,m,this.index)}}update(t,i,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,yx),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,i,r,a,s=1){let o;switch(s){case 1:o=[0,7];break;case 3:o=[0,2,5,7];break;case 5:o=[0,1,3,4,6,7];break;case 7:o=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${s}; valid values are 1, 3, 5, 7.`)}let n=o.length;for(let l of i)for(let u of l){let h=u.x,c=u.y;if(h<0||h>=8192||c<0||c>=8192)continue;let p=this.segments.prepareSegment(n*n,this.layoutVertexArray,this.indexArray,t.sortKey),d=p.vertexLength;for(let f=0;f<n;f++)for(let m=0;m<n;m++)Ex(this.layoutVertexArray,h,c,o[m],o[f]);for(let f=0;f<n-1;f++)for(let m=0;m<n-1;m++){let _=d+f*n+m,g=d+(f+1)*n+m;this.indexArray.emplaceBack(_,g+1,_+1),this.indexArray.emplaceBack(_,g,g+1)}p.vertexLength+=n*n,p.primitiveLength+=(n-1)*(n-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:{},canonical:a})}};V("CircleBucket",Qu,{omit:["layers"]});function wm(e,t){for(let i of e)if(Yr(t,i))return!0;for(let i of t)if(Yr(e,i))return!0;return eh(e,t)}function Qo(e,t,i){return Yr(e,t)?!0:Kl(t,e,i)}function Tm(e,t){if(e.length===1)return Oc(t,e[0]);for(let i of t)for(let r of i)if(Yr(e,r))return!0;for(let i of e)if(Oc(t,i))return!0;for(let i of t)if(eh(e,i))return!0;return!1}function Mx(e,t,i){for(let r of t){if(e.length>=3){for(let a of r)if(Yr(e,a))return!0}if(Ax(e,r,i))return!0}return!1}function Ax(e,t,i){if(e.length>1){if(eh(e,t))return!0;for(let r of t)if(Kl(r,e,i))return!0}for(let r of e)if(Kl(r,t,i))return!0;return!1}function eh(e,t){if(e.length===0||t.length===0)return!1;for(let i=0;i<e.length-1;i++){let r=e[i],a=e[i+1];for(let s=0;s<t.length-1;s++){let o=t[s],n=t[s+1];if(Cx(r,a,o,n))return!0}}return!1}function Cx(e,t,i,r){return Bi(e,i,r)!==Bi(t,i,r)&&Bi(e,t,i)!==Bi(e,t,r)}function Kl(e,t,i){let r=i*i;if(t.length===1)return e.distSqr(t[0])<r;for(let a=1;a<t.length;a++){let s=t[a-1],o=t[a];if(Dx(e,s,o)<r)return!0}return!1}function Dx(e,t,i){let r=t.distSqr(i);if(r===0)return e.distSqr(t);let a=((e.x-t.x)*(i.x-t.x)+(e.y-t.y)*(i.y-t.y))/r;return a<0?e.distSqr(t):a>1?e.distSqr(i):e.distSqr(i.sub(t)._mult(a)._add(t))}function Oc(e,t){let i=!1,r,a,s;for(let o of e){r=o;for(let n=0,l=r.length-1;n<r.length;l=n++)a=r[n],s=r[l],a.y>t.y!=s.y>t.y&&t.x<(s.x-a.x)*(t.y-a.y)/(s.y-a.y)+a.x&&(i=!i)}return i}function Yr(e,t){let i=!1;for(let r=0,a=e.length-1;r<e.length;a=r++){let s=e[r],o=e[a];s.y>t.y!=o.y>t.y&&t.x<(o.x-s.x)*(t.y-s.y)/(o.y-s.y)+s.x&&(i=!i)}return i}function zx(e,t,i,r,a){for(let o of e)if(t<=o.x&&i<=o.y&&r>=o.x&&a>=o.y)return!0;let s=[new E(t,i),new E(t,a),new E(r,a),new E(r,i)];if(e.length>2){for(let o of s)if(Yr(e,o))return!0}for(let o=0;o<e.length-1;o++){let n=e[o],l=e[o+1];if(Rx(n,l,s))return!0}return!1}function Rx(e,t,i){let r=i[0],a=i[2];if(e.x<r.x&&t.x<r.x||e.x>a.x&&t.x>a.x||e.y<r.y&&t.y<r.y||e.y>a.y&&t.y>a.y)return!1;let s=Bi(e,t,i[0]);return s!==Bi(e,t,i[1])||s!==Bi(e,t,i[2])||s!==Bi(e,t,i[3])}function Br(e,t,i){let r=t.paint.get(e).value;return r.kind==="constant"?r.value:i.programConfigurations.get(t.id).getMaxValue(e)}function en(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function tn(e,t,i,r,a){if(!t[0]&&!t[1])return e;let s=E.convert(t)._mult(a);i==="viewport"&&s._rotate(-r);let o=[];for(let n of e)o.push(n.sub(s));return o}function kx(e){let t=[];for(let i=0;i<e.length;i++){let r=e[i],a=t.at(-1);(i===0||a&&!r.equals(a))&&t.push(r)}return t}function Lx(e,t){let i=[];for(let r of e){let a=kx(r),s=[];for(let o=0;o<a.length;o++){let n=a[o],l=a[o-1],u=a[o+1],h=o===0?new E(0,0):n.sub(l)._unit()._perp(),c=o===a.length-1?new E(0,0):u.sub(n)._unit()._perp(),p=h._add(c)._unit(),d=p.x*c.x+p.y*c.y;d!==0&&p._mult(1/d),s.push(p._mult(t)._add(n))}i.push(s)}return i}function Fx({queryGeometry:e,size:t},i){return Qo(e,i,t)}function Bx({queryGeometry:e,size:t,transform:i,unwrappedTileID:r,getElevation:a},s){return Qo(e,s,t*(i.projectTileCoordinates(s.x,s.y,r,a).signedDistanceFromCamera/i.cameraToCenterDistance))}function Ox({queryGeometry:e,size:t,transform:i,unwrappedTileID:r,getElevation:a},s){let o=i.projectTileCoordinates(s.x,s.y,r,a).signedDistanceFromCamera,n=t*(i.cameraToCenterDistance/o);return Qo(e,th(s,i,r,a),n)}function $x({queryGeometry:e,size:t,transform:i,unwrappedTileID:r,getElevation:a},s){return Qo(e,th(s,i,r,a),t)}function Sm({queryGeometry:e,size:t,transform:i,unwrappedTileID:r,getElevation:a,pitchAlignment:s="map",pitchScale:o="map"},n){let l=s==="map"?o==="map"?Fx:Bx:o==="map"?Ox:$x,u={queryGeometry:e,size:t,transform:i,unwrappedTileID:r,getElevation:a};for(let h of n)for(let c of h)if(l(u,c))return!0;return!1}function th(e,t,i,r){let a=t.projectTileCoordinates(e.x,e.y,i,r).point;return new E((a.x*.5+.5)*t.width,(-a.y*.5+.5)*t.height)}function Vx(e,t,i,r){return e.map(a=>th(a,t,i,r))}let jx;const Nx=()=>jx||=new Ke({"circle-sort-key":new Z(A.layout_circle["circle-sort-key"],"circle-sort-key")});let Ux;const Gx=()=>Ux||=new Ke({"circle-radius":new Z(A.paint_circle["circle-radius"],"circle-radius"),"circle-color":new Z(A.paint_circle["circle-color"],"circle-color"),"circle-blur":new Z(A.paint_circle["circle-blur"],"circle-blur"),"circle-opacity":new Z(A.paint_circle["circle-opacity"],"circle-opacity"),"circle-translate":new $(A.paint_circle["circle-translate"],"circle-translate"),"circle-translate-anchor":new $(A.paint_circle["circle-translate-anchor"],"circle-translate-anchor"),"circle-pitch-scale":new $(A.paint_circle["circle-pitch-scale"],"circle-pitch-scale"),"circle-pitch-alignment":new $(A.paint_circle["circle-pitch-alignment"],"circle-pitch-alignment"),"cir
2cle-stroke-width":new Z(A.paint_circle["circle-stroke-width"],"circle-stroke-width"),"circle-stroke-color":new Z(A.paint_circle["circle-stroke-color"],"circle-stroke-color"),"circle-stroke-opacity":new Z(A.paint_circle["circle-stroke-opacity"],"circle-stroke-opacity")});var Zx={get paint(){return Gx()},get layout(){return Nx()}};const qx=e=>e.type==="circle";var Wx=class extends Yt{constructor(t,i){super(t,Zx,i)}createBucket(t){return new Qu(t)}queryRadius(t){let i=t;return Br("circle-radius",this,i)+Br("circle-stroke-width",this,i)+en(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:t,feature:i,featureState:r,geometry:a,transform:s,pixelsToTileUnits:o,unwrappedTileID:n,getElevation:l}){let u=tn(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-s.bearingInRadians,o),h=this.paint.get("circle-radius").evaluate(i,r)+this.paint.get("circle-stroke-width").evaluate(i,r),c=this.paint.get("circle-pitch-scale"),p=this.paint.get("circle-pitch-alignment"),d,f;return p==="map"?(d=u,f=h*o):(d=Vx(u,s,n,l),f=h),Sm({queryGeometry:d,size:f,transform:s,unwrappedTileID:n,getElevation:l,pitchAlignment:p,pitchScale:c},a)}},Pm=class extends Qu{};V("HeatmapBucket",Pm,{omit:["layers"]});let Hx;const Xx=()=>Hx||=new Ke({"heatmap-radius":new Z(A.paint_heatmap["heatmap-radius"],"heatmap-radius"),"heatmap-weight":new Z(A.paint_heatmap["heatmap-weight"],"heatmap-weight"),"heatmap-intensity":new $(A.paint_heatmap["heatmap-intensity"],"heatmap-intensity"),"heatmap-color":new Jo(A.paint_heatmap["heatmap-color"],"heatmap-color"),"heatmap-opacity":new $(A.paint_heatmap["heatmap-opacity"],"heatmap-opacity")});var Yx={get paint(){return Xx()}};function ih(e,{width:t,height:i},r,a){if(!a)a=new Uint8Array(t*i*r);else if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==t*i*r)throw RangeError(`mismatched image size. expected: ${a.length} but got: ${t*i*r}`);return e.width=t,e.height=i,e.data=a,e}function Im(e,{width:t,height:i},r){if(t===e.width&&i===e.height)return;let a=ih({},{width:t,height:i},r);rh(e,a,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,t),height:Math.min(e.height,i)},r),e.width=t,e.height=i,e.data=a.data}function rh(e,t,i,r,a,s){if(a.width===0||a.height===0)return t;if(a.width>e.width||a.height>e.height||i.x>e.width-a.width||i.y>e.height-a.height)throw RangeError("out of range source coordinates for image copy");if(a.width>t.width||a.height>t.height||r.x>t.width-a.width||r.y>t.height-a.height)throw RangeError("out of range destination coordinates for image copy");let o=e.data,n=t.data;if(o===n)throw Error("srcData equals dstData, so image is already copied");for(let l=0;l<a.height;l++){let u=((i.y+l)*e.width+i.x)*s,h=((r.y+l)*t.width+r.x)*s;for(let c=0;c<a.width*s;c++)n[h+c]=o[u+c]}return t}var ah=class Em{constructor(t,i){ih(this,t,1,i)}resize(t){Im(this,t,1)}clone(){return new Em({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,i,r,a,s){rh(t,i,r,a,s,1)}},xe=class Mm{constructor(t,i){ih(this,t,4,i)}resize(t){Im(this,t,4)}replace(t,i){i?this.data.set(t):t instanceof Uint8ClampedArray?this.data=new Uint8Array(t.buffer):this.data=t}clone(){return new Mm({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,i,r,a,s){rh(t,i,r,a,s,4)}setPixel(t,i,r){let a=(t*this.width+i)*4;this.data[a+0]=Math.round(r.r*255/r.a),this.data[a+1]=Math.round(r.g*255/r.a),this.data[a+2]=Math.round(r.b*255/r.a),this.data[a+3]=Math.round(r.a*255)}};function Rn(e){let t=new Uint8Array(e.length);for(let i=0;i<e.length;i+=4){let r=e[i+3];t[i+0]=Math.round(e[i+0]*r/255),t[i+1]=Math.round(e[i+1]*r/255),t[i+2]=Math.round(e[i+2]*r/255),t[i+3]=r}return t}V("AlphaImage",ah),V("RGBAImage",xe);function Am(e){let t={},i=e.resolution||256,r=e.clips?e.clips.length:1,a=e.image||new xe({width:i,height:r});if(!_y(i))throw Error(`width is not a power of 2 - ${i}`);let s=(o,n,l)=>{t[e.evaluationKey]=l;let u=e.expression.evaluate(t);a.setPixel(o/4/i,n/4,u)};if(e.clips)for(let o=0,n=0;o<r;++o,n+=i*4)for(let l=0,u=0;l<i;l++,u+=4){let h=l/(i-1),{start:c,end:p}=e.clips[o],d=c*(1-h)+p*h;s(n,u,d)}else for(let o=0,n=0;o<i;o++,n+=4){let l=o/(i-1);s(0,n,l)}return a}const xo="big-fb",Kx=e=>e.type==="heatmap";var Jx=class extends Yt{createBucket(t){return new Pm(t)}constructor(t,i){super(t,Yx,i),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){let t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Am({expression:t,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has("big-fb")&&this.heatmapFbos.delete(xo)}queryRadius(t){return Br("heatmap-radius",this,t)}queryIntersectsFeature({queryGeometry:t,feature:i,featureState:r,geometry:a,transform:s,pixelsToTileUnits:o,unwrappedTileID:n,getElevation:l}){return Sm({queryGeometry:t,size:this.paint.get("heatmap-radius").evaluate(i,r)*o,transform:s,unwrappedTileID:n,getElevation:l},a)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&!this.isHidden()}};let Qx;const e1=()=>Qx||=new Ke({"hillshade-illumination-direction":new $(A.paint_hillshade["hillshade-illumination-direction"],"hillshade-illumination-direction"),"hillshade-illumination-altitude":new $(A.paint_hillshade["hillshade-illumination-altitude"],"hillshade-illumination-altitude"),"hillshade-illumination-anchor":new $(A.paint_hillshade["hillshade-illumination-anchor"],"hillshade-illumination-anchor"),"hillshade-exaggeration":new $(A.paint_hillshade["hillshade-exaggeration"],"hillshade-exaggeration"),"hillshade-shadow-color":new $(A.paint_hillshade["hillshade-shadow-color"],"hillshade-shadow-color"),"hillshade-highlight-color":new $(A.paint_hillshade["hillshade-highlight-color"],"hillshade-highlight-color"),"hillshade-accent-color":new $(A.paint_hillshade["hillshade-accent-color"],"hillshade-accent-color"),"hillshade-method":new $(A.paint_hillshade["hillshade-method"],"hillshade-method"),resampling:new $(A.paint_hillshade.resampling,"resampling")});var t1={get paint(){return e1()}};const i1=e=>e.type==="hillshade";var r1=class extends Yt{constructor(t,i){super(t,t1,i),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get("hillshade-illumination-direction").values,i=this.paint.get("hillshade-illumination-altitude").values,r=this.paint.get("hillshade-highlight-color").values,a=this.paint.get("hillshade-shadow-color").values,s=Math.max(t.length,i.length,r.length,a.length);t=t.concat(Array(s-t.length).fill(t.at(-1))),i=i.concat(Array(s-i.length).fill(i.at(-1))),r=r.concat(Array(s-r.length).fill(r.at(-1))),a=a.concat(Array(s-a.length).fill(a.at(-1)));let o=i.map(De);return{directionRadians:t.map(De),altitudeRadians:o,shadowColor:a,highlightColor:r}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}};let a1;const s1=()=>a1||=new Ke({"color-relief-opacity":new $(A["paint_color-relief"]["color-relief-opacity"],"color-relief-opacity"),"color-relief-color":new Jo(A["paint_color-relief"]["color-relief-color"],"color-relief-color"),resampling:new $(A["paint_color-relief"].resampling,"resampling")});var o1={get paint(){return s1()}};function kn(e){return"data"in e}var ke=class{constructor(t,i,r,a){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this._ownedHandle=this.texture,this.update(i,a)}update(t,i,r){let{width:a,height:s}=t,o=(this.size?.[0]!==a||this.size[1]!==s)&&!r,{context:n}=this,{gl:l}=n;this.useMipmap=!!i?.useMipmap,o&&this.size&&this.format===l.RGBA&&(l.deleteTexture(this.texture),this.texture=l.createTexture(),this._ownedHandle=this.texture),l.bindTexture(l.TEXTURE_2D,this.texture),n.pixelStoreUnpackFlipY.set(!1),n.pixelStoreUnpack.set(1);let u=this.format===l.RGBA&&i?.premultiply!==!1;if(o)if(this.size=[a,s],this.format===l.RGBA&&a>0&&s>0){let h=this.useMipmap?Math.floor(Math.log2(Math.max(a,s)))+1:1;if(l.texStorage2D(l.TEXTURE_2D,h,l.RGBA8,a,s),kn(t)){n.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:c}=t;u&&c&&(c=Rn(c)),c&&l.texSubImage2D(l.TEXTURE_2D,0,0,0,a,s,l.RGBA,l.UNSIGNED_BYTE,c
2)}else n.pixelStoreUnpackPremultiplyAlpha.set(u),l.texSubImage2D(l.TEXTURE_2D,0,0,0,l.RGBA,l.UNSIGNED_BYTE,t)}else kn(t)?(n.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(t,u,a,s,l)):(n.pixelStoreUnpackPremultiplyAlpha.set(u),this._uploadDomImage(t,l));else{let{x:h,y:c}=r||{x:0,y:0};kn(t)?(n.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(t,u,h,c,a,s,l)):(n.pixelStoreUnpackPremultiplyAlpha.set(u),this._updateDomImage(t,h,c,l))}this.useMipmap&&l.generateMipmap(l.TEXTURE_2D),n.pixelStoreUnpackFlipY.setDefault(),n.pixelStoreUnpack.setDefault(),n.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(t,i){i.texImage2D(i.TEXTURE_2D,0,this.format,this.format,i.UNSIGNED_BYTE,t)}_uploadRawData(t,i,r,a,s){let{data:o}=t;i&&o&&(o=Rn(o)),s.texImage2D(s.TEXTURE_2D,0,this.format,r,a,0,this.format,s.UNSIGNED_BYTE,o)}_updateDomImage(t,i,r,a){a.texSubImage2D(a.TEXTURE_2D,0,i,r,a.RGBA,a.UNSIGNED_BYTE,t)}_updateRawData(t,i,r,a,s,o,n){let{data:l}=t;i&&l&&(l=Rn(l)),n.texSubImage2D(n.TEXTURE_2D,0,r,a,s,o,n.RGBA,n.UNSIGNED_BYTE,l)}bind(t,i,r){let{context:a}=this,{gl:s}=a;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),s.bindTexture(s.TEXTURE_2D,this.texture),r===s.LINEAR_MIPMAP_NEAREST&&!this.useMipmap&&(r=s.LINEAR),t!==this.filter&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,t),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,r||t),this.filter=t),i!==this.wrap&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,i),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,i),this.wrap=i)}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},vi,n1=(vi=class{constructor(t,i,r,a=1,s=1,o=1,n=0){if(this.uid=t,i.height!==i.width)throw RangeError("DEM tiles must be square");if(r&&!["mapbox","terrarium","custom"].includes(r)){ge(`"${r}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);return}this.stride=i.height;let l=this.dim=i.height-2;switch(this.data=new Uint32Array(i.data.buffer),vi.byteViewCache.set(this,new Uint8Array(this.data.buffer)),r){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=a,this.greenFactor=s,this.blueFactor=o,this.baseShift=n;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4;break}for(let h=0;h<l;h++)this.data[this._idx(-1,h)]=this.data[this._idx(0,h)],this.data[this._idx(l,h)]=this.data[this._idx(l-1,h)],this.data[this._idx(h,-1)]=this.data[this._idx(h,0)],this.data[this._idx(h,l)]=this.data[this._idx(h,l-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(l,-1)]=this.data[this._idx(l-1,0)],this.data[this._idx(-1,l)]=this.data[this._idx(0,l-1)],this.data[this._idx(l,l)]=this.data[this._idx(l-1,l-1)];let u=this._getByteView();this.min=2**53-1,this.max=-9007199254740991;for(let h=0;h<l;h++)for(let c=0;c<l;c++){let p=this._idx(h,c)*4,d=this._unpackAtIndex(u,p);d>this.max&&(this.max=d),d<this.min&&(this.min=d)}}get(t,i){let r=this._getByteView(),a=this._idx(t,i)*4;return this._unpackAtIndex(r,a)}sampleBilinear(t,i){let r=Math.floor(t),a=Math.floor(i);if(r<-1||r>=this.dim||a<-1||a>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${t}, y: ${i}, dim: ${this.dim}`);let s=this._getByteView(),o=((a+1)*this.stride+r+1)*4,n=this.stride*4,l=t-r,u=i-a,h=this._unpackAtIndex(s,o),c=this._unpackAtIndex(s,o+4),p=this._unpackAtIndex(s,o+n),d=this._unpackAtIndex(s,o+n+4);return h*(1-l)*(1-u)+c*l*(1-u)+p*(1-l)*u+d*l*u}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,i){if(t<-1||t>=this.dim+1||i<-1||i>=this.dim+1)throw RangeError(`Out of range source coordinates for DEM data. x: ${t}, y: ${i}, dim: ${this.dim}`);return(i+1)*this.stride+(t+1)}unpack(t,i,r){return t*this.redFactor+i*this.greenFactor+r*this.blueFactor-this.baseShift}pack(t){return Cm(t,this.getUnpackVector())}getPixels(){return new xe({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(t,i,r){if(this.dim!==t.dim)throw Error("dem dimension mismatch");let a=i*this.dim,s=i*this.dim+this.dim,o=r*this.dim,n=r*this.dim+this.dim;switch(i){case-1:a=s-1;break;case 1:s=a+1;break}switch(r){case-1:o=n-1;break;case 1:n=o+1;break}let l=-i*this.dim,u=-r*this.dim;for(let h=o;h<n;h++)for(let c=a;c<s;c++)this.data[this._idx(c,h)]=t.data[this._idx(c+l,h+u)]}_getByteView(){let t=vi.byteViewCache.get(this);return t?.buffer!==this.data.buffer&&(t=new Uint8Array(this.data.buffer),vi.byteViewCache.set(this,t)),t}_unpackAtIndex(t,i){return this.unpack(t[i],t[i+1],t[i+2])}},vi.byteViewCache=new WeakMap,vi);function Cm(e,t){let i=t[0],r=t[1],a=t[2],s=t[3],o=Math.min(i,r,a),n=Math.round((e+s)/o);return{r:Math.floor(n*o/i)%256,g:Math.floor(n*o/r)%256,b:Math.floor(n*o/a)%256}}V("DEMData",n1);const l1=e=>e.type==="color-relief";var u1=class extends Yt{constructor(t,i){super(t,o1,i)}_createColorRamp(t){let i={elevationStops:[],colorStops:[]},r=this._transitionablePaint._values["color-relief-color"].value.expression;if(r instanceof Ua&&r._styleExpression.expression instanceof Ht){this.colorRampExpression=r;let o=r._styleExpression.expression;i.elevationStops=o.labels,i.colorStops=[];for(let n of i.elevationStops)i.colorStops.push(o.evaluate({globals:{elevation:n}}))}if(i.elevationStops.length<1&&(i.elevationStops=[0],i.colorStops=[K.transparent]),i.elevationStops.length<2&&(i.elevationStops.push(i.elevationStops[0]+1),i.colorStops.push(i.colorStops[0])),i.elevationStops.length<=t)return i;let a={elevationStops:[],colorStops:[]},s=(i.elevationStops.length-1)/(t-1);for(let o=0;o<i.elevationStops.length-.5;o+=s)a.elevationStops.push(i.elevationStops[Math.round(o)]),a.colorStops.push(i.colorStops[Math.round(o)]);return ge(`Too many colors in specification of ${this.id}
2 color-relief layer, may not render properly. Max possible colors: ${t}, provided: ${i.elevationStops.length}`),a}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(t,i,r){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let a=this._createColorRamp(i),s=new xe({width:a.colorStops.length,height:1}),o=new xe({width:a.colorStops.length,height:1});for(let n=0;n<a.elevationStops.length;n++){let l=Cm(a.elevationStops[n],r);o.setPixel(0,n,new K(l.r/255,l.g/255,l.b/255,1)),s.setPixel(0,n,a.colorStops[n])}return this.colorRampTextures={elevationTexture:new ke(t,o,t.gl.RGBA),colorTexture:new ke(t,s,t.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}};const h1=Me([{name:"a_pos",components:2,type:"Int16"}],4),c1=h1.members;function bo(e,t,i){let r=i.patternDependencies,a=!1;for(let s of t){let o=s.paint.get(`${e}-pattern`);o.isConstant()||(a=!0);let n=o.constantOr(null);n&&(a=!0,r[n.to]=!0,r[n.from]=!0)}return a}function sh(e,t,i,r,a){let{zoom:s}=r,o=a.patternDependencies;for(let n of t){let l=n.paint.get(`${e}-pattern`).value;if(l.kind!=="constant"){let u=l.evaluate({zoom:s-1},i,{},a.availableImages),h=l.evaluate({zoom:s},i,{},a.availableImages),c=l.evaluate({zoom:s+1},i,{},a.availableImages);u=u?.name?u.name:u,h=h?.name?h.name:h,c=c?.name?c.name:c,o[u]=!0,o[h]=!0,o[c]=!0,i.patterns[n.id]={min:u,mid:h,max:c}}}return i}const Xa=new Set;let Jl=!1;function p1(e,t,i=2){let r=t&&t.length,a=r?t[0]*i:e.length;Xa.size&&Xa.clear();let s=Dm(e,0,a,i,!0),o=[];if(!s||s.next===s.prev)return o;let n=0,l=0,u=0;if(r&&(s=g1(e,t,s,i)),e.length>80*i){n=e[0],l=e[1];let h=n,c=l;for(let p=i;p<a;p+=i){let d=e[p],f=e[p+1];d<n&&(n=d),f<l&&(l=f),d>h&&(h=d),f>c&&(c=f)}u=Math.max(h-n,c-l),u=u===0?0:32767/u}return Ql(s,o,n,l,u),o}function Dm(e,t,i,r,a){let s=null;if(a===C1(e,t,i,r)>0)for(let o=t;o<i;o+=r)s=jc(o/r|0,e[o],e[o+1],s);else for(let o=i-r;o>=t;o-=r)s=jc(o/r|0,e[o],e[o+1],s);return s&&Ya(s,s.next)&&(Ja(s),s=s.next),s}function pr(e,t=e){let i=t===e,r=e,a;do a=!1,r!==r.next&&(Xa.size===0||!Xa.has(r))&&(Ya(r,r.next)||je(r.prev,r,r.next)===0)?((i||r===t)&&(t=r.prev),Jl=!0,Ja(r),r=r.prev,a=!0):(i||r!==t)&&(r=r.next,a=!i);while(a||r!==t);return t}function Ql(e,t,i,r,a){a&&S1(e,i,r,a);let s=e,o=!1;for(;e.prev!==e.next;){let n=e.prev,l=e.next;if(je(n,e,l)<0&&(a?f1(e,i,r,a):d1(e))){t.push(n.i,e.i,l.i),Ja(e),e=l,s=l;continue}if(e=l,e===s){if(Jl=!1,e=pr(e),Jl){s=e;continue}if(!o){e=m1(e,t),s=e,o=!0;continue}_1(e,t,i,r,a);break}}}function d1(e){let t=e.prev,i=e,r=e.next,a=t.x,s=i.x,o=r.x,n=t.y,l=i.y,u=r.y,h=Math.min(a,s,o),c=Math.min(n,l,u),p=Math.max(a,s,o),d=Math.max(n,l,u),f=r.next;for(;f!==t;){if(f.x>=h&&f.x<=p&&f.y>=c&&f.y<=d&&(a!==f.x||n!==f.y)&&To(a,n,s,l,o,u,f.x,f.y)&&je(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function f1(e,t,i,r){let a=e.prev,s=e,o=e.next,n=a.x,l=s.x,u=o.x,h=a.y,c=s.y,p=o.y,d=Math.min(n,l,u),f=Math.min(h,c,p),m=Math.max(n,l,u),_=Math.max(h,c,p),g=ru(d,f,t,i,r),x=ru(m,_,t,i,r),y=e.prevZ;for(;y&&y.z>=g;){if(y.x>=d&&y.x<=m&&y.y>=f&&y.y<=_&&y!==o&&(n!==y.x||h!==y.y)&&To(n,h,l,c,u,p,y.x,y.y)&&je(y.prev,y,y.next)>=0)return!1;y=y.prevZ}let v=e.nextZ;for(;v&&v.z<=x;){if(v.x>=d&&v.x<=m&&v.y>=f&&v.y<=_&&v!==o&&(n!==v.x||h!==v.y)&&To(n,h,l,c,u,p,v.x,v.y)&&je(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function m1(e,t){let i=e,r=!1;do{let a=i.prev,s=i.next.next;Rm(a,i,i.next,s,!1)&&Ka(a,s)&&Ka(s,a)&&(t.push(a.i,i.i,s.i),Ja(i),Ja(i.next),i=e=s,r=!0),i=i.next}while(i!==e);return r?pr(i):i}function _1(e,t,i,r,a){let s=e;do{let o=s.next.next;for(;o!==s.prev;){if(s.i!==o.i&&E1(s,o)){let n=km(s,o);s=pr(s,s.next),n=pr(n,n.next),Ql(s,t,i,r,a),Ql(n,t,i,r,a);return}o=o.next}s=s.next}while(s!==e)}let eu=!1;function g1(e,t,i,r){let a=[];for(let s=0,o=t.length;s<o;s++){let n=Dm(e,t[s]*r,s<o-1?t[s+1]*r:e.length,r,!1);n===n.next&&Xa.add(n),a.push(I1(n))}a.sort(y1),x1(e.length/r,t.length),zm(i,i),eu=!0;for(let s=0;s<a.length;s++)i=v1(a[s],i);return eu=!1,pr(i)}function y1(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function v1(e,t){let i=w1(e,t);if(!i)return t;let r=km(i,e),a=r.next;return zm(i,a.next),pr(r,r.next),pr(i,i.next)}let ze=new Float64Array,wo=0;const tu=[],iu=[];function x1(e,t){let i=Math.ceil((e+2*t)/16)+t+2;ze.length<i*4&&(ze=new Float64Array(i*4)),wo=0}function zm(e,t){let i=e;do{let r=wo++;tu[r]=i;let a=1/0,s=1/0,o=-1/0,n=-1/0,l=0;do{let h=i.next;i.z=r,i.x<a&&(a=i.x),i.x>o&&(o=i.x),i.y<s&&(s=i.y),i.y>n&&(n=i.y),h.x<a&&(a=h.x),h.x>o&&(o=h.x),h.y<s&&(s=h.y),h.y>n&&(n=h.y),i=h}while(++l<16&&i!==t);iu[r]=i;let u=r*4;ze[u]=a,ze[u+1]=s,ze[u+2]=o,ze[u+3]=n}while(i!==t)}function b1(e,t){let i=e.z*4;t.x<ze[i]&&(ze[i]=t.x),t.y<ze[i+1]&&(ze[i+1]=t.y),t.x>ze[i+2]&&(ze[i+2]=t.x),t.y>ze[i+3]&&(ze[i+3]=t.y)}function $c(e){let t=iu[e];for(;t.prev.next!==t;)t=t.next;return iu[e]=t,t}function Vc(e){let t=tu[e];for(;t.prev.next!==t;)t=t.next;return tu[e]=t,t}
vendor: 10,938 bytes, line 2
2function w1(e,t){let i=t,r=e.x,a=e.y,s=-1/0,o;if(Ya(e,i))return i;for(let p=0,d=0;p<wo;p++,d+=4){if(a<ze[d+1]||a>ze[d+3]||ze[d]>r||ze[d+2]<=s)continue;let f=$c(p);i=Vc(p);do{if(i.prev.next===i){if(Ya(e,i.next))return i.next;if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){let m=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(m<=r&&m>s&&(s=m,o=i.x<i.next.x?i:i.next,m===r))return o}}i=i.next}while(i!==f)}if(!o)return null;let n=o.x,l=o.y,u=Math.min(a,l),h=Math.max(a,l),c=1/0;for(let p=0,d=0;p<wo;p++,d+=4){if(ze[d+2]<n||ze[d]>r||ze[d+3]<u||ze[d+1]>h)continue;let f=$c(p);i=Vc(p);do{if(i.prev.next===i&&r>=i.x&&i.x>=n&&r!==i.x&&To(a<l?r:s,a,n,l,a<l?s:r,a,i.x,i.y)){let m=Math.abs(a-i.y)/(r-i.x);(Ka(i,e)||i.y===a&&i.next.y===a&&i.next.x>r)&&(m<c||m===c&&(i.x>o.x||i.x===o.x&&T1(o,i)))&&(o=i,c=m)}i=i.next}while(i!==f)}return o}function T1(e,t){return je(e.prev,e,t.prev)<0&&je(t.next,e,e.next)<0}const Dt=[];let ua=[],Ki=new Uint32Array,ha=new Uint32Array;const ca=new Uint32Array(256);function S1(e,t,i,r){let a=e,s=0;do a.z=ru(a.x,a.y,t,i,r),Dt[s++]=a,a=a.next;while(a!==e);P1(s);let o=null;for(let n=0;n<s;n++){let l=Dt[n];l.prevZ=o,o&&(o.nextZ=l),o=l}o.nextZ=null}function P1(e){if(e<=32){for(let t=1;t<e;t++){let i=Dt[t],r=i.z,a=t-1;for(;a>=0&&Dt[a].z>r;)Dt[a+1]=Dt[a],a--;Dt[a+1]=i}return}Ki.length<e&&(Ki=new Uint32Array(e),ha=new Uint32Array(e),ua=Array(e));for(let t=0;t<e;t++)Ki[t]=Dt[t].z;Rs(e,Dt,Ki,ua,ha,0),Rs(e,ua,ha,Dt,Ki,8),Rs(e,Dt,Ki,ua,ha,16),Rs(e,ua,ha,Dt,Ki,24)}function Rs(e,t,i,r,a,s){ca.fill(0);for(let n=0;n<e;n++)ca[i[n]>>>s&255]++;let o=0;for(let n=0;n<256;n++){let l=ca[n];ca[n]=o,o+=l}for(let n=0;n<e;n++){let l=i[n],u=ca[l>>>s&255]++;r[u]=t[n],a[u]=l}}function ru(e,t,i,r,a){return e=(e-i)*a|0,t=(t-r)*a|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function I1(e){let t=e,i=e;do(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next;while(t!==e);return i}function To(e,t,i,r,a,s,o,n){return(a-o)*(t-n)>=(e-o)*(s-n)&&(e-o)*(r-n)>=(i-o)*(t-n)&&(i-o)*(s-n)>=(a-o)*(r-n)}function E1(e,t){let i=Ya(e,t)&&je(e.prev,e,e.next)>0&&je(t.prev,t,t.next)>0;return e.next.i!==t.i&&(i||Ka(e,t)&&Ka(t,e)&&(je(e.prev,e,t.prev)!==0||je(e,t.prev,t)!==0))&&!M1(e,t)&&(i||A1(e,t))}function je(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function Ya(e,t){return e.x===t.x&&e.y===t.y}function Rm(e,t,i,r,a=!0){let s=je(e,t,i),o=je(e,t,r),n=je(i,r,e),l=je(i,r,t);return(s>0&&o<0||s<0&&o>0)&&(n>0&&l<0||n<0&&l>0)?!0:a?!!(s===0&&ks(e,i,t)||o===0&&ks(e,r,t)||n===0&&ks(i,e,r)||l===0&&ks(i,t,r)):!1}function ks(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function M1(e,t){let i=Math.min(e.x,t.x),r=Math.max(e.x,t.x),a=Math.min(e.y,t.y),s=Math.max(e.y,t.y),o=e;do{let n=o.next;if(o.x>r&&n.x>r||o.x<i&&n.x<i||o.y>s&&n.y>s||o.y<a&&n.y<a){o=n;continue}if(o.i!==e.i&&n.i!==e.i&&o.i!==t.i&&n.i!==t.i&&Rm(o,n,e,t))return!0;o=n}while(o!==e);return!1}function Ka(e,t){return je(e.prev,e,e.next)<0?je(e,t,e.next)>=0&&je(e,e.prev,t)>=0:je(e,t,e.prev)<0||je(e,e.next,t)<0}function A1(e,t){let i=e,r=!1,a=(e.x+t.x)/2,s=(e.y+t.y)/2;do{let o=i.next;i.y>s!=o.y>s&&a<(o.x-i.x)*(s-i.y)/(o.y-i.y)+i.x&&(r=!r),i=o}while(i!==e);return r}function km(e,t){let i=au(e.i,e.x,e.y),r=au(t.i,t.x,t.y),a=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=a,a.prev=i,r.next=i,i.prev=r,s.next=r,r.prev=s,r}function jc(e,t,i,r){let a=au(e,t,i);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function Ja(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),eu&&b1(e.prev,e.next)}function au(e,t,i){return{i:e,x:t,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function C1(e,t,i,r){let a=0;for(let s=t,o=i-r;s<i;s+=r)a+=(e[o]-e[s])*(e[s+1]+e[o+1]),o=s;return a}var gi=class{constructor(t,i){if(i>t)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=i}getGranularityForZoomLevel(t){let i=1<<t;return Math.max(Math.floor(this._baseZoomGranularity/i),this._minGranularity,1)}},lr,oh=(lr=class{constructor(t){this.fill=t.fill,this.line=t.line,this.tile=t.tile,this.stencil=t.stencil,this.circle=t.circle}},lr.noSubdivision=new lr({fill:new gi(0,0),line:new gi(0,0),tile:new gi(0,0),stencil:new gi(0,0),circle:1}),lr);V("SubdivisionGranularityExpression",gi),V("SubdivisionGranularitySetting",oh);const Ra=-32768,Lr=32767;var D1=class{constructor(t,i){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=t,this._granularityCellSize=C/t,this._canonical=i}_getKey(t,i){return t+=32768,i+=32768,t<<16|i<<0}_vertexToIndex(t,i){if(t<-32768||i<-32768||t>32767||i>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let r=Math.round(t)|0,a=Math.round(i)|0,s=this._getKey(r,a);if(this._vertexDictionary.has(s))return this._vertexDictionary.get(s);let o=this._vertexBuffer.length/2;return this._vertexDictionary.set(s,o),this._vertexBuffer.push(r,a),o}_subdivideTrianglesScanline(t){if(this._granularity<2)return R1(this._vertexBuffer,t);let i=[],r=t.length;for(let a=0;a<r;a+=3){let s=[t[a+0],t[a+1],t[a+2]],o=[this._vertexBuffer[t[a+0]*2+0],this._vertexBuffer[t[a+0]*2+1],this._vertexBuffer[t[a+1]*2+0],this._vertexBuffer[t[a+1]*2+1],this._vertexBuffer[t[a+2]*2+0],this._vertexBuffer[t[a+2]*2+1]],n=1/0,l=1/0,u=-1/0,h=-1/0;for(let m=0;m<3;m++){let _=o[m*2],g=o[m*2+1];n=Math.min(n,_),u=Math.max(u,_),l=Math.min(l,g),h=Math.max(h,g)}if(n===u||l===h)continue;let c=Math.floor(n/this._granularityCellSize),p=Math.ceil(u/this._granularityCellSize),d=Math.floor(l/this._granularityCellSize),f=Math.ceil(h/this._granularityCellSize);if(c===p&&d===f){i.push(...s);continue}for(let m=d;m<f;m++){let _=this._scanlineGenerateVertexRingForCellRow(m,o,s);k1(this._vertexBuffer,_,i)}}return i}_scanlineGenerateVertexRingForCellRow(t,i,r){let a=t*this._granularityCellSize,s=a+this._granularityCellSize,o=[];for(let n=0;n<3;n++){let l=i[n*2],u=i[n*2+1],h=i[(n+1)*2%6],c=i[((n+1)*2+1)%6],p=i[(n+2)*2%6],d=i[((n+2)*2+1)%6],f=h-l,m=c-u,_=f===0,g=m===0,x=(a-u)/m,y=(s-u)/m,v=Math.min(x,y),w=Math.max(x,y);if(!g&&(v>=1||w<=0)||g&&(u<a||u>s)){c>=a&&c<=s&&o.push(r[(n+1)%3]);continue}if(!g&&v>0){let I=l+f*v,M=u+m*v;o.push(this._vertexToIndex(I,M))}let b=l+f*Math.max(v,0),T=l+f*Math.min(w,1);if(_||this._generateIntraEdgeVertices(o,l,u,h,c,b,T),!g&&w<1){let I=l+f*w,M=u+m*w;o.push(this._vertexToIndex(I,M))}(g||c>=a&&c<=s)&&o.push(r[(n+1)%3]),!g&&(c<=a||c>=s)&&this._generateInterEdgeVertices(o,l,u,h,c,p,d,T,a,s)}return o}_generateIntraEdgeVertices(t,i,r,a,s,o,n){let l=a-i,u=s-r,h=u===0,c=h?Math.min(i,a):Math.min(o,n),p=h?Math.max(i,a):Math.max(o,n),d=Math.floor(c/this._granularityCellSize)+1,f=Math.ceil(p/this._granularityCellSize)-1;if(h?i<a:o<n)for(let m=d;m<=f;m++){let _=m*this._granularityCellSize,g=r+u*(_-i)/l;t.push(this._vertexToIndex(_,g))}else for(let m=f;m>=d;m--){let _=m*this._granularityCellSize,g=r+u*(_-i)/l;t.push(this._vertexToIndex(_,g))}}_generateInterEdgeVertices(t,i,r,a,s,o,n,l,u,h){let c=s-r,p=o-a,d=n-s,f=(u-s)/d,m=(h-s)/d,_=Math.min(f,m),g=Math.max(f,m),x=a+p*_,y=Math.floor(Math.min(x,l)/this._granularityCellSize)+1,v=Math.ceil(Math.max(x,l)/this._granularityCellSize)-1,w=l<x,b=d===0;if(b&&(n===u||n===h))return;if(b||_>=1||g<=0){let I=i-o,M=r-n,D=(u-n)/M,L=(h-n)/M,z=o+I*Math.min(D,L);y=Math.floor(Math.min(z,l)/this._granularityCellSize)+1,v=Math.ceil(Math.max(z,l)/this._granularityCellSize)-1,w=l<z}let T=c>0?h:u;if(w)for(let I=y;I<=v;I++){let M=I*this._granularityCellSize;t.push(this._vertexToIndex(M,T))}else for(let I=v;I>=y;I--){let M=I*this._granularityCellSize;t.push(this._vertexToIndex(M,T))}}_generateOutline(t){let i=[];for(let r of t){let a=nh(r,this._granularity,!0),s=this._pointArrayToIndices(a),o=[];for(let n=1;n<s.length;n++)o.push(s[n-1]),o.push(s[n]);i.push(o)}return i}_handlePoles(t){let i=!1,r=!1;this._canonical&&(this._canonical.y===0&&(i=!0),this._canonical.y===(1<<this._canonical.z)-1&&(r=!0)),(i||r)&&this._fillPoles(t,i,r)}_ensureNoPoleVertices(){let t=this._vertexBuffer;for(let i=0;i<t.length;i+=2){let r=t[i+1];r===-32768&&(t[i+1]=-32767),r===32767&&(t[i+1]=Lr-1)}}_generatePoleQuad(t,i,r,a,s,o){a>s==(o===-32768)?(t.push(r),t.push(i),t.push(this._vertexToIndex(a,o)),t.push(this._vertexToIndex(s,o)),t.push(r),t.push(this._vertexToIndex(a,o))):(t.push(i),t.push(r),t.push(this._vertexToIndex(a,o)),t.push(r),t.push(this._vertexToIndex(s,o)),t.push(this._vertexToIndex(a,o)))}_fillPoles(t,i,r){let a=this._vertexBuffer,s=C,o=t.length;for(let n=2;n<o;n+=3){let l=t[n-2],u=t[n-1],h=t[n],c=a[l*2],p=a[l*2+1],d=a[u*2],f=a[u*2+1],m=a[h*2],_=a[h*2+1];i&&(p===0&&f===0&&this._generatePoleQuad(t,l,u,c,d,Ra),f===0&&_===0&&this._generatePoleQuad(t,u,h,d,m,Ra),_===0&&p===0&&this._generatePoleQuad(t,h,l,m,c,Ra)),r&&(p===s&&f===s&&this._generatePoleQuad(t,l,u,c,d,Lr),f===s&&_===s&&this._generatePoleQuad(t,u,h,d,m,Lr),_===s&&p===s&&this._generatePoleQuad(t,h,l,m,c,Lr))}}_initializeVertices(t){for(let i=0;i<t.length;i+=2)this._vertexToIndex(t[i],t[i+1])}subdividePolygonInternal(t,i){if(this._used)throw Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:r,holeIndices:a}=z1(t);this._initializeVertices(r);let s;try{let n=p1(r,a),l=this._convertIndices(r,n);s=this._subdivideTrianglesScanline(l)}catch(n){console.error(n)}let o=[];return i&&(o=this._generateOutline(t)),this._ensureNoPoleVertices(),this._handlePoles(s),this._granularity>=2&&this._canonical?.z===0&&(s=this._removeTrianglesOutsideTileX(s),o=o.map(n=>this._removeLinesOutsideTileX(n))),{verticesFlattened:this._vertexBuffer,indicesTriangles:s,indicesLineList:o}}_vertexOutsideTileX(t){let i=this._vertexBuffer[t*2];return i<0||i>8192}_removeTrianglesOutsideTileX(t){let i=[];for(let r=0;r<t.length;r+=3)this._vertexOutsideTileX(t[r])||this._vertexOutsideTileX(t[r+1])||this._vertexOutsideTileX(t[r+2])||i.push(t[r],t[r+1],t[r+2]);return i}_removeLinesOutsideTileX(t){let i=[];for(let r=0;r<t.length;r+=2)this._vertexOutsideTileX(t[r])||this._vertexOutsideTileX(t[r+1])||i.push(t[r],t[r+1]);return i}_convertIndices(t,i){let r=[];for(let a of i){let s=t[a*2],o=t[a*2+1];r.push(this._vertexToIndex(s,o))}return r}_pointArrayToIndices(t){let i=[];for(let r of t)i.push(this._vertexToIndex(r.x,r.y));return i}};function Lm(e,t,i,r=!0){return new D1(i,t).subdividePolygonInternal(e,r)}function nh(e,t,i=!1){if(!e||e.length<1||e.length<2)return[];let r=e[0],a=e[e.length-1],s=i&&(r.x!==a.x||r.y!==a.y);if(t<2)return s?[...e,e[0]]:[...e];let o=Math.floor(C/t),n=[];n.push(new E(e[0].x,e[0].y));let l=e.length,u=s?l:l-1;for(let h=0;h<u;h++){let c=e[h],p=h<l-1?e[h+1]:e[0],d=c.x,f=c.y,m=p.x,_=p.y,g=d!==m,x=f!==_;if(!g&&!x)continue;let y=m-d,v=_-f,w=Math.abs(y),b=Math.abs(v),T=d,I=f;for(;;){let D=y>0?(Math.floor(T/o)+1)*o:(Math.ceil(T/o)-1)*o,L=v>
vendor: 6,044 bytes, line 2
20?(Math.floor(I/o)+1)*o:(Math.ceil(I/o)-1)*o,z=Math.abs(T-D),P=Math.abs(I-L),S=Math.abs(T-m),F=Math.abs(I-_),O=g?z/w:1/0,H=x?P/b:1/0;if((S<=z||!g)&&(F<=P||!x))break;if(O<H&&g||!x){T=D,I+=v*O;let Y=new E(T,Math.round(I));(n[n.length-1].x!==Y.x||n[n.length-1].y!==Y.y)&&n.push(Y)}else{T+=y*H,I=L;let Y=new E(Math.round(T),I);(n[n.length-1].x!==Y.x||n[n.length-1].y!==Y.y)&&n.push(Y)}}let M=new E(m,_);(n[n.length-1].x!==M.x||n[n.length-1].y!==M.y)&&n.push(M)}return n}function z1(e){let t=[],i=[];for(let r of e)if(r.length!==0){r!==e[0]&&t.push(i.length/2);for(let a of r)i.push(a.x),i.push(a.y)}return{flattened:i,holeIndices:t}}function R1(e,t){let i=[];for(let r=0;r<t.length;r+=3){let a=t[r],s=t[r+1],o=t[r+2],n=e[a*2],l=e[a*2+1],u=e[s*2],h=e[s*2+1],c=e[o*2],p=e[o*2+1],d=u-n,f=h-l,m=c-n;d*(p-l)-f*m>0?(i.push(a),i.push(o),i.push(s)):(i.push(a),i.push(s),i.push(o))}return i}function k1(e,t,i){if(t.length===0)throw Error("Subdivision vertex ring is empty.");let r=0,a=e[t[0]*2];for(let l=1;l<t.length;l++){let u=e[t[l]*2];u<a&&(a=u,r=l)}let s=t.length,o=r,n=(o+1)%s;for(;;){let l=o-1>=0?o-1:s-1,u=(n+1)%s,h=e[t[l]*2],c=e[t[l]*2+1],p=e[t[u]*2],d=e[t[u]*2+1],f=e[t[o]*2],m=e[t[o]*2+1],_=e[t[n]*2],g=e[t[n]*2+1],x=!1;if(h<p)x=!0;else if(h>p)x=!1;else{let y=g-m,v=-(_-f),w=m<g?1:-1;((h-f)*y+(c-m)*v)*w>((p-f)*y+(d-m)*v)*w&&(x=!0)}if(x){let y=t[l],v=t[o],w=t[n];y!==v&&y!==w&&v!==w&&i.push(w,v,y),o--,o<0&&(o=s-1)}else{let y=t[u],v=t[o],w=t[n];y!==v&&y!==w&&v!==w&&i.push(w,v,y),n++,n>=s&&(n=0)}if(l===u)break}}function Fm(e,t,i,r,a,s,o,n,l){let u=a.length/2,h=o&&n&&l;if(u<Te.MAX_VERTEX_ARRAY_LENGTH){let c=t.prepareSegment(u,i,r),p=c.vertexLength;for(let m=0;m<s.length;m+=3)r.emplaceBack(p+s[m],p+s[m+1],p+s[m+2]);c.vertexLength+=u,c.primitiveLength+=s.length/3;let d,f;h&&(f=o.prepareSegment(u,i,n),d=f.vertexLength,f.vertexLength+=u);for(let m=0;m<a.length;m+=2)e(a[m],a[m+1]);if(h)for(let m of l){for(let _=1;_<m.length;_+=2)n.emplaceBack(d+m[_-1],d+m[_]);f.primitiveLength+=m.length/2}}else L1(t,i,r,a,s,e),h&&F1(o,i,n,a,l,e),t.forceNewSegmentOnNextPrepare(),o?.forceNewSegmentOnNextPrepare()}function ka(e,t,i,r,a,s,o){if(s){let n=r.count;return i(t[a*2],t[a*2+1]),e[a]=r.count,r.count++,o.vertexLength++,n}else return e[a]}function L1(e,t,i,r,a,s){let o=[];for(let c=0;c<r.length/2;c++)o.push(-1);let n={count:0},l=0,u=e.getOrCreateLatestSegment(t,i),h=u.vertexLength;for(let c=2;c<a.length;c+=3){let p=a[c-2],d=a[c-1],f=a[c],m=o[p]<l,_=o[d]<l,g=o[f]<l,x=+!!m+ +!!_+ +!!g;u.vertexLength+x>Te.MAX_VERTEX_ARRAY_LENGTH&&(u=e.createNewSegment(t,i),l=n.count,m=!0,_=!0,g=!0,h=0);let y=ka(o,r,s,n,p,m,u),v=ka(o,r,s,n,d,_,u),w=ka(o,r,s,n,f,g,u);i.emplaceBack(h+y-l,h+v-l,h+w-l),u.primitiveLength++}}function F1(e,t,i,r,a,s){let o=[];for(let c=0;c<r.length/2;c++)o.push(-1);let n={count:0},l=0,u=e.getOrCreateLatestSegment(t,i),h=u.vertexLength;for(let c of a)for(let p=1;p<c.length;p+=2){let d=c[p-1],f=c[p],m=o[d]<l,_=o[f]<l,g=+!!m+ +!!_;u.vertexLength+g>Te.MAX_VERTEX_ARRAY_LENGTH&&(u=e.createNewSegment(t,i),l=n.count,m=!0,_=!0,h=0);let x=ka(o,r,s,n,d,m,u),y=ka(o,r,s,n,f,_,u);i.emplaceBack(h+x-l,h+y-l),u.primitiveLength++}}var Bm=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new ox,this.indexArray=new hi,this.indexArray2=new Wl,this.programConfigurations=new cr(t.layers,t.zoom),this.segments=new Te,this.segments2=new Te,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,r){this.hasDependencies=bo("fill",this.layers,i);let a=this.layers[0].layout.get("fill-sort-key"),s=!a.isConstant(),o=[],n=new Se(this.zoom),l=this.layers[0]._featureFilter.needGeometry;for(let{feature:u,id:h,index:c,sourceLayerIndex:p}of t){let d=_r(u,l);if(!this.layers[0]._featureFilter.filter(n,d,r))continue;let f=s?a.evaluate(d,{},r,i.availableImages):void 0,m={id:h,properties:u.properties,type:u.type,sourceLayerIndex:p,index:c,geometry:l?d.geometry:mr(u),patterns:{},sortKey:f};o.push(m)}s&&o.sort((u,h)=>u.sortKey-h.sortKey);for(let u of o){let{geometry:h,index:c,sourceLayerIndex:p}=u;if(this.hasDependencies){let f=sh("fill",this.layers,u,{zoom:this.zoom},i);this.patternFeatures.push(f)}else this.addFeature(u,h,c,r,{},i.subdivisionGranularity);let d=t[c].feature;i.featureIndex.insert(d,h,c,p,this.index)}}update(t,i,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,{imagePositions:r})}addFeatures(t,i,r){for(let a of this.patternFeatures)this.addFeature(a,a.geometry,a.index,i,r,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,c1),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,i,r,a,s,o){for(let n of Ou(i,500)){let l=Lm(n,a,o.fill.getGranularityForZoomLevel(a.z)),u=this.layoutVertexArray;Fm((h,c)=>{u.emplaceBack(h,c)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles,this.segments2,this.indexArray2,l.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:s,canonical:a})}};V("FillBucket",Bm,{omit:["layers","patternFeatures"]});let B1;const O1=()=>B1||=new Ke({"fill-sort-key":new Z(A.layout_fill["fill-sort-key"],"fill-sort-key")});let $1;const V1=()=>$1||=new Ke({"fill-antialias":new $(A.paint_fill["fill-antialias"],"fill-antialias"),"fill-opacity":new Z(A.paint_fill["fill-opacity"],"fill-opacity"),"fill-layer
2-opacity":new $(A.paint_fill["fill-layer-opacity"],"fill-layer-opacity"),"fill-color":new Z(A.paint_fill["fill-color"],"fill-color"),"fill-outline-color":new Z(A.paint_fill["fill-outline-color"],"fill-outline-color"),"fill-translate":new $(A.paint_fill["fill-translate"],"fill-translate"),"fill-translate-anchor":new $(A.paint_fill["fill-translate-anchor"],"fill-translate-anchor"),"fill-pattern":new qa(A.paint_fill["fill-pattern"],"fill-pattern")});var j1={get paint(){return V1()},get layout(){return O1()}};const N1=e=>e.type==="fill";var U1=class extends Yt{constructor(t,i){super(t,j1,i)}recalculate(t,i){super.recalculate(t,i);let r=this.paint._values["fill-outline-color"];r.value.kind==="constant"&&r.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new Bm(t)}queryRadius(){return en(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:t,geometry:i,transform:r,pixelsToTileUnits:a}){return Tm(tn(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-r.bearingInRadians,a),i)}isTileClipped(){return!0}};const G1=Me([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Z1=Me([{name:"a_centroid",components:2,type:"Int16"}],4),q1=G1.members;var fs=class{constructor(t,i,r,a,s){for(this.properties=Object.create(null),this.extent=r,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=a,this._values=s;t.pos<i;){let o=t.readVarint();if(o===8)this.id=t.readVarint();else if(o===18){let n=t.readVarint()+t.pos;for(;t.pos<n;){let l=a[t.readVarint()],u=s[t.readVarint()];this.properties[l]=u}}else o===24?this.type=t.readVarint():(o===34&&(this._geometry=t.pos),t.skip(o))}}loadGeometry(){if(this._geometry<0)throw Error("feature has no geometry");let t=this._pbf;t.pos=this._geometry;let i=t.readVarint()+t.pos,r=[],a,s=1,o=0,n=0,l=0;for(;t.pos<i;){if(o<=0){let u=t.readVarint();if(s=u&7,o=u>>3,o===0)continue}if(o--,s===1)n+=t.readSVarint(),l+=t.readSVarint(),a&&r.push(a),a=[new E(n,l)];else if(s===2)n+=t.readSVarint(),l+=t.readSVarint(),a&&a.push(new E(n,l));else if(s===7)a&&a.push(a[0].clone());else throw Error(`unknown command ${s}`)}return a&&r.push(a),r}bbox(){if(this._geometry<0)throw Error("feature has no geometry");let t=this._pbf;t.pos=this._geometry;let i=t.readVarint()+t.pos,r=1,a=0,s=0,o=0,n=1/0,l=-1/0,u=1/0,h=-1/0;for(;t.pos<i;){if(a<=0){let c=t.readVarint();if(r=c&7,a=c>>3,a===0)continue}if(a--,r===1||r===2)s+=t.readSVarint(),o+=t.readSVarint(),s<n&&(n=s),s>l&&(l=s),o<u&&(u=o),o>h&&(h=o);else if(r!==7)throw Error(`unknown command ${r}`)}return[n,u,l,h]}toGeoJSON(t,i,r){let a=this.extent*2**r,s=this.extent*t,o=this.extent*i,n=this.loadGeometry();function l(p){return[(p.x+s)*360/a-180,360/Math.PI*Math.atan(Math.exp((1-(p.y+o)*2/a)*Math.PI))-90]}function u(p){return p.map(l)}let h;if(this.type===1){let p=[];for(let f of n)p.push(f[0]);let d=u(p);h=p.length===1?{type:"Point",coordinates:d[0]}:{type:"MultiPoint",coordinates:d}}else if(this.type===2){let p=n.map(u);h=p.length===1?{type:"LineString",coordinates:p[0]}:{type:"MultiLineString",coordinates:p}}else if(this.type===3){let p=Om(n),d=[];for(let f of p)d.push(f.map(u));h=d.length===1?{type:"Polygon",coordinates:d[0]}:{type:"MultiPolygon",coordinates:d}}else throw Error("unknown feature type");let c={type:"Feature",geometry:h,properties:this.properties};return this.id!=null&&(c.id=this.id),c}};fs.types=["Unknown","Point","LineString","Polygon"];function Om(e){let t=e.length;if(t<=1)return[e];let i=[],r,a;for(let s=0;s<t;s++){let o=W1(e[s]);o!==0&&(a===void 0&&(a=o<0),a===o<0?(r&&i.push(r),r=[e[s]]):r&&r.push(e[s]))}return r&&i.push(r),i}function W1(e){let t=0;for(let i=0,r=e.length,a=r-1,s,o;i<r;a=i++)s=e[i],o=e[a],t+=(o.x-s.x)*(s.y+o.y);return t}var H1=class{constructor(t,i){for(this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],i===void 0&&(i=t.length);t.pos<i;){let r=t.readVarint();r===10?this.name=t.readString():r===18?(this._features.push(t.pos),t.skip(r)):r===26?this._keys.push(t.readString()):r===34?this._values.push(X1(t)):r===40?this.extent=t.readVarint():r===120?this.version=t.readVarint():t.skip(r)}this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[t];let i=this._pbf.readVarint()+this._pbf.pos;return new fs(this._pbf,i,this.extent,this._keys,this._values)}};function X1(e){let t=null,i=e.readVarint()+e.pos;for(;e.pos<i;){let r=e.readVarint();t=r===10?e.readString():r===21?e.readFloat():r===25?e.readDouble():r===32?e.readVarint(!0):r===40?e.readVarint():r===48?e.readSVarint():r===56?e.readBoolean():(e.ski
vendor: 13,143 bytes, line 2
2p(r),null)}if(t==null)throw Error("unknown feature value");return t}var Y1=class{constructor(t,i=t.length){let r=Object.create(null);for(;t.pos<i;){let a=t.readVarint();if(a===26){let s=new H1(t,t.readVarint()+t.pos);s.length&&(r[s.name]=s)}else t.skip(a)}this.layers=r}};const Ln=2**13;function pa(e,t,i,r,a,s,o,n){e.emplaceBack(t,i,Math.floor(r*Ln)*2+o,a*Ln*2,s*Ln*2,Math.round(n))}var $m=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(t=>t.id),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new nx,this.centroidVertexArray=new Oi,this.indexArray=new hi,this.programConfigurations=new cr(e.layers,e.zoom),this.segments=new Te,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(e,t,i){this.features=[],this.hasDependencies=bo("fill-extrusion",this.layers,t);let r=new Se(this.zoom),a=this.layers[0]._featureFilter.needGeometry;for(let{feature:s,id:o,index:n,sourceLayerIndex:l}of e){let u=_r(s,a);if(!this.layers[0]._featureFilter.filter(r,u,i))continue;let h={id:o,sourceLayerIndex:l,index:n,geometry:a?u.geometry:mr(s),properties:s.properties,type:s.type,patterns:{}};this.hasDependencies?this.features.push(sh("fill-extrusion",this.layers,h,{zoom:this.zoom},t)):this.addFeature(h,h.geometry,n,i,{},t.subdivisionGranularity),t.featureIndex.insert(s,h.geometry,n,l,this.index,!0)}}addFeatures(e,t,i){for(let r of this.features){let{geometry:a}=r;this.addFeature(r,a,r.index,t,i,e.subdivisionGranularity)}}update(e,t,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:i})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,q1),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Z1.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,i,r,a,s){for(let o of Ou(t,500)){let n={x:0,y:0,sampleCount:0},l=this.layoutVertexArray.length;this.processPolygon(n,r,e,o,s);let u=this.layoutVertexArray.length-l,h=Math.floor(n.x/n.sampleCount),c=Math.floor(n.y/n.sampleCount);for(let p=0;p<u;p++)this.centroidVertexArray.emplaceBack(h,c)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,{imagePositions:a,canonical:r})}processPolygon(e,t,i,r,a){if(r.length<1||Nc(r[0]))return;for(let h of r)h.length!==0&&K1(e,h);let s={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},o=a.fill.getGranularityForZoomLevel(t.z),n=fs.types[i.type]==="Polygon";for(let h of r){if(h.length===0||Nc(h))continue;let c=nh(h,o,n);this._generateSideFaces(c,s)}if(!n)return;let l=Lm(r,t,o,!1),u=this.layoutVertexArray;Fm((h,c)=>{pa(u,h,c,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(e,t){let i=0;for(let r=1;r<e.length;r++){let a=e[r],s=e[r-1];if(J1(a,s))continue;t.segment.vertexLength+4>Te.MAX_VERTEX_ARRAY_LENGTH&&(t.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let o=a.sub(s)._perp()._unit(),n=s.dist(a);i+n>32768&&(i=0),pa(this.layoutVertexArray,a.x,a.y,o.x,o.y,0,0,i),pa(this.layoutVertexArray,a.x,a.y,o.x,o.y,0,1,i),i+=n,pa(this.layoutVertexArray,s.x,s.y,o.x,o.y,0,0,i),pa(this.layoutVertexArray,s.x,s.y,o.x,o.y,0,1,i);let l=t.segment.vertexLength;this.indexArray.emplaceBack(l,l+2,l+1),this.indexArray.emplaceBack(l+1,l+2,l+3),t.segment.vertexLength+=4,t.segment.primitiveLength+=2}}};function K1(e,t){for(let i=0;i<t.length;i++){let r=t[i];(i!==t.length-1||t[0].x!==r.x||t[0].y!==r.y)&&(e.x+=r.x,e.y+=r.y,e.sampleCount++)}}V("FillExtrusionBucket",$m,{omit:["layers","features"]});function J1(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}function Nc(e){return e.every(t=>t.x<0)||e.every(t=>t.x>8192)||e.every(t=>t.y<0)||e.every(t=>t.y>8192)}let Q1;const eb=()=>Q1||=new Ke({"fill-extrusion-rounded-corner-distance":new $(A["layout_fill-extrusion"]["fill-extrusion-rounded-corner-distance"],"fill-extrusion-rounded-corner-distance")});let tb;const ib=()=>tb||=new Ke({"fill-extrusion-opacity":new $(A["paint_fill-extrusion"]["fill-extrusion-opacity"],"fill-extrusion-opacity"),"fill-extrusion-color":new Z(A["paint_fill-extrusion"]["fill-extrusion-color"],"fill-extrusion-color"),"fill-extrusion-translate":new $(A["paint_fill-extrusion"]["fill-extrusion-translate"],"fill-extrusion-translate"),"fill-extrusion-translate-anchor":new $(A["paint_fill-extrusion"]["fill-extrusion-translate-anchor"],"fill-extrusion-translate-anchor"),"fill-extrusion-pattern":new qa(A["paint_fill-extrusion"]["fill-extrusion-pattern"],"fill-extrusion-pattern"),"fill-extrusion-height":new Z(A["paint_fill-extrusion"]["fill-extrusion-height"],"fill-extrusion-height"),"fill-extrusion-base":new Z(A["paint_fill-extrusion"]["fill-extrusion-base"],"fill-extrusion-base"),"fill-extrusion-vertical-gradient":new $(A["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"],"fill-extrusion-vertical-gradient")});var rb={get paint(){return ib()},get layout(){return eb()}};const ab=e=>e.type==="fill-extrusion";var sb=class extends Yt{constructor(e,t){super(e,rb,t)}createBucket(e){return new $m(e)}queryRadius(){return en(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:i,geometry:r,transform:a,pixelsToTileUnits:s,pixelPosMatrix:o}){let n=tn(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-a.bearingInRadians,s),l=this.paint.get("fill-extrusion-height").evaluate(t,i),u=this.paint.get("fill-extrusion-base").evaluate(t,i),h=lb(n,o,0),c=nb(r,u,l,o),p=c[0],d=c[1];return ob(p,d,h)}};function da(e,t){return e.x*t.x+e.y*t.y}function Uc(e,t){if(e.length===1){let i=0,r=t[i++],a;for(;!a||r.equals(a);)if(a=t[i++],!a)return 1/0;for(;i<t.length;i++){let s=t[i],o=e[0],n=a.sub(r),l=s.sub(r),u=o.sub(r),h=da(n,n),c=da(n,l),p=da(l,l),d=da(u,n),f=da(u,l),m=h*p-c*c,_=(p*d-c*f)/m,g=(h*f-c*d)/m,x=1-_-g,y=r.z*x+a.z*_+s.z*g;if(isFinite(y))return y}return 1/0}else{let i=1/0;for(let r of t)i=Math.min(i,r.z);return i}}function ob(e,t,i){let r=1/0;Tm(i,t)&&(r=Uc(i,t[0]));for(let a=0;a<t.length;a++){let s=t[a],o=e[a];for(let n=0;n<s.length-1;n++){let l=s[n],u=s[n+1],h=o[n],c=[l,u,o[n+1],h,l];wm(i,c)&&(r=Math.min(r,Uc(i,c)))}}return r!==1/0&&r}function nb(e,t,i,r){let a=[],s=[],o=r[8]*t,n=r[9]*t,l=r[10]*t,u=r[11]*t,h=r[8]*i,c=r[9]*i,p=r[10]*i,d=r[11]*i;for(let f of e){let m=[],_=[];for(let g of f){let x=g.x,y=g.y,v=r[0]*x+r[4]*y+r[12],w=r[1]*x+r[5]*y+r[13],b=r[2]*x+r[6]*y+r[14],T=r[3]*x+r[7]*y+r[15],I=v+o,M=w+n,D=b+l,L=T+u,z=v+h,P=w+c,S=b+p,F=T+d,O=new E(I/L,M/L);O.z=D/L,m.push(O);let H=new E(z/F,P/F);H.z=S/F,_.push(H)}a.push(m),s.push(_)}return[a,s]}function lb(e,t,i){let r=[];for(let a of e){let s=[a.x,a.y,i,1];Ue(s,s,t),r.push(new E(s[0]/s[3],s[1]/s[3]))}return r}const ub="geojsonvt_clip_start",hb="geojsonvt_clip_end",cb=Me([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),pb=cb.members,db=Me([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),fb=db.members,mb=Math.cos(75/2*(Math.PI/180)),Vm=1/2,Gc=2**14/Vm;var jm=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(t=>t.id),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let t of this.layers)this.gradients[t.id]={};this.layoutVertexArray=new lx,this.layoutVertexArray2=new ux,this.indexArray=new hi,this.programConfigurations=new cr(e.layers,e.zoom),this.segments=new Te,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(e,t,i){this.hasDependencies=bo("line",this.layers,t)||this.hasLineDasharray(this.layers);let r=this.layers[0].layout.get("line-sort-key"),a=!r.isConstant(),s=[],o=new Se(this.zoom),n=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of e){let p=_r(l,n);if(!this.layers[0]._featureFilter.filter(o,p,i))continue;let d=a?r.evaluate(p,{},i):void 0,f={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:n?p.geometry:mr(l),patterns:{},dashes:{},sortKey:d};s.push(f)}a&&s.sort((l,u)=>l.sortKey-u.sortKey);for(let l of s){let{geometry:u,index:h,sourceLayerIndex:c}=l;this.hasDependencies?(bo("line",this.layers,t)?sh("line",this.layers,l,{zoom:this.zoom},t):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,l,this.zoom,t),this.patternFeatures.push(l)):this.addFeature(l,u,h,i,{},{},t.subdivisionGranularity);let p=e[h].feature;t.featureIndex.insert(p,u,h,c,this.index)}}update(e,t,i,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:i,dashPositions:r})}addFeatures(e,t,i,r){for(let a of this.patternFeatures)this.addFeature(a,a.geometry,a.index,t,i,r,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,fb)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,pb),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.hasOwn(e.properties,"geojsonvt_clip_start")&&Object.hasOwn(e.properties,"geojsonvt_clip_end"))return{start:+e.properties[ub],end:+e.properties[hb]}}addFeature(e,t,i,r,a,s,o){let n=this.layers[0].layout,l=n.get("line-join").evaluate(e,{}),u=n.get("line-cap").evaluate(e,{}),h=n.get("line-miter-limit").evaluate(e,{}),c=n.get("line-round-limit").evaluate(e,{});this.lineClips=this.lineFeatureClips(e);for(let p of t)this.addLine(p,e,l,u,h,c,r,o);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,{imagePositions:a,dashPositions:s,canonical:r})}addLine(e,t,i,r,a,s,o,n){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let l=o?n.line.getGranularityForZoomLevel(o.z):1;if(e=nh(e,l),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let y=0;y<e.length-1;y++)this.totalDistance+=e[y].dist(e[y+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let u=fs.types[t.type]==="Polygon",h=e.length;for(;h>=2&&e[h-1].equals(e[h-2]);)h--;let c=0;for(;c<h-1&&e[c].equals(e[c+1]);)c++;if(h-c<(u?3:2))return;i==="bevel"&&(a=1.05);let p=this.overscaling<=16?15*C/(512*this.overscaling):0,d=this.segments.prepareSegment(h*10,this.layoutVertexArray,this.indexArray),f,m,_,g,x;this.e1=this.e2=-1,u&&(f=e[h-2],x=e[c].sub(f)._unit()._perp());for(let y=c;y<h;y++){if(_=y===h-1?u?e[c+1]:void 0:e[y+1],_&&e[y].equals(_))continue;x&&(g=x),f&&(m=f),f=e[y],x=_?_.sub(f)._unit()._perp():g,g||=x;let v=g.add(x);(v.x!==0||v.y!==0)&&v._unit();let w=g.x*x.x+g.y*x.y,b=v.x*x.x+v.y*x.y,T=b===0?1/0:1/b,I=2*Math.sqrt(2-2*b),M=b<mb&&m&&_,D=g.x*x.y-g.y*x.x>0;if(M&&y>c){let P=f.dist(m);if(P>2*p){let S=f.sub(f.sub(m)._mult(p/P)._round());this.updateDistance(m,S),this.addCurrentVertex(S,g,0,0,d),m=S}}let L=m&&_,z=L?i:u?"butt":r;if(L&&z==="round"&&(T<s?z="miter":T<=2&&(z="fakeround")),z==="miter"&&T>a&&(z="bevel"),z==="bevel"&&(T>2&&(z="flipbevel"),T<a&&(z="miter")),m&&this.updateDistance(m,f),z==="miter")v._mult(T),this.addCurrentVertex(f,v,0,0,d);else if(z==="flipbevel"){if(T>100)v=x.mult(-1);else{let P=T*g.add(x).mag()/g.sub(x).mag();v._perp()._mult(P*(D?-1:1))}this.addCurrentVertex(f,v,0,0,d),this.addCurrentVertex(f,v.mult(-1),0,0,d)}else if(z==="bevel"||z==="fakeround"){let P=-Math.sqrt(T*T-1),S=D?P:0,F=D?0:P;if(m&&this.addCurrentVertex(f,g,S,F,d),z==="fakeround"){let O=Math.round(I*180/Math.PI/20);for(let H=1;H<O;H++){let Y=H/O;if(Y!==.5){let ue=Y-.5,me=1.0904+w*(-3.2452+w*(3.55645-w*1.43519)),It=.848013+w*(-1.06021+w*.215638);Y+=Y*ue*(Y-1)*(me*ue*ue+It)}let ie=x.sub(g)._mult(Y)._add(g)._unit()._mult(D?-1:1);this.addHalfVertex(f,ie.x,ie.y,!1,D,0,d)}}_&&this.addCurrentVertex(f,x,-S,-F,d)}else if(z==="butt")this.addCurrentVertex(f,v,0,0,d);else if(z==="square"){let P=m?1:-1;this.addCurrentVertex(f,v,P,P,d)}else z==="round"&&(m&&(this.addCurrentVertex(f,g,0,0,d),this.addCurrentVertex(f,g,1,1,d,!0)),_&&(this.addCurrentVertex(f,x,-1,-1,d,!0),this.addCurrentVertex(f,x,0,0,d)));if(M&&y<h-1){let P=f.dist(_);if(P>
vendor: 14,095 bytes, line 2
22*p){let S=f.add(_.sub(f)._mult(p/P)._round());this.updateDistance(f,S),this.addCurrentVertex(S,x,0,0,d),f=S}}}}addCurrentVertex(e,t,i,r,a,s=!1){let o=t.x+t.y*i,n=t.y-t.x*i,l=-t.x+t.y*r,u=-t.y-t.x*r;this.addHalfVertex(e,o,n,s,!1,i,a),this.addHalfVertex(e,l,u,s,!0,-r,a),this.distance>Gc/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,i,r,a,s))}addHalfVertex({x:e,y:t},i,r,a,s,o,n){let l=(this.lineClips?this.scaledDistance*(Gc-1):this.scaledDistance)*Vm;if(this.layoutVertexArray.emplaceBack((e<<1)+ +!!a,(t<<1)+ +!!s,Math.round(63*i)+128,Math.round(63*r)+128,(o===0?0:o<0?-1:1)+1|(l&63)<<2,l>>6),this.lineClips){let h=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(h,this.lineClipsArray.length)}let u=n.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,u,this.e2),n.primitiveLength++),s?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}hasLineDasharray(e){for(let t of e){let i=t.paint.get("line-dasharray");if(i&&!i.isConstant())return!0}return!1}addLineDashDependencies(e,t,i,r){for(let a of e){let s=a.paint.get("line-dasharray");if(!s||s.value.kind==="constant")continue;let o=a.layout.get("line-cap").evaluate(t,{})==="round",n={dasharray:s.value.evaluate({zoom:i-1},t,{}),round:o},l={dasharray:s.value.evaluate({zoom:i},t,{}),round:o},u={dasharray:s.value.evaluate({zoom:i+1},t,{}),round:o},h=`${n.dasharray.join(",")},${n.round}`,c=`${l.dasharray.join(",")},${l.round}`,p=`${u.dasharray.join(",")},${u.round}`;r.dashDependencies[h]=n,r.dashDependencies[c]=l,r.dashDependencies[p]=u,t.dashes[a.id]={min:h,mid:c,max:p}}}};V("LineBucket",jm,{omit:["layers","patternFeatures"]});let _b;const gb=()=>_b||=new Ke({"line-cap":new Z(A.layout_line["line-cap"],"line-cap"),"line-join":new Z(A.layout_line["line-join"],"line-join"),"line-miter-limit":new Z(A.layout_line["line-miter-limit"],"line-miter-limit"),"line-round-limit":new Z(A.layout_line["line-round-limit"],"line-round-limit"),"line-sort-key":new Z(A.layout_line["line-sort-key"],"line-sort-key")});let yb;const vb=()=>yb||=new Ke({"line-opacity":new Z(A.paint_line["line-opacity"],"line-opacity"),"line-layer-opacity":new $(A.paint_line["line-layer-opacity"],"line-layer-opacity"),"line-color":new Z(A.paint_line["line-color"],"line-color"),"line-translate":new $(A.paint_line["line-translate"],"line-translate"),"line-translate-anchor":new $(A.paint_line["line-translate-anchor"],"line-translate-anchor"),"line-width":new Z(A.paint_line["line-width"],"line-width"),"line-gap-width":new Z(A.paint_line["line-gap-width"],"line-gap-width"),"line-offset":new Z(A.paint_line["line-offset"],"line-offset"),"line-blur":new Z(A.paint_line["line-blur"],"line-blur"),"line-dasharray":new qa(A.paint_line["line-dasharray"],"line-dasharray"),"line-pattern":new qa(A.paint_line["line-pattern"],"line-pattern"),"line-gradient":new Jo(A.paint_line["line-gradient"],"line-gradient")});var Zc={get paint(){return vb()},get layout(){return gb()}},xb=class extends Z{possiblyEvaluate(e,t){return t=new Se(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,i,r){return t=j({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,i,r)}};let Ls;const bb=e=>e.type==="line";var wb=class extends Yt{constructor(e,t){super(e,Zc,t),this.gradientVersion=0,Ls||(Ls=new xb(Zc.paint.properties["line-width"].specification,"line-floorwidth"),Ls.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let t=this.gradientExpression();h0(t)?this.stepInterpolant=t._styleExpression.expression instanceof ku:this.stepInterpolant=!1,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=Ls.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new jm(e)}queryRadius(e){let t=e,i=qc(Br("line-width",this,t),Br("line-gap-width",this,t)),r=Br("line-offset",this,t);return i/2+Math.abs(r)+en(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:i,geometry:r,transform:a,pixelsToTileUnits:s}){let o=tn(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-a.bearingInRadians,s),n=s/2*qc(this.paint.get("line-width").evaluate(t,i),this.paint.get("line-gap-width").evaluate(t,i)),l=this.paint.get("line-offset").evaluate(t,i);return l&&(r=Lx(r,l*s)),Mx(o,r,n)}isTileClipped(){return!0}};function qc(e,t){return t>0?t+2*e:e}const Tb=Me([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Sb=Me([{name:"a_projected_pos",components:3,type:"Float32"}],4);Me([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Pb=Me([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Me([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Wc=Me([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Ib=Me([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Me([{name:"triangle",components:3,type:"Uint16"}]),Me([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Me([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Me([{type:"Float32",name:"offsetX"}]),Me([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Me([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);function Eb(e,t,i){let r=t.layout.get("text-transform").evaluate(i,{});return r==="uppercase"?e=e.toLocaleUpperCase():r==="lowercase"&&(e=e.toLocaleLowerCase()),Xr.applyArabicShaping&&(e=Xr.applyArabicShaping(e)),e}function Mb(e,t,i){for(let r of e.sections)r.text=Eb(r.text,t,i);return e}function Ab(e){let t={},i={},r=[],a=0;function s(u){r.push(e[u]),a++}function o(u,h,c){let p=i[u];return delete i[u],i[h]=p,r[p].geometry[0].pop(),r[p].geometry[0]=r[p].geometry[0].concat(c[0]),p}function n(u,h,c){let p=t[h];return delete t[h],t[u]=p,r[p].geometry[0].shift(),r[p].geometry[0]=c[0].concat(r[p].geometry[0]),p}function l(u,h,c){let p=c?h[0][h[0].length-1]:h[0][0];return`${u}:${p.x}:${p.y}`}for(let u=0;u<e.length;u++){let h=e[u],c=h.geometry,p=h.text?h.text.toString():null;if(!p){s(u);continue}let d=l(p,c),f=l(p,c,!0);if(d in i&&f in t&&i[d]!==t[f]){let m=n(d,f,c),_=o(d,f,r[m].geometry);delete t[d],delete i[f],i[l(p,r[_].geometry,!0)]=_,r[m].geometry=null}else d in i?o(d,f,c):f in t?n(d,f,c):(s(u),t[d]=a-1,i[f]=a-1)}return r.filter(u=>u.geometry)}const Cb={"!":"ï¸","#":"ï¼",$:"ï¼","%":"ï¼
","&":"ï¼","(":"︵",")":"︶","*":"ï¼","+":"ï¼",",":"ï¸","-":"︲",".":"ã»","/":"ï¼",":":"ï¸",";":"ï¸","<":"︿","=":"ï¼",">":"ï¹","?":"ï¸","@":"ï¼ ","[":"ï¹","\\":"ï¼¼","]":"ï¹","^":"ï¼¾",_:"︳","`":"ï½","{":"︷","|":"â","}":"︸","~":"ï½","¢":"ï¿ ","£":"ï¿¡","Â¥":"ï¿¥","¦":"¦","¬":"ï¿¢","¯":"ï¿£","â":"︲","â":"︱","â":"ï¹","â":"ï¹","â":"ï¹","â":"ï¹","â¦":"ï¸","â¯":"ï¸","â§":"ã»","â©":"₩","ã":"ï¸","ã":"ï¸","ã":"︿","ã":"ï¹","ã":"︽","ã":"︾","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"︻","ã":"︼","ã":"︹","ã":"︺","ã":"ï¸","ã":"ï¸","ï¼":"ï¸","ï¼":"︵","ï¼":"︶","ï¼":"ï¸","ï¼":"︲","ï¼":"ã»","ï¼":"ï¸","ï¼":"ï¸","ï¼":"︿","ï¼":"ï¹","ï¼":"ï¸","ï¼»":"ï¹","ï¼½":"ï¹","_":"︳","ï½":"︷","ï½":"â","ï½":"︸","ï½":"︵","ï½ ":"︶","。":"ï¸","ï½¢":"ï¹","ï½£":"ï¹"},Hc=65536*65536,Xc=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");var Nm=class{constructor(e){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(e,t,i=this.length){let r;for(;r=this.nextField(i);)e(r,t,this);return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Hc;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Hc;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let t=this.buf,i=t[this.pos++];if(i<128)return i;let r=i&127,a;return a=t[this.pos++],r|=(a&127)<<7,a<128||(a=t[this.pos++],r|=(a&127)<<14,a<128)||(a=t[this.pos++],r|=(a&127)<<21,a<128)?r:(a=t[this.pos],r|=(a&15)<<28,Db(r,e,this))}readSVarint(){let e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&Xc?Xc.decode(this.buf.subarray(t,e)):Rb(this.buf,t,e)}readBytes(){let e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}nextField(e=this.length){if(this.pos===this._valueStart&&this.skip(this.type),this.pos>=e)return 0;let t=this.readVarint();return this.type=t&7,this._valueStart=this.pos,t>>>3}skip(e){let t=e&7;if(t===0)for(;this.buf[this.pos++]>127;);else if(t===2)this.pos=this.readVarint()+this.pos;else if(t===5)this.pos+=4;else if(t===1)this.pos+=8;else throw Error(`Unimplemented type: ${t}`)}};function Db(e,t,i){let r=i.buf,a,s;if(s=r[i.pos++],a=(s&112)>>4,s<128||(s=r[i.pos++],a|=(s&127)<<3,s<128)||(s=r[i.pos++],a|=(s&127)<<10,s<128)||(s=r[i.pos++],a|=(s&127)<<17,s<128)||(s=r[i.pos++],a|=(s&127)<<24,s<128)||(s=r[i.pos++],a|=(s&1)<<31,s<128))return zb(e,a,t);throw Error("Expected varint not more than 10 bytes")}function zb(e,t,i){return i?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function Rb(e,t,i){let r="",a=t;for(;a<i;){let s=e[a],o=null,n=s>239?4:s>223?3:s>191?2:1;if(a+n>i)break;let l,u,h;n===1?s<128&&(o=s):n===2?(l=e[a+1],(l&192)==128&&(o=(s&31)<<6|l&63,o<=127&&(o=null))):n===3?(l=e[a+1],u=e[a+2],(l&192)==128&&(u&192)==128&&(o=(s&15)<<12|(l&63)<<6|u&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):n===4&&(l=e[a+1],u=e[a+2],h=e[a+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(o=(s&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,n=1):o>65535&&(o-=65536,r+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),r+=String.fromCharCode(o),a+=n}return r}function kb(e,t,i){e===1&&i.readMessage(Lb,t)}
2function Lb(e,t,i){if(e===3){let{id:r,bitmap:a,width:s,height:o,left:n,top:l,advance:u}=i.readMessage(Fb,{});t.push({id:r,bitmap:new ah({width:s+6,height:o+6},a),metrics:{width:s,height:o,left:n,top:l,advance:u}})}}function Fb(e,t,i){e===1?t.id=i.readVarint():e===2?t.bitmap=i.readBytes():e===3?t.width=i.readVarint():e===4?t.height=i.readVarint():e===5?t.left=i.readSVarint():e===6?t.top=i.readSVarint():e===7&&(t.advance=i.readVarint())}function Bb(e){return new Nm(e).readFields(kb,[])}function Ob(e){let{userImage:t}=e;return t?.render&&t.render()?(e.data.replace(new Uint8Array(t.data.buffer)),!0):!1}function Um(e){let t=0,i=0;for(let o of e)t+=o.w*o.h,i=Math.max(i,o.w);e.sort((o,n)=>n.h-o.h);let r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),i),h:1/0}],a=0,s=0;for(let o of e)for(let n=r.length-1;n>=0;n--){let l=r[n];if(!(o.w>l.w||o.h>l.h)){if(o.x=l.x,o.y=l.y,s=Math.max(s,o.y+o.h),a=Math.max(a,o.x+o.w),o.w===l.w&&o.h===l.h){let u=r.pop();u&&n<r.length&&(r[n]=u)}else o.h===l.h?(l.x+=o.w,l.w-=o.w):o.w===l.w?(l.y+=o.h,l.h-=o.h):(r.push({x:l.x+o.w,y:l.y,w:l.w-o.w,h:o.h}),l.y+=o.h,l.h-=o.h);break}}return{w:a,h:s,fill:t/(a*s)||0}}var lh=class{constructor(e,{pixelRatio:t,version:i,stretchX:r,stretchY:a,content:s,textFitWidth:o,textFitHeight:n}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=r,this.stretchY=a,this.content=s,this.version=i,this.textFitWidth=o,this.textFitHeight=n}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}},$b=class{constructor(e,t){let i={},r={};this.haveRenderCallbacks=[];let a=[];this.addImages(e,i,a),this.addImages(t,r,a);let{w:s,h:o}=Um(a),n=new xe({width:s||1,height:o||1});for(let l in e){let u=e[l],h=i[l].paddedRect;xe.copy(u.data,n,{x:0,y:0},{x:h.x+1,y:h.y+1},u.data)}for(let l in t){let u=t[l],h=r[l].paddedRect,c=h.x+1,p=h.y+1,d=u.data.width,f=u.data.height;xe.copy(u.data,n,{x:0,y:0},{x:c,y:p},u.data),xe.copy(u.data,n,{x:0,y:f-1},{x:c,y:p-1},{width:d,height:1}),xe.copy(u.data,n,{x:0,y:0},{x:c,y:p+f},{width:d,height:1}),xe.copy(u.data,n,{x:d-1,y:0},{x:c-1,y:p},{width:1,height:f}),xe.copy(u.data,n,{x:0,y:0},{x:c+d,y:p},{width:1,height:f})}this.image=n,this.iconPositions=i,this.patternPositions=r}addImages(e,t,i){for(let r in e){let a=e[r],s={x:0,y:0,w:a.data.width+2,h:a.data.height+2};i.push(s),t[r]=new lh(s,a),a.hasRenderCallback&&this.haveRenderCallbacks.push(r)}}patchUpdatedImages(e,t){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let i in e.updatedImages)this.patchUpdatedImage(this.iconPositions[i],e.getImage(i),t),this.patchUpdatedImage(this.patternPositions[i],e.getImage(i),t)}patchUpdatedImage(e,t,i){if(!e||!t||e.version===t.version)return;e.version=t.version;let[r,a]=e.tl;i.update(t.data,void 0,{x:r,y:a})}};V("ImagePosition",lh),V("ImageAtlas",$b);var Gm=(function(e){return e[e.none=0]="none",e[e.horizontal=1]="horizontal",e[e.vertical=2]="vertical",e[e.horizontalOnly=3]="horizontalOnly",e})(Gm||{});function Zm(e){let t=.5,i=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0;break}switch(e){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0;break}return{horizontalAlign:t,verticalAlign:i}}const Yc=32640;function Kc(e,t){let{expression:i}=t;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new Se(e+1))};if(i.kind==="source")return{kind:"source"};{let{zoomStops:r,interpolationType:a}=i,s=0;for(;s<r.length&&r[s]<=e;)s++;s=Math.max(0,s-1);let o=s;for(;o<r.length&&r[o]<e+1;)o++;o=Math.min(r.length-1,o);let n=r[s],l=r[o];return i.kind==="composite"?{kind:"composite",minZoom:n,maxZoom:l,interpolationType:a}:{kind:"camera",minZoom:n,maxZoom:l,minSize:i.evaluate(new Se(n)),maxSize:i.evaluate(new Se(l)),interpolationType:a}}}function uh(e,{uSize:t,uSizeT:i},{lowerSize:r,upperSize:a}){return e.kind==="source"?r/128:e.kind==="composite"?$e.number(r/128,a/128,i):t}function rn(e,t){let i=0,r=0;if(e.kind==="constant")r=e.layoutSize;else if(e.kind!=="source"){let{interpolationType:a,minZoom:s,maxZoom:
2o}=e,n=a?oe(Ht.interpolationFactor(a,t,s,o),0,1):0;e.kind==="camera"?r=$e.number(e.minSize,e.maxSize,n):i=n}return{uSizeT:i,uSize:r}}function So(e,t,i){let r="never",a=e.get(t);return a?r=a:e.get(i)&&(r="always"),r}const Vb=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Fs(e,t,i,r,a,s,o,n,l,u,h,c,p){let d=n?Math.min(Yc,Math.round(n[0])):0,f=n?Math.min(Yc,Math.round(n[1])):0;e.emplaceBack(t,i,Math.round(r*32),Math.round(a*32),s,o,(d<<1)+ +!!l,f,u*16,h*16,c*256,p*256)}function Qa(e,t,i){e.emplaceBack(t.x,t.y,i),e.emplaceBack(t.x,t.y,i),e.emplaceBack(t.x,t.y,i),e.emplaceBack(t.x,t.y,i)}function jb(e){for(let t of e.sections)if(W0(t.text))return!0;return!1}var su=class{constructor(e){this.layoutVertexArray=new hx,this.indexArray=new hi,this.programConfigurations=e,this.segments=new Te,this.dynamicLayoutVertexArray=new cx,this.opacityVertexArray=new px,this.hasVisibleVertices=!1,this.placedSymbolArray=new lm}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,t,i,r){this.isEmpty()||(i&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Tb.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Sb.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Vb,!0),this.opacityVertexBuffer.itemSize=1),(i||r)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};V("SymbolBuffers",su);var ou=class{constructor(e,t,i){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new i,this.segments=new Te,this.collisionVertexArray=new fx}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Pb.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};V("CollisionBuffers",ou);var Or=class{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(o=>o.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];let t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Kc(this.zoom,t["text-size"]),this.iconSizeData=Kc(this.zoom,t["icon-size"]);let i=this.layers[0].layout,r=i.get("symbol-sort-key"),a=i.get("symbol-z-order");this.canOverlap=So(i,"text-overlap","text-allow-overlap")!=="never"||So(i,"icon-overlap","icon-allow-overlap")!=="never"||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey=a!=="viewport-y"&&!r.isConstant();let s=a==="viewport-y"||a==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=s&&this.canOverlap,i.get("symbol-placement")==="point"&&(this.writingModes=i.get("text-writing-mode").map(o=>Gm[o])),this.stateDependentLayerIds=this.layers.filter(o=>o.isStateDependent()).map(o=>o.id),this.sourceID=e.sourceID}createArrays(){this.text=new su(new cr(this.layers,this.zoom,e=>e.startsWith("text"))),this.icon=new su(new cr(this.layers,this.zoom,e=>e.startsWith("icon"))),this.glyphOffsetArray=new cm,this.lineVertexArray=new pm,this.symbolInstances=new hm,this.textAnchorOffsets=new fm}calculateGlyphDependencies(e,t,i,r,a){for(let s of e)if(t[s.codePointAt(0)]=!0,(i||r)&&a){let o=Cb[s];o&&(t[o.codePointAt(0)]=!0)}}populate(e,t,i){let r=this.layers[0],a=r.layout,s=a.get("text-font"),o=a.get("text-field"),n=a.get("icon-image"),l=(o.value.kind!=="constant"||o.value.value instanceof Pi&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&(s.value.kind!=="constant"||s.value.value.length>0),u=n.value.kind!=="constant"||!!n.value.value||Object.keys(n.parameters).length>0,h=a.get("symbol-sort-key");if(this.features=[],!l&&!u)return;let c=t.iconDependencies,p=t.glyphDependencies,d=t.availableImages,f=new Se(this.zoom);for(let{feature:m,id:_,index:g,sourceLayerIndex:x}of e){let y=r._featureFilter.needGeometry,v=_r(m,y);if(!r._featureFilter.filter(f,v,i))continue;y||(v.geometry=mr(m));let w;
vendor: 6,935 bytes, line 2
2if(l){let M=r.getValueAndResolveTokens("text-field",v,i,d),D=Pi.factory(M);this.hasRTLText||=jb(D),(!this.hasRTLText||Xr.getRTLTextPluginStatus()==="unavailable"||this.hasRTLText&&Xr.isParsed())&&(w=Mb(D,r,v))}let b;if(u){let M=r.getValueAndResolveTokens("icon-image",v,i,d);b=M instanceof oi?M:oi.fromString(M)}if(!w&&!b)continue;let T=this.sortFeaturesByKey?h.evaluate(v,{},i):void 0,I={id:_,text:w,icon:b,index:g,sourceLayerIndex:x,geometry:v.geometry,properties:m.properties,type:fs.types[m.type],sortKey:T};if(this.features.push(I),b&&(c[b.name]=!0),w){let M=s.evaluate(v,{},i).join(","),D=a.get("text-rotation-alignment")!=="viewport"&&a.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes?.includes(2);for(let L of w.sections)if(L.image)c[L.image.name]=!0;else{let z=G0(w.toString()),P=L.fontStack||M;p[P]||={},this.calculateGlyphDependencies(L.text,p[P],D,this.allowVerticalPlacement,z)}}}a.get("symbol-placement")==="line"&&(this.features=Ab(this.features)),this.sortFeaturesByKey&&this.features.sort((m,_)=>m.sortKey-_.sortKey)}update(e,t,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:i}),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:i}))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){let i=this.lineVertexArray.length;if(e.segment!==void 0){let r=e.dist(t[e.segment+1]),a=e.dist(t[e.segment]),s={};for(let o=e.segment+1;o<t.length;o++)s[o]={x:t[o].x,y:t[o].y,tileUnitDistanceFromAnchor:r},o<t.length-1&&(r+=t[o+1].dist(t[o]));for(let o=e.segment||0;o>=0;o--)s[o]={x:t[o].x,y:t[o].y,tileUnitDistanceFromAnchor:a},o>0&&(a+=t[o-1].dist(t[o]));for(let o=0;o<t.length;o++){let n=s[o];this.lineVertexArray.emplaceBack(n.x,n.y,n.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(e,t,i,r,a,s,o,n,l,u,h,c){let p=e.indexArray,d=e.layoutVertexArray,f=e.segments.prepareSegment(4*t.length,d,p,this.canOverlap?s.sortKey:void 0),m=this.glyphOffsetArray.length,_=f.vertexLength,g=this.allowVerticalPlacement&&o===2?Math.PI/2:0,x=s.text&&s.text.sections;for(let y=0;y<t.length;y++){let{tl:v,tr:w,bl:b,br:T,tex:I,pixelOffsetTL:M,pixelOffsetBR:D,minFontScaleX:L,minFontScaleY:z,glyphOffset:P,isSDF:S,sectionIndex:F}=t[y],O=f.vertexLength,H=P[1];Fs(d,n.x,n.y,v.x,H+v.y,I.x,I.y,i,S,M.x,M.y,L,z),Fs(d,n.x,n.y,w.x,H+w.y,I.x+I.w,I.y,i,S,D.x,M.y,L,z),Fs(d,n.x,n.y,b.x,H+b.y,I.x,I.y+I.h,i,S,M.x,D.y,L,z),Fs(d,n.x,n.y,T.x,H+T.y,I.x+I.w,I.y+I.h,i,S,D.x,D.y,L,z),Qa(e.dynamicLayoutVertexArray,n,g),p.emplaceBack(O,O+2,O+1),p.emplaceBack(O+1,O+2,O+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(P[0]),(y===t.length-1||F!==t[y+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(d.length,s,s.index,{imagePositions:{},canonical:c,formattedSection:x?.[F]})}e.placedSymbolArray.emplaceBack(n.x,n.y,m,this.glyphOffsetArray.length-m,_,l,u,n.segment,i?i[0]:0,i?i[1]:0,r[0],r[1],o,0,!1,0,h)}_addCollisionDebugVertex(e,t,i,r,a,s){return t.emplaceBack(0,0),e.emplaceBack(i.x,i.y,r,a,Math.round(s.x),Math.round(s.y))}addCollisionDebugVertices(e,t,i,r,a,s,o){let n=a.segments.prepareSegment(4,a.layoutVertexArray,a.indexArray),l=n.vertexLength,u=a.layoutVertexArray,h=a.collisionVertexArray,c=o.anchorX,p=o.anchorY;this._addCollisionDebugVertex(u,h,s,c,p,new E(e,t)),this._addCollisionDebugVertex(u,h,s,c,p,new E(i,t)),this._addCollisionDebugVertex(u,h,s,c,p,new E(i,r)),this._addCollisionDebugVertex(u,h,s,c,p,new E(e,r)),n.vertexLength+=4;let d=a.indexArray;d.emplaceBack(l,l+1),d.emplaceBack(l+1,l+2),d.emplaceBack(l+2,l+3),d.emplaceBack(l+3,l),n.primitiveLength+=4}addDebugCollisionBoxes(e,t,i,r){for(let a=e;a<t;a++){let s=this.collisionBoxArray.get(a),o=s.x1,n=s.y1,l=s.x2,u=s.y2;this.addCollisionDebugVertices(o,n,l,u,r?this.textCollisionBox:this.iconCollisionBox,s.anchorPoint,i)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new ou(Cc,Wc.members,Wl),this.iconCollisionBox=new ou(Cc,Wc.members,Wl);for(let e=0;e<this.symbolInstances.length;e++){let t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}}_deserializeCollisionBoxesForSymbol(e,t,i,r,a,s,o,n,l){let u={};for(let h=t;h<i;h++){let c=e.get(h);u.textBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.textFeatureIndex=c.featureIndex;break}for(let h=r;h<a;h++){let c=e.get(h);u.verticalTextBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.verticalTextFeatureIndex=c.featureIndex;break}for(let h=s;h<o;h++){let c=e.get(h);u.iconBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.iconFeatureIndex=c.featureIndex;break}for(let h=n;h<l;h++){let c=e.get(h);u.verticalIconBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.verticalIconFeatureIndex=c.featureIndex;break}return u}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){let i=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,t){let i=e.placedSymbolArray.get(t),r=i.vertexStartIndex+i.numGlyphs*4;for(let a=i.vertexStartIndex;a<r;a+=4)e.indexArray.emplaceBack(a,a+2,a+1),e.indexArray.emplaceBack(a+1,a+2,a+3)}
vendor: 36,491 bytes, line 2
2getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let t=Math.sin(e),i=Math.cos(e),r=[],a=[],s=[];for(let o=0;o<this.symbolInstances.length;++o){s.push(o);let n=this.symbolInstances.get(o);r.push(Math.round(t*n.anchorX+i*n.anchorY)|0),a.push(n.featureIndex)}return s.sort((o,n)=>r[o]-r[n]||a[n]-a[o]),s}addToSortKeyRanges(e,t){let i=this.sortKeyRanges[this.sortKeyRanges.length-1];i?.sortKey===t?i.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let t of this.symbolInstanceIndexes){let i=this.symbolInstances.get(t);this.featureSortOrder.push(i.featureIndex);let r=[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex];for(let a=0;a<r.length;a++){let s=r[a];s>=0&&r.indexOf(s)===a&&this.addIndicesForPlacedSymbol(this.text,s)}i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};V("SymbolBucket",Or,{omit:["layers","collisionBoxArray","features","compareText"]}),Or.MAX_GLYPHS=65535,Or.addDynamicAttributes=Qa;function Nb(e,t){return t.replace(/{([^{}]+)}/g,(i,r)=>e&&r in e?String(e[r]):"")}let Ub;const Gb=()=>Ub||=new Ke({"symbol-placement":new $(A.layout_symbol["symbol-placement"],"symbol-placement"),"symbol-spacing":new $(A.layout_symbol["symbol-spacing"],"symbol-spacing"),"symbol-avoid-edges":new $(A.layout_symbol["symbol-avoid-edges"],"symbol-avoid-edges"),"symbol-sort-key":new Z(A.layout_symbol["symbol-sort-key"],"symbol-sort-key"),"symbol-z-order":new $(A.layout_symbol["symbol-z-order"],"symbol-z-order"),"icon-allow-overlap":new $(A.layout_symbol["icon-allow-overlap"],"icon-allow-overlap"),"icon-overlap":new $(A.layout_symbol["icon-overlap"],"icon-overlap"),"icon-ignore-placement":new $(A.layout_symbol["icon-ignore-placement"],"icon-ignore-placement"),"icon-optional":new $(A.layout_symbol["icon-optional"],"icon-optional"),"icon-rotation-alignment":new $(A.layout_symbol["icon-rotation-alignment"],"icon-rotation-alignment"),"icon-size":new Z(A.layout_symbol["icon-size"],"icon-size"),"icon-text-fit":new $(A.layout_symbol["icon-text-fit"],"icon-text-fit"),"icon-text-fit-padding":new $(A.layout_symbol["icon-text-fit-padding"],"icon-text-fit-padding"),"icon-image":new Z(A.layout_symbol["icon-image"],"icon-image"),"icon-rotate":new Z(A.layout_symbol["icon-rotate"],"icon-rotate"),"icon-padding":new Z(A.layout_symbol["icon-padding"],"icon-padding"),"icon-keep-upright":new $(A.layout_symbol["icon-keep-upright"],"icon-keep-upright"),"icon-offset":new Z(A.layout_symbol["icon-offset"],"icon-offset"),"icon-anchor":new Z(A.layout_symbol["icon-anchor"],"icon-anchor"),"icon-pitch-alignment":new $(A.layout_symbol["icon-pitch-alignment"],"icon-pitch-alignment"),"text-pitch-alignment":new $(A.layout_symbol["text-pitch-alignment"],"text-pitch-alignment"),"text-rotation-alignment":new $(A.layout_symbol["text-rotation-alignment"],"text-rotation-alignment"),"text-field":new Z(A.layout_symbol["text-field"],"text-field"),"text-font":new Z(A.layout_symbol["text-font"],"text-font"),"text-size":new Z(A.layout_symbol["text-size"],"text-size"),"text-max-width":new Z(A.layout_symbol["text-max-width"],"text-max-width"),"text-line-height":new $(A.layout_symbol["text-line-height"],"text-line-height"),"text-letter-spacing":new Z(A.layout_symbol["text-letter-spacing"],"text-letter-spacing"),"text-justify":new Z(A.layout_symbol["text-justify"],"text-justify"),"text-radial-offset":new Z(A.layout_symbol["text-radial-offset"],"text-radial-offset"),"text-variable-anchor":new $(A.layout_symbol["text-variable-anchor"],"text-variable-anchor"),"text-variable-anchor-offset":new Z(A.layout_symbol["text-variable-anchor-offset"],"text-variable-anchor-offset"),"text-anchor":new Z(A.layout_symbol["text-anchor"],"text-anchor"),"text-max-angle":new $(A.layout_symbol["text-max-angle"],"text-max-angle"),"text-writing-mode":new $(A.layout_symbol["text-writing-mode"],"text-writing-mode"),"text-rotate":new Z(A.layout_symbol["text-rotate"],"text-rotate"),"text-padding":new $(A.layout_symbol["text-padding"],"text-padding"),"text-keep-upright":new $(A.layout_symbol["text-keep-upright"],"text-keep-upright"),"text-transform":new Z(A.layout_symbol["text-transform"],"text-transform"),"text-offset":new Z(A.layout_symbol["text-offset"],"text-offset"),"text-allow-overlap":new $(A.layout_symbol["text-allow-overlap"],"text-allow-overlap"),"text-overlap":new $(A.layout_symbol["text-overlap"],"text-overlap"),"text-ignore-placement":new $(A.layout_symbol["text-ignore-placement"],"text-ignore-placement"),"text-optional":new $(A.layout_symbol["text-optional"],"text-optional")});let Zb;const qb=()=>Zb||=new Ke({"icon-opacity":new Z(A.paint_symbol["icon-opacity"],"icon-opacity"),"icon-color":new Z(A.paint_symbol["icon-color"],"icon-color"),"icon-halo-color":new Z(A.paint_symbol["icon-halo-color"],"icon-halo-color"),"icon-halo-width":new Z(A.paint_symbol["icon-halo-width"],"icon-halo-width"),"icon-halo-blur":new Z(A.paint_symbol["icon-halo-blur"],"icon-halo-blur"),"icon-translate":new $(A.paint_symbol["icon-translate"],"icon-translate"),"icon-translate-anchor":new $(A.paint_symbol["icon-translate-anchor"],"icon-translate-anchor"),"text-opacity":new Z(A.paint_symbol["text-opacity"],"text-opacity"),"text-color":new Z(A.paint_symbol["text-color"],"text-color",{runtimeType:Wt,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new Z(A.paint_symbol["text-halo-color"],"text-halo-color"),"text-halo-width":new Z(A.paint_symbol["text-halo-width"],"text-halo-width"),"text-halo-blur":new Z(A.paint_symbol["text-halo-blur"],"text-halo-blur"),"text-translate":new $(A.paint_symbol["text-translate"],"text-translate"),"text-translate-anchor":new $(A.paint_symbol["text-translate-anchor"],"text-translate-anchor")});var Fn={get paint(){return qb()},get layout(){return Gb()}},qm=class{constructor(e){if(e.property.overrides===void 0)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:os,this.defaultValue=e}evaluate(e){if(e.formattedSection){let t=this.defaultValue.property.overrides;if(t?.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){if(!this.defaultValue.isConstant()){let t=this.defaultValue.value;e(t._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};V("FormatSectionOverride",qm,{omit:["defaultValue"]});const Wm=e=>e.type==="symbol";var Wb=class nu extends Yt{constructor(t,i){super(t,Fn,i)}recalculate(t,i){if(super.recalculate(t,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")==="point"?this.layout._values["icon-rotation-alignment"]="viewport":this.layout._values["icon-rotation-alignment"]="map"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")==="point"?this.layout._values["text-rotation-alignment"]="viewport":this.layout._values["text-rotation-alignment"]="map"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let r=this.layout.get("text-writing-mode");if(r){let a=[];for(let s of r)a.includes(s)||a.push(s);this.layout._values["text-writing-mode"]=a}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,i,r,a){let s=this.layout.get(t).evaluate(i,{},r,a),o=this._unevaluatedLayout._values[t];return!o.isDataDriven()&&!qo(o.value)&&s?Nb(i.properties,s):s}createBucket(t){return new Or(t)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let t of Fn.paint.overridableProperties){if(!nu.hasPaintOverride(this.layout,t))continue;let i=this.paint.get(t),r=new Zu(new qm(i),`layers[${this.id}].paint.${i.property.name}`,i.property.specification),a=null;a=i.value.kind==="constant"||i.value.kind==="source"?new Ua("source",r):new fo("composite",r,i.value.zoomStops),this.paint._values[t]=new qt(i.property,a,i.parameters)}}_handleOverridablePaintPropertyUpdate(t,i,r){return!this.layout||i.isDataDriven()||r.isDataDriven()?!1:nu.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,i){let r=t.get("text-field"),a=Fn.paint.properties[i],s=!1,o=n=>{for(let l of n)if(a.overrides?.hasOverride(l)){s=!0;return}};if(r.value.kind==="constant"&&r.value.value instanceof Pi)o(r.value.value.sections);else if(r.value.kind==="source"||r.value.kind==="composite"){let n=u=>{if(!s)if(u instanceof $a&&Oe(u.value)===ns){let h=u.value;o(h.sections)}else u instanceof pf?o(u.sections):u.eachChild(n)},l=r.value;l._styleExpression&&n(l._styleExpression.expression)}return s}};let Hb;const Xb=()=>Hb||=new Ke({"background-color":new $(A.paint_background["background-color"],"background-color"),"background-pattern":new am(A.paint_background["background-pattern"],"background-pattern"),"background-opacity":new $(A.paint_background["background-opacity"],"background-opacity")});var Yb={get paint(){return Xb()}};const Kb=e=>e.type==="background";var Jb=class extends Yt{constructor(e,t){super(e,Yb,t)}};function Qb(e){let t=[],i=e.id;return i===void 0&&t.push(new R(`layers.${i}`,null,'missing required property "id"')),e.render===void 0&&t.push(new R(`layers.${i}`,null,'missing required method "render"')),e.renderingMode&&e.renderingMode!=="2d"&&e.renderingMode!=="3d"&&t.push(new R(`layers.${i}`,null,'property "renderingMode" must be either "2d" or "3d"')),t}const ew=e=>e.type==="custom";var tw=class extends Yt{constructor(e,t){super(e,{},t),this.onAdd=i=>{this.implementation.onAdd&&this.implementation.onAdd(i,i.painter.context.gl)},this.onRemove=i=>{this.implementation.onRemove&&this.implementation.onRemove(i,i.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}};function Bn(e,t){if(e.type==="custom")return new tw(e,t);switch(e.type){case"background":return new Jb(e,t);case"circle":return new Wx(e,t);case"color-relief":return new u1(e,t);case"fill":return new U1(e,t);case"fill-extrusion":return new sb(e,t);case"heatmap":return new Jx(e,t);case"hillshade":return new r1(e,t);case"line":return new wb(e,t);case"raster":return new ex(e,t);case"symbol":return new Wb(e,t)}}var iw=class{constructor(e){this._methodToThrottle=e,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){this._triggered||(this._triggered=!0,this._channel?.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}};const rw={once:!0};var aw=class{constructor(e,t){this.target=e,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new iw(()=>this.process()),this.subscription=cl(this.target,"message",i=>this.receive(i),!1),this.globalScope=Gr(self)?e:window}registerMessageHandler(e,t){this.messageHandlers[e]=t}unregisterMessageHandler(e){delete this.messageHandlers[e]}sendAsync(e,t){return new Promise((i,r)=>{let a=Math.round(Math.random()*1e18).toString(36).substring(0,10),s=t?cl(t.signal,"abort",()=>{s?.unsubscribe(),delete this.resolveRejects[a];let l={id:a,type:"<cancel>",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(l),r(new ss(t.signal.reason))},rw):null;this.resolveRejects[a]={resolve:l=>{s?.unsubscribe(),i(l)},reject:l=>{s?.unsubscribe(),r(l)}};let o=[],n={...e,id:a,sourceMapId:this.mapId,origin:location.origin,data:Da(e.data,o)};this.target.postMessage(n,{transfer:o})})}receive(e){let t=e.data,i=t.id,r=["file://","resource://android","null"],a=[t.origin,location.origin],s=t.origin===location.origin,o=a.some(n=>r.includes(n));if(!(!s&&!o)&&!(t.targetMapId&&this.mapId!==t.targetMapId)){if(t.type==="<cancel>"){delete this.tasks[i];let n=this.abortControllers[i];delete this.abortControllers[i],n&&n.abort();return}if(Gr(self)||t.mustQueue){this.tasks[i]=t,this.taskQueue.push(i),this.invoker.trigger();return}this.processTask(i,t)}}process(){if(this.taskQueue.length===0)return;let e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(e,t)}async processTask(e,t){if(t.type==="<response>"){let a=this.resolveRejects[e];if(delete this.resolveRejects[e],!a)return;t.error?a.reject(ht(za(t.error))):a.resolve(za(t.data));return}if(!this.messageHandlers[t.type]){this.completeTask(e,null,null);return}let i=za(t.data),r=new AbortController;this.abortControllers[e]=r;try{let a=await this.messageHandlers[t.type](t.sourceMapId,i,r);this.completeTask(e,null,a)}catch(a){this.completeTask(e,ht(a))}}completeTask(e,t,i){let r=[];delete this.abortControllers[e];let a={id:e,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?Da(t):null,data:Da(i,r)};this.target.postMessage(a,{transfer:r})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};const Vi=63710088e-1;var W=class Ea{constructor(t,i){if(isNaN(t)||isNaN(i))throw Error(`Invalid LngLat object: (${t}, ${i})`);if(this.lng=+t,this.lat=+i,this.lat>90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ea(Zt(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){let i=Math.PI/180,r=this.lat*i,a=t.lat*i,s=Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos((t.lng-this.lng)*i);return Vi*Math.acos(Math.min(s,1))}static convert(t){if(t instanceof Ea)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new Ea(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t)return new Ea(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}};const Hm=2*Math.PI*Vi;function Xm(e){return Hm*Math.cos(e*Math.PI/180)}function Kr(e){return(180+e)/360}function Jr(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function ji(e,t){return e/Xm(t)}function lu(e){return e*360-180}function es(e){let t=180-e*360;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}function Ym(e,t){return e*Xm(es(t))}function sw(e){return 1/Math.cos(e*Math.PI/180)}var ye=class Km{constructor(t,i,r=0){this.x=+t,this.y=+i,this.z=+r}static fromLngLat(t,i=0){let r=W.convert(t);return new Km(Kr(r.lng),Jr(r.lat),ji(i,r.lat))}toLngLat(){return new W(lu(this.x),es(this.y))}toAltitude(){return Ym(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Hm*sw(es(this.y))}};function ow(e,t,i){return!(e<0||e>25||i<0||i>=2**e||t<0||t>=2**e)}function Jc(e,t){let{x:i,y:r}=ye.fromLngLat(t);return!(e<0||e>25||r<0||r>=1||i<0||i>=1)}var an=class{constructor(e,t,i){if(!ow(e,t,i))throw Error(`x=${t}, y=${i}, z=${e} outside of bounds. 0<=x<${2**e}, 0<=y<${2**e} 0<=z<=25 `);this.z=e,this.x=t,this.y=i,this.key=$r(0,e,e,t,i)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,i){let r=nw(this.x,this.y,this.z),a=lw(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(i==="tms"?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,t>1?"@2x":"").replace(/{quadkey}/g,a).replace(/{bbox-epsg-3857}/g,r)}isChildOf(e){let t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}getTilePoint(e){let t=2**this.z;return new E((e.x*t-this.x)*C,(e.y*t-this.y)*C)}toString(){return`${this.z}/${this.x}/${this.y}`}},Po=class{constructor(e,t){this.wrap=e,this.canonical=t,this.key=$r(e,t.z,t.z,t.x,t.y)}},et=class Ct{constructor(t,i,r,a,s){if(this.terrainRttPosMatrix32f=null,t<r)throw Error(`overscaledZ should be >= z; overscaledZ = ${t}; z = ${r}`);this.overscaledZ=t,this.wrap=i,this.canonical=new an(r,+a,+s),this.key=$r(i,t,r,a,s)}clone(){return new Ct(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-t;return t>this.canonical.z?new Ct(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Ct(t,this.wrap,t,this.canonical.x>>i,this.canonical.y>>i)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(t,i){if(t>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-t;return t>this.canonical.z?$r(this.wrap*+i,t,this.canonical.z,this.canonical.x,this.canonical.y):$r(this.wrap*+i,t,t,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(t){if(t.wrap!==this.wrap||this.overscaledZ-t.overscaledZ<=0)return!1;if(t.overscaledZ===0)return this.overscaledZ>0;let i=this.canonical.z-t.canonical.z;return i<0?!1:t.canonical.x===this.canonical.x>>i&&t.canonical.y===this.canonical.y>>i}children(t){if(this.overscaledZ>=t)return[new Ct(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let i=this.canonical.z+1,r=this.canonical.x*2,a=this.canonical.y*2;return[new Ct(i,this.wrap,i,r,a),new Ct(i,this.wrap,i,r+1,a),new Ct(i,this.wrap,i,r,a+1),new Ct(i,this.wrap,i,r+1,a+1)]}isLessThan(t){return this.wrap<t.wrap?!0:this.wrap>t.wrap?!1:this.overscaledZ<t.overscaledZ?!0:this.overscaledZ>t.overscaledZ?!1:this.canonical.x<t.canonical.x?!0:this.canonical.x>t.canonical.x?!1:this.canonical.y<t.canonical.y}wrapped(){return new Ct(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new Ct(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return 2**(this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Po(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new ye(t.x-this.wrap,t.y))}normalizeCoordinates(t,i,r=C){if(t>=0&&t<r&&i>=0&&i<r)return{tileID:this,x:t,y:i};let a=Math.floor(t/r),s=Math.floor(i/r),o=t-a*r,n=i-s*r,l=this.canonical.z,u=1<<l,h=this.canonical.y+s;if(h<0||h>=u)return null;let c=this.canonical.x+a,p=this.wrap;return c<0?(p-=Math.ceil(-c/u),c=(c%u+u)%u):c>=u&&(p+=Math.floor(c/u),c%=u),{tileID:new Ct(this.overscaledZ,p,l,c,h),x:o,y:n}}};function $r(e,t,i,r,a){e*=2,e<0&&(e=e*-1-1);let s=1<<i;return(s*s*e+s*a+r).toString(36)+i.toString(36)+t.toString(36)}const On=Math.PI*6378137;function nw(e,t,i){t=2**i-t-1;let r=Qc(e*256,t*256,i),a=Qc((e+1)*256,(t+1)*256,i);return`${r[0]},${r[1]},${a[0]},${a[1]}`}function Qc(e,t,i){let r=2*On/256/2**i;return[e*r-On,t*r-On]}function lw(e,t,i){let r="";for(let a=e;a>0;a--){let s=1<<a-1;r+=(t&s?1:0)+(i&s?2:0)}return r}function ep(e,t){let i=Math.abs(e.wrap*2)-+(e.wrap<0),r=Math.abs(t.wrap*2)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||r-i||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}V("CanonicalTileID",an),V("OverscaledTileID",et,{omit:["terrainRttPosMatrix32f"]});var ai=class uu{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(t){return this.minX=Math.min(this.minX,t.x),this.minY=Math.min(this.minY,t.y),this.maxX=Math.max(this.maxX,t.x),this.maxY=Math.max(this.maxY,t.y),this}expandBy(t){return this.minX-=t,this.minY-=t,this.maxX+=t,this.maxY+=t,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(t){return this.expandBy(-t)}map(t){let i=new uu;return i.extend(t(new E(this.minX,this.minY))),i.extend(t(new E(this.maxX,this.minY))),i.extend(t(new E(this.minX,this.maxY))),i.extend(t(new E(this.maxX,this.maxY))),i}static fromPoints(t){let i=new uu;for(let r of t)i.extend(r);return i}contains(t){return t.x>=this.minX&&t.x<=this.maxX&&t.y>=this.minY&&t.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(t){return!this.empty()&&!t.empty()&&t.minX>=this.minX&&t.maxX<=this.maxX&&t.minY>=this.minY&&t.maxY<=this.maxY}intersects(t){return!this.empty()&&!t.empty()&&t.minX<=this.maxX&&t.maxX>=this.minX&&t.minY<=this.maxY&&t.maxY>=this.minY}};const to="_geojsonTileLayer";var uw=class{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){let i=e[t];this._stringToNumber[i]=t,this._numberToString[t]=i}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}},Jm=class{constructor(e,t,i,r,a){this.type="Feature",this._vectorTileFeature=e,this._x=i,this._y=r,this._z=t;for(let s in e.properties)typeof e.properties[s]!="string"||!e.properties[s].startsWith("__$json__:")||(e.properties[s]=JSON.parse(e.properties[s].slice(10)));this.properties=e.properties,this.id=a}projectPoint(e,t,i,r){return[(e.x+t)*360/r-180,360/Math.PI*Math.atan(Math.exp((1-(e.y+i)*2/r)*Math.PI))-90]}projectLine(e,t,i,r){return e.map(a=>this.projectPoint(a,t,i,r))}get geometry(){if(this._geometry)return this._geometry;let e=this._vectorTileFeature,t=e.extent*2**this._z,i=e.extent*this._x,r=e.extent*this._y,a=e.loadGeometry();switch(e.type){case 1:{let s=[];for(let n of a)s.push(n[0]);let o=this.projectLine(s,i,r,t);this._geometry=s.length===1?{type:"Point",coordinates:o[0]}:{type:"MultiPoint",coordinates:o};break}case 2:{let s=a.map(o=>this.projectLine(o,i,r,t));this._geometry=s.length===1?{type:"LineString",coordinates:s[0]}:{type:"MultiLineString",coordinates:s};break}case 3:{let s=Om(a),o=[];for(let n of s)o.push(n.map(l=>this.projectLine(l,i,r,t)));this._geometry=o.length===1?{type:"Polygon",coordinates:o[0]}:{type:"MultiPolygon",coordinates:o};break}default:throw Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let t in this)t!=="_geometry"&&t!=="_vectorTileFeature"&&t!=="_x"&&t!=="_y"&&t!=="_z"&&(e[t]=this[t]);return e}},ta=class{constructor(e,t,i){this._name=e,this.dataBuffer=t,typeof i=="number"?this._size=i:(this.nullabilityBuffer=i,this._size=i.size())}getValue(e){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(e)?null:this.getValueFromBuffer(e)}has(e){return this.nullabilityBuffer?.get(e)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},sn=class extends ta{},hh=class extends sn{getValueFromBuffer(e){return this.dataBuffer[e]}},ch=class extends sn{getValueFromBuffer(e){return this.dataBuffer[e]}},Qm=class extends ta{constructor(e,t,i,r){super(e,t,r),this.delta=i}},ph=class extends Qm{constructor(e,t,i,r){super(e,Int32Array.of(t),i,r)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}},dh=class extends ta{constructor(e,t,i,r){super(e,r?Int32Array.of(t):Uint32Array.of(t),i)}getValueFromBuffer(e){return this.dataBuffer[0]}},hw=class{constructor(e,t,i,r,a=4096){if(this._name=e,this._geometryVector=t,this._idVector=i,this._propertyVectors=r,this._extent=a,e.length===0)throw Error("Missing layer name")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors}getPropertyVector(e){return this.propertyVectorsMap||=new Map(this._propertyVectors.map(t=>[t.name,t])),this.propertyVectorsMap.get(e)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let e=[],t=this.geometryVector.getGeometries();for(let i=0;i<this.numFeatures;i++){let r;if(this.idVector){let o=this.idVector.getValue(i);r=this.containsMaxSafeIntegerValues(this.idVector)&&o!==null?Number(o):o}let a={coordinates:t[i],type:this.geometryVector.geometryType(i)},s={};for(let o of this.propertyVectors){if(!o)continue;let n=o.name,l=o.getValue(i);l!==null&&(s[n]=l)}e.push({id:r,geometry:a,properties:s})}return e}containsMaxSafeIntegerValues(e){return e instanceof hh||e instanceof dh||e instanceof ph||e instanceof ch}};const io={FEATURE:0},ne={BOOLEAN:0,INT_8:1,UINT_8:2,INT_32:3,UINT_32:4,INT_64:5,UINT_64:6,FLOAT:7,DOUBLE:8,STRING:9},ts={GEOMETRY:0,STRUCT:1},fh={ID:0};var e_=class{constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}increment(){return this.value++}add(e){this.value+=e}},Q;(function(e){e.NONE="NONE",e.DELTA="DELTA",e.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",e.RLE="RLE",e.MORTON="MORTON",e.PDE="PDE"})(Q||={});var wi;(function(e){e.NONE="NONE",e.FAST_PFOR="FAST_PFOR",e.VARINT="VARINT"})(wi||={});const mh=new Uint32Array(33);mh[0]=0;for(let e=1;e<=32;e++)mh[e]=e===32?4294967295:4294967295>>>32-e;const hu=mh,t_=65536;function _h(e,t){return e-e%t}function cw(e){return _h(e+31,32)}function pw(e){if(!Number.isFinite(e)||e<=0)return t_;let t=_h(Math.floor(e),256);return t===0?256:t}function dw(e){let t=e>>>0;return((t&255)<<24|(t&65280)<<8|t>>>8&65280|t>>>24&255)>>>0}function fw(e,t,i,r){let a=r,s=e[t]>>>0,o=e[t+1]>>>0;i[a++]=s>>>0&3,i[a++]=s>>>2&3,i[a++]=s>>>4&3,i[a++]=s>>>6&3,i[a++]=s>>>8&3,i[a++]=s>>>10&3,i[a++]=s>>>12&3,i[a++]=s>>>14&3,i[a++]=s>>>16&3,i[a++]=s>>>18&3,i[a++]=s>>>20&3,i[a++]=s>>>22&3,i[a++]=s>>>24&3,i[a++]=s>>>26&3,i[a++]=s>>>28&3,i[a++]=s>>>30&3,i[a++]=o>>>0&3,i[a++]=o>>>2&3,i[a++]=o>>>4&3,i[a++]=o>>>6&3,i[a++]=o>>>8&3,i[a++]=o>>>10&3,i[a++]=o>>>12&3,i[a++]=o>>>14&3,i[a++]=o>>>16&3,i[a++]=o>>>18&3,i[a++]=o>>>20&3,i[a++]=o>>>22&3,i[a++]=o>>>24&3,i[a++]=o>>>26&3,i[a++]=o>>>28&3,i[a]=o>>>30&3}function mw(e,t,i,r){let a=r,s=e[t]>>>0,o=e[t+1]>>>0,n=e[t+2]>>>0;i[a++]=s>>>0&7,i[a++]=s>>>3&7,i[a++]=s>>>6&7,i[a++]=s>>>9&7,i[a++]=s>>>12&7,i[a++]=s>>>15&7,i[a++]=s>>>18&7,i[a++]=s>>>21&7,i[a++]=s>>>24&7,i[a++]=s>>>27&7,i[a++]=(s>>>30|(o&1)<<2)&7,i[a++]=o>>>1&7,i[a++]=o>>>4&7,i[a++]=o>>>7&7,i[a++]=o>>>10&7,i[a++]=o>>>13&7,i[a++]=o>>>16&7,i[a++]=o>>>19&7,i[a++]=o>>>22&7,i[a++]=o>>>25&7,i[a++]=o>>>28&7,i[a++]=(o>>>31|(n&3)<<1)&7,i[a++]=n>>>2&7,i[a++]=n>>>5&7,i[a++]=n>>>8&7,i[a++]=n>>>11&7,i[a++]=n>>>14&7,i[a++]=n>>>17&7,i[a++]=n>>>20&7,i[a++]=n>>>23&7,i[a++]=n>>>26&7,i[a]=n>>>29&7}function _w(e,t,i,r){let a=r,s=e[t]>>>0,o=e[t+1]>>>0,n=e[t+2]>>>0,l=e[t+3]>>>0;i[a++]=s>>>0&15,i[a++]=s>>>4&15,i[a++]=s>>>8&15,i[a++]=s>>>12&15,i[a++]=s>>>16&15,i[a++]=s>>>20&15,i[a++]=s>>>24&15,i[a++]=s>>>28&15,i[a++]=o>>>0&15,i[a++]=o>>>4&15,i[a++]=o>>>8&15,i[a++]=o>>>12&15,i[a++]=o>>>16&15,i[a++]=o>>>20&15,i[a++]=o>>>24&15,i[a++]=o>>>28&15,i[a++]=n>>>0&15,i[a++]=n>>>4&15,i[a++]=n>>>8&15,i[a++]=n>>>12&15,i[a++]=n>>>16&15,i[a++]=n>>>20&15,i[a++]=n>>>24&15,i[a++]=n>>>28&15,i[a++]=l>>>0&15,i[a++]=l>>>4&15,i[a++]=l>>>8&15,i[a++]=l>>>12&15,i[a++]=l>>>16&15,i[a++]=l>>>20&15,i[a++]=l>>>24&15,i[a]=l>>>28&15}function gw(e,t,i,r){let a=r,s=e[t]>>>0,o=e[t+1]>>>0,n=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0;i[a++]=s>>>0&31,i[a++]=s>>>5&31,i[a++]=s>>>10&31,i[a++]=s>>>15&31,i[a++]=s>>>20&31,i[a++]=s>>>25&31,i[a++]=(s>>>30|(o&7)<<2)&31,i[a++]=o>>>3&31,i[a++]=o>>>8&31,i[a++]=o>>>13&31,i[a++]=o>>>18&31,i[a++]=o>>>23&31,i[a++]=(o>>>28|(n&1)<<4)&31,i[a++]=n>>>1&31,i[a++]=n>>>6&31,i[a++]=n>>>11&31,i[a++]=n>>>16&31,i[a++]=n>>>21&31,i[a++]=n>>>26&31,i[a++]=(n>>>31|(l&15)<<1)&31,i[a++]=l>>>4&31,i[a++]=l>>>9&31,i[a++]=l>>>14&31,i[a++]=l>>>19&31,i[a++]=l>>>24&31,i[a++]=(l>>>29|(u&3)<<3)&31,i[a++]=u>>>2&31,i[a++]=u>>>7&31,i[a++]=u>>>12&31,i[a++]=u>>>17&31,i[a++]=u>>>22&31,i[a]=u>>>27&31}function yw(e,t,i,r){let a=r,s=e[t]>>>0,o=e[t+1]>>>0,n=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,h=e[t+5]>>>0;i[a++]=s>>>0&63,i[a++]=s>>>6&63,i[a++]=s>>>12&63,i[a++]=s>>>18&63,i[a++]=s>>>24&63,i[a++]=(s>>>30|(o&15)<<2)&63,i[a++]=o>>>4&63,i[a++]=o>>>10&63,i[a++]=o>>>16&63,i[a++]=o>>>22&63,i[a++]=(o>>>28|(n&3)<<4)&63,i[a++]=n>>>2&63,i[a++]=n>>>8&63,i[a++]=n>>>14&63,i[a++]=n>>>20&63,i[a++]=n>>>26&63,i[a++]=l>>>0&63,i[a++]=l>>>6&63,i[a++]=l>>>12&63,i[a++]=l>>>18&63,i[a++]=l>>>24&63,i[a++]=(l>>>30|(u&15)<<2)&63,i[a++]=u>>>4&63,i[a++]=u>>>10&63,i[a++]=u>>>16&63,i[a++]=u>>>22&63,i[a++]=(u>>>28|(h&3)<<4)&63,i[a++]=h>>>2&63,i[a++]=h>>>8&63,i[a++]=h>>>14&63,i[a++]=h>>>20&63,i[a]=h>>>26&63}function vw(e,t,i,r){let a=r,s=e[t]>>>0,o=e[t+1]>>>0,n=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,h=e[t+5]>>>0,c=e[t+6]>>>0;i[a++]=s>>>0&127,i[a++]=s>>>7&127,i[a++]=s>>>14&127,i[a++]=s>>>21&127,i[a++]=(s>>>28|(o&7)<<4)&127,i[a++]=o>>>3&127,i[a++]=o>>>10&127,i[a++]=o>>>17&127,i[a++]=o>>>24&127,i[a++]=(o>>>31|(n&63)<<1)&127,i[a++]=n>>>6&127,i[a++]=n>>>13&127,i[a++]=n>>>20&127,i[a++]=(n>>>27|(l&3)<<5)&127,i[a++]=l>>>2&127,i[a++]=l>>>9&127,i[a++]=l>>>16&127,i[a++]=l>>>23&127,i[a++]=(l>>>30|(u&31)<<2)&127,i[a++]=u>>>5&127,i[a++]=u>>>12&127,i[a++]=u>>>19&127,i[a++]=(u>>>26|(h&1)<<6)&127,i[a++]=h>>>1&127,i[a++]=h>>>8&127,i[a++]=h>>>15&127,i[a++]=h>>>22&127,i[a++]=(h>>>29|(c&15)<<3)&127,i[a++]=c>>>4&127,i[a++]=c>>>11&127,i[a++]=c>>>18&127,i[a]=c>>>25&127}function xw(e,t,i,r){let a=r,s=e[t]>>>0,o=e[t+1]>>>0,n=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,h=e[t+5]>>>0,c=e[t+6]>>>0,p=e[t+7]>>>0;i[a++]=s>>>0&255,i[a++]=s>>>8&255,i[a++]=s>>>16&255,i[a++]=s>>>24&255,i[a++]=o>>>0&255,i[a++]=o>>>8&255,i[a++]=o>>>16&255,i[a++]=o>>>24&255,i[a++]=n>>>0&255,i[a++]=n>>>8&255,i[a++]=n>>>16&255,i[a++]=n>>>24&255,i[a++]=l>>>0&255,i[a++]=l>>>8&255,i[a++]=l>>>16&255,i[a++]=l>>>24&255,i[a++]=u>>>0&255,i[a++]=u>>>8&255,i[a++]=u>>>16&255,i[a++]=u>>>24&255,i[a++]=h>>>0&255,i[a++]=h>>>8&255,i[a++]=h>>>16&255,i[a++]=h>>>24&255,i[a++]=c>>>0&255,i[a++]=c>>>8&255,i[a++]=c>>>16&255,i[a++]=c>>>24&255,i[a++]=p>>>0&255,i[a++]=p>>>8&255,i[a++]=p>>>16&255,i[a]=p>>>24&255}function bw(e,t,i,r){let a=r,s=e[t]>>>0,o=e[t+1]>>>0,n=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,h=e[t+5]>>>0,c=e[t+6]>>>0,p=e[t+7]>>>0,d=e[t+8]>>>0;i[a++]=s>>>0&511,i[a++]=s>>>9&511,i[a++]=s>>>18&511,i[a++]=(s>>>27|(o&15)<<5)&511,i[a++]=o>>>4&511,i[a++]=o>>>13&511,i[a++]=o>>>22&511,i[a++]=(o>>>31|(n&255)<<1)&511,i[a++]=n>>>8&511,i[a++]=n>>>17&511,i[a++]=(n>>>26|(l&7)<<6)&511,i[a++]=l>>>3&511,i[a++]=l>>>12&511,i[a++]=l>>>21&511,i[a++]=(l>>>30|(u&127)<<2)&511,i[a++]=u>>>7&511,i[a++]=u>>>16&511,i[a++]=(u>>>25|(h&3)<<7)&511,i[a++]=h>>>2&511,i[a++]=h>>>11&511,i[a++]=h>>>20&511,i[a++]=(h>>>29|(c&63)<<3)&511,i[a++]=c>>>6&511,i[a++]=c>>>15&511,i[a++]=(c>>>24|(p&1)<<8)&511,i[a++]=p>>>1&511,i[a++]=p>>>10&511,i[a++]=p>>>19&511,i[a++]=(p>>>28|(d&31)<<4)&511,i[a++]=d>>>5&511,i[a++]=d>>>14&511,i[a]=d>>>23&511}function ww(e,t,i,r){let a=r,s=e[t]>>>0,o=e[t+1]>>>0,n=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,h=e[t+5]>>>0,c=e[t+6]>>>0,p=e[t+7]>>>0,d=e[t+8]>>>0,f=e[t+9]>>>0;i[a++]=s>>>0&1023,i[a++]=s>>>10&1023,i[a++]=s>>>20&1023,i[a++]=(s>>>30|(o&255)<<2)&1023,i[a++]=o>>>8&1023,i[a++]=o>>>18&1023,i[a++]=(o>>>28|(n&63)<<4)&1023,i[a++]=n>>>6&1023,i[a++]=n>>>16&1023,i[a++]=(n>>>26|(l&15)<<6)&1023,i[a++]=l>>>4&1023,i[a++]=l>>>14&1023,i[a++]=(l>>>24|(u&3)<<8)&1023,i[a++]=u>>>2&1023,i[a++]=u>>>12&1023,i[a++]=u>>>22&1023,i[a++]=h>>>0&1023,i[a++]=h>>>10&1023,i[a++]=h>>>20&1023,i[a++]=(h>>>30|(c&255)<<2)&1023,i[a++]=c>>>8&1023,i[a++]=c>>>18&1023,i[a++]=(c>>>28|(p&63)<<4)&1023,i[a++]=p>>>6&1023,i[a++]=p>>>16&1023,i[a++]=(p>>>26|(d&15)<<6)&1023,i[a++]=d>>>4&1023,i[a++]=d>>>14&1023,i[a++]=(d>>>24|(f&3)<<8)&1023,i[a++]=f>>>2&1023,i[a++]=f>>>12&1023,i[a]=f>>>22&1023}function Tw(e,t,i,r){let a=r,s=e[t]>>>0,o=e[t+1]>>>0,n=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,h=e[t+5]>>>0,c=e[t+6]>>>0,p=e[t+7]>>>0,d=e[t+8]>>>0,f=e[t+9]>>>0,m=e[t+10]>>>0;i[a++]=s>>>0&2047,i[a++]=s>>>11&2047,i[a++]=(s>>>22|(o&1)<<10)&2047,i[a++]=o>>>1&2047,i[a++]=o>>>12&2047,i[a++]=(o>>>23|(n&3)<<9)&2047,i[a++]=n>>>2&2047,i[a++]=n>>>13&2047,i[a++]=(n>>>24|(l&7)<<8)&2047,i[a++]=l>>>3&2047,i[a++]=l>>>14&2047,i[a++]=(l>>>25|(u&15)<<7)&2047,i[a++]=u>>>4&2047,i[a++]=u>>>15&2047,i[a++]=(u>>>26|(h&31)<<6)&2047,i[a++]=h>>>5&2047,i[a++]=h>>>16&2047,i[a++]=(h>>>27|(c&63)<<5)&2047,i[a++]=c>>>6&2047,i[a++]=c>>>17&2047,i[a++]=(c>>>28|(p&127)<<4)&2047,i[a++]=p>>>7&2047,i[a++]=p>>>18&2047,i[a++]=(p>>>29|(d&255)<<3)&2047,i[a++]=d>>>8&2047,i[a++]=d>>>19&2047,i[a++]=(d>>>30|(f&511)<<2)&2047,i[a++]=f>>>9&2047,i[a++]=f>>>20&2047,i[a++]=(f>>>31|(m&1023)<<1)&2047,i[a++]=m>>>10&2047,i[a]=m>>>21&2047}function Sw(e,t,i,r){let a=r,s=e[t]>>>0,o=e[t+1]>>>0,n=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,h=e[t+5]>>>0,c=e[t+6]>>>0,p=e[t+7]>>>0,d=e[t+8]>>>0,f=e[t+9]>>>0,m=e[t+10]>>>0,_=e[t+11]>>>0;i[a++]=s>>>0&4095,i[a++]=s>>>12&4095,i[a++]=(s>>>24|(o&15)<<8)&4095,i[a++]=o>>>4&4095,i[a++]=o>>>16&4095,i[a++]=(o>>>28|(n&255)<<4)&4095,i[a++]=n>>>8&4095,i[a++]=n>>>20&4095,i[a++]=l>>>0&4095,i[a++]=l>>>12&4095,i[a++]=(l>>>24|(u&15)<<8)&4095,i[a++]=u>>>4&4095,i[a++]=u>>>16&4095,i[a++]=(u>>>28|(h&255)<<4)&4095,i[a++]=h>>>8&4095,i[a++]=h>>>20&4095,i[a++]=c>>>0&4095,i[a++]=c>>>12&4095,i[a++]=(c>>>24|(p&15)<<8)&4095,i[a++]=p>>>4&4095,i[a++]=p>>>16&4095,i[a++]=(p>>>28|(d&255)<<4)&4095,i[a++]=d>>>8&4095,i[a++]=d>>>20&4095,i[a++]=f>>>0&4095,i[a++]=f>>>12&4095,i[a++]=(f>>>24|(m&15)<<8)&4095,i[a++]=m>>>4&4095,i[a++]=m>>>16&4095,i[a++]=(m>>>28|(_&255)<<4)&4095,i[a++]=_>>>8&4095,i[a]=_>>>20&4095}function Pw(e,t,i,r){let a=r,s=e[t]>>>0,o=e[t+1]>>>0,n=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,h=e[t+5]>>>0,c=e[t+6]>>>0,p=e[t+7]>>>0,d=e[t+8]>>>0,f=e[t+9]>>>0,m=e[t+10]>>>0,_=e[t+11]>>>0,g=e[t+12]>>>0,x=e[t+13]>>>0,y=e[t+14]>>>0,v=e[t+15]>>>0;i[a++]=s>>>0&65535,i[a++]=s>>>16&65535,i[a++]=o>>>0&65535,i[a++]=o>>>16&65535,i[a++]=n>>>0&65535,i[a++]=n>>>16&65535,i[a++]=l>>>0&65535,i[a++]=l>>>16&65535,i[a++]=u>>>0&65535,i[a++]=u>>>16&65535,i[a++]=h>>>0&65535,i[a++]=h>>>16&65535,i[a++]=c>>>0&65535,i[a++]=c>>>16&65535,i[a++]=p>>>0&65535,i[a++]=p>>>16&65535,i[a++]=d>>>0&65535,i[a++]=d>>>16&65535,i[a++]=f>>>0&65535,i[a++]=f>>>16&65535,i[a++]=m>>>0&65535,i[a++]=m>>>16&65535,i[a++]=_>>>0&65535,i[a++]=_>>>16&65535,i[a++]=g>>>0&65535,i[a++]=g>>>16&65535,i[a++]=x>>>0&65535,i[a++]=x>>>16&65535,i[a++]=y>>>0&65535,i[a++]=y>>>16&65535,i[a++]=v>>>0&65535,i[a]=v>>>16&65535}function Iw(e,t,i,r){let a=r,s=t;for(let o=0;o<8;o++){let n=e[s++]>>>0;i[a++]=n>>>0&1,i[a++]=n>>>1&1,i[a++]=n>>>2&1,i[a++]=n>>>3&1,i[a++]=n>>>4&1,i[a++]=n>>>5&1,i[a++]=n>>>6&1,i[a++]=n>>>7&1,i[a++]=n>>>8&1,i[a++]=n>>>9&1,i[a++]=n>>>10&1,i[a++]=n>>>11&1,i[a++]=n>>>12&1,i[a++]=n>>>13&1,i[a++]=n>>>14&1,i[a++]=n>>>15&1,i[a++]=n>>>16&1,i[a++]=n>>>17&1,i[a++]=n>>>18&1,i[a++]=n>>>19&1,i[a++]=n>>>20&1,i[a++]=n>>>21&1,i[a++]=n>>>22&1,i[a++]=n>>>23&1,i[a++]=n>>>24&1,i[a++]=n>>>25&1,i[a++]=n>>>26&1,i[a++]=n>>>27&1,i[a++]=n>>>28&1,i[a++]=n>>>29&1,i[a++]=n>>>30&1,i[a++]=n>>>31&1}}function Ew(e,t,i,r){let a=r,s=t;for(let o=0;o<8;o++){let n=e[s++]>>>0,l=e[s++]>>>0;i[a++]=n>>>0&3,i[a++]=n>>>2&3,i[a++]=n>>>4&3,i[a++]=n>>>6&3,i[a++]=n>>>8&3,i[a++]=n>>>10&3,i[a++]=n>>>12&3,i[a++]=n>>>14&3,i[a++]=n>>>16&3,i[a++]=n>>>18&3,i[a++]=n>>>20&3,i[a++]=n>>>22&3,i[a++]=n>>>24&3,i[a++]=n>>>26&3,i[a++]=n>>>28&3,i[a++]=n>>>30&3,i[a++]=l>>>0&3,i[a++]=l>>>2&3,i[a++]=l>>>4&3,i[a++]=l>>>6&3,i[a++]=l>>>8&3,i[a++]=l>>>10&3,i[a++]=l>>>12&3,i[a++]=l>>>14&3,i[a++]=l>>>16&3,i[a++]=l>>>18&3,i[a++]=l>>>20&3,i[a++]=l>>>22&3,i[a++]=l>>>24&3,i[a++]=l>>>26&3,i[a++]=l>>>28&3,i[a++]=l>>>30&3}}function Mw(e,t,i,r){let a=r,s=t;
2for(let o=0;o<8;o++){let n=e[s++]>>>0,l=e[s++]>>>0,u=e[s++]>>>0;i[a++]=n>>>0&7,i[a++]=n>>>3&7,i[a++]=n>>>6&7,i[a++]=n>>>9&7,i[a++]=n>>>12&7,i[a++]=n>>>15&7,i[a++]=n>>>18&7,i[a++]=n>>>21&7,i[a++]=n>>>24&7,i[a++]=n>>>27&7,i[a++]=(n>>>30|(l&1)<<2)&7,i[a++]=l>>>1&7,i[a++]=l>>>4&7,i[a++]=l>>>7&7,i[a++]=l>>>10&7,i[a++]=l>>>13&7,i[a++]=l>>>16&7,i[a++]=l>>>19&7,i[a++]=l>>>22&7,i[a++]=l>>>25&7,i[a++]=l>>>28&7,i[a++]=(l>>>31|(u&3)<<1)&7,i[a++]=u>>>2&7,i[a++]=u>>>5&7,i[a++]=u>>>8&7,i[a++]=u>>>11&7,i[a++]=u>>>14&7,i[a++]=u>>>17&7,i[a++]=u>>>20&7,i[a++]=u>>>23&7,i[a++]=u>>>26&7,i[a++]=u>>>29&7}}function Aw(e,t,i,r){let a=r,s=t;for(let o=0;o<8;o++){let n=e[s++]>>>0,l=e[s++]>>>0,u=e[s++]>>>0,h=e[s++]>>>0;i[a++]=n>>>0&15,i[a++]=n>>>4&15,i[a++]=n>>>8&15,i[a++]=n>>>12&15,i[a++]=n>>>16&15,i[a++]=n>>>20&15,i[a++]=n>>>24&15,i[a++]=n>>>28&15,i[a++]=l>>>0&15,i[a++]=l>>>4&15,i[a++]=l>>>8&15,i[a++]=l>>>12&15,i[a++]=l>>>16&15,i[a++]=l>>>20&15,i[a++]=l>>>24&15,i[a++]=l>>>28&15,i[a++]=u>>>0&15,i[a++]=u>>>4&15,i[a++]=u>>>8&15,i[a++]=u>>>12&15,i[a++]=u>>>16&15,i[a++]=u>>>20&15,i[a++]=u>>>24&15,i[a++]=u>>>28&15,i[a++]=h>>>0&15,i[a++]=h>>>4&15,i[a++]=h>>>8&15,i[a++]=h>>>12&15,i[a++]=h>>>16&15,i[a++]=h>>>20&15,i[a++]=h>>>24&15,i[a++]=h>>>28&15}}function Cw(e,t,i,r){let a=r,s=t;for(let o=0;o<8;o++){let n=e[s++]>>>0,l=e[s++]>>>0,u=e[s++]>>>0,h=e[s++]>>>0,c=e[s++]>>>0;i[a++]=n>>>0&31,i[a++]=n>>>5&31,i[a++]=n>>>10&31,i[a++]=n>>>15&31,i[a++]=n>>>20&31,i[a++]=n>>>25&31,i[a++]=(n>>>30|(l&7)<<2)&31,i[a++]=l>>>3&31,i[a++]=l>>>8&31,i[a++]=l>>>13&31,i[a++]=l>>>18&31,i[a++]=l>>>23&31,i[a++]=(l>>>28|(u&1)<<4)&31,i[a++]=u>>>1&31,i[a++]=u>>>6&31,i[a++]=u>>>11&31,i[a++]=u>>>16&31,i[a++]=u>>>21&31,i[a++]=u>>>26&31,i[a++]=(u>>>31|(h&15)<<1)&31,i[a++]=h>>>4&31,i[a++]=h>>>9&31,i[a++]=h>>>14&31,i[a++]=h>>>19&31,i[a++]=h>>>24&31,i[a++]=(h>>>29|(c&3)<<3)&31,i[a++]=c>>>2&31,i[a++]=c>>>7&31,i[a++]=c>>>12&31,i[a++]=c>>>17&31,i[a++]=c>>>22&31,i[a++]=c>>>27&31}}function Dw(e,t,i,r){let a=r,s=t;for(let o=0;o<8;o++){let n=e[s++]>>>0,l=e[s++]>>>0,u=e[s++]>>>0,h=e[s++]>>>0,c=e[s++]>>>0,p=e[s++]>>>0;i[a++]=n>>>0&63,i[a++]=n>>>6&63,i[a++]=n>>>12&63,i[a++]=n>>>18&63,i[a++]=n>>>24&63,i[a++]=(n>>>30|(l&15)<<2)&63,i[a++]=l>>>4&63,i[a++]=l>>>10&63,i[a++]=l>>>16&63,i[a++]=l>>>22&63,i[a++]=(l>>>28|(u&3)<<4)&63,i[a++]=u>>>2&63,i[a++]=u>>>8&63,i[a++]=u>>>14&63,i[a++]=u>>>20&63,i[a++]=u>>>26&63,i[a++]=h>>>0&63,i[a++]=h>>>6&63,i[a++]=h>>>12&63,i[a++]=h>>>18&63,i[a++]=h>>>24&63,i[a++]=(h>>>30|(c&15)<<2)&63,i[a++]=c>>>4&63,i[a++]=c>>>10&63,i[a++]=c>>>16&63,i[a++]=c>>>22&63,i[a++]=(c>>>28|(p&3)<<4)&63,i[a++]=p>>>2&63,i[a++]=p>>>8&63,i[a++]=p>>>14&63,i[a++]=p>>>20&63,i[a++]=p>>>26&63}}function zw(e,t,i,r){let a=r,s=t;for(let o=0;o<8;o++){let n=e[s++]>>>0,l=e[s++]>>>0,u=e[s++]>>>0,h=e[s++]>>>0,c=e[s++]>>>0,p=e[s++]>>>0,d=e[s++]>>>0;i[a++]=n>>>0&127,i[a++]=n>>>7&127,i[a++]=n>>>14&127,i[a++]=n>>>21&127,i[a++]=(n>>>28|(l&7)<<4)&127,i[a++]=l>>>3&127,i[a++]=l>>>10&127,i[a++]=l>>>17&127,i[a++]=l>>>24&127,i[a++]=(l>>>31|(u&63)<<1)&127,i[a++]=u>>>6&127,i[a++]=u>>>13&127,i[a++]=u>>>20&127,i[a++]=(u>>>27|(h&3)<<5)&127,i[a++]=h>>>2&127,i[a++]=h>>>9&127,i[a++]=h>>>16&127,i[a++]=h>>>23&127,i[a++]=(h>>>30|(c&31)<<2)&127,i[a++]=c>>>5&127,i[a++]=c>>>12&127,i[a++]=c>>>19&127,i[a++]=(c>>>26|(p&1)<<6)&127,i[a++]=p>>>1&127,i[a++]=p>>>8&127,i[a++]=p>>>15&127,i[a++]=p>>>22&127,i[a++]=(p>>>29|(d&15)<<3)&127,i[a++]=d>>>4&127,i[a++]=d>>>11&127,i[a++]=d>>>18&127,i[a++]=d>>>25&127}}function Rw(e,t,i,r){let a=r,s=t;for(let o=0;o<8;o++){let n=e[s++]>>>0,l=e[s++]>>>0,u=e[s++]>>>0,h=e[s++]>>>0,c=e[s++]>>>0,p=e[s++]>>>0,d=e[s++]>>>0,f=e[s++]>>>0;i[a++]=n>>>0&255,i[a++]=n>>>8&255,i[a++]=n>>>16&255,i[a++]=n>>>24&255,i[a++]=l>>>0&255,i[a++]=l>>>8&255,i[a++]=l>>>16&255,i[a++]=l>>>24&255,i[a++]=u>>>0&255,i[a++]=u>>>8&255,i[a++]=u>>>16&255,i[a++]=u>>>24&255,i[a++]=h>>>0&255,i[a++]=h>>>8&255,i[a++]=h>>>16&255,i[a++]=h>>>24&255,i[a++]=c>>>0&255,i[a++]=c>>>8&255,i[a++]=c>>>16&255,i[a++]=c>>>24&255,i[a++]=p>>>0&255,i[a++]=p>>>8&255,i[a++]=p>>>16&255,i[a++]=p>>>24&255,i[a++]=d>>>0&255,i[a++]=d>>>8&255,i[a++]=d>>>16&255,i[a++]=d>>>24&255,i[a++]=f>>>0&255,i[a++]=f>>>8&255,i[a++]=f>>>16&255,i[a++]=f>>>24&255}}function kw(e,t,i,r){let a=r,s=t;
vendor: 5,013 bytes, line 2
2for(let o=0;o<128;o++){let n=e[s++]>>>0;i[a++]=n&65535,i[a++]=n>>>16&65535}}function Lw(e,t,i,r,a){let s=hu[a]>>>0,o=t,n=0,l=e[o]>>>0,u=r;for(let h=0;h<8;h++){for(let c=0;c<32;c++)if(n+a<=32){let p=l>>>n&s;i[u+c]=p|0,n+=a,n===32&&(n=0,o++,c!==31&&(l=e[o]>>>0))}else{let p=32-n,d=l>>>n;o++,l=e[o]>>>0;let f=a-p,m=-1>>>32-f>>>0,_=(d|(l&m)<<p)&s;i[u+c]=_|0,n=f}u+=32,n=0,h<7&&(l=e[o]>>>0)}}const cu=pw(t_),Fw=3*cu/256+cu|0;function i_(){let e=new Uint8Array(Fw);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:e,byteContainerI32:new Int32Array(e.buffer,e.byteOffset,e.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function Bw(e=16){if(e<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${e}`);let t=Math.max(16,e|0);return{encodedWords:new Uint32Array(t),decoderWorkspace:i_()}}function Ow(e,t){if(t<=e.encodedWords.length)return e.encodedWords;let i=new Uint32Array(Math.max(16,t*2));return e.encodedWords=i,i}function $w(e,t,i,r){r.byteContainer.length<i&&(r.byteContainer=new Uint8Array(i*2),r.byteContainerI32=void 0);let a=r.byteContainer,s=i>>>2;if(a.byteOffset&3)for(let n=0;n<s;n=n+1|0){let l=e[t+n|0]|0,u=n<<2;a[u]=l&255,a[u+1|0]=l>>>8&255,a[u+2|0]=l>>>16&255,a[u+3|0]=l>>>24&255}else{let n=r.byteContainerI32;(!n||n.buffer!==a.buffer||n.byteOffset!==a.byteOffset||n.length<s)&&(n=r.byteContainerI32=new Int32Array(a.buffer,a.byteOffset,a.byteLength>>>2)),n.set(e.subarray(t,t+s))}let o=i&3;if(o>0){let n=e[t+s|0]|0,l=s<<2;for(let u=0;u<o;u=u+1|0)a[l+u|0]=n>>>(u<<3)&255}return a}function Vw(e,t,i){let r=e[t++]|0,a=i.dataToBePacked;for(let s=2;s<=32;s=s+1|0){if(!(r>>>s-1&1))continue;if(t>=e.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${s}, streamWordIndex=${t}, needWords=1, availableWords=${e.length-t}, encodedWords=${e.length})`);let o=e[t++]>>>0,n=cw(o),l=o*s+31>>>5;if(t+l>e.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${s}, size=${o}, streamWordIndex=${t}, needWords=${l}, availableWords=${e.length-t}, encodedWords=${e.length})`);let u=a[s];(!u||u.length<n)&&(u=a[s]=new Uint32Array(n));let h=0;for(;h<o;h=h+32|0)Yw(e,t,u,h,s),t=t+s|0;let c=h-o|0;t=t-(c*s>>>5)|0,i.exceptionSizes[s]=o}return t}function jw(e,t,i,r,a){switch(a){case 1:Iw(e,t,i,r);break;case 2:Ew(e,t,i,r);break;case 3:Mw(e,t,i,r);break;case 4:Aw(e,t,i,r);break;case 5:Cw(e,t,i,r);break;case 6:Dw(e,t,i,r);break;case 7:zw(e,t,i,r);break;case 8:Rw(e,t,i,r);break;case 16:kw(e,t,i,r);break;default:Lw(e,t,i,r,a);break}return t+(a<<3)|0}function Nw(e,t,i,r){if(i+2>t)throw Error(`FastPFOR decode: byteContainer underflow at block=${r} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${i}, byteSize=${t})`);let a=e[i++],s=e[i++];if(a>32)throw Error(`FastPFOR decode: invalid bitWidth=${a} at block=${r} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:a,exceptionCount:s,bytePosIn:i}}function Uw(e,t,i,r,a,s){if(i+1>t)throw Error(`FastPFOR decode: exception header underflow at block=${s} (need 1 byte for maxBits, bytePos=${i}, byteSize=${t})`);let o=e[i++];if(o<r||o>32)throw Error(`FastPFOR decode: invalid maxBits=${o} at block=${s} (bitWidth=${r}, expected ${r}..32)`);let n=o-r|0;if(n<1||n>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${n} at block=${s} (bitWidth=${r}, maxBits=${o})`);if(i+a>t)throw Error(`FastPFOR decode: exception positions underflow at block=${s} (need=${a}, have=${t-i})`);return{maxBits:o,exceptionBitWidth:n,bytePosIn:i}}function Gw(e,t,i,r,a,s,o,n,l){let{maxBits:u,exceptionBitWidth:h,bytePosIn:c}=Uw(a,s,o,i,r,l);if(o=c,h===1){let _=1<<i;for(let g=0;g<r;g=g+1|0){let x=a[o++];e[x+t|0]|=_}return o}let p=n.dataToBePacked[h];if(!p)throw Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${h} (bitWidth=${i}, maxBits=${u}) at block ${l}`);let d=n.dataPointers,f=d[h]|0,m=n.exceptionSizes[h]|0;if(f+r>m)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${h} (ptr=${f}, need ${r}, size=${m}) at block ${l}`);for(let _=0;_<r;_=_+1|0){let g=a[o++],x=p[f++]|0;e[g+t|0]|=x<<i}return d[h]=f,o}function Zw(e,t,i,r,a,s,o,n,l,u){let h=i|0,c=0;for(let p=0;p<o;p=p+1|0){let d=Nw(n,l,c,p);c=d.bytePosIn;let f=d.bitWidth,m=d.exceptionCount,_=s+p*256|0;switch(f){case 0:a.fill(0,_,_+256);break;case 32:for(let g=0;g<256;g=g+1|0)a[_+g|0]=e[h+g|0]|0;h=h+256|0;break;default:h=jw(e,h,a,_,f);break}m>0&&(c=Gw(a,_,f,m,n,l,c,u,p))}if(h!==r)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${t}, packedStart=${i}, consumedPackedEnd=${h}, expectedPackedEnd=${r}, packedWords=${r-i}, encoded.length=${e.length})`)}function qw(e,t,i,r,a,s){let o=i|0,n=e[o]|0;if(n<=0||o+n>e.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${n} at pageStart=${o} (expected > 0 and pageStart+whereMeta < encoded.length=${e.length})`);let l=o+1|0,u=o+n|0,h=e[u]>>>0,c=h+3>>>2,p=u+1,d=p+c;if(d>=e.length)throw Error(`FastPFOR decode: invalid byteSize=${h} (metaInts=${c}, pageStart=${o}, packedEnd=${u}
2, byteContainerStart=${p}) causes bitmapPos=${d} out of bounds (encoded.length=${e.length})`);let f=$w(e,p,h,s),m=h,_=Vw(e,d,s);return s.dataPointers.fill(0),Zw(e,o,l,u,t,r|0,a/256|0,f,m,s),_}function Ww(e,t,i,r,a,s){let o=r+_h(a,256),n=r,l=i;for(;n!==o;){let u=Math.min(cu,o-n);l=qw(e,t,l,n,u,s),n=n+u|0}return l}function Hw(e,t,i,r,a,s){if(s===0)return t;let o=0,n=t,l=t+i,u=a,h=a,c=a+s,p=0,d=0;for(;n<l&&h<c;){let f=e[n]>>>o&255;if(o+=8,n+=o>>>5,o&=31,p|=(f&127)<<d,f&128)r[h++]=p|0,p=0,d=0;else if(d+=7,d>28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${d}, partial=${p}, decoded=${h-u}/${s}, inPos=${n}, inEnd=${l})`)}if(h!==c)throw Error(`FastPFOR VByte: truncated stream (decoded=${h-u}, expected=${s}, consumedWords=${n-t}/${i}, vbyteStart=${t}, vbyteEnd=${l})`);return n}function Xw(e,t,i){let r=0,a=0,s=new Uint32Array(t),o=i??i_();if(e.length>0){let u=e[r]|0;if(r=r+1|0,u&255)throw Error(`FastPFOR decode: invalid alignedLength=${u} (expected multiple of 256)`);if(a+u>s.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${a}, alignedLength=${u}, out.length=${s.length})`);r=Ww(e,s,r,a,u,o),a=a+u|0}let n=e.length-r|0,l=t-a|0;return Hw(e,r,n,s,a,l),s}function Yw(e,t,i,r,a){switch(a){case 2:fw(e,t,i,r);return;case 3:mw(e,t,i,r);return;case 4:_w(e,t,i,r);return;case 5:gw(e,t,i,r);return;case 6:yw(e,t,i,r);return;case 7:vw(e,t,i,r);return;case 8:xw(e,t,i,r);return;case 9:bw(e,t,i,r);return;case 10:ww(e,t,i,r);return;case 11:Tw(e,t,i,r);return;case 12:Sw(e,t,i,r);return;case 16:Pw(e,t,i,r);return;case 32:for(let u=0;u<32;u=u+1|0)i[r+u|0]=e[t+u|0]|0;return}let s=hu[a]>>>0,o=t,n=0,l=e[o]>>>0;for(let u=0;u<32;u++)if(n+a<=32){let h=l>>>n&s;i[r+u]=h|0,n+=a,n===32&&(n=0,o++,u!==31&&(l=e[o]>>>0))}else{let h=32-n,c=l>>>n;o++,l=e[o]>>>0;let p=hu[a-h]>>>0,d=(c|(l&p)<<h)&s;i[r+u]=d|0,n=a-h}}function Kw(e,t,i,r){if(t<0||i<0||t+i>e.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${t}, byteLength=${i}, bytes.length=${e.length})`);let a=Math.floor(i/4),s=i%4!=0,o=s?a+1:a;if(r.length<o)throw RangeError(`decodeBigEndianInt32sInto: out.length=${r.length} < ${o}`);if(a>0){let n=e.byteOffset+t;if(n&3)for(let l=0;l<a;l++){let u=t+l*4;r[l]=e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]|0}else{let l=new Uint32Array(e.buffer,n,a);for(let u=0;u<a;u++)r[u]=dw(l[u])|0}}if(s){let n=t+a*4,l=i-a*4,u=0;for(let h=0;h<l;h++)u|=e[n+h]<<24-h*8;r[a]=u|0}return o}function at(e,t,i){let r=new Uint32Array(i),a=0,s=t.get();for(let o=0;o<r.length;o++){let n=e[s++],l=n&127;if(n<128){r[a++]=l;continue}if(n=e[s++],l|=(n&127)<<7,n<128){r[a++]=l;continue}if(n=e[s++],l|=(n&127)<<14,n<128){r[a++]=l;continue}if(n=e[s++],l|=(n&127)<<21,n<128){r[a++]=l;continue}n=e[s++],l|=(n&15)<<28,r[a++]=l}return t.set(s),r}function ia(e,t,i){let r=new BigUint64Array(i);for(let a=0;a<r.length;a++)r[a]=Jw(e,t);return r}function Jw(e,t){let i=0n,r=0,a=t.get();for(;a<e.length;){let s=e[a++];if(i|=BigInt(s&127)<<BigInt(r),!(s&128))break;if(r+=7,r>=64)throw Error("Varint too long")}return t.set(a),i}function Qw(e,t,i){let r=new Float64Array(i);for(let a=0;a<i;a++)r[a]=e2(e,t);return r}function e2(e,t){let i,r;return r=e[t.get()],t.increment(),i=r&127,r<128||(r=e[t.get()],t.increment(),i|=(r&127)<<7,r<128)||(r=e[t.get()],t.increment(),i|=(r&127)<<14,r<128)||(r=e[t.get()],t.increment(),i|=(r&127)<<21,r<128)?i:(r=e[t.get()],i|=(r&15)<<28,t2(i,e,t))}function t2(e,t,i){let r,a;if(a=t[i.get()],i.increment(),r=(a&112)>>4,a<128||(a=t[i.get()],i.increment(),r|=(a&127)<<3,a<128)||(a=t[i.get()],i.increment(),r|=(a&127)<<10,a<128)||(a=t[i.get()],i.increment(),r|=(a&127)<<17,a<128)||(a=t[i.get()],i.increment(),r|=(a&127)<<24,a<128)||(a=t[i.get()],i.increment(),r|=(a&1)<<31,a<128))return r*4294967296+(e>>>0);throw Error("Expected varint not more than 10 bytes")}function i2(e,t,i,r){return r2(e,t,i,r,Bw(i>>>2))}function r2(e,t,i,r,a){let s=r.get();if(i&3)throw Error(`FastPFOR: invalid encodedByteLength=${i} at offset=${s} (encodedBytes.length=${e.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let o=i>
vendor: 11,467 bytes, line 2
2>>2,n=Ow(a,o);Kw(e,s,i,n);let l=Xw(n.subarray(0,o),t,a.decoderWorkspace);return r.add(i),l}function pe(e){return e>>>1^-(e&1)}function rt(e){return e>>1n^-(e&1n)}function er(e){return e%2==1?(e+1)/-2:e/2}function a2(e){let t=new Int32Array(e.length);for(let i=0;i<e.length;i++)t[i]=pe(e[i]);return t}function s2(e){let t=new BigInt64Array(e.length);for(let i=0;i<e.length;i++)t[i]=rt(e[i]);return t}function pu(e,t,i){if(i===void 0){i=0;for(let s=0;s<t;s++)i+=e[s]}let r=new Uint32Array(i),a=0;for(let s=0;s<t;s++){let o=e[s],n=e[s+t];r.fill(n,a,a+o),a+=o}return r}function du(e,t,i){if(i===void 0){i=0;for(let s=0;s<t;s++)i+=Number(e[s])}let r=new BigUint64Array(i),a=0;for(let s=0;s<t;s++){let o=Number(e[s]),n=e[s+t];r.fill(n,a,a+o),a+=o}return r}function r_(e,t,i){let r=new Float64Array(i),a=0;for(let s=0;s<t;s++){let o=e[s],n=e[s+t];r.fill(n,a,a+o),a+=o}return r}function tp(e){let t=new Int32Array(e.length);t[0]=pe(e[0]);let i=e.length/4*4,r=1;if(i>=4)for(;r<i-4;r+=4){let a=e[r],s=e[r+1],o=e[r+2],n=e[r+3];t[r]=pe(a)+t[r-1],t[r+1]=pe(s)+t[r],t[r+2]=pe(o)+t[r+1],t[r+3]=pe(n)+t[r+2]}for(;r!==e.length;++r)t[r]=pe(e[r])+t[r-1];return t}function ip(e){let t=new BigInt64Array(e.length);t[0]=rt(e[0]);let i=e.length/4*4,r=1;if(i>=4)for(;r<i-4;r+=4){let a=e[r],s=e[r+1],o=e[r+2],n=e[r+3];t[r]=rt(a)+t[r-1],t[r+1]=rt(s)+t[r],t[r+2]=rt(o)+t[r+1],t[r+3]=rt(n)+t[r+2]}for(;r!==t.length;++r)t[r]=rt(e[r])+t[r-1];return t}function o2(e){e[0]=er(e[0]);let t=e.length/4*4,i=1;if(t>=4)for(;i<t-4;i+=4){let r=e[i],a=e[i+1],s=e[i+2],o=e[i+3];e[i]=er(r)+e[i-1],e[i+1]=er(a)+e[i],e[i+2]=er(s)+e[i+1],e[i+3]=er(o)+e[i+2]}for(;i!==e.length;++i)e[i]=er(e[i])+e[i-1]}function n2(e,t,i){if(i===void 0){i=0;for(let s=0;s<t;s++)i+=e[s]}let r=new Int32Array(i),a=0;for(let s=0;s<t;s++){let o=e[s],n=e[s+t];n=pe(n),r.fill(n,a,a+o),a+=o}return r}function l2(e,t,i){if(i===void 0){i=0;for(let s=0;s<t;s++)i+=Number(e[s])}let r=new BigInt64Array(i),a=0;for(let s=0;s<t;s++){let o=Number(e[s]),n=e[s+t];n=rt(n),r.fill(n,a,a+o),a+=o}return r}function u2(e,t,i){let r=new Float64Array(i),a=0;for(let s=0;s<t;s++){let o=e[s],n=e[s+t];n=er(n),r.fill(n,a,a+o),a+=o}return r}function gh(e){let t=e.length/4*4,i=1;if(t>=4)for(let r=e[0];i<t-4;i+=4)r=e[i]+=r,r=e[i+1]+=r,r=e[i+2]+=r,r=e[i+3]+=r;for(;i!==e.length;)e[i]+=e[i-1],++i}function h2(e){let t=0;for(let i=0;i<e.length;i++)e[i]+=t,t=e[i]}function c2(e){if(e.length<2)return new Int32Array(e);let t=new Int32Array(e.length);t[0]=pe(e[0]),t[1]=pe(e[1]);let i=e.length/4*4,r=2;if(i>=4)for(;r<i-4;r+=4){let a=e[r],s=e[r+1],o=e[r+2],n=e[r+3];t[r]=pe(a)+t[r-2],t[r+1]=pe(s)+t[r-1],t[r+2]=pe(o)+t[r],t[r+3]=pe(n)+t[r+1]}for(;r!==e.length;r+=2)t[r]=pe(e[r])+t[r-2],t[r+1]=pe(e[r+1])+t[r-1];return t}function p2(e){let t=new Int32Array(e.length+1);t[0]=0,t[1]=pe(e[0]);let i=t[1];for(let r=2;r!==t.length;++r){let a=e[r-1],s=pe(a);i+=s,t[r]=t[r-1]+i}return new Uint32Array(t)}function d2(e,t,i){let r=new Int32Array(i+1);r[0]=0;let a=1,s=r[0];for(let o=0;o<t;o++){let n=e[o],l=e[o+t];l=pe(l);for(let u=a;u<a+n;u++)r[u]=l+s,s=r[u];a+=n}return r}function f2(e,t,i){let r=new Uint32Array(i+1);r[0]=0;let a=1,s=r[0];for(let o=0;o<t;o++){let n=e[o],l=e[o+t];for(let u=a;u<a+n;u++)r[u]=l+s,s=r[u];a+=n}return r}function m2(e,t,i){let r=new Int32Array(i),a=0,s=0;for(let o=0;o<t;o++){let n=e[o],l=e[o+t],u=pe(l);for(let h=0;h<n;h++)s+=u,r[a++]=s}return r}function _2(e,t,i){let r=new BigInt64Array(i),a=0,s=0n;for(let o=0;o<t;o++){let n=Number(e[o]),l=e[o+t],u=rt(l);for(let h=0;h<n;h++)s+=u,r[a++]=s}return r}function rp(e){let t=new Uint32Array(e.length);t[0]=pe(e[0])>>>0;for(let i=1;i<e.length;i++)t[i]=t[i-1]+pe(e[i])>>>0;return t}function ap(e){let t=new BigUint64Array(e.length);t[0]=BigInt.asUintN(64,rt(e[0]));for(let i=1;i<e.length;i++)t[i]=BigInt.asUintN(64,t[i-1]+rt(e[i]));return t}function g2(e){if(e.length<2)return new Uint32Array(e);let t=new Uint32Array(e.length);t[0]=pe(e[0])>>>0,t[1]=pe(e[1])>>>0;for(let i=2;i<e.length;i+=2)t[i]=t[i-2]+pe(e[i])>>>0,t[i+1]=t[i-1]+pe(e[i+1])>>>0;return t}function y2(e){return e[1]}function v2(e){return pe(e[1])}function x2(e){if(e.length===2){let t=pe(e[1]);return[t,t]}return[pe(e[2]),pe(e[3])]}function b2(e){return e[1]}function w2(e){return rt(e[1])}function T2(e){if(e.length===2){let t=rt(e[1]);return[t,t]}return[rt(e[2]),rt(e[3])]}var Ve;(function(e){e.PRESENT="PRESENT",e.DATA="DATA",e.OFFSET="OFFSET",e.LENGTH="LENGTH"})(Ve||={});var pt;(function(e){e.NONE="NONE",e.SINGLE="SINGLE",e.SHARED="SHARED",e.VERTEX="VERTEX",e.MORTON="MORTON",e.FSST="FSST"})(pt||={});var yi;(function(e){e.VERTEX="VERTEX",e.INDEX="INDEX",e.STRING="STRING",e.KEY="KEY"})(yi||={});var Ne;(function(e){e.VAR_BINARY="VAR_BINARY",e.GEOMETRIES="GEOMETRIES",e.PARTS="PARTS",e.RINGS="RINGS",e.TRIANGLES="TRIANGLES",e.SYMBOL="SYMBOL",e.DICTIONARY="DICTIONARY"})(Ne||={});const S2=[Ve.PRESENT,Ve.DATA,Ve.OFFSET,Ve.LENGTH],sp=[Q.NONE,Q.DELTA,Q.COMPONENTWISE_DELTA,Q.RLE,Q.MORTON,Q.PDE],P2=[wi.NONE,wi.FAST_PFOR,wi.VARINT],I2=[pt.NONE,pt.SINGLE,pt.SHARED,pt.VERTEX,pt.MORTON,pt.FSST],E2=[yi.VERTEX,yi.INDEX,yi.STRING,yi.KEY],M2=[Ne.VAR_BINARY,Ne.GEOMETRIES,Ne.PARTS,Ne.RINGS,Ne.TRIANGLES,Ne.SYMBOL,Ne.DICTIONARY];function ut(e,t){let i=D2(e,t);return i.logicalLevelTechnique1===Q.MORTON?A2(i,e,t):(Q.RLE===i.logicalLevelTechnique1||Q.RLE===i.logicalLevelTechnique2)&&wi.NONE!==i.physicalLevelTechnique?C2(i,e,t):i}function A2(e,t,i){let r=at(t,i,2);return{physicalStreamType:e.physicalStreamType,logicalStreamType:e.logicalStreamType,logicalLevelTechnique1:e.logicalLevelTechnique1,logicalLevelTechnique2:e.logicalLevelTechnique2,physicalLevelTechnique:e.physicalLevelTechnique,numValues:e.numValues,byteLength:e.byteLength,decompressedCount:e.decompressedCount,numBits:r[0],coordinateShift:r[1]}}function C2(e,t,i){let r=at(t,i,2);return{physicalStreamType:e.physicalStreamType,logicalStreamType:e.logicalStreamType,logicalLevelTechnique1:e.logicalLevelTechnique1,logicalLevelTechnique2:e.logicalLevelTechnique2,physicalLevelTechnique:e.physicalLevelTechnique,numValues:e.numValues,byteLength:e.byteLength,decompressedCount:r[1],runs:r[0],numRleValues:r[1]}}function D2(e,t){let i=e[t.get()],r=S2[i>>4],a={};switch(r){case Ve.DATA:a={dictionaryType:I2[i&15]};break;case Ve.OFFSET:a={offsetType:E2[i&15]};break;case Ve.LENGTH:a={lengthType:M2[i&15]};break}t.increment();let s=e[t.get()],o=sp[s>>5],n=sp[s>>2&7],l=P2[s&3];t.increment();let u=at(e,t,2),h=u[0],c=u[1];return{physicalStreamType:r,logicalStreamType:a,logicalLevelTechnique1:o,logicalLevelTechnique2:n,physicalLevelTechnique:l,numValues:h,byteLength:c,decompressedCount:h}}var ve;(function(e){e[e.FLAT=0]="FLAT",e[e.CONST=1]="CONST",e[e.SEQUENCE=2]="SEQUENCE",e[e.DICTIONARY=3]="DICTIONARY",e[e.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(ve||={});var Ei=class{constructor(e,t){this.values=e,this._size=t}get(e){let t=Math.floor(e/8),i=e%8;return(this.values[t]>>i&1)==1}set(e,t){let i=Math.floor(e/8),r=e%8;this.values[i]=this.values[i]|+!!t<<r}getInt(e){let t=Math.floor(e/8),i=e%8;return this.values[t]>>i&1}size(){return this._size}getBuffer(){return this.values}};function ra(e,t,i){if(!t)return e;let r=t.size(),a=e.constructor,s=new a(r),o=0;for(let n=0;n<r;n++)s[n]=t.get(n)?e[o++]:i;return s}function z2(e,t,i){if(!i)return e;let r=i.size(),a=new Ei(e,t),s=new Ei(new Uint8Array(Math.ceil(r/8)),r),o=0;for(let n=0;n<r;n++){let l=i.get(n)?a.get(o++):!1;s.set(n,l)}return s.getBuffer()}function fu(e,t,i,r,a){return B2(aa(e,t,i),i,r,a)}function mt(e,t,i,r,a){return O2(aa(e,t,i),i,r,a)}function Li(e,t,i){return N2(aa(e,t,i),i)}function aa(e,t,i){let r=i.physicalLevelTechnique;switch(r){case wi.FAST_PFOR:return i2(e,i.numValues,i.byteLength,t);case wi.VARINT:return at(e,t,i.numValues);case wi.NONE:{let a=t.get(),s=i.byteLength;t.add(s);let o=e.subarray(a,t.get());return new Uint32Array(o)}default:throw Error(`Specified physicalLevelTechnique ${r} is not supported (yet).`)}}function R2(e,t,i){let r=aa(e,t,i);return r.length===1?pe(r[0]):v2(r)}function yh(e,t,i){let r=aa(e,t,i);return r.length===1?i.logicalLevelTechnique1===Q.DELTA?pe(r[0]):r[0]:y2(r)}function a_(e,t,i){return x2(aa(e,t,i))}function s_(e,t,i){return T2(ia(e,t,i.numValues))}function k2(e,t,i,r){return $2(ia(e,t,i.numValues),i,r)}function o_(e,t,i,r){return V2(ia(e,t,i.numValues),i,r)}function L2(e,t,i){return j2(Qw(e,t,i.numValues),i,!1)}function F2(e,t,i){let r=ia(e,t,i.numValues);return r.length===1?rt(r[0]):w2(r)}function n_(e,t,i){let r=ia(e,t,i.numValues);return r.length===1?i.logicalLevelTechnique1===Q.DELTA?rt(r[0]):r[0]:b2(r)}function B2(e,t,i,r){let a;switch(t.logicalLevelTechnique1){case Q.DELTA:if(t.logicalLevelTechnique2===Q.RLE){let s=t;if(!r)return m2(e,s.runs,s.numRleValues);e=pu(e,s.runs,s.numRleValues),a=tp(e)}else a=tp(e);break;case Q.RLE:a=n2(e,t.runs,t.numRleValues);break;case Q.MORTON:gh(e),a=new Int32Array(e);break;case Q.COMPONENTWISE_DELTA:a=c2(e);break;case Q.NONE:a=a2(e);break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return r?ra(a,r,0):a}function O2(e,t,i,r){let a;switch(t.logicalLevelTechnique1){case Q.DELTA:if(t.logicalLevelTechnique2===Q.RLE){let s=t;a=rp(pu(e,s.runs,s.numRleValues))}else a=rp(e);break;case Q.RLE:a=pu(e,t.runs,t.numRleValues);break;case Q.MORTON:gh(e),a=e;break;case Q.COMPONENTWISE_DELTA:a=g2(e);break;case Q.NONE:a=e;break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return r?ra(a,r,0):a}function $2(e,t,i){let r;switch(t.logicalLevelTechnique1){case Q.DELTA:if(t.logicalLevelTechnique2===Q.RLE){let a=t;if(!i)return _2(e,a.runs,a.numRleValues);e=du(e,a.runs,a.numRleValues),r=ip(e)}else r=ip(e);break;case Q.RLE:r=l2(e,t.runs,t.numRleValues);break;case Q.NONE:r=s2(e);break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return i?ra(r,i,0n):r}function V2(e,t,i){let r;switch(t.logicalLevelTechnique1){case Q.DELTA:if(t.logicalLevelTechnique2===Q.RLE){let a=t;r=ap(du(e,a.runs,a.numRleValues))}else r=ap(e);break;case Q.RLE:r=du(e,t.runs,t.numRleValues);break;case Q.NONE:r=e;break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return i?ra(r,i,0n):r}function j2(e,t,i){switch(t.logicalLevelTechnique1){case Q.DELTA:if(t.logicalLevelTechnique2===Q.RLE){let r=t;e=r_(e,r.runs,r.numRleValues)}return o2(e),e;case Q.RLE:return G2(e,t,i);case Q.NONE:return e;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}}function N2(e,t){if(t.logicalLevelTechnique1===Q.DELTA&&t.logicalLevelTechnique2===Q.NONE)return p2(e);if(t.logicalLevelTechnique1===Q.RLE&&t.logicalLevelTechnique2===Q.NONE){let i=t;return f2(e,i.runs,i.numRleValues)}if(t.logicalLevelTechnique1===Q.NONE&&t.logicalLevelTechnique2===Q.NONE){h2(e);let i=new Uint32Array(t.numValues+1);return i[0]=0,i.set(e,1),i}if(t.logicalLevelTechnique1===Q.DELTA&&t.logicalLevelTechnique2===Q.RLE){let i=t,r=d2(e,i.runs,i.numRleValues);return gh(r),new Uint32Array(r)}throw Error("Only delta encoding is supported for transforming length to offset streams yet.")}function on(e,t,i,r,a="int32"){let s=e.logicalLevelTechnique1;if(s===Q.RLE)return e.runs===1?ve.CONST:ve.FLAT;if(s!==Q.DELTA||e.logicalLevelTechnique2!==Q.RLE)return e.numValues===1?ve.CONST:ve.FLAT;let o=t instanceof Ei?t.size():t,n=e;if(n.numRleValues!==o)return ve.FLAT;if(n.runs===1)return ve.SEQUENCE;
2if(n.runs!==2)return e.numValues===1?ve.CONST:ve.FLAT;let l=r.get();if(e.physicalLevelTechnique===wi.VARINT)return U2(i,r,a)?ve.SEQUENCE:e.numValues===1?ve.CONST:ve.FLAT;let u=r.get(),h=new Int32Array(i.buffer,i.byteOffset+u,4);return r.set(l),h[2]===2&&h[3]===2?ve.SEQUENCE:e.numValues===1?ve.CONST:ve.FLAT}function U2(e,t,i){let r=new e_(t.get());if(i==="int64"){let s=ia(e,r,4);return s[2]===2n&&s[3]===2n}let a=at(e,r,4);return a[2]===2&&a[3]===2}function G2(e,t,i){return i?u2(e,t.runs,t.numRleValues):r_(e,t.runs,t.numRleValues)}var l_=class extends sn{getValueFromBuffer(e){return this.dataBuffer[e]}},u_=class extends Qm{constructor(e,t,i,r){super(e,BigInt64Array.of(t),i,r)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}};function vh(e,t,i){return{x:op(e,t)-i,y:op(e>>1,t)-i}}function op(e,t){let i=0;for(let r=0;r<t;r++)i|=(e&1<<2*r)>>r;return i}var Ge;(function(e){e[e.POINT=0]="POINT",e[e.LINESTRING=1]="LINESTRING",e[e.POLYGON=2]="POLYGON",e[e.MULTIPOINT=3]="MULTIPOINT",e[e.MULTILINESTRING=4]="MULTILINESTRING",e[e.MULTIPOLYGON=5]="MULTIPOLYGON"})(Ge||={});var Z2;(function(e){e[e.POINT=0]="POINT",e[e.LINESTRING=1]="LINESTRING",e[e.POLYGON=2]="POLYGON"})(Z2||={});var gr;(function(e){e[e.MORTON=0]="MORTON",e[e.VEC_2=1]="VEC_2",e[e.VEC_3=2]="VEC_3"})(gr||={});function q2(e){let t=Array(e.numGeometries),i=1,r=1,a=1,s=0,o=0,n=0,l=e.mortonSettings,u=e.topologyVector,h=u.geometryOffsets,c=u.partOffsets,p=u.ringOffsets,d=e.vertexOffsets,f=!d||d.length===0,m=e.containsPolygonGeometry(),_=e.vertexBuffer;for(let g=0;g<e.numGeometries;g++){let x=e.geometryType(g);switch(x){case Ge.POINT:{let y,v;if(f)y=_[o++],v=_[o++];else if(e.vertexBufferType===gr.MORTON){let w=_[d[n++]],b=vh(w,l.numBits,l.coordinateShift);y=b.x,v=b.y}else{let w=d[n++]*2;y=_[w],v=_[w+1]}t[s++]=[[new E(y,v)]],h&&a++,c&&i++,p&&r++}break;case Ge.MULTIPOINT:{let y=h[a]-h[a-1];a++;let v=Array(y);if(f)for(let w=0;w<y;w++){let b=_[o++],T=_[o++];v[w]=new E(b,T)}else for(let w=0;w<y;w++){let b=d[n++]*2,T=_[b],I=_[b+1];v[w]=new E(T,I)}t[s++]=v.map(w=>[w]),i+=y,r+=y}break;case Ge.LINESTRING:{let y;m?(y=p[r]-p[r-1],r++):y=c[i]-c[i-1],i++;let v;f?(v=Pr(_,o,y,!1),o+=y*2):(v=Sr(e.vertexBufferType,_,d,n,y,!1,l),n+=y),t[s++]=[v],h&&a++}break;case Ge.POLYGON:{let y=c[i]-c[i-1];i++;let v=Array(y-1),w,b=p[r]-p[r-1];if(r++,f){w=Pr(_,o,b,!0),o+=b*2;for(let T=0;T<v.length;T++)b=p[r]-p[r-1],r++,v[T]=Pr(_,o,b,!0),o+=b*2}else{w=Sr(e.vertexBufferType,_,d,n,b,!0,l),n+=b;for(let T=0;T<v.length;T++)b=p[r]-p[r-1],r++,v[T]=Sr(e.vertexBufferType,_,d,n,b,!0,l),n+=b}t[s++]=[w].concat(v),h&&a++}break;case Ge.MULTILINESTRING:{let y=h[a]-h[a-1];a++;let v=Array(y);for(let w=0;w<y;w++){let b;m?(b=p[r]-p[r-1],r++):b=c[i]-c[i-1],i++,f?(v[w]=Pr(_,o,b,!1),o+=b*2):(v[w]=Sr(e.vertexBufferType,_,d,n,b,!1,l),n+=b)}t[s++]=v}break;case Ge.MULTIPOLYGON:{let y=h[a]-h[a-1];a++;let v=Array(y);for(let w=0;w<y;w++){let b=c[i]-c[i-1];i++;let T,I=Array(b-1),M=p[r]-p[r-1];r++,f?(T=Pr(_,o,M,!0),o+=M*2):(T=Sr(e.vertexBufferType,_,d,n,M,!0,l),n+=M);for(let D=0;D<I.length;D++){let L=p[r]-p[r-1];r++,f?(I[D]=Pr(_,o,L,!0),o+=L*2):(I[D]=Sr(e.vertexBufferType,_,d,n,L,!0,l),n+=L)}v[w]=[T].concat(I)}t[s++]=v.flat()}break;default:throw Error(`The specified geometry type (${x}) is currently not supported.`)}}return t}function Sr(e,t,i,r,a,s,o){return e===gr.MORTON?H2(t,i,r,a,s,o):W2(t,i,r,a,s)}function Pr(e,t,i,r){let a=Array(r?i+1:i);for(let s=0;s<i*2;s+=2){let o=e[t+s],n=e[t+s+1];a[s/2]=new E(o,n)}return r&&(a[a.length-1]=a[0]),a}function W2(e,t,i,r,a){let s=Array(a?r+1:r);for(let o=0;o<r*2;o+=2){let n=t[i+o/2]*2,l=e[n],u=e[n+1];s[o/2]=new E(l,u)}return a&&(s[s.length-1]=s[0]),s}function H2(e,t,i,r,a,s){let o=Array(a?r+1:r);for(let n=0;n<r;n++){let l=e[t[i+n]],u=vh(l,s.numBits,s.coordinateShift);o[n]=new E(u.x,u.y)}return a&&(o[o.length-1]=o[0]),o}var h_=class{constructor(e,t,i,r,a){this._vertexBufferType=e,this._topologyVector=t,this._vertexOffsets=i,this._vertexBuffer=r,this._mortonSettings=a}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(e){let t=this.vertexOffsets?this.vertexOffsets[e]*2:e*2;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getVertex(e){if(this.vertexOffsets&&this.mortonSettings){let i=this.vertexOffsets[e],r=this.vertexBuffer[i],a=vh(r,this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[a.x,a.y]}let t=this.vertexOffsets?this.vertexOffsets[e]*2:e*2;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getGeometries(){return q2(this)}get mortonSettings(){return this._mortonSettings}};function X2(e,t,i,r,a){return new c_(e,t,gr.VEC_2,i,r,a)}function Y2(e,t,i,r,a,s){return new c_(e,t,gr.MORTON,i,r,a,s)}var c_=class extends h_{constructor(e,t,i,r,a,s,o){super(i,r,a,s,o),this._numGeometries=e,this._geometryType=t}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===Ge.POLYGON||this._geometryType===Ge.MULTIPOLYGON}containsSingleGeometryType(){return!0}};function K2(e,t,i,r){return new p_(gr.VEC_2,e,t,i,r)}function J2(e,t,i,r,a){return new p_(gr.MORTON,e,t,i,r,a)}var p_=class extends h_{constructor(e,t,i,r,a,s){super(e,i,r,a,s),this._geometryTypes=t}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let e=0;e<this.numGeometries;e++)if(this.geometryType(e)===Ge.POLYGON||this.geometryType(e)===Ge.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}},d_=class{constructor(e,t,i,r){this._triangleOffsets=e,this._indexBuffer=t,this._vertexBuffer=i,this._topologyVector=r}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw Error("Cannot convert GpuVector to coordinates without topology information");let e=Array(this.numGeometries),t=this._topologyVector,i=t.partOffsets,r=t.ringOffsets,a=t.geometryOffsets,s=0,o=1,n=1,l=1;for(let u=0;u<this.numGeometries;u++)switch(this.geometryType(u)){case Ge.POLYGON:{let h=i[o]-i[o-1];o++;let c=[];for(let p=0;p<h;p++){let d=r[n]-r[n-1];n++;let f=[];for(let m=0;m<d;m++){let _=this._vertexBuffer[s++],g=this._vertexBuffer[s++];f.push(new E(_,g))}f.length>0&&f.push(f[0]),c.push(f)}e[u]=c,a&&l++}break;case Ge.MULTIPOLYGON:{let h=a[l]-a[l-1];l++;let c=[];for(let p=0;p<h;p++){let d=i[o]-i[o-1];o++;for(let f=0;f<d;f++){let m=r[n]-r[n-1];n++;let _=[];for(let g=0;g<m;g++){let x=this._vertexBuffer[s++],y=this._vertexBuffer[s++];_.push(new E(x,y))}_.length>0&&_.push(_[0]),c.push(_)}}e[u]=c}break}return e}[Symbol.iterator](){return null}};function np(e,t,i,r,a,s){return new Q2(e,t,i,r,a,s)}var Q2=class extends d_{constructor(e,t,i,r,a,s){super(i,r,a,s),this._numGeometries=e,this._geometryType=t}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}};function lp(e,t,i,r,a){return new eT(e,t,i,r,a)}var eT=class extends d_{constructor(e,t,i,r,a){super(t,i,r,a),this._geometryTypes=e}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}};
2function tT(e,t,i,r,a){let s=ut(e,i),o=on(s,r,e,i),n,l,u,h;if(o===ve.CONST){let y=yh(e,i,s),v,w,b,T;for(let I=0;I<t-1;I++){let M=ut(e,i);switch(M.physicalStreamType){case Ve.LENGTH:switch(M.logicalStreamType.lengthType){case Ne.GEOMETRIES:v=Li(e,i,M);break;case Ne.PARTS:w=Li(e,i,M);break;case Ne.RINGS:b=Li(e,i,M);break;case Ne.TRIANGLES:T=Li(e,i,M)}break;case Ve.OFFSET:switch(M.logicalStreamType.offsetType){case yi.VERTEX:n=mt(e,i,M);break;case yi.INDEX:h=mt(e,i,M);break}break;case Ve.DATA:if(pt.VERTEX===M.logicalStreamType.dictionaryType)l=fu(e,i,M,a);else{let D=M;u={numBits:D.numBits,coordinateShift:D.coordinateShift},l=mt(e,i,M,a)}break}}return h?v!==void 0||w!==void 0?np(r,y,T,h,l,{geometryOffsets:v,partOffsets:w,ringOffsets:b}):np(r,y,T,h,l):u===void 0?X2(r,y,{geometryOffsets:v,partOffsets:w,ringOffsets:b},n,l):Y2(r,y,{geometryOffsets:v,partOffsets:w,ringOffsets:b},n,l,u)}let c=mt(e,i,s),p,d,f,m;for(let y=0;y<t-1;y++){let v=ut(e,i);switch(v.physicalStreamType){case Ve.LENGTH:switch(v.logicalStreamType.lengthType){case Ne.GEOMETRIES:p=mt(e,i,v);break;case Ne.PARTS:d=mt(e,i,v);break;case Ne.RINGS:f=mt(e,i,v);break;case Ne.TRIANGLES:m=Li(e,i,v)}break;case Ve.OFFSET:switch(v.logicalStreamType.offsetType){case yi.VERTEX:n=mt(e,i,v);break;case yi.INDEX:h=mt(e,i,v);break}break;case Ve.DATA:if(pt.VERTEX===v.logicalStreamType.dictionaryType)l=fu(e,i,v,a);else{let w=v;u={numBits:w.numBits,coordinateShift:w.coordinateShift},l=mt(e,i,v,a)}break}}let _,g,x;return p?(_=$n(c,p,2),d&&f?(g=up(c,_,d,!1),x=rT(c,_,g,f)):d&&(g=iT(c,_,d))):d&&f?(g=$n(c,d,1),x=up(c,g,f,!0)):d&&(g=$n(c,d,0)),h&&!g?lp(c,m,h,l):h?lp(c,m,h,l,{geometryOffsets:_,partOffsets:g,ringOffsets:x}):u===void 0?K2(c,{geometryOffsets:_,partOffsets:g,ringOffsets:x},n,l):J2(c,{geometryOffsets:_,partOffsets:g,ringOffsets:x},n,l,u)}function $n(e,t,i){let r=new Uint32Array(e.length+1),a=0;r[0]=a;let s=0;for(let o=0;o<e.length;o++)a=r[o+1]=a+(e[o]>i?t[s++]:1);return r}function up(e,t,i,r){let a=new Uint32Array(t[t.length-1]+1),s=0;a[0]=s;let o=1,n=0;for(let l=0;l<e.length;l++){let u=e[l],h=t[l+1]-t[l];if(u===5||u===2||r&&(u===4||u===1))for(let c=0;c<h;c++)s=a[o++]=s+i[n++];else for(let c=0;c<h;c++)a[o++]=++s}return a}function iT(e,t,i){let r=new Uint32Array(t[t.length-1]+1),a=0;r[0]=a;let s=1,o=0;for(let n=0;n<e.length;n++){let l=e[n],u=t[n+1]-t[n];if(l===4||l===1)for(let h=0;h<u;h++)a=r[s++]=a+i[o++];else for(let h=0;h<u;h++)r[s++]=++a}return r}function rT(e,t,i,r){let a=new Uint32Array(i[i.length-1]+1),s=0;a[0]=s;let o=1,n=1,l=0;for(let u=0;u<e.length;u++){let h=e[u],c=t[u+1]-t[u];if(h!==0&&h!==3)for(let p=0;p<c;p++){let d=i[o]-i[o-1];o++;for(let f=0;f<d;f++)s=a[n++]=s+r[l++]}else for(let p=0;p<c;p++)a[n++]=++s,o++}return a}var aT=class extends ta{constructor(e,t,i){super(e,t.getBuffer(),i),this.dataVector=t}getValueFromBuffer(e){return this.dataVector.get(e)}},sT=class extends sn{getValueFromBuffer(e){return this.dataBuffer[e]}},f_=class extends ta{constructor(e,t,i,r){super(e,r?BigInt64Array.of(t):BigUint64Array.of(t),i)}getValueFromBuffer(e){return this.dataBuffer[0]}};function ms(e,t,i,r,a){let s=oT(e,Math.ceil(t/8),i,r);return a?z2(s,t,a):s}function oT(e,t,i,r){let a=new Uint8Array(t),s=0,o=r.get()+i;for(;s<t&&!(r.get()>=o);){let n=e[r.increment()];if(n<=127){let l=n+3,u=e[r.increment()],h=Math.min(s+l,t);a.fill(u,s,h),s=h}else{let l=256-n;for(let u=0;u<l&&s<t;u++)a[s++]=e[r.increment()]}}return r.set(o),a}function nT(e,t,i,r){let a=t.get(),s=a+i*Float32Array.BYTES_PER_ELEMENT,o=new Uint8Array(e.subarray(a,s)).buffer,n=new Float32Array(o);return t.set(s),r?ra(n,r,0):n}function lT(e,t,i,r){let a=t.get(),s=a+i*Float64Array.BYTES_PER_ELEMENT,o=new Uint8Array(e.subarray(a,s)).buffer,n=new Float64Array(o);return t.set(s),r?ra(n,r,0):n}const uT=new TextDecoder;function xh(e,t,i){return i-t>=12?uT.decode(e.subarray(t,i)):hT(e,t,i)}function hT(e,t,i){let r="",a=t;for(;a<i;){let s=e[a],o=null,n=s>239?4:s>223?3:s>191?2:1;if(a+n>i)break;let l,u,h;n===1?s<128&&(o=s):n===2?(l=e[a+1],(l&192)==128&&(o=(s&31)<<6|l&63,o<=127&&(o=null))):n===3?(l=e[a+1],u=e[a+2],(l&192)==128&&(u&192)==128&&(o=(s&15)<<12|(l&63)<<6|u&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):n===4&&(l=e[a+1],u=e[a+2],h=e[a+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(o=(s&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,n=1):o>65535&&(o-=65536,r+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),r+=String.fromCharCode(o),a+=n}return r}var bh=class extends ta{constructor(e,t,i,r){super(e,i,r),this.offsetBuffer=t}},hp=class extends bh{constructor(e,t,i,r){super(e,t,i,r??t.length-1)}getValueFromBuffer(e){let t=this.offsetBuffer[e],i=this.offsetBuffer[e+1];return xh(this.dataBuffer,t,i)}},Vr=class extends bh{constructor(e,t,i,r,a){super(e,i,r,a??t.length),this.indexBuffer=t,this.indexBuffer=t}getValueFromBuffer(e){let t=this.indexBuffer[e],i=this.offsetBuffer[t],r=this.offsetBuffer[t+1];return xh(this.dataBuffer,i,r)}};function cT(e,t,i){let r=[],a=Array(t.length).fill(0);for(let s=1;s<t.length;s++)a[s]=a[s-1]+t[s-1];for(let s=0;s<i.length;s++)if(i[s]===255)r.push(i[++s]);else{let o=t[i[s]],n=a[i[s]];for(let l=0;l<o;l++)r.push(e[n+l])}return new Uint8Array(r)}var m_=class extends bh{constructor(e,t,i,r,a,s,o){super(e,i,r,o??t.length),this.indexBuffer=t,this.symbolOffsetBuffer=a,this.symbolTableBuffer=s}getValueFromBuffer(e){this.decodedDictionary??=(this.symbolLengthBuffer??=this.offsetToLengthBuffer(this.symbolOffsetBuffer),cT(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));let t=this.indexBuffer[e],i=this.offsetBuffer[t],r=this.offsetBuffer[t+1];return xh(this.decodedDictionary,i,r)}offsetToLengthBuffer(e){let t=new Uint32Array(e.length-1),i=e[0];for(let r=1;r<e.length;r++){let a=e[r];t[r-1]=a-i,i=a}return t}};function pT(e,t,i,r,a){let s=null,o=null,n=null,l=null,u=null,h=a??null,c=null,p=null;for(let d=0;d<r;d++){let f=ut(t,i);switch(f.physicalStreamType){case Ve.PRESENT:{let m=new Ei(ms(t,f.numValues,f.byteLength,i),f.numValues);h=a??m;break}
2case Ve.OFFSET:o=mt(t,i,f,void 0,h);break;case Ve.LENGTH:{let m=Li(t,i,f);Ne.DICTIONARY===f.logicalStreamType.lengthType?s=m:Ne.SYMBOL===f.logicalStreamType.lengthType?l=m:c=m;break}case Ve.DATA:{let m=t.subarray(i.get(),i.get()+f.byteLength);i.add(f.byteLength);let _=f.logicalStreamType.dictionaryType;pt.FSST===_?u=m:pt.SINGLE===_||pt.SHARED===_?n=m:pt.NONE===_&&(p=m);break}}}return dT(e,u,o,s,n,l,h)??fT(e,n,o,s,h)??mT(e,c,p,o,h)}function dT(e,t,i,r,a,s,o){return t?new m_(e,i,r,a,s,t,o):null}function fT(e,t,i,r,a){return t?a?new Vr(e,i,r,t,a):new Vr(e,i,r,t):null}function mT(e,t,i,r,a){if(!t||!i)return null;if(r)return a?new Vr(e,r,t,i,a):new Vr(e,r,t,i);if(a&&a.size()!==t.length-1){let s=new Uint32Array(a.size()),o=0;for(let n=0;n<a.size();n++)a.get(n)?s[n]=o++:s[n]=0;return new Vr(e,s,t,i,a)}return a?new hp(e,t,i,a):new hp(e,t,i)}function _T(e,t,i,r){let a=null,s=null,o=null,n=null,l=!1;for(;!l;){let p=ut(e,t);switch(p.physicalStreamType){case Ve.LENGTH:Ne.DICTIONARY===p.logicalStreamType.lengthType?a=Li(e,t,p):o=Li(e,t,p);break;case Ve.DATA:pt.SINGLE===p.logicalStreamType.dictionaryType||pt.SHARED===p.logicalStreamType.dictionaryType?(s=e.subarray(t.get(),t.get()+p.byteLength),l=!0):n=e.subarray(t.get(),t.get()+p.byteLength),t.add(p.byteLength);break}}let u=i.complexType.children,h=[],c=0;for(let p of u){let d=at(e,t,1)[0];if(d===0)continue;let f=p.name?`${i.name}${p.name}`:i.name;if(p.type!=="scalarField"||p.scalarField.physicalType!==ne.STRING)throw Error("Currently only scalar string fields are implemented for a struct.");if(d>1&&!p.nullable||d===1&&p.nullable)throw Error(`The number of streams for the child field ${p.name} does not match its nullability. nullibilty: ${p.nullable}, numStreams: ${d}`);let m;if(p.nullable){let g=ut(e,t);m=new Ei(ms(e,g.numValues,g.byteLength,t),g.numValues)}let _=mt(e,t,ut(e,t),void 0,m);h[c++]=n?new m_(f,_,a,s,o,n,m):new Vr(f,_,a,s,m)}return h}function gT(e,t,i,r,a,s){return i.type==="scalarType"?yT(r,e,t,a,i.scalarType,i):r===0?null:_T(e,t,i)}function yT(e,t,i,r,a,s){let o=null;if(e===0)return null;if(s.nullable){let l=ut(t,i),u=l.numValues,h=i.get(),c=ms(t,u,l.byteLength,i);i.set(h+l.byteLength),o=new Ei(c,l.numValues)}let n=o??r;switch(a.physicalType){case ne.UINT_32:case ne.INT_32:return TT(t,i,s,a,n);case ne.STRING:{let l=s.nullable?e-1:e;return pT(s.name,t,i,l,o)}case ne.BOOLEAN:return vT(t,i,s,r,n);case ne.UINT_64:case ne.INT_64:return wT(t,i,s,n,a);case ne.FLOAT:return xT(t,i,s,n);case ne.DOUBLE:return bT(t,i,s,n);default:throw Error(`The specified data type for the field is currently not supported: ${a}`)}}function vT(e,t,i,r,a){let s=ut(e,t),o=s.numValues,n=t.get(),l=_s(a)?a:void 0,u=ms(e,o,s.byteLength,t,l);t.set(n+s.byteLength);let h=new Ei(u,o);return new aT(i.name,h,a)}function xT(e,t,i,r){let a=ut(e,t),s=_s(r)?r:void 0,o=nT(e,t,a.numValues,s);return new sT(i.name,o,r)}function bT(e,t,i,r){let a=ut(e,t),s=_s(r)?r:void 0,o=lT(e,t,a.numValues,s);return new ch(i.name,o,r)}function wT(e,t,i,r,a){let s=ut(e,t),o=on(s,r,e,t,"int64"),n=a.physicalType===ne.INT_64;if(o===ve.FLAT){let u=_s(r)?r:void 0,h=n?k2(e,t,s,u):o_(e,t,s,u);return new l_(i.name,h,r)}if(o===ve.SEQUENCE){let u=s_(e,t,s);return new u_(i.name,u[0],u[1],s.numRleValues)}let l=n?F2(e,t,s):n_(e,t,s);return new f_(i.name,l,r,n)}function TT(e,t,i,r,a){let s=ut(e,t),o=on(s,a,e,t),n=r.physicalType===ne.INT_32;if(o===ve.FLAT){let u=_s(a)?a:void 0,h=n?fu(e,t,s,void 0,u):mt(e,t,s,void 0,u);return new hh(i.name,h,a)}if(o===ve.SEQUENCE){let u=a_(e,t,s);return new ph(i.name,u[0],u[1],s.numRleValues)}let l=n?R2(e,t,s):yh(e,t,s);return new dh(i.name,l,a,n)}function _s(e){return e instanceof Ei}function __(e){switch(e){case 0:case 1:case 2:case 3:{let t={};t.nullable=(e&1)!=0,t.columnScope=io.FEATURE;let i={};return i.type="logicalType",i.logicalType=fh.ID,i.longID=(e&2)!=0,t.scalarType=i,t.type="scalarType",t}case 4:{let t={};t.nullable=!1,t.columnScope=io.FEATURE;let i={};return i.type="physicalType",i.physicalType=ts.GEOMETRY,t.type="complexType",t.complexType=i,t}case 30:{let t={};t.nullable=!1,t.columnScope=io.FEATURE;let i={};return i.type="physicalType",i.physicalType=ts.STRUCT,t.type="complexType",t.complexType=i,t}default:return ET(e)}}function g_(e){return e>=10}function y_(e){return e===30}function ST(e){if(e.type==="scalarType"){let t=e.scalarType;if(t.type==="physicalType")switch(t.physicalType){case ne.BOOLEAN:case ne.INT_8:case ne.UINT_8:case ne.INT_32:case ne.UINT_32:case ne.INT_64:case ne.UINT_64:case ne.FLOAT:case ne.DOUBLE:return!1;case ne.STRING:return!0;default:return!1}if(t.type==="logicalType")return!1}else if(e.type==="complexType"){let t=e.complexType;if(t.type==="physicalType")switch(t.physicalType){case ts.GEOMETRY:case ts.STRUCT:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",e),!1}function PT(e){return e.type==="scalarType"&&e.scalarType?.type==="logicalType"&&e.scalarType.logicalType===fh.ID}function IT(e){return e.type==="complexType"&&e.complexType?.type==="physicalType"&&e.complexType.physicalType===ts.GEOMETRY}function ET(e){let t;switch(e){case 10:case 11:t=ne.BOOLEAN;break;case 12:case 13:t=ne.INT_8;break;case 14:case 15:t=ne.UINT_8;break;case 16:case 17:t=ne.INT_32;break;case 18:case 19:t=ne.UINT_32;break;case 20:case 21:t=ne.INT_64;break;case 22:case 23:t=ne.UINT_64;break;case 24:case 25:t=ne.FLOAT;break;case 26:case 27:t=ne.DOUBLE;break;case 28:case 29:t=ne.STRING;break;default:return null}let i={};i.nullable=(e&1)!=0,i.columnScope=io.FEATURE;let r={};return r.type="physicalType",r.physicalType=t,i.type="scalarType",i.scalarType=r,i}const MT=new TextDecoder;function wh(e,t){let i=at(e,t,1)[0];if(i===0)return"";let r=t.get(),a=r+i,s=e.subarray(r,a);return t.add(i),MT.decode(s)}function AT(e){return{name:e.name,nullable:e.nullable,scalarField:e.scalarType,complexField:e.complexType,type:e.type==="scalarType"?"scalarField":"complexField"}}function v_(e,t){let i=at(e,t,1)[0]>>>0;if(i<10||i>
230)throw Error(`Unsupported field type code ${i}. Supported: 10-29(scalars), 30(STRUCT)`);let r=__(i);if(g_(i)&&(r.name=wh(e,t)),y_(i)){let a=at(e,t,1)[0]>>>0;r.complexType.children=Array(a);for(let s=0;s<a;s++)r.complexType.children[s]=v_(e,t)}return AT(r)}function CT(e,t){let i=at(e,t,1)[0]>>>0,r=__(i);if(!r)throw Error(`Unsupported column type code ${i}. Supported: 0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT)`);if(g_(i)?r.name=wh(e,t):i>=0&&i<=3?r.name="id":i===4&&(r.name="geometry"),y_(i)){let a=at(e,t,1)[0]>>>0,s=r.complexType;s.children=Array(a);for(let o=0;o<a;o++)s.children[o]=v_(e,t)}return r}function DT(e,t){let i={};i.featureTables=[];let r={};if(r.name=wh(e,t),r.name.length===0)throw Error("Missing layer name");let a=at(e,t,1)[0]>>>0,s=at(e,t,1)[0]>>>0;r.columns=Array(s);for(let o=0;o<s;o++)r.columns[o]=CT(e,t);return i.featureTables.push(r),[i,a]}function zT(e,t,i=!0){let r=new e_(0),a=[];for(;r.get()<e.length;){let s=at(e,r,1)[0]>>>0,o=r.get()+s;if(o>e.length)throw Error(`Block overruns tile: ${o} > ${e.length}`);if(at(e,r,1)[0]>>>0!=1){r.set(o);continue}let[n,l]=DT(e,r),u=n.featureTables[0],h=null,c=null,p=[],d=0;for(let m of u.columns){let _=m.name;if(PT(m)){let g=null;if(m.nullable){let y=ut(e,r),v=r.get(),w=ms(e,y.numValues,y.byteLength,r);r.set(v+y.byteLength),g=new Ei(w,y.numValues)}let x=ut(e,r);d=g?g.size():x.decompressedCount,h=RT(e,m,r,_,x,g??d,i)}else if(IT(m)){let g=at(e,r,1)[0];if(d===0){let x=r.get();d=ut(e,r).decompressedCount,r.set(x)}c=tT(e,g,r,d,t)}else{let g=ST(m)?at(e,r,1)[0]:1;if(g===0)continue;let x=gT(e,r,m,g,d);if(x)if(Array.isArray(x))for(let y of x)p.push(y);else p.push(x)}}let f=new hw(u.name,c,h,p,l);a.push(f),r.set(o)}return a}function RT(e,t,i,r,a,s,o=!1){let n=t.scalarType;if(n?.type!=="logicalType"||n.logicalType!==fh.ID)throw Error(`ID column must be a logical ID scalar type: ${r}`);let l=n.longID?ne.UINT_64:ne.UINT_32,u=typeof s=="number"?void 0:s,h=on(a,s,e,i,l===ne.UINT_64?"int64":"int32");if(l===ne.UINT_32)switch(h){case ve.FLAT:return new hh(r,mt(e,i,a,void 0,u),s);case ve.SEQUENCE:{let c=a_(e,i,a);return new ph(r,c[0],c[1],a.numRleValues)}case ve.CONST:return new dh(r,yh(e,i,a),s,!1)}switch(h){case ve.FLAT:return o?new ch(r,L2(e,i,a),s):new l_(r,o_(e,i,a,u),s);case ve.SEQUENCE:{let c=s_(e,i,a);return new u_(r,c[0],c[1],a.numRleValues)}case ve.CONST:return new f_(r,n_(e,i,a),s,!1)}throw Error("Vector type not supported for id column.")}var kT=class{constructor(e,t){switch(this._featureData=e,this.properties=this._featureData.properties||{},this._featureData.geometry?.type){case Ge.POINT:case Ge.MULTIPOINT:this.type=1;break;case Ge.LINESTRING:case Ge.MULTILINESTRING:this.type=2;break;case Ge.POLYGON:case Ge.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=t,this.id=Number(this._featureData.id)}loadGeometry(){let e=[];for(let t of this._featureData.geometry.coordinates){let i=[];for(let r of t)i.push(new E(r.x,r.y));e.push(i)}return e}},LT=class{constructor(e){this.features=[],this.featureTable=e,this.name=e.name,this.extent=e.extent,this.version=2,this.features=e.getFeatures(),this.length=this.features.length}feature(e){return new kT(this.features[e],this.extent)}},FT=class{constructor(e){this.layers={};let t=zT(new Uint8Array(e));this.layers=t.reduce((i,r)=>({...i,[r.name]:new LT(r)}),{})}},BT=class{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Sl(C,16,0),this.grid3D=new Sl(C,16,0),this.featureIndexArray=new _m,this.promoteId=t}insert(e,t,i,r,a,s){let o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,r,a);let n=s?this.grid3D:this.grid;for(let l of t){let u=[1/0,1/0,-1/0,-1/0];for(let h of l)u[0]=Math.min(u[0],h.x),u[1]=Math.min(u[1],h.y),u[2]=Math.max(u[2],h.x),u[3]=Math.max(u[3],h.y);u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&n.insert(o,u[0],u[1],u[2],u[3])}}loadVTLayers(){return this.vtLayers||(this.encoding==="mlt"?this.vtLayers=new FT(this.rawTileData).layers:this.vtLayers=new Y1(new Nm(this.rawTileData)).layers,this.sourceLayerCoder=new uw(this.vtLayers?Object.keys(this.vtLayers).sort():[to])),this.vtLayers}query(e,t,i,r){this.loadVTLayers();let a=e.params,s=C/e.tileSize/e.scale,o=Ga(a.filter,"queryRenderedFeatures filter",a.globalState),n=e.queryGeometry,l=e.queryPadding*s,u=ai.fromPoints(n),h=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),c=ai.fromPoints(e.cameraQueryGeometry).expandBy(l),p=this.grid3D.query(c.minX,c.minY,c.maxX,c.maxY,(m,_,g,x)=>zx(e.cameraQueryGeometry,m-l,_-l,g+l,x+l));for(let m of p)h.push(m);h.sort(OT);let d={},f;for(let m of h){if(m===f)continue;f=m;let _=this.featureIndexArray.get(m),g=null;
vendor: 4,159 bytes, line 2
2this.loadMatchingFeature(d,_.bucketIndex,_.sourceLayerIndex,_.featureIndex,o,a.layers,a.availableImages,t,i,r,(x,y,v)=>(g||=mr(x),y.queryIntersectsFeature({queryGeometry:n,feature:x,featureState:v,geometry:g,zoom:this.z,transform:e.transform,pixelsToTileUnits:s,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation})))}return d}loadMatchingFeature(e,t,i,r,a,s,o,n,l,u,h){let c=this.bucketLayerIDs[t];if(s&&!c.some(m=>s.has(m)))return;let p=this.sourceLayerCoder.decode(i),d=this.vtLayers[p].feature(r);if(a.needGeometry){let m=_r(d,!0);if(!a.filter(new Se(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!a.filter(new Se(this.tileID.overscaledZ),d))return;let f=this.getId(d,p);for(let m of c){if(s&&!s.has(m))continue;let _=n[m];if(!_)continue;let g={};f&&u&&(g=u.getState(_.sourceLayer||"_geojsonTileLayer",f));let x=j({},l[m]);x.paint=cp(x.paint,_.paint,d,g,o),x.layout=cp(x.layout,_.layout,d,g,o);let y=!h||h(d,_,g);if(!y)continue;let v=new Jm(d,this.z,this.x,this.y,f);v.layer=x;let w=e[m];w===void 0&&(w=e[m]=[]),w.push({featureIndex:r,feature:v,intersectionZ:y})}}lookupSymbolFeatures(e,t,i,r,a,s,o,n){let l={};this.loadVTLayers();let u=Ga(a.filterSpec,"queryRenderedFeatures symbol filter",a.globalState);for(let h of e)this.loadMatchingFeature(l,i,r,h,u,s,o,n,t);return l}hasLayer(e){for(let t of this.bucketLayerIDs)for(let i of t)if(e===i)return!0;return!1}getId(e,t){let i=e.id;if(this.promoteId){let r=typeof this.promoteId=="string"?this.promoteId:this.promoteId[t];i=e.properties[r],typeof i=="boolean"&&(i=Number(i)),i===void 0&&e.properties?.cluster&&this.promoteId&&(i=Number(e.properties.cluster_id))}return i}};V("FeatureIndex",BT,{omit:["rawTileData","sourceLayerCoder"]});function cp(e,t,i,r,a){return Cu(e,(s,o)=>{let n=t instanceof Ko?t.get(o):null;return n?.evaluate?n.evaluate(i,r,a):n})}function OT(e,t){return t-e}var $T=class{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(let e in this.data)for(let t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,i){let r=e.wrapped().key;this.data[r]===void 0&&(this.data[r]=[]);let a={value:t,timeout:void 0};if(i!==void 0&&(a.timeout=setTimeout(()=>{this.remove(e,a)},i)),this.data[r].push(a),this.order.push(r),this.order.length>this.max){let s=this._getAndRemoveByKey(this.order[0]);s&&this.onRemove(s)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){let t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){let t=this.data[e];return t?t[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;let i=e.wrapped().key,r=t===void 0?0:this.data[i].indexOf(t),a=this.data[i][r];return this.data[i].splice(r,1),a.timeout&&clearTimeout(a.timeout),this.data[i].length===0&&delete this.data[i],this.onRemove(a.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){let t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(e){let t=[];for(let i in this.data)for(let r of this.data[i])e(r.value)||t.push(r);for(let i of t)this.remove(i.value.tileID,i)}};function VT(e,t,i,r,a){let s=[];for(let o of e){let n;for(let l=0;l<o.length-1;l++){let u=o[l],h=o[l+1];u.x<t&&h.x<t||(u.x<t?u=new E(t,u.y+(h.y-u.y)*((t-u.x)/(h.x-u.x)))._round():h.x<t&&(h=new E(t,u.y+(h.y-u.y)*((t-u.x)/(h.x-u.x)))._round()),!(u.y<i&&h.y<i)&&(u.y<i?u=new E(u.x+(h.x-u.x)*((i-u.y)/(h.y-u.y)),i)._round():h.y<i&&(h=new E(u.x+(h.x-u.x)*((i-u.y)/(h.y-u.y)),i)._round()),!(u.x>=r&&h.x>=r)&&(u.x>=r?u=new E(r,u.y+(h.y-u.y)*((r-u.x)/(h.x-u.x)))._round():h.x>=r&&(h=new E(r,u.y+(h.y-u.y)*((r-u.x)/(h.x-u.x)))._round()),!(u.y>=a&&h.y>=a)&&(u.y>=a?u=new E(u.x+(h.x-u.x)*((a-u.y)/(h.y-u.y)),a)._round():h.y>=a&&(h=new E(u.x+(h.x-u.x)*((a-u.y)/(h.y-u.y)),a)._round()),(!n||!u.equals(n[n.length-1]))&&
2(n=[u],s.push(n)),n.push(h)))))}}return s}var jT=class x_ extends E{constructor(t,i,r,a){super(t,i),this.angle=r,a!==void 0&&(this.segment=a)}clone(){return new x_(this.x,this.y,this.angle,this.segment)}};V("Anchor",jT);let pp=(function(e){return e[e.center=1]="center",e[e.left=2]="left",e[e.right=3]="right",e[e.top=4]="top",e[e.bottom=5]="bottom",e[e["top-left"]=6]="top-left",e[e["top-right"]=7]="top-right",e[e["bottom-left"]=8]="bottom-left",e[e["bottom-right"]=9]="bottom-right",e})({});function NT(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}var b_="6.1.0";function w_(){var e=new Ye(4);return Ye!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function UT(e,t){var i=t[0],r=t[1],a=t[2],s=t[3],o=i*s-a*r;return o?(o=1/o,e[0]=s*o,e[1]=-r*o,e[2]=-a*o,e[3]=i*o,e):null}function GT(e,t,i){var r=t[0],a=t[1],s=t[2],o=t[3],n=Math.sin(i),l=Math.cos(i);return e[0]=r*l+s*n,e[1]=a*l+o*n,e[2]=r*-n+s*l,e[3]=a*-n+o*l,e}let Vn,dp,jn;const ft={frame(e,t,i,r){let a=r||window,s=a.requestAnimationFrame(n=>{o(),t(n)}),{unsubscribe:o}=cl(e.signal,"abort",()=>{o(),a.cancelAnimationFrame(s),i(new ss(e.signal.reason))},!1)},frameAsync(e,t){return new Promise((i,r)=>{this.frame(e,i,r,t)})},getImageData(e,t=0){return this.getImageCanvasContext(e).getImageData(-t,-t,e.width+2*t,e.height+2*t)},getImageCanvasContext(e){let t=window.document.createElement("canvas"),i=t.getContext("2d",{willReadFrequently:!0});if(!i)throw Error("failed to create canvas 2d context");return t.width=e.width,t.height=e.height,i.drawImage(e,0,0,e.width,e.height),i},resolveURL(e){return Vn||=document.createElement("a"),Vn.href=e,Vn.href},get hardwareConcurrency(){return typeof navigator<"u"&&navigator.hardwareConcurrency||4},get prefersReducedMotion(){return jn===void 0?matchMedia?(dp??=matchMedia("(prefers-reduced-motion: reduce)"),dp.matches):!1:jn},set prefersReducedMotion(e){jn=e}},nn=new class{constructor(){this._frozenAt=null}getCurrentTime(){return this._frozenAt===null?performance.now():this._frozenAt}setNow(e){this._frozenAt=e}restoreNow(){this._frozenAt=null}isFrozen(){return this._frozenAt!==null}};function _e(){return nn.getCurrentTime()}function _z(e){nn.setNow(e)}function gz(){nn.restoreNow()}function yz(){return nn.isFrozen()}var ce,N=(ce=class{static create(t,i,r){let a=window.document.createElement(t);return i!==void 0&&(a.className=i),r&&r.appendChild(a),a}static createNS(t,i){return window.document.createElementNS(t,i)}static disableDrag(){ce.docStyle&&ce.selectProp&&(ce.userSelect=ce.docStyle[ce.selectProp],ce.docStyle[ce.selectProp]="none")}static enableDrag(){ce.docStyle&&ce.selectProp&&(ce.docStyle[ce.selectProp]=ce.userSelect)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",ce.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",ce.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",ce.suppressClickInternal,!0)},0)}static getScale(t){let i=t.getBoundingClientRect();return{x:i.width/t.offsetWidth||1,y:i.height/t.offsetHeight||1,boundingClientRect:i}}static getPoint(t,i,r){let a=i.boundingClientRect;return new E((r.clientX-a.left)/i.x-t.clientLeft,(r.clientY-a.top)/i.y-t.clientTop)}static mousePos(t,i){let r=ce.getScale(t);return ce.getPoint(t,r,i)}static touchPos(t,i){let r=[],a=ce.getScale(t);for(let s of i)r.push(ce.getPoint(t,a,s));return r}static sanitize(t){let i=new DOMParser().parseFromString(t,"text/html").body||document.createElement("body"),r=i.querySelectorAll("script");for(let a of r)a.remove();return ce.clean(i),i.innerHTML}static isPossiblyDangerous(t,i){let r=i.replace(/\s+/g,"").toLowerCase();if(["src","href","xlink:href"].includes(t)&&(r.includes("javascript:")||r.includes("data:"))||t.startsWith("on"))return!0}static clean(t){let i=t.children;for(let r of i)ce.removeAttributes(r),ce.clean(r)}static removeAttributes(t){for(let{name:i,value:r}of t.attributes)ce.isPossiblyDangerous(i,r)&&t.removeAttribute(i)}},ce.docStyle=typeof window<"u"&&window.document?.documentElement.style,ce.selectProp=!ce.docStyle||"userSelect"in ce.docStyle?"userSelect":"webkitUserSelect",ce);let Ti;(function(e){let t,i,r,a;e.resetRequestQueue=()=>{t=[],i=0,r=0,a={}},e.addThrottleControl=h=>{let c=r++;return a[c]=h,c},e.removeThrottleControl=h=>{delete a[h],l()};let s=()=>{for(let h of Object.keys(a))if(a[h]())return!0;return!1};e.getImage=(h,c,p=!0,d)=>new Promise((f,m)=>{h.headers||={}
vendor: 5,355 bytes, line 2
2,h.headers.accept="image/webp,*/*",j(h,{type:"image"});let _={abortController:c,requestParameters:h,supportImageRefresh:p,imageBitmapOptions:d,state:"queued",onError:g=>{m(g)},onSuccess:g=>{f(g)}};t.push(_),l()});let o=(h,c)=>typeof createImageBitmap=="function"?wy(h,c):Ty(h),n=async h=>{h.state="running";let{requestParameters:c,supportImageRefresh:p,imageBitmapOptions:d,onError:f,onSuccess:m,abortController:_}=h,g=p===!1&&!d&&!Gr(self)&&!Cd(c.url)&&(!c.headers||Object.keys(c.headers).reduce((y,v)=>y&&v==="accept",!0));i++;let x=g?u(c,_):ko(c,_);try{let y=await x;delete h.abortController,h.state="completed",y.data instanceof HTMLImageElement||ar(y.data)?m(y):y.data&&m({data:await o(y.data,d),cacheControl:y.cacheControl,expires:y.expires})}catch(y){delete h.abortController,f(ht(y))}finally{i--,l()}},l=()=>{let h=s()?Bt.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:Bt.MAX_PARALLEL_IMAGE_REQUESTS;for(let c=i;c<h&&t.length>0;c++){let p=t.shift();if(p.abortController.signal.aborted){c--;continue}n(p)}},u=(h,c)=>new Promise((p,d)=>{let f=new Image,m=h.url,_=h.credentials;_&&_==="include"?f.crossOrigin="use-credentials":(_&&_==="same-origin"||!Dd(m))&&(f.crossOrigin="anonymous"),c.signal.addEventListener("abort",()=>{f.src="",d(new ss(c.signal.reason))}),f.fetchPriority="high",f.onload=()=>{f.onerror=f.onload=null,p({data:f})},f.onerror=()=>{f.onerror=f.onload=null,!c.signal.aborted&&d(Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},f.src=m})})(Ti||={}),Ti.resetRequestQueue();var ZT=class{constructor(e){this._transformRequestFn=e??null}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}},Xe=class extends Ot{},U=class extends Xe{},fp=class extends Xe{constructor(e={}){super("style.load",e)}},Gt=class extends Xe{constructor(e,t={}){super(e,t),this.dataType="style"}},be=class extends Xe{constructor(e,t={}){super(e,t),this.dataType="source"}},Rt=class extends Xe{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,i,r={}){i=i instanceof MouseEvent?i:new MouseEvent(e,i);let a=N.mousePos(t.getCanvas(),i),s=t.unproject(a);super(e,j({point:a,lngLat:s,originalEvent:i},r)),this._defaultPrevented=!1,this.target=t}},Bs=class extends Xe{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,i){let r=e==="touchend"?i.changedTouches:i.touches,a=N.touchPos(t.getCanvasContainer(),r),s=a.map(l=>t.unproject(l)),o=a.reduce((l,u,h,c)=>l.add(u.div(c.length)),new E(0,0)),n=t.unproject(o);super(e,{points:a,point:o,lngLats:s,lngLat:n,originalEvent:i}),this._defaultPrevented=!1}},qT=class extends Xe{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t){super("wheel",{originalEvent:t}),this._defaultPrevented=!1}},mp=class extends Xe{},WT=class extends Xe{constructor(e={}){super("terrain",e)}},HT=class extends Xe{constructor(e={}){super("projectiontransition",e)}},Nn=class extends Xe{},XT=class extends Xe{constructor(e={}){super("styleimagemissing",e)}};function ro(e){let t=[];if(typeof e=="string")t.push({id:"default",url:e});else if(e&&e.length>0){let i=[];for(let{id:r,url:a}of e){let s=`${r}${a}`;i.includes(s)||(i.push(s),t.push({id:r,url:a}))}}return t}function _p(e,t,i){try{let r=new URL(e);return r.pathname+=`${t}${i}`,r.toString()}catch{throw Error(`Invalid sprite URL "${e}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}async function YT(e,t,i,r){let a=ro(e),s=i>1?"@2x":"",o={},n={};for(let{id:l,url:u}of a){o[l]=Lo(await t.transformRequest(_p(u,s,".json"),"SpriteJSON"),r);let h=await t.transformRequest(_p(u,s,".png"),"SpriteImage");n[l]=Ti.getImage(h,r)}return await Promise.all([...Object.values(o),...Object.values(n)]),KT(o,n)}async function KT(e,t){let i={};for(let r in e){i[r]={};let a=ft.getImageCanvasContext((await t[r]).data),s=(await e[r]).data;for(let o in s){let{width:n,height:l,x:u,y:h,sdf:c,pixelRatio:p,stretchX:d,stretchY:f,content:m,textFitWidth:_,textFitHeight:g}=s[o],x={width:n,height:l,x:u,y:h,context:a};i[r][o]={data:null,pixelRatio:p,sdf:c,stretchX:d,stretchY:f,content:m,textFitWidth:_,textFitHeight:g,spriteData:x}}}return i}var JT=class extends Ze{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.missingImageResolver=null,this.patterns={},this.atlasImage=new xe({width:1,height:1}),this.dirty=!0}destroy(){this.atlasTexture&&=(this.atlasTexture.destroy(),null);for(let e of Object.keys(this.images))this.removeImage(e);this.patterns={},this.atlasImage=new xe({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(let{ids:t,promiseResolve:i}of this.requestors)i(this._getImagesForIds(t));this.requestors=[]}}getImage(e){let t=this.images[e];if(t&&!t.data&&t.spriteData){let i=t.spriteData;t.data=new xe({width:i.width,height:i.height},i.context.getImageData(i.x,i.y,i.width,i.height).data),t.spriteData=null}return t}addImage(e,t){if(this.images[e])throw Error(`Image id ${e} already exist, use updateImage instead`);
2this._validate(e,t)&&(this.images[e]=t)}_validate(e,t){let i=!0,r=t.data||t.spriteData;return this._validateStretch(t.stretchX,r?.width)||(this.fire(new G(Error(`Image "${e}" has invalid "stretchX" value`))),i=!1),this._validateStretch(t.stretchY,r?.height)||(this.fire(new G(Error(`Image "${e}" has invalid "stretchY" value`))),i=!1),this._validateContent(t.content,t)||(this.fire(new G(Error(`Image "${e}" has invalid "content" value`))),i=!1),i}_validateStretch(e,t){if(!e)return!0;let i=0;for(let r of e){if(r[0]<i||r[1]<r[0]||t<r[1])return!1;i=r[1]}return!0}_validateContent(e,t){if(!e)return!0;if(e.length!==4)return!1;let i=t.spriteData,r=i?.width||t.data.width,a=i?.height||t.data.height;return e[0]<0||r<e[0]||e[1]<0||a<e[1]||e[2]<0||r<e[2]||e[3]<0||a<e[3]||e[2]<e[0]?!1:e[3]>=e[1]}updateImage(e,t,i=!0){let r=this.getImage(e);if(i&&(r.data.width!==t.data.width||r.data.height!==t.data.height))throw Error(`size mismatch between old image (${r.data.width}x${r.data.height}) and new image (${t.data.width}x${t.data.height}).`);t.version=r.version+1,this.images[e]=t,this.updatedImages[e]=!0}removeImage(e){let t=this.images[e];delete this.images[e],delete this.patterns[e],t.userImage?.onRemove&&t.userImage.onRemove()}listImages(){return Object.keys(this.images)}setMissingImageResolver(e){this.missingImageResolver=e}getImages(e){return new Promise((t,i)=>{let r=!0;if(!this.isLoaded())for(let a of e)this.images[a]||(r=!1);this.isLoaded()||r?t(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:t})})}async _getImagesForIds(e){let t=new Set(e.filter(a=>!this.getImage(a))),i=this.missingImageResolver;i&&await Promise.all(Array.from(t,a=>i(a)));let r={};for(let a of e){let s=this.getImage(a);s&&(t.delete(a),r[a]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,textFitWidth:s.textFitWidth,textFitHeight:s.textFitHeight,hasRenderCallback:!!s.userImage?.render})}for(let a of t)this.fire(new XT({id:a})),ge(`Image "${a}" could not be loaded. Please make sure you have added the image before it is needed with map.addImage(), resolved it with map.setMissingStyleImageResolver(), or included it in a "sprite" property in your style.`);return r}getPixelSize(){let{width:e,height:t}=this.atlasImage;return{width:e,height:t}}getPattern(e){let t=this.patterns[e],i=this.getImage(e);if(!i)return null;if(t&&t.position.version===i.version)return t.position;if(t)t.position.version=i.version;else{let r={w:i.data.width+2,h:i.data.height+2,x:0,y:0},a=new lh(r,i);this.patterns[e]={bin:r,position:a}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){let t=e.gl;this.atlasTexture?this.dirty&&=(this.atlasTexture.update(this.atlasImage),!1):this.atlasTexture=new ke(e,this.atlasImage,t.RGBA),this.atlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE)}_updatePatternAtlas(){let e=[];for(let a in this.patterns)e.push(this.patterns[a].bin);let{w:t,h:i}=Um(e),r=this.atlasImage;r.resize({width:t||1,height:i||1});for(let a in this.patterns){let{bin:s}=this.patterns[a],o=s.x+1,n=s.y+1,l=this.getImage(a).data,u=l.width,h=l.height;xe.copy(l,r,{x:0,y:0},{x:o,y:n},{width:u,height:h}),xe.copy(l,r,{x:0,y:h-1},{x:o,y:n-1},{width:u,height:1}),xe.copy(l,r,{x:0,y:0},{x:o,y:n+h},{width:u,height:1}),xe.copy(l,r,{x:u-1,y:0},{x:o-1,y:n},{width:1,height:h}),xe.copy(l,r,{x:0,y:0},{x:o+u,y:n},{width:1,height:h})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(let t of e){if(this.callbackDispatchedThisFrame[t])continue;this.callbackDispatchedThisFrame[t]=!0;let i=this.getImage(t);i||ge(`Image with ID: "${t}" was not found`),Ob(i)&&this.updateImage(t,i)}}cloneImages(){let e={};for(let t in this.images){let i=this.images[t];e[t]={...i,data:i.data?i.data.clone():null}}return e}};async function QT(e,t,i,r){let a=t*256,s=a+255,o=await Ry(await r.transformRequest(i.replace("{fontstack}",e).replace("{range}",`${a}-${s}`),"Glyphs"),new AbortController);if(!o?.data)throw Error(`Could not load glyph range. range: ${t}, ${a}-${s}`);let n={};for(let l of Bb(o.data))n[l.id]=l;return n}const mu=1e20,Th=new Float64Array(256);for(let e=0;e<256;e++){let t=.5-(e/255)**.45454545454545453;Th[e]=t*Math.abs(t)}Th[255]=-1e20;var eS=class{constructor({fontSize:e=24,buffer:t=3,radius:i=8,cutoff:r=.25,fontFamily:a="sans-serif",fontWeight:s="normal",fontStyle:o="normal",lang:n=null}={}){this.buffer=t,this.radius=i,this.cutoff=r,this.lang=n;let l=this.size=e+t*4,u=this._createCanvas(l),h=this.ctx=u.getContext("2d",{willReadFrequently:!0});h.font=`${o} ${s} ${e}px ${a}`,h.textBaseline="alphabetic",h.textAlign="left",h.fillStyle="black",this.gridOuter=new Float64Array(l*l),this.gridInner=new Float64Array(l*l),this.f=new Float64Array(l),this.z=new Float64Array(l+1),this.v=new Uint16Array(l)}_createCanvas(e){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(e,e);let t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){let{width:t,actualBoundingBoxAscent:i,actualBoundingBoxDescent:r,actualBoundingBoxLeft:a,actualBoundingBoxRight:s}=this.ctx.measureText(e),o=Math.ceil(i),n=Math.floor(-a),l=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(s)-n)),u=Math.max(0,Math.min(this.size-this.buffer,o+Math.ceil(r))),h=l+2*this.buffer,c=u+2*this.buffer,p=Math.max(h*c,0),d=new Uint8ClampedArray(p),f={data:d,width:h,height:c,glyphWidth:l,glyphHeight:u,glyphTop:o,glyphLeft:n,glyphAdvance:t};if(l===0||u===0)return f;let{ctx:m,buffer:_,gridInner:g,gridOuter:x}=this;this.lang&&(m.lang=this.lang),m.clearRect(_,_,l,u),m.fillText(e,_-n,_+o);let y=m.getImageData(_,_,l,u);x.fill(mu,0,p),g.fill(0,0,p);let v=3;for(let I=0;I<u;I++){let M=(I+_)*h+_;for(let D=0;D<l;D++,v+=4,M++){let L=y.data[v];if(L===0)continue;let z=Th[L];x[M]=Math.max(0,z),g[M]=Math.max(0,-z)}
2}gp(x,0,0,h,c,h,this.f,this.v,this.z);let w=Math.min(_,1);gp(g,_-w,_-w,l+2*w,u+2*w,h,this.f,this.v,this.z);let b=255/this.radius,T=255*(1-this.cutoff);for(let I=0;I<p;I++){let M=Math.sqrt(x[I])-Math.sqrt(g[I]);d[I]=Math.round(T-b*M)}return f}};function gp(e,t,i,r,a,s,o,n,l){for(let u=t;u<t+r;u++)yp(e,i*s+u,s,a,o,n,l);for(let u=i;u<i+a;u++)yp(e,u*s+t,1,r,o,n,l)}function yp(e,t,i,r,a,s,o){s[0]=0,o[0]=-1e20,o[1]=mu,a[0]=e[t];for(let n=1,l=0,u=0;n<r;n++){a[n]=e[t+n*i];let h=n*n;do{let c=s[l];u=(a[n]-a[c]+h-c*c)/(n-c)/2}while(u<=o[l]&&--l>-1);l++,s[l]=n,o[l]=u,o[l+1]=mu}for(let n=0,l=0;n<r;n++){for(;o[l+1]<n;)l++;let u=s[l],h=n-u;e[t+n*i]=a[u]+h*h}}const tS=A.layout_symbol["text-font"].default.join(",");var xi,iS=(xi=class{constructor(t,i,r){this.requestManager=t,this.localIdeographFontFamily=i,this.entries={},this.lang=r}setURL(t){this.url=t}async getGlyphs(t){let i=[];for(let s in t)for(let o of t[s])i.push(this._getAndCacheGlyphsPromise(s,o));let r=await Promise.all(i),a={};for(let{stack:s,id:o,glyph:n}of r)a[s]||={},a[s][o]=n&&{id:n.id,bitmap:n.bitmap.clone(),metrics:n.metrics};return a}async _getAndCacheGlyphsPromise(t,i){this.entries[t]??={glyphs:{},requests:{},ranges:{}};let r=this.entries[t],a=r.glyphs[i];return a===void 0?!this.url||this._charUsesLocalIdeographFontFamily(i)?(a=r.glyphs[i]=await this._drawGlyph(r,t,i),{stack:t,id:i,glyph:a}
2):await this._downloadAndCacheRangePromise(t,i):{stack:t,id:i,glyph:a}}async _downloadAndCacheRangePromise(t,i){let r=this.entries[t],a=Math.floor(i/256);if(r.ranges[a])return{stack:t,id:i,glyph:null};r.requests[a]||=xi.loadGlyphRange(t,a,this.url,this.requestManager);try{let s=await r.requests[a];for(let o in s)r.glyphs[+o]=s[+o];return r.ranges[a]=!0,{stack:t,id:i,glyph:s[i]||null}}catch(s){let o=r.glyphs[i]=await this._drawGlyph(r,t,i);return this._warnOnMissingGlyphRange(o,a,i,ht(s)),{stack:t,id:i,glyph:o}}}_warnOnMissingGlyphRange(t,i,r,a){let s=i*256;ge(`Unable to load glyph range ${i}, ${s}-${s+255}. Rendering codepoint U+${r.toString(16).padStart(4,"0").toUpperCase()} locally instead. ${a}`)}_charUsesLocalIdeographFontFamily(t){return!!this.localIdeographFontFamily&&j0(t)}async _drawGlyph(t,i,r){let a=i===tS&&this.localIdeographFontFamily!==""&&this._charUsesLocalIdeographFontFamily(r),s=a?"ideographTinySDF":"tinySDF";t[s]||=this._createTinySDF(a?this.localIdeographFontFamily:i);let o=(await t[s]).draw(String.fromCodePoint(r)),n=new RegExp("^\\p{gc=Cf}+$","u").test(String.fromCodePoint(r));return{id:r,bitmap:new ah({width:o.width||60,height:o.height||60},o.data),metrics:{width:n?0:o.glyphWidth/2||24,height:o.glyphHeight/2||24,left:o.glyphLeft/2+.5||0,top:o.glyphTop/2-27.5||-8,advance:n?0:o.glyphAdvance/2||24,isDoubleResolution:!0}}}async _createTinySDF(t){let i=t?t.split(","):[];i.push("sans-serif");let r=i.map(o=>/[-\w]+/.test(o)?o:`'${CSS.escape(o)}'`).join(","),a=this._fontWeight(i[0]),s=this._fontStyle(i[0]);if(typeof document<"u"&&document.fonts?.load)try{await document.fonts.load(`${s} ${a||"normal"} 48px ${r}`)}catch(o){ge(`Failed to load font "${r}": ${ht(o).message}`)}return new xi.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:r,fontWeight:a,fontStyle:s,lang:this.lang})}_fontStyle(t){return/italic/i.test(t)?"italic":/oblique/i.test(t)?"oblique":"normal"}_fontWeight(t){let i={thin:100,hairline:100,"extra light":200,"ultra light":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,"extra bold":800,"ultra bold":800,black:900,heavy:900,"extra black":950,"ultra black":950},r;for(let[a,s]of Object.entries(i))RegExp(`\\b${a}\\b`,"i").test(t)&&(r=`${s}`);return r}destroy(){for(let t in this.entries){let i=this.entries[t];
vendor: 17,200 bytes, line 2
2i.tinySDF=null,i.ideographTinySDF=null,i.glyphs={},i.requests={},i.ranges={}}this.entries={}}},xi.loadGlyphRange=QT,xi.TinySDF=eS,xi);let rS;const aS=()=>rS||=new Ke({anchor:new $(A.light.anchor,"anchor"),position:new $(A.light.position,"position"),color:new $(A.light.color,"color"),intensity:new $(A.light.intensity,"intensity")});var sS=class extends Ze{constructor(e,t){super(),this._transitionable=new Yo(aS(),"light",t),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}getCartesianPosition(){return vy(this.properties.get("position"))}setLight(e,t={}){if(!this._validate(_t.light,e,t))for(let i in e){let r=e[i];i.endsWith("-transition")?this._transitionable.setTransition(i.slice(0,-Ju.length),r):this._transitionable.setValue(i,r)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,t,i){return ps(this,e,{value:t},i)}};let oS;const nS=()=>oS||=new Ke({"sky-color":new $(A.sky["sky-color"],"sky-color"),"horizon-color":new $(A.sky["horizon-color"],"horizon-color"),"fog-color":new $(A.sky["fog-color"],"fog-color"),"fog-ground-blend":new $(A.sky["fog-ground-blend"],"fog-ground-blend"),"horizon-fog-blend":new $(A.sky["horizon-fog-blend"],"horizon-fog-blend"),"sky-horizon-blend":new $(A.sky["sky-horizon-blend"],"sky-horizon-blend"),"atmosphere-blend":new $(A.sky["atmosphere-blend"],"atmosphere-blend")});var lS=class extends Ze{constructor(e,t){super(),this._transitionable=new Yo(nS(),"sky",t),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new Se(0))}setSky(e,t={}){if(!this._validate(_t.sky,e,t)){e||={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0};for(let i in e){let r=e[i];i.endsWith("-transition")?this._transitionable.setTransition(i.slice(0,-Ju.length),r):this._transitionable.setValue(i,r)}}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,t,i={}){return ps(this,e,{value:t},i)}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}},uS=class{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,t){let i=e.join(",")+String(t);return this.dashEntry[i]||=this.addDash(e,t),this.dashEntry[i]}getDashRanges(e,t,i){let r=e.length%2==1,a=[],s=r?-e[e.length-1]*i:0,o=e[0]*i,n=!0;a.push({left:s,right:o,isDash:n,zeroLength:e[0]===0});let l=e[0];for(let u=1;u<e.length;u++){n=!n;let h=e[u];s=l*i,l+=h,o=l*i,a.push({left:s,right:o,isDash:n,zeroLength:h===0})}return a}addRoundDash(e,t,i){let r=t/2;for(let a=-i;a<=i;a++){let s=this.nextRow+i+a,o=this.width*s,n=0,l=e[n];for(let u=0;u<this.width;u++){u/l.right>1&&(l=e[++n]);let h=Math.abs(u-l.left),c=Math.abs(u-l.right),p=Math.min(h,c),d,f=a/i*(r+1);if(l.isDash){let m=r-Math.abs(f);d=Math.sqrt(p*p+m*m)}else d=r-Math.sqrt(p*p+f*f);this.data[o+u]=Math.max(0,Math.min(255,d+128))}}}addRegularDash(e){for(let o=e.length-1;o>=0;--o){let n=e[o],l=e[o+1];n.zeroLength?e.splice(o,1):l?.isDash===n.isDash&&(l.left=n.left,e.splice(o,1))}let t=e[0],i=e[e.length-1];t.isDash===i.isDash&&(t.left=i.left-this.width,i.right=t.right+this.width);let r=this.width*this.nextRow,a=0,s=e[a];for(let o=0;o<this.width;o++){o/s.right>1&&(s=e[++a]);let n=Math.abs(o-s.left),l=Math.abs(o-s.right),u=Math.min(n,l),h=s.isDash?u:-u;this.data[r+o]=Math.max(0,Math.min(255,h+128))}}addDash(e,t){let i=t?7:0,r=2*i+1;if(this.nextRow+r>this.height)return ge("LineAtlas out of space"),null;let a=0;for(let o of e)a+=o;if(a!==0){let o=this.width/a,n=this.getDashRanges(e,this.width,o);t?this.addRoundDash(n,o,i):this.addRegularDash(n)}let s={y:this.nextRow+i,height:2*i,width:a};return this.nextRow+=r,this.dirty=!0,s}bind(e){let t=e.gl;this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,this.data))}};function hS(e){if(!e)return!1;let t=globalThis.location;if(!t)return!1;try{return new URL(e,t.href).origin!==t.origin}catch{return!1}}function cS(){let e=import.meta.url;if(!/^https?:/.test(e))return"";let t=e.endsWith("-dev.mjs")?"maplibre-gl-worker-dev.mjs":"maplibre-gl-worker.mjs";return new URL(`./${t}`,e).href}function Un(e,t){if(t)try{return new Worker(e,{type:"module"})}catch(i){console.warn("Module worker not supported, falling back to classic worker",i)}return new Worker(e)}async function pS(e){let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch worker script (${t.status}): ${e}`);let i=await t.text(),r=new Blob([i],{type:"text/javascript"});return URL.createObjectURL(r)}function dS(e){let t=new Blob([`import ${JSON.stringify(new URL(e,import.meta.url).href)}`],{type:"text/javascript"});return URL.createObjectURL(t)}async function fS(){let e=Bt.WORKER_URL||cS(),t=!e?.endsWith(".cjs");if(!hS(e))return Un(e,t);if(t){let r=dS(e);try{return Un(r,t)}finally{URL.revokeObjectURL(r)}}let i=await pS(e);try{return Un(i,t)}finally{URL.revokeObjectURL(i)}}const Sh="maplibre_preloaded_worker_pool";var ln=class T_{constructor(){this.active={},this.workersPromise=null}async acquire(t){if(this.active[t]=!0,!this.workersPromise){let i=[];for(;i.length<T_.workerCount;)i.push(fS());this.workersPromise=Promise.all(i)}return(await this.workersPromise).slice()}release(t){if(delete this.active[t],this.numActive()===0&&this.workersPromise){let i=this.workersPromise;this.workersPromise=null,i.then(r=>{for(let a of r)a.terminate()})}}isPreloaded(){return!!this.active[Sh]}numActive(){return Object.keys(this.active).length}};const mS=Math.floor(ft.hardwareConcurrency/2);ln.workerCount=by(globalThis)?Math.max(Math.min(mS,3),1):1;let Io;function Ph(){return Io||=new ln,Io}function vz(){Ph().acquire(Sh)}function xz(){let e=Io;e&&(e.isPreloaded()&&e.numActive()===1?(e.release(Sh),Io=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))}var S_=class{constructor(e,t){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=t,this.removed=!1,this.actorsPromise=this.initActors(t)}async initActors(e){let t=await this.workerPool.acquire(e);if(this.removed)return[];if(this.actors=t.map((i,r)=>{let a=new aw(i,e);return a.name=`Worker ${r}`,a}),!this.actors.length)throw Error("No actors found");return this.actors}async broadcast(e,t){let i=await this.actorsPromise;return Promise.all(i.map(r=>r.sendAsync({type:e,data:t})))}async getActor(){let e=await this.actorsPromise;return this.currentActor=(this.currentActor+1)%e.length,e[this.currentActor]}async waitForInitComplete(){this.actors.length===0&&await this.actorsPromise}getReadyActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.removed=!0;for(let t of this.actors)t.remove();this.actors=[],e&&this.workerPool.release(this.id)}async registerMessageHandler(e,t){let i=await this.actorsPromise;for(let r of i)r.registerMessageHandler(e,t)}async unregisterMessageHandler(e){let t=await this.actorsPromise;for(let i of t)i.unregisterMessageHandler(e)}};let Os;function P_(){return Os||(Os=new S_(Ph(),pl),Os.registerMessageHandler("GR",(e,t,i)=>ko(t,i))),Os}function _S(e,t){let i=Wi();return Fe(i,i,[1,1,0]),tt(i,i,[e.width*.5,e.height*.5,1]),e.calculatePosMatrix?Mr(i,i,e.calculatePosMatrix(t.toUnwrapped())):i}function gS(e,t,i){if(e)for(let r of e){let a=t[r];if(a?.source===i&&a.type==="fill-extrusion")return!0}else for(let r in t){let a=t[r];if(a.source===i&&a.type==="fill-extrusion")return!0}return!1}function yS(e,t,i,r,a,s,o){let n=gS(a?.layers??null,t,e.id),l=s.maxPitchScaleFactor(),u=e.tilesIn(r,l,n);u.sort(I_);let h=[];for(let c of u)h.push({wrappedTileID:c.tileID.wrapped().key,queryResults:c.tile.queryRenderedFeatures(t,i,e.getState(),c.queryGeometry,c.cameraQueryGeometry,c.scale,a,s,l,_S(s,c.tileID),o?(p,d)=>o(c.tileID,p,d):void 0)});return wS(bS(h),e)}function vS(e,t,i,r,a,s,o){let n={},l=s.queryRenderedSymbols(r),u=[];for(let h of Object.keys(l).map(Number))u.push(o[h]);u.sort(I_);for(let h of u){let c=h.featureIndex.lookupSymbolFeatures(l[h.bucketInstanceId],t,h.bucketIndex,h.sourceLayerIndex,{filterSpec:a.filter,globalState:a.globalState},a.layers,a.availableImages,e);for(let p in c){n[p]||=[];let d=c[p];d.sort((f,m)=>{let _=h.featureSortOrder;if(_){let g=_.indexOf(f.featureIndex);return _.indexOf(m.featureIndex)-g}else return m.featureIndex-f.featureIndex});for(let f of d)n[p].push(f)}}return TS(n,e,i)}function xS(e,t){let i=e.getRenderableIds().map(s=>e.getTileByID(s)),r=[],a={};for(let s of i){let o=s.tileID.canonical.key;a[o]||(a[o]=!0,s.querySourceFeatures(r,t))}return r}function I_(e,t){let i=e.tileID,r=t.tileID;return i.overscaledZ-r.overscaledZ||i.canonical.y-r.canonical.y||i.wrap-r.wrap||i.canonical.x-r.canonical.x}function bS(e){let t={},i={};for(let{queryResults:r,wrappedTileID:a}of e){i[a]||={};let s=i[a];for(let o in r){let n=r[o];s[o]||={};let l=s[o];t[o]||=[];for(let u of n)l[u.featureIndex]||(l[u.featureIndex]=!0,t[o].push(u))}}return t}function wS(e,t){for(let i in e)for(let r of e[i])E_(r,t);return e}function TS(e,t,i){for(let r in e)for(let a of e[r]){let s=i[t[r].source];E_(a,s)}return e}function E_(e,t){let i=e.feature,r=t.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=r}async function M_(e,t,i,r){let a=e;if(e.url?a=(await Lo(await t.transformRequest(e.url,"Source"),i)).data:await ft.frameAsync(i,r),!a)return null;let s=as(j(a,e),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in a&&a.vector_layers&&(s.vectorLayerIds=a.vector_layers.map(o=>o.id)),s}var ni=class di{constructor(t,i){t&&(i?this.setSouthWest(t).setNorthEast(i):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof W?new W(t.lng,t.lat):W.convert(t),this}setSouthWest(t){return this._sw=t instanceof W?new W(t.lng,t.lat):W.convert(t),this}extend(t){let i=this._sw,r=this._ne,a,s;if(t instanceof W)a=t,s=t;else if(t instanceof di){if(a=t._sw,s=t._ne,!a||!s)return this}else{if(Array.isArray(t))if(t.length===4||t.every(Array.isArray)){let o=t;return this.extend(di.convert(o))}else{let o=t;return this.extend(W.convert(o))}else if(t&&("lng"in t||"lon"in t)&&"lat"in t)return this.extend(W.convert(t));return this}return!i&&!r?(this._sw=new W(a.lng,a.lat),this._ne=new W(s.lng,s.lat)):(i.lng=Math.min(a.lng,i.lng),i.lat=Math.min(a.lat,i.lat),r.lng=Math.max(s.lng,r.lng),r.lat=Math.max(s.lat,r.lat)),this}getCenter(){return new W((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new W(this.getWest(),this.getNorth())}getSouthEast(){return new W(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){let{lng:i,lat:r}=W.convert(t),a=this._sw.lat<=r&&r<=this._ne.lat,s=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(s=this._sw.lng>=i&&i>=this._ne.lng),a&&s}intersects(t){if(t=di.convert(t),!(t.getNorth()>=this.getSouth()&&t.getSouth()<=this.getNorth()))return!1;let i=Math.abs(this.getEast()-this.getWest()),r=Math.abs(t.getEast()-t.getWest());if(i>=360||r>=360)return!0;let a=Zt(this.getWest(),-180,180),s=Zt(this.getEast(),-180,180),o=Zt(t.getWest(),-180,180),n=Zt(t.getEast(),-180,180),l=a>s,u=o>n;return l&&u?!0:l?n>=a||o<=s:u?s>=o||a<=n:o<=s&&n>=a}static convert(t){return t instanceof di||!t?t:new di(t)}static fromLngLat(t,i=0){let r=360*i/40075017,a=r/Math.cos(Math.PI/180*t.lat);return new di(new W(t.lng-a,t.lat-r),new W(t.lng+a,t.lat+r))}adjustAntiMeridian(){let t=new W(this._sw.lng,this._sw.lat),i=new W(this._ne.lng,this._ne.lat);return t.lng>i.lng?new di(t,new W(i.lng+360,i.lat)):new di(t,i)}},A_=class{constructor(e,t,i){this.bounds=ni.convert(this.validateBounds(e)),this.minzoom=t||0,this.maxzoom=i||24}validateBounds(e){return!Array.isArray(e)||e.length!==4?[-180,-90,180,90]:[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]}contains(e){let t=2**e.z,i={minX:Math.floor(Kr(this.bounds.getWest())*t),minY:Math.floor(Jr(this.bounds.getNorth())*t),maxX:Math.ceil(Kr(this.bounds.getEast())*t),maxY:Math.ceil(Jr(this.bounds.getSouth())*t)};return e.x>=i.minX&&e.x<i.maxX&&e.y>=i.minY&&e.y<i.maxY}},SS=class extends Ze{constructor(e,t,i,r){if(super(),this.id=e,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,j(this,as(t,["url","scheme","tileSize","promoteId","encoding"])),this._options=j({type:"vector"},t),this._collectResourceTiming=t.collectResourceTiming,this.tileSize!==512)throw Error("vector tile sources must have a tileSize of 512");this.setEventedParent(r)}async load(e=!1){this._loaded=!1,this.fire(new be("dataloading")),this._tileJSONRequest=new AbortController;try{let t=await M_(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,t&&(j(this,t),t.bounds&&(this.tileBounds=new A_(t.bounds,this.minzoom,this.maxzoom)),this.fire(new be("data",{sourceDataType:"metadata"})),this.fire(new be("data",{sourceDataType:"content",sourceDataChanged:e})))}catch(t){this._tileJSONRequest=null,this._loaded=!0,Ui(t)||this.fire(new G(ht(t)))}}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.abort(),e(),this.load(!0)}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&=(this._tileJSONRequest.abort(),null)}serialize(){return j({},this._options)}async loadTile(e){let t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i={request:await this.map._requestManager.transformRequest(t,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:await this._getOverzoomParameters(e),etag:e.etag};i.request.collectResourceTiming=this._collectResourceTiming,await this.dispatcher.waitForInitComplete();let r="RT";if(!e.actor||e.state==="expired")e.actor=this.dispatcher.getReadyActor(),r="LT";else if(e.state==="loading")return new Promise((a,s)=>{e.reloadPromise={resolve:a,reject:s}});e.abortController=new AbortController;try{let a=await e.actor.sendAsync({type:r,data:i},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,a);let s={};return a?.etagUnmodified&&(s.unmodified=!0),s}catch(a){if(delete e.abortController,e.aborted||Ui(a))return;if(a&&a.status!==404)throw a;this._afterTileLoadWorkerResponse(e,null)}}async _getOverzoomParameters(e){if(e.tileID.canonical.z<=this.maxzoom||this.map._zoomLevelsToOverscale===void 0)return;let t=e.tileID.scaledTo(this.maxzoom).canonical,i=t.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:t,overzoomRequest:await this.map._requestManager.transformRequest(i,"Tile")}}_afterTileLoadWorkerResponse(e,t){if(t?.resourceTiming&&(e.resourceTiming=t.resourceTiming),t&&this.map._refreshExpiredTiles&&e.setExpiryData(t),e.etag=t?.etag,e.loadVectorData(t,this.map.painter),e.reloadPromise){let i=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(i.resolve).catch(i.reject)}}async abortTile(e){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&await e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.t
2ype,source:this.id}})}async unloadTile(e){e.unloadVectorData(),e.actor&&await e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})}hasTransition(){return!1}},C_=class extends Ze{constructor(e,t,i,r){super(),this.id=e,this.dispatcher=i,this.setEventedParent(r),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._premultiplyAlpha=!0,this._options=j({type:"raster"},t),j(this,as(t,["url","scheme","tileSize"]))}async load(e=!1){this._loaded=!1,this.fire(new be("dataloading")),this._tileJSONRequest=new AbortController;try{let t=await M_(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,t&&(j(this,t),t.bounds&&(this.tileBounds=new A_(t.bounds,this.minzoom,this.maxzoom)),this.fire(new be("data",{sourceDataType:"metadata"})),this.fire(new be("data",{sourceDataType:"content",sourceDataChanged:e})))}catch(t){this._tileJSONRequest=null,this._loaded=!0,Ui(t)||this.fire(new G(ht(t)))}}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&=(this._tileJSONRequest.abort(),null)}setSourceProperty(e){this._tileJSONRequest&&=(this._tileJSONRequest.abort(),null),e(),this.load(!0)}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}serialize(){return j({},this._options)}setPremultiplyAlpha(e){return this._premultiplyAlpha===e||this.setSourceProperty(()=>{this._premultiplyAlpha=e}),this}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}async loadTile(e){let t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i=this._premultiplyAlpha,r=i?void 0:{premultiplyAlpha:"none"},a=await this.map._requestManager.transformRequest(t,"Tile");e.abortController=new AbortController;try{let s=await Ti.getImage(a,e.abortController,this.map._refreshExpiredTiles,r);if(delete e.abortController,e.aborted){e.state="unloaded";return}if(s?.data){this.map._refreshExpiredTiles&&(s.cacheControl||s.expires)&&e.setExpiryData({cacheControl:s.cacheControl,expires:s.expires});let o=this.map.painter.context,n=o.gl,l=s.data;e.texture=this.map.painter.getTileTexture(l.width),e.texture?e.texture.update(l,{useMipmap:!0,premultiply:i}):(e.texture=new ke(o,l,n.RGBA,{useMipmap:!0,premultiply:i}),e.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(s){if(delete e.abortController,e.aborted)e.state="unloaded";else if(s)throw e.state="errored",s}}async abortTile(e){e.abortController&&(e.abortController.abort(),delete e.abortController)}async unloadTile(e){e.texture&&this.map.painter.saveTileTexture(e.texture)}hasTransition(){return!1}},PS=class extends C_{constructor(e,t,i,r){super(e,t,i,r),this.type="raster-dem",this.maxzoom=22,this._options=j({type:"raster-dem"},t),this.encoding=t.encoding||"mapbox",this.redFactor=t.redFactor,this.greenFactor=t.greenFactor,this.blueFactor=t.blueFactor,this.baseShift=t.baseShift}async loadTile(e){let t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i=await this.map._requestManager.transformRequest(t,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{let r=await Ti.getImage(i,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted){e.state="unloaded";return}if(r?.data){let a=r.data;this.map._refreshExpiredTiles&&(r.cacheControl||r.expires)&&e.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});let s=ar(a)&&gd()?a:await this.readImageNow(a),o={type:this.type,uid:e.uid,source:this.id,rawImageData:s,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(e.actor&&e.state!=="expired"&&e.state!=="reloading")return;await this.dispatcher.waitForInitComplete(),(!e.actor||e.state==="expired")&&(e.actor=this.dispatcher.getReadyActor()),e.dem=await e.actor.sendAsync({type:"LDT",data:o}),e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}catch(r){if(delete e.abortController,e.aborted)e.state="unloaded";else if(r)throw e.state="errored",r}}
vendor: 11,484 bytes, line 2
2async readImageNow(e){if(typeof VideoFrame<"u"&&Og()){let t=e.width+2,i=e.height+2;try{return new xe({width:t,height:i},await Py(e,-1,-1,t,i))}catch{}}return ft.getImageData(e,1)}_getNeighboringTiles(e){let t=e.canonical,i=2**t.z,r=(t.x-1+i)%i,a=t.x===0?e.wrap-1:e.wrap,s=(t.x+1+i)%i,o=t.x+1===i?e.wrap+1:e.wrap,n={};return n[new et(e.overscaledZ,a,t.z,r,t.y).key]={backfilled:!1},n[new et(e.overscaledZ,o,t.z,s,t.y).key]={backfilled:!1},t.y>0&&(n[new et(e.overscaledZ,a,t.z,r,t.y-1).key]={backfilled:!1},n[new et(e.overscaledZ,e.wrap,t.z,t.x,t.y-1).key]={backfilled:!1},n[new et(e.overscaledZ,o,t.z,s,t.y-1).key]={backfilled:!1}),t.y+1<i&&(n[new et(e.overscaledZ,a,t.z,r,t.y+1).key]={backfilled:!1},n[new et(e.overscaledZ,e.wrap,t.z,t.x,t.y+1).key]={backfilled:!1},n[new et(e.overscaledZ,o,t.z,s,t.y+1).key]={backfilled:!1}),n}async unloadTile(e){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&await e.actor.sendAsync({type:"RDT",data:{type:this.type,uid:e.uid,source:this.id}})}};function _u(e,t){return t?e.properties[t]:e.id}function IS(e,t){let i=new Map;if(e==null||e.type==null)return i;if(e.type==="Feature"){let r=_u(e,t);return r==null?void 0:(i.set(r,e),i)}if(e.type==="FeatureCollection"){let r=new Set;for(let a of e.features){let s=_u(a,t);if(s==null||r.has(s))return;r.add(s),i.set(s,a)}return i}}function ES(e,t,i){let r=[];if(t.removeAll)e.clear();else if(t.remove)for(let a of t.remove){let s=e.get(a);s&&(r.push(s.geometry),e.delete(a))}if(t.add)for(let a of t.add){let s=_u(a,i);if(s==null)continue;let o=e.get(s);o&&r.push(o.geometry),r.push(a.geometry),e.set(s,a)}if(t.update)for(let a of t.update){let s=e.get(a.id);if(!s)continue;let o=!!a.newGeometry,n=a.removeAllProperties||a.removeProperties?.length>0||a.addOrUpdateProperties?.length>0;if(!o&&!n)continue;r.push(s.geometry);let l={...s};if(e.set(a.id,l),o&&(r.push(a.newGeometry),l.geometry=a.newGeometry),n){if(a.removeAllProperties?l.properties={}:l.properties={...l.properties||{}},a.removeProperties)for(let u of a.removeProperties)delete l.properties[u];if(a.addOrUpdateProperties)for(let{key:u,value:h}of a.addOrUpdateProperties)l.properties[u]=h}}return r}function MS(e,t,i){if(!e)return t||{};if(!t)return e||{};let r=vp(e),a=vp(t);AS(r,a);let s={};if((r.removeAll||a.removeAll)&&(s.removeAll=!0),s.remove=new Set([...r.remove,...a.remove]),s.add=new Map([...r.add,...a.add]),s.update=new Map([...r.update,...a.update]),s.remove.size&&s.add.size)for(let n of s.add.keys())s.remove.delete(n);return DS(s)}function AS(e,t){t.removeAll&&(e.add.clear(),e.update.clear(),e.remove.clear(),t.remove.clear());for(let i of t.remove)e.add.delete(i),e.update.delete(i);for(let[i,r]of t.update){let a=e.update.get(i);a&&(t.update.set(i,CS(a,r)),e.update.delete(i))}}function CS(e,t){let i={id:e.id};if(t.removeAllProperties&&(delete e.removeProperties,delete e.addOrUpdateProperties,delete t.removeProperties),t.removeProperties)for(let r of t.removeProperties){let a=e.addOrUpdateProperties.findIndex(s=>s.key===r);a>-1&&e.addOrUpdateProperties.splice(a,1)}return(e.removeAllProperties||t.removeAllProperties)&&(i.removeAllProperties=!0),(e.removeProperties||t.removeProperties)&&(i.removeProperties=[...e.removeProperties||[],...t.removeProperties||[]]),(e.addOrUpdateProperties||t.addOrUpdateProperties)&&(i.addOrUpdateProperties=[...e.addOrUpdateProperties||[],...t.addOrUpdateProperties||[]]),(e.newGeometry||t.newGeometry)&&(i.newGeometry=t.newGeometry||e.newGeometry),i}function vp(e){if(!e)return{};let t={};return t.removeAll=e.removeAll,t.remove=new Set(e.remove||[]),t.add=new Map(e.add?.map(i=>[i.id,i])),t.update=new Map(e.update?.map(i=>[i.id,i])),t}function DS(e){let t={};return e.removeAll&&(t.removeAll=e.removeAll),e.remove&&(t.remove=Array.from(e.remove)),e.add&&(t.add=Array.from(e.add.values())),e.update&&(t.update=Array.from(e.update.values())),t}function D_(e){return!e||e.length===0?[]:typeof e[0]=="number"?[e]:e.flatMap(t=>D_(t))}function ao(e){return e.type==="GeometryCollection"?e.geometries.flatMap(t=>ao(t)):D_(e.coordinates)}function xp(e){let t=new ni,i;switch(e.type){case"FeatureCollection":i=e.features.flatMap(r=>ao(r.geometry));break;case"Feature":i=ao(e.geometry);break;default:i=ao(e);break}if(i.length===0)return t;for(let r of i){let[a,s]=r;t.extend([a,s])}return t}function zS({x:e,y:t,z:i},r=0){let a=lu((e-r)/2**i),s=es((t+1+r)/2**i),o=lu((e+1+r)/2**i),n=es((t-r)/2**i);return new ni([a,s],[o,n])}var RS=class extends Ze{constructor(e,t,i,r){super(),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._isUpdatingWorker=!1,this._pendingWorkerUpdate={data:t.data},this.actorPromise=i.getActor(),this.setEventedParent(r),this._data=typeof t.data=="string"?{url:t.data}:{geojson:t.data},this._options=j({},t),this._collectResourceTiming=t.collectResourceTiming,t.maxzoom!==void 0&&(this.maxzoom=t.maxzoom),t.type&&(this.type=t.type),t.attribution&&(this.attribution=t.attribution),this.promoteId=t.promoteId,t.clusterMaxZoom!==void 0&&this.maxzoom<=t.clusterMaxZoom&&ge(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${t.clusterMaxZoom}".`),this.workerOptions=j({source:this.id,geojsonVtOptions:{buffer:this._pixelsToTileUnits(t.buffer===void 0?128:t.buffer),tolerance:this._pixelsToTileUnits(t.tolerance===void 0?.375:t.tolerance),extent:C,maxZoom:this.maxzoom,lineMetrics:t.lineMetrics||!1,generateId:t.generateId||!1,promoteId:typeof t.promoteId=="string"?t.promoteId:void 0,cluster:t.cluster||!1,clusterOptions:{maxZoom:this._getClusterMaxZoom(t.clusterMaxZoom),minPoints:Math.max(2,t.clusterMinPoints||2),extent:C,radius:this._pixelsToTileUnits(t.clusterRadius||50),log:!1,generateId:t.generateId||!1}},clusterProperties:t.clusterProperties,filter:t.filter},t.workerOptions)}_hasPendingWorkerUpdate(){return this._pendingWorkerUpdate.data!==void 0||this._pendingWorkerUpdate.diff!==void 0||this._pendingWorkerUpdate.updateCluster}_pixelsToTileUnits(e){return e*(C/this.tileSize)}_tileUnitsToPixels(e){return e/(C/this.tileSize)}_getClusterMaxZoom(e){let t=e?Math.round(e):this.maxzoom-1;return Number.isInteger(e)||e===void 0||ge(`Integer expected for option 'clusterMaxZoom': provided value "${e}" rounded to "${t}"`),t}async load(){await this._updateWorkerData()}onAdd(e){this.map=e,this.load()}setData(e){return this._data=typeof e=="string"?{url:e}:{geojson:e},this._pendingWorkerUpdate={data:e},this._updateWorkerData()}updateData(e){return this._pendingWorkerUpdate.diff=MS(this._pendingWorkerUpdate.diff,e),this._updateWorkerData()}async getData(){return this._data.url&&await this.once("data"),this._data.geojson?this._data.geojson:{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}}async getBounds(){return xp(await this.getData())}setClusterOptions(e){return this.workerOptions.geojsonVtOptions.cluster=e.cluster,e.clusterRadius!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.radius=this._pixelsToTileUnits(e.clusterRadius)),e.clusterMaxZoom!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.maxZoom=this._getClusterMaxZoom(e.clusterMaxZoom)),this._pendingWorkerUpdate.updateCluster=!0,this._updateWorkerData()}getClusterOptions(){let{cluster:e,clusterOptions:t}=this.workerOptions.geojsonVtOptions;return{cluster:e,clusterMaxZoom:t.maxZoom,clusterRadius:this._tileUnitsToPixels(t.radius)}}async getClusterExpansionZoom(e){return(await this.actorPromise).sendAsync({type:"GCEZ",data:{type:this.type,clusterId:e,source:this.id}})}async getClusterChildren(e){return(await this.actorPromise).sendAsync({type:"GCC",data:{type:this.type,clusterId:e,source:this.id}})}async getClusterLeaves(e,t,i){return(await this.actorPromise).sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:e,limit:t,offset:i}})}async _updateWorkerData(){if(this._isUpdatingWorker)return this._updatePromise;if(!this._hasPendingWorkerUpdate()){ge(`No pending worker updates for GeoJSONSource ${this.id}.`);return}let{data:e,diff:t,updateCluster:i}=this._pendingWorkerUpdate,r=this._getLoadGeoJSONParameters(e,t,i);e===void 0?t?this._pendingWorkerUpdate.diff=void 0:i&&(this._pendingWorkerUpdate.updateCluster=void 0):this._pendingWorkerUpdate.data=void 0,this._updatePromise=this._dispatchWorkerUpdate(r),await this._updatePromise}async _getLoadGeoJSONParameters(e,t,i){let r=j({type:this.type,source:this.id},this.workerOptions);if(typeof e=="string")return r.request=await this.map._requestManager.transformRequest(ft.resolveURL(e),"Source"),r.request.collectResourceTiming=this._collectResourceTiming,r;if(e!==void 0)return r.data=e,r;if(t)return r.dataDiff=t,r;if(i)return r.updateCluster=!0,r}async _dispatchWorkerUpdate(e){this._isUpdatingWorker=!0,this.fire(new be("dataloading"));try{let t=await e,i=await(await this.actorPromise).sendAsync({type:"LD",data:t});if(this._isUpdatingWorker=!1,this._removed||i.abandoned){this.fire(new be("dataabort"));return}i.data&&(this._data={geojson:i.data});let r=this._applyDiffToSource(t.dataDiff),a=this._getShouldReloadTileOptions(r),s={};this._applyResourceTiming(s,i),this.fire(new be("data",{...s,sourceDataType:"metadata"})),this.fire(new be("data",{...s,sourceDataType:"content",shouldReloadTileOptions:a}))}catch(t){if(this._isUpdatingWorker=!1,this._removed){this.fire(new be("dataabort"));return}this.fire(new G(ht(t)))}finally{this._hasPendingWorkerUpdate()&&await this._updateWorkerData()}}_applyResourceTiming(e,t){if(!this._collectResourceTiming)return;let i=t.resourceTiming?.[this.id];if(!i)return;let r=i.slice(0);r?.length&&j(e,{resourceTiming:r})}_applyDiffToSource(e){if(!e)return;let t=typeof this.promoteId=="string"?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){let r=IS(this._data.geojson,t);if(!r)throw Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:r}}if(!this._data.updateable)return;let i=ES(this._data.updateable,e,t);if(!(e.removeAll||this._options.cluster))return i}_getShouldReloadTileOptions(e){if(e)return{affectedBounds:e.filter(Boolean).map(t=>xp(t))}}shouldReloadTile(e,{affectedBounds:t}){if(e.state==="loading")return!0;if(e.state==="unloaded")return!1;let{buffer:i,extent:r}=this.workerOptions.geojsonVtOptions,a=zS(e.tileID.canonical,i/r);for(let s of t)if(a.intersects(s))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}async loadTile(e){let t=e.actor?"RT":"LT";e.actor=await this.actorPromise;let i={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};e.abortController=new AbortController;try{let r=await(await this.actorPromise).sendAsync({type:t,data:i},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(r,this.map.painter,t==="RT")}catch(r){if(delete e.abortController,e.aborted||Ui(r))return;throw r}}async abortTile(e){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0}async unloadTile(e){e.unloadVectorData(),await(await this.actorPromise).sendAsync({type:"RMT",data:{uid:e.uid,type:this.t
2ype,source:this.id}})}onRemove(){this._removed=!0,this.actorPromise.then(e=>e.sendAsync({type:"RS",data:{type:this.type,source:this.id}}))}serialize(){return j({},this._options,{type:this.type,data:this._data.updateable?{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}:this._data.url||this._data.geojson})}hasTransition(){return!1}},gs=class extends Ze{constructor(e,t,i,r){super(),this.flippedWindingOrder=!1,this.id=e,this.dispatcher=i,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(r),this.options=t}async load(e){this._loaded=!1,this.fire(new be("dataloading")),this.url=this.options.url;let t=await this.map._requestManager.transformRequest(this.url,"Image");this._request=new AbortController;try{let i=await Ti.getImage(t,this._request);this._request=null,this._loaded=!0,i?.data&&(this.image=i.data,e&&(this.coordinates=e),this._finishLoading())}catch(i){this._request=null,this._loaded=!0,Ui(i)||this.fire(new G(ht(i)))}}loaded(){return this._loaded}updateImage(e){return this._request&&=(this._request.abort(),null),"image"in e?(this._loaded=!0,this.image=e.image,e.coordinates&&(this.coordinates=e.coordinates),this.texture=null,this._finishLoading(),this):e.url?(this.options.url=e.url,this.load(e.coordinates).finally(()=>this.texture=null),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new be("data",{sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&=(this._request.abort(),null)}setCoordinates(e){this.coordinates=e;let t=e.map(ye.fromLngLat);return this.tileID=kS(t),this.terrainTileRanges=this._getOverlappingTileRanges(t),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=t.map(i=>this.tileID.getTilePoint(i)._round()),this.flippedWindingOrder=LS(this.tileCoords),this.fire(new be("data",{sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let e=this.map.painter.context,t=e.gl;this.texture||(this.texture=new ke(e,this.image,t.RGBA),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE));let i=!1;for(let r in this.tiles){let a=this.tiles[r];a.state!=="loaded"&&(a.state="loaded",a.texture=this.texture,i=!0)}i&&this.fire(new be("data",{sourceDataType:"idle",sourceId:this.id}))}async loadTile(e){this.tileID?.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(e){let{minX:t,minY:i,maxX:r,maxY:a}=ai.fromPoints(e),s={};for(let o=0;o<=25;o++){let n=2**o,l=Math.floor(t*n),u=Math.floor(i*n),h=Math.floor(r*n),c=Math.floor(a*n),p=(l%n+n)%n,d=h%n;s[o]={minWrap:Math.floor(l/n),maxWrap:Math.floor(h/n),minTileXWrapped:p,maxTileXWrapped:d,minTileY:u,maxTileY:c}}return s}};function kS(e){let t=ai.fromPoints(e),i=t.width(),r=t.height(),a=Math.max(0,Math.floor(-Math.log(Math.max(i,r))/Math.LN2)),s=2**a;return new an(a,Math.floor((t.minX+t.maxX)/2*s),Math.floor((t.minY+t.maxY)/2*s))}function LS(e){let t=e[1].x-e[0].x,i=e[1].y-e[0].y,r=e[2].x-e[0].x;return t*(e[2].y-e[0].y)-i*r<0}var FS=class extends gs{constructor(e,t,i,r){super(e,t,i,r),this._onPlayingHandler=()=>{this.map?.triggerRepaint()},this.roundZoom=!0,this.type="video",this.options=t}async load(){this._loaded=!1;let e=this.options;this.urls=[];for(let t of e.urls)this.urls.push((await this.map._requestManager.transformRequest(t,"Source")).url);try{let t=await ky(this.urls);if(this._loaded=!0,!t)return;this.video=t,this.video.loop=!0,this.video.addEventListener("playing",this._onPlayingHandler),this.map&&this.video.play(),this._finishLoading()}catch(t){this.fire(new G(ht(t)))}}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){let t=this.video.seekable;e<t.start(0)||e>t.end(0)?this.fire(new G(new R(`sources.${this.id}`,null,`Playback for this video can be set only between the ${t.start(0)} and ${t.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}
vendor: 4,705 bytes, line 2
2onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}onRemove(){super.onRemove(),this.video&&(this.video.removeEventListener("playing",this._onPlayingHandler),this.video.pause())}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let e=this.map.painter.context,t=e.gl;this.texture?this.video.paused||(this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this.texture=new ke(e,this.video,t.RGBA),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE));let i=!1;for(let r in this.tiles){let a=this.tiles[r];a.state!=="loaded"&&(a.state="loaded",a.texture=this.texture,i=!0)}i&&this.fire(new be("data",{sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},BS=class extends gs{constructor(e,t,i,r){super(e,t,i,r),t.coordinates?(!Array.isArray(t.coordinates)||t.coordinates.length!==4||t.coordinates.some(a=>!Array.isArray(a)||a.length!==2||a.some(s=>typeof s!="number")))&&this.fire(new G(new R(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new G(new R(`sources.${e}`,null,'missing required property "coordinates"'))),t.animate&&typeof t.animate!="boolean"&&this.fire(new G(new R(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),t.canvas?typeof t.canvas!="string"&&!(t.canvas instanceof HTMLCanvasElement)&&this.fire(new G(new R(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new G(new R(`sources.${e}`,null,'missing required property "canvas"'))),this.options=t,this.animate=t.animate===void 0||t.animate}async load(){if(this._loaded=!0,this.canvas||=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new G(Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&=(this.prepare(),!1)},this._finishLoading()}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let t=this.map.painter.context,i=t.gl;this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new ke(t,this.canvas,i.RGBA,{premultiply:!0}),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let r=!1;for(let a in this.tiles){let s=this.tiles[a];s.state!=="loaded"&&(s.state="loaded",s.texture=this.texture,r=!0)}r&&this.fire(new be("data",{sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}};const z_={},OS=(e,t,i,r)=>{let a=new(R_(t.type))(e,t,i,r);if(a.id!==e)throw Error(`Expected Source id to be ${e} instead of ${a.id}`);return a},R_=e=>{switch(e){case"geojson":return RS;case"image":return gs;case"raster":return C_;case"raster-dem":return PS;case"vector":return SS;case"video":return FS;case"canvas":return BS}return z_[e]},$S=(e,t)=>{z_[e]=t},bz=async(e,t)=>{if(R_(e))throw Error(`A source type called "${e}" already exists.`);$S(e,t)};function VS(e,t){let i={};if(!t)return i;for(let r of e){let a=r.layerIds.map(s=>t.getLayer(s)).filter(Boolean);if(a.length!==0){r.layers=a,r.stateDependentLayerIds&&(r.stateDependentLayers=r.stateDependentLayerIds.map(s=>a.filter(o=>o.id===s)[0]));for(let s of a)i[s.id]=r}}return i}const gu="RTLPluginLoaded";var jS=class extends Ze{constructor(...e){super(...e),this.status="unavailable",this.url=null,this.dispatcher=P_()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch(t=>{throw this.status="error",t})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}async setRTLTextPlugin(e,t=!1){if(this.url)throw Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=ft.resolveURL(e),!this.url)throw Error(`requested url ${e}
2 is invalid`);if(this.status==="unavailable")if(t)this.status="deferred",this._syncState(this.status);else return this._requestImport();else if(this.status==="requested")return this._requestImport()}async _requestImport(){await this._syncState("loading"),this.status="loaded",this.fire(new Ot(gu))}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}};let bp=null;function is(){return bp||=new jS,bp}var k_=class{constructor(e,t){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=e,this.uid=Td(),this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rttObjects=[],this.rttFingerprint={},this.expiredRequestCount=0,this.state="loading",this.featureStateRevision=-1}isRenderable(e){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(e||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:e,fadingDirection:t,fadingParentID:i,fadeEndTime:r}){this.resetFadeLogic(),this.fadingRole=e,this.fadingDirection=t,this.fadingParentID=i,this.fadeEndTime=r}setSelfFadeLogic(e){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=e}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=_e(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}getRTT(e){return this.rttObjects[e]}acquireRTT(e,t,i){return this.rttObjects[t]=e.acquireRTT(i)}releaseRTT(e){if(this.rttObjects.length!==0){for(let t of this.rttObjects)t&&e.releaseRTT(t);this.rttObjects.length=0}}loadVectorData(e,t,i){if(e?.etagUnmodified===!0){this.state="loaded";return}if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!e){this.collisionBoxArray=new om;return}e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestEncoding=e.encoding,this.latestFeatureIndex.rawTileData=e.rawTileData,this.latestFeatureIndex.encoding=e.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=VS(e.buckets,t?.style),this.hasSymbolBuckets=!1;for(let r in this.buckets){let a=this.buckets[r];if(a instanceof Or)if(this.hasSymbolBuckets=!0,i)a.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let r in this.buckets){let a=this.buckets[r];if(a instanceof Or&&a.hasRTLText){this.hasRTLText=!0,is().lazyLoad();break}}this.queryPadding=0;for(let r in this.buckets){let a=this.buckets[r];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(r).queryRadius(a))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),this.dashPositions=e.dashPositions}unloadVectorData(){for(let e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.imageAtlas=null,this.dashPositions=null,this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(let i in this.buckets){let r=this.buckets[i];r.uploadPending()&&r.upload(e)}let t=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new ke(e,this.imageAtlas.image,t.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&=(this.glyphAtlasTexture=new ke(e,this.glyphAtlasImage,t.ALPHA),null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,i,r,a,s,o,n,l,u,h){return this.latestFeatureIndex?.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:a,scale:s,tileSize:this.tileSize,pixelPosMatrix:u,transform:n,params:o,queryPadding:this.queryPadding*l,getElevation:h},e,t,i):{}}querySourceFeatures(e,t){let i=this.latestFeatureIndex;if(!i?.rawTileData)return;let r=i.loadVTLayers(),a=t?.sourceLayer?t.sourceLayer:"",s=r._geojsonTileLayer||r[a];if(!s)return;let o=Ga(t?.filter,`querySourceFeatures[${a}].filter`,t?.globalState),{z:n,x:l,y:u}=this.tileID.canonical,h={z:n,x:l,y:u};for(let c=0;c<s.length;c++){let p=s.feature(c);if(o.needGeometry){let f=_r(p,!0);
2if(!o.filter(new Se(this.tileID.overscaledZ),f,this.tileID.canonical))continue}else if(!o.filter(new Se(this.tileID.overscaledZ),p))continue;let d=new Jm(p,n,l,u,i.getId(p,a));d.tile=h,e.push(d)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){let t=this.expirationTime;if(e.cacheControl){let i=xy(e.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+i["max-age"]*1e3)}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){let i=Date.now(),r=!1;if(this.expirationTime>i)r=!1;else if(!t)r=!0;else if(this.expirationTime<t)r=!0;else{let a=this.expirationTime-t;a?this.expirationTime=i+Math.max(a,3e4):r=!0}r?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),2**31-1)}setFeatureState(e,t,i){if(!this.latestFeatureIndex?.rawTileData||Object.keys(e).length===0||this.featureStateRevision===i)return;this.featureStateRevision=i;let r=this.latestFeatureIndex.loadVTLayers();for(let a in this.buckets){if(!t.style.hasLayer(a))continue;let s=this.buckets[a],o=s.layers[0].sourceLayer||"_geojsonTileLayer",n=r[o],l=e[o];if(!n||!l||l.length===0)continue;s.update(l,n,this.imageAtlas?.patternPositions||{},this.dashPositions||{});let u=t?.style?.getLayer(a);u&&(this.queryPadding=Math.max(this.queryPadding,u.queryRadius(s)))}}holdingForSymbolFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<_e()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(e){this.symbolFadeHoldUntil=_e()+e}setDependencies(e,t){let i={};for(let r of t)i[r]=!0;this.dependencies[e]=i}hasDependency(e,t){for(let i of e){let r=this.dependencies[i];if(r){for(let a of t)if(r[a])return!0}}return!1}};function wp(e){let t=[];for(let i in e)t.push({id:i,state:e[i]});return t}var NS=class{constructor(){this.state={},this.stateChanges={},this.deletedStates={},this.revision=0}updateState(e,t,i){let r=String(t);if(this.stateChanges[e]||={},this.stateChanges[e][r]||={},j(this.stateChanges[e][r],i),this.deletedStates[e]===null){this.deletedStates[e]={};for(let a in this.state[e])if(a===r){this.deletedStates[e][r]={};for(let s in this.state[e][a])i[s]===void 0&&(this.deletedStates[e][r][s]=null)}else this.deletedStates[e][a]=null}else if(this.deletedStates[e]?.[r]===null){this.deletedStates[e][r]={};for(let a in this.state[e][r])i[a]===void 0&&(this.deletedStates[e][r][a]=null)}else for(let a in i)this.deletedStates[e]?.[r]?.[a]===null&&delete this.deletedStates[e][r][a]}removeFeatureState(e,t,i){if(this.deletedStates[e]===null)return;let r=String(t);if(this.deletedStates[e]||={},i&&t!==void 0)this.deletedStates[e][r]!==null&&(this.deletedStates[e][r]||={},this.deletedStates[e][r][i]=null);else if(t!==void 0)if(this.stateChanges[e]?.[r])for(i in this.deletedStates[e][r]={},this.stateChanges[e][r])this.deletedStates[e][r][i]=null;else this.deletedStates[e][r]=null;else this.deletedStates[e]=null}getState(e,t){let i=String(t),r=this.state[e]||{},a=this.stateChanges[e]||{},s=j({},r[i],a[i]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){let o=this.deletedStates[e][t];if(o===null)return{};for(let n in o)delete s[n]}return s}initializeTileState(e,t){let i={};for(let r in this.state)i[r]=wp(this.state[r]);e.setFeatureState(i,t,this.revision)}coalesceChanges(e,t){let i={};for(let a in this.stateChanges){this.state[a]||={},i[a]||={};for(let s in this.stateChanges[a])this.state[a][s]||={},j(this.state[a][s],this.stateChanges[a][s]),i[a][s]=this.state[a][s]}for(let a in this.deletedStates)if(this.state[a]||={},i[a]||={},this.deletedStates[a]===null)for(let s in this.state[a])this.state[a][s]={},i[a][s]={};else for(let s in this.deletedStates[a]){if(this.deletedStates[a][s]===null)this.state[a][s]={};else for(let o of Object.keys(this.deletedStates[a][s]))delete this.state[a][s][o];i[a][s]=this.state[a][s]}if(this.stateChanges={},this.deletedStates={},Object.keys(i).length===0)return;this.revision++;let r={};for(let a in i)r[a]=wp(i[a]);e.setFeatureState(r,t,this.revision)}};const nr=89.25;function US(e,t,i){let r=1/(1<<i.z);return new ye(e/C*r+i.x*r,t/C*r+i.y*r)}function ti(e,t){let i=oe(t.lat,-si,si);return new E(Kr(t.lng)*e,Jr(i)*e)}function rs(e,t){return new ye(t.x/e,t.y/e).toLngLat()}function La(e){return e.cameraToCenterDistance*Math.min(Math.tan(De(90-e.pitch))*.85,Math.tan(De(nr-e.pitch)))}function Gn(e,t){let i=e.canonical,r=t/dt(i.z),a=i.x+2**i.z*e.wrap,s=new Float64Array(16);return Xt(s),Fe(s,s,[a*r,i.y*r,0]),tt(s,s,[r/C,r/C,1]),s}function L_(e,t,i,r,a){let s=ye.fromLngLat(e,t),o=a*ji(1,e.lat),{x:n,y:l,z:u}=yu(i,r),h=o*-n,c=o*-l,p=o*-u;return new ye(s.x+h,s.y+c,s.z+p)}function yu(e,t){let i=De(e),r=De(t),a=Math.cos(-i),s=Math.sin(i);
vendor: 3,475 bytes, line 2
2return{x:s*Math.sin(r),y:-s*Math.cos(r),z:a}}function GS(e,t,i){let r=t.intersectsFrustum(e);if(!i||r===0)return r;let a=t.intersectsPlane(i);return a===0?0:r===2&&a===2?2:1}function Tp(e,t,i){let r=0,a=(i-t)/10;for(let s=0;s<10;s++){let o=t+(s+.5)/10*(i-t);r+=a*Math.cos(o)**+e}return r}function vu(e,t){return function(i,r,a,s,o){let n=2*((e-1)/lt(Math.cos(De(nr-o))/Math.cos(De(nr)))-1),l=Math.acos(a/s),u=2*Tp(n-1,0,De(o/2)),h=Math.min(De(nr),l+De(o/2)),c=Math.min(h,l-De(o/2)),p=Tp(n-1,c,h),d=Math.atan(r/a),f=Math.hypot(r,a),m=i;return m+=lt(s/f/Math.max(.5,Math.cos(De(o/2)))),m+=n*lt(Math.cos(d))/2,m-=lt(Math.max(1,p/u/t))/2,m}}const ZS=vu(9.314,3);function Ih(e,t){let i=(t.roundZoom?Math.round:Math.floor)(e.zoom+lt(e.tileSize/t.tileSize));return Math.max(0,i)}function qS(e){let t=oe((15-(nr-e.pitch-e.fov/2))/15,0,1);return e.elevation+t*500}function sa(e,t){let i=e.getCameraFrustum(),r=e.getClippingPlane(),a=e.screenPointToMercatorCoordinate(e.getCameraPoint()),s=ye.fromLngLat(e.center,e.elevation);a.z=s.z+Math.cos(e.pitchInRadians)*e.cameraToCenterDistance/e.worldSize;let o=qS(e),n=e.getCoveringTilesDetailsProvider(),l=n.allowVariableZoom(e,t),u=Ih(e,t),h=t.minzoom||0,c=t.maxzoom===void 0?e.maxZoom:t.maxzoom,p=Math.min(Math.max(0,u),c),d=2**p,f=[d*a.x,d*a.y,0],m=[d*s.x,d*s.y,0],_=Math.hypot(s.x-a.x,s.y-a.y),g=Math.abs(s.z-a.z),x=Math.hypot(_,g),y=b=>({zoom:0,x:0,y:0,wrap:b,fullyVisible:!1}),v=[],w=[];if(e.renderWorldCopies&&n.allowWorldCopies())for(let b=1;b<=3;b++)v.push(y(-b)),v.push(y(b));for(v.push(y(0));v.length>0;){let b=v.pop(),T=b.x,I=b.y,M=b.fullyVisible,D={x:T,y:I,z:b.zoom},L=n.getTileBoundingVolume(D,b.wrap,o,t);if(!M){let F=GS(i,L,r);if(F===0)continue;M=F===2}let z=n.distanceToTile2d(a.x,a.y,D,L),P=u;l&&(P=(t.calculateTileZoom||ZS)(e.zoom+lt(e.tileSize/t.tileSize),z,g,x,e.fov)),P=(t.roundZoom?Math.round:Math.floor)(P),P=Math.max(0,P);let S=Math.min(P,c);if(b.wrap=n.getWrap(s,D,b.wrap),b.zoom>=S){if(b.zoom<h)continue;let F=p-b.zoom,O=f[0]-.5-(T<<F),H=f[1]-.5-(I<<F),Y=t.reparseOverscaled?Math.max(b.zoom,P):b.zoom;w.push({tileID:new et(b.zoom===c?Y:b.zoom,b.wrap,b.zoom,T,I),distanceSq:hy([m[0]-.5-T,m[1]-.5-I]),tileDistanceToCamera:Math.sqrt(O*O+H*H)});continue}for(let F=0;F<4;F++){let O=(T<<1)+F%2,H=(I<<1)+(F>>1),Y=b.zoom+1;v.push({zoom:Y,x:O,y:H,wrap:b.wrap,fullyVisible:M})}}return w.sort((b,T)=>b.distanceSq-T.distanceSq).map(b=>b.tileID)}const WS=ai.fromPoints([new E(0,0),new E(C,C)]);function Sp(e){return e==="raster"||e==="image"||e==="video"}function HS(e,t,i,r,a,s,o){let n=_e(),l=dy(t);for(let u of t){let h=e.getTileById(u.key);(h.fadingDirection===0||h.fadeOpacity===0)&&h.resetFadeLogic(),!XS(e,h,i,n,r,a,o)&&(YS(e,h,i,n,s,o)||KS(h,l,n,o)||h.resetFadeLogic())}}function XS(e,t,i,r,a,s,o){if(!t.hasData())return!1;let{tileID:n,fadingRole:l,fadingDirection:u,fadingParentID:h}=t;if(l===0&&u===1&&h)return i[h.key]=h,!0;let c=Math.max(n.overscaledZ-a,s);for(let p=n.overscaledZ-1;p>=c;p--){let d=n.scaledTo(p),f=e.getLoadedTile(d);if(f)return t.setCrossFadeLogic({fadingRole:0,fadingDirection:1,fadingParentID:f.tileID,fadeEndTime:r+o}),f.setCrossFadeLogic({fadingRole:1,fadingDirection:0,fadeEndTime:r+o}),i[d.key]=d,!0}return!1}function YS(e,t,i,r,a,s){if(!t.hasData())return!1;let o=t.tileID.children(a),n=Pp(e,t,o,i,r,a,s);if(n)return!0;for(let l of o)Pp(e,t,l.children(a),i,r,a,s)&&(n=!0);return n}function Pp(e,t,i,r,a,s,o){if(i[0].overscaledZ>=s)return!1;let n=!1;for(let l of i){let u=e.getLoadedTile(l);
vendor: 51,520 bytes, line 2
2if(!u)continue;let{fadingRole:h,fadingDirection:c,fadingParentID:p}=u;(h!==0||c!==0||!p)&&(u.setCrossFadeLogic({fadingRole:0,fadingDirection:0,fadingParentID:t.tileID,fadeEndTime:a+o}),t.setCrossFadeLogic({fadingRole:1,fadingDirection:1,fadeEndTime:a+o})),r[l.key]=l,n=!0}return n}function KS(e,t,i,r){let a=e.tileID;if(e.selfFading)return!0;if(e.hasData())return!1;if(t.has(a)){let s=i+r;return e.setSelfFadeLogic(s),!0}return!1}function JS(e,t){if(t<=0)return!1;let i=_e();for(let r of e.getAllTiles())if(r.fadeEndTime>=i)return!0;return!1}function QS(e,t){let i=t.getRenderableIds();for(let r of i){if(!e.neighboringTiles?.[r])continue;let a=t.getTileById(r);e.neighboringTiles[r].backfilled||Ip(e,a),!a.neighboringTiles?.[e.tileID.key]?.backfilled&&Ip(a,e)}}function Ip(e,t){e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0;let i=t.tileID.canonical.x-e.tileID.canonical.x,r=t.tileID.canonical.y-e.tileID.canonical.y,a=2**e.tileID.canonical.z,s=t.tileID.key;(i!==0||r!==0)&&(Math.abs(r)>1||(Math.abs(i)>1&&(Math.abs(i+a)===1?i+=a:Math.abs(i-a)===1&&(i-=a)),!(!t.dem||!e.dem)&&(e.dem.backfillBorder(t.dem,i,r),e.neighboringTiles?.[s]&&(e.neighboringTiles[s].backfilled=!0))))}var Ep=class{constructor(){this._tiles={}}handleWrapJump(e){let t={};for(let i in this._tiles){let r=this._tiles[i];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+e),t[r.tileID.key]=r}this._tiles=t}setFeatureState(e,t,i){for(let r in this._tiles)this._tiles[r].setFeatureState(e,t,i)}getAllTiles(){return Object.values(this._tiles)}getAllIds(e=!1){return e?Object.values(this._tiles).map(t=>t.tileID).sort(ep).map(t=>t.key):Object.keys(this._tiles)}getTileById(e){return this._tiles[e]}setTile(e,t){this._tiles[e]=t}deleteTileById(e){delete this._tiles[e]}getLoadedTile(e){let t=this.getTileById(e.key);return t?.hasData()?t:null}isIdRenderable(e,t=!1){return this.getTileById(e)?.isRenderable(t)}getRenderableIds(e=0,t){let i=[];for(let r of this.getAllIds())this.isIdRenderable(r,t)&&i.push(this.getTileById(r));return t?i.sort((r,a)=>{let s=r.tileID,o=a.tileID,n=new E(s.canonical.x,s.canonical.y)._rotate(-e),l=new E(o.canonical.x,o.canonical.y)._rotate(-e);return s.overscaledZ-o.overscaledZ||l.y-n.y||l.x-n.x}).map(r=>r.tileID.key):i.map(r=>r.tileID).sort(ep).map(r=>r.key)}},bi,xu=(bi=class extends Ze{constructor(t,i,r){super(),this.id=t,this.dispatcher=r,this.on("data",a=>{this._dataHandler(a)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=OS(t,i,r,this),this._inViewTiles=new Ep,this._outOfViewCache=new $T(0,a=>this._unloadTile(a)),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new NS,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source?.onAdd&&this._source.onAdd(t)}onRemove(t){for(let i of this._inViewTiles.getAllTiles())i.unloadVectorData();this.clearTiles(),this._source?.onRemove&&this._source.onRemove(t),this._inViewTiles=new Ep}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if((this.used!==void 0||this.usedForTerrain!==void 0)&&!this.used&&!this.usedForTerrain)return!0;if(!this._updated)return!1;for(let t of this._inViewTiles.getAllTiles())if(t.state!=="loaded"&&t.state!=="errored")return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;let t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}async _loadTile(t,i,r){try{let a=await this._source.loadTile(t);this._tileLoaded(t,i,r,a)}catch(a){t.state="errored",a.status===404?this.update(this.transform,this.terrain):this._source.fire(new G(ht(a),{tile:t}))}}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new be("dataabort",{tile:t,coord:t.tileID}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.map?this.map.painter:null);for(let i of this._inViewTiles.getAllTiles())i.upload(t),i.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(t){return this._inViewTiles.getRenderableIds(this.transform?.bearingInRadians,t)}hasRenderableParent(t){let i=t.overscaledZ-1;if(i>=this._source.minzoom){let r=this.getLoadedTile(t.scaledTo(i));if(r)return this._inViewTiles.isIdRenderable(r.tileID.key)}return!1}reload(t,i=void 0){if(this._paused){this._shouldReloadOnResume=!0;return}this._outOfViewCache.reset();for(let r of this._inViewTiles.getAllIds()){let a=this._inViewTiles.getTileById(r);i&&!this._source.shouldReloadTile(a,i)||(t?this._reloadTile(r,a.state==="errored"?"loading":"expired"):a.state!=="errored"&&this._reloadTile(r,"reloading"))}}async _reloadTile(t,i){let r=this._inViewTiles.getTileById(t);r&&(r.state!=="loading"&&(r.state=i),await this._loadTile(r,t,i))}_tileLoaded(t,i,r,a){t.timeAdded=_e(),t.selfFading&&(t.fadeEndTime=t.timeAdded+this._rasterFadeDuration),r==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(i,t),!a?.unmodified&&(this.getSource().type==="raster-dem"&&t.dem&&QS(t,this._inViewTiles),t.featureStateRevision=-1,this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new be("data",{tile:t,coord:t.tileID})))}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._inViewTiles.getTileById(t)}_retainLoadedChildren(t,i){let r=this._getLoadedDescendents(i),a=new Set;for(let s of i){let o=r[s.key];if(!o?.length){a.add(s);continue}let n=s.overscaledZ+bi.maxOverzooming,l=o.filter(c=>c.tileID.overscaledZ<=n);if(!l.length){a.add(s);continue}let u=Math.min(...l.map(c=>c.tileID.overscaledZ)),h=l.filter(c=>c.tileID.overscaledZ===u).map(c=>c.tileID);for(let c of h)t[c.key]=c;this._areDescendentsComplete(h,u,s.overscaledZ)||a.add(s)}return a}_getLoadedDescendents(t){let i={};for(let r of this._inViewTiles.getAllTiles().filter(a=>a.hasData()))for(let a of t)r.tileID.isChildOf(a)&&(i[a.key]||=[],i[a.key].push(r));return i}_areDescendentsComplete(t,i,r){return t.length===1&&t[0].isOverscaled()?t[0].overscaledZ===i:4**(i-r)===t.length}getLoadedTile(t){return this._inViewTiles.getLoadedTile(t)}updateCacheSize(t){let i=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=this._maxTileCacheZoomLevels===null?Bt.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels,a=Math.floor(i*r),s=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,a):a;this._outOfViewCache.setMaxSize(s)}handleWrapJump(t){let i=(t-(this._prevLng===void 0?t:this._prevLng))/360,r=Math.round(i);this._prevLng=t,r&&(this._inViewTiles.handleWrapJump(r),this._resetTileReloadTimers())}update(t,i){if(!this._sourceLoaded||this._paused)return;this.transform=t,this.terrain=i,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng);let r;!this.used&&!this.usedForTerrain?r=[]:this._source.tileID?r=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(l=>new et(l.canonical.z,l.wrap,l.canonical.z,l.canonical.x,l.canonical.y)):(r=sa(t,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.type==="vector"&&this.map._zoomLevelsToOverscale!==void 0?Math.max(this._source.maxzoom,t.maxZoom-this.map._zoomLevelsToOverscale):this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:i,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(r=r.filter(l=>this._source.hasTile(l)))),this.usedForTerrain&&(r=this._addTerrainIdealTiles(r));let a=r.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,a&&this.fire(new be("data",{sourceDataType:"idle",sourceId:this.id}));let s=Ih(t,this._source),o=this._updateRetainedTiles(r,s),n=Sp(this._source.type);n&&this._rasterFadeDuration>0&&!i&&HS(this._inViewTiles,r,o,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),n?this._cleanUpRasterTiles(o):this._cleanUpVectorTiles(o)}_cleanUpRasterTiles(t){for(let i of this._inViewTiles.getAllIds())t[i]||this._removeTile(i)}_cleanUpVectorTiles(t){for(let i of this._inViewTiles.getAllIds()){let r=this._inViewTiles.getTileById(i);if(t[i]){r.clearSymbolFadeHold();continue}if(!r.hasSymbolBuckets){this._removeTile(i);continue}r.holdingForSymbolFade()?r.symbolFadeFinished()&&this._removeTile(i):r.setSymbolHoldDuration(this.map._fadeDuration)}}_addTerrainIdealTiles(t){let i=[];for(let r of t)if(r.canonical.z>this._source.minzoom){let a=r.scaledTo(r.canonical.z-1);i.push(a);let s=r.scaledTo(Math.max(this._source.minzoom,Math.min(r.canonical.z,5)));i.push(s)}return t.concat(i)}releaseSymbolFadeTiles(){for(let t of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(t).holdingForSymbolFade()&&this._removeTile(t)}_updateRetainedTiles(t,i){let r=new Set;for(let l of t)this._addTile(l).hasData()||r.add(l);let a=t.reduce((l,u)=>(l[u.key]=u,l),{}),s=this._retainLoadedChildren(a,r),o={},n=Math.max(i-bi.maxUnderzooming,this._source.minzoom);for(let l of s){let u=this._inViewTiles.getTileById(l.key),h=u?.wasRequested();for(let c=l.overscaledZ-1;c>=n;--c){let p=l.scaledTo(c);if(o[p.key])break;if(o[p.key]=!0,u=this.getTile(p),!u&&h&&(u=this._addTile(p)),u){let d=u.hasData();if((d||!this.map?.cancelPendingTileRequestsWhileZooming||h)&&(a[p.key]=p),h=u.wasRequested(),d)break}}}return a}_addTile(t){let i=this._inViewTiles.getTileById(t.key);if(i)return i;i=this._outOfViewCache.getAndRemove(t),i&&(i.resetFadeLogic(),this._setTileReloadTimer(t.key,i),i.tileID=t,this._state.initializeTileState(i,this.map?this.map.painter:null));let r=i;return i||(i=new k_(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(i,t.key,i.state)),i.uses++,this._inViewTiles.setTile(t.key,i),r||this._source.fire(new be("dataloading",{tile:i,coord:i.tileID})),i}_setTileReloadTimer(t,i){this._clearTileReloadTimer(t);let r=i.getExpiryTimeout();if(r){let a=()=>{this._reloadTile(t,"expired"),delete this._timers[t]};this._timers[t]=setTimeout(a,r)}}_clearTileReloadTimer(t){let i=this._timers[t];i&&(clearTimeout(i),delete this._timers[t])}_resetTileReloadTimers(){for(let t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(let t of this._inViewTiles.getAllIds()){let i=this._inViewTiles.getTileById(t);this._setTileReloadTimer(t,i)}}refreshTiles(t){for(let i of this._inViewTiles.getAllIds()){let r=this._inViewTiles.getTileById(i);!this._inViewTiles.isIdRenderable(i)&&r.state!="errored"||t.some(a=>a.equals(r.tileID.canonical))&&this._reloadTile(i,"expired")}}_removeTile(t){let i=this._inViewTiles.getTileById(t);i&&(i.uses--,this._inViewTiles.deleteTileById(t),this._clearTileReloadTimer(t),!(i.uses>0)&&(i.hasData()&&i.state!=="reloading"?this._outOfViewCache.add(i.tileID,i,i.getExpiryTimeout()):(i.aborted=!0,this._abortTile(i),this._unloadTile(i))))}_dataHandler(t){if(t.dataType==="source"){if(t.sourceDataType==="metadata"){this._sourceLoaded=!0;return}t.sourceDataType!=="content"||!this._sourceLoaded||this._paused||(this.reload(t.sourceDataChanged,t.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let t of this._inViewTiles.getAllIds())this._removeTile(t);this._outOfViewCache.reset()}tilesIn(t,i,r){let a=[],s=this.transform;if(!s)return a;let o=s.getCoveringTilesDetailsProvider().allowWorldCopies(),n=r?s.getCameraQueryGeometry(t):t,l=d=>s.screenPointToMercatorCoordinate(d,this.terrain),u=this.transformBbox(t,l,!o),h=this.transformBbox(n,l,!o),c=this.getIds(),p=ai.fromPoints(h);for(let d of c){let f=this._inViewTiles.getTileById(d);if(f.holdingForSymbolFade())continue;let m=o?[f.tileID]:[f.tileID.unwrapTo(-1),f.tileID.unwrapTo(0)],_=2**(s.zoom-f.tileID.overscaledZ),g=i*f.queryPadding*C/f.tileSize/_;for(let x of m){let y=p.map(v=>x.getTilePoint(new ye(v.x,v.y)));if(y.expandBy(g),y.intersects(WS)){let v=u.map(b=>x.getTilePoint(b)),w=h.map(b=>x.getTilePoint(b));a.push({tile:f,tileID:o?x:x.unwrapTo(0),queryGeometry:v,cameraQueryGeometry:w,scale:_})}}}return a}transformBbox(t,i,r){let a=t.map(i);if(r){let s=ai.fromPoints(t);s.shrinkBy(Math.min(s.width(),s.height())*.001);let o=s.map(i);ai.fromPoints(a).covers(o)||(a=a.map(n=>n.x>.5?new ye(n.x-1,n.y,n.z):n))}return a}getVisibleCoordinates(t){let i=this.getRenderableIds(t).map(r=>this._inViewTiles.getTileById(r).tileID);return this.transform&&this.transform.populateCache(i),i}hasTransition(){return this._source.hasTransition()?!0:Sp(this._source.type)&&JS(this._inViewTiles,this._rasterFadeDuration)}setRasterFadeDuration(t){this._rasterFadeDuration=t}setFeatureState(t,i,r){t||=to,this._state.updateState(t,i,r)}removeFeatureState(t,i,r){t||=to,this._state.removeFeatureState(t,i,r)}getFeatureState(t,i){return t||=to,this._state.getState(t,i)}setDependencies(t,i,r){let a=this._inViewTiles.getTileById(t);a&&a.setDependencies(i,r)}reloadTilesForDependencies(t,i){for(let r of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(r).hasDependency(t,i)&&this._reloadTile(r,"reloading");this._outOfViewCache.filter(r=>!r.hasDependency(t,i))}areTilesLoaded(){for(let t of this._inViewTiles.getAllTiles())if(t.state!=="loaded"&&t.state!=="errored")return!1;return!0}},bi.maxUnderzooming=10,bi.maxOverzooming=3,bi),eP=class{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let i=1;i<this.points.length;i++)this._distances[i]=this._distances[i-1]+this.points[i].dist(this.points[i-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,this.length*.5),this.paddedLength=this.length-this.padding*2}lerp(e){if(this.points.length===1)return this.points[0];e=oe(e,0,1);let t=1,i=this._distances[t],r=e*this.paddedLength+this.padding;for(;i<r&&t<this._distances.length;)i=this._distances[++t];let a=t-1,s=this._distances[a],o=i-s,n=o>0?(r-s)/o:0;return this.points[a].mult(1-n).add(this.points[t].mult(n))}};function $s(e,t){let i=!0;return e==="always"||(e==="never"||t==="never")&&(i=!1),i}var Mp=class{constructor(e,t,i){let r=this.boxCells=[],a=this.circleCells=[];this.xCellCount=Math.ceil(e/i),this.yCellCount=Math.ceil(t/i);for(let s=0;s<this.xCellCount*this.yCellCount;s++)r.push([]),a.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,t,i,r,a){this._forEachCell(t,i,r,a,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(a)}insertCircle(e,t,i,r){this._forEachCell(t-r,i-r,t+r,i+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(i),this.circles.push(r)}_insertBoxCell(e,t,i,r,a,s){this.boxCells[a].push(s)}_insertCircleCell(e,t,i,r,a,s){this.circleCells[a].push(s)}_query(e,t,i,r,a,s,o){if(i<0||e>this.width||r<0||t>this.height)return[];let n=[];if(e<=0&&t<=0&&this.width<=i&&this.height<=r){if(a)return[{key:null,x1:e,y1:t,x2:i,y2:r}];for(let l=0;l<this.boxKeys.length;l++)n.push({key:this.boxKeys[l],x1:this.bboxes[l*4],y1:this.bboxes[l*4+1],x2:this.bboxes[l*4+2],y2:this.bboxes[l*4+3]});for(let l=0;l<this.circleKeys.length;l++){let u=this.circles[l*3],h=this.circles[l*3+1],c=this.circles[l*3+2];n.push({key:this.circleKeys[l],x1:u-c,y1:h-c,x2:u+c,y2:h+c})}}else{let l={hitTest:a,overlapMode:s,seenUids:{box:{},circle:{}}};this._forEachCell(e,t,i,r,this._queryCell,n,l,o)}return n}query(e,t,i,r){return this._query(e,t,i,r,!1,null)}hitTest(e,t,i,r,a,s){return this._query(e,t,i,r,!0,a,s).length>0}hitTestCircle(e,t,i,r,a){let s=e-i,o=e+i,n=t-i,l=t+i;if(o<0||s>this.width||l<0||n>this.height)return!1;let u=[],h={hitTest:!0,overlapMode:r,circle:{x:e,y:t,radius:i},seenUids:{box:{},circle:{}}};return this._forEachCell(s,n,o,l,this._queryCellCircle,u,h,a),u.length>0}_queryCell(e,t,i,r,a,s,o,n){let{seenUids:l,hitTest:u,overlapMode:h}=o,c=this.boxCells[a],p=1e-6;if(c!==null){let f=this.bboxes;for(let m of c)if(!l.box[m]){l.box[m]=!0;let _=m*4,g=this.boxKeys[m];if(e<=f[_+2]+p&&t<=f[_+3]+p&&i>=f[_+0]-p&&r>=f[_+1]-p&&(!n||n(g))&&(!u||!$s(h,g.overlapMode))&&(s.push({key:g,x1:f[_],y1:f[_+1],x2:f[_+2],y2:f[_+3]}),u))return!0}}let d=this.circleCells[a];if(d!==null){let f=this.circles;for(let m of d)if(!l.circle[m]){l.circle[m]=!0;let _=m*3,g=this.circleKeys[m];if(this._circleAndRectCollide(f[_],f[_+1],f[_+2],e,t,i,r)&&(!n||n(g))&&(!u||!$s(h,g.overlapMode))){let x=f[_],y=f[_+1],v=f[_+2];if(s.push({key:g,x1:x-v,y1:y-v,x2:x+v,y2:y+v}),u)return!0}}}return!1}_queryCellCircle(e,t,i,r,a,s,o,n){let{circle:l,seenUids:u,overlapMode:h}=o,c=this.boxCells[a];if(c!==null){let d=this.bboxes;for(let f of c)if(!u.box[f]){u.box[f]=!0;let m=f*4,_=this.boxKeys[f];if(this._circleAndRectCollide(l.x,l.y,l.radius,d[m+0],d[m+1],d[m+2],d[m+3])&&(!n||n(_))&&!$s(h,_.overlapMode))return s.push(!0),!0}}let p=this.circleCells[a];if(p!==null){let d=this.circles;for(let f of p)if(!u.circle[f]){u.circle[f]=!0;let m=f*3,_=this.circleKeys[f];if(this._circlesCollide(d[m],d[m+1],d[m+2],l.x,l.y,l.radius)&&(!n||n(_))&&!$s(h,_.overlapMode))return s.push(!0),!0}}}_forEachCell(e,t,i,r,a,s,o,n){let l=this._convertToXCellCoord(e),u=this._convertToYCellCoord(t),h=this._convertToXCellCoord(i),c=this._convertToYCellCoord(r);for(let p=l;p<=h;p++)for(let d=u;d<=c;d++){let f=this.xCellCount*d+p;if(a.call(this,e,t,i,r,f,s,o,n))return}}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,i,r,a,s){let o=r-e,n=a-t,l=i+s;return l*l>o*o+n*n}_circleAndRectCollide(e,t,i,r,a,s,o){let n=(s-r)/2,l=Math.abs(e-(r+n));if(l>n+i)return!1;let u=(o-a)/2,h=Math.abs(t-(a+u));if(h>u+i)return!1;if(l<=n||h<=u)return!0;let c=l-n,p=h-u;return c*c+p*p<=i*i}};function tP(e,t){let i=1/(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]),r=1/(t[8]*t[8]+t[9]*t[9]+t[10]*t[10]),a=t[0]*i,s=t[4]*i,o=t[8]*r,n=t[1]*i,l=t[5]*i,u=t[9]*r,h=t[2]*i,c=t[6]*i,p=t[10]*r;e[0]=a,e[1]=s,e[2]=o,e[4]=n,e[5]=l,e[6]=u,e[8]=h,e[9]=c,e[10]=p;let d=t[12],f=t[13],m=t[14];return e[12]=-a*d-n*f-h*m,e[13]=-s*d-l*f-c*m,e[14]=-o*d-u*f-p*m,e[3]=0,e[7]=0,e[11]=0,e[15]=1,e}function iP(e,t){return e[0]=1/t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1/t[5],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=0,e[11]=1/t[14],e[12]=0,e[13]=0,e[14]=-1,e[15]=t[10]/t[14],e}function rP(e,t){let i=1/(t[0]*t[5]-t[1]*t[4]);return e[0]=t[5]*i,e[1]=-t[1]*i,e[2]=0,e[3]=0,e[4]=-t[4]*i,e[5]=t[0]*i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1/t[10],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1/t[15],e}const aP=Wi();function Eh(e,t,i){let r=Wi();if(!e){let{vecSouth:a,vecEast:s}=Mh(t),o=w_();o[0]=s[0],o[1]=s[1],o[2]=a[0],o[3]=a[1],UT(o,o),r[0]=o[0],r[1]=o[1],r[4]=o[2],r[5]=o[3]}return tt(r,r,[1/i,1/i,1]),r}function sP(e,t,i,r){if(e){let a=Wi();if(!t){let{vecSouth:s,vecEast:o}=Mh(i);a[0]=o[0],a[1]=o[1],a[4]=s[0],a[5]=s[1]}return tt(a,a,[r,r,1]),a}else return i.pixelsToClipSpaceMatrix}function Mh(e){let t=Math.cos(e.rollInRadians),i=Math.sin(e.rollInRadians),r=Math.cos(e.pitchInRadians),a=Math.cos(e.bearingInRadians),s=Math.sin(e.bearingInRadians),o=ll();o[0]=-a*r*i-s*t,o[1]=-s*r*i+a*t;let n=Wh(o);n<1e-9?Hh(o):qh(o,o,1/n);let l=ll();l[0]=a*r*t-s*i,l[1]=s*r*t+a*i;let u=Wh(l);return u<1e-9?Hh(l):qh(l,l,1/u),{vecEast:l,vecSouth:o}}function Ah(e,t,i,r){let a;r?(a=[e,t,r(e,t),1],Ue(a,a,i)):(a=[e,t,0,1],Ch(a,a,i));let s=a[3];return{point:new E(a[0]/s,a[1]/s),signedDistanceFromCamera:s,isOccluded:!1}}function F_(e,t){return .5+e/t*.5}function oP(e,t){return e.x>=-t[0]&&e.x<=t[0]&&e.y>=-t[1]&&e.y<=t[1]}function nP(e,t,i,r,a,s,o,n,l,u,h,c,p){let d=i?e.textSizeData:e.iconSizeData,f=rn(d,t.transform.zoom),m=[256/t.width*2+1,256/t.height*2+1],_=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;_.clear();let g=e.lineVertexArray,x=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,y=t.transform.width/t.transform.height,v=!1;for(let w=0;w<x.length;w++){let b=x.get(w);if(b.hidden||b.writingMode===2&&!v){jr(b.numGlyphs,_);continue}v=!1;let T=new E(b.anchorX,b.anchorY),I={getElevation:p,pitchedLabelPlaneMatrix:r,lineVertexArray:g,pitchWithMap:s,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:t.transform,tileAnchorPoint:T,unwrappedTileID:l,width:u,height:h,translation:c},M=$_(b.anchorX,b.anchorY,I);if(!oP(M.point,m)){jr(b.numGlyphs,_);continue}let D=M.signedDistanceFromCamera,L=F_(t.transform.cameraToCenterDistance,D),z=uh(d,f,b),P=s?z*t.transform.getPitchedTextCorrection(b.anchorX,b.anchorY,l)/L:z*L,S=Cp({projectionContext:I,pitchedLabelPlaneMatrixInverse:a,symbol:b,fontSize:P,flip:!1,keepUpright:o,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:_,aspectRatio:y,rotateToLine:n});v=S.useVertical,(S.notEnoughRoom||v||S.needsFlipping&&Cp({projectionContext:I,pitchedLabelPlaneMatrixInverse:a,symbol:b,fontSize:P,flip:!0,keepUpright:o,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:_,aspectRatio:y,rotateToLine:n}).notEnoughRoom)&&jr(b.numGlyphs,_)}i?e.text.dynamicLayoutVertexBuffer.updateData(_):e.icon.dynamicLayoutVertexBuffer.updateData(_)}function B_(e,t,i,r,a,s,o,n){let l=s.glyphStartIndex+s.numGlyphs,u=s.lineStartIndex,h=s.lineStartIndex+s.lineLength,c=t.getoffsetX(s.glyphStartIndex),p=t.getoffsetX(l-1),d=Eo(e*c,i,r,a,s.segment,u,h,n,o);if(!d)return null;let f=Eo(e*p,i,r,a,s.segment,u,h,n,o);return!f||n.projectionCache.anyProjectionOccluded?null:{first:d,last:f}}function Ap(e,t,i,r){return e===1&&Math.abs(i.y-t.y)>Math.abs(i.x-t.x)*r?{useVertical:!0}:(e===2?t.y<i.y:t.x>i.x)?{needsFlipping:!0}:null}function Cp(e){let{projectionContext:t,pitchedLabelPlaneMatrixInverse:i,symbol:r,fontSize:a,flip:s,keepUpright:o,glyphOffsetArray:n,dynamicLayoutVertexArray:l,aspectRatio:u,rotateToLine:h}=e,c=a/24,p=r.lineOffsetX*c,d=r.lineOffsetY*c,f;if(r.numGlyphs>1){let m=r.glyphStartIndex+r.numGlyphs,_=r.lineStartIndex,g=r.lineStartIndex+r.lineLength,x=B_(c,n,p,d,s,r,h,t);if(!x)return{notEnoughRoom:!0};let y=Vs(x.first.point.x,x.first.point.y,t,i),v=Vs(x.last.point.x,x.last.point.y,t,i);if(o&&!s){let w=Ap(r.writingMode,y,v,u);if(w)return w}f=[x.first];for(let w=r.glyphStartIndex+1;w<m-1;w++){let b=Eo(c*n.getoffsetX(w),p,d,s,r.segment,_,g,t,h);if(!b)return{notEnoughRoom:!0};f.push(b)}f.push(x.last)}else{if(o&&!s){let _=dr(t.tileAnchorPoint.x,t.tileAnchorPoint.y,t).point,g=r.lineStartIndex+r.segment+1,x=new E(t.lineVertexArray.getx(g),t.lineVertexArray.gety(g)),y=dr(x.x,x.y,t),v=y.signedDistanceFromCamera>0?y.point:O_(t.tileAnchorPoint,x,_,1,t),w=Vs(_.x,_.y,t,i),b=Vs(v.x,v.y,t,i),T=Ap(r.writingMode,w,b,u);if(T)return T}let m=Eo(c*n.getoffsetX(r.glyphStartIndex),p,d,s,r.segment,r.lineStartIndex,r.lineStartIndex+r.lineLength,t,h);if(!m||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};f=[m]}for(let m of f)Qa(l,m.point,m.angle);return{}}function O_(e,t,i,r,a){let s=e.add(e.sub(t)._unit()),o=dr(s.x,s.y,a).point,n=i.sub(o);return i.add(n._mult(r/n.mag()))}function bu(e,t,i){let r=t.projectionCache;if(r.projections[e])return r.projections[e];let a=new E(t.lineVertexArray.getx(e),t.lineVertexArray.gety(e)),s=dr(a.x,a.y,t);if(s.signedDistanceFromCamera>0)return r.projections[e]=s.point,r.anyProjectionOccluded||=s.isOccluded,s.point;let o=e-i.direction,n=i.distanceFromAnchor===0?t.tileAnchorPoint:new E(t.lineVertexArray.getx(o),t.lineVertexArray.gety(o)),l=i.absOffsetX-i.distanceFromAnchor+1;return O_(n,a,i.previousVertex,l,t)}function dr(e,t,i){let r=e+i.translation[0],a=t+i.translation[1],s;return i.pitchWithMap?(s=Ah(r,a,i.pitchedLabelPlaneMatrix,i.getElevation),s.isOccluded=!1):(s=i.transform.projectTileCoordinates(r,a,i.unwrappedTileID,i.getElevation),s.point.x=(s.point.x*.5+.5)*i.width,s.point.y=(-s.point.y*.5+.5)*i.height),s}function Vs(e,t,i,r){if(i.pitchWithMap){let a=[e,t,0,1];return Ue(a,a,r),i.transform.projectTileCoordinates(a[0]/a[3],a[1]/a[3],i.unwrappedTileID,i.getElevation).point}else return{x:e/i.width*2-1,y:1-t/i.height*2}}function $_(e,t,i){return i.transform.projectTileCoordinates(e,t,i.unwrappedTileID,i.getElevation)}function wu(e,t,i){return e._unit()._perp()._mult(t*i)}function lP(e,t,i,r,a,s,o,n,l){if(n.projectionCache.offsets[e])return n.projectionCache.offsets[e];let u=i.add(t);if(e+l.direction<r||e+l.direction>=a)return n.projectionCache.offsets[e]=u,u;let h=bu(e+l.direction,n,l),c=wu(h.sub(i),o,l.direction),p=i.add(c),d=h.add(c);return n.projectionCache.offsets[e]=yy(s,u,p,d)||u,n.projectionCache.offsets[e]}function Eo(e,t,i,r,a,s,o,n,l){let u=r?e-t:e+t,h=u>0?1:-1,c=0;r&&(h*=-1,c=Math.PI),h<0&&(c+=Math.PI);let p=h>0?s+a:s+a+1,d;n.projectionCache.cachedAnchorPoint?d=n.projectionCache.cachedAnchorPoint:(d=dr(n.tileAnchorPoint.x,n.tileAnchorPoint.y,n).point,n.projectionCache.cachedAnchorPoint=d);let f=d,m=d,_,g,x=0,y=0,v=Math.abs(u),w=[],b;for(;x+y<=v;){if(p+=h,p<s||p>=o)return null;x+=y,m=f,g=_;let D={absOffsetX:v,direction:h,distanceFromAnchor:x,previousVertex:m};if(f=bu(p,n,D),i===0)w.push(m),b=f.sub(m);else{let L,z=f.sub(m);L=z.mag()===0?wu(bu(p+h,n,D).sub(f),i,h):wu(z,i,h),g||=m.add(L),_=lP(p,L,f,s,o,g,i,n,D),w.push(g),b=_.sub(g)}y=b.mag()}let T=(v-x)/y,I=b._mult(T)._add(g||m),M=c+Math.atan2(f.y-m.y,f.x-m.x);return w.push(I),{point:I,angle:l?M:0,path:w}}const uP=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function jr(e,t){for(let i=0;i<e;i++){let r=t.length;t.resize(r+4),t.float32.set(uP,r*3)}}function Ch(e,t,i){let r=t[0],a=t[1];return e[0]=i[0]*r+i[4]*a+i[12],e[1]=i[1]*r+i[5]*a+i[13],e[3]=i[3]*r+i[7]*a+i[15],e}function hP(e,t){let i=aP;return rP(i,t.pitchedLabelPlaneMatrix),e.map(r=>{let a=Ah(r.x,r.y,i,t.getElevation),s=t.transform.projectTileCoordinates(a.point.x,a.point.y,t.unwrappedTileID,t.getElevation);return s.point.x=(s.point.x*.5+.5)*t.width,s.point.y=(-s.point.y*.5+.5)*t.height,s})}function cP(e){let t=0,i=0,r=0,a=0;for(let s=0;s<e.length;s++)e[s].isOccluded?(r=s+1,a=0):(a++,a>i&&(i=a,t=r));return e.slice(t,t+i)}var pP=class{constructor(e,t=new Mp(e.width+200,e.height+200,25),i=new Mp(e.width+200,e.height+200,25)){this.transform=e,this.grid=t,this.ignoredGrid=i,this.pitchFactor=Math.cos(e.pitch*Math.PI/180)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+100,this.screenBottomBoundary=e.height+100,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,t,i,r,a,s,o,n,l,u,h,c){let p=e.anchorPointX+n[0],d=e.anchorPointY+n[1],f=this.projectAndGetPerspectiveRatio(p,d,a,u,c),m=i*f.perspectiveRatio,_;if(!s&&!o){let T=f.x+(h?h.x*m:0),I=f.y+(h?h.y*m:0);_={allPointsOccluded:!1,box:[T+e.x1*m,I+e.y1*m,T+e.x2*m,I+e.y2*m]}}else _=this._projectCollisionBox(e,m,r,a,s,o,n,f,u,h,c);let[g,x,y,v]=_.box,w=s?_.allPointsOccluded:f.isOccluded,b=w;return b||=f.perspectiveRatio<this.perspectiveRatioCutoff,b||=!this.isInsideGrid(g,x,y,v),b||t!=="always"&&this.grid.hitTest(g,x,y,v,t,l)?{box:[g,x,y,v],placeable:!1,offscreen:!1,occluded:w}:{box:[g,x,y,v],placeable:!0,offscreen:this.isOffscreen(g,x,y,v),occluded:w}}placeCollisionCircles(e,t,i,r,a,s,o,n,l,u,h,c,p,d){let f=[],m=new E(t.anchorX,t.anchorY),_=this.getPerspectiveRatio(m.x,m.y,s,d),g=(l?a*this.transform.getPitchedTextCorrection(t.anchorX,t.anchorY,s)/_:a*_)/24,x={projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},y=t.lineOffsetX*g,v=t.lineOffsetY*g,w={getElevation:d,pitchedLabelPlaneMatrix:o,lineVertexArray:i,pitchWithMap:l,projectionCache:x,transform:this.transform,tileAnchorPoint:m,unwrappedTileID:s,width:this.transform.width,height:this.transform.height,translation:p},b=B_(g,r,y,v,!1,t,!1,w),T=!1,I=!1,M=!0;if(b){let D=h*.5*_+c,L=new E(-100,-100),z=new E(this.screenRightBoundary,this.screenBottomBoundary),P=new eP,S=b.first,F=b.last,O=[];for(let ie=S.path.length-1;ie>=1;ie--)O.push(S.path[ie]);for(let ie=1;ie<F.path.length;ie++)O.push(F.path[ie]);let H=D*2.5;if(l){let ie=this.projectPathToScreenSpace(O,w);O=ie.some(ue=>ue.signedDistanceFromCamera<=0)?[]:ie.map(ue=>ue.point)}let Y=[];if(O.length>0){let ie=O[0].clone(),ue=O[0].clone();for(let me=1;me<O.length;me++)ie.x=Math.min(ie.x,O[me].x),ie.y=Math.min(ie.y,O[me].y),ue.x=Math.max(ue.x,O[me].x),ue.y=Math.max(ue.y,O[me].y);Y=ie.x>=L.x&&ue.x<=z.x&&ie.y>=L.y&&ue.y<=z.y?[O]:ue.x<L.x||ie.x>z.x||ue.y<L.y||ie.y>z.y?[]:VT([O],L.x,L.y,z.x,z.y)}for(let ie of Y){P.reset(ie,D*.25);let ue=0;ue=P.length<=.5*D?1:Math.ceil(P.paddedLength/H)+1;for(let me=0;me<ue;me++){let It=me/Math.max(ue-1,1),Je=P.lerp(It),Qe=Je.x+100,qe=Je.y+100;f.push(Qe,qe,D,0);let $t=Qe-D,ci=qe-D,Ai=Qe+D,Kt=qe+D;if(M&&=this.isOffscreen($t,ci,Ai,Kt),I||=this.isInsideGrid($t,ci,Ai,Kt),e!=="always"&&this.grid.hitTestCircle(Qe,qe,D,e,u)&&(T=!0,!n))return{circles:[],offscreen:!1,collisionDetected:T}}}}return{circles:!n&&T||!I||_<this.perspectiveRatioCutoff?[]:f,offscreen:M,collisionDetected:T}}projectPathToScreenSpace(e,t){return cP(hP(e,t))}queryRenderedSymbols(e){if(e.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let t=[],i=new ai;for(let h of e){let c=new E(h.x+100,h.y+100);i.extend(c),t.push(c)}let{minX:r,minY:a,maxX:s,maxY:o}=i,n=this.grid.query(r,a,s,o).concat(this.ignoredGrid.query(r,a,s,o)),l={},u={};for(let h of n){let c=h.key;l[c.bucketInstanceId]===void 0&&(l[c.bucketInstanceId]={}),!(l[c.bucketInstanceId][c.featureIndex]||!wm(t,[new E(h.x1,h.y1),new E(h.x2,h.y1),new E(h.x2,h.y2),new E(h.x1,h.y2)]))&&(l[c.bucketInstanceId][c.featureIndex]=!0,u[c.bucketInstanceId]===void 0&&(u[c.bucketInstanceId]=[]),u[c.bucketInstanceId].push(c.featureIndex))}return u}insertCollisionBox(e,t,i,r,a,s){let o=i?this.ignoredGrid:this.grid,n={bucketInstanceId:r,featureIndex:a,collisionGroupID:s,overlapMode:t};o.insert(n,e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,i,r,a,s){let o=i?this.ignoredGrid:this.grid,n={bucketInstanceId:r,featureIndex:a,collisionGroupID:s,overlapMode:t};for(let l=0;l<e.length;l+=4)o.insertCircle(n,e[l],e[l+1],e[l+2])}projectAndGetPerspectiveRatio(e,t,i,r,a){if(a){let s;r?(s=[e,t,r(e,t),1],Ue(s,s,a)):(s=[e,t,0,1],Ch(s,s,a));let o=s[3];return{x:(s[0]/o+1)/2*this.transform.width+100,y:(-s[1]/o+1)/2*this.transform.height+100,perspectiveRatio:.5+.5*(this.transform.cameraToCenterDistance/o),isOccluded:!1,signedDistanceFromCamera:o}}else{let s=this.transform.projectTileCoordinates(e,t,i,r);return{x:(s.point.x+1)/2*this.transform.width+100,y:(-s.point.y+1)/2*this.transform.height+100,perspectiveRatio:.5+.5*(this.transform.cameraToCenterDistance/s.signedDistanceFromCamera),isOccluded:s.isOccluded,signedDistanceFromCamera:s.signedDistanceFromCamera}}}getPerspectiveRatio(e,t,i,r){let a=this.transform.projectTileCoordinates(e,t,i,r);return .5+.5*(this.transform.cameraToCenterDistance/a.signedDistanceFromCamera)}isOffscreen(e,t,i,r){return i<100||e>=this.screenRightBoundary||r<100||t>this.screenBottomBoundary}isInsideGrid(e,t,i,r){return i>=0&&e<this.gridRightBoundary&&r>=0&&t<this.gridBottomBoundary}getViewportMatrix(){let e=Xt([]);return Fe(e,e,[-100,-100,0]),e}_projectCollisionBox(e,t,i,r,a,s,o,n,l,u,h){let c=1,p=0,d=0,f=1,m=e.anchorPointX+o[0],_=e.anchorPointY+o[1];if(s&&!a){let P=this.projectAndGetPerspectiveRatio(m+1,_,r,l,h),S=P.x-n.x,F=P.y-n.y,O=Math.atan(F/S)+(S<0?Math.PI:0),H=Math.sin(O),Y=Math.cos(O);c=Y,p=H,d=-H,f=Y}else if(!s&&a){let P=Mh(this.transform);c=P.vecEast[0],p=P.vecEast[1],d=P.vecSouth[0],f=P.vecSouth[1]}let g=n.x,x=n.y,y=t;if(a&&(g=m,x=_,y=2**-(this.transform.zoom-i.overscaledZ),y*=this.transform.getPitchedTextCorrection(m,_,r),!u)){let P=oe(.5+.5*(n.signedDistanceFromCamera/this.transform.cameraToCenterDistance),0,4);y*=P}u&&(g+=c*u.x*y+d*u.y*y,x+=p*u.x*y+f*u.y*y);let v=e.x1*y,w=e.x2*y,b=(v+w)/2,T=e.y1*y,I=e.y2*y,M=(T+I)/2,D=[{offsetX:v,offsetY:T},{offsetX:b,offsetY:T},{offsetX:w,offsetY:T},{offsetX:w,offsetY:M},{offsetX:w,offsetY:I},{offsetX:b,offsetY:I},{offsetX:v,offsetY:I},{offsetX:v,offsetY:M}],L=[];for(let{offsetX:P,offsetY:S}of D)L.push(new E(g+c*P+d*S,x+p*P+f*S));let z=!1;if(a){let P=L.map(S=>this.projectAndGetPerspectiveRatio(S.x,S.y,r,l,h));z=P.some(S=>!S.isOccluded),L=P.map(S=>new E(S.x,S.y))}else z=!0;return{box:py(L),allPointsOccluded:!z}}},Dp=class{constructor(e,t,i,r){e?this.opacity=Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):this.opacity=r&&i?1:0,this.placed=i}isHidden(){return this.opacity===0&&!this.placed}},fa=class{constructor(e,t,i,r,a){this.text=new Dp(e?e.text:null,t,i,a),this.icon=new Dp(e?e.icon:null,t,r,a)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}},zp=class{constructor(e,t,i){this.text=e,this.icon=t,this.skipFade=i}},dP=class{constructor(e,t,i,r,a){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=i,this.bucketIndex=r,this.tileID=a}},fP=class{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){let t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:i=>i.collisionGroupID===t}}return this.collisionGroups[e]}};function Rp(e,t,i,r,a){let{horizontalAlign:s,verticalAlign:o}=Zm(e),n=-(s-.5)*t,l=-(o-.5)*i;return new E(n+r[0]*a,l+r[1]*a)}var mP=class{constructor(e,t,i,r,a){this.transform=e.clone(),this.terrain=t,this.collisionIndex=new pP(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=i,this.retainedQueryData={},this.collisionGroups=new fP(r),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=a,a&&(a.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){let t=this.terrain;return t?(i,r)=>t.getElevation(e,i,r):null}getBucketParts(e,t,i,r){let a=i.getBucket(t),s=i.latestFeatureIndex;if(!a||!s||t.id!==a.layerIds[0])return;let o=i.collisionBoxArray,n=a.layers[0].layout,l=a.layers[0].paint,u=2**(this.transform.zoom-i.tileID.overscaledZ),h=i.tileSize/C,c=i.tileID.toUnwrapped(),p=n.get("text-rotation-alignment")==="map",d=St(i,1,this.transform.zoom),f=Ni(this.collisionIndex.transform,i,l.get("text-translate"),l.get("text-translate-anchor")),m=Ni(this.collisionIndex.transform,i,l.get("icon-translate"),l.get("icon-translate-anchor")),_=Eh(p,this.transform,d);this.retainedQueryData[a.bucketInstanceId]=new dP(a.bucketInstanceId,s,a.sourceLayerIndex,a.index,i.tileID);let g={bucket:a,layout:n,translationText:f,translationIcon:m,unwrappedTileID:c,pitchedLabelPlaneMatrix:_,scale:u,textPixelRatio:h,holdingForFade:i.holdingForSymbolFade(),collisionBoxArray:o,partiallyEvaluatedTextSize:rn(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(r)for(let x of a.sortKeyRanges){let{sortKey:y,symbolInstanceStart:v,symbolInstanceEnd:w}=x;e.push({sortKey:y,symbolInstanceStart:v,symbolInstanceEnd:w,parameters:g})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:g})}attemptAnchorPlacement(e,t,i,r,a,s,o,n,l,u,h,c,p,d,f,m,_,g,x,y){let v=pp[e.textAnchor],w=[e.textOffset0,e.textOffset1],b=Rp(v,i,r,w,a),T=this.collisionIndex.placeCollisionBox(t,c,n,l,u,o,s,m,h.predicate,x,b,y);if(!(g&&!this.collisionIndex.placeCollisionBox(g,c,n,l,u,o,s,_,h.predicate,x,b,y).placeable)&&T.placeable){let I;if(this.prevPlacement?.variableOffsets[p.crossTileID]&&this.prevPlacement?.placements[p.crossTileID]?.text&&(I=this.prevPlacement.variableOffsets[p.crossTileID].anchor),p.crossTileID===0)throw Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[p.crossTileID]={textOffset:w,width:i,height:r,anchor:v,textBoxScale:a,prevAnchor:I},this.markUsedJustification(d,v,p,f),d.allowVerticalPlacement&&(this.markUsedOrientation(d,f,p),this.placedOrientations[p.crossTileID]=f),{shift:b,placedGlyphBoxes:T}}}placeLayerBucketPart(e,t,i){let{bucket:r,layout:a,translationText:s,translationIcon:o,unwrappedTileID:n,pitchedLabelPlaneMatrix:l,textPixelRatio:u,holdingForFade:h,collisionBoxArray:c,partiallyEvaluatedTextSize:p,collisionGroup:d}=e.parameters,f=a.get("text-optional"),m=a.get("icon-optional"),_=So(a,"text-overlap","text-allow-overlap"),g=_==="always",x=So(a,"icon-overlap","icon-allow-overlap"),y=x==="always",v=a.get("text-rotation-alignment")==="map",w=a.get("text-pitch-alignment")==="map",b=a.get("icon-text-fit")!=="none",T=a.get("symbol-z-order")==="viewport-y",I=g&&(y||!r.hasIconData()||m),M=y&&(g||!r.hasTextData()||f);!r.collisionArrays&&c&&r.deserializeCollisionBoxes(c);let D=this.retainedQueryData[r.bucketInstanceId].tileID,L=this._getTerrainElevationFunc(D),z=this.transform.getFastPathSimpleProjectionMatrix(D),P=(S,F,O)=>{if(t[S.crossTileID])return;if(h){this.placements[S.crossTileID]=new zp(!1,!1,!1);return}let H=!1,Y=!1,ie=!0,ue=null,me={box:null,placeable:!1,offscreen:null,occluded:!1},It={placeable:!1},Je=null,Qe=null,qe=null,$t=0,ci=0,Ai=0;F.textFeatureIndex?$t=F.textFeatureIndex:S.useRuntimeCollisionCircles&&($t=S.featureIndex),F.verticalTextFeatureIndex&&(ci=F.verticalTextFeatureIndex);let Kt=F.textBox;if(Kt){let Et=st=>{let ot=1;if(r.allowVerticalPlacement&&!st&&this.prevPlacement){let yt=this.prevPlacement.placedOrientations[S.crossTileID];yt&&(this.placedOrientations[S.crossTileID]=yt,ot=yt,this.markUsedOrientation(r,ot,S))}return ot},Vt=(st,ot)=>{if(r.allowVerticalPlacement&&S.numVerticalGlyphVertices>0&&F.verticalTextBox){for(let yt of r.writingModes)if(yt===2?(me=ot(),It=me):me=st(),me?.placeable)break}else me=st()},br=S.textAnchorOffsetStartIndex,Ci=S.textAnchorOffsetEndIndex;if(Ci===br){let st=(ot,yt)=>{let Pe=this.collisionIndex.placeCollisionBox(ot,_,u,D,n,w,v,s,d.predicate,L,void 0,z);return Pe?.placeable&&(this.markUsedOrientation(r,yt,S),this.placedOrientations[S.crossTileID]=yt),Pe};Vt(()=>st(Kt,1),()=>{let ot=F.verticalTextBox;return r.allowVerticalPlacement&&S.numVerticalGlyphVertices>0&&ot?st(ot,2):{box:null,offscreen:null}}),Et(me?.placeable)}else{let st=pp[this.prevPlacement?.variableOffsets[S.crossTileID]?.anchor],ot=(Pe,Di,mn)=>{let _n=Pe.x2-Pe.x1,Eg=Pe.y2-Pe.y1,Mg=S.textBoxScale,Ag=b&&x==="never"?Di:null,wr=null,Bh=_==="never"?1:2,Oh="never";st&&Bh++;for(let $h=0;$h<Bh;$h++){for(let gn=br;gn<Ci;gn++){let Vh=r.textAnchorOffsets.get(gn);if(st&&Vh.textAnchor!==st)continue;let yn=this.attemptAnchorPlacement(Vh,Pe,_n,Eg,Mg,v,w,u,D,n,d,Oh,S,r,mn,s,o,Ag,L);if(yn&&(wr=yn.placedGlyphBoxes,wr?.placeable))return H=!0,ue=yn.shift,wr}st?st=null:Oh=_}return i&&!wr&&(wr={box:this.collisionIndex.placeCollisionBox(Kt,"always",u,D,n,w,v,s,d.predicate,L,void 0,z).box,offscreen:!1,placeable:!1,occluded:!1}),wr};Vt(()=>ot(Kt,F.iconBox,1),()=>{let Pe=F.verticalTextBox,Di=me?.placeable;return r.allowVerticalPlacement&&!Di&&S.numVerticalGlyphVertices>0&&Pe?ot(Pe,F.verticalIconBox,2):{box:null,occluded:!0,offscreen:null}}),me&&(H=me.placeable,ie=me.offscreen);let yt=Et(me?.placeable);if(!H&&this.prevPlacement){let Pe=this.prevPlacement.variableOffsets[S.crossTileID];Pe&&(this.variableOffsets[S.crossTileID]=Pe,this.markUsedJustification(r,Pe.anchor,S,yt))}}}if(Je=me,H=Je?.placeable,ie=Je?.offscreen,S.useRuntimeCollisionCircles&&S.centerJustifiedTextSymbolIndex>=0){let Et=r.text.placedSymbolArray.get(S.centerJustifiedTextSymbolIndex),Vt=uh(r.textSizeData,p,Et),br=a.get("text-padding"),Ci=S.collisionCircleDiameter;Qe=this.collisionIndex.placeCollisionCircles(_,Et,r.lineVertexArray,r.glyphOffsetArray,Vt,n,l,i,w,d.predicate,Ci,br,s,L),Qe.circles.length&&Qe.collisionDetected&&!i&&ge("Collisions detected, but collision boxes are not shown"),H=g||Qe.circles.length>0&&!Qe.collisionDetected,ie&&=Qe.offscreen}if(F.iconFeatureIndex&&(Ai=F.iconFeatureIndex),F.iconBox){let Et=Vt=>this.collisionIndex.placeCollisionBox(Vt,x,u,D,n,w,v,o,d.predicate,L,b&&ue?ue:void 0,z);It&&It.placeable&&F.verticalIconBox?(qe=Et(F.verticalIconBox),Y=qe.placeable):(qe=Et(F.iconBox),Y=qe.placeable),ie&&=qe.offscreen}let yr=f||S.numHorizontalGlyphVertices===0&&S.numVerticalGlyphVertices===0,vr=m||S.numIconVertices===0;!yr&&!vr?Y=H=Y&&H:vr?yr||(Y&&=H):H=Y&&H;let xr=H&&Je.placeable,pn=Y&&qe.placeable;if(xr&&(It&&It.placeable&&ci?this.collisionIndex.insertCollisionBox(Je.box,_,a.get("text-ignore-placement"),r.bucketInstanceId,ci,d.ID):this.collisionIndex.insertCollisionBox(Je.box,_,a.get("text-ignore-placement"),r.bucketInstanceId,$t,d.ID)),pn&&this.collisionIndex.insertCollisionBox(qe.box,x,a.get("icon-ignore-placement"),r.bucketInstanceId,Ai,d.ID),Qe&&H&&this.collisionIndex.insertCollisionCircles(Qe.circles,_,a.get("text-ignore-placement"),r.bucketInstanceId,$t,d.ID),i&&this.storeCollisionData(r.bucketInstanceId,O,F,Je,qe,Qe),S.crossTileID===0)throw Error("symbolInstance.crossTileID can't be 0");if(r.bucketInstanceId===0)throw Error("bucket.bucketInstanceId can't be 0");let dn=(H||I)&&!Je?.occluded,fn=(Y||M)&&!qe?.occluded;this.placements[S.crossTileID]=new zp(dn,fn,ie||r.justReloaded),t[S.crossTileID]=!0};if(T){if(e.symbolInstanceStart!==0)throw Error("bucket.bucketInstanceId should be 0");let S=r.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let F=S.length-1;F>=0;--F){let O=S[F];P(r.symbolInstances.get(O),r.collisionArrays[O],O)}}else for(let S=e.symbolInstanceStart;S<e.symbolInstanceEnd;S++)P(r.symbolInstances.get(S),r.collisionArrays[S],S);r.justReloaded=!1}storeCollisionData(e,t,i,r,a,s){if(i.textBox||i.iconBox){let o;this.collisionBoxArrays.has(e)?o=this.collisionBoxArrays.get(e):(o=new Map,this.collisionBoxArrays.set(e,o));let n;o.has(t)?n=o.get(t):(n={text:null,icon:null},o.set(t,n)),i.textBox&&(n.text=r.box),i.iconBox&&(n.icon=a.box)}if(s){let o=this.collisionCircleArrays[e];o===void 0&&(o=this.collisionCircleArrays[e]=[]);for(let n=0;n<s.circles.length;n+=4)o.push(s.circles[n+0]-100),o.push(s.circles[n+1]-100),o.push(s.circles[n+2]),o.push(+!!s.collisionDetected)}}markUsedJustification(e,t,i,r){let a={left:i.leftJustifiedTextSymbolIndex,center:i.centerJustifiedTextSymbolIndex,right:i.rightJustifiedTextSymbolIndex},s;s=r===2?i.verticalPlacedTextSymbolIndex:a[NT(t)];let o=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex,i.verticalPlacedTextSymbolIndex];for(let n of o)n>=0&&(s>=0&&n!==s?e.text.placedSymbolArray.get(n).crossTileID=0:e.text.placedSymbolArray.get(n).crossTileID=i.crossTileID)}markUsedOrientation(e,t,i){let r=t===1||t===3?t:0,a=t===2?t:0,s=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];for(let o of s)e.text.placedSymbolArray.get(o).placedOrientation=r;i.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;let t=this.prevPlacement,i=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;let r=t?t.symbolFadeChange(e):1,a=t?t.opacities:{},s=t?t.variableOffsets:{},o=t?t.placedOrientations:{};for(let n in this.placements){let l=this.placements[n],u=a[n];u?(this.opacities[n]=new fa(u,r,l.text,l.icon),i||=l.text!==u.text.placed,i||=l.icon!==u.icon.placed):(this.opacities[n]=new fa(null,r,l.text,l.icon,l.skipFade),i||=l.text||l.icon)}for(let n in a){let l=a[n];if(!this.opacities[n]){let u=new fa(l,r,!1,!1);u.isHidden()||(this.opacities[n]=u,i||=l.text.placed,i||=l.icon.placed)}}for(let n in s)!this.variableOffsets[n]&&this.opacities[n]&&!this.opacities[n].isHidden()&&(this.variableOffsets[n]=s[n]);for(let n in o)!this.placedOrientations[n]&&this.opacities[n]&&!this.opacities[n].isHidden()&&(this.placedOrientations[n]=o[n]);if(t&&t.lastPlacementChangeTime===void 0)throw Error("Last placement time for previous placement is not defined");i?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){let i={};for(let r of t){let a=r.getBucket(e);a&&r.latestFeatureIndex&&e.id===a.layerIds[0]&&this.updateBucketOpacities(a,r.tileID,i,r.collisionBoxArray)}}updateBucketOpacities(e,t,i,r){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();let a=e.layers[0],s=a.layout,o=new fa(null,0,!1,!1,!0),n=s.get("text-allow-overlap"),l=s.get("icon-allow-overlap"),u=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),h=s.get("text-rotation-alignment")==="map",c=s.get("text-pitch-alignment")==="map",p=s.get("icon-text-fit")!=="none",d=new fa(null,0,n&&(l||!e.hasIconData()||s.get("icon-optional")),l&&(n||!e.hasTextData()||s.get("text-optional")),!0);!e.collisionArrays&&r&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(r);let f=(_,g,x)=>{for(let y=0;y<g/4;y++)_.opacityVertexArray.emplaceBack(x);_.hasVisibleVertices||=x!==ma},m=this.collisionBoxArrays.get(e.bucketInstanceId);for(let _=0;_<e.symbolInstances.length;_++){let g=e.symbolInstances.get(_),{numHorizontalGlyphVertices:x,numVerticalGlyphVertices:y,crossTileID:v}=g,w=i[v],b=this.opacities[v];w?b=o:b||(b=d,this.opacities[v]=b),i[v]=!0;let T=x>0||y>0,I=g.numIconVertices>0,M=this.placedOrientations[g.crossTileID],D=M===2,L=M===1||M===3;if(T){let P=Lp(b.text),S=D?ma:P;f(e.text,x,S);let F=L?ma:P;f(e.text,y,F);let O=b.text.isHidden(),H=[g.rightJustifiedTextSymbolIndex,g.centerJustifiedTextSymbolIndex,g.leftJustifiedTextSymbolIndex];for(let ue of H)ue>=0&&(e.text.placedSymbolArray.get(ue).hidden=O||D?1:0);g.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(g.verticalPlacedTextSymbolIndex).hidden=O||L?1:0);let Y=this.variableOffsets[g.crossTileID];Y&&this.markUsedJustification(e,Y.anchor,g,M);let ie=this.placedOrientations[g.crossTileID];ie&&(this.markUsedJustification(e,"left",g,ie),this.markUsedOrientation(e,ie,g))}if(I){let P=Lp(b.icon),S=!(p&&g.verticalPlacedIconSymbolIndex&&D);if(g.placedIconSymbolIndex>=0){let F=S?P:ma;f(e.icon,g.numIconVertices,F),e.icon.placedSymbolArray.get(g.placedIconSymbolIndex).hidden=b.icon.isHidden()}if(g.verticalPlacedIconSymbolIndex>=0){let F=S?ma:P;f(e.icon,g.numVerticalIconVertices,F),e.icon.placedSymbolArray.get(g.verticalPlacedIconSymbolIndex).hidden=b.icon.isHidden()}}let z=m?.has(_)?m.get(_):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){let P=e.collisionArrays[_];if(P){let S=new E(0,0);if(P.textBox||P.verticalTextBox){let F=!0;if(u){let O=this.variableOffsets[v];O?(S=Rp(O.anchor,O.width,O.height,O.textOffset,O.textBoxScale),h&&S._rotate(c?-this.transform.bearingInRadians:this.transform.bearingInRadians)):F=!1}if(P.textBox||P.verticalTextBox){let O;P.textBox&&(O=D),P.verticalTextBox&&(O=L),kp(e.textCollisionBox.collisionVertexArray,b.text.placed,!F||O,z.text,S.x,S.y)}}if(P.iconBox||P.verticalIconBox){let F=!!(!L&&P.verticalIconBox),O;P.iconBox&&(O=F),P.verticalIconBox&&(O=!F),kp(e.iconCollisionBox.collisionVertexArray,b.icon.placed,O,z.icon,p?S.x:0,p?S.y:0)}}}}if(e.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);e.bucketInstanceId in this.collisionCircleArrays&&(e.collisionCircleArray=this.collisionCircleArrays[e.bucketInstanceId],delete this.collisionCircleArrays[e.bucketInstanceId])}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){let i=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*i>e}setStale(){this.stale=!0}};function kp(e,t,i,r,a,s){(!r||r.length===0)&&(r=[0,0,0,0]);let o=r[0]-100,n=r[1]-100,l=r[2]-100,u=r[3]-100;e.emplaceBack(+!!t,+!!i,a||0,s||0,o,n),e.emplaceBack(+!!t,+!!i,a||0,s||0,l,n),e.emplaceBack(+!!t,+!!i,a||0,s||0,l,u),e.emplaceBack(+!!t,+!!i,a||0,s||0,o,u)}const _P=2**25,gP=2**24,yP=2**17,vP=2**16;function Lp(e){if(e.opacity===0&&!e.placed)return 0;if(e.opacity===1&&e.placed)return 4294967295;let t=+!!e.placed,i=Math.floor(e.opacity*127);return i*_P+t*gP+i*yP+t*vP+i*512+t*256+i*2+t}const ma=0;var xP=class{constructor(e){this._sortAcrossTiles=e.layout.get("symbol-z-order")!=="viewport-y"&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,t,i,r,a){let s=this._bucketParts;for(;this._currentTileIndex<e.length;){let o=e[this._currentTileIndex];if(t.getBucketParts(s,r,o,this._sortAcrossTiles),this._currentTileIndex++,a())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,s.sort((o,n)=>o.sortKey-n.sortKey));this._currentPartIndex<s.length;){let o=s[this._currentPartIndex];if(t.placeLayerBucketPart(o,this._seenCrossTileIDs,i),this._currentPartIndex++,a())return!0}return!1}},bP=class{constructor(e,t,i,r,a,s,o,n){this.placement=new mP(e,t,s,o,n),this._currentPlacementIndex=i.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=a,this._done=!1}isDone(){return this._done}continuePlacement(e,t,i){let r=_e(),a=()=>!this._forceFullPlacement&&_e()-r>2;for(;this._currentPlacementIndex>=0;){let s=t[e[this._currentPlacementIndex]],o=this.placement.collisionIndex.transform.zoom;if(Wm(s)&&s.layout&&(!s.minzoom||s.minzoom<=o)&&(!s.maxzoom||s.maxzoom>o)){if(this._inProgressLayer||=new xP(s),this._inProgressLayer.continuePlacement(i[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}};const Fp=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array
vendor: 2,913 bytes, line 2
2],Ie=new Uint32Array(96);var wP=class V_{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[i,r]=new Uint8Array(t,0,2);if(i!==219)throw Error("Data does not appear to be in a KDBush format.");let a=r>>4;if(a!==1)throw Error(`Got v${a} data when expected v1.`);let s=Fp[r&15];if(!s)throw Error("Unrecognized array type.");let[o]=new Uint16Array(t,2,1),[n]=new Uint32Array(t,4,1);return new V_(n,o,s,void 0,t)}constructor(t,i=64,r=Float64Array,a=ArrayBuffer,s){if(isNaN(t)||t<0)throw Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let o=Fp.indexOf(this.ArrayType),n=t*2*this.ArrayType.BYTES_PER_ELEMENT,l=t*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-l%8)%8;if(o<0)throw Error(`Unexpected typed array class: ${r}.`);if(s)this.data=s,this.ids=new this.IndexArrayType(s,8,t),this.coords=new r(s,8+l+u,t*2),this._pos=t*2,this._finished=!0;else{let h=this.data=new a(8+n+l+u);this.ids=new this.IndexArrayType(h,8,t),this.coords=new r(h,8+l+u,t*2),this._pos=0,this._finished=!1,new Uint8Array(h,0,2).set([219,16+o]),new Uint16Array(h,2,1)[0]=i,new Uint32Array(h,4,1)[0]=t}}add(t,i){let r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=i,r}finish(){let t=this._pos>>1;if(t!==this.numItems)throw Error(`Added ${t} items when expected ${this.numItems}.`);return Tu(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,i,r,a){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:s,coords:o,nodeSize:n}=this;Ie[0]=0,Ie[1]=s.length-1,Ie[2]=0;let l=3,u=[];for(;l>0;){let h=Ie[--l],c=Ie[--l],p=Ie[--l];if(c-p<=n){for(let _=p;_<=c;_++){let g=o[2*_],x=o[2*_+1];g>=t&&g<=r&&x>=i&&x<=a&&u.push(s[_])}continue}let d=p+c>>1,f=o[2*d],m=o[2*d+1];f>=t&&f<=r&&m>=i&&m<=a&&u.push(s[d]),(h===0?t<=f:i<=m)&&(Ie[l++]=p,Ie[l++]=d-1,Ie[l++]=1-h),(h===0?r>=f:a>=m)&&(Ie[l++]=d+1,Ie[l++]=c,Ie[l++]=1-h)}return u}within(t,i,r){let a=[];return this.withinInto(t,i,r,a),a}withinInto(t,i,r,a){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:s,coords:o,nodeSize:n}=this;Ie[0]=0,Ie[1]=s.length-1,Ie[2]=0;let l=3,u=0,h=r*r;for(;l>0;){let c=Ie[--l],p=Ie[--l],d=Ie[--l];if(p-d<=n){for(let g=d;g<=p;g++)Bp(o[2*g],o[2*g+1],t,i)<=h&&(a[u++]=s[g]);continue}let f=d+p>>1,m=o[2*f],_=o[2*f+1];Bp(m,_,t,i)<=h&&(a[u++]=s[f]),(c===0?t-r<=m:i-r<=_)&&(Ie[l++]=d,Ie[l++]=f-1,Ie[l++]=1-c),(c===0?t+r>=m:i+r>=_)&&(Ie[l++]=f+1,Ie[l++]=p,Ie[l++]=1-c)}return u}};function Tu(e,t,i,r,a,s){if(a-r<=i)return;let o=r+a>>1;j_(e,t,o,r,a,s),Tu(e,t,i,r,o-1,1-s),Tu(e,t,i,o+1,a,1-s)}function j_(e,t,i,r,a,s){for(;a>r;){if(a-r>600){let u=a-r+1,h=i-r+1,c=Math.log(u),p=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*p*(u-p)/u)*(h-u/2<0?-1:1);
vendor: 5,560 bytes, lines 2-29
2j_(e,t,i,Math.max(r,Math.floor(i-h*p/u+d)),Math.min(a,Math.floor(i+(u-h)*p/u+d)),s)}let o=t[2*i+s],n=r,l=a;for(_a(e,t,r,i),t[2*a+s]>o&&_a(e,t,r,a);n<l;){for(_a(e,t,n,l),n++,l--;t[2*n+s]<o;)n++;for(;t[2*l+s]>o;)l--}t[2*r+s]===o?_a(e,t,r,l):(l++,_a(e,t,l,a)),l<=i&&(r=l+1),i<=l&&(a=l-1)}}function _a(e,t,i,r){Zn(e,i,r),Zn(t,2*i,2*r),Zn(t,2*i+1,2*r+1)}function Zn(e,t,i){let r=e[t];e[t]=e[i],e[i]=r}function Bp(e,t,i,r){let a=e-i,s=t-r;return a*a+s*s}const ga=512/C/2;var TP=class{constructor(e,t,i){this.tileID=e,this.bucketInstanceId=i,this._symbolsByKey={};let r=new Map;for(let a=0;a<t.length;a++){let s=t.get(a),o=s.key,n=r.get(o);n?n.push(s):r.set(o,[s])}for(let[a,s]of r){let o={positions:s.map(n=>({x:Math.floor(n.anchorX*ga),y:Math.floor(n.anchorY*ga)})),crossTileIDs:s.map(n=>n.crossTileID)};if(o.positions.length>128){let n=new wP(o.positions.length,16,Uint16Array);for(let{x:l,y:u}of o.positions)n.add(l,u);n.finish(),delete o.positions,o.index=n}this._symbolsByKey[a]=o}}getScaledCoordinates(e,t){let{x:i,y:r,z:a}=this.tileID.canonical,{x:s,y:o,z:n}=t.canonical,l=n-a,u=ga/2**l,h=(s*C+e.anchorX)*u,c=(o*C+e.anchorY)*u,p=i*C*ga,d=r*C*ga;return{x:Math.floor(h-p),y:Math.floor(c-d)}}findMatches(e,t,i){let r=this.tileID.canonical.z<t.canonical.z?1:2**(this.tileID.canonical.z-t.canonical.z);for(let a=0;a<e.length;a++){let s=e.get(a);if(s.crossTileID)continue;let o=this._symbolsByKey[s.key];if(!o)continue;let n=this.getScaledCoordinates(s,t);if(o.index){let l=o.index.range(n.x-r,n.y-r,n.x+r,n.y+r).sort();for(let u of l){let h=o.crossTileIDs[u];if(!i[h]){i[h]=!0,s.crossTileID=h;break}}}else if(o.positions)for(let l=0;l<o.positions.length;l++){let u=o.positions[l],h=o.crossTileIDs[l];if(Math.abs(u.x-n.x)<=r&&Math.abs(u.y-n.y)<=r&&!i[h]){i[h]=!0,s.crossTileID=h;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:e})=>e)}},SP=class{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}},PP=class{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){let t=Math.round((e-this.lng)/360);if(t!==0)for(let i in this.indexes){let r=this.indexes[i],a={};for(let s in r){let o=r[s];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+t),a[o.tileID.key]=o}this.indexes[i]=a}this.lng=e}addBucket(e,t,i){if(this.indexes[e.overscaledZ]?.[e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let a=0;a<t.symbolInstances.length;a++){let s=t.symbolInstances.get(a);s.crossTileID=0}this.usedCrossTileIDs[e.overscaledZ]||={};let r=this.usedCrossTileIDs[e.overscaledZ];for(let a in this.indexes){let s=this.indexes[a];if(Number(a)>e.overscaledZ)for(let o in s){let n=s[o];n.tileID.isChildOf(e)&&n.findMatches(t.symbolInstances,e,r)}else{let o=s[e.scaledTo(Number(a)).key];o&&o.findMatches(t.symbolInstances,e,r)}}for(let a=0;a<t.symbolInstances.length;a++){let s=t.symbolInstances.get(a);s.crossTileID||(s.crossTileID=i.generate(),r[s.crossTileID]=!0)}return this.indexes[e.overscaledZ]===void 0&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new TP(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(let i of t.getCrossTileIDsLists())for(let r of i)delete this.usedCrossTileIDs[e][r]}removeStaleBuckets(e){let t=!1;for(let i in this.indexes){let r=this.indexes[i];for(let a in r)e[r[a].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,r[a]),delete r[a],t=!0)}return t}},N_=class{constructor(){this.layerIndexes={},this.crossTileIDs=new SP,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,i){let r=this.layerIndexes[e.id];r===void 0&&(r=this.layerIndexes[e.id]=new PP);let a=!1,s={};r.handleWrapJump(i);for(let o of t){let n=o.getBucket(e);e.id===n?.layerIds[0]&&(n.bucketInstanceId||=(this.maxBucketInstanceId+=1,this.maxBucketInstanceId),r.addBucket(o.tileID,n,this.crossTileIDs)&&(a=!0),s[n.bucketInstanceId]=!0)}return r.removeStaleBuckets(s)&&(a=!0),a}pruneUnusedLayers(e){let t={};for(let i of e)t[i]=!0;for(let i in this.layerIndexes)t[i]||delete this.layerIndexes[i]}},IP=`#ifdef GL_ES 3precision mediump float; 4#else 5#if !defined(lowp) 6#define lowp 7#endif 8#if !defined(mediump) 9#define mediump 10#endif 11#if !defined(highp) 12#define highp 13#endif 14#endif 15out highp vec4 fragColor;`,EP=`#ifdef GL_ES 16precision highp float; 17#else 18#if !defined(lowp) 19#define lowp 20#endif 21#if !defined(mediump) 22#define mediump 23#endif 24#if !defined(highp) 25#define highp 26#endif 27#endif 28vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 29);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);
29return (tile_units_to_pixels*pos+offset)/pattern_size;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+ c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+ c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+ c 30);} 31#ifdef TERRAIN3D 32uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; 33#endif 34const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { 35#ifdef TERRAIN3D 36highp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); 37#else 38return 1.0; 39#endif 40}float calculate_visibility(vec4 pos) { 41#ifdef TERRAIN3D 42vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; 43#else 44return 1.0; 45#endif 46}float ele(vec2 pos) { 47#ifdef TERRAIN3D 48vec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; 49#else 50return 0.0; 51#endif 52}float get_elevation(vec2 pos) { 53#ifdef TERRAIN3D 54#ifdef GLOBE 55if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;} 56#endif 57vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; 58#else 59return 0.0; 60#endif 61}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;`,MP=`uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity; 62#ifdef OVERDRAW_INSPECTOR 63fragColor=vec4(1.0); 64#endif 65}`,AP="layout(location=0) in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}",CP=`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity; 66#ifdef OVERDRAW_INSPECTOR 67fragColor=vec4(1.0); 68#endif 69}`,DP="uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;layout(location=0) in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}",zP=`in vec3 v_data;flat in float v_visibility; 70#pragma maplibre: define highp vec4 color 71#pragma maplibre: define mediump float radius 72#pragma maplibre: define lowp float blur 73#pragma maplibre: define lowp float opacity 74#pragma maplibre: define highp vec4 stroke_color 75#pragma maplibre: define mediump float stroke_width 76#pragma maplibre: define lowp float stroke_opacity 77void main() { 78#pragma maplibre: initialize highp vec4 color 79#pragma maplibre: initialize mediump float radius 80#pragma maplibre: initialize lowp float blur 81#pragma maplibre: initialize lowp float opacity 82#pragma maplibre: initialize highp vec4 stroke_color 83#pragma maplibre: initialize mediump float stroke_width 84#pragma maplibre: initialize lowp float stroke_opacity 85vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius
85/(radius+stroke_width));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;} 86#ifdef OVERDRAW_INSPECTOR 87fragColor=vec4(1.0); 88#endif 89}`,RP=`uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;layout(location=0) in vec2 a_pos;out vec3 v_data;flat out float v_visibility; 90#pragma maplibre: define highp vec4 color 91#pragma maplibre: define mediump float radius 92#pragma maplibre: define lowp float blur 93#pragma maplibre: define lowp float opacity 94#pragma maplibre: define highp vec4 stroke_color 95#pragma maplibre: define mediump float stroke_width 96#pragma maplibre: define lowp float stroke_opacity 97void main(void) { 98#pragma maplibre: initialize highp vec4 color 99#pragma maplibre: initialize mediump float radius 100#pragma maplibre: initialize lowp float blur 101#pragma maplibre: initialize lowp float opacity 102#pragma maplibre: initialize highp vec4 stroke_color 103#pragma maplibre: initialize mediump float stroke_width 104#pragma maplibre: initialize lowp float stroke_opacity 105vec2 pos_raw=a_pos+32768.0;vec2 extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);vec2 circle_center=floor(pos_raw/8.0)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) { 106#ifdef GLOBE 107vec3 center_vector=projectToSphere(circle_center); 108#endif 109float angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else { 110#ifdef GLOBE 111vec4 projected_center=interpolateProjection(circle_center,center_vector,ele); 112#else 113vec4 projected_center=projectTileWithElevation(circle_center,ele); 114#endif 115corner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);} 116#ifdef GLOBE 117vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele); 118#else 119gl_Position=projectTileWithElevation(corner_position,ele); 120#endif 121} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`,Op="void main() {fragColor=vec4(1.0);}";const ii={prelude:se(IP,EP),projectionMercator:se(` 122void clipAntimeridian() {}`,"float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}"),projectionGlobe:se("uniform bool u_projection_clip_antimeridian;in highp float v_projection_tile_x;void clipAntimeridian() {if (u_projection_clip_antimeridian && (v_projection_tile_x < 0.0 || v_projection_tile_x >=8192.0)) {discard;}}",`#define GLOBE_RADIUS 6371008.8 123uniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;out highp float v_projection_tile_x;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos 124);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float t=exp(PI-(mercator_pos_y*PI*2.0));return (2.0*t)/(t*t+1.0);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY);if (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;float spherical_x=mercator_pos.x*PI*2.0+PI;float t=exp(PI-(mercator_pos.y*PI*2.0));
124float t2=t*t;float denom=t2+1.0;float sin_sy=(t2-1.0)/denom;float cos_sy=(2.0*t)/denom;vec3 pos=vec3(sin(spherical_x)*cos_sy,sin_sy,cos(spherical_x)*cos_sy 125);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {v_projection_tile_x=posInTile.x;vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {v_projection_tile_x=posInTile.x;vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}`),background:se(MP,AP),backgroundPattern:se(CP,DP),circle:se(zP,RP),clippingMask:se(Op,"layout(location=0) in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:se(`uniform highp float u_intensity;in vec2 v_extrude; 126#pragma maplibre: define highp float weight 127#define GAUSS_COEF 0.3989422804014327 128void main() { 129#pragma maplibre: initialize highp float weight 130float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0); 131#ifdef OVERDRAW_INSPECTOR 132fragColor=vec4(1.0); 133#endif 134}`,`uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;layout(location=0) in vec2 a_pos;out vec2 v_extrude; 135#pragma maplibre: define highp float weight 136#pragma maplibre: define mediump float radius 137const highp float ZERO=1.0/255.0/16.0; 138#define GAUSS_COEF 0.3989422804014327 139void main(void) { 140#pragma maplibre: initialize highp float weight 141#pragma maplibre: initialize mediump float radius 142vec2 pos_raw=a_pos+32768.0;vec2 unscaled_extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 circle_center=floor(pos_raw/8.0); 143#ifdef GLOBE 144vec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0); 145#else 146gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center)); 147#endif 148}`),heatmapTexture:se(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity; 149#ifdef OVERDRAW_INSPECTOR 150fragColor=vec4(0.0); 151#endif 152}`,"uniform mat4 u_matrix;uniform vec2 u_world;layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:se("flat in float v_placed;flat in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}","layout(location=0) in vec2 a_anchor_pos;layout(location=1) in vec2 a_placed;layout(location=2) in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;flat out float v_placed;flat out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:se("flat in float v_radius;in vec2 v_extrude;flat in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);fragColor=color*alpha*opacity_t;}","layout(location=0) in vec2 a_pos;layout(location=1) in float a_radius;layout(location=2) in vec2 a_flags;uniform vec2 u_viewport_size;flat out float v_radius;out vec2 v_extrude;flat out float v_collision;void main() {float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),colorRelief:se(`#ifdef GL_ES 153precision highp float; 154#endif 155uniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {float x=(float(stop)+0.5)/float(u_color_ramp_size);vec4 data=texture(u_elevation_stops,vec2(x,0))*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else 156{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0)); 157#ifdef OVERDRAW_INSPECTOR 158fragColor=vec4(1.0); 159#endif 160}`,"uniform vec2 u_dimension;layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),debug:se("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}","layout(location=0) in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}"),depth:se(Op,`layout(location=0) in vec2 a_pos;void main() { 161#ifdef GLOBE 162gl_Position=projectTileFor3D(a_pos,0.0); 163#else 164gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0); 165#endif 166}`),fill:se(`#pragma maplibre: define highp vec4 color 167#pragma maplibre: define lowp float opacity 168void main() { 169#pragma maplibre: initialize highp vec4 color 170#pragma maplibre: initialize lowp float opacity 171fragColor=color*opacity; 172#ifdef OVERDRAW_INSPECTOR 173fragColor=vec4(1.0); 174#endif 175}`,`uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos; 176#pragma maplibre: define highp vec4 color 177#pragma maplibre: define lowp float opacity 178void main() { 179#pragma maplibre: initialize highp vec4 color 180#pragma maplibre: initialize lowp float opacity 181if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}gl_Position=projectTile(a_pos+u_fill_translate,a_pos);}`),fillOutline:se(`in vec2 v_pos; 182#ifdef GLOBE 183in float v_depth; 184#endif 185#pragma maplibre: define highp vec4 outline_color 186#pragma maplibre: define lowp float opacity 187void main() { 188#pragma maplibre: initialize highp vec4 outline_color 189#pragma maplibre: initialize lowp float opacity 190float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity); 191#ifdef GLOBE 192if (v_depth > 1.0) {discard;} 193#endif 194#ifdef OVERDRAW_INSPECTOR 195fragColor=vec4(1.0); 196#endif 197}`,`uniform vec2 u_world;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos; 198#ifdef GLOBE 199out float v_depth; 200#endif 201#pragma maplibre: define highp vec4 outline_color 202#pragma maplibre: define lowp float opacity 203void main() { 204#pragma maplibre: initialize highp vec4 outline_color 205#pragma maplibre: initialize lowp float opacity 206if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; 207#ifdef GLOBE 208v_depth=gl_Position.z/gl_Position.w; 209#endif 210}`),fillOutlinePattern:se(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos; 211#ifdef GLOBE 212in float v_depth; 213#endif 214#pragma maplibre: define lowp float opacity 215#pragma maplibre: define lowp vec4 pattern_from 216#pragma maplibre: define lowp vec4 pattern_to 217void main() { 218#pragma maplibre: initialize lowp float opacity 219#pragma maplibre: initialize mediump vec4 pattern_from 220#pragma maplibre: initialize mediump vec4 pattern_to 221vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity; 222#ifdef GLOBE 223if (v_depth > 1.0) {discard;} 224#endif 225#ifdef OVERDRAW_INSPECTOR 226fragColor=vec4(1.0); 227#endif 228}`,`uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos; 229#ifdef GLOBE 230out float v_depth; 231#endif 232#pragma maplibre: define lowp float opacity 233#pragma maplibre: define lowp vec4 pattern_from 234#pragma maplibre: define lowp vec4 pattern_to 235#pragma maplibre: define lowp float pixel_ratio_from 236#pragma maplibre: define lowp float pixel_ratio_to 237void main() { 238#pragma maplibre: initialize lowp float opacity 239#pragma maplibre: initialize mediump vec4 pattern_from 240#pragma maplibre: initialize mediump vec4 pattern_to 241#pragma maplibre: initialize lowp float pixel_ratio_from 242#pragma maplibre: initialize lowp float pixel_ratio_to 243if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; 244#ifdef GLOBE 245v_depth=gl_Position.z/gl_Position.w; 246#endif 247}`),fillPattern:se(`#ifdef GL_ES 248precision highp float; 249#endif 250uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b; 251#pragma maplibre: define lowp float opacity 252#pragma maplibre: define lowp vec4 pattern_from 253#pragma maplibre: define lowp vec4 pattern_to 254void main() { 255#pragma maplibre: initialize lowp float opacity 256#pragma maplibre: initialize mediump vec4 pattern_from 257#pragma maplibre: initialize mediump vec4 pattern_to 258vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity; 259#ifdef OVERDRAW_INSPECTOR 260fragColor=vec4(1.0); 261#endif 262}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b; 263#pragma maplibre: define lowp float opacity 264#pragma maplibre: define lowp vec4 pattern_from 265#pragma maplibre: define lowp vec4 pattern_to 266#pragma maplibre: define lowp float pixel_ratio_from 267#pragma maplibre: define lowp float pixel_ratio_to 268void main() { 269#pragma maplibre: initialize lowp float opacity 270#pragma maplibre: initialize mediump vec4 pattern_from 271#pragma maplibre: initialize mediump vec4 pattern_to 272#pragma maplibre: initialize lowp float pixel_ratio_from 273#pragma maplibre: initialize lowp float pixel_ratio_to 274if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:se(`in vec4 v_color;void main() {fragColor=v_color; 275#ifdef OVERDRAW_INSPECTOR 276fragColor=vec4(1.0); 277#endif 278}`,`uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;layout(location=1) in vec4 a_normal_ed; 279#ifdef TERRAIN3D 280layout(location=2) in vec2 a_centroid; 281#endif 282out vec4 v_color; 283#pragma maplibre: define highp float base 284#pragma maplibre: define highp float height 285#pragma maplibre: define highp vec4 color 286void main() { 287#pragma maplibre: initialize highp float base 288#pragma maplibre: initialize highp float height 289#pragma maplibre: initialize highp vec4 color 290vec3 normal=a_normal_ed.xyz; 291#ifdef TERRAIN3D 292float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); 293#else 294float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; 295#endif 296base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate; 297#ifdef GLOBE 298vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor
2983D(posInTile,spherePos,elevation); 299#else 300gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0); 301#endif 302float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0); 303#ifdef GLOBE 304mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition); 305#endif 306directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:se(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting; 307#pragma maplibre: define lowp float base 308#pragma maplibre: define lowp float height 309#pragma maplibre: define lowp vec4 pattern_from 310#pragma maplibre: define lowp vec4 pattern_to 311#pragma maplibre: define lowp float pixel_ratio_from 312#pragma maplibre: define lowp float pixel_ratio_to 313void main() { 314#pragma maplibre: initialize lowp float base 315#pragma maplibre: initialize lowp float height 316#pragma maplibre: initialize mediump vec4 pattern_from 317#pragma maplibre: initialize mediump vec4 pattern_to 318#pragma maplibre: initialize lowp float pixel_ratio_from 319#pragma maplibre: initialize lowp float pixel_ratio_to 320vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting; 321#ifdef OVERDRAW_INSPECTOR 322fragColor=vec4(1.0); 323#endif 324}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;layout(location=0) in vec2 a_pos;layout(location=1) in vec4 a_normal_ed; 325#ifdef TERRAIN3D 326layout(location=2) in vec2 a_centroid; 327#endif 328#ifdef GLOBE 329out vec3 v_sphere_pos; 330#endif 331out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting; 332#pragma maplibre: define lowp float base 333#pragma maplibre: define lowp float height 334#pragma maplibre: define lowp vec4 pattern_from 335#pragma maplibre: define lowp vec4 pattern_to 336#pragma maplibre: define lowp float pixel_ratio_from 337#pragma maplibre: define lowp float pixel_ratio_to 338void main() { 339#pragma maplibre: initialize lowp float base 340#pragma maplibre: initialize lowp float height 341#pragma maplibre: initialize mediump vec4 pattern_from 342#pragma maplibre: initialize mediump vec4 pattern_to 343#pragma maplibre: initialize lowp float pixel_ratio_from 344#pragma maplibre: initialize lowp float pixel_ratio_to 345vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; 346#ifdef TERRAIN3D 347float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); 348#else 349float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; 350#endif 351base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate; 352#ifdef GLOBE 353vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation); 354#else 355gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0); 356#endif 357vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 358? a_pos 359: vec2(edgedistance,elevation*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:se(`#ifdef GL_ES 360precision highp float; 361#endif 362uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {vec2 epsilon=1.0/u_dimension;float tileSize=u_dimension.x-2.0;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))*tileSize/p
362ow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0); 363#ifdef OVERDRAW_INSPECTOR 364fragColor=vec4(1.0); 365#endif 366}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;layout(location=0) in vec2 a_pos;layout(location=1) in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:se(`uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES]; 367#define PI 3.141592653589793 368#define STANDARD 0 369#define COMBINED 1 370#define IGOR 2 371#define MULTIDIRECTIONAL 3 372#define BASIC 4 373float get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else 374{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else 375{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);} 376#ifdef OVERDRAW_INSPECTOR 377fragColor=vec4(1.0); 378#endif 379}`,"uniform mat4 u_matrix;layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),line:se(`uniform lowp float u_device_pixel_ratio;flat in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale; 380#ifdef GLOBE 381in float v_depth; 382#endif 383#pragma maplibre: define highp vec4 color 384#pragma maplibre: define lowp float blur 385#pragma maplibre: define lowp float opacity 386void main() { 387#pragma maplibre: initialize highp vec4 color 388#pragma maplibre: initialize lowp float blur 389#pragma maplibre: initialize lowp float opacity 390clipAntimeridian();float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);fragColor=color*(alpha*opacity); 391#ifdef GLOBE 392if (v_depth > 1.0) {discard;} 393#endif 394#ifdef OVERDRAW_INSPECTOR 395fragColor=vec4(1.0); 396#endif 397}`,` 398#define scale 0.015873016 399layout(location=0) in vec2 a_pos_normal;layout(location=1) in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;flat out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar; 400#ifdef GLOBE 401out float v_depth; 402#endif 403#pragma maplibre: define highp vec4 color 404#pragma maplibre: define lowp float blur 405#pragma maplibre: define lowp float opacity 406#pragma maplibre: define mediump float gapwidth 407#pragma maplibre: define lowp float offset 408#pragma maplibre: define mediump float width 409void main() { 410#pragma maplibre: initialize highp vec4 color 411#pragma maplibre: initialize lowp float blur 412#pragma maplibre: initialize lowp float opacity 413#pragma maplibre: initialize mediump float gapwidth 414#pragma maplibre: initialize lowp float offset 415#pragma maplibre: initialize mediump float width 416if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);
416float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 417#ifdef GLOBE 418v_depth=gl_Position.z/gl_Position.w; 419#endif 420#ifdef TERRAIN3D 421v_gamma_scale=1.0; 422#else 423float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 424#endif 425v_width2=vec2(outset,inset);}`),lineGradient:se(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;flat in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv; 426#ifdef GLOBE 427in float v_depth; 428#endif 429#pragma maplibre: define lowp float blur 430#pragma maplibre: define lowp float opacity 431void main() { 432#pragma maplibre: initialize lowp float blur 433#pragma maplibre: initialize lowp float opacity 434clipAntimeridian();float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity); 435#ifdef GLOBE 436if (v_depth > 1.0) {discard;} 437#endif 438#ifdef OVERDRAW_INSPECTOR 439fragColor=vec4(1.0); 440#endif 441}`,` 442#define scale 0.015873016 443layout(location=0) in vec2 a_pos_normal;layout(location=1) in vec4 a_data;layout(location=2) in float a_uv_x;layout(location=3) in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;flat out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv; 444#ifdef GLOBE 445out float v_depth; 446#endif 447#pragma maplibre: define lowp float blur 448#pragma maplibre: define lowp float opacity 449#pragma maplibre: define mediump float gapwidth 450#pragma maplibre: define lowp float offset 451#pragma maplibre: define mediump float width 452void main() { 453#pragma maplibre: initialize lowp float blur 454#pragma maplibre: initialize lowp float opacity 455#pragma maplibre: initialize mediump float gapwidth 456#pragma maplibre: initialize lowp float offset 457#pragma maplibre: initialize mediump float width 458if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 459#ifdef GLOBE 460v_depth=gl_Position.z/gl_Position.w; 461#endif 462#ifdef TERRAIN3D 463v_gamma_scale=1.0; 464#else 465float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 466#endif 467v_width2=vec2(outset,inset);}`),linePattern:se(`#ifdef GL_ES 468precision highp float; 469#endif 470uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;flat in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;flat in float v_width; 471#ifdef GLOBE 472in float v_depth; 473#endif 474#pragma maplibre: define lowp vec4 pattern_from 475#pragma maplibre: define lowp vec4 pattern_to 476#pragma maplibre: define lowp float pixel_ratio_from 477#pragma maplibre: define lowp float pixel_ratio_to 478#pragma maplibre: define lowp float blur 479#pragma maplibre: define lowp float opacity 480void main() { 481#pragma maplibre: initialize mediump vec4 pattern_from 482#pragma maplibre: initialize mediump vec4 pattern_to 483#pragma maplibre: initialize lowp float pixel_ratio_from 484#pragma maplibre: initialize lowp float pixel_ratio_to 485#pragma maplibre: initialize lowp float blur 486#pragma maplibre: initialize lowp float opacity 487clipAntimeridian();vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity; 488#ifdef GLOBE 489if (v_depth > 1.0) {discard;} 490#endif 491#ifdef OVERDRAW_INSPECTOR 492fragColor=vec4(1.0); 493#endif 494}`,` 495#define scale 0.015873016 496#define LINE_DISTANCE_SCALE 2.0 497layout(location=0) in vec2 a_pos_normal;layout(location=1) in vec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;flat out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;flat out float v_width; 498#ifdef GLOBE 499out float v_depth; 500#endif 501#pragma maplibre: define lowp float blur 502#pragma maplibre: define lowp float opacity 503#pragma maplibre: define lowp float offset 504#pragma maplibre: define mediump float gapwidth 505#pragma maplibre: define mediump float width 506#pragma maplibre: define lowp float floorwidth 507#pragma maplibre: define lowp vec4 pattern_from 508#pragma maplibre: define lowp vec4 pattern_to 509#pragma maplibre: define lowp float pixel_ratio_from 510#pragma maplibre: define lowp float pixel_ratio_to 511void main() { 512#pragma maplibre: initialize lowp float blur 513#pragma maplibre: initialize lowp float opacity 514#pragma maplibre: initialize lowp float offset 515#pragma maplibre: initialize mediump float gapwidth 516#pragma maplibre: initialize mediump float width 517#pragma maplibre: initialize lowp float floorwidth 518#pragma maplibre: initialize mediump vec4 pattern_from 519#pragma maplibre: initialize mediump vec4 pattern_to 520#pragma maplibre: initialize lowp float pixel_ratio_from 521#pragma maplibre: initialize lowp float pixel_ratio_to 522if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);
522float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 523#ifdef GLOBE 524v_depth=gl_Position.z/gl_Position.w; 525#endif 526#ifdef TERRAIN3D 527v_gamma_scale=1.0; 528#else 529float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 530#endif 531v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:se(`uniform lowp float u_device_pixel_ratio;uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;flat in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale; 532#ifdef GLOBE 533in float v_depth; 534#endif 535#pragma maplibre: define highp vec4 color 536#pragma maplibre: define lowp float blur 537#pragma maplibre: define lowp float opacity 538#pragma maplibre: define mediump float width 539#pragma maplibre: define lowp float floorwidth 540#pragma maplibre: define mediump vec4 dasharray_from 541#pragma maplibre: define mediump vec4 dasharray_to 542void main() { 543#pragma maplibre: initialize highp vec4 color 544#pragma maplibre: initialize lowp float blur 545#pragma maplibre: initialize lowp float opacity 546#pragma maplibre: initialize mediump float width 547#pragma maplibre: initialize lowp float floorwidth 548#pragma maplibre: initialize mediump vec4 dasharray_from 549#pragma maplibre: initialize mediump vec4 dasharray_to 550clipAntimeridian();float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);
550float sdfgamma=(u_lineatlas_width/256.0/u_device_pixel_ratio)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity); 551#ifdef GLOBE 552if (v_depth > 1.0) {discard;} 553#endif 554#ifdef OVERDRAW_INSPECTOR 555fragColor=vec4(1.0); 556#endif 557}`,` 558#define scale 0.015873016 559#define LINE_DISTANCE_SCALE 2.0 560layout(location=0) in vec2 a_pos_normal;layout(location=1) in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;flat out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale; 561#ifdef GLOBE 562out float v_depth; 563#endif 564#pragma maplibre: define highp vec4 color 565#pragma maplibre: define lowp float blur 566#pragma maplibre: define lowp float opacity 567#pragma maplibre: define mediump float gapwidth 568#pragma maplibre: define lowp float offset 569#pragma maplibre: define mediump float width 570#pragma maplibre: define lowp float floorwidth 571#pragma maplibre: define mediump vec4 dasharray_from 572#pragma maplibre: define mediump vec4 dasharray_to 573void main() { 574#pragma maplibre: initialize highp vec4 color 575#pragma maplibre: initialize lowp float blur 576#pragma maplibre: initialize lowp float opacity 577#pragma maplibre: initialize mediump float gapwidth 578#pragma maplibre: initialize lowp float offset 579#pragma maplibre: initialize mediump float width 580#pragma maplibre: initialize lowp float floorwidth 581#pragma maplibre: initialize mediump vec4 dasharray_from 582#pragma maplibre: initialize mediump vec4 dasharray_to 583if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 584#ifdef GLOBE 585v_depth=gl_Position.z/gl_Position.w; 586#endif 587#ifdef TERRAIN3D 588v_gamma_scale=1.0; 589#else 590float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 591#endif 592float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),lineGradientSDF:se(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;flat in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv; 593#ifdef GLOBE 594in float v_depth; 595#endif 596#pragma maplibre: define lowp float blur 597#pragma maplibre: define lowp float opacity 598#pragma maplibre: define mediump float width 599#pragma maplibre: define lowp float floorwidth 600#pragma maplibre: define mediump vec4 dasharray_from 601#pragma maplibre: define mediump vec4 dasharray_to 602void main() { 603#pragma maplibre: initialize lowp float blur 604#pragma maplibre: initialize lowp float opacity 605#pragma maplibre: initialize mediump float width 606#pragma maplibre: initialize lowp float floorwidth 607#pragma maplibre: initialize mediump vec4 dasharray_from 608#pragma maplibre: initialize mediump vec4 dasharray_to 609clipAntimeridian();float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);
609float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity); 610#ifdef GLOBE 611if (v_depth > 1.0) {discard;} 612#endif 613#ifdef OVERDRAW_INSPECTOR 614fragColor=vec4(1.0); 615#endif 616}`,` 617#define scale 0.015873016 618#define LINE_DISTANCE_SCALE 2.0 619layout(location=0) in vec2 a_pos_normal;layout(location=1) in vec4 a_data;layout(location=2) in float a_uv_x;layout(location=3) in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;flat out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b; 620#ifdef GLOBE 621out float v_depth; 622#endif 623#pragma maplibre: define lowp float blur 624#pragma maplibre: define lowp float opacity 625#pragma maplibre: define mediump float gapwidth 626#pragma maplibre: define lowp float offset 627#pragma maplibre: define mediump float width 628#pragma maplibre: define lowp float floorwidth 629#pragma maplibre: define mediump vec4 dasharray_from 630#pragma maplibre: define mediump vec4 dasharray_to 631void main() { 632#pragma maplibre: initialize lowp float blur 633#pragma maplibre: initialize lowp float opacity 634#pragma maplibre: initialize mediump float gapwidth 635#pragma maplibre: initialize lowp float offset 636#pragma maplibre: initialize mediump float width 637#pragma maplibre: initialize lowp float floorwidth 638#pragma maplibre: initialize mediump vec4 dasharray_from 639#pragma maplibre: initialize mediump vec4 dasharray_to 640if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;float texel_height=1.0/u_image_height;float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 641#ifdef GLOBE 642v_depth=gl_Position.z/gl_Position.w; 643#endif 644#ifdef TERRAIN3D 645v_gamma_scale=1.0; 646#else 647float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 648#endif 649float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),layerOpacity:se(`uniform sampler2D u_image;uniform float u_opacity;in vec2 v_pos;void main() {fragColor=texture(u_image,v_pos)*u_opacity; 650#ifdef OVERDRAW_INSPECTOR 651fragColor=vec4(0.0); 652#endif 653}`,"layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos.x*2.0-1.0,1.0-a_pos.y*2.0,0.0,1.0);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),raster:se(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec2 v_pos0;in vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture(u_image0,v_pos0);vec4 color1=texture(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); 654#ifdef OVERDRAW_INSPECTOR 655fragColor=vec4(1.0); 656#endif 657}`,`uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;layout(location=0) in vec2 a_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 position=mix(mix(u_coords_top.xy,u_coords_top.zw,fractionalPos.x),mix(u_coords_bottom.xy,u_coords_bottom.zw,fractionalPos.x),fractionalPos.y);gl_Position=projectTile(position,position);v_pos0=((fractionalPos-0.5)/u_buffer_scale)+0.5; 658#ifdef GLOBE 659if (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;} 660#endif 661v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),symbolIcon:se(`uniform sampler2D u_texture;in vec2 v_tex;flat in float v_total_opacity;void main() {fragColor=texture(u_texture,v_tex)*v_total_opacity; 662#ifdef OVERDRAW_INSPECTOR 663fragColor=vec4(1.0); 664#endif 665}`,`layout(location=0) in vec4 a_pos_offset;layout(location=1) in vec4 a_data;layout(location=2) in vec4 a_pixeloffset;layout(location=3) in vec3 a_projected_pos;layout(location=4) in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;uniform bool u_is_offset;out vec2 v_tex;flat out float v_total_opacity; 666#pragma maplibre: define lowp float opacity 667void main() { 668#pragma maplibre: initialize lowp float opacity 669vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_total_opacity=opacity*max(0.0,min(visibility,fade_opacity[0]+fade_change));if (v_total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 670camera_to_anchor_distance/u_camera_to_center_distance : 671u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);if (!u_is_offset) {size*=perspective_ratio;}float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0; 672#ifdef GLOBE 673if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} 674#endif 675vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;}`),symbolSDF:se(`#define SDF_PX 8.0 676uniform bool u_is_halo;uniform bool u_is_plain;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1; 677#pragma maplibre: define highp vec4 fill_color 678#pragma maplibre: define highp vec4 halo_color 679#pragma maplibre: define lowp float halo_width 680#pragma maplibre: define lowp float halo_blur 681void main() { 682#pragma maplibre: initialize highp vec4 fill_color 683#pragma maplibre: initialize highp vec4 halo_color 684#pragma maplibre: initialize lowp float halo_width 685#pragma maplibre: initialize lowp float halo_blur 686float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float total_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out_text,color_alpha_out_halo;if (u_is_plain){highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);color_alpha_out_text=total_opacity*alpha*fill_color;}if (u_is_halo) {float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);float inner_edge_halo=inner_edge+gamma_halo*gamma_scale;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(inner_edge_halo-gamma_scaled_halo,inner_edge_halo+gamma_scaled_halo,dist);highp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha_halo= min(smoothstep(halo_edge-gamma_scaled_halo,halo_edge+gamma_scaled_halo,dist),1.0-alpha_halo);color_alpha_out_halo=total_opacity*alpha_halo*halo_color;}if (u_is_plain && u_is_halo) {fragColor=color_alpha_out_text+(1.-color_alpha_out_text.a)*color_alpha_out_halo;} else if (u_is_halo){fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out_text;} 687#ifdef OVERDRAW_INSPECTOR 688fragColor=vec4(1.0); 689#endif 690}`,`layout(location=0) in vec4 a_pos_offset;layout(location=1) in vec4 a_data;layout(location=2) in vec4 a_pixeloffset;layout(location=3) in vec3 a_projected_pos;layout(location=4) in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;uniform bool u_is_offset;out vec2 v_data0;out vec3 v_data1; 691#pragma maplibre: define highp vec4 fill_color 692#pragma maplibre: define highp vec4 halo_color 693#pragma maplibre: define lowp float opacity 694#pragma maplibre: define lowp float halo_width 695#pragma maplibre: define lowp float halo_blur 696void main() { 697#pragma maplibre: initialize highp vec4 fill_color 698#pragma maplibre: initialize highp vec4 halo_color 699#pragma maplibre: initialize lowp float opacity 700#pragma maplibre: initialize lowp float halo_width 701#pragma maplibre: initialize lowp float halo_blur 702vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy/16.0;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 703camera_to_anchor_distance/u_camera_to_center_distance : 704u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);if (!u_is_offset) {size*=perspective_ratio;}float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0; 705#ifdef GLOBE 706if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} 707#endif 708vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,total_opacity);}`),symbolTextAndIcon:se(`#define SDF_PX 8.0 709#define SDF 1.0 710#define ICON 0.0 711uniform bool u_is_halo;uniform bool u_is_text;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;in vec4 v_data0;in ve
711c3 v_data1;flat in float v_is_sdf; 712#pragma maplibre: define highp vec4 fill_color 713#pragma maplibre: define highp vec4 halo_color 714#pragma maplibre: define lowp float halo_width 715#pragma maplibre: define lowp float halo_blur 716void main() { 717#pragma maplibre: initialize highp vec4 fill_color 718#pragma maplibre: initialize highp vec4 halo_color 719#pragma maplibre: initialize lowp float halo_width 720#pragma maplibre: initialize lowp float halo_blur 721float total_opacity=v_data1[2];if (v_is_sdf==ICON) {vec2 tex_icon=v_data0.zw;fragColor=texture(u_texture_icon,tex_icon)*total_opacity; 722#ifdef OVERDRAW_INSPECTOR 723fragColor=vec4(1.0); 724#endif 725return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out,color_alpha_out_halo;if (u_is_text) {highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);color_alpha_out=fill_color*(alpha*total_opacity);}if (u_is_halo) {highp float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);lowp float buff_halo=(6.0-halo_width/fontScale)/SDF_PX;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(buff_halo-gamma_scaled_halo,buff_halo+gamma_scaled_halo,dist);color_alpha_out_halo=halo_color*(alpha_halo*total_opacity);}if (u_is_text && u_is_halo) {fragColor=color_alpha_out+(1.-color_alpha_out.a)*color_alpha_out_halo;} else if (u_is_halo) {fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out;} 726#ifdef OVERDRAW_INSPECTOR 727fragColor=vec4(1.0); 728#endif 729}`,`layout(location=0) in vec4 a_pos_offset;layout(location=1) in vec4 a_data;layout(location=2) in vec3 a_projected_pos;layout(location=3) in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;uniform bool u_is_offset;out vec4 v_data0;out vec3 v_data1;flat out float v_is_sdf; 730#pragma maplibre: define highp vec4 fill_color 731#pragma maplibre: define highp vec4 halo_color 732#pragma maplibre: define lowp float opacity 733#pragma maplibre: define lowp float halo_width 734#pragma maplibre: define lowp float halo_blur 735void main() { 736#pragma maplibre: initialize highp vec4 fill_color 737#pragma maplibre: initialize highp vec4 halo_color 738#pragma maplibre: initialize lowp float opacity 739#pragma maplibre: initialize lowp float halo_width 740#pragma maplibre: initialize lowp float halo_blur 741vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 742camera_to_anchor_distance/u_camera_to_center_distance : 743u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);if (!u_is_offset) {size*=perspective_ratio;}float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0; 744#ifdef GLOBE 745if(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} 746#endif 747vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec3(gamma_scale,size,total_opacity);v_is_sdf=is_sdf;}`),terrain:se("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && u_fog_ground_blend_opacity > 0.0 && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);
747float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}","layout(location=0) in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:se("in float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {fragColor=pack(v_depth);}","layout(location=0) in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:se("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;in vec2 v_texture_pos;void main() {vec4 rgba=texture(u_texture,v_texture_pos);fragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","layout(location=0) in vec3 a_pos3d;uniform float u_ele_delta;out vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);}"),atmosphere:se(`#ifdef GL_ES 748precision highp float; 749#endif 750in vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758 751);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}`,"layout(location=0) in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:se("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}","layout(location=0) in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function se(e,t){let i=/#pragma maplibre: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=t.match(/in ([\w]+) ([\w]+)/g),a=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),s=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=s?s.concat(a):a,n=r?r.length:0,l={};return e=e.replace(i,(u,h,c,p,d)=>(l[d]=!0,h==="define"?` 752#ifndef HAS_UNIFORM_u_${d} 753in ${c} ${p} ${d}; 754#else 755uniform ${c} ${p} u_${d}; 756#endif 757`:` 758#ifdef HAS_UNIFORM_u_${d} 759 ${c} ${p} ${d} = u_${d}; 760#endif 761`)),t=t.replace(i,(u,h,c,p,d)=>{let f=p==="float"?"vec2":"vec4",m=d.match(/color/)?"color":f;return l[d]?h==="define"?` 762#ifndef HAS_UNIFORM_u_${d} 763uniform lowp float u_${d}_t; 764layout(location = ${n++}) in ${c} ${f} a_${d}; 765out ${c} ${p} ${d}; 766#else 767uniform ${c} ${p} u_${d}; 768#endif 769`:m==="vec4"?` 770#ifndef HAS_UNIFORM_u_${d} 771 ${d} = a_${d}; 772#else 773 ${c} ${p} ${d} = u_${d}; 774#endif 775`:` 776#ifndef HAS_UNIFORM_u_${d} 777 ${d} = unpack_mix_${m}(a_${d}, u_${d}_t); 778#else 779 ${c} ${p} ${d} = u_${d}; 780#endif 781`:h==="define"?` 782#ifndef HAS_UNIFORM_u_${d} 783uniform lowp float u_${d}_t; 784layout(location = ${n++}) in ${c} ${f} a_${d}; 785#else 786uniform ${c} ${p} u_${d}; 787#endif 788`:m==="vec4"?` 789#ifndef HAS_UNIFORM_u_${d} 790 ${c} ${p} ${d} = a_${d}; 791#else 792 ${c} ${p} ${d} = u_${d}; 793#endif 794`:` 795#ifndef HAS_UNIFORM_u_${d} 796 ${c} ${p} ${d} = unpack_mix_${m}(a_${d}, u_${d}_t); 797#else 798 ${c} ${p} ${d} = u_${d}; 799#endif 800`}),{fragmentSource:e,vertexSource:t,staticAttributes:r,staticUniforms:o}}var ys=class{constructor(e,t,i){this.vertexBuffer=e,this.indexBuffer=t,this.segments=i}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}};const rr=Me([{name:"a_pos",type:"Int16",components:2}]),U_="#define PROJECTION_MERCATOR",G_="mercator";var Su=class{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return G_}get shaderDefine(){return U_}get shaderPreludeCode(){return ii.projectionMercator}get vertexShaderPreludeCode(){return ii.projectionMercator.vertexSource}get subdivisionGranularity(){return oh.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}destroy(){}getMeshFromTileID(e,t,i,r,a){if(this._cachedMesh)return this._cachedMesh;let s=new Oi;s.emplaceBack(0,0),s.emplaceBack(C,0),s.emplaceBack(0,C),s.emplaceBack(C,C);let o=e.createVertexBuffer(s,rr.members),n=Te.simpleSegment(0,0,4,2),l=new hi;
vendor: 13,482 bytes, line 800
800l.emplaceBack(1,0,2),l.emplaceBack(1,2,3);let u=e.createIndexBuffer(l);return this._cachedMesh=new ys(o,u,n),this._cachedMesh}recalculate(){}hasTransition(){return!1}},$p=class Z_{constructor(t=0,i=0,r=0,a=0){if(isNaN(t)||t<0||isNaN(i)||i<0||isNaN(r)||r<0||isNaN(a)||a<0)throw Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=i,this.left=r,this.right=a}interpolate(t,i,r){return i.top!=null&&t.top!=null&&(this.top=$e.number(t.top,i.top,r)),i.bottom!=null&&t.bottom!=null&&(this.bottom=$e.number(t.bottom,i.bottom,r)),i.left!=null&&t.left!=null&&(this.left=$e.number(t.left,i.left,r)),i.right!=null&&t.right!=null&&(this.right=$e.number(t.right,i.right,r)),this}getCenter(t,i){return new E(oe((this.left+t-this.right)/2,0,t),oe((this.top+i-this.bottom)/2,0,i))}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Z_(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}};function Mo(e,t){if(!e.renderWorldCopies||e.lngRange)return;let i=t.lng-e.center.lng;t.lng+=i>180?-360:i<-180?360:0}function Vp(e){return Math.max(0,Math.floor(e))}var Dh=class{constructor(e,t){this.applyConstrain=(i,r)=>this._constrainOverride===null?this._callbacks.defaultConstrain(i,r):this._constrainOverride(i,r),this._callbacks=e,this._tileSize=512,this._renderWorldCopies=t?.renderWorldCopies===void 0||!!t?.renderWorldCopies,this._minZoom=t?.minZoom||0,this._maxZoom=t?.maxZoom||22,this._minPitch=t?.minPitch===void 0||t?.minPitch===null?0:t?.minPitch,this._maxPitch=t?.maxPitch===void 0||t?.maxPitch===null?60:t?.maxPitch,this._constrainOverride=t?.constrainOverride??null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new W(0,0),this._elevation=0,this._zoom=0,this._tileZoom=Vp(this._zoom),this._scale=dt(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new $p,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(e,t,i){this._constrainOverride=e.constrainOverride,this._latRange=e.latRange,this._lngRange=e.lngRange,this._width=e.width,this._height=e.height,this._center=e.center,this._elevation=e.elevation,this._minElevationForCurrentTile=e.minElevationForCurrentTile,this._zoom=e.zoom,this._tileZoom=Vp(this._zoom),this._scale=dt(this._zoom),this._bearingInRadians=e.bearingInRadians,this._fovInRadians=e.fovInRadians,this._pitchInRadians=e.pitchInRadians,this._rollInRadians=e.rollInRadians,this._unmodified=e.unmodified,this._edgeInsets=new $p(e.padding.top,e.padding.bottom,e.padding.left,e.padding.right),this._minZoom=e.minZoom,this._maxZoom=e.maxZoom,this._minPitch=e.minPitch,this._maxPitch=e.maxPitch,this._renderWorldCopies=e.renderWorldCopies,this._cameraToCenterDistance=e.cameraToCenterDistance,this._nearZ=e.nearZ,this._farZ=e.farZ,this._autoCalculateNearFarZ=!i&&e.autoCalculateNearFarZ,t&&this.constrainInternal(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(e){this._minElevationForCurrentTile=e}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(e){this._minZoom!==e&&(this._minZoom=e,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get maxZoom(){return this._maxZoom}setMaxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get minPitch(){return this._minPitch}setMinPitch(e){this._minPitch!==e&&(this._minPitch=e,this.setPitch(Math.max(this.pitch,e)))}get maxPitch(){return this._maxPitch}setMaxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.setPitch(Math.min(this.pitch,e)))}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get constrainOverride(){return this._constrainOverride}setConstrainOverride(e){e===void 0&&(e=null),this._constrainOverride!==e&&(this._constrainOverride=e,this.constrainInternal(),this._calcMatrices())}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new E(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(e){let t=Zt(e,-180,180)*Math.PI/180;this._bearingInRadians!==t&&(this._unmodified=!1,this._bearingInRadians=t,this._calcMatrices(),this._rotationMatrix=w_(),GT(this._rotationMatrix,this._rotationMatrix,-this._bearingInRadians))}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(e){let t=oe(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==t&&(this._unmodified=!1,this._pitchInRadians=t,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(e){let t=e/180*Math.PI;this._rollInRadians!==t&&(this._unmodified=!1,this._rollInRadians=t,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return Rr(this._fovInRadians)}setFov(e){e=oe(e,.1,150),this.fov!==e&&(this._unmodified=!1,this._fovInRadians=De(e),this._calcMatrices())}get zoom(){return this._zoom}setZoom(e){let t=this.applyConstrain(this._center,e).zoom;this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this._tileZoom=Math.max(0,Math.floor(t)),this._scale=dt(t),this.constrainInternal(),this._calcMatrices())}get center(){return this._center}setCenter(e){(e.lat!==this._center.lat||e.lng!==this._center.lng)&&(this._unmodified=!1,this._center=e,this.constrainInternal(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(e){e!==this._elevation&&(this._elevation=e,this.constrainInternal(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(e,t){this._autoCalculateNearFarZ=!1,this._nearZ=e,this._farZ=t,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,i){this._unmodified=!1,this._edgeInsets.interpolate(e,t,i),this.constrainInternal(),this._calcMatrices()}resize(e,t,i=!0){this._width=e,this._height=t,i&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){return this._latRange?.length!==2||this._lngRange?.length!==2?null:new ni([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]])}setMaxBounds(e){e?(this._lngRange=[e.getWest(),e.getEast()],this._latRange=[e.getSouth(),e.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-si,si])}getCameraQueryGeometry(e,t){if(t.length===1)return[t[0],e];{let{minX:i,minY:r,maxX:a,maxY:s}=ai.fromPoints(t).extend(e);return[new E(i,r),new E(a,r),new E(a,s),new E(i,s),new E(i,r)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;let e=this._unmodified,{center:t,zoom:i}=this.applyConstrain(this.center,this.zoom);this.setCenter(t),this.setZoom(i),this._unmodified=e,this._constraining=!1}_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let e=Xt(new Float64Array(16));tt(e,e,[this._width/2,-this._height/2,1]),Fe(e,e,[1,-1,0]),this._clipSpaceToPixelsMatrix=e,e=Xt(new Float64Array(16)),tt(e,e,[1,-1,1]),Fe(e,e,[-1,-1,0]),tt(e,e,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=e;let t=this.fovInRadians/2;this._cameraToCenterDistance=.5/Math.tan(t)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(e,t,i,r){let a=i===void 0?this.bearing:i,s=r=r===void 0?this.pitch:r,{distanceToCenter:o,clampedElevation:n}=this._distanceToCenterFromAltElevationPitch(t,this.elevation,s),{x:l,y:u}=yu(s,a),h=ye.fromLngLat(e,t),c=Ym(1,h.y),p,d,f=0;do{if(f+=1,f>10)break;d=o/c;let m=l*d,_=u*d;p=new ye(h.x+m,h.y+_),c=1/p.meterInMercatorCoordinateUnits()}while(Math.abs(o-d*c)>1e-12);return{center:p.toLngLat(),elevation:n,zoom:lt(this.height/2/Math.tan(this.fovInRadians/2)/d/this.tileSize)}}recalculateZoomAndCenter(e){if(this.elevation-e===0)return;let t=1/this.worldSize,i=ji(1,this.center.lat)*this.worldSize,r=ye.fromLngLat(this.center,this.elevation),a=r.x/t,s=r.y/t,o=r.z/t,n=this.pitch,l=this.bearing,{x:u,y:h,z:c}=yu(n,l),p=this.cameraToCenterDistance,d=a+p*-u,f=s+p*-h,m=o+p*c,{distanceToCenter:_,clampedElevation:g}=this._distanceToCenterFromAltElevationPitch(m/i,e,n),x=_*i,y=d+u*x,v=f+h*x,w=new ye(y*t,v*t,0).toLngLat(),b=ji(1,w.lat),T=lt(this.height/2/Math.tan(this.fovInRadians/2)/_/b/this.tileSize);this._elevation=g,this._center=w,this.setZoom(T)}_distanceToCenterFromAltElevationPitch(e,t,i){let r=-Math.cos(De(i)),a=e-t,s,o=t;return r*a>=0||Math.abs(r)<.1?(s=1e4,o=e+s*r):s=-a/r,{distanceToCenter:s,clampedElevation:o}}getCameraPoint(){let e=this.pitchInRadians,t=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new E(t*Math.sin(this.rollInRadians),t*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){let e=ji(1,this.center.lat)*this.worldSize,t=this.cameraToCenterDistance/e;return L_(this.center,this.elevation,this.pitch,this.bearing,t).toLngLat()}getMercatorTileCoordinates(e){if(!e)return[0,0,1,1];let t=e.canonical.z>=0?1<<e.canonical.z:2**e.canonical.z;return[e.canonical.x/t,e.canonical.y/t,1/t/C,1/t/C]}},q_=class W_{constructor(t,i){this.min=t,this.max=i,this.center=Be([],Lt([],this.min,this.max),.5)}quadrant(t){let i=[t%2==0,t<2],r=nl(this.min),a=nl(this.max);for(let s=0;s<i.length;s++)r[s]=i[s]?this.min[s]:this.center[s],a[s]=i[s]?this.center[s]:this.max[s];return a[2]=this.max[2],new W_(r,a)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersectsFrustum(t){let i=!0;for(let r of t.planes){let a=this.intersectsPlane(r);if(a===0)return 0;a===1&&(i=!1)}return i?2:t.aabb.min[0]>this.max[0]||t.aabb.min[1]>this.max[1]||t.aabb.min[2]>this.max[2]||t.aabb.max[0]<this.min[0]||t.aabb.max[1]<this.min[1]||t.aabb.max[2]<this.min[2]?0:1}intersectsPlane(t){let i=t[3],r=t[3];for(let a=0;a<3;a++)t[a]>0?(i+=t[a]*this.min[a],r+=t[a]*this.max[a]):(r+=t[a]*this.min[a],i+=t[a]*this.max[a]);return i>=0?2:r<0?0:1}},kP=class{distanceToTile2d(e,t,i,r){let a=r,s=a.distanceX([e,t]),o=a.distanceY([e,t]);return Math.hypot(s,o)}getWrap(e,t,i){return i}getTileBoundingVolume(e,t,i,r){let a=Math.min(0,i),s=Math.max(0,i);if(r?.terrain){let n=new et(e.z,t,e.z,e.x,e.y),l=r.terrain.getMinMaxElevation(n);a=l.minElevation??a,s=l.maxElevation??s}let o=1<<e.z;return new q_([t+e.x/o,e.y/o,a],[t+(e.x+1)/o,(e.y+1)/o,s])}allowVariableZoom(e,t){let i=oe(78.5-e.fov*(Math.abs(Math.cos(e.rollInRadians))*e.height+Math.abs(Math.sin(e.rollInRadians))*e.width)/e.height/2,0,60);return!!t.terrain||e.pitch>i}allowWorldCopies(){return!0}prepareNextFrame(){}},H_=class X_{constructor(t,i,r){this.points=t,this.planes=i,this.aabb=r}static fromInvProjectionMatrix(t,i=1,r=0,a,s){let o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]],n=s?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],l=2**r,u=o.map(d=>LP(d,t,i,l));a&&FP(u,n[0],a,s);let h=n.map(d=>{let f=kt([],bt([],Si([],u[d[0]],u[d[1]]),Si([],u[d[2]],u[d[1]]))),m=-it(f,u[d[1]]);return f.concat(m)}),c=[1/0,1/0,1/0],p=[-1/0,-1/0,-1/0];for(let d of u)for(let f=0;f<3;f++)c[f]=Math.min(c[f],d[f]),p[f]=Math.max(p[f],d[f]);return new X_(u,h,new q_(c,p))}};function LP(e,t,i,r){let a=Ue([],e,t),s=1/a[3]/i*r;return ay(a,a,[s,s,1/a[3],s])}function FP(e,t,i,r){let a=r?4:0,s=r?0:4,o=0,n=[],l=[];for(let c=0;c<4;c++){let p=Si([],e[c+s],e[c+a]),d=Ro(p);Be(p,p,1/d),n.push(d),l.push(p)}for(let c=0;c<4;c++){let p=cy(e[c+a],l[c],i);o=p!==null&&p>=0?Math.max(o,p):Math.max(o,n[c])}let u=BP(e,t),h=OP(i,u);if(h!==null){let c=h/it(l[0],u);o=Math.min(o,c)}for(let c=0;c<4;c++){let p=Math.min(o,n[c]);e[c+s]=[e[c+a][0]+l[c][0]*p,e[c+a][1]+l[c][1]*p,e[c+a][2]+l[c][2]*p,1]}}function BP(e,t){let i=Si([],e[t[0]],e[t[1]]),r=Si([],e[t[2]],e[t[1]]),a=[0,0,0,0];return kt(a,bt([],i,r)),a[3]=-it(a,e[t[0]]),a}function OP(e,t){let i=iy([],e,1/no(e)),r=Si([],t,Be([],i,it(t,i))),a=no(r);if(a>0){let s=Math.sqrt(1-i[3]*i[3]);return ul(t,Lt([],Be([],i,-i[3]),Be([],r,s/a)))}else return null}
800var Ao=class Y_{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,i,r){this._helper.interpolatePadding(t,i,r)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,i,r=!0){this._helper.resize(t,i,r)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,i){this._helper.overrideNearFarZ(t,i)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t){}constructor(t){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this.defaultConstrain=(i,r)=>{r=oe(+r,this.minZoom,this.maxZoom);let a={center:new W(i.lng,i.lat),zoom:r},s=this._helper._lngRange;!this._helper._renderWorldCopies&&s===null&&(s=[-179.9999999999,179.9999999999]);let o=this.tileSize*dt(a.zoom),n=0,l=o,u=0,h=o,c=0,p=0,{x:d,y:f}=this.size;if(this._helper._latRange){let v=this._helper._latRange;n=Jr(v[1])*o,l=Jr(v[0])*o,l-n<f&&(c=f/(l-n))}s&&(u=Zt(Kr(s[0])*o,0,o),h=Zt(Kr(s[1])*o,0,o),h<u&&(h+=o),h-u<d&&(p=d/(h-u)));let{x:m,y:_}=ti(o,i),g,x,y=Math.max(p||0,c||0);if(y)return a.center=rs(o,new E(p?(h+u)/2:m,c?(l+n)/2:_)).wrap(),a.zoom+=lt(y),a;if(this._helper._latRange){let v=f/2;_-v<n&&(x=n+v),_+v>l&&(x=l-v)}if(s){let v=(u+h)/2,w=m;
800this._helper._renderWorldCopies&&(w=Zt(m,v-o/2,v+o/2));let b=d/2;w-b<u&&(g=u+b),w+b>h&&(g=h-b)}return(g!==void 0||x!==void 0)&&(a.center=rs(o,new E(g??m,x??_)).wrap()),a},this.applyConstrain=(i,r)=>this._helper.applyConstrain(i,r),this._helper=new Dh({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(i,r)=>this.defaultConstrain(i,r)},t),this._coveringTilesDetailsProvider=new kP}clone(){let t=new Y_;return t.apply(this,!1),t}apply(t,i,r){this._helper.apply(t,i,r)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(t){let i=[new Po(0,t)];if(this._helper._renderWorldCopies){let r=this.screenPointToMercatorCoordinate(new E(0,0)),a=this.screenPointToMercatorCoordinate(new E(this._helper._width,0)),s=this.screenPointToMercatorCoordinate(new E(this._helper._width,this._helper._height)),o=this.screenPointToMercatorCoordinate(new E(0,this._helper._height)),n=Math.floor(Math.min(r.x,a.x,s.x,o.x)),l=Math.floor(Math.max(r.x,a.x,s.x,o.x));for(let u=n-1;u<=l+1;u++)u!==0&&i.push(new Po(u,t))}return i}getCameraFrustum(){return H_.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){let i=this.screenPointToLocation(this.centerPoint,t),r=t?t.getElevationForLngLatZoom(i,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(r)}setLocationAtPoint(t,i){let r=ji(this.elevation,this.center.lat),a=this.screenPointToMercatorCoordinateAtZ(i,r),s=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,r),o=ye.fromLngLat(t),n=new ye(o.x-(a.x-s.x),o.y-(a.y-s.y)
vendor: 4,935 bytes, line 800
800);this.setCenter(n?.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(t,i){return i?this.coordinatePoint(ye.fromLngLat(t),i.getElevationForLngLat(t,this),this._pixelMatrix3D):this.coordinatePoint(ye.fromLngLat(t))}screenPointToLocation(t,i){return this.screenPointToMercatorCoordinate(t,i)?.toLngLat()}screenPointToMercatorCoordinate(t,i){if(i){let r=i.pointCoordinate(t);if(r!=null)return r}return this.screenPointToMercatorCoordinateAtZ(t)}screenPointToMercatorCoordinateAtZ(t,i){let r=i||0,a=[t.x,t.y,0,1],s=[t.x,t.y,1,1];Ue(a,a,this._pixelMatrixInverse),Ue(s,s,this._pixelMatrixInverse);let o=a[3],n=s[3],l=a[0]/o,u=s[0]/n,h=a[1]/o,c=s[1]/n,p=a[2]/o,d=s[2]/n,f=p===d?0:(r-p)/(d-p);return new ye($e.number(l,u,f)/this.worldSize,$e.number(h,c,f)/this.worldSize,r)}coordinatePoint(t,i=0,r=this._pixelMatrix){let a=[t.x*this.worldSize,t.y*this.worldSize,i,1];return Ue(a,a,r),new E(a[0]/a[3],a[1]/a[3])}getBounds(){let t=Math.max(0,this._helper._height/2-La(this));return new ni().extend(this.screenPointToLocation(new E(0,t))).extend(this.screenPointToLocation(new E(this._helper._width,t))).extend(this.screenPointToLocation(new E(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new E(0,this._helper._height)))}isPointOnMapSurface(t,i){return i?i.pointCoordinate(t)!=null:t.y>this.height/2-La(this)}calculatePosMatrix(t,i=!1,r=!1){let a=t.key??$r(t.wrap,t.canonical.z,t.canonical.z,t.canonical.x,t.canonical.y),s=i?this._alignedPosMatrixCache:this._posMatrixCache;if(s.has(a)){let l=s.get(a);return r?l.f32:l.f64}let o=Gn(t,this.worldSize);Mr(o,i?this._alignedProjMatrix:this._viewProjMatrix,o);let n={f64:o,f32:new Float32Array(o)};return s.set(a,n),r?n.f32:n.f64}calculateFogMatrix(t){let i=t.key,r=this._fogMatrixCacheF32;if(r.has(i))return r.get(i);let a=Gn(t,this.worldSize);return Mr(a,this._fogMatrix,a),r.set(i,new Float32Array(a)),r.get(i)}calculateCenterFromCameraLngLatAlt(t,i,r,a){return this._helper.calculateCenterFromCameraLngLatAlt(t,i,r,a)}_calculateNearFarZIfNeeded(t,i,r){if(!this._helper.autoCalculateNearFarZ)return;let a=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),s=t-a*this._helper._pixelPerMeter/Math.cos(i),o=a<0?s:t,n=Math.PI/2+this.pitchInRadians,l=De(this.fov)*(Math.abs(Math.cos(De(this.roll)))*this.height+Math.abs(Math.sin(De(this.roll)))*this.width)/this.height*(.5+r.y/this.height),u=Math.sin(l)*o/Math.sin(oe(Math.PI-n-l,.01,Math.PI-.01)),h=La(this),c=Math.atan(h/this._helper.cameraToCenterDistance),p=De(90-nr),d=c>p?2*c*(.5+r.y/(h*2)):p,f=Math.sin(d)*o/Math.sin(oe(Math.PI-n-d,.01,Math.PI-.01)),m=Math.min(u,f);this._helper._farZ=(Math.cos(Math.PI/2-i)*m+o)*1.01,this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;let t=this.centerOffset,i=ti(this.worldSize,this.center),r=i.x,a=i.y;this._helper._pixelPerMeter=ji(1,this.center.lat)*this.worldSize;let s=De(Math.min(this.pitch,nr)),o=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(s));this._calculateNearFarZIfNeeded(o,s,t);let n;n=new Float64Array(16),ol(n,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),iP(this._invProjMatrix,n),n[8]=-t.x*2/this._helper._width,n[9]=t.y*2/this._helper._height,this._projectionMatrix=sl(n),tt(n,n,[1,-1,1]),Fe(n,n,[0,0,-this._helper.cameraToCenterDistance]),Fi(n,n,-this.rollInRadians),Nr(n,n,this.pitchInRadians),Fi(n,n,-this.bearingInRadians),Fe(n,n,[-r,-a,0]),this._mercatorMatrix=tt([],n,[this.worldSize,this.worldSize,this.worldSize]),tt(n,n,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=Mr(new Float64Array(16),this.clipSpaceToPixelsMatrix,n),Fe(n,n,[0,0,-this.elevation]),this._viewProjMatrix=n,this._invViewProjMatrix=oo([],n);let l=[0,0,-1,1];Ue(l,l,this._invViewProjMatrix),this._cameraPosition=[l[0]/l[3],l[1]/l[3],l[2]/l[3]],this._fogMatrix=new Float64Array(16),ol(this._fogMatrix,this.fovInRadians,this.width/this.height,o,this._helper._farZ),this._fogMatrix[8]=-t.x*2/this.width,this._fogMatrix[9]=t.y*2/this.height,tt(this._fogMatrix,this._fogMatrix,[1,-1,1]),Fe(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),Fi(this._fogMatrix,this._fogMatrix,-this.rollInRadians),Nr(this._fogMatrix,this._fogMatrix,this.pitchInRadians),Fi(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),Fe(this._fogMatrix,this._fogMatrix,[-r,-a,0]),tt(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),Fe(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=Mr(new Float64Array(16),this.clipSpaceToPixelsMatrix,n);let u=this._helper._width%2/2,h=this._helper._height%2/2,c=Math.cos(this.bearingInRadians),p=Math.sin(-this.bearingInRadians),d=r-Math.round(r)+c*u+p*h,f=a-Math.round(a)+c*h+p*u,m=ne
800w Float64Array(n);if(Fe(m,m,[d>.5?d-1:d,f>.5?f-1:f,0]),this._alignedProjMatrix=m,n=oo(new Float64Array(16),this._pixelMatrix),!n)throw Error("failed to invert matrix");this._pixelMatrixInverse=n,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;let t=this.screenPointToMercatorCoordinate(new E(0,0)),i=[t.x*this.worldSize,t.y*this.worldSize,0,1];return Ue(i,i,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){let t=ji(1,this.center.lat)*this.worldSize,i=this._helper.cameraToCenterDistance/t;return L_(this.center,this.elevation,this.pitch,this.bearing,i).toLngLat()}lngLatToCameraDepth(t,i){let r=ye.fromLngLat(t),a=[r.x*this.worldSize,r.y*this.worldSize,i,1];return Ue(a,a,this._viewProjMatrix),a[2]/a[3]}getProjectionData(t){let{overscaledTileID:i,aligned:r,applyTerrainMatrix:a}=t,s=this._helper.getMercatorTileCoordinates(i),o=i?this.calculatePosMatrix(i,r,!0):null,n;return n=i?.terrainRttPosMatrix32f&&a?i.terrainRttPosMatrix32f:o||wd(),{mainMatrix:n,tileMercatorCoords:s,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:n,clipAntimeridian:!1}}isLocationOccluded(t){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(t,i,r){return 1}transformLightDirection(t){return nl(t)}getRayDirectionFromPixel(t){throw Error("Not implemented.")}projectTileCoordinates(t,i,r,a){let s=this.calculatePosMatrix(r),o;a?(o=[t,i,a(t,i),1],Ue(o,o,s)):(o=[t,i,0,1],Ch(o,o,s));let n=o[3];return{point:new E(o[0]/n,o[1]/n),signedDistanceFromCamera:n,isOccluded:!1}}populateCache(t){for(let i of t)this.calculatePosMatrix(i)}getProjectionDataForCustomLayer(t=!0){let i=new et(0,0,0,0,0),r=this.getProjectionData({overscaledTileID:i,applyGlobeMatrix:t}),a=Gn(i,this.worldSize);Mr(a,this._viewProjMatrix,a);let s=[C,C,this.worldSize/this._helper.pixelsPerMeter],o=tr();return tt(o,a,s),{...r,tileMercatorCoords:[0,0,1,1],fallbackMatrix:o,mainMatrix:o}}getFastPathSimpleProjectionMatrix(t){return this.calculatePosMatrix(t)}};function K_(){ge("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function J_(e){if(e.useSlerp)if(e.k<1){let t=Kh(e.startEulerAngles.roll,e.startEulerAngles.pitch,e.startEulerAngles.bearing),i=Kh(e.endEulerAngles.roll,e.endEulerAngles.pitch,e.endEulerAngles.bearing),r=new Float64Array(4);Hs(r,t,i,e.k);let a=Iy(r);e.tr.setRoll(a.roll),e.tr.setPitch(a.pitch),e.tr.setBearing(a.bearing)}else e.tr.setRoll(e.endEulerAngles.roll),e.tr.setPitch(e.endEulerAngles.pitch),e.tr.setBearing(e.endEulerAngles.bearing);else e.tr.setRoll($e.number(e.startEulerAngles.roll,e.endEulerAngles.roll,e.k)),e.tr.setPitch($e.number(e.startEulerAngles.pitch,e.endEulerAngles.pitch,e.k)),e.tr.setBearing($e.number(e.startEulerAngles.bearing,e.endEulerAngles.bearing,e.k))}function Q_(e,t,i,r,a){let s=a.padding,o=ti(a.worldSize,i.getNorthWest()),n=ti(a.worldSize,i.getNorthEast()),l=ti(a.worldSize,i.getSouthEast()),u=ti(a.worldSize,i.getSouthWest
vendor: 13,544 bytes, line 800
800()),h=De(-r),c=o.rotate(h),p=n.rotate(h),d=l.rotate(h),f=u.rotate(h),m=new E(Math.max(c.x,p.x,f.x,d.x),Math.max(c.y,p.y,f.y,d.y)),_=new E(Math.min(c.x,p.x,f.x,d.x),Math.min(c.y,p.y,f.y,d.y)),g=m.sub(_),x=a.width-(s.left+s.right+t.left+t.right),y=a.height-(s.top+s.bottom+t.top+t.bottom),v=x/g.x,w=y/g.y;if(w<0||v<0){K_();return}let b=Math.min(lt(a.scale*Math.min(v,w)),e.maxZoom),T=E.convert(e.offset),I=new E((t.left-t.right)/2,(t.top-t.bottom)/2).rotate(De(r)),M=T.add(I).mult(a.scale/dt(b));return{center:rs(a.worldSize,o.add(l).div(2).sub(M)),zoom:b,bearing:r}}var Co=class{get useGlobeControls(){return!1}handlePanInertia(e,t){let i=e.mag(),r=Math.abs(La(t));return{easingOffset:e.mult(Math.min(r*.75/i,1)),easingCenter:t.center}}handleMapControlsRollPitchBearingZoom(e,t){e.bearingDelta&&t.setBearing(t.bearing+e.bearingDelta),e.pitchDelta&&t.setPitch(t.pitch+e.pitchDelta),e.rollDelta&&t.setRoll(t.roll+e.rollDelta),e.zoomDelta&&t.setZoom(t.zoom+e.zoomDelta)}handleMapControlsPan(e,t,i){e.around.distSqr(t.centerPoint)<.01||t.setLocationAtPoint(i,e.around)}cameraForBoxAndBearing(e,t,i,r,a){return Q_(e,t,i,r,a)}handleJumpToCenterZoom(e,t){let i=t.zoom===void 0?e.zoom:+t.zoom;e.zoom!==i&&e.setZoom(+t.zoom),t.center!==void 0&&e.setCenter(W.convert(t.center))}handleEaseTo(e,t){let i=e.zoom,r=e.padding,a={roll:e.roll,pitch:e.pitch,bearing:e.bearing},s={roll:t.roll===void 0?e.roll:t.roll,pitch:t.pitch===void 0?e.pitch:t.pitch,bearing:t.bearing===void 0?e.bearing:t.bearing},o=t.zoom!==void 0,n=!e.isPaddingEqual(t.padding),l=!1,u=o?+t.zoom:e.zoom,h=e.centerPoint.add(t.offsetAsPoint),c=e.screenPointToLocation(h),{center:p,zoom:d}=e.applyConstrain(W.convert(t.center||c),u??i);Mo(e,p);let f=ti(e.worldSize,c),m=ti(e.worldSize,p).sub(f),_=dt(d-i);return l=d!==i,{easeFunc:g=>{if(l&&e.setZoom($e.number(i,d,g)),Pd(a,s)||J_({startEulerAngles:a,endEulerAngles:s,tr:e,k:g,useSlerp:a.roll!=s.roll}),n&&(e.interpolatePadding(r,t.padding,g),h=e.centerPoint.add(t.offsetAsPoint)),t.around)e.setLocationAtPoint(t.around,t.aroundPoint);else{let x=dt(e.zoom-i),y=(d>i?Math.min(2,_):Math.max(.5,_))**(1-g),v=rs(e.worldSize,f.add(m.mult(g*y)).mult(x));e.setLocationAtPoint(e.renderWorldCopies?v.wrap():v,h)}},isZooming:l,elevationCenter:p}}handleFlyTo(e,t){let i=t.zoom!==void 0,r=e.zoom,a=e.applyConstrain(W.convert(t.center||t.locationAtOffset),i?+t.zoom:r),s=a.center,o=a.zoom;Mo(e,s);let n=e.worldSize,l=ti(n,t.locationAtOffset),u=ti(n,s).sub(l),h=u.mag(),c=dt(o-r),p=t.minZoom===void 0?e.minZoom:+t.minZoom,d=Math.max(p,e.minZoom),f=Math.min(d,r,o),m=e.applyConstrain(s,f).zoom;return{easeFunc:(_,g,x,y)=>{e.setZoom(_===1?o:r+lt(g));let v=_===1?s:rs(n,l.add(u.mult(x)));e.setLocationAtPoint(e.renderWorldCopies?v.wrap():v,y)},scaleOfZoom:c,targetCenter:s,scaleOfMinZoom:dt(m-r),pixelPathLength:h}}};let $P;const VP=()=>$P||=new Ke({type:new $(A.projection.type,"type")}),js=C/128;function jP(e,t){let i=NP(t,"16bit"),r=Oi.deserialize({arrayBuffer:i.vertices,length:i.vertices.byteLength/2/2}),a=hi.deserialize({arrayBuffer:i.indices,length:i.indices.byteLength/2/3});return new ys(e.createVertexBuffer(r,rr.members),e.createIndexBuffer(a),Te.simpleSegment(0,0,r.length,a.length))}function NP(e,t){let i=e.granularity===void 0?1:Math.max(e.granularity,1),r=i+(e.generateBorders?2:0),a=i+(e.extendToNorthPole||e.generateBorders?1:0)+(e.extendToSouthPole||e.generateBorders?1:0),s=r+1,o=a+1,n=e.generateBorders?-1:0,l=e.generateBorders||e.extendToNorthPole?-1:0,u=i+ +!!e.generateBorders,h=i+(e.generateBorders||e.extendToSouthPole?1:0),c=s*o,p=r*a*6,d=s*o>65536;if(d&&t==="16bit")throw Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");let f=d||t==="32bit",m=new Int16Array(c*2),_=0;for(let y=l;y<=h;y++)for(let v=n;v<=u;v++){let w=v/i*C;v===-1&&(w=-js),v===i+1&&(w=C+js);let b=y/i*C;y===-1&&(b=e.extendToNorthPole?Ra:-js),y===i+1&&(b=e.extendToSouthPole?Lr:C+js),m[_++]=w,m[_++]=b}let g=f?new Uint32Array(p):new Uint16Array(p),x=0;for(let y=0;y<a;y++)for(let v=0;v<r;v++){let w=v+y*s,b=v+1+y*s,T=v+(y+1)*s,I=v+1+(y+1)*s;g[x++]=w,g[x++]=T,g[x++]=b,g[x++]=b,g[x++]=T,g[x++]=I}return{vertices:m.buffer.slice(0),indices:g.buffer.slice(0),uses32bitIndices:f}}const qn=new oh({fill:new gi(128,2),line:new gi(512,0),tile:new gi(128,32),stencil:new gi(128,1),circle:3});var eg=class{constructor(){this._tileMeshCache={}}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return ii.projectionGlobe}get vertexShaderPreludeCode(){return ii.projectionMercator.vertexSource}get subdivisionGranularity(){return qn}get useGlobeControls(){return!0}destroy(){}_getMeshKey(e){return`${e.granularity.toString(36)}_${e.generateBorders?"b":""}${e.extendToNorthPole?"n":""}${e.extendToSouthPole?"s":""}`}getMeshFromTileID(e,t,i,r,a){let s=(a==="stencil"?qn.stencil:qn.tile).getGranularityForZoomLevel(t.z),o=t.y===0&&r,n=t.y===(1<<t.z)-1&&r;return this._getMesh(e,{granularity:s,generateBorders:i,extendToNorthPole:o,extendToSouthPole:n})}_getMesh(e,t){let i=this._getMeshKey(t);if(i in this._tileMeshCache)return this._tileMeshCache[i];let r=jP(e,t);return this._tileMeshCache[i]=r,r}recalculate(e){}hasTransition(){return!1}},jp=class extends Ze{constructor(e,t){super(),this._transitionable=new Yo(VP(),"projection",t),this.setProjection(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new Se(0)),this._mercatorProjection=new Su,this._verticalPerspectiveProjection=new eg}get transitionState(){let e=this.properties.get("type");if(typeof e=="string"&&e==="mercator")return 0;if(typeof e=="string"&&e==="vertical-perspective")return 1;if(e instanceof Xi){if(e.from===e.to)return e.from==="mercator"?0:1;if(e.from==="vertical-perspective"&&e.to==="mercator")return 1-e.transition;if(e.from==="mercator"&&e.to==="vertical-perspective")return e.transition}return 1}get useGlobeRendering(){return this.transitionState>0}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}getMeshFromTileID(e,t,i,r,a){return this.currentProjection.getMeshFromTileID(e,t,i,r,a)}setProjection(e){this._transitionable.setValue("type",e?.type||"mercator")}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}};function tg(e){let t=un(e.worldSize,e.center.lat);return 2*Math.PI*t}function UP(e,t,i){let r=it(nt(t),nt(i)),a=Math.acos(r),s=tg(e);return a/(2*Math.PI)*s}function GP(e,t){return[Ur(e*Math.PI*2+Math.PI,Math.PI*2),2*Math.atan(Math.exp(Math.PI-t*Math.PI*2))-Math.PI*.5]}function ZP(e,t){let i=Math.cos(t),r=new Float64Array(3);return r[0]=Math.sin(e)*i,r[1]=Math.sin(t),r[2]=Math.cos(e)*i,r}function Ri(e,t,i,r,a){let s=1/(1<<a),o=e/C*s+i*s,n=t/C*s+r*s,l=Ur(o*Math.PI*2+Math.PI,Math.PI*2),u=2*Math.atan(Math.exp(Math.PI-n*Math.PI*2))-Math.PI*.5,h=Math.cos(u),c=new Float64Array(3);return c[0]=Math.sin(l)*h,c[1]=Math.sin(u),c[2]=Math.cos(l)*h,c}function nt(e){return ZP(e.lng*Math.PI/180,e.lat*Math.PI/180)}function un(e,t){return e/(2*Math.PI)/Math.cos(t*Math.PI/180)}function Np(e){let t=Math.asin(e[1])/Math.PI*180,i=Math.sqrt(e[0]*e[0]+e[2]*e[2]);if(i>1e-6){let r=e[0]/i,a=e[2]/i,s=Math.acos(a);return new W(Zt((r>0?s:-s)/Math.PI*180,-180,180),t)}else return new W(0,t)}function qP(e){let t=Le();return t[0]=e[0]*-e[3],t[1]=e[1]*-e[3],t[2]=e[2]*-e[3],{center:t,radius:Math.sqrt(1-e[3]*e[3])}}function WP(e,t,i){let r=Le();Si(r,i,e);let a=Le();return Xg(a,e,r,t/no(r)),a}function Do(e){return Math.cos(e*Math.PI/180)}function We(e,t){let i=Do(e);return lt(Do(t)/i)}function HP(e,t){return 360/tg({worldSize:e,center:{lat:t}})}function Up(e,t){let i=e.rotate(t.bearingInRadians),r=t.zoom+We(t.center.lat,0),a=Ma(1/Do(t.center.lat),1/Do(Math.min(Math.abs(t.center.lat),60)),Xs(r,7,3,0,1)),s=HP(t.worldSize,t.center.lat);return new W(t.center.lng-i.x*s*a,oe(t.center.lat+i.y*s,-si,si))}function Wn(e){let t=.5*e,i=Math.sin(t),r=Math.cos(t);return Math.log(i+r)-Math.log(r-i)}function Gp(e,t,i,r){let a=e.lat+i*r;if(Math.abs(i)>1){let s=e.lat+i,o=(Math.sign(s)===Math.sign(e.lat)?Math.abs(e.lat):-Math.abs(e.lat))*Math.PI/180,n=Math.abs(e.lat+i)*Math.PI/180,l=Wn(o+r*(n-o)),u=Wn(o),h=Wn(n),c=(l-u)/(h-u);return new W(e.lng+t*c,a)}else return new W(e.lng+t*r,a)}var XP=class{constructor(e){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=e}swapBuffers(){if(!this._hadAnyChanges)return;let e=this._cachePrevious;this._cachePrevious=this._cache,this._cache=e,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(e,t,i,r){let a=`${e.z}_${e.x}_${e.y}_${r?.terrain?"t":""}_${Math.round(i)}`,s=this._cache.get(a);if(s)return s;let o=this._cachePrevious.get(a);if(o)return this._cache.set(a,o),o;let n=this._boundingVolumeFactory(e,t,i,r);return this._cache.set(a,n),this._hadAnyChanges=!0,n}},Hn=class Pu{constructor(t,i,r,a){this.min=r,this.max=a,this.points=t,this.planes=i}static fromAabb(t,i){let r=[];for(let a=0;a<8;a++)r.push([(a>>0&1)==1?i[0]:t[0],(a>>1&1)==1?i[1]:t[1],(a>>2&1)==1?i[2]:t[2]]);return new Pu(r,[[-1,0,0,i[0]],[1,0,0,-t[0]],[0,-1,0,i[1]],[0,1,0,-t[1]],[0,0,-1,i[2]],[0,0,1,-t[2]]],t,i)}static fromCenterSizeAngles(t,i,r){let a=bd([],r[0],r[1],r[2]),s=vn([],[i[0],0,0],a),o=vn([],[0,i[1],0],a),n=vn([],[0,0,i[2]],a),l=[...t],u=[...t];for(let c=0;c<8;c++)for(let p=0;p<3;p++){let d=t[p]+s[p]*((c>>0&1)==1?1:-1)+o[p]*((c>>1&1)==1?1:-1)+n[p]*((c>>2&1)==1?1:-1);l[p]=Math.min(l[p],d),u[p]=Math.max(u[p],d)}let h=[];for(let c=0;c<8;c++){let p=[...t];Lt(p,p,Be([],s,(c>>0&1)==1?1:-1)),Lt(p,p,Be([],o,(c>>1&1)==1?1:-1)),Lt(p,p,Be([],n,(c>>2&1)==1?1:-1)),h.push(p)}return new Pu(h,[[...s,-it(s,h[0])],[...o,-it(o,h[0])],[...n,-it(n,h[0])],[-s[0],-s[1],-s[2],-it(s,h[7])],[-o[0],-o[1],-o[2],-it(o,h[7])],[-n[0],-n[1],-n[2],-it(n,h[7])]],l,u)}intersectsFrustum(t){let i=!0,r=this.points.length,a=this.planes.length,s=t.planes.length,o=t.points.length;for(let n=0;n<s;n++){let l=t.planes[n],u=0;for(let h=0;h<r;h++){let c=this.points[h];l[0]*c[0]+l[1]*c[1]+l[2]*c[2]+l[3]>=0&&u++}if(u===0)return 0;u<r&&(i=!1)}if(i)return 2;for(let n=0;n<a;n++){let l=this.planes[n],u=0;for(let h=0;h<o;h++){let c=t.points[h];l[0]*c[0]+l[1]*c[1]+l[2]*c[2]+l[3]>=0&&u++}if(u===0)return 0}return 1}intersectsPlane(t){let i=this.points.length,r=0;for(let a=0;a<i;a++){let s=this.points[a];t[0]*s[0]+t[1]*s[1]+t[2]*s[2]+t[3]>=0&&r++}return r===i?2:r===0?0:1}};function so(e,t,i){let r=e-t;return r<0?-r:Math.max(0,r-i)}function Xn(e,t,i,r,a){let s=e-i,o;return o=s<0?Math.min(-s,1+s-a):s>a?Math.min(Math.max(s-a,0),1-s):0,Math.max(o,so(t,r,a))}var YP=class{constructor(){this._boundingVolumeCache=new XP(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(e,t,i,r){let a=1<<i.z,s=1/a,o=i.x/a,n=i.y/a,l=.5*1,u=2;return u=Math.min(u,Xn(e,t,o,n,s)),u=Math.min(u,Xn(e,t,o+l,-n-s,s)),u=Math.min(u,Xn(e,t,o+l,2-n-s,s)),u}getWrap(e,t,i){let r=1<<t.z,a=1/r,s=t.x/r,o=so(e.x,s,a),n=so(e.x,s-1,a),l=so(e.x,s+1,a),u=Math.min(o,n,l);return u===l?1:u===n?-1:0}allowVariableZoom(e,t){return Ih(e,t)>4}allowWorldCopies(){return!1}getTileBoundingVolume(e,t,i,r){return this._boundingVolumeCache.getTileBoundingVolume(e,t,i,r)}_computeTileBoundingVolume(e,t,i,r){let a=Math.min(0,i),s=Math.max(0,i);if(r?.terrain){let o=new et(e.z,t,e.z,e.x,e.y),n=r.terrain.getMinMaxElevation(o);a=n.minElevation??a,s=n.maxElevation??s}if(a/=Vi,s/=Vi,a+=1,s+=1,e.z<=0)return Hn.fromAabb([-s,-s,-s],[s,s,s]);if(e.z===1)return Hn.fromAabb([e.x===0?-s:0,e.y===0?0:-s,-s],[e.x===0?0:s,e.y===0?s:0,s]);{let o=[Ri(0,0,e.x,e.y,e.z),Ri(C,0,e.x,e.y,e.z),Ri(C,C,e.x,e.y,e.z),Ri(0,C,e.x,e.y,e.z)],n=[];for(let I of o)n.push(Be([],I,s));if(s!==a)for(let I of o)n.push(Be([],I,a));e.y===0&&n.push([0,1,0]),e.y===(1<<e.z)-1&&n.push([0,-1,0]);let l=[1,1,1],u=[-1,-1,-1];for(let I of n)for(let M=0;M<3;M++)l[M]=Math.min(l[M],I[M]),u[M]=Math.max(u[M],I[M]);let h=Ri(C/2,C/2,e.x,e.y,e.z),c=bt([],[0,1,0],h);kt(c,c);let p=bt([],h,c);kt(p,p);let d=bt([],o[2],o[1]);kt(d,d);let f=bt([],o[0],o[3]);kt(f,f),n.push(Be([],h,s)),e.y>=(1<<e.z)/2&&n.push(Be([],Ri(C/2,0,e.x,e.y,e.z),s)),e.y<(1<<e.z)/2&&n.push(Be([],Ri(C/2,C,e.x,e.y,e.z),s));let m=Zp(h,n),_=Zp(p,n),g=[-h[0],-h[1],-h[2],m.max],x=[h[0],h[1],h[2],-m.min],y=[-p[0],-p[1],-p[2],_.max],v=[p[0],p[1],p[2],-_.min],w=[...d,0],b=[...f,0],T=[];return e.y===0?T.push(Mt(b,w,g),Mt(b,w,x)):T.push(Mt(y,w,g),Mt(y,w,x),Mt(y,b,g),Mt(y,b,x)),e.y===(1<<e.z)-1?T.push(Mt(b,w,g),Mt(b,w,x)):T.push(Mt(v,w,g),Mt(v,w,x),Mt(v,b,g),Mt(v,b,x)),new Hn(T,[g,x,y,v,w,b],l,u)}}};function Zp(e,t){let i=1/0,r=-1/0;for(let a of t){let s=it(e,a);i=Math.min(i,s),r=Math.max(r,s)}return{min:i,max:r}}
vendor: 19,633 bytes, line 800
800var ig=class rg{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,i,r){this._helper.interpolatePadding(t,i,r)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,i){this._helper.resize(t,i)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,i){this._helper.overrideNearFarZ(t,i)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t){}constructor(t){this._cachedClippingPlane=na(),this._projectionMatrix=Ss(),this._globeViewProjMatrix32f=wd(),this._globeViewProjMatrixF64=Ss(),this._globeViewProjMatrixF64Inverted=Ss(),this._globeProjMatrixInverted=Ss(),this._cameraPosition=Le(),this.defaultConstrain=(i,r)=>{let a=oe(i.lat,-si,si),s=oe(+r,this.minZoom+We(0,a),this.maxZoom);return{center:new W(i.lng,a),zoom:s}},this.applyConstrain=(i,r)=>this._helper.applyConstrain(i,r),this._helper=new Dh({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(i,r)=>this.defaultConstrain(i,r)},t),this._coveringTilesDetailsProvider=new YP}clone(){let t=new rg;return t.apply(this,!1),t}apply(t,i){this._helper.apply(t,i)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixF64}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){let t=Le();return t[0]=this._cameraPosition[0],t[1]=this._cameraPosition[1],t[2]=this._cameraPosition[2],t}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(t){let{overscaledTileID:i,applyGlobeMatrix:r}=t,a=this._helper.getMercatorTileCoordinates(i);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:a,clippingPlane:this._cachedClippingPlane,projectionTransition:+!!r,fallbackMatrix:this._globeViewProjMatrix32f,clipAntimeridian:i?.canonical.z===0}}_computeClippingPlane(t){let i=this.pitchInRadians,r=this.cameraToCenterDistance/t,a=Math.sin(i)*r,s=Math.cos(i)*r+1,o=1/Math.sqrt(a*a+s*s)*1,n=-a,l=s,u=Math.sqrt(n*n+l*l);n/=u,l/=u;let h=[0,n,l];xn(h,h,[0,0,0],-this.bearingInRadians),Ts(h,h,[0,0,0],-1*this.center.lat*Math.PI/180),oa(h,h,[0,0,0],this.center.lng*Math.PI/180);let c=1/Ro(h);return Be(h,h,c),[...h,-o*c]}isLocationOccluded(t){return!this.isSurfacePointVisible(nt(t))}transformLightDirection(t){let i=this._helper._center.lng*Math.PI/180,r=this._helper._center.lat*Math.PI/180,a=Math.cos(r),s=[Math.sin(i)*a,Math.sin(r),Math.cos(i)*a],o=[s[2],0,-s[0]],n=[0,0,0];bt(n,o,s),kt(o,o),kt(n,n);let l=[o[0]*t[0]+n[0]*t[1]+s[0]*t[2],o[1]*t[0]+n[1]*t[1]+s[1]*t[2],o[2]*t[0]+n[2]*t[1]+s[2]*t[2]],u=[0,0,0];return kt(u,l),u}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(t,i,r){let a=US(t,i,r.canonical),s=GP(a.x,a.y);return this.getCircleRadiusCorrection()/Math.cos(s[1])}projectTileCoordinates(t,i,r,a){let s=r.canonical,o=Ri(t,i,s.x,s.y,s.z),n=1+(a?a(t,i):0)/Vi,l=[o[0]*n,o[1]*n,o[2]*n,1];Ue(l,l,this._globeViewProjMatrixF64);let u=this._cachedClippingPlane,h=u[0]*o[0]+u[1]*o[1]+u[2]*o[2]+u[3]<0;return{point:new E(l[0]/l[3],l[1]/l[3]),signedDistanceFromCamera:l[3],isOccluded:h}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;let t=un(this.worldSize,this.center.lat),i=tr();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+t*2),ol(i,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);let r=this.centerOffset;i[8]=-r.x*2/this._helper._width,i[9]=r.y*2/this._helper._height,this._projectionMatrix=sl(i),this._globeProjMatrixInverted=tr(),oo(this._globeProjMatrixInverted,i),Fe(i,i,[0,0,-this.cameraToCenterDistance]),Fi(i,i,this.rollInRadians),Nr(i,i,-this.pitchInRadians),Fi(i,i,this.bearingInRadians),Fe(i,i,[0,0,-t]);let a=Le();a[0]=t,a[1]=t,a[2]=t,Nr(i,i,this.center.lat*Math.PI/180),vd(i,i,-this.center.lng*Math.PI/180),tt(i,i,a),this._globeViewProjMatrixF64=i,this._globeViewProjMatrix32f=new Float32Array(i),this._globeViewProjMatrixF64Inverted=tr(),oo(this._globeViewProjMatrixF64Inverted,i);let s=Le();this._cameraPosition=Le(),this._cameraPosition[2]=this.cameraToCenterDistance/t,xn(this._cameraPosition,this._cameraPosition,s,-this.rollInRadians),Ts(this._cameraPosition,this._cameraPosition,s,this.pitchInRadians),xn(this._cameraPosition,this._cameraPosition,s,-this.bearingInRadians),Lt(this._cameraPosition,this._cameraPosition,[0,0,1]),Ts(this._cameraPosition,this._cameraPosition,s,-this.center.lat*Math.PI/180),oa(this._cameraPosition,this._cameraPosition,s,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(t);let o=sl(this._globeViewProjMatrixF64Inverted);tt(o,o,[1,1,-1]),this._cachedFrustum=H_.fromInvProjectionMatrix(o,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(t){ge("calculateFogMatrix is not supported on globe projection.");let i=tr();return Xt(i),i}getVisibleUnwrappedCoordinates(t){return[new Po(0,t)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){if(t){ge("terrain is not fully supported on vertical perspective projection.");return}this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,i){if(!this._globeViewProjMatrixF64)return 1;let r=nt(t);Be(r,r,1+i/Vi);let a=na();return Ue(a,[r[0],r[1],r[2],1],this._globeViewProjMatrixF64),a[2]/a[3]}populateCache(t){}getBounds(){let t=this.width*.5,i=this.height*.5,r=[new E(0,0),new E(t,0),new E(this.width,0),new E(this.width,i),new E(this.width,this.height),new E(t,this.height),new E(0,this.height),new E(0,i)],a=[];for(let c of r)a.push(this.unprojectScreenPoint(c));let s=0,o=0,n=0,l=0,u=this.center;for(let c of a){let p=vt(u.lng,c.lng),d=vt(u.lat,c.lat);p<o&&(o=p),p>s&&(s=p),d<l&&(l=d),d>n&&(n=d)}let h=[u.lng+o,u.lat+l,u.lng+s,u.lat+n];return this.isSurfacePointOnScreen([0,1,0])&&(h[3]=90,h[0]=-180,h[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(h[1]=-90,h[0]=-180,h[2]=180),new ni(h)}calculateCenterFromCameraLngLatAlt(t,i,r,a){return this._helper.calculateCenterFromCameraLngLatAlt(t,i,r,a)}setLocationAtPoint(t,i){let r=nt(this.unprojectScreenPoint(i)),a=nt(t),s=Le();Qg(s);let o=Le();oa(o,r,s,-this.center.lng*Math.PI/180),Ts(o,o,s,this.center.lat*Math.PI/180);let n=a[0]*a[0]+a[2]*a[2],l=o[0]*o[0];if(n<l)return;let u=Math.sqrt(n-l),h=-u,c=Ps(a[0],a[2],o[0],u),p=Ps(a[0],a[2],o[0],h),d=Le();oa(d,a,s,-c);let f=Ps(d[1],d[2],o[1],o[2]),m=Le();oa(m,a,s,-p);let _=Ps(m[1],m[2],o[1],o[2]),g=Math.PI*.5,x=f>=-g&&f<=g,y=_>=-g&&_<=g,v,w;if(x&&y){let M=this.center.lng*Math.PI/180,D=this.center.lat*Math.PI/180,L=Is(c,M),z=Is(f,D),P=Is(p,M),S=Is(_,D);L+z<P+S?(v=c,w=f):(v=p,w=_)}else if(x)v=c,w=f;else if(y)v=p,w=_;else return;let b=v/Math.PI*180,T=w/Math.PI*180,I=this.center.lat;this.setCenter(new W(b,oe(T,-90,90))),this.setZoom(this.zoom+We(I,this.center.lat))}locationToScreenPoint(t,i){let r=nt(t);return i&&Be(r,r,1+i.getElevationForLngLatZoom(t,this._helper._tileZoom)/Vi),this._projectSurfacePointToScreen(r)}_projectSurfacePointToScreen(t){let i=na();return Ue(i,[...t,1],this._globeViewProjMatrixF64),i[0]/=i[3],i[1]/=i[3],new E((i[0]*.5+.5)*this.width,(-i[1]*.5+.5)*this.height)}screenPointToMercatorCoordinate(t,i){if(i){let r=i.pointCoordinate(t);if(r)return r}return ye.fromLngLat(this.unprojectScreenPoint(t))}screenPointToLocation(t,i){return this.screenPointToMercatorCoordinate(t,i)?.toLngLat()}isPointOnMapSurface(t,i){let r=this._cameraPosition,a=this.getRayDirectionFromPixel(t);return!!this.rayPlanetIntersection(r,a)}getRayDirectionFromPixel(t){let i=na();i[0]=t.x/this.width*2-1,i[1]=(t.y/this.height*2-1)*-1,i[2]=1,i[3]=1,Ue(i,i,this._globeViewProjMatrixF64Inverted),i[0]/=i[3],i[1]/=i[3],i[2]/=i[3];let r=Le();r[0]=i[0]-this._cameraPosition[0],r[1]=i[1]-this._cameraPosition[1],r[2]=i[2]-this._cameraPosition[2];let a=Le();return kt(a,r),a}isSurfacePointVisible(t){let i=this._cachedClippingPlane;return i[0]*t[0]+i[1]*t[1]+i[2]*t[2]+i[3]>=0}isSurfacePointOnScreen(t){if(!this.isSurfacePointVisible(t))return!1;let i=na();return Ue(i,[...t,1],this._globeViewProjMatrixF64),i[0]/=i[3],i[1]/=i[3],i[2]/=i[3],i[0]>-1&&i[0]<1&&i[1]>-1&&i[1]<1&&i[2]>-1&&i[2]<1}rayPlanetIntersection(t,i){let r=it(t,i),a=Le(),s=Le();Be(s,i,r),Si(a,t,s);let o=1-it(a,a);if(o<0)return null;let n=it(t,t)-1,l=-r+(r<0?1:-1)*Math.sqrt(o),u=n/l,h=l;return{tMin:Math.min(u,h),tMax:Math.max(u,h)}}unprojectScreenPoint(t){let i=this._cameraPosition,r=this.getRayDirectionFromPixel(t),a=this.rayPlanetIntersection(i,r);if(a){let h=Le();Lt(h,i,[r[0]*a.tMin,r[1]*a.tMin,r[2]*a.tMin]);let c=Le();return kt(c,h),Np(c)}let s=this._cachedClippingPlane,o=s[0]*r[0]+s[1]*r[1]+s[2]*r[2],n=-ul(s,i)/o,l=Le();if(n>0)Lt(l,i,[r[0]*n,r[1]*n,r[2]*n]);else{let h=Le();Lt(h,i,[r[0]*2,r[1]*2,r[2]*2]);let c=ul(this._cachedClippingPlane,h);Si(l,h,[this._cachedClippingPlane[0]*c,this._cachedClippingPlane[1]*c,this._cachedClippingPlane[2]*c])}let u=qP(s);return Np(WP(u.center,u.radius,l))}getProjectionDataForCustomLayer(t=!0){let i=this.getProjectionData({overscaledTileID:new et(0,0,0,0,0),applyGlobeMatrix:t});return i.tileMercatorCoords=[0,0,1,1],i}getFastPathSimpleProjectionMatrix(t){}},qp=class ag{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,i,r){this._helper.interpolatePadding(t,i,r)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,i,r=!0){this._helper.resize(t,i,r)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,i){this._helper.overrideNearFarZ(t,i)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(t){this._globeness=t,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(t){this._globeness=1,this.defaultConstrain=(i,r)=>this.currentTransform.defaultConstrain(i,r),this.applyConstrain=(i,r)=>this._helper.applyConstrain(i,r),this._helper=new Dh({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(i,r)=>this.defaultConstrain(i,r)},t),this._globeness=1,this._mercatorTransform=new Ao,this._verticalPerspectiveTransform=new ig}clone(){let t=new ag;return t._globeness=this._globeness,t.apply(this,!1),t}apply(t,i){this._helper.apply(t,i),this._mercatorTransform.apply(this,!1),this._verticalPerspectiveTransform.apply(this,!1)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(t){let i=this._mercatorTransform.getProjectionData(t),r=this._verticalPerspectiveTransform.getProjectionData(t);return{mainMatrix:this.isGlobeRendering?r.mainMatrix:i.mainMatrix,clippingPlane:r.clippingPlane,tileMercatorCoords:r.tileMercatorCoords,projectionTransition:t.applyGlobeMatrix?this._globeness:0,fallbackMatrix:i.fallbackMatrix,clipAntimeridian:r.clipAntimeridian}}isLocationOccluded(t){return this.currentTransform.isLocationOccluded(t)}transformLightDirection(t){return this.currentTransform.transformLightDirection(t)}getPixelScale(){return Ma(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return Ma(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(t,i,r){return Ma(this._mercatorTransform.getPitchedTextCorrection(t,i,r),this._verticalPerspectiveTransform.getPitchedTextCorrection(t,i,r),this._globeness)}projectTileCoordinates(t,i,r,a){return this.currentTransform.projectTileCoordinates(t,i,r,a)}_calcMatrices(){!this._helper._width||!this._helper._height||(this._verticalPerspectiveTransform.apply(this,!1),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(t){return this.currentTransform.calculateFogMatrix(t)}getVisibleUnwrappedCoordinates(t){return this.currentTransform.getVisibleUnwrappedCoordinates(t)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(t){this.currentTransform.recalculateZoomAndCenter(t)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,i){return this.currentTransform.lngLatToCameraDepth(t,i)}populateCache(t){this._mercatorTransform.populateCache(t),this._verticalPerspectiveTransform.populateCache(t)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(t,i,r,a){return this._helper.calculateCenterFromCameraLngLatAlt(t,i,r,a)}setLocationAtPoint(t,i){if(!this.isGlobeRendering){this._mercatorTransform.setLocationAtPoint(t,i),this.apply(this._mercatorTransform,!1);return}this._verticalPerspectiveTransform.setLocationAtPoint(t,i),this.apply(this._verticalPerspectiveTransform,!1)}locationToScreenPoint(t,i){return this.currentTransform.locationToScreenPoint(t,i)}screenPointToMercatorCoordinate(t,i){return this.currentTransform.screenPointToMercatorCoordinate(t,i)}screenPointToLocation(t,i){return this.currentTransform.screenPointToLocation(t,i)}
800isPointOnMapSurface(t,i){return this.currentTransform.isPointOnMapSurface(t,i)}getRayDirectionFromPixel(t){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(t)}getProjectionDataForCustomLayer(t=!0){let i=this._mercatorTransform.getProjectionDataForCustomLayer(t);if(!this.isGlobeRendering)return i;let r=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(t);return r.fallbackMatrix=i.mainMatrix,r}getFastPathSimpleProjectionMatrix(t){return this.currentTransform.getFastPathSimpleProjectionMatrix(t)}},sg=class fi{get useGlobeControls(){return!0}handlePanInertia(t,i){let r=Up(t,i);return Math.abs(r.lng-i.center.lng)>180&&(r.lng=i.center.lng+179.5*Math.sign(r.lng-i.center.lng)),{easingCenter:r,easingOffset:new E(0,0)}}handleMapControlsRollPitchBearingZoom(t,i){let r=t.around,a=i.screenPointToLocation(r);t.bearingDelta&&i.setBearing(i.bearing+t.bearingDelta),t.pitchDelta&&i.setPitch(i.pitch+t.pitchDelta),t.rollDelta&&i.setRoll(i.roll+t.rollDelta);let s=i.zoom;t.zoomDelta&&i.setZoom(i.zoom+t.zoomDelta);let o=i.zoom-s;if(o===0)return;let n=vt(i.center.lng,a.lng),l=n/(Math.abs(n/180)+1),u=vt(i.center.lat,a.lat),h=i.getRayDirectionFromPixel(r),c=i.cameraPosition,p=it(c,h)*-1,d=Le();Lt(d,c,[h[0]*p,h[1]*p,h[2]*p]);let f=Ro(d)-1,m=Math.exp(-Math.max(f-.3,0)*.5),_=un(i.worldSize,i.center.lat)/Math.min(i.width,i.height),g=Xs(_,.9,.5,1,.25),x=(1-dt(-o))*Math.min(m,g),y=i.center.lat,v=i.zoom,w=new W(i.center.lng+l*x,oe(i.center.lat+u*x,-si,si));i.setLocationAtPoint(a,r);let b=i.center,T=Xs(Math.abs(n),45,85,0,1),I=Xs(_,.75,.35,0,1),M=Math.max(T,I)**.25,D=vt(b.lng,w.lng),L=vt(b.lat,w.lat);i.setCenter(new W(b.lng+D*M,b.lat+L*M).wrap()),i.setZoom(v+We(y,i.center.lat))}handleMapControlsPan(t,i,r){if(!t.panDelta)return;let a=i.center.lat,s=i.zoom;i.setCenter(Up(t.panDelta,i).wrap()),i.setZoom(s+We(a,i.center.lat))}cameraForBoxAndBearing(t,i,r,a,s){let o=Q_(t,i,r,a,s),n=i.left/s.width*2-1,l=(s.width-i.right)/s.width*2-1,u=i.top/s.height*-2+1,h=(s.height-i.bottom)/s.height*-2+1,c=vt(r.getWest(),r.getEast())<0,p=c?r.getEast():r.getWest(),d=c?r.getWest():r.getEast(),f=Math.max(r.getNorth(),r.getSouth()),m=Math.min(r.getNorth(),r.getSouth()),_=p+vt(p,d)*.5,g=f+vt(f,m)*.5,x=s.clone();x.setCenter(o.center),x.setBearing(o.bearing),x.setPitch(0),x.setRoll(0),x.setZoom(o.zoom);let y=x.modelViewProjectionMatrix,v=[nt(r.getNorthWest()),nt(r.getNorthEast()),nt(r.getSouthWest
vendor: 5,996 bytes, line 800
800()),nt(r.getSouthEast()),nt(new W(d,g)),nt(new W(p,g)),nt(new W(_,f)),nt(new W(_,m))],w=nt(o.center),b=1/0;for(let T of v)n<0&&(b=fi.getLesserNonNegativeNonNull(b,fi.solveVectorScale(T,w,y,"x",n))),l>0&&(b=fi.getLesserNonNegativeNonNull(b,fi.solveVectorScale(T,w,y,"x",l))),u>0&&(b=fi.getLesserNonNegativeNonNull(b,fi.solveVectorScale(T,w,y,"y",u))),h<0&&(b=fi.getLesserNonNegativeNonNull(b,fi.solveVectorScale(T,w,y,"y",h)));if(!Number.isFinite(b)||b===0){K_();return}return o.zoom=Math.min(x.zoom+lt(b),t.maxZoom),o}handleJumpToCenterZoom(t,i){let r=t.center.lat,a=t.applyConstrain(i.center?W.convert(i.center):t.center,t.zoom).center;t.setCenter(a.wrap());let s=i.zoom===void 0?t.zoom+We(r,a.lat):+i.zoom;t.zoom!==s&&t.setZoom(s)}handleEaseTo(t,i){let r=t.zoom,a=t.center,s=t.padding,o={roll:t.roll,pitch:t.pitch,bearing:t.bearing},n={roll:i.roll===void 0?t.roll:i.roll,pitch:i.pitch===void 0?t.pitch:i.pitch,bearing:i.bearing===void 0?t.bearing:i.bearing},l=i.zoom!==void 0,u=!t.isPaddingEqual(i.padding),h=!1,c=i.center?W.convert(i.center):a,p=t.applyConstrain(c,r).center;Mo(t,p);let d=t.clone();d.setCenter(p),d.setZoom(l?+i.zoom:r+We(a.lat,c.lat)),d.setBearing(i.bearing);let f=new E(oe(t.centerPoint.x+i.offsetAsPoint.x,0,t.width),oe(t.centerPoint.y+i.offsetAsPoint.y,0,t.height));d.setLocationAtPoint(p,f);let m=(i.offset&&i.offsetAsPoint.mag())>0?d.center:p,_=l?+i.zoom:r+We(a.lat,m.lat),g=r+We(a.lat,0),x=_+We(m.lat,0),y=vt(a.lng,m.lng),v=vt(a.lat,m.lat),w=dt(x-g);return h=_!==r,{easeFunc:b=>{if(Pd(o,n)||J_({startEulerAngles:o,endEulerAngles:n,tr:t,k:b,useSlerp:o.roll!=n.roll}),u&&t.interpolatePadding(s,i.padding,b),i.around)ge("Easing around a point is not supported under globe projection."),t.setLocationAtPoint(i.around,i.aroundPoint);else{let T=b*(x>g?Math.min(2,w):Math.max(.5,w))**(1-b),I=Gp(a,y,v,T);t.setCenter(I.wrap())}if(h){let T=$e.number(g,x,b)+We(0,t.center.lat);t.setZoom(T)}},isZooming:h,elevationCenter:m}}handleFlyTo(t,i){let r=i.zoom!==void 0,a=t.center,s=t.zoom,o=t.padding,n=!t.isPaddingEqual(i.padding),l=t.applyConstrain(W.convert(i.center||i.locationAtOffset),s).center,u=r?+i.zoom:t.zoom+We(t.center.lat,l.lat),h=t.clone();h.setCenter(l),h.setZoom(u),h.setBearing(i.bearing);let c=new E(oe(t.centerPoint.x+i.offsetAsPoint.x,0,t.width),oe(t.centerPoint.y+i.offsetAsPoint.y,0,t.height));h.setLocationAtPoint(l,c);let p=h.center;Mo(t,p);let d=UP(t,a,p),f=s+We(a.lat,0),m=u+We(p.lat,0),_=dt(m-f),g=typeof i.minZoom=="number"?+i.minZoom:t.minZoom,x=Math.max(g,t.minZoom)+We(p.lat,0),y=Math.min(x,f,m)+We(0,p.lat),v=dt(t.applyConstrain(p,y).zoom+We(p.lat,0)-f),w=vt(a.lng,p.lng),b=vt(a.lat,p.lat);return{easeFunc:(T,I,M,D)=>{let L=Gp(a,w,b,M);n&&t.interpolatePadding(o,i.padding,T);let z=T===1?p:L;t.setCenter(z.wrap());let P=f+lt(I);t.setZoom(T===1?u:P+We(0,z.lat))},scaleOfZoom:_,targetCenter:p,scaleOfMinZoom:v,pixelPathLength:d}}static solveVectorScale(t,i,r,a,s){let o=s,n=a==="x"?[r[0],r[4],r[8],r[12]]:[r[1],r[5],r[9],r[13]],l=[r[3],r[7],r[11],r[15]],u=t[0]*n[0]+t[1]*n[1]+t[2]*n[2],h=t[0]*l[0]+t[1]*l[1]+t[2]*l[2],c=i[0]*n[0]+i[1]*n[1]+i[2]*n[2],p=i[0]*l[0]+i[1]*l[1]+i[2]*l[2],d=(c+n[3]-o*p-o*l[3])/(c-u-o*p+o*h);return c+o*h===u+o*p||l[3]*(u-c)+n[3]*(p-h)+u*p===c*h?null:d}static getLesserNonNegativeNonNull(t,i){return i!==null&&i>=0&&i<t?i:t}},Wp=class{constructor(e){this._globe=e,this._mercatorCameraHelper=new Co,this._verticalPerspectiveCameraHelper=new sg}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(e,t){return this.currentHelper.handlePanInertia(e,t)}handleMapControlsRollPitchBearingZoom(e,t){this.currentHelper.handleMapControlsRollPitchBearingZoom(e,t)}handleMapControlsPan(e,t,i){this.currentHelper.handleMapControlsPan(e,t,i)}cameraForBoxAndBearing(e,t,i,r,a){return this.currentHelper.cameraForBoxAndBearing(e,t,i,r,a)}handleJumpToCenterZoom(e,t){this.currentHelper.handleJumpToCenterZoom(e,t)}handleEaseTo(e,t){return this.currentHelper.handleEaseTo(e,t)}handleFlyTo(e,t){return this.currentHelper.handleFlyTo(e,t)}};function KP(e,t,i){let r={constrainOverride:t};if(Array.isArray(e)){let a=new jp({type:e},i);return{projection:a,transform:new qp(r),cameraHelper:new Wp(a)}}switch(e){case"mercator":return{projection:new Su,transform:new Ao(r),cameraHelper:new Co};case"globe":{let a=new jp({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]},{});return{projection:a,transform:new qp(r),cameraHelper:new Wp(a)}}case"vertical-perspective":return{projection:new eg,transform:new ig(r),cameraHelper:new sg};default:return ge(`Unknown projection name: ${e}. Falling back to mercator projection.`),{projection:new Su,transform:new Ao(r),cameraHelper:new Co}}}const JP=v0();var Hp=class extends Ze{constructor(e,t={}){super(),this._rtlPluginLoaded=()=>{for(let r in this.tileManagers){let a=this.tileManagers[r].getSource().type;(a==="vector"||a==="geojson")&&this.tileManagers[r].reload()}},this.map=e,this.dispatcher=new S_(Ph(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",(r,a)=>this.getGlyphs(r,a)),this.dispatcher.registerMessageHandler("GI",(r,a)=>this.getImages(r,a)),this.dispatcher.registerMessageHandler("GDA",(r,a)=>this.getDashes(r,a)),this.imageManager=new JT,this.imageManager.setEventedParent(this),this.imageManager.setMissingImageResolver(e._missingStyleImageResolver);let i=e._container?.lang||typeof document<"u"&&document.documentElement?.lang||void 0;this.glyphManager=new iS(e._requestManager,t.localIdeographFontFamily,i),this.lineAtlas=new uS(256,512),this.crossTileSymbolIndex=new N_,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",Du()),is().on(gu,this._rtlPluginLoaded),this.on("data",r=>{if(r.dataType!=="source"||r.sourceDataType!=="metadata")return;let a=this.tileManagers[r.sourceId];if(!a)return;let s=a.getSource();if(s?.vectorLayerIds)for(let o in this._layers){let n=this._layers[o];
800n.source===s.id&&this._validateLayer(n)}})}_setInitialValues(){this._spritesImagesIds={},this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new Pl,this._availableImages=[],this._imagesListDirty=!1,this._globalState={},this._serializedLayers={},this.stylesheet=null,this.light=null,this.sky=null,this.projection&&(this.projection.destroy(),delete this.projection),this._loaded=!1,this._changed=!1,this._updatedLayers={},this._updatedSources={},this._changedImages={},this._glyphsDidChange=!1,this._updatedPaintProps={},this._layerOrderChanged=!1,this.crossTileSymbolIndex=new(this.crossTileSymbolIndex?.constructor||Object),this.pauseablePlacement=void 0,this.placement=void 0,this.z=0}setGlobalStateProperty(e,t){this._checkLoaded();let i=t===null?this.stylesheet.state?.[e]?.default??null:t;if(Qt(i,this._globalState[e]))return this;this._globalState[e]=i,this._applyGlobalStateChanges([e])}getGlobalState(){return this._globalState}setGlobalState(e){this._checkLoaded();let t=[];for(let i in e)Qt(this._globalState[i],e[i].default)||(t.push(i),this._globalState[i]=e[i].default);this._applyGlobalStateChanges(t)}_applyGlobalStateChanges(e){if(e.length===0)return;let t=new Set,i={};for(let r of e){i[r]=this._globalState[r];for(let a in this._layers){let s=this._layers[a],o=s.getLayoutAffectingGlobalStateRefs(),n=s.getPaintAffectingGlobalStateRefs(),l=s.getVisibilityAffectingGlobalStateRefs();if(o.has(r)&&t.add(s.source),n.has(r))for(let{name:u,value:h}of n.get(r))this._updatePaintProperty(s,u,h);l?.has(r)&&(s.recalculateVisibility(),this._updateLayer(s))}}this.dispatcher.broadcast("UGS",i);for(let r in this.tileManagers)t.has(r)&&(this._reloadSource(r),this._changed=!0)}async loadURL(e,t={},i){this.fire(new Gt("dataloading")),t.validate=typeof t.validate!="boolean"||t.validate,this._loadStyleRequest=new AbortController;let r=this._loadStyleRequest;try{let a=await this.map._requestManager.transformRequest(e,"Style");Ad(r.signal);let s=await Lo(a,r);this._loadStyleRequest===r&&(this._loadStyleRequest=null),this._load(s.data,t,i)}catch(a){this._loadStyleRequest===r&&(this._loadStyleRequest=null),a&&!r.signal.aborted&&this.fire(new G(ht(a)))}}loadJSON(e,t={},i){this.fire(new Gt("dataloading")),this._frameRequest=new AbortController,ft.frameAsync(this._frameRequest,this.map._ownerWindow).then(()=>{this._frameRequest=null,t.validate=t.validate!==!1,this._load(e,t,i)}).catch(()=>{})}loadEmpty(){this.fire(new Gt("dataloading")),this._load(JP,{validate:!1})}_load(e,t,i){let r=t.transformStyle?t.transformStyle(i,e):e;if(!(t.validate&&Tc(this,r))){r={...r},this._loaded=!0,this.stylesheet=r;for(let a in r.sources)this.addSource(a,r.sources[a],{validate:!1});r.sprite?this._loadSprite(r.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(r.glyphs),this._createLayers(),this.light=new sS(this.stylesheet.light??{},this._globalState),this._setProjectionInternal(this.stylesheet.projection?.type||"mercator"),this.sky=new lS(this.stylesheet.sky,this._globalState),this.map.setTerrain(this.stylesheet.terrain??null,{validate:!1}),this.fire(new Gt("data")),this.fire(new fp)}}_createLayers(){let e=ec(this.stylesheet.layers);this.setGlobalState(this.stylesheet.state??null),this.dispatcher.broadcast("SL",e),this._order=e.map(t=>t.id),this._layers={},this._serializedLayers=null;for(let t of e){let i=Bn(t,this._globalState);if(i.setEventedParent(this,{layer:{id:t.id}}),this._layers[t.id]=i,El(i)&&this.tileManagers[i.source]){let r=t.paint?.["raster-fade-duration"]??i.paint.get("raster-fade-duration");this.tileManagers[i.source].setRasterFadeDuration(r)}}}_loadSprite(e,t=!1,i=void 0){this.imageManager.setLoaded(!1);let r=new AbortController;this._spriteRequest=r;let a;YT(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(s=>{if(this._spriteRequest=null,s)for(let o in s){this._spritesImagesIds[o]=[];let n=this._spritesImagesIds[o]?this._spritesImagesIds[o].filter(l=>!(l in s)):[];for(let l of n)this.imageManager.removeImage(l),this._changedImages[l]=!0;for(let l in s[o]){let u=o==="default"?l:`${o}:${l}`;this._spritesImagesIds[o].push(u),u in this.imageManager.images?this.imageManager.updateImage(u,s[o][l],!1):this.imageManager.addImage(u,s[o][l]),t&&(this._changedImages[u]=!0)}}}).catch(s=>{this._spriteRequest=null,a=s,r.signal.aborted||this.fire(new G(a
800))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),t&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new Gt("data")),i&&i(a)})}_unloadSprite(){for(let e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._imagesListDirty=!0,this._changed=!0,this.fire(new Gt("data"))}_validateLayer(e){let t=this.tileManagers[e.source];if(!t)return;let i=e.sourceLayer;if(!i)return;let r=t.getSource();(r.type==="geojson"||r.vectorLayerIds&&!r.vectorLayerIds.includes(i))&&this.fire(new G(Error(`Source layer "${i}" does not exist on source "${r.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let e in this.tileManagers)if(!this.tileManagers[e].loaded())return!1;return this.imageManager.isLoaded()}_serializeByIds(e,t=!1){let i=this._serializedAllLayers();if(!e||e.length===0)return Object.values(t?gt(i):i);let r=[];for(let a of e)if(i[a]){let s=t?gt(i[a]):i[a];r.push(s)}return r}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};let t=Object.keys(this._layers);for(let i of t){let r=this._layers[i];r.type!=="custom"&&(e[i]=r.serialize())}return e}hasTransitions(){if(this.light?.hasTransition()||this.sky?.hasTransition()||this.projection?.hasTransition())return!0;for(let e in this.tileManagers)if(this.tileManagers[e].hasTransition())return!0;for(let e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw Error("Style is not done loading.")}update(e){if(!this._loaded)return;let t=this._changed;if(t){this._imagesListDirty&&=(this.dispatcher.broadcast("SI",this._availableImages),!1);let r=Object.keys(this._updatedLayers),a=Object.keys(this._removedLayers);(r.length||a.length)&&this._updateWorkerLayers(r,a);for(let s in this._updatedSources){let o=this._updatedSources[s];if(o==="reload")this._reloadSource(s);else if(o==="clear")this._clearSource(s);else throw Error(`Invalid action ${o}`)}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let s in this._updatedPaintProps)this._layers[s].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}let i={};for(let r in this.tileManagers){let a=this.tileManagers[r];i[r]=a.used,a.used=!1}for(let r of this._order){let a=this._layers[r];a.recalculate(e,this._availableImages),!a.isHidden(e.zoom)&&a.source&&(this.tileManagers[a.source].used=!0)}for(let r in i){let a=this.tileManagers[r];!!i[r]!=!!a.used&&a.fire(new be("data",{sourceDataType:"visibility",sourceId:r}))}this.light.recalculate(e),this.sky.recalculate(e),this.projection.recalculate(e),this.z=e.zoom,t&&this.fire(new Gt("data"))}_updateTilesForChangedImages(){let e=Object.keys(this._changedImages);if(e.length){for(let t in this.tileManagers)this.tileManagers[t].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let e in this.tileManagers)this.tileManagers[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,t){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:t})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,t={}){this._checkLoaded();let i=this.serialize();if(e=t.transformStyle?t.transformStyle(i,e):e,(t.validate??!0)&&Tc(this,e))return!1;e=gt(e),e.layers=ec(e.layers);let r=jy(i,e),a=this._getOperationsToPerform(r);if(a.unimplemented.length>0)throw Error(`Unimplemented: ${a.unimplemented.join(", ")}.`);if(a.operations.length===0)return!1;for(let s of a.operations)s();return this.stylesheet=e,this._serializedLayers=null,this.fire(new fp({style:this})),!0}_getOperationsToPerform(e){let t=[],i=[];for(let r of e)switch(r.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":t.push(()=>this.addLayer.apply(this,r.args));break;case"removeLayer":t.push(()=>this.removeLayer.apply(this,r.args));break;case"setPaintProperty":t.push(()=>this.setPaintProperty.apply(this,r.args));break;case"setLayoutProperty":t.push(()=>this.setLayoutProperty.apply(this,r.args));break;case"setFilter":t.push(()=>this.setFilter.apply(this,r.args));break;case"addSource":t.push(()=>this.addSource.apply(this,r.args));break;case"removeSource":t.push(()=>this.removeSource.apply(this,r.args));break;case"setLayerZoomRange":t.push(()=>this.setLayerZoomRange.apply(this,r.args));break;case"setLight":t.push(()=>this.setLight.apply(this,r.args));break;case"setGeoJSONSourceData":t.push(()=>this.setGeoJSONSourceData.apply(this,r.args));break;case"setGlyphs":t.push(()=>this.setGlyphs.apply(this,r.args));break;case"setSprite":t.push(()=>this.setSprite.apply(this,r.args));break;case"setTerrain":t.push(()=>this.map.setTerrain.apply(this,r.args));break;case"setSky":t.push(()=>this.setSky.apply(this,r.args));break;case"setProjection":this.setProjection.apply(this,r.args);break;case"setGlobalState":t.push(()=>this.setGlobalState.apply(this,r.args));break;case"setTransition":t.push(()=>{});break;default:i.push(r.command);break}return{operations:t,unimplemented:i}}addImage(e,t){if(this.getImage(e)){this.fire(new G(Error(`An image named "${e}" already exists.`)));return}this.imageManager.addImage(e,t),this._afterImageUpdated(e)}updateImage(e,t){this.imageManager.updateImage(e,t)}getImage(e){return this.imageManager.getImage(e)}setMissingImageResolver(e){this.imageManager.setMissingImageResolver(e)}removeImage(e){if(!this.getImage(e)){this.fire(new G(Error(`An image named "${e}" does not exist.`)));return}this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._imagesListDirty=!0,this._changed=!0,this.fire(new Gt("data"))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,t,i={}){if(this._checkLoaded(),this.tileManagers[e]!==void 0)throw Error(`Source "${e}" already exists.`);if(!t.type)throw Error(`The type property must be defined, but only the following properties were given: ${Ob
800ject.keys(t).join(", ")}.`);if(Kf.has(t.type)&&this._validate(_t.source,`sources.${e}`,t,null,i))return;this.map?._collectResourceTiming&&(t.collectResourceTiming=!0);let r=this.tileManagers[e]=new xu(e,t,this.dispatcher);r.style=this,r.setEventedParent(this,()=>({isSourceLoaded:r.loaded(),source:r.serialize(),sourceId:e})),r.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),this.tileManagers[e]===void 0)throw Error(`There is no source with this ID=${e}`);for(let i in this._layers)if(this._layers[i].source===e)return this.fire(new G(Error(`Source "${e}" cannot be removed while layer "${i}" is using it.`)));let t=this.tileManagers[e];delete this.tileManagers[e],delete this._updatedSources[e],t.fire(new be("data",{sourceDataType:"metadata",sourceId:e})),t.setEventedParent(null),t.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,t){if(this._checkLoaded(),this.tileManagers[e]===void 0)throw Error(`There is no source with this ID=${e}`);let i=this.tileManagers[e].getSource();if(i.type!=="geojson")throw Error(`geojsonSource.type is ${i.type}, which is !== 'geojson`);i.setData(t),this._changed=!0}getSource(e){return this.tileManagers[e]?.getSource()}addLayer(e,t,i={}){this._checkLoaded();let r=e.id;if(this.getLayer(r)){this.fire(new G(Error(`Layer "${r}" already exists on this map.`)));return}let a;if(e.type==="custom"){if(Yu(this,Qb(e)))return;a=Bn(e,this._globalState)}else{if("source"in e&&typeof e.source=="object"&&(this.addSource(r,e.source),e=gt(e),e=j(e,{source:r})),this._validate(_t.layer,`layers.${r}`,e,{arrayIndex:-1},i))return;a=Bn(e,this._globalState),this._validateLayer(a),a.setEventedParent(this,{layer:{id:r}})}let s=t?this._order.indexOf(t):this._order.length;if(t&&s===-1){this.fire(new G(Error(`Cannot add layer "${r}" before non-existing layer "${t}".`)));return}if(this._order.splice(s,0,r),this._layerOrderChanged=!0,this._layers[r]=a,this._removedLayers[r]&&a.source&&a.type!=="custom"){let o=this._removedLayers[r];delete this._removedLayers[r],o.type===a.type?(this._updatedSources[a.source]="reload",this.tileManagers[a.source].pause()):this._updatedSources[a.source]="clear"}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}moveLayer(e,t){if(this._checkLoaded(),this._changed=!0,!this._layers[e]){this.fire(new G(Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));return}if(e===t)return;let i=this._order.indexOf(e);this._order.splice(i,1);let r=t?this._order.indexOf(t):this._order.length;if(t&&r===-1){this.fire(new G(Error(`Cannot move layer "${e}" before non-existing layer "${t}".`)));return}this._order.splice(r,0,e),this._layerOrderChanged=!0}removeLayer(e){this._checkLoaded();let t=this._layers[e];if(!t){this.fire(new G(Error(`Cannot remove non-existing layer "${e}".`)));return}t.setEventedParent(null);let i=this._order.indexOf(e);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=t,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],t.onRemove&&t.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,t,i){this._checkLoaded();let r=this.getLayer(e);if(!r){this.fire(new G(Error(`Cannot set the zoom range of non-existing layer "${e}".`)));return}(r.minzoom!==t||r.maxzoom!==i)&&(t!=null&&(r.minzoom=t),i!=null&&(r.maxzoom=i),this._updateLayer(r))}setFilter(e,t,i={}){this._checkLoaded();let r=this.getLayer(e);if(!r){this.fire(new G(Error(`Cannot filter non-existing layer "${e}".`)));return}if(!Qt(r.filter,t)){if(t==null){r.setFilter(void 0),this._updateLayer(r);return}
vendor: 9,273 bytes, line 800
800this._validate(_t.filter,`layers.${r.id}.filter`,t,null,i)||(r.setFilter(gt(t)),this._updateLayer(r))}}getFilter(e){return gt(this.getLayer(e).filter)}setLayoutProperty(e,t,i,r={}){this._checkLoaded();let a=this.getLayer(e);if(!a){this.fire(new G(Error(`Cannot style non-existing layer "${e}".`)));return}Qt(a.getLayoutProperty(t),i)||(a.setLayoutProperty(t,i,r),this._updateLayer(a))}getLayoutProperty(e,t){let i=this.getLayer(e);if(!i){this.fire(new G(Error(`Cannot get style of non-existing layer "${e}".`)));return}return i.getLayoutProperty(t)}setPaintProperty(e,t,i,r={}){this._checkLoaded();let a=this.getLayer(e);if(!a){this.fire(new G(Error(`Cannot style non-existing layer "${e}".`)));return}Qt(a.getPaintProperty(t),i)||this._updatePaintProperty(a,t,i,r)}_updatePaintProperty(e,t,i,r={}){e.setPaintProperty(t,i,r)&&this._updateLayer(e),El(e)&&t==="raster-fade-duration"&&this.tileManagers[e.source].setRasterFadeDuration(i),this._changed=!0,this._updatedPaintProps[e.id]=!0,this._serializedLayers=null}getPaintProperty(e,t){return this.getLayer(e).getPaintProperty(t)}setFeatureState(e,t){this._checkLoaded();let i=e.source,r=e.sourceLayer,a=this.tileManagers[i];if(a===void 0){this.fire(new G(Error(`The source '${i}' does not exist in the map's style.`)));return}let s=a.getSource().type;if(s==="geojson"&&r){this.fire(new G(Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(s==="vector"&&!r){this.fire(new G(Error("The sourceLayer parameter must be provided for vector source types.")));return}if(e.id===void 0){this.fire(new G(Error("The feature id parameter must be provided.")));return}let o=["__proto__","constructor","prototype"];if(t&&Object.keys(t).some(n=>o.includes(n))){this.fire(new G(Error(`The feature state should not include one of the following keys: ${o}`)));return}a.setFeatureState(r,e.id,t)}removeFeatureState(e,t){this._checkLoaded();let i=e.source,r=this.tileManagers[i];if(r===void 0){this.fire(new G(Error(`The source '${i}' does not exist in the map's style.`)));return}let a=r.getSource().type,s=a==="vector"?e.sourceLayer:void 0;if(a==="vector"&&!s){this.fire(new G(Error("The sourceLayer parameter must be provided for vector source types.")));return}if(t&&typeof e.id!="string"&&typeof e.id!="number"){this.fire(new G(Error("A feature id is required to remove its specific state property.")));return}r.removeFeatureState(s,e.id,t)}getFeatureState(e){this._checkLoaded();let t=e.source,i=e.sourceLayer,r=this.tileManagers[t];if(r===void 0){this.fire(new G(Error(`The source '${t}' does not exist in the map's style.`)));return}if(r.getSource().type==="vector"&&!i){this.fire(new G(Error("The sourceLayer parameter must be provided for vector source types.")));return}return e.id===void 0&&this.fire(new G(Error("The feature id parameter must be provided."))),r.getFeatureState(i,e.id)}getTransition(){return j({duration:300,delay:0},this.stylesheet?.transition)}serialize(){if(!this._loaded)return;let e=Cu(this.tileManagers,a=>a.serialize()),t=this._serializeByIds(this._order,!0),i=this.map.getTerrain()||void 0,r=this.stylesheet;return Sd({version:r.version,name:r.name,metadata:r.metadata,light:r.light,sky:r.sky,center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch,sprite:r.sprite,glyphs:r.glyphs,transition:r.transition,projection:r.projection,sources:e,layers:t,terrain:i},a=>a!==void 0)}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.tileManagers[e.source].getSource().type!=="raster"&&(this._updatedSources[e.source]="reload",this.tileManagers[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){let t=s=>this._layers[s].type==="fill-extrusion",i={},r=[];for(let s=this._order.length-1;s>=0;s--){let o=this._order[s];if(t(o)){i[o]=s;for(let n of e){let l=n[o];if(l)for(let u of l)r.push(u)}}}r.sort((s,o)=>o.intersectionZ-s.intersectionZ);let a=[];for(let s=this._order.length-1;s>=0;s--){let o=this._order[s];if(t(o))for(let n=r.length-1;n>=0;n--){let l=r[n].feature;if(i[l.layer.id]<s)break;a.push(l),r.pop()}else for(let n of e){let l=n[o];if(l)for(let u of l)a.push(u.feature)}}return a}queryRenderedFeatures(e,t,i){t?.filter&&this._validate(_t.filter,"queryRenderedFeatures.filter",t.filter,null,t);let r={};if(t?.layers){if(!(Array.isArray(t.layers)||t.layers instanceof Set))return this.fire(new G(Error("parameters.layers must be an Array or a Set of strings"))),[];for(let l of t.layers){let u=this._layers[l];if(!u)return this.fire(new G(Error(`The layer '${l}' does not exist in the map's style and cannot be queried for features.`))),[];r[u.source]=!0}}let a=[];t.availableImages=this._availableImages;let s=this._serializedAllLayers(),o=t.layers instanceof Set?t.layers:Array.isArray(t.layers)?new Set(t.layers):null,n={...t,layers:o,globalState:this._globalState};for(let l in this.tileManagers)t.layers&&!r[l]||a.push(yS(this.tileManagers[l],this._layers,s,e,n,i,this.map.terrain?(u,h,c)=>this.map.terrain.getElevation(u,h,c):void 0));return this.placement&&a.push(vS(this._layers,s,this.tileManagers,e,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(e,t){t?.filter&&this._validate(_t.filter,"querySourceFeatures.filter",t.filter,null,t);let i=this.tileManagers[e];return i?xS(i,t?{...t,globalState:this._globalState}:{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(e,t={}){this._checkLoaded();let i=this.light.getLight(),r=!1;for(let s in e)if(!Qt(e[s],i[s])){r=!0;break}if(!r)return;let a={now:_e(),transition:j({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,t),this.light.updateTransitions(a)}getProjection(){return this.stylesheet?.projection}setProjection(e){this._checkLoaded();let t=e??{type:"mercator"};if(this.stylesheet.projection=e,this.projection){if(this.projection.name===t.type)return;this.projection.destroy(),delete this.projection}this._setProjectionInternal(t.type)}getSky(){return this.stylesheet?.sky}setSky(e,t={}){this._checkLoaded();let i=this.getSky(),r=!1;if(!e&&!i)return;if(e&&!i)r=!0;else if(!e&&i)r=!0;else for(let s in e)if(!Qt(e[s],i[s])){r=!0;break}if(!r)return;let a={now:_e(),transition:j({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,t),this.sky.updateTransitions(a)}_setProjectionInternal(e){let t=KP(e,this.map._camera?.transform.constrainOverride,this._globalState);this.projection=t.projection,this.map.migrateProjection(t.transform,t.cameraHelper);for(let i in this.tileManagers)this.tileManagers[i].reload()}_validate(e,t,i,r,a={}){return ps(this,e,{key:t,style:this.serialize(),value:i,...r},a)}_remove(e=!0){this._frameRequest&&=(this._frameRequest.abort(),null),this._loadStyleRequest&&=(this._loadStyleRequest.abort(),null),this._spriteRequest&&=(this._spriteRequest.abort(),null),is().off(gu,this._rtlPluginLoaded);for(let t in this._layers)this._layers[t].setEventedParent(null);for(let t in this.tileManagers){let i=this.tileManagers[t];i.setEventedParent(null),i.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),e&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(e)}_clearSource(e){this.tileManagers[e].clearTiles()}_reloadSource(e){this.tileManagers[e].resume(),this.tileManagers[e].reload()}_updateSources(e){for(let t in this.tileManagers)this.tileManagers[t].update(e,this.map.terrain)}_generateCollisionBoxes(){for(let e in this.tileManagers)this._reloadSource(e)}_updatePlacement(e,t,i,r,a=!1){let s=!1,o=!1,n={};for(let l of this._order){let u=this._layers[l];if(u.type!=="symbol")continue;if(!n[u.source]){let c=this.tileManagers[u.source];n[u.source]=c.getRenderableIds(!0).map(p=>c.getTileByID(p)).sort((p,d)=>d.tileID.overscaledZ-p.tileID.overscaledZ||(p.tileID.isLessThan(d.tileID)?-1:1))}let h=this.crossTileSymbolIndex.addLayer(u,n[u.source],e.center.lng);s||=h}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),a||=this._layerOrderChanged||i===0,(a||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(_e(),e.zoom))&&(this.pauseablePlacement=new bP(e,this.map.terrain,this._order,a,t,i,r,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,n),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(_e()),o=!0),s&&this.pauseablePlacement.placement.setStale()),o||s)for(let l of this._order){let u=this._layers[l];u.type==="symbol"&&this.placement.updateLayerOpacities(u,n[u.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(_e())}_releaseSymbolFadeTiles(){for(let e in this.tileManagers)this.tileManagers[e].releaseSymbolFadeTiles()}async getImages(e,t){let i=await this.imageManager.getImages(t.icons);this._updateTilesForChangedImages();let r=this.tileManagers[t.source];return r&&r.setDependencies(t.tileID.key,t.type,t.icons),i}async getGlyphs(e,t){let i=await this.glyphManager.getGlyphs(t.stacks),r=this.tileManagers[t.source];return r&&r.setDependencies(t.tileID.key,t.type,[""]),i}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,t={}
800){this._checkLoaded(),!(e&&this._validate(_t.glyphs,"glyphs",e,null,t))&&(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}async getDashes(e,t){let i={};for(let[r,a]of Object.entries(t.dashes))i[r]=this.lineAtlas.getDash(a.dasharray,a.round);return i}addSprite(e,t,i={},r){this._checkLoaded();let a=[{id:e,url:t}],s=[...ro(this.stylesheet.sprite),...a];this._validate(_t.sprite,"sprite",s,null,i)||(this.stylesheet.sprite=s,this._loadSprite(a,!0,r))}removeSprite(e){this._checkLoaded();let t=ro(this.stylesheet.sprite);if(!t.find(i=>i.id===e)){this.fire(new G(Error(`Sprite "${e}" doesn't exists on this map.`)));return}if(this._spritesImagesIds[e])for(let i of this._spritesImagesIds[e])this.imageManager.removeImage(i),this._changedImages[i]=!0;t.splice(t.findIndex(i=>i.id===e),1),this.stylesheet.sprite=t.length>0?t:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._imagesListDirty=!0,this._changed=!0,this.fire(new Gt("data"))}getSprite(){return ro(this.stylesheet.sprite)}setSprite(e,t={},i){this._checkLoaded(),!(e&&this._validate(_t.sprite,"sprite",e,null,t))&&(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,i):(this._unloadSprite(),i&&i(null)))}destroy(){this._frameRequest&&=(this._frameRequest.abort(),null),this._loadStyleRequest&&=(this._loadStyleRequest.abort(),null),this._spriteRequest&&=(this._spriteRequest.abort(),null);for(let e in this.tileManagers){let t=this.tileManagers[e];t.setEventedParent(null),t.onRemove(this.map)}this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this._availableImages=[],this._spritesImagesIds={}),this.glyphManager&&this.glyphManager.destroy();for(let e in this._layers){let t=this._layers[e];t.setEventedParent(null),t.onRemove&&t.onRemove(this.map)}this._setInitialValues(),this.setEventedParent(null),this.dispatcher.unregisterMessageHandler("GG"),this.dispatcher.unregisterMessageHandler("GI"),this.dispatcher.unregisterMessageHandler("GDA"),this.dispatcher.remove(!0),this._listeners={},this._oneTimeListeners={}}};const QP=Me([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);var eI=class{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,t,i,r,a,s,o,n,l){this.context=e;let u=this.boundPaintVertexBuffers.length!==r.length;for(let h=0;!u&&h<r.length;h++)this.boundPaintVertexBuffers[h]!==r[h]&&(u=!0);!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==i||u||this.boundIndexBuffer!==a||this.boundVertexOffset!==s||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==n||this.boundDynamicVertexBuffer3!==l?this.freshBind(t,i,r,a,s,o,n,l):(e.bindVertexArray.set(this.vao),o&&o.bind(),a?.dynamicDraw&&a.bind(),n&&n.bind(),l&&l.bind())}freshBind(e,t,i,r,a,s,o,n){let l=e.numAttributes,u=this.context,h=u.gl;this.vao&&this.destroy(),this.vao=u.createVertexArray(),u.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=r,this.boundVertexOffset=a,this.boundDynamicVertexBuffer=s,this.boundDynamicVertexBuffer2=o,this.boundDynamicVertexBuffer3=n,t.enableAttributes(h,e);for(let c of i)c.enableAttributes(h,e);s&&s.enableAttributes(h,e),o&&o.enableAttributes(h,e),n&&n.enableAttributes(h,e),t.bind(),t.setVertexAttribPointers(h,e,a);for(let c of i)c.bind(),c.setVertexAttribPointers(h,e,a);s&&(s.bind(),s.setVertexAttribPointers(h,e,a)),r&&r.bind(),o&&(o.bind(),o.setVertexAttribPointers(h,e,a)),n&&(n.bind(),n.setVertexAttribPointers(h,e,a)),u.currentNumAttributes=l}destroy(){this.vao&&=(this.context.deleteVertexArray(this.vao),null)}};const tI=(e,t)=>({u_depth:new q(e,t.u_depth),u_terrain:new q(e,t.u_terrain),u_terrain_dim:new k(e,t.u_terrain_dim),u_terrain_matrix:new Pt(e,t.u_terrain_matrix),u_terrain_unpack:new Zi(e,t.u_terrain_unpack),u_terrain_exaggeration:new k(e,t.u_terrain_exaggeration)}),iI=(e,t)=>({u_texture:new q(e,t.u_texture),u_ele_delta:new k(e,t.u_ele_delta),u_fog_matrix:new Pt(e,t.u_fog_matrix),u_fog_color:new qi(e,t.u_fog_color),u_fog_ground_blend:new k(e,t.u_fog_ground_blend),u_fog_ground_blend_opacity:new k(e,t.u_fog_ground_blend_opacity),u_horizon_color:new qi(e,t.u_horizon_color),u_horizon_fog_blend:new k(e,t.u_horizon_fog_blend),u_is_globe_mode:new k(e,t.u_is_globe_mode)}),rI=(e,t)=>({u_ele_delta:new k(e,t.u_ele_delta)}),aI=(e,t)=>({u_texture:new q(e,t.u_texture),u_terrain_coords_id:new k(e,t.u_terrain_coords_id),u_ele_delta:new k(e,t.u_ele_delta)}),sI=(e,t,i,r,a)=>({u_texture:0,u_ele_delta:e,u_fog_matrix:t,u_fog_color:i?i.properties.get("fog-color"):K.white,u_fog_ground_blend:i?i.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:a?0:i?i.calculateFogBlendOpacity(r):0,u_horizon_color:i?i.properties.get("horizon-color"):K.white,u_horizon_fog_blend:i?i.properties.get("horizon-fog-blend"):1,u_is_globe_mode:+!!a}),oI=e=>({u_ele_delta:e}),nI=(e,t)=>({u_terrain_coords_id:e/255,u_texture:0,u_ele_delta:t}),lI=(e,t)=>({u_projection_matrix:new Pt(e,t.u_projection_matrix),u_projection_tile_mercator_coords:new Zi(e,t.u_projection_tile_mercator_coords),u_projection_clipping_plane
800:new Zi(e,t.u_projection_clipping_plane),u_projection_transition:new k(e,t.u_projection_transition),u_projection_fallback_matrix:new Pt(e,t.u_projection_fallback_matrix),u_projection_clip_antimeridian:new q(e,t.u_projection_clip_antimeridian)}),uI=e=>({u_projection_matrix:e.mainMatrix,u_projection_tile_mercator_coords:e.tileMercatorCoords,u_projection_clipping_plane:e.clippingPlane,u_projection_transition:e.projectionTransition,u_projection_fallback_matrix:e.fallbackMatrix,u_projection_clip_antimeridian:+!!e.clipAntimeridian});function Ns(e){let t=[];for(let i of e){if(i===null)continue;let r=i.split(" ");t.push(r.pop())}return t}var hI=class{constructor(e,t,i,r,a,s,o,n,l=[]){let u=e.gl;this.program=u.createProgram();let h=Ns(t.staticAttributes),c=i?i.getBinderAttributes():[],p=h.concat(c),d=ii.prelude.staticUniforms?Ns(ii.prelude.staticUniforms):[],f=o.staticUniforms?Ns(o.staticUniforms):[],m=t.staticUniforms?Ns(t.staticUniforms):[],_=i?i.getBinderUniforms():[],g=d.concat(f).concat(m).concat(_),x=[];for(let M of g)x.includes(M)||x.push(M);let y=i?i.defines():[];y.unshift("#version 300 es"),a&&y.push("#define OVERDRAW_INSPECTOR;"),s&&y.push("#define TERRAIN3D;"),n&&y.push(n),l&&y.push(...l);let v=y.concat(ii.prelude.fragmentSource,o.fragmentSource,t.fragmentSource).join(` 801`),w=y.concat(ii.prelude.vertexSource,o.vertexSource,t.vertexSource).join(` 802`),b=u.createShader(u.FRAGMENT_SHADER);if(u.isContextLost()){this.failedToCreate=!0;return}if(u.shaderSource(b,v),u.compileShader(b),!u.getShaderParameter(b,u.COMPILE_STATUS))throw Error(`Could not compile fragment shader: ${u.getShaderInfoLog(b)}`);u.attachShader(this.program,b);let T=u.createShader(u.VERTEX_SHADER);if(u.isContextLost()){this.failedToCreate=!0;return}if(u.shaderSource(T,w),u.compileShader(T),!u.getShaderParameter(T,u.COMPILE_STATUS))throw Error(`Could not compile vertex shader: ${u.getShaderInfoLog(T)}`);u.attachShader(this.program,T),this.attributes={};let I={};this.numAttributes=p.length;for(let M=0;M<this.numAttributes;M++)p[M]&&(this.attributes[p[M]]=M);u.linkProgram(this.program);for(let M in this.attributes){let D=u.getAttribLocation(this.program,M);D>=0&&(this.attributes[M]=D)}if(!u.getProgramParameter(this.program,u.LINK_STATUS))throw Error(`Program failed to link: ${u.getProgramInfoLog(this.program)}`);u.deleteShader(T),u.deleteShader(b);for(let M of x)if(M&&!I[M]){let D=u.getUniformLocation(this.program,M);D&&(I[M]=D)}this.fixedUniforms=r(e,I),this.terrainUniforms=tI(e,I),this.projectionUniforms=lI(e,I),this.binderUniforms=i?i.getUniforms(e,I):[]}draw(e,t,i,r,a,s,o,n,l,u,h,c,p,d,f,m,_,g,x){let y=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(i),e.setStencilMode(r),e.setColorMode(a),e.setCullFace(s),n){e.activeTexture.set(y.TEXTURE2),y.bindTexture(y.TEXTURE_2D,n.depthTexture),e.activeTexture.set(y.TEXTURE3),y.bindTexture(y.TEXTURE_2D,n.texture);for(let w in this.terrainUniforms)this.terrainUniforms[w].set(n[w])}if(l){let w=uI(l);for(let b in this.projectionUniforms)this.projectionUniforms[b].set(w[b])}if(o)for(let w in this.fixedUniforms)this.fixedUniforms[w].set(o[w]);m&&m.setUniforms(e,this.binderUniforms,d,{zoom:f});let v=0;switch(t){case y.LINES:v=2;break;case y.TRIANGLES:v=3;break;case y.LINE_STRIP:v=1;break}for(let w of p.get())w.vaos||={},w.vaos[u]||=new eI,w.vaos[u].bind(e,this,h,m?m.getPaintVertexBuffers():[],c,w.vertexOffset,_,g,x),y.drawElements(t,w.primitiveLength*v,y.UNSIGNED_SHORT,w.primitiveOffset*v*2)}};function og(e,t,i){let r=1/St(i,1,t.transform.tileZoom),a=2**i.tileID.overscaledZ,s=i.tileSize*2**t.transform.tileZoom/a,o=s*(i.tileID.canonical.x+i.tileID.wrap*a),n=s*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[r,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[o>>16,n>>16],u_pixel_coord_lower:[o&65535,n&65535]}}function cI(e,t,i,r){let a=i.imageManager.getPattern(e.from.toString()),s=i.imageManager.getPattern(e.to.toString()),{width:o,height:n}=i.imageManager.getPixelSize(),l=2**r.tileID.overscaledZ,u=r.tileSize*2**i.transform.tileZoom/l,h=u*(r.tileID.canonical.x+r.tileID.wrap*l),c=u*r.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:a.tl,u_pattern_br_a:a.br,u_pattern_tl_b:s.tl,u_pattern_br_b:s.br,u_texsize:[o,n],u_mix:t.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:s.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/St(r,1,i.transform.tileZoom),u_pixel_coord_upper:[h>>16,c>>16],u_pixel_coord_lower:[h&65535,c&65535]}}const pI=(e,t)=>({u_lightpos:new Tt(e,t.u_lightpos),u_lightpos_globe:new Tt(e,t.u_lightpos_globe),u_lightintensity:new k(e,t.u_lightintensity),u_lightcolor:new Tt(e,t.u_lightcolor),u_vertical_gradient:new k(e,t.u_vertical_gradient),u_opacity:new k(e,t.u_opacity),u_fill_translate:new X(e,t.u_fill_translate)}),dI=(e,t)=>({u_lightpos:new Tt(e,t.u_lightpos),u_lightpos_globe:new Tt(e,t.u_lightpos_globe),u_lightintensity:new k(e,t.u_lightintensity),u_lightcolor:new Tt(e,t.u_lightcolor),u_vertical_gradient:new k(e,t.u_vertical_gradient),u_height_factor:new k(e,t.u_height_factor),u_opacity:new k(e,t.u_opacity),u_fill_translate:new X(e,t.u_fill_translate),u_image:new q(e,t.u_image),u_texsize:new X(e,t.u_texsize),u_pixel_coord_upper:new X(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new X(e,t.u_pixel_coord_lower),u_scale:new Tt(e,t.u_scale),u_fade:new k(e,t.u_fade)}),ng=(e,t,i,r)=>{let a=e.style.light,s=a.getCartesianPosition(),o=yd();a.properties.get("anchor")==="viewport"&&Vg(o,e.transform.bearingInRadians),Jg(s,s,o);let n=e.transform.transformLightDirection(s),l=a.properties.get("color");return{u_lightpos:s,u_lightpos_globe:n,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[l.r,l.g,l.b],u_vertical_gradient:+t,u_opacity:i,u_fill_translate:r}},fI=(e,t,i,r,a,s,o)=>
802j(ng(e,t,i,r),og(s,e,o),{u_height_factor:-(2**a.overscaledZ)/o.tileSize/8}),mI=(e,t)=>({u_fill_translate:new X(e,t.u_fill_translate)}),_I=(e,t)=>({u_image:new q(e,t.u_image),u_texsize:new X(e,t.u_texsize),u_pixel_coord_upper:new X(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new X(e,t.u_pixel_coord_lower),u_scale:new Tt(e,t.u_scale),u_fade:new k(e,t.u_fade),u_fill_translate:new X(e,t.u_fill_translate)}),gI=(e,t)=>({u_world:new X(e,t.u_world),u_fill_translate:new X(e,t.u_fill_translate)}),yI=(e,t)=>({u_world:new X(e,t.u_world),u_image:new q(e,t.u_image),u_texsize:new X(e,t.u_texsize),u_pixel_coord_upper:new X(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new X(e,t.u_pixel_coord_lower),u_scale:new Tt(e,t.u_scale),u_fade:new k(e,t.u_fade),u_fill_translate:new X(e,t.u_fill_translate)}),lg=(e,t,i,r)=>j(og(t,e,i),{u_fill_translate:r}),vI=e=>({u_fill_translate:e}),xI=(e,t)=>({u_world:e,u_fill_translate:t}),bI=(e,t,i,r,a)=>j(lg(e,t,i,a),{u_world:r}),wI=(e,t)=>({u_camera_to_center_distance:new k(e,t.u_camera_to_center_distance),u_scale_with_map:new q(e,t.u_scale_with_map),u_pitch_with_map:new q(e,t.u_pitch_with_map),u_extrude_scale:new X(e,t.u_extrude_scale),u_device_pixel_ratio:new k(e,t.u_device_pixel_ratio),u_globe_extrude_scale:new k(e,t.u_globe_extrude_scale),u_translate:new X(e,t.u_translate)}),TI=(e,t,i,r,a)=>{let s=e.transform,o,n,l=0;if(i.paint.get("circle-pitch-alignment")==="map"){let u=St(t,1,s.zoom);o=!0,n=[u,u],l=u/(C*2**t.tileID.overscaledZ)*2*Math.PI*a}else o=!1,n=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+(i.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+o,u_device_pixel_ratio:e.pixelRatio,u_extrude_scale:n,u_globe_extrude_scale:l,u_translate:r}},SI=(e,t)=>({u_pixel_extrude_scale:new X(e,t.u_pixel_extrude_scale)}),PI=(e,t)=>({u_viewport_size:new X(e,t.u_viewport_size)}),II=e=>({u_pixel_extrude_scale:[1/e.width,1/e.height]}),EI=e=>({u_viewport_size:[e.width,e.height]}),MI=(e,t)=>({u_color:new qi(e,t.u_color),u_overlay:new q(e,t.u_overlay),u_overlay_scale:new k(e,t.u_overlay_scale)}),Xp=(e,t=1)=>({u_color:e,u_overlay:0,u_overlay_scale:t}),AI=(e,t)=>({u_extrude_scale:new k(e,t.u_extrude_scale),u_intensity:new k(e,t.u_intensity),u_globe_extrude_scale:new k(e,t.u_globe_extrude_scale)}),CI=(e,t)=>({u_matrix:new Pt(e,t.u_matrix),u_world:new X(e,t.u_world),u_image:new q(e,t.u_image),u_color_ramp:new q(e,t.u_color_ramp),u_opacity:new k(e,t.u_opacity)}),ug=(e,t,i,r)=>{let a=St(e,1,t)/(C*2**e.tileID.overscaledZ)*2*Math.PI*r;return{u_extrude_scale:St(e,1,t),u_intensity:i,u_globe_extrude_scale:a}},hg=(e,t,i,r)=>{let a=Wi();Jt(a,0,e.width,e.height,0,0,1);let s=e.context.gl;return{u_matrix:a,u_world:[s.drawingBufferWidth,s.drawingBufferHeight],u_image:i,u_color_ramp:r,u_opacity:t.paint.get("heatmap-opacity")}},DI=(e,t)=>({u_image:new q(e,t.u_image),u_latrange:new X(e,t.u_latrange),u_exaggeration:new k(e,t.u_exaggeration),u_altitudes:new kc(e,t.u_altitudes),u_azimuths:new kc(e,t.u_azimuths),u_accent:new qi(e,t.u_accent),u_method:new q(e,t.u_method),u_shadows:new Rc(e,t.u_shadows),u_highlights:new Rc(e,t.u_highlights)}),zI=(e,t)=>({u_matrix:new Pt(e,t.u_matrix),u_image:new q(e,t.u_image),u_dimension:new X(e,t.u_dimension),u_zoom:new k(e,t.u_zoom),u_unpack:new Zi(e,t.u_unpack)}),RI=(e,t,i)=>{let r=i.paint.get("hillshade-accent-color"),a;switch(i.paint.get("hillshade-method")){case"basic":a=4;break;case"combined":a=1;break;case"igor":a=2;break;case"multidirectional":a=3;break;default:a=0;break}let s=i.getIlluminationProperties();for(let o=0;o<s.directionRadians.length;o++)i.paint.get("hillshade-illumination-anchor")==="viewport"&&(s.directionRadians[o]+=e.transform.bearingInRadians);return{u_image:0,u_latrange:LI(e,t.tileID),u_exaggeration:i.paint.get("hillshade-exaggeration"),u_altitudes:s.altitudeRadians,u_azimuths:s.directionRadians,u_accent:r,u_method:a,u_highlights:s.highlightColor,u_shadows:s.shadowColor}},kI=(e,t)=>{let i=t.stride,r=Wi();return Jt(r,0,C,-C,0,0,1),Fe(r,r,[0,-C,0]),{u_matrix:r,u_image:1,u_dimension:[i,i],u_zoom:e.overscaledZ,u_unpack:t.getUnpackVector()}};function LI(e,t){let i=2**t.canonical.z,r=t.canonical.y;return[new ye(0,r/i).toLngLat().lat,new ye(0,(r+1)/i).toLngLat().lat]}const FI=(e,t)=>({u_image:new q(e,t.u_image),u_unpack:new Zi(e,t.u_unpack),u_dimension:new X(e,t.u_dimension),u_elevation_stops:new q(e,t.u_elevation_stops),u_color_stops:new q(e,t.u_color_stops),u_color_ramp_size:new q(e,t.u_color_ramp_size),u_opacity:new k(e,t.u_opacity)}),BI=(e,t,i=0)=>({u_image:0,u_unpack:t.getUnpackVector(),u_dimension:[t.stride,t.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:i,u_opacity:e.paint.get("color-relief-opacity")}),OI=(e,t)=>({u_translation:new X(e,t.u_translation),u_ratio:new k(e,t.u_ratio),u_device_pixel_ratio:new k(e,t.u_device_pixel_ratio),u_units_to_pixels:new X(e,t.u_units_to_pixels)}),$I=(e,t)=>({u_translation:new X(e,t.u_translation),u_ratio:new k(e,t.u_ratio),u_device_pixel_ratio:new k(e,t.u_device_pixel_ratio),u_units_to_pixels:new X(e,t.u_units_to_pixels),u_image:new q(e,t.u_image),u_image_height:new k(e,t.u_image_height)}),VI=(e,t)=>({u_translation:new X(e,t.u_translation),u_texsize:new X(e,t.u_texsize),u_ratio:new k(e,t.u_ratio),u_device_pixel_ratio:new k(e,t.u_device_pixel_ratio),u_image:new q(e,t.u_image),u_units_to_pixels:new X(e,t.u_units_to_pixels),u_scale:new Tt(e,t.u_scale),u_fade:new k(e,t.u_fade)}),jI=(e,t)=>({u_translation:new X(e,t.u_translation),u_ratio:new k(e,t.u_ratio),u_device_pixel_ratio:new k(e,t.u_device_pixel_ratio),u_units_to_pixels:new X(e,t.u_units_to_pixels),u_image:new q(e,t.u_image),u_mix:new k(e,t.u_mix),u_tileratio:new k(e,t.u_tileratio),u_crossfade_from:new k(e,t.u_crossfade_from),u_crossfade_to:new k(e,t.u_crossfade_to),u_lineatlas_width:new k(e,t.u_lineatlas_width),u_lineatlas_height:new k(e,t.u_lineatlas_height)}),NI=(e,t)=>({u_translation:new X(e,t.u_translation),u_ratio:new k(e,t.u_ratio),u_device_pixel_ratio:new k(e,t.u_device_pixel_ratio),u_units_to_pixels:new X(e,t.u_units_to_pixels),u_image:new q(e,t.u_image),u_image_height:new k(e,t.u_image_height),u_tileratio:new k(e,t.u_tileratio),u_crossfade_from:new k(e,t.u_crossfade_from),u_crossfade_to:new k(e,t.u_crossfade_to),u_image_dash:new q(e,t.u_image_dash),u_mix:new k(e,t.u_mix),u_lineatlas_width:new k(e,t.u_lineatlas_width),u_lineatlas_height:new k(e,t.u_lineatlas_height)}),hn=(e,t,i,r)=>{let a=e.transform;return{u_translation:cg(e,t,i),u_ratio:r/St(t,1,a.zoom),u_device_pixel_ratio:e.pixelRatio,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},UI=(e,t,i,r,a)=>j(hn(e,t,i,r),{u_image:0,u_image_height:a}),GI=(e,t,i,r,a)=>{let s=e.transform,o=zh(t,s);return{u_translation:cg(e,t,i),u_texsize:t.imageAtlasTexture.size,u_ratio:r/St(t,1,s.zoom),u_device_pixel_ratio:e.pixelRatio,u_image:0,u_scale:[o,a.fromScale,a.toScale],u_fade:a.t,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]]}},ZI=(e,t,i,r,a)=>{let s=e.transform,o=zh(t,s);return j(hn(e,t,i,r),{u_tileratio:o,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image:0,u_mix:a.t,u_lineatlas_width:e.lineAtlas.width,u_lineatlas_height:e.lineAtlas.height})},qI=(e,t,i,r,a,s)=>{let o=e.transform,n=zh(t,o);return j(hn(e,t,i,r),{u_image:0,u_image_height:s,u_tileratio:n,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image_dash:1,u_mix:a.t,u_lineatlas_width:e.lineAtlas.width,u_lineatlas_height:e.lineAtlas.height})};function zh(e,t){return 1/St(e,1,t.tileZoom)}function cg(e,t,i){return Ni(e.transform,t,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}const WI=(e,t)=>({u_image:new q(e,t.u_image),u_opacity:new k(e,t.u_opacity)}),HI=(e,t)=>({u_image:t,u_opacity:e}),XI=(e,t)=>({u_tl_parent:new X(e,t.u_tl_parent),u_scale_parent:new k(e,t.u_scale_parent),u_buffer_scale:new k(e,t.u_buffer_scale),u_fade_t:new k(e,t.u_fade_t),u_opacity:new k(e,t.u_opacity),u_image0:new q(e,t.u_image0),u_image1:new q(e,t.u_image1),u_brightness_low:new k(e,t.u_brightness_low),u_brightness_high:new k(e,t.u_brightness_high),u_saturation_factor:new k(e,t.u_saturation_factor),u_contrast_factor:new k(e,t.u_contrast_factor),u_spin_weights:new Tt(e,t.u_spin_weights),u_coords_top:new Zi(e,t.u_coords_top),u_coords_bottom:new Zi(e,t.u_coords_bottom)}),YI=(e,t,i,r,a)=>({u_tl_parent:e,u_scale_parent:t,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.opacity*r.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:r.paint.get("raster-brightness-min"),u_brightness_high:r.paint.get("raster-brightness-max"),u_saturation_factor:QI(r.paint.get("raster-saturation")),u_contrast_factor:JI(r.paint.get("raster-contrast")),u_spin_weights:KI(r.paint.get("raster-hue-rotate")),u_coords_top:[a[0].x,a[0].y,a[1].x,a[1].y],u_coords_bottom:[a[3].x,a[3].y,a[2].x,a[2].y]});function KI(e){e*=Math.PI/180;let t=Math.sin(e),i=Math.cos(e);return[(2*i+1)/3,(-Math.sqrt(3)*t-i+1)/3,(Math.sqrt(3)*t-i+1)/3]}function JI(e){return e>0?1/(1-e):1+e}function QI(e){return e>0?1-1/(1.001-e):-e}const eE=(e,t)=>({u_is_size_zoom_constant:new q(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new q(e,t.u_is_size_feature_constant),u_size_t:new k(e,t.u_size_t),u_size:new k(e,t.u_size),u_camera_to_center_distance:new k(e,t.u_camera_to_center_distance),u_pitch:new k(e,t.u_pitch),u_rotate_symbol:new q(e,t.u_rotate_symbol),u_aspect_ratio:new k(e,t.u_aspect_ratio),u_fade_change:new k(e,t.u_fade_change),u_label_plane_matrix:new Pt(e,t.u_label_plane_matrix
802),u_coord_matrix:new Pt(e,t.u_coord_matrix),u_is_text:new q(e,t.u_is_text),u_pitch_with_map:new q(e,t.u_pitch_with_map),u_is_along_line:new q(e,t.u_is_along_line),u_is_variable_anchor:new q(e,t.u_is_variable_anchor),u_texsize:new X(e,t.u_texsize),u_texture:new q(e,t.u_texture),u_translation:new X(e,t.u_translation),u_pitched_scale:new k(e,t.u_pitched_scale),u_is_offset:new q(e,t.u_is_offset)}),tE=(e,t)=>({u_is_size_zoom_constant:new q(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new q(e,t.u_is_size_feature_constant),u_size_t:new k(e,t.u_size_t),u_size:new k(e,t.u_size),u_camera_to_center_distance:new k(e,t.u_camera_to_center_distance),u_pitch:new k(e,t.u_pitch),u_rotate_symbol:new q(e,t.u_rotate_symbol),u_aspect_ratio:new k(e,t.u_aspect_ratio),u_fade_change:new k(e,t.u_fade_change),u_label_plane_matrix:new Pt(e,t.u_label_plane_matrix),u_coord_matrix:new Pt(e,t.u_coord_matrix),u_is_text:new q(e,t.u_is_text),u_pitch_with_map:new q(e,t.u_pitch_with_map),u_is_along_line:new q(e,t.u_is_along_line),u_is_variable_anchor:new q(e,t.u_is_variable_anchor),u_texsize:new X(e,t.u_texsize),u_texture:new q(e,t.u_texture),u_gamma_scale:new k(e,t.u_gamma_scale),u_device_pixel_ratio:new k(e,t.u_device_pixel_ratio),u_is_halo:new q(e,t.u_is_halo),u_is_plain:new q(e,t.u_is_plain),u_translation:new X(e,t.u_translation),u_pitched_scale:new k(e,t.u_pitched_scale),u_is_offset:new q(e,t.u_is_offset)}),iE=(e,t)=>({u_is_size_zoom_constant:new q(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new q(e,t.u_is_size_feature_constant),u_size_t:new k(e,t.u_size_t),u_size:new k(e,t.u_size),u_camera_to_center_distance:new k(e,t.u_camera_to_center_distance),u_pitch:new k(e,t.u_pitch),u_rotate_symbol:new q(e,t.u_rotate_symbol),u_aspect_ratio:new k(e,t.u_aspect_ratio),u_fade_change:new k(e,t.u_fade_change),u_label_plane_matrix:new Pt(e,t.u_label_plane_matrix),u_coord_matrix:new Pt(e,t.u_coord_matrix),u_is_text:new q(e,t.u_is_text),u_pitch_with_map:new q(e,t.u_pitch_with_map),u_is_along_line:new q(e,t.u_is_along_line),u_is_variable_anchor:new q(e,t.u_is_variable_anchor),u_texsize:new X(e,t.u_texsize),u_texsize_icon:new X(e,t.u_texsize_icon),u_texture:new q(e,t.u_texture),u_texture_icon:new q(e,t.u_texture_icon),u_gamma_scale:new k(e,t.u_gamma_scale),u_device_pixel_ratio:new k(e,t.u_device_pixel_ratio),u_is_halo:new q(e,t.u_is_halo),u_translation:new X(e,t.u_translation),u_pitched_scale:new k(e,t.u_pitched_scale),u_is_offset:new q(e,t.u_is_offset)}),pg=(e,t,i,r,a,s,o,n,l,u,h,c,p,d)=>{let f=o.transform;return{u_is_size_zoom_constant:+(e==="constant"||e==="source"),u_is_size_feature_constant:+(e==="constant"||e==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:f.cameraToCenterDistance,u_pitch:f.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:f.width/f.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_label_plane_matrix:n,u_coord_matrix:l,u_is_text:+h,u_pitch_with_map:+r,u_is_along_line:a,u_is_variable_anchor:s,u_texsize:c,u_texture:0,u_translation:u,u_pitched_scale:p,u_is_offset:d}},dg=(e,t,i,r,a,s,o,n,l,u,h,c,p,d,f)=>{let m=o.transform;return j(pg(e,t,i,r,a,s,o,n,l,u,h,c,d,f),{u_gamma_scale:r?Math.cos(m.pitch*Math.PI/180)*m.cameraToCenterDistance:1,u_device_pixel_ratio:o.pixelRatio,u_is_halo:+!!p,u_is_plain:1})},rE=(e,t,i,r,a,s,o,n,l,u,h,c,p,d)=>j(dg(e,t,i,r,a,s,o,n,l,u,!0,h,!0,p,d),{u_texsize_icon:c,u_texture_icon:1}),aE=(e,t)=>({u_opacity:new k(e,t.u_opacity),u_color:new qi(e,t.u_color)}),sE=(e,t)=>({u_opacity:new k(e,t.u_opacity),u_image:new q(e,t.u_image),u_pattern_tl_a:new X(e,t.u_pattern_tl_a),u_pattern_br_a:new X(e,t.u_pattern_br_a),u_pattern_tl_b:new X(e,t.u_pattern_tl_b),u_pattern_br_b:new X(e,t.u_pattern_br_b),u_texsize:new X(e,t.u_texsize),u_mix:new k(e,t.u_mix),u_pattern_size_a:new X(e,t.u_pattern_size_a),u_pattern_size_b:new X(e,t.u_pattern_size_b),u_scale_a:new k(e,t.u_scale_a),u_scale_b:new k(e,t.u_scale_b),u_pixel_coord_upper:new X(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new X(e,t.u_pixel_coord_lower),u_tile_units_to_pixels:new k(e,t.u_tile_units_to_pixels)}),oE=(e,t)=>({u_opacity:e,u_color:t}),nE=(e,t,i,r,a)=>j(cI(i,a,t,r),{u_opacity:e}),lE=(e,t)=>({u_sun_pos:new Tt(e,t.u_sun_pos),u_atmosphere_blend:new k(e,t.u_atmosphere_blend),u_globe_position:new Tt(e,t.u_globe_position),u_globe_radius:new k(e,t.u_globe_radius),u_inv_proj_matrix:new Pt(e,t.u_inv_proj_matrix)}),uE=(e,t,i,r,a)=>({u_sun_pos:e,u_atmosphere_blend:t,u_globe_position:i,u_globe_radius:r,u_inv_proj_matrix:a}),hE=(e,t)=>({u_sky_color:new qi(e,t.u_sky_color),u_horizon_color:new qi(e,t.u_horizon_color),u_horizon:new X(e,t.u_horizon),u_horizon_normal:new X(e,t.u_horizon_normal),u_sky_horizon_blend:new k(e,t.u_sky_horizon_blend),u_sky_blend:new k(e,t.u_sky_blend)}),cE=(e,t,i)=>{let r=Math.cos(t.rollInRadians),a=Math.sin(t.rollInRadians),s=La(t),o=t.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:e.properties.get("sky-color"),u_horizon_color:e.properties.get("horizon-color"),u_horizon:[(t.width/2-s*a)*i,(t.height/2+s*r)*i],u_horizon_normal:[-a,r],u_sky_horizon_blend:e.properties.get("sky-horizon-blend")*t.height/2*i,u_sky_blend:o}},Yp=(e,t)=>{},pE={fillExtrusion:pI,fillExtrusionPattern:dI,fill:mI,fillPattern:_I,fillOutline:gI,fillOutlinePattern:yI,circle:wI,collisionBox:SI,collisionCircle:PI,debug:MI,depth:Yp,clippingMask:Yp,heatmap:AI,heatmapTexture:CI,hillshade:DI,hillshadePrepare:zI,colorRelief:FI,line:OI,lineGradient:$I,linePattern:VI,lineSDF:jI,lineGradientSDF:NI,layerOpacity:WI,raster:XI,symbolIcon:eE,symbolSDF:tE,symbolTextAndIcon:iE,background:aE,backgroundPattern:sE,terrain:iI,terrainDepth:rI,terrainCoords:aI,atmosphere:lE,sky:hE};var dE=class{constructor(e,t,i){this.context=e;let r=e.gl;this.buffer=r.createBuffer(),this.dynamicDraw=!!i,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||t.freeBufferAfterUpload()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){let t=this.context.gl;if(!this.dynamicDraw)throw Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){let e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)}};const fE={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};var mE=class{constructor(e,t,i,r){this.length=t.length,this.attributes=i,this.itemSize=t.bytesPerElement,this.dynamicDraw=r,this.context=e;let a=e.gl;this.buffer=a.createBuffer(),e.bindVertexBuffer.set(this.buffer),a.bufferData(a.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?a.DYNAMIC_DRAW:a.STATIC_DRAW),this.dynamicDraw||t.freeBufferAfterUpload()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);let t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}
802enableAttributes(e,t){for(let i of this.attributes){let r=t.attributes[i.name];r!==void 0&&e.enableVertexAttribArray(r)}}setVertexAttribPointers(e,t,i){for(let r of this.attributes){let a=t.attributes[r.name];a!==void 0&&e.vertexAttribPointer(a,r.components,e[fE[r.type]],!1,this.itemSize,r.offset+this.itemSize*(i||0))}}destroy(){let e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)}},de=class{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}},_E=class extends de{getDefault(){return K.transparent}set(e){let t=this.current;e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a&&!this.dirty||(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}},gE=class extends de{getDefault(){return 1}set(e){e===this.current&&!this.dirty||(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}},yE=class extends de{getDefault(){return 0}set(e){e===this.current&&!this.dirty||(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}},vE=class extends de{getDefault(){return[!0,!0,!0,!0]}set(e){let t=this.current;e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&!this.dirty||(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}},xE=class extends de{getDefault(){return!0}set(e){e===this.current&&!this.dirty||(this.gl.depthMask(e),this.current=e,this.dirty=!1)}},bE=class extends de{getDefault(){return 255}set(e){e===this.current&&!this.dirty||(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}},wE=class extends de{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){let t=this.current;e.func===t.func&&e.ref===t.ref&&e.mask===t.mask&&!this.dirty||(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}},TE=class extends de{getDefault(){let e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){let t=this.current;e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&!this.dirty||(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}},SE=class extends de{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}},PE=class extends de{getDefault(){return[0,1]}set(e){let t=this.current;e[0]===t[0]&&e[1]===t[1]&&!this.dirty||(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}},IE=class extends de{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}},EE=class extends de{getDefault(){return this.gl.LESS}set(e){e===this.current&&!this.dirty||(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}},ME=class extends de{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}},AE=class extends de{getDefault(){let e=this.gl;return[e.ONE,e.ZERO]}set(e){let t=this.current;e[0]===t[0]&&e[1]===t[1]&&!this.dirty||(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}},CE=class extends de{getDefault(){return K.transparent}set(e){let t=this.current;e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a&&!this.dirty||(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}},DE=class extends de{getDefault(){return this.gl.FUNC_ADD}set(e){e===this.current&&!this.dirty||(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}},zE=class extends de{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}},RE=class extends de{getDefault(){return this.gl.BACK}set(e){e===this.current&&!this.dirty||(this.gl.cullFace(e),this.current=e,this.dirty=!1)}},kE=class extends de{getDefault(){return this.gl.CCW}set(e){e===this.current&&!this.dirty||(this.gl.frontFace(e),this.current=e,this.dirty=!1)}},LE=class extends de{getDefault(){return null}set(e){e===this.current&&!this.dirty||(this.gl.useProgram(e),this.current=e,this.dirty=!1)}},FE=class extends de{getDefault(){return this.gl.TEXTURE0}set(e){e===this.current&&!this.dirty||(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}},BE=class extends de{getDefault(){let e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){let t=this.current;e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&!this.dirty||(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}},OE=class extends de{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}},$E=class extends de{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}},VE=class extends de{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}},jE=class extends de{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}},NE=class extends de{getDefault(){return null}set(e){let t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}},UE=class extends de{getDefault(){return null}set(e){e===this.current&&!this.dirty||(this.gl.bindVertexArray(e),this.current=e,this.dirty=!1)}},GE=class extends de{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}},ZE=class extends de{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}},qE=class extends de{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}},Rh=class extends de{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}},WE=class extends Rh{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}},HE=class extends Rh{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}},XE=class extends Rh{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}},YE=class{constructor(e,t,i,r,a){this.context=e,this.width=t,this.height=i;let s=e.gl,o=this.framebuffer=s.createFramebuffer();
vendor: 5,996 bytes, line 802
802if(this.colorAttachment=new WE(e,o),r)this.depthAttachment=a?new XE(e,o):new HE(e,o);else if(a)throw Error("Stencil cannot be set without depth")}destroy(){let e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){let i=this.depthAttachment.get();i&&e.deleteRenderbuffer(i)}e.deleteFramebuffer(this.framebuffer)}},Ee=class{constructor(e,t,i){this.blendFunction=e,this.blendColor=t,this.mask=i}};Ee.Replace=[1,0],Ee.disabled=new Ee(Ee.Replace,K.transparent,[!1,!1,!1,!1]),Ee.unblended=new Ee(Ee.Replace,K.transparent,[!0,!0,!0,!0]),Ee.alphaBlended=new Ee([1,771],K.transparent,[!0,!0,!0,!0]);var KE=class{constructor(e){this.gl=e,this.clearColor=new _E(this),this.clearDepth=new gE(this),this.clearStencil=new yE(this),this.colorMask=new vE(this),this.depthMask=new xE(this),this.stencilMask=new bE(this),this.stencilFunc=new wE(this),this.stencilOp=new TE(this),this.stencilTest=new SE(this),this.depthRange=new PE(this),this.depthTest=new IE(this),this.depthFunc=new EE(this),this.blend=new ME(this),this.blendFunc=new AE(this),this.blendColor=new CE(this),this.blendEquation=new DE(this),this.cullFace=new zE(this),this.cullFaceSide=new RE(this),this.frontFace=new kE(this),this.program=new LE(this),this.activeTexture=new FE(this),this.viewport=new BE(this),this.bindFramebuffer=new OE(this),this.bindRenderbuffer=new $E(this),this.bindTexture=new VE(this),this.bindVertexBuffer=new jE(this),this.bindElementBuffer=new NE(this),this.bindVertexArray=new UE(this),this.pixelStoreUnpack=new GE(this),this.pixelStoreUnpackPremultiplyAlpha=new ZE(this),this.pixelStoreUnpackFlipY=new qE(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),e.getExtension("EXT_color_buffer_half_float"),e.getExtension("EXT_color_buffer_float")}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,t){return new dE(this,e,t)}createVertexBuffer(e,t,i){return new mE(this,e,t,i)}createRenderbuffer(e,t,i){let r=this.gl,a=r.createRenderbuffer();return this.bindRenderbuffer.set(a),r.renderbufferStorage(r.RENDERBUFFER,e,t,i),this.bindRenderbuffer.set(null),a}createFramebuffer(e,t,i,r){return new YE(this,e,t,i,r)}clear({color:e,depth:t,stencil:i}){let r=this.gl,a=0;e&&(a|=r.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),t!==void 0&&(a|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),i!==void 0&&(a|=r.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),r.clear(a)}setCullFace(e){e.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func===this.gl.ALWAYS&&!e.mask?this.depthTest.set(!1):(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range))}setStencilMode(e){e.test.func===this.gl.ALWAYS&&!e.mask?this.stencilTest.set(!1):(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask}))}setColorMode(e){Qt(e.blendFunction,Ee.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){return this.gl.createVertexArray()}deleteVertexArray(e){this.gl.deleteVertexArray(e)}unbindVAO(){this.bindVertexArray.set(null)}},te=class{constructor(e,t,i){this.func=e,this.mask=t,this.range=i}};te.ReadOnly=!1,te.ReadWrite=!0,te.disabled=new te(519,te.ReadOnly,[0,1]);const Yn=7680;var he=class{constructor(e,t,i,r,a,s){this.test=e,this.ref=t,this.mask=i,this.fail=r,this.depthFail=a,this.pass=s}};he.disabled=new he({func:519,mask:0},0,0,Yn,Yn,Yn);const Kp=1029,Kn=2305;var le=class{constructor(e,t,i){this.enable=e,this.mode=t,this.frontFace=i}};le.disabled=new le(!1,Kp,Kn),le.backCCW=new le(!0,Kp,Kn),le.frontCCW=new le(!0,1028,Kn);let Us;function Jp(e,t,i,r,a){let s=e.context,o=e.transform,n=s.gl,l=e.useProgram("collisionBox"),u=[],h=0,c=0;for(let g of r){let x=t.getTile(g).getBucket(i);if(!x)continue;let y=a?x.textCollisionBox:x.iconCollisionBox,v=x.collisionCircleArray;v.length>
8020&&(u.push({circleArray:v,circleOffset:c,coord:g}),h+=v.length/4,c=h),y&&l.draw(s,n.LINES,te.disabled,he.disabled,e.colorModeForRenderPass(),le.disabled,II(e.transform),e.style.map.terrain?.getTerrainData(g),o.getProjectionData({overscaledTileID:g,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),i.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,null,e.transform.zoom,null,null,y.collisionVertexBuffer)}if(!a||!u.length)return;let p=e.useProgram("collisionCircle"),d=new dx;d.resize(h*4),d._trim();let f=0;for(let g of u)for(let x=0;x<g.circleArray.length/4;x++){let y=x*4,v=g.circleArray[y+0],w=g.circleArray[y+1],b=g.circleArray[y+2],T=g.circleArray[y+3];d.emplace(f++,v,w,b,T,0),d.emplace(f++,v,w,b,T,1),d.emplace(f++,v,w,b,T,2),d.emplace(f++,v,w,b,T,3)}(!Us||Us.length<h*2)&&(Us=JE(h));let m=s.createIndexBuffer(Us,!0),_=s.createVertexBuffer(d,Ib.members,!0);for(let g of u){let x=EI(e.transform);p.draw(s,n.TRIANGLES,te.disabled,he.disabled,e.colorModeForRenderPass(),le.disabled,x,e.style.map.terrain?.getTerrainData(g.coord),null,i.id,_,m,Te.simpleSegment(0,g.circleOffset*2,g.circleArray.length,g.circleArray.length/2),null,e.transform.zoom,null,null,null)}_.destroy(),m.destroy()}function JE(e){let t=e*2,i=new mx;i.resize(t),i._trim();for(let r=0;r<t;r++){let a=r*6;i.uint16[a+0]=r*4+0,i.uint16[a+1]=r*4+1,i.uint16[a+2]=r*4+2,i.uint16[a+3]=r*4+2,i.uint16[a+4]=r*4+3,i.uint16[a+5]=r*4+0}return i}const QE=Xt(new Float32Array(16));function eM(e,t,i,r,a,s){if(e.renderPass!=="translucent")return;let{isRenderingToTexture:o}=s,n=he.disabled,l=e.colorModeForRenderPass();(i._unevaluatedLayout.hasValue("text-variable-anchor")||i._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&iM(r,e,i,t,i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),a),i.paint.get("icon-opacity").constantOr(1)!==0&&Qp(e,t,i,r,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),n,l,o),i.paint.get("text-opacity").constantOr(1)!==0&&Qp(e,t,i,r,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),n,l,o),t.map.showCollisionBoxes&&(Jp(e,t,i,r,!0),Jp(e,t,i,r,!1))}function tM(e,t,i,r,a,s){let{horizontalAlign:o,verticalAlign:n}=Zm(e),l=-(o-.5)*t,u=-(n-.5)*i;return new E((l/a+r[0])*s,(u/a+r[1])*s)}function iM(e,t,i,r,a,s,o,n,l){let u=t.transform,h=t.style.map.terrain,c=a==="map",p=s==="map";for(let d of e){let f=r.getTile(d),m=f.getBucket(i);if(!m?.text?.segments.get().length)continue;let _=m.textSizeData,g=rn(_,u.zoom),x=St(f,1,t.transform.zoom),y=Eh(c,t.transform,x),v=i.layout.get("icon-text-fit")!=="none"&&m.hasIconData();if(g){let w=2**(u.zoom-f.tileID.overscaledZ),b=h?(T,I)=>h.getElevation(d,T,I):null;aM(m,c,p,l,u,y,w,g,v,Ni(u,f,o,n),d.toUnwrapped(),b)}}}function rM(e,t,i,r,a,s){let o=t.tileAnchorPoint.add(new E(t.translation[0],t.translation[1]));if(t.pitchWithMap){let n=r.mult(s);i||(n=n.rotate(-a));let l=o.add(n);return Ah(l.x,l.y,t.pitchedLabelPlaneMatrix,t.getElevation).point}else if(i){let n=dr(t.tileAnchorPoint.x+1,t.tileAnchorPoint.y,t).point.sub(e),l=Math.atan(n.y/n.x)+(n.x<0?Math.PI:0);return e.add(r.rotate(l))}else return e.add(r)}function aM(e,t,i,r,a,s,o,n,l,u,h,c){let p=e.text.placedSymbolArray,d=e.text.dynamicLayoutVertexArray,f=e.icon.dynamicLayoutVertexArray,m={};d.clear();for(let _=0;_<p.length;_++){let g=p.get(_),x=e.allowVerticalPlacement&&!g.placedOrientation,y=!g.hidden&&g.crossTileID&&!x?r[g.crossTileID]:null;if(!y)jr(g.numGlyphs,d);else{let v=new E(g.anchorX,g.anchorY),w={getElevation:c,width:a.width,height:a.height,pitchedLabelPlaneMatrix:s,pitchWithMap:i,transform:a,tileAnchorPoint:v,translation:u,unwrappedTileID:h},b=i?$_(v.x,v.y,w):dr(v.x,v.y,w),T=F_(a.cameraToCenterDistance,b.signedDistanceFromCamera),I=uh(e.textSizeData,n,g)*T/24;i&&(I*=e.tilePixelRatio/o);let{width:M,height:D,anchor:L,textOffset:z,textBoxScale:P}=y,S=tM(L,M,D,z,P,I),F=a.getPitchedTextCorrection(v.x+u[0],v.y+u[1],h),O=rM(b.point,w,t,S,-a.bearingInRadians,F),H=e.allowVerticalPlacement&&g.placedOrientation===2?Math.PI/2:0;for(let Y=0;Y<g.numGlyphs;Y++)Qa(d,O,H);l&&g.associatedIconIndex>=0&&(m[g.associatedIconIndex]={shiftedAnchor:O,angle:H})}}if(l){f.clear();let _=e.icon.placedSymbolArray;for(let g=0;g<_.length;g++){let x=_.get(g);if(x.hidden)jr(x.numGlyphs,f);else{let y=m[g];if(!y)jr(x.numGlyphs,f);else for(let v=0;v<x.numGlyphs;v++)Qa(f,y.shiftedAnchor,y.angle)}}e.icon.dynamicLayoutVertexBuffer.updateData(f)}e.text.dynamicLayoutVertexBuffer.updateData(d)}function sM(e,t,i){return i.iconsInText&&t?"symbolTextAndIcon":e?"symbolSDF":"symbolIcon"}
vendor: 14,099 bytes, line 802
802function Qp(e,t,i,r,a,s,o,n,l,u,h,c,p){let d=e.context,f=d.gl,m=e.transform,_=n==="map",g=l==="map",x=n!=="viewport"&&i.layout.get("symbol-placement")!=="point",y=_&&!g&&!x,v=!i.layout.get("symbol-sort-key").isConstant(),w=!1,b=e.getDepthModeForSublayer(0,te.ReadOnly),T=i._unevaluatedLayout.hasValue("text-variable-anchor")||i._unevaluatedLayout.hasValue("text-variable-anchor-offset"),I=[],M=m.getCircleRadiusCorrection();for(let z of r){let P=t.getTile(z),S=P.getBucket(i);if(!S)continue;let F=a?S.text:S.icon;if(!F?.segments.get().length||!F.hasVisibleVertices)continue;let O=F.programConfigurations.get(i.id),H=a||S.sdfIcons,Y=a?S.textSizeData:S.iconSizeData,ie=g||m.pitch!==0,ue=e.useProgram(sM(H,a,S),O),me=rn(Y,m.zoom),It=e.style.map.terrain?.getTerrainData(z),Je,Qe=[0,0],qe,$t,ci=null,Ai;if(a){if(qe=P.glyphAtlasTexture,$t=f.LINEAR,Je=P.glyphAtlasTexture.size,S.iconsInText){Qe=P.imageAtlasTexture.size,ci=P.imageAtlasTexture;let Pe=Y.kind==="composite"||Y.kind==="camera";Ai=ie||e.options.rotating||e.options.zooming||Pe?f.LINEAR:f.NEAREST}}else{let Pe=i.layout.get("icon-size").constantOr(0)!==1||S.iconsNeedLinear;qe=P.imageAtlasTexture,$t=H||e.options.rotating||e.options.zooming||Pe||ie?f.LINEAR:f.NEAREST,Je=P.imageAtlasTexture.size}let Kt=St(P,1,e.transform.zoom),yr=Eh(_,e.transform,Kt),vr=sP(g,_,e.transform,Kt),xr=Ni(m,P,s,o),pn=m.getProjectionData({overscaledTileID:z,applyGlobeMatrix:!p,applyTerrainMatrix:!0}),dn=T&&S.hasTextData(),fn=i.layout.get("icon-text-fit")!=="none"&&dn&&S.hasIconData(),Et=i._unevaluatedLayout.hasValue("icon-offset");if(x){let Pe=Wi();tP(Pe,yr);let Di=e.style.map.terrain?(mn,_n)=>e.style.map.terrain.getElevation(z,mn,_n):null;nP(S,e,a,yr,Pe,g,u,i.layout.get("text-rotation-alignment")==="map",z.toUnwrapped(),m.width,m.height,xr,Di)}let Vt=a&&T||fn,br=g?yr:e.transform.clipSpaceToPixelsMatrix,Ci=x||Vt?QE:br,st=H&&i.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1)!==0,ot;ot=H?S.iconsInText?rE(Y.kind,me,y,g,x,Vt,e,Ci,vr,xr,Je,Qe,M,Et):dg(Y.kind,me,y,g,x,Vt,e,Ci,vr,xr,a,Je,st,M,Et):pg(Y.kind,me,y,g,x,Vt,e,Ci,vr,xr,a,Je,M,Et);let yt={program:ue,buffers:F,uniformValues:ot,projectionData:pn,atlasTexture:qe,atlasTextureIcon:ci,atlasInterpolation:$t,atlasInterpolationIcon:Ai,isSDF:H,hasHalo:st};if(v&&S.canOverlap){w=!0;let Pe=F.segments.get();for(let Di of Pe)I.push({segments:new Te([Di]),sortKey:Di.sortKey,state:yt,terrainData:It})}else I.push({segments:F.segments,sortKey:0,state:yt,terrainData:It})}w&&I.sort((z,P)=>z.sortKey-P.sortKey);let D=i.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(null)??1/0,L=i.layout.get("text-letter-spacing").constantOr(0)*24<0||D>1;for(let z of I){let P=z.state;d.activeTexture.set(f.TEXTURE0),P.atlasTexture.bind(P.atlasInterpolation,f.CLAMP_TO_EDGE),P.atlasTextureIcon&&(d.activeTexture.set(f.TEXTURE1),P.atlasTextureIcon&&P.atlasTextureIcon.bind(P.atlasInterpolationIcon,f.CLAMP_TO_EDGE));let S=P.isSDF&&P.hasHalo;if(S){let F=P.uniformValues;F.u_is_halo=1,L&&(F.u_is_plain=0,ed(P.buffers,z.segments,i,e,P.program,b,h,c,F,P.projectionData,z.terrainData),F.u_is_halo=0,F.u_is_plain=1)}ed(P.buffers,z.segments,i,e,P.program,b,h,c,P.uniformValues,P.projectionData,z.terrainData),S&&!L&&(P.uniformValues.u_is_halo=0)}}function ed(e,t,i,r,a,s,o,n,l,u,h){let c=r.context,p=c.gl;a.draw(c,p.TRIANGLES,s,o,n,le.backCCW,l,h,u,i.id,e.layoutVertexBuffer,e.indexBuffer,t,i.paint,r.transform.zoom,e.programConfigurations.get(i.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function oM(e,t,i,r,a){if(e.renderPass!=="translucent")return;let{isRenderingToTexture:s}=a,o=i.paint.get("circle-opacity"),n=i.paint.get("circle-stroke-width"),l=i.paint.get("circle-stroke-opacity"),u=!i.layout.get("circle-sort-key").isConstant();if(o.constantOr(1)===0&&(n.constantOr(1)===0||l.constantOr(1)===0))return;let h=e.context,c=h.gl,p=e.transform,d=e.getDepthModeForSublayer(0,te.ReadOnly),f=he.disabled,m=e.colorModeForRenderPass(),_=[],g=p.getCircleRadiusCorrection();for(let x of r){let y=t.getTile(x),v=y.getBucket(i);if(!v)continue;let w=Ni(p,y,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),b=v.programConfigurations.get(i.id),T=e.useProgram("circle",b),I=v.layoutVertexBuffer,M=v.indexBuffer,D=e.style.map.terrain?.getTerrainData(x),L={programConfiguration:b,program:T,layoutVertexBuffer:I,indexBuffer:M,uniformValues:TI(e,y,i,w,g),terrainData:D,projectionData:p.getProjectionData({overscaledTileID:x,applyGlobeMatrix:!s,applyTerrainMatrix:!0})};if(u){let z=v.segments.get();for(let P of z)_.push({segments:new Te([P]),sortKey:P.sortKey,state:L})}else _.push({segments:v.segments,sortKey:0,state:L})}u&&_.sort((x,y)=>x.sortKey-y.sortKey);for(let x of _){let{programConfiguration:y,program:v,layoutVertexBuffer:w,indexBuffer:b,uniformValues:T,terrainData:I,projectionData:M}=x.state,D=x.segments;v.draw(h,c.TRIANGLES,d,f,m,le.backCCW,T,I,M,i.id,w,b,D,i.paint,e.transform.zoom,y)}}function nM(e,t,i,r,a){if(i.paint.get("heatmap-opacity")===0)return;let s=e.context,{isRenderingToTexture:o,isRenderingGlobe:n}=a;if(e.style.map.terrain){for(let l of r){let u=t.getTile(l);t.hasRenderableParent(l)||(e.renderPass==="offscreen"?hM(e,u,i,l,n):e.renderPass==="translucent"&&cM(e,i,l,o,n))}s.viewport.set([0,0,e.width,e.height])}else e.renderPass==="offscreen"?lM(e,t,i,r):e.renderPass==="translucent"&&uM(e,i)}function lM(e,t,i,r){let a=e.context,s=a.gl,o=e.transform,n=he.disabled,l=new Ee([s.ONE,s.ONE],K.transparent,[!0,!0,!0,!0]);pM(a,e,i),a.clear({color:K.transparent});for(let u of r){if(t.hasRenderableParent(u))continue;let h=t.getTile(u),c=h.getBucket(i);if(!c)continue;let p=c.programConfigurations.get(i.id),d=e.useProgram("heatmap",p),f=o.getProjectionData({overscaledTileID:u,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),m=o.getCircleRadiusCorrection();d.draw(a,s.TRIANGLES,te.disabled,n,l,le.backCCW,ug(h,o.zoom,i.paint.get("heatmap-intensity"),m),null,f,i.id,c.layoutVertexBuffer,c.indexBuffer,c.segments,i.paint,o.zoom,p)}a.viewport.set([0,0,e.width,e.height])}function uM(e,t){let i=e.context,r=i.gl;i.setColorMode(e.colorModeForRenderPass());let a=t.heatmapFbos.get(xo);a&&(i.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,a.colorAttachment.get()),i.activeTexture.set(r.TEXTURE1),mg(i,t).bind(r.LINEAR,r.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(i,r.TRIANGLES,te.disabled,he.disabled,e.colorModeForRenderPass(),le.disabled,hg(e,t,0,1),null,null,t.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,t.paint,e.transform.zoom))}function hM(e,t,i,r,a){let s=e.context,o=s.gl,n=he.disabled,l=new Ee([o.ONE,o.ONE],K.transparent,[!0,!0,!0,!0]),u=t.getBucket(i);if(!u)return;let h=r.key,c=i.heatmapFbos.get(h);c||(c=fg(s,t.tileSize,t.tileSize),i.heatmapFbos.set(h,c)),s.bindFramebuffer.set(c.framebuffer),s.viewport.set([0,0,t.tileSize,t.tileSize]),s.clear({color:K.transparent});let p=u.programConfigurations.get(i.id),d=e.useProgram("heatmap",p,!a),f=e.transform.getProjectionData({overscaledTileID:t.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),m=e.style.map.terrain.getTerrainData(r);d.draw(s,o.TRIANGLES,te.disabled,n,l,le.disabled,ug(t,e.transform.zoom,i.paint.get("heatmap-intensity"),1),m,f,i.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,i.paint,e.transform.zoom,p)}function cM(e,t,i,r,a){let s=e.context,o=s.gl,n=e.transform;s.setColorMode(e.colorModeForRenderPass());let l=mg(s,t),u=i.key,h=t.heatmapFbos.get(u);if(!h)return;s.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,h.colorAttachment.get()),s.activeTexture.set(o.TEXTURE1),l.bind(o.LINEAR,o.CLAMP_TO_EDGE);let c=n.getProjectionData({overscaledTileID:i,applyTerrainMatrix:a,applyGlobeMatrix:!r});e.useProgram("heatmapTexture").draw(s,o.TRIANGLES,te.disabled,he.disabled,e.colorModeForRenderPass(),le.disabled,hg(e,t,0,1),null,c,t.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments,t.paint,n.zoom),h.destroy(),t.heatmapFbos.delete(u)}function pM(e,t,i){let r=e.gl;e.activeTexture.set(r.TEXTURE1),e.viewport.set([0,0,t.width/4,t.height/4]);let a=i.heatmapFbos.get(xo);a?(r.bindTexture(r.TEXTURE_2D,a.colorAttachment.get()),e.bindFramebuffer.set(a.framebuffer)):(a=fg(e,t.width/4,t.height/4),i.heatmapFbos.set(xo,a))}function fg(e,t,i){let r=e.gl,a=r.createTexture();r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texStorage2D(r.TEXTURE_2D,1,r.RGBA16F,t,i);let s=e.createFramebuffer(t,i,!1,!1);return s.colorAttachment.set(a),s}function mg(e,t){return t.colorRampTexture||=new ke(e,t.colorRamp,e.gl.RGBA),t.colorRampTexture}function _g(e,t,i,r){let a=e.context,s=a.bindFramebuffer.get(),o=a.viewport.get(),[,,n,l]=o;return dM(e,n,l),a.viewport.set([0,0,n,l]),a.clear({color:K.transparent,depth:1,stencil:0}),e.currentStencilSource=void 0,e.renderTileClippingMasks(t,i,r),{compositeTarget:s,compositeViewport:o}}function dM(e,t,i){let r=e.context.gl;if(!e.layerOpacityFbo){let s=e.context.createFramebuffer(t,i,!0,!0),o=r.createTexture();r.bindTexture(r.TEXTURE_2D,o),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,t,i,0,r.RGBA,r.UNSIGNED_BYTE,null),s.colorAttachment.set(o),s.depthAttachment.set(e.context.createRenderbuffer(r.DEPTH_STENCIL,t,i)),e.layerOpacityFbo=s,e.context.bindFramebuffer.set(e.layerOpacityFbo.framebuffer);return}if(e.layerOpacityFbo.width===t&&e.layerOpacityFbo.height===i){e.context.bindFramebuffer.set(e.layerOpacityFbo.framebuffer);return}let a=e.layerOpacityFbo;r.bindTexture(r.TEXTURE_2D,a.colorAttachment.get()),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,t,i,0,r.RGBA,r.UNSIGNED_BYTE,null),e.context.bindRenderbuffer.set(a.depthAttachment.get()),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,i),e.context.bindRenderbuffer.set(null),a.width=t,a.height=i,e.context.bindFramebuffer.set(a.framebuffer)}function gg(e,t,i,r){let a=e.context,s=a.gl;a.bindFramebuffer.set(i.compositeTarget),a.viewport.set(i.compositeViewport),a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,e.layerOpacityFbo.colorAttachment.get()),e.useProgram("layerOpacity").draw(a,s.TRIANGLES,te.disabled,he.disabled,e.colorModeForRenderPass(),le.disabled,HI(t,0),null,null,r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom),e.currentStencilSource=void 0}function yg(e,t,i,r,a,s,o,n){let l=256;if(a.stepInterpolant){let u=t.getSource().maxzoom,h=o.canonical.z===u?Math.ceil(1<<e.transform.maxZoom-o.canonical.z):1;l=oe(gy(s.maxLineLength/C*1024*h),256,i.maxTextureSize)}return n.gradient=Am({expression:a.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:n.gradient||void 0,clips:s.lineClipsArray}),n.texture?n.texture.update(n.gradient):n.texture=new ke(i,n.gradient,r.RGBA),n.version=a.gradientVersion,n.texture}function fM(e,t,i,r,a){e.activeTexture.set(t.TEXTURE0),i.imageAtlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE),r.updatePaintBuffers(a)}function mM(e,t,i,r,a,s){(a||e.lineAtlas.dirty)&&(t.activeTexture.set(i.TEXTURE0),e.lineAtlas.bind(t)),r.updatePaintBuffers(s)}function _M(e,t,i,r,a,s,o){let n=s.gradients[a.id],l=n.texture;a.gradientVersion!==n.version&&(l=yg(e,t,i,r,a,s,o,n)),i.activeTexture.set(r.TEXTURE0),l.bind(a.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE)}function gM(e,t,i,r,a,s,o,n,l){let u=s.gradients[a.id],h=u.texture;a.gradientVersion!==u.version&&(h=yg(e,t,i,r,a,s,o,u)),i.activeTexture.set(r.TEXTURE0),h.bind(a.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE),i.activeTexture.set(r.TEXTURE1),e.lineAtlas.bind(i),n.updatePaintBuffers(l)}function yM(e,t,i,r,a){if(e.renderPass!=="translucent")return;let s=i.paint.get("line-opacity"),o=i.paint.get("line-width"),n=i.paint.get("line-layer-opacity");if(s.constantOr(1)===0||o.constantOr(1)===0||n===0)return;let l=!!e.style.map.terrain;if(n<1){let u=_g(e,i,r,l);td(e,t,i,r,a,l),gg(e,n,u,i);return}td(e,t,i,r,a,l)}function td(e,t,i,r,a,s){let{isRenderingToTexture:o}=a,n=e.getDepthModeForSublayer(0,te.ReadOnly),l=e.colorModeForRenderPass(),u=i.paint.get("line-dasharray"),h=u.constantOr(1),c=i.paint.get("line-pattern"),p=c.constantOr(1),d=i.paint.get("line-gradient"),f=i.getCrossfadeParameters(),m;m=p?"linePattern":h&&d?"lineGradientSDF":h?"lineSDF":d?"lineGradient":"line";let _=e.context,g=_.gl,x=e.transform,y=!0;for(let v of r){let w=t.getTile(v);if(p&&!w.patternsLoaded())continue;let b=w.getBucket(i);if(!b)continue;let T=b.programConfigurations.get(i.id),I=e.context.program.get(),M=e.useProgram(m,T),D=y||M.program!==I,L=s?e.getTerrainDataForTile(v,o):null,z=c.constantOr(null),P=u?.constantOr(null);if(z&&w.imageAtlas){let Y=w.imageAtlas,ie=Y.patternPositions[z.to.toString()],ue=Y.patternPositions[z.from.toString()];ie&&ue&&T.setConstantPatternPositions(ie,ue)}else if(P){let Y=i.layout.get("line-cap").constantOr(null)==="round",ie=e.lineAtlas.getDash(P.to,Y),ue=e.lineAtlas.getDash(P.from,Y);T.setConstantDashPositions(ie,ue)}let S=x.getProjectionData({overscaledTileID:v,applyGlobeMatrix:!o,applyTerrainMatrix:!0}),F=x.getPixelScale(),O;p?(O=GI(e,w,i,F,f),fM(_,g,w,T,f)):h&&d?(O=qI(e,w,i,F,f,b.lineClipsArray.length),gM(e,t,_,g,i,b,v,T,f)):h?(O=ZI(e,w,i,F,f),mM(e,_,g,T,D,f)):d?(O=UI(e,w,i,F,b.lineClipsArray.length),_M(e,t,_,g,i,b,v)):O=hn(e,w,i,F);let H=e.stencilModeForClipping(v);M.draw(_,g.TRIANGLES,n,H,l,le.disabled,O,L,S,i.id,b.layoutVertexBuffer,b.indexBuffer,b.segments,i.paint,e.transform.zoom,T,b.layoutVertexBuffer2),y=!1}}function vg(e,t,i,r,a){if(!i||!r?.imageAtlas)return;let s=r.imageAtlas.patternPositions,o=s[i.to.toString()],n=s[i.from.toString()];if(!o&&n&&(o=n),!n&&o&&(n=o),!o||!n){let l=a.getPaintProperty(t);o=s[l],n=s[l]}o&&n&&e.setConstantPatternPositions(o,n)}function vM(e,t,i,r,a){let s=i.paint.get("fill-color"),o=i.paint.get("fill-opacity"),n=i.paint.get("fill-layer
vendor: 9,565 bytes, line 802
802-opacity");if(o.constantOr(1)===0||n===0)return;if(n<1){if(e.renderPass!=="translucent")return;let h=_g(e,i,r,!!e.style.map.terrain);id(e,t,i,r,a),gg(e,n,h,i);return}let l=i.paint.get("fill-pattern"),u=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&s.constantOr(K.transparent).a===1&&o.constantOr(0)===1;if(u&&e.renderPass==="opaque"){let{isRenderingToTexture:h}=a,c=e.colorModeForRenderPass();kh(e,t,i,r,e.getDepthModeForSublayer(1,te.ReadWrite),c,!1,h);return}if(u&&e.renderPass==="translucent"){xg(e,t,i,r,a);return}e.renderPass==="translucent"&&id(e,t,i,r,a)}function id(e,t,i,r,a){let{isRenderingToTexture:s}=a,o=e.colorModeForRenderPass();kh(e,t,i,r,e.getDepthModeForSublayer(1,te.ReadOnly),o,!1,s),xg(e,t,i,r,a)}function xg(e,t,i,r,a){if(!i.paint.get("fill-antialias"))return;let{isRenderingToTexture:s}=a,o=e.colorModeForRenderPass();kh(e,t,i,r,e.getDepthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,te.ReadOnly),o,!0,s)}function kh(e,t,i,r,a,s,o,n){let l=e.context.gl,u="fill-pattern",h=i.paint.get(u),c=h?.constantOr(1),p=i.getCrossfadeParameters(),d,f,m,_,g,x=e.transform,y=i.paint.get("fill-translate"),v=i.paint.get("fill-translate-anchor");o?(f=c&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",d=l.LINES):(f=c?"fillPattern":"fill",d=l.TRIANGLES);let w=h.constantOr(null);for(let b of r){let T=t.getTile(b);if(c&&!T.patternsLoaded())continue;let I=T.getBucket(i);if(!I)continue;let M=I.programConfigurations.get(i.id),D=e.useProgram(f,M),L=e.getTerrainDataForTile(b,n);c&&(e.context.activeTexture.set(l.TEXTURE0),T.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),M.updatePaintBuffers(p)),vg(M,u,w,T,i);let z=x.getProjectionData({overscaledTileID:b,applyGlobeMatrix:!n,applyTerrainMatrix:!0}),P=Ni(x,T,y,v);if(!o)_=I.indexBuffer,g=I.segments,m=c?lg(e,p,T,P):vI(P);else{_=I.indexBuffer2,g=I.segments2;let F=[l.drawingBufferWidth,l.drawingBufferHeight];m=f==="fillOutlinePattern"&&c?bI(e,p,T,F,P):xI(F,P)}let S=e.stencilModeForClipping(b);D.draw(e.context,d,a,S,s,le.backCCW,m,L,z,i.id,I.layoutVertexBuffer,_,g,i.paint,e.transform.zoom,M)}}function xM(e,t,i,r,a){let s=i.paint.get("fill-extrusion-opacity");if(s===0)return;let{isRenderingToTexture:o}=a;if(e.renderPass==="translucent"){let n=new te(e.context.gl.LEQUAL,te.ReadWrite,e.depthRangeFor3D);if(s===1&&!i.paint.get("fill-extrusion-pattern").constantOr(1)){let l=e.colorModeForRenderPass();Jn(e,t,i,r,n,he.disabled,l,o)}else Jn(e,t,i,r,n,he.disabled,Ee.disabled,o),Jn(e,t,i,r,n,e.stencilModeFor3D(),e.colorModeForRenderPass(),o)}}function Jn(e,t,i,r,a,s,o,n){let l=e.context,u=l.gl,h="fill-extrusion-pattern",c=i.paint.get(h),p=c.constantOr(1),d=i.getCrossfadeParameters(),f=i.paint.get("fill-extrusion-opacity"),m=c.constantOr(null),_=e.transform;for(let g of r){let x=t.getTile(g),y=x.getBucket(i);if(!y)continue;let v=e.style.map.terrain?.getTerrainData(g),w=y.programConfigurations.get(i.id),b=e.useProgram(p?"fillExtrusionPattern":"fillExtrusion",w);p&&(e.context.activeTexture.set(u.TEXTURE0),x.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),w.updatePaintBuffers(d));let T=_.getProjectionData({overscaledTileID:g,applyGlobeMatrix:!n,applyTerrainMatrix:!0});vg(w,h,m,x,i);let I=Ni(_,x,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),M=i.paint.get("fill-extrusion-vertical-gradient"),D=p?fI(e,M,f,I,g,d,x):ng(e,M,f,I);b.draw(l,l.gl.TRIANGLES,a,s,o,le.backCCW,D,v,T,i.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,i.paint,e.transform.zoom,w,e.style.map.terrain&&y.centroidVertexBuffer)}}function bM(e,t,i,r,a){if(e.renderPass!=="offscreen"&&e.renderPass!=="translucent")return;let{isRenderingToTexture:s}=a,o=e.context,n=e.style.projection.useSubdivision,l=e.getDepthModeForSublayer(0,te.ReadOnly),u=e.colorModeForRenderPass();if(e.renderPass==="offscreen")wM(e,t,r,i,l,he.disabled,u),o.viewport.set([0,0,e.width,e.height]);else if(e.renderPass==="translucent")if(n){let[h,c,p]=e.stencilConfigForOverlapTwoPass(r);Qn(e,t,i,p,h,l,u,!1,s),Qn(e,t,i,p,c,l,u,!0,s)}else{let[h,c]=e.getStencilConfigForOverlapAndUpdateStencilID(r);Qn(e,t,i,c,h,l,u,!1,s)}}function Qn(e,t,i,r,a,s,o,n,l){let u=e.style.projection,h=e.context,c=e.transform,p=h.gl,d=[`#define NUM_ILLUMINATION_SOURCES ${i.paint.get("hillshade-highlight-color").values.length}`],f=e.useProgram("hillshade",null,!1,d),m=!e.options.moving;for(let _ of r){let g=t.getTile(_),x=g.fbo;if(!x)continue;let y=u.getMeshFromTileID(h,_.canonical,n,!0,"raster"),v=e.getTerrainDataForTile(_,l);h.activeTexture.set(p.TEXTURE0),p.bindTexture(p.TEXTURE_2D,x.colorAttachment.get());let w=c.getProjectionData({overscaledTileID:_,aligned:m,applyGlobeMatrix:!l,applyTerrainMatrix:!0});f.draw(h,p.TRIANGLES,s,a[_.overscaledZ],o,le.backCCW,RI(e,g,i),v,w,i.id,y.vertexBuffer,y.indexBuffer,y.segments)}}function wM(e,t,i,r,a,s,o){let n=e.context,l=n.gl,u=r.paint.get("resampling")==="nearest"?l.NEAREST:l.LINEAR;for(let h of i){let c=t.getTile(h),p=c.dem;if(!p?.data||!c.needsHillshadePrepare)continue;let d=p.dim,f=p.stride,m=p.getPixels();if(n.activeTexture.set(l.TEXTURE1),n.pixelStoreUnpackPremultiplyAlpha.set(!1),c.demTexture||=e.getTileTexture(f),c.demTexture){let g=c.demTexture;g.update(m,{premultiply:!1}),g.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else c.demTexture=new ke(n,m,l.RGBA,{premultiply:!1}),c.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);n.activeTexture.set(l.TEXTURE0);let _=c.fbo;if(!_){let g=new ke(n,{width:d,height:d,data:null},l.RGBA);g.bind(u,l.CLAMP_TO_EDGE),_=c.fbo=n.createFramebuffer(d,d,!0,!1),_.colorAttachment.set(g.texture)}n.bindFramebuffer.set(_.framebuffer),n.viewport.set([0,0,d,d]),e.useProgram("hillshadePrepare").draw(n,l.TRIANGLES,a,s,o,le.disabled,kI(c.tileID,p),null,null,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),c.needsHillshadePrepare=!1}}function TM(e,t,i,r,a){if(e.renderPass!=="translucent"||!r.length)return;let{isRenderingToTexture:s}=a,o=e.style.projection.useSubdivision,n=e.getDepthModeForSublayer(0,te.ReadOnly),l=e.colorModeForRenderPass();if(o){let[u,h,c]=e.stencilConfigForOverlapTwoPass(r);el(e,t,i,c,u,n,l,!1,s),el(e,t,i,c,h,n,l,!0,s)}else{let[u,h]=e.getStencilConfigForOverlapAndUpdateStencilID(r);el(e,t,i,h,u,n,l,!1,s)}}let rd=0;function el(e,t,i,r,a,s,o,n,l){let u=e.style.projection,h=e.context,c=e.transform,p=h.gl,d=e.useProgram("colorRelief"),f=!e.options.moving,m=i.paint.get("resampling")==="nearest"?p.NEAREST:p.LINEAR,_=!0,g=0;for(let x of r){let y=t.getTile(x),v=y.dem;if(_){rd||=p.getParameter(p.MAX_TEXTURE_SIZE);let D=rd,{elevationTexture:L,colorTexture:z}=i.getColorRampTextures(h,D,v.getUnpackVector());h.activeTexture.set(p.TEXTURE1),L.bind(p.NEAREST,p.CLAMP_TO_EDGE),h.activeTexture.set(p.TEXTURE4),z.bind(p.LINEAR,p.CLAMP_TO_EDGE),_=!1,g=L.size[0]}if(!v?.data)continue;let w=v.stride,b=v.getPixels();if(h.activeTexture.set(p.TEXTURE0),h.pixelStoreUnpackPremultiplyAlpha.set(!1),y.demTexture||=e.getTileTexture(w),y.demTexture){let D=y.demTexture;D.update(b,{premultiply:!1}),D.bind(m,p.CLAMP_TO_EDGE)}else y.demTexture=new ke(h,b,p.RGBA,{premultiply:!1}),y.demTexture.bind(m,p.CLAMP_TO_EDGE);let T=u.getMeshFromTileID(h,x.canonical,n,!0,"raster"),I=e.getTerrainDataForTile(x,l),M=c.getProjectionData({overscaledTileID:x,aligned:f,applyGlobeMatrix:!l,applyTerrainMatrix:!0});d.draw(h,p.TRIANGLES,s,a[x.overscaledZ],o,le.backCCW,BI(i,y.dem,g),I,M,i.id,T.vertexBuffer,T.indexBuffer,T.segments)}}const tl=[new E(0,0),new E(C,0),new E(C,C),new E(0,C)];function SM(e,t,i,r,a){if(e.renderPass!=="translucent"||i.paint.get("raster-opacity")===0||!r.length)return;let{isRenderingToTexture:s}=a,o=t.getSource(),n=e.style.projection.useSubdivision;if(o instanceof gs)Gs(e,t,i,r,null,!1,!1,o.tileCoords,o.flippedWindingOrder,s);else if(n){let[l,u,h]=e.stencilConfigForOverlapTwoPass(r);Gs(e,t,i,h,l,!1,!0,tl,!1,s),Gs(e,t,i,h,u,!0,!0,tl,!1,s)}else{let[l,u]=e.getStencilConfigForOverlapAndUpdateStencilID(r);Gs(e,t,i,u,l,!1,!0,tl,!1,s)}}function Gs(e,t,i,r,a,s,o,n,l=!1,u=!1){let h=r[r.length-1].overscaledZ,c=e.context,p=c.gl,d=e.useProgram("raster"),f=e.transform,m=e.style.projection,_=e.colorModeForRenderPass(),g=!e.options.moving,x=i.paint.get("raster-opacity"),y=i.paint.get("resampling")==="nearest"||i.paint.get("raster-resampling")==="nearest"?p.NEAREST:p.LINEAR,v=i.paint.get("raster-fade-duration"),w=!!e.style.map.terrain;for(let b of r){let T=e.getDepthModeForSublayer(b.overscaledZ-h,x===1?te.ReadWrite:te.ReadOnly,p.LESS),I=t.getTile(b);c.activeTexture.set(p.TEXTURE0),I.texture.bind(y,p.CLAMP_TO_EDGE,p.LINEAR_MIPMAP_NEAREST),c.activeTexture.set(p.TEXTURE1);let{parentTile:M,parentScaleBy:D,parentTopLeft:L,fadeValues:z}=PM(I,t,v,w);I.fadeOpacity=z.tileOpacity,M?(M.fadeOpacity=z.parentTileOpacity,M.texture.bind(y,p.CLAMP_TO_EDGE,p.LINEAR_MIPMAP_NEAREST)):I.texture.bind(y,p.CLAMP_TO_EDGE,p.LINEAR_MIPMAP_NEAREST),I.texture.useMipmap&&c.extTextureFilterAnisotropic&&e.transform.pitch>e.options.anisotropicFilterPitch&&p.texParameterf(p.TEXTURE_2D,c.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,c.extTextureFilterAnisotropicMax);let P=e.getTerrainDataForTile(b,u),S=f.getProjectionData({overscaledTileID:b,aligned:g,applyGlobeMatrix:!u,applyTerrainMatrix:!0}),F=YI(L,D,z.fadeMix,i,n),O=m.getMeshFromTileID(c,b.canonical,s,o,"raster"),H=a?a[b.overscaledZ]:he.disabled;d.draw(c,p.TRIANGLES,T,H,_,l?le.frontCCW:le.backCCW,F,P,S,i.id,O.vertexBuffer,O.indexBuffer,O.segments)}}function PM(e,t,i,r){let a={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(i===0||r)return a;
vendor: 3,892 bytes, line 802
802if(e.fadingParentID){let s=t.getLoadedTile(e.fadingParentID);if(!s)return a;let o=2**(s.tileID.overscaledZ-e.tileID.overscaledZ);return{parentTile:s,parentScaleBy:o,parentTopLeft:[e.tileID.canonical.x*o%1,e.tileID.canonical.y*o%1],fadeValues:IM(e,s,i)}}return e.selfFading?{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:EM(e,i)}:a}function IM(e,t,i){let r=_e(),a=(r-e.timeAdded)/i,s=(r-t.timeAdded)/i,o=e.fadingDirection===1,n=oe(a,0,1),l=oe(1-s,0,1),u=o?n:l;return{tileOpacity:u,parentTileOpacity:o?l:n,fadeMix:{opacity:1,mix:1-u}}}function EM(e,t){let i=oe((_e()-e.timeAdded)/t,0,1);return{tileOpacity:i,fadeMix:{opacity:i,mix:0}}}function MM(e,t,i,r,a){let s=i.paint.get("background-color"),o=i.paint.get("background-opacity");if(o===0)return;let{isRenderingToTexture:n}=a,l=e.context,u=l.gl,h=e.style.projection,c=e.transform,p=c.tileSize,d=i.paint.get("background-pattern");if(e.isPatternMissing(d))return;let f=!d&&s.a===1&&o===1&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass!==f)return;let m=he.disabled,_=e.getDepthModeForSublayer(0,f==="opaque"?te.ReadWrite:te.ReadOnly),g=e.colorModeForRenderPass(),x=e.useProgram(d?"backgroundPattern":"background"),y=r||sa(c,{tileSize:p,terrain:e.style.map.terrain});d&&(l.activeTexture.set(u.TEXTURE0),e.imageManager.bind(e.context));let v=i.getCrossfadeParameters();for(let w of y){let b=c.getProjectionData({overscaledTileID:w,applyGlobeMatrix:!n,applyTerrainMatrix:!0}),T=d?nE(o,e,d,{tileID:w,tileSize:p},v):oE(o,s),I=e.getTerrainDataForTile(w,n),M=h.getMeshFromTileID(l,w.canonical,!1,!0,"raster");x.draw(l,u.TRIANGLES,_,m,g,le.backCCW,T,I,b,i.id,M.vertexBuffer,M.indexBuffer,M.segments)}}const AM=new K(1,0,0,1),CM=new K(0,1,0,1),DM=new K(0,0,1,1),zM=new K(1,0,1,1),RM=new K(0,1,1,1);function kM(e){let t=e.transform.padding;ad(e,e.transform.height-(t.top||0),3,AM),ad(e,t.bottom||0,3,CM),sd(e,t.left||0,3,DM),sd(e,e.transform.width-(t.right||0),3,zM);let i=e.transform.centerPoint;LM(e,i.x,e.transform.height-i.y,RM)}function LM(e,t,i,r){zo(e,t-2/2,i-20/2,2,20,r),zo(e,t-20/2,i-2/2,20,2,r)}function ad(e,t,i,r){zo(e,0,t+i/2,e.transform.width,i,r)}function sd(e,t,i,r){zo(e,t-i/2,0,i,e.transform.height,r)}function zo(e,t,i,r,a,s){let o=e.context,n=o.gl;n.enable(n.SCISSOR_TEST),n.scissor(t*e.pixelRatio,i*e.pixelRatio,r*e.pixelRatio,a*e.pixelRatio),o.clear({color:s}),n.disable(n.SCISSOR_TEST)}function FM(e,t,i){for(let r of i)BM(e,t,r)}function BM(e,t,i){let r=e.context,a=r.gl,s=e.useProgram("debug"),o=te.disabled,n=he.disabled,l=e.colorModeForRenderPass(),u="$debug",h=e.style.map.terrain?.getTerrainData(i);r.activeTexture.set(a.TEXTURE0);let c=t.getTileByID(i.key).latestRawTileData?.byteLength||0,p=Math.floor(c/1024),d=t.getTile(i).tileSize,f=512/Math.min(d,512)*(i.overscaledZ/e.transform.zoom)*.5,m=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(m+=` => ${i.overscaledZ}`),OM(e,`${m} ${p}kB`);let _=e.transform.getProjectionData({overscaledTileID:i,applyGlobeMatrix:!0,applyTerrainMatrix:!0});s.draw(r,a.TRIANGLES,o,n,Ee.alphaBlended,le.disabled,Xp(K.transparent,f),null,_,u,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments),s.draw(r,a.LINE_STRIP,o,n,l,le.disabled,Xp(K.red),h,_,u,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments)}function OM(e,t){e.initDebugOverlayCanvas();let i=e.debugOverlayCanvas,r=e.context.gl,a=e.debugOverlayCanvas.getContext("2d");a.clearRect(0,0,i.width,i.height),a.shadowColor="white",a.shadowBlur=2,a.lineWidth=1.5,a.strokeStyle="white",a.textBaseline="top",a.font="bold 36px Open Sans, sans-serif",a.fillText(t,5,5),a.strokeText(t,5,5),e.debugOverlayTexture.update(i),e.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}function $M(e,t){let i=null,r=Object.values(e._layers).flatMap(n=>n.source&&!n.isHidden(t)?[e.tileManagers[n.source]]:[]),a=r.filter(n=>n.getSource().type==="vector"),s=r.filter(n=>n.getSource().type!=="vector"),o=n=>
802{(!i||i.getSource().maxzoom<n.getSource().maxzoom)&&(i=n)};for(let n of a)o(n);if(!i)for(let n of s)o(n);return i}function VM(e,t,i,r){let{isRenderingGlobe:a}=r,s=e.context,o=i.implementation,n=e.style.projection,l=e.transform,u=l.getProjectionDataForCustomLayer(a),h={farZ:l.farZ,nearZ:l.nearZ,fov:l.fov*Math.PI/180,modelViewProjectionMatrix:l.modelViewProjectionMatrix,projectionMatrix:l.projectionMatrix,shaderData:{variantName:n.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793; 803uniform mat4 u_projection_matrix; 804${n.shaderPreludeCode.vertexSource}`,define:n.shaderDefine},defaultProjectionData:u,getProjectionData:p=>l.getProjectionData({overscaledTileID:new et(p.tileID.canonical.z,p.tileID.wrap??0,p.tileID.canonical.z,p.tileID.canonical.x,p.tileID.canonical.y),aligned:p.aligned,applyGlobeMatrix:p.applyGlobeMatrix,applyTerrainMatrix:p.applyTerrainMatrix})},c=o.renderingMode?o.renderingMode:"2d";if(e.renderPass==="offscreen"){let p=o.prerender;p&&(e.setCustomLayerDefaults(),s.setColorMode(e.colorModeForRenderPass()),p.call(o,s.gl,h),s.setDirty(),e.setBaseState())}else if(e.renderPass==="translucent"){e.setCustomLayerDefaults(),s.setColorMode(e.colorModeForRenderPass()),s.setStencilMode(he.disabled);let p=c==="3d"?e.getDepthModeFor3D():e.getDepthModeForSublayer(0,te.ReadOnly);s.setDepthMode(p),o.render(s.gl,h),s.setDirty(),e.setBaseState(),s.bindFramebuffer.set(null)}}function jM(e,t){let i=e.context,r=i.gl,a=e.transform,s=Ee.unblended,o=new te(r.LEQUAL,te.ReadWrite,[0,1]),n=t.tileManager.getRenderableTiles(),l=e.useProgram("terrainDepth");i.bindFramebuffer.set(t.getFramebuffer("depth").framebuffer),i.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),i.clear({color:K.transparent,depth:1});for(let u of n){let h=t.getTerrainMesh(u.tileID),c=t.getTerrainData(u.tileID),p=a.getProjectionData({overscaledTileID:u.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),d=oI(t.getSkirtLength(a.zoom));l.draw(i,r.TRIANGLES,o,he.disabled,s,le.backCCW,d,c,p,"terrain",h.vertexBuffer,h.indexBuffer,h.segments)}i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height])}function NM(e,t){let i=e.context,r=i.gl,a=e.transform,s=Ee.unblended,o=new te(r.LEQUAL,te.ReadWrite,[0,1]),n=t.getCoordsTexture(),l=t.tileManager.getRenderableTiles(),u=e.useProgram("terrainCoords");i.bindFramebuffer.set(t.getFramebuffer("coords").framebuffer),i.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),i.clear({color:K.transparent,depth:1}),t.coordsIndex=[];for(let h of l){let c=t.getTerrainMesh(h.tileID),p=t.getTerrainData(h.tileID);i.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,n.texture);let d=nI(255-t.coordsIndex.length,t.getSkirtLength(a.zoom)),f=a.getProjectionData({overscaledTileID:h.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});u.draw(i,r.TRIANGLES,o,he.disabled,s,le.backCCW,d,p,f,"terrain",c.vertexBuffer,c.indexBuffer,c.segments),t.coordsIndex.push(h.tileID.key)}i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height])}function UM(e,t,i,r){let{isRenderingGlobe:a}=r,s=e.context,o=s.gl,n=e.transform,l=e.colorModeForRenderPass(),u=e.getDepthModeFor3D(),h=e.useProgram("terrain");s.bindFramebuffer.set(null),s.viewport.set([0,0,e.width,e.height]);for(let c of i){let p=t.getTerrainMesh(c.tileID),d=e.renderToTexture.getTexture(c),f=t.getTerrainData(c.tileID);s.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,d.texture);let m=sI(t.getSkirtLength(n.zoom),n.calculateFogMatrix(c.tileID.toUnwrapped()),e.style.sky,n.pitch,a),_=n.getProjectionData({overscaledTileID:c.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});h.draw(s,o.TRIANGLES,u,he.disabled,l,le.backCCW,m,f,_,"terrain",p.vertexBuffer,p.indexBuffer,p.segments)}}function bg(e,t){if(!t.mesh){let i=new Oi;i.emplaceBack(-1,-1),i.emplaceBack(1,-1),i.emplaceBack(1,1),i.emplaceBack(-1,1);let r=new hi;r.emplaceBack(0,1,2),r.emplaceBack(0,2,3),t.mesh=new ys(e.createVertexBuffer(i,rr.members),e.createIndexBuffer(r),Te.simpleSegment(0,0,i.length,r.length))}return t.mesh}function GM(e,t){let i=e.context,r=i.gl,a=cE(t,e.transform,e.pixelRatio),s=new te(r.LEQUAL,te.ReadWrite,[0,1]),o=he.disabled,n=e.colorModeForRenderPass(),l=e.useProgram("sky"),u=bg(i,t);l.draw(i,r.TRIANGLES,s,o,n,le.disabled,a,null,void 0,"sky",u.vertexBuffer,u.indexBuffer,u.segments)}function ZM(e,t){let i=e.getCartesianPosition();Yg(i,i);let r=Xt(new Float64Array(16));return e.properties.get("anchor")==="map"&&(Fi(r,r,t.rollInRadians),Nr(r,r,-t.pitchInRadians),Fi(r,r,t.bearingInRadians),Nr(r,r,t.center.lat*Math.PI/180),vd(r,r,-t.center.lng*Math.PI/180)
804),Kg(i,i,r),i}function qM(e,t,i){let r=e.context,a=r.gl,s=e.useProgram("atmosphere"),o=new te(a.LEQUAL,te.ReadOnly,[0,1]),n=e.transform,l=ZM(i,e.transform),u=n.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),h=t.properties.get("atmosphere-blend")*u.projectionTransition;if(h===0)return;let c=un(n.worldSize,n.center.lat),p=n.inverseProjectionMatrix,d=new Float64Array(4);d[3]=1,Ue(d,d,n.modelViewProjectionMatrix),d[0]/=d[3],d[1]/=d[3],d[2]/=d[3],d[3]=1,Ue(d,d,p),d[0]/=d[3],d[1]/=d[3],d[2]/=d[3],d[3]=1;let f=uE(l,h,[d[0],d[1],d[2]],c,p),m=bg(r,t);s.draw(r,a.TRIANGLES,o,he.disabled,Ee.alphaBlended,le.disabled,f,null,null,"atmosphere",m.vertexBuffer,m.indexBuffer,m.segments)}const WM={symbol:eM,circle:oM,heatmap:nM,line:yM,fill:vM,fillExtrusion:xM,hillshade:bM,colorRelief:TM,raster:SM,background:MM,sky:GM,atmosphere:qM,custom:VM,debug:FM,debugPadding:kM,terrainDepth:jM,terrainCoords:NM};var ur,HM=(ur=class{constructor(t,i){this.drawFunctions=WM,this.context=new KE(t),this.transform=i,this.layerOpacityFbo=null,this._tileTextures={},this._rttObjectRecyclePool=[],this._rttSharedFbo=null,this.terrainFacilitator={depthDirty:!0,coordsDirty:!1,matrix:Xt(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=xu.maxOverzooming+xu.maxUnderzooming+1,this.depthEpsilon=1/2**16,this.crossTileSymbolIndex=new N_}resize(t,i,r){if(this.width=Math.floor(t*r),this.height=Math.floor(i*r),this.pixelRatio=r,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let a of this.style._order)this.style._layers[a].resize()}setup(){let t=this.context,i=new Oi;i.emplaceBack(0,0),i.emplaceBack(C,0),i.emplaceBack(0,C),i.emplaceBack(C,C),this.tileExtentBuffer=t.createVertexBuffer(i,rr.members),this.tileExtentSegments=Te.simpleSegment(0,0,4,2);let r=new Oi;r.emplaceBack(0,0),r.emplaceBack(C,0),r.emplaceBack(0,C),r.emplaceBack(C,C),this.debugBuffer=t.createVertexBuffer(r,rr.members),this.debugSegments=Te.simpleSegment(0,0,4,5);let a=new ax;a.emplaceBack(0,0,0,0),a.emplaceBack(C,0,C,0),a.emplaceBack(0,C,0,C),a.emplaceBack(C,C,C,C),this.rasterBoundsBuffer=t.createVertexBuffer(a,QP.members),this.rasterBoundsSegments=Te.simpleSegment(0,0,4,2);let s=new Oi;s.emplaceBack(0,0),s.emplaceBack(C,0),s.emplaceBack(0,C),s.emplaceBack(C,C),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(s,rr.members),this.rasterBoundsSegmentsPosOnly=Te.simpleSegment(0,0,4,5);let o=new Oi;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(o,rr.members),this.viewportSegments=Te.simpleSegment(0,0,4,2);let n=new _x;n.emplaceBack(0),n.emplaceBack(1),n.emplaceBack(3),n.emplaceBack(2),n.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(n);let l=new hi;l.emplaceBack(1,0,2),l.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(l);let u=this.context.gl;this.stencilClearMode=new he({func:u.ALWAYS,mask:0},0,255,u.ZERO,u.ZERO,u.ZERO),this.tileExtentMesh=new ys(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let t=this.context,i=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let r=Wi();Jt(r,0,this.width,this.height,0,0,1),tt(r,r,[i.drawingBufferWidth,i.drawingBufferHeight,0]);let a={mainMatrix:r,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:r,clipAntimeridian:!1};this.useProgram("clippingMask",null,!0).draw(t,i.TRIANGLES,te.disabled,this.stencilClearMode,Ee.disabled,le.disabled,null,null,a,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}renderTileClippingMasks(t,i,r){if(this.currentStencilSource===t.source||!t.isTileClipped()||!i?.length)return;this.currentStencilSource=t.source,this.nextStencilID+i.length>256&&this.clearStencil();let a=this.context;a.setColorMode(Ee.disabled),a.setDepthMode(te.disabled);let s={};for(let o of i)s[o.key]=this.nextStencilID++;this._renderTileMasks(s,i,r,!0),this._renderTileMasks(s,i,r,!1),this._tileClippingMaskIDs=s}_renderTileMasks(t,i,r,a){let s=this.context,o=s.gl,n=this.style.projection,l=this.transform,u=this.useProgram("clippingMask");for(let h of i){let c=t[h.key],p=this.getTerrainDataForTile(h,r),d=n.getMeshFromTileID(this.context,h.canonical,a,!0,"stencil"),f=l.getProjectionData({overscaledTileID:h,applyGlobeMatrix:!r,applyTerrainMatrix:!0});u.draw(s,o.TRIANGLES,te.disabled,new he({func:o.ALWAYS,mask:0},c,255,o.KEEP,o.KEEP,o.REPLACE),Ee.disabled,r?le.disabled:le.backCCW,null,p,f,"$clipping",d.vertexBuffer,d.indexBuffer,d.segments)}}getTerrainDataForTile(t,i){return i&&this.style.projection?.name==="mercator"?null:this.style.map.terrain?.getTerrainData(t)||null}_renderTilesDepthBuffer(){let t=this.context,i=t.gl,r=this.style.projection,a=this.transform,s=this.useProgram("depth"),o=this.getDepthModeFor3D(),n=sa(a,{tileSize:a.tileSize});for(let l of n){let u=this.style.map.terrain?.getTerrainData(l),h=r.getMeshFromTileID(this.context,l.canonical,!0,!0,"raster"),c=a.getProjectionData({overscaledTileID:l,applyGlobeMatrix:!0,applyTerrainMatrix:!0});s.draw(t,i.TRIANGLES,o,he.disabled,Ee.disabled,le.backCCW,null,u,c,"$clipping",h.vertexBuffer,h.indexBuffer,h.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,i=this.context.gl;return new he({func:i.NOTEQUAL,mask:255},t,255,i.KEEP,i.KEEP,i.REPLACE)}stencilModeForClipping(t){let i=this.context.gl;return new he({func:i.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,i.KEEP,i.KEEP,i.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(t){let i=this.context.gl,r=t.sort((o,n)=>
804n.overscaledZ-o.overscaledZ),a=r[r.length-1].overscaledZ,s=r[0].overscaledZ-a+1;if(s>1){this.currentStencilSource=void 0,this.nextStencilID+s>256&&this.clearStencil();let o={};for(let n=0;n<s;n++)o[n+a]=new he({func:i.GEQUAL,mask:255},n+this.nextStencilID,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID+=s,[o,r]}return[{[a]:he.disabled},r]}stencilConfigForOverlapTwoPass(t){let i=this.context.gl,r=t.sort((o,n)=>n.overscaledZ-o.overscaledZ),a=r[r.length-1].overscaledZ,s=r[0].overscaledZ-a+1;if(this.clearStencil(),s>1){let o={},n={};for(let l=0;l<s;l++)o[l+a]=new he({func:i.GREATER,mask:255},s+1+l,255,i.KEEP,i.KEEP,i.REPLACE),n[l+a]=new he({func:i.GREATER,mask:255},1+l,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID=s*2+1,[o,n,r]}else return this.nextStencilID=3,[{[a]:new he({func:i.GREATER,mask:255},2,255,i.KEEP,i.KEEP,i.REPLACE)},{[a]:new he({func:i.GREATER,mask:255},1,255,i.KEEP,i.KEEP,i.REPLACE)},r]}colorModeForRenderPass(){let t=this.context.gl;if(this._showOverdrawInspector){let i=.125;return new Ee([t.CONSTANT_COLOR,t.ONE],new K(i,i,i,0),[!0,!0,!0,!0])}else return this.renderPass==="opaque"?Ee.unblended:Ee.alphaBlended}getDepthModeForSublayer(t,i,r){if(!this.opaquePassEnabledForLayer())return te.disabled;let a=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new te(r||this.context.gl.LEQUAL,i,[a,a])}getDepthModeFor3D(){return new te(this.context.gl.LEQUAL,te.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,i){this.style=t,this.options=i,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(_e()),this.imageManager.beginFrame();let r=this.style._order,a=this.style.tileManagers,s={},o={},n={}
804,l={isRenderingToTexture:!1,isRenderingGlobe:t.projection?.transitionState>0};for(let h in a){let c=a[h];c.used&&c.prepare(this.context),s[h]=c.getVisibleCoordinates(!1),o[h]=s[h].slice().reverse(),n[h]=c.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let h=0;h<r.length;h++){let c=r[h];if(this.style._layers[c].is3D()){this.opaquePassCutoff=h;break}}this.maybeDrawDepth(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(let h of r){let c=this.style._layers[h];if(!c.hasOffscreenPass()||c.isHidden(this.transform.zoom))continue;let p=o[c.source];c.type!=="custom"&&!p.length||this.renderLayer(this,a[c.source],c,p,l)}if(this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?K.black:K.transparent,depth:1}),this.clearStencil(),this.style.sky&&this.drawFunctions.sky(this,this.style.sky),this._showOverdrawInspector=i.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=r.length-1;this.currentLayer>=0;this.currentLayer--){let h=this.style._layers[r[this.currentLayer]],c=a[h.source],p=s[h.source];this.renderTileClippingMasks(h,p,!1),this.renderLayer(this,c,h,p,l)}this.renderPass="translucent";let u=!1;for(this.currentLayer=0;this.currentLayer<r.length;this.currentLayer++){let h=this.style._layers[r[this.currentLayer]],c=a[h.source];if(this.renderToTexture?.renderLayer(h,l))continue;!this.opaquePassEnabledForLayer()&&!u&&(u=!0,l.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());let p=(h.type==="symbol"?n:o)[h.source];this.renderTileClippingMasks(h,s[h.source],!!this.renderToTexture),this.renderLayer(this,c,h,p,l)}if(l.isRenderingGlobe&&this.drawFunctions.atmosphere(this,this.style.sky,this.style.light),this.options.showTileBoundaries){let h=$M(this.style,this.transform.zoom);h&&this.drawFunctions.debug(this,h,h.getVisibleCoordinates())}this.options.showPadding&&this.drawFunctions.debugPadding(this),this.context.setDefault()}maybeDrawDepth(t){if(!this.style?.map?.terrain)return;let i=this.terrainFacilitator.matrix,r=this.transform.modelViewProjectionMatrix,a=this.terrainFacilitator.depthDirty;a||=t?!qg(i,r):!Wg(i,r),a||=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime),a&&(Ng(i,r),this.terrainFacilitator.renderTime=_e(),this.terrainFacilitator.depthDirty=!1,this.terrainFacilitator.coordsDirty=!0,this.drawFunctions.terrainDepth(this,this.style.map.terrain))}maybeDrawCoords(){!this.style?.map?.terrain||!this.terrainFacilitator.coordsDirty||(this.terrainFacilitator.coordsDirty=!1,this.drawFunctions.terrainCoords(this,this.style.map.terrain))}renderLayer(t,i,r,a,s){if(r.isHidden(this.transform.zoom)||r.type!=="background"&&r.type!=="custom"&&!(a||[]).length)return;this.id=r.id;let o=this.drawFunctions;Wm(r)?o.symbol(t,i,r,a,this.style.placement.variableOffsets,s):qx(r)?o.circle(t,i,r,a,s):Kx(r)?o.heatmap(t,i,r,a,s):bb(r)?o.line(t,i,r,a,s):N1(r)?o.fill(t,i,r,a,s):ab(r)?o.fillExtrusion(t,i,r,a,s):i1(r)?o.hillshade(t,i,r,a,s):l1(r)?o.colorRelief(t,i,r,a,s):El(r)?o.raster(t,i,r,a,s):Kb(r)?o.background(t,i,r,a,s):ew(r)&&o.custom(t,i,r,s)}saveTileTexture(t){let i=this._tileTextures[t.size[0]];i?i.length<ur.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?i.push(t):t.destroy():this._tileTextures[t.size[0]]=[t]}getTileTexture(t){let i=this._tileTextures[t];return i&&i.length>0?i.pop():null}acquireRTT(t){let i=this.context.gl,r=this._rttObjectRecyclePool.pop();if(r)return r.size!==t&&(i.bindTexture(i.TEXTURE_2D,r.texture.texture),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,t,0,i.RGBA,i.UNSIGNED_BYTE,null),r.texture.size=[t,t],r.size=t),r;let a=new ke(this.context,{width:t,height:t,data:null},i.RGBA);return a.bind(i.LINEAR,i.CLAMP_TO_EDGE),this.context.extTextureFilterAnisotropic&&i.texParameterf(i.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),{texture:a,size:t}}bindRTT(t){let i=this.context.gl,r=t.size;if(!this._rttSharedFbo){let a=this.context.createFramebuffer(r,r,!0,!0),s=this.context.createRenderbuffer(i.DEPTH_STENCIL,r,r);a.depthAttachment.set(s),this._rttSharedFbo={fbo:a,depthRenderbuffer:s,size:r}}this._rttSharedFbo.size!==r&&(this.context.bindRenderbuffer.set(this._rttSharedFbo.depthRenderbuffer),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,r,r),this.context.bindRenderbuffer.set(null),this._rttSharedFbo.fbo.width=r,this._rttSharedFbo.fbo.height=r,this._rttSharedFbo.size=r),this._rttSharedFbo.fbo.colorAttachment.set(t.texture.texture),this.context.bindFramebuffer.set(this._rttSharedFbo.fbo.framebuffer)}releaseRTT(t){this._rttObjectRecyclePool.push(t)}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let i=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!i||!r}useProgram(t,i,r=!1,a=[]){this.cache||={};let s=!!this.style.map.terrain,o=this.style.projection,n=r?ii.projectionMercator:o.shaderPreludeCode,l=r?U_:o.shaderDefine,u=`/${r?G_:o.shaderVariantName}
804`,h=i?i.cacheKey:"",c=this._showOverdrawInspector?"/overdraw":"",p=s?"/terrain":"",d=a?`/${a.join("/")}`:"",f=t+h+u+c+p+d;return this.cache[f]||=new hI(this.context,ii[t],i,pE[t],this._showOverdrawInspector,s,n,l,a),this.cache[f]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;let t=this.context.gl;this.debugOverlayTexture=new ke(this.context,this.debugOverlayCanvas,t.RGBA)}}destroy(){if(this._tileTextures){for(let t in this._tileTextures){let i=this._tileTextures[t];if(i)for(let r of i)r.destroy()}this._tileTextures={}}for(let t of this._rttObjectRecyclePool)t.texture.destroy();if(this._rttObjectRecyclePool=[],this._rttSharedFbo){this._rttSharedFbo.fbo.colorAttachment.set(null),this._rttSharedFbo.fbo.depthAttachment.set(null);let t=this.context.gl;t.deleteRenderbuffer(this._rttSharedFbo.depthRenderbuffer),t.deleteFramebuffer(this._rttSharedFbo.fbo.framebuffer),this._rttSharedFbo=null}if(this.layerOpacityFbo?.destroy(),this.layerOpacityFbo=null,this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&this.tileExtentMesh.vertexBuffer?.destroy(),this.tileExtentMesh&&this.tileExtentMesh.indexBuffer?.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.cache){for(let t in this.cache){let i=this.cache[t];i?.program&&this.context.gl.deleteProgram(i.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:i}=this.context.gl;return this.width!==t||this.height!==i}},ur.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50,ur),XM=class extends Error{constructor(e,t){super("WebGL2 is required to display this map. We are sorry, but it seems that your browser does not support WebGL2, a technology for rendering 3D graphics on the web. Read more on https://wiki.openstreetmap.org/wiki/This_map_requires_WebGL"),this.name="GPUInitializationError",this.requestedAttributes=e,this.statusMessage=t?.statusMessage??null}};function wg(e,t){let i=!1,r=null,a,s=()=>{r=null,i&&=(e(...a),r=setTimeout(s,t),!1)};return(...o)=>(i=!0,a=o,r||s(),r)}var YM=class{constructor(e){this._getHashParams=()=>new URLSearchParams(window.location.hash.replace("#","")),this._getCurrentHash=()=>{let t=this._getHashParams();return this._hashName?(t.get(this._hashName)||"").split("/"):([...t.keys()][0]??"").split("/")},this._onHashChange=()=>{let t=this._getCurrentHash();if(!this._isValidHash(t))return!1;let i=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:i,pitch:+(t[4]||0)}),!0},this._updateHashUnthrottled=()=>{let t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{let t=this._getHashParams();if(this._hashName)t.delete(this._hashName);else{let s=Array.from(t.keys());s.length>0&&t.delete(s[0])}let i=decodeURIComponent(t.toString()).replace(/=&/g,"&").replace(/=$/g,""),r=i?`#${i}`:"",a=window.location.href.replace(/(#.+)?$/,r);a=a.replace("&&","&"),window.history.replaceState(window.history.state,null,a)},this._updateHash=wg(this._updateHashUnthrottled,30*1e3/100),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){let t=this._map.getCenter(),i=Math.round(this._map.getZoom()*100)/100,r=10**Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),a=Math.round(t.lng*r)/r,s=Math.round(t.lat*r)/r,o=this._map.getBearing(),n=this._map.getPitch(),l="";if(e?l+=`/${a}
804/${s}/${i}`:l+=`${i}/${s}/${a}`,(o||n)&&(l+=`/${Math.round(o*10)/10}`),n&&(l+=`/${Math.round(n)}`),this._hashName){let u=this._getHashParams();return u.set(this._hashName,l),`#${decodeURIComponent(u.toString()).replace(/=&/g,"&").replace(/=$/g,"")}`}return`#${l}`}_isValidHash(e){if(e.length<3||e.some(a=>isNaN(+a)))return!1;try{new W(+e[2],+e[1])}catch{return!1}let t=+e[0],i=+(e[3]||0),r=+(e[4]||0);return t>=this._map.getMinZoom()&&t<=this._map.getMaxZoom()&&i>=-180&&i<=180&&r>=this._map.getMinPitch()&&r<=this._map.getMaxPitch()}};const vs={linearity:.3,easing:Au(0,0,.3,1)},KM=j({deceleration:2500,maxSpeed:1400},vs),JM=j({deceleration:20,maxSpeed:1400},vs),QM=j({deceleration:1e3,maxSpeed:360},vs),eA=j({deceleration:1e3,maxSpeed:90},vs),tA=j({deceleration:1e3,maxSpeed:360},vs);var iA=class{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:_e(),settings:e})}_drainInertiaBuffer(){let e=this._inertiaBuffer,t=_e();for(;e.length>0&&t-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let t={zoom:0,bearing:0,pitch:0,roll:0,pan:new E(0,0),pinchAround:void 0,around:void 0};for(let{settings:a}of this._inertiaBuffer)t.zoom+=a.zoomDelta||0,t.bearing+=a.bearingDelta||0,t.pitch+=a.pitchDelta||0,t.roll+=a.rollDelta||0,a.panDelta&&t.pan._add(a.panDelta),a.around&&(t.around=a.around),a.pinchAround&&(t.pinchAround=a.pinchAround);let i=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,r={};if(t.pan.mag()){let a=va(t.pan.mag(),i,j({},KM,e||{})),s=t.pan.mult(a.amount/t.pan.mag()),o=this._map._camera.cameraHelper.handlePanInertia(s,this._map._camera.transform);r.center=o.easingCenter,r.offset=o.easingOffset,ya(r,a)}if(t.zoom){let a=va(t.zoom,i,JM);r.zoom=xt(this._map.getZoom()+a.amount,this._map.getZoomSnap(),a.amount),ya(r,a)}if(t.bearing){let a=va(t.bearing,i,QM);r.bearing=this._map.getBearing()+oe(a.amount,-179,179),ya(r,a)}if(t.pitch){let a=va(t.pitch,i,eA);r.pitch=this._map.getPitch()+a.amount,ya(r,a)}if(t.roll){let a=va(t.roll,i,tA);r.roll=this._map.getRoll()+oe(a.amount,-179,179),ya(r,a)}if(r.zoom||r.bearing){let a=t.pinchAround===void 0?t.around:t.pinchAround;r.around=a?this._map.unproject(a):this._map.getCenter()}return this.clear(),j(r,{noMoveStart:!0})}};function ya(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function va(e,t,i){let{maxSpeed:r,linearity:a,deceleration:s}=i,o=oe(e*a/(t/1e3),-r,r),n=Math.abs(o)/(s*a);return{easing:i.easing,duration:n*1e3,amount:n/2*o}}var rA=class{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new qT(this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new Rt(e.type,this._map,e))}mouseup(e){this._map.fire(new Rt(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new Rt(e.type,this._map,e))}dblclick(e){return this._firePreventable(new Rt(e.type,this._map,e))}mouseover(e){this._map.fire(new Rt(e.type,this._map,e))}mouseout(e){this._map.fire(new Rt(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Bs(e.type,this._map,e))}touchmove(e){this._map.fire(new Bs(e.type,this._map,e))}touchend(e){this._map.fire(new Bs(e.type,this._map,e))}touchcancel(e){this._map.fire(new Bs(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},aA=class{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new Rt(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Rt("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new Rt(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},sA=class{constructor(e,t,i){this._map=e,this._tr=i,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1,t.boxZoom&&typeof t.boxZoom=="object"&&(this._boxZoomEnd=t.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&e.button===0&&(N.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;let i=t;if(this._lastPos.equals(i)||!this._box&&i.dist(this._startPos)<this._clickTolerance)return;let r=this._startPos;this._lastPos=i,this._box||(this._box=N.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));let a=Math.min(r.x,i.x),s=Math.max(r.x,i.x),o=Math.min(r.y,i.y),n=Math.max(r.y,i.y);this._box.style.transform=`translate(${a}px,${o}px)`,this._box.style.width=`${s-a}px`,this._box.style.height=`${n-o}px`}mouseupWindow(e,t){if(!this._active||e.button!==0)return;let i=this._startPos,r=t;if(this.reset(),N.suppressClick(),i.x===r.x&&i.y===r.y)this._fireEvent("boxzoomcancel",e);else{if(this._map.fire(new mp("boxzoomend",{originalEvent:e})),this._boxZoomEnd){this._boxZoomEnd(this._map,i,r,e);return}return{cameraAnimation:a=>a.fitScreenCoordinates(i,r,this._tr.bearing,{linear:!0})}}}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&=(this._box.remove(),null),N.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,t){return this._map.fire(new mp(e,{originalEvent:t}))}};function Iu(e,t){if(e.length!==t.length)throw Error(`The number of touches and points are not equal - touches ${e.length}, points ${t.length}`);let i={};for(let r=0;r<e.length;r++)i[e[r].identifier]=t[r];return i}function oA(e){let t=new E(0,0);for(let i of e)t._add(i);return t.div(e.length)}var nA=class{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,t,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=e.timeStamp),i.length===this.numTouches&&(this.centroid=oA(t),this.touches=Iu(i,t)))}touchmove(e,t,i){if(this.aborted||!this.centroid)return;let r=Iu(i,t);for(let a in this.touches){let s=this.touches[a],o=r[a];(!o||o.dist(s)>30)&&(this.aborted=!0)}}touchend(e,t,i){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),i.length===0){let r=!this.aborted&&this.centroid;if(this.reset(),r)return r}}},Eu=class{constructor(e){this.singleTap=new nA(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,t,i){this.singleTap.touchstart(e,t,i)}touchmove(e,t,i){this.singleTap.touchmove(e,t,i)}touchend(e,t,i){let r=this.singleTap.touchend(e,t,i);if(r){let a=e.timeStamp-this.lastTime<500,s=!this.lastTap||this.lastTap.dist(r)<30;if((!a||!s)&&this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}},lA=class{constructor(e,t){this._tr=t,this._zoomIn=new Eu({numTouches:1,numTaps:2}),this._zoomOut=new Eu({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,i){this._zoomIn.touchstart(e,t,i),this._zoomOut.touchstart(e,t,i)}touchmove(e,t,i){this._zoomIn.touchmove(e,t,i),this._zoomOut.touchmove(e,t,i)}touchend(e,t,i){let r=this._zoomIn.touchend(e,t,i),a=this._zoomOut.touchend(e,t,i),s=this._tr;if(r)return this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:o=>
vendor: 21,107 bytes, line 804
804o.easeTo({duration:300,zoom:xt(s.zoom+1,o.getZoomSnap()),around:s.unproject(r)},{originalEvent:e})};if(a)return this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:o=>o.easeTo({duration:300,zoom:xt(s.zoom-1,o.getZoomSnap()),around:s.unproject(a)},{originalEvent:e})}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},xs=class{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){let t=this._moveFunction(...e);if(t.bearingDelta||t.pitchDelta||t.rollDelta||t.around||t.panDelta)return this._active=!0,t}dragStart(e,t){!this.isEnabled()||this._lastPoint||this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=Array.isArray(t)?t[0]:t,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,t){if(!this.isEnabled())return;let i=this._lastPoint;if(!i)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e)){this.reset(e);return}let r=Array.isArray(t)?t[0]:t;if(!(!this._moved&&r.dist(i)<this._clickTolerance))return this._moved=!0,this._lastPoint=r,this._move(i,r)}dragEnd(e){!this.isEnabled()||!this._lastPoint||this._moveStateManager.isValidEndEvent(e)&&(this._moved&&N.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}};const uA={0:1,2:2};function hA(e,t){let i=uA[t];return e.buttons===void 0||(e.buttons&i)!==i}var bs=class{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){this._eventButton=e.button}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!hA(e,this._eventButton)}isValidEndEvent(e){return e.button===this._eventButton}},cA=class{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return e.targetTouches.length===1}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}},pA=class{constructor(e=new bs({checkCorrectEvent:()=>!0}),t=new cA){this.mouseMoveStateManager=e,this.oneFingerTouchMoveStateManager=t}_executeRelevantHandler(e,t,i){if(e instanceof MouseEvent)return t(e);if(typeof TouchEvent<"u"&&e instanceof TouchEvent)return i(e)}startMove(e){this._executeRelevantHandler(e,t=>{this.mouseMoveStateManager.startMove(t)},t=>{this.oneFingerTouchMoveStateManager.startMove(t)})}endMove(e){this._executeRelevantHandler(e,t=>{this.mouseMoveStateManager.endMove(t)},t=>{this.oneFingerTouchMoveStateManager.endMove(t)})}isValidStartEvent(e){return!!this._executeRelevantHandler(e,t=>this.mouseMoveStateManager.isValidStartEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidStartEvent(t))}isValidMoveEvent(e){return!!this._executeRelevantHandler(e,t=>this.mouseMoveStateManager.isValidMoveEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(t))}isValidEndEvent(e){return!!this._executeRelevantHandler(e,t=>this.mouseMoveStateManager.isValidEndEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidEndEvent(t))}};const cn=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=t=>{t.preventDefault()}};function dA({enable:e,clickTolerance:t}){return new xs({clickTolerance:t,move:(i,r)=>({around:r,panDelta:r.sub(i)}),activateOnStart:!0,moveStateManager:new bs({checkCorrectEvent:i=>i.button===0&&!i.ctrlKey}),enable:e,assignEvents:cn})}function fA({enable:e,clickTolerance:t,aroundCenter:i=!0,minPixelCenterThreshold:r=100,rotateSpeed:a=.8},s){return new xs({clickTolerance:t,move:(o,n)=>{let l=s();if(i&&Math.abs(l.y-o.y)>r)return{bearingDelta:Id(new E(o.x,n.y),n,l)};let u=(n.x-o.x)*a;return i&&n.y<l.y&&(u=-u),{bearingDelta:u}},moveStateManager:new bs({checkCorrectEvent:o=>o.button===0&&o.ctrlKey||o.button===2&&!o.ctrlKey}),enable:e,assignEvents:cn})}function mA({enable:e,clickTolerance:t,pitchSpeed:i=-.5}){return new xs({clickTolerance:t,move:(r,a)=>({pitchDelta:(a.y-r.y)*i}),moveStateManager:new bs({checkCorrectEvent:r=>r.button===0&&r.ctrlKey||r.button===2}),enable:e,assignEvents:cn})}function _A({enable:e,clickTolerance:t,rollDegreesPerPixelMoved:i=.3},r){return new xs({clickTolerance:t,move:(a,s)=>{let o=r(),n=(s.x-a.x)*i;return s.y<o.y&&(n=-n),{rollDelta:n}},moveStateManager:new bs({checkCorrectEvent:a=>a.button===2&&a.ctrlKey}),enable:e,assignEvents:cn})}var gA=class{constructor(e,t){this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new E(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,t,i){return this._calculateTransform(e,t,i)}touchmove(e,t,i){if(this._active){if(this._shouldBePrevented(i.length)){this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e);return}return e.preventDefault(),this._calculateTransform(e,t,i)}}touchend(e,t,i){this._calculateTransform(e,t,i),this._active&&this._shouldBePrevented(i.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,t,i){i.length>0&&(this._active=!0);let r=Iu(i,t),a=new E(0,0),s=new E(0,0),o=0;for(let l in r){let u=r[l],h=this._touches[l];h&&(a._add(u),s._add(u.sub(h)),o++,r[l]=u)}if(this._touches=r,this._shouldBePrevented(o)||!s.mag())return;let n=s.div(o);if(this._sum._add(n),!(this._sum.mag()<this._clickTolerance))return{around:a.div(o),panDelta:n}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},Lh=class{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,t,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,i){if(!this._firstTwoTouches)return;e.preventDefault();let[r,a]=this._firstTwoTouches,s=Zs(i,t,r),o=Zs(i,t,a);if(!s||!o)return;let n=this._aroundCenter?null:s.add(o).div(2);return this._move([s,o],n,e)}touchend(e,t,i){if(!this._firstTwoTouches)return;let[r,a]=this._firstTwoTouches,s=Zs(i,t,r),o=Zs(i,t,a);s&&o||(this._active&&N.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}};function Zs(e,t,i){for(let r=0;r<e.length;r++)if(e[r].identifier===i)return t[r]}const od=.1;function nd(e,t){return Math.log(e/t)/Math.LN2}var yA=class extends Lh{constructor(){super(),this._zoomRate=1,this._zoomThreshold=od}setZoomRate(e){this._zoomRate=e??1}setZoomThreshold(e){this._zoomThreshold=e??od}reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){let i=this._distance;if(this._distance=e[0].dist(e[1]),!(!this._active&&Math.abs(nd(this._distance,this._startDistance))<this._zoomThreshold))return this._active=!0,{zoomDelta:nd(this._distance,i)*this._zoomRate,pinchAround:t}}};function ld(e,t){return e.angleWith(t)*180/Math.PI}var vA=class extends Lh{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t,i){let r=this._vector;if(this._vector=e[0].sub(e[1]),!(!this._active&&this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:ld(this._vector,r),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());let t=25/(Math.PI*this._minDiameter)*360,i=ld(e,this._startVector);return Math.abs(i)<t}};function il(e){return Math.abs(e.y)>Math.abs(e.x)}var xA=class extends Lh{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,t,i){super.touchstart(e,t,i),this._currentTouchCount=i.length}_start(e){this._lastPoints=e,il(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,i){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let r=e[0].sub(this._lastPoints[0]),a=e[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(r,a,i.timeStamp),this._valid)return this._lastPoints=e,this._active=!0,{pitchDelta:(r.y+a.y)/2*-.5}}gestureBeginsVertically(e,t,i){if(this._valid!==void 0)return this._valid;let r=e.mag()>=2,a=t.mag()>=2;if(!r&&!a)return;if(!r||!a)return this._firstMove===void 0&&(this._firstMove=i),i-this._firstMove<100&&void 0;let s=e.y>0==t.y>0;return il(e)&&il(t)&&s}};const bA={panStep:100,bearingStep:15,pitchStep:10};var wA=class{constructor(e,t){this._tr=t;let i=bA;this._panStep=i.panStep,this._bearingStep=i.bearingStep,this._pitchStep=i.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,i=0,r=0,a=0,s=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?i=-1:(e.preventDefault(),a=-1);break;case 39:e.shiftKey?i=1:(e.preventDefault(),a=1);break;case 38:e.shiftKey?r=1:(e.preventDefault(),s=-1);break;case 40:e.shiftKey?r=-1:(e.preventDefault(),s=1);break;default:return}return this._rotationDisabled&&(i=0,r=0),{cameraAnimation:o=>{let n=this._tr;o.easeTo({duration:300,easeId:"keyboardHandler",easing:TA,zoom:t?xt(n.zoom+t*(e.shiftKey?2:1),o.getZoomSnap()):n.zoom,bearing:n.bearing+i*this._bearingStep,pitch:n.pitch+r*this._pitchStep,offset:[-a*this._panStep,-s*this._panStep],center:n.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}};function TA(e){return e*(2-e)}const ud=4.000244140625;var SA=class{constructor(e,t,i){this._onTimeout=r=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(r)},this._map=e,this._tr=i,this._triggerRenderFrame=t,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return this._map.cooperativeGestures.isEnabled()?!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e)):!1}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e)){this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);return}let t=e.deltaMode===WheelEvent.DOM_DELTA_LINE?e.deltaY*40:e.deltaY,i=_e(),r=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,t!==0&&t%ud==0?this._type="wheel":t!==0&&Math.abs(t)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(r*t)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&(this._lastWheelEvent=e,this._delta-=t,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let t=N.mousePos(this._map.getCanvas(),e),i=this._tr;this._aroundCenter?this._aroundPoint=i.transform.locationToScreenPoint(W.convert(i.center)):this._aroundPoint=t,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let e=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){let o=e.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=o),typeof this._targetZoom=="number"&&(this._targetZoom+=o)}if(this._delta!==0){let o=this._type==="wheel"&&Math.abs(this._delta)>ud?this._wheelZoomRate:this._defaultZoomRate,n=2/(1+Math.exp(-Math.abs(this._delta*o)));this._delta<0&&n!==0&&(n=1/n);let l=typeof this._targetZoom=="number"?dt(this._targetZoom):e.scale,u=e.applyConstrain(e.getCameraLngLat(),lt(l*n)).zoom,h=this._map.getZoomSnap();if(this._type==="wheel"&&h>0){let c=xt(e.zoom,h);this._targetZoom=xt(u,h,u-c)}else this._targetZoom=u;this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let t=typeof this._targetZoom=="number"?this._targetZoom:e.zoom,i=this._startZoom,r=this._easing,a=!1,s;if(this._type==="wheel"&&i&&r){let o=_e()-this._lastWheelEventTime,n=Math.min((o+5)/200,1),l=r(n);s=$e.number(i,t,l),n<1?this._needsRerender=!0:a=!0}else s=t,a=!0;return this._active=!0,a&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=s,{noInertia:!0,needsRenderFrame:!a,zoomDelta:s-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let t=hl;if(this._prevEase){let i=this._prevEase,r=(_e()-i.start)/i.duration,a=i.easing(r+.01)-i.easing(r),s=.27/Math.sqrt(a*a+1e-4)*.01;t=Au(s,Math.sqrt(.27*.27-s*s),.25,1)}return this._prevEase={start:_e(),duration:e,easing:t},t}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}},PA=class{constructor(e,t){this._clickZoom=e,this._tapZoom=t}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}},IA=class{constructor(e,t){this._tr=t,this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:xt(this._tr.zoom+(e.shiftKey?-1:1),i.getZoomSnap()),around:this._tr.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},EA=class{constructor(){this._tap=new Eu({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(e){this._zoomRate=e??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,t,i){if(!this._swipePoint)if(!this._tapTime)this._tap.touchstart(e,t,i);else{let r=t[0],a=e.timeStamp-this._tapTime<500,s=this._tapPoint.dist(r)<30;!a||!s?this.reset():i.length>0&&(this._swipePoint=r,this._swipeTouch=i[0].identifier)}}touchmove(e,t,i){if(!this._tapTime)this._tap.touchmove(e,t,i);else if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;let r=t[0],a=r.y-this._swipePoint.y;return this._swipePoint=r,e.preventDefault(),this._active=!0,{zoomDelta:a/128*this._zoomRate}}}touchend(e,t,i){if(this._tapTime)this._swipePoint&&i.length===0&&this.reset();else{let r=this._tap.touchend(e,t,i);r&&(this._tapTime=e.timeStamp,this._tapPoint=r)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},MA=class{constructor(e,t,i){this._el=e,this._mousePan=t,this._touchPan=i}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}},AA=class{constructor(e,t,i,r){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=t,this._mousePitch=i,this._mouseRoll=r}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}},CA=class{constructor(e,t,i,r){this._el=e,this._touchZoom=t,this._touchRotate=i,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}setZoomRate(e){this._touchZoom.setZoomRate(e),this._tapDragZoom.setZoomRate(e)}setZoomThreshold(e){this._touchZoom.setZoomThreshold(e)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}},DA=class{constructor(e,t){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=e,this._options=t,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=N.create("div","maplibregl-cooperative-gesture-screen",e);let t=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(t=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let i=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),r=document.createElement("div");r.className="maplibregl-desktop-message",r.textContent=t,this._container.appendChild(r);let a=document.createElement("div");a.className="maplibregl-mobile-message",a.textContent=i,this._container.appendChild(a),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(this._container.remove(),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,t){this._enabled&&(this._map.fire(new Xe("cooperativegestureprevented",{gestureType:e,originalEvent:t})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}},zA=class{constructor(e){this._camera=e}get transform(){return this._camera._requestedCameraState||this._camera.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(E.convert(e),this._camera.terrain)}};const qs=e=>e.zoom||e.drag||e.roll||e.pitch||e.rotate;var RA=class extends Ot{};function rl(e){return e.panDelta?.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta||e.rollDelta}var kA=class{get _ownerDocument(){return this._el?.ownerDocument||document}get _ownerWindow(){return this._el?.ownerDocument?.defaultView||window}constructor(e,t,i){this.handleWindowEvent=a=>{this.handleEvent(a,`${a.type}Window`)},this.handleEvent=(a,s)=>{if(a.type==="blur"){this.stop(!0);return}this._updatingCamera=!0;let o=a.type==="renderFrame"?void 0:a,n={needsRenderFrame:!1},l={},u={};for(let{handlerName:p,handler:d,allowed:f}of this._handlers){if(!d.isEnabled())continue;let m;if(this._blockedByActive(u,f,p))d.reset();else if(d[s||a.type]){if(My(a,s||a.type)){let _=N.mousePos(this._map.getCanvas(),a);m=d[s||a.type](a,_)}else if(Ey(a,s||a.type)){let _=a.touches,g=this._getMapTouches(_),x=N.touchPos(this._map.getCanvas(),g);m=d[s||a.type](a,x,g)}else Ay(s||a.type)||(m=d[s||a.type](a));this.mergeHandlerResult(n,l,m,p,o),m?.needsRenderFrame&&this._triggerRe
vendor: 7,933 bytes, line 804
804nderFrame()}(m||d.isActive())&&(u[p]=d)}let h={};for(let p in this._previousActiveHandlers)u[p]||(h[p]=o);this._previousActiveHandlers=u,(Object.keys(h).length||rl(n))&&(this._changes.push([n,l,h]),this._triggerRenderFrame()),(Object.keys(u).length||rl(n))&&this._camera.stop(!0),this._updatingCamera=!1;let{cameraAnimation:c}=n;c&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],c(this._map))},this._map=e,this._camera=t,this._transformProvider=new zA(this._camera),this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new iA(e),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i);let r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]];for(let[a,s,o]of this._listeners)a.addEventListener(s,a===this._ownerDocument?this.handleWindowEvent:this.handleEvent,o)}destroy(){for(let[e,t,i]of this._listeners)e.removeEventListener(t,e===this._ownerDocument?this.handleWindowEvent:this.handleEvent,i)}_addDefaultHandlers(e){let t=this._map,i=t.getCanvasContainer();this._add("mapEvent",new rA(t,e));let r=t.boxZoom=new sA(t,e,this._transformProvider);this._add("boxZoom",r),e.interactive&&e.boxZoom&&r.enable();let a=t.cooperativeGestures=new DA(t,e.cooperativeGestures);this._add("cooperativeGestures",a),e.cooperativeGestures&&a.enable();let s=new lA(t,this._transformProvider),o=new IA(t,this._transformProvider);t.doubleClickZoom=new PA(o,s),this._add("tapZoom",s),this._add("clickZoom",o),e.interactive&&e.doubleClickZoom&&t.doubleClickZoom.enable();let n=new EA;this._add("tapDragZoom",n);let l=t.touchPitch=new xA(t);this._add("touchPitch",l),e.interactive&&e.touchPitch&&t.touchPitch.enable(e.touchPitch);let u=()=>t.project(t.getCenter()),h=fA(e,u),c=mA(e),p=_A(e,u);t.dragRotate=new AA(e,h,c,p),this._add("mouseRotate",h,["mousePitch"]),this._add("mousePitch",c,["mouseRotate","mouseRoll"]),this._add("mouseRoll",p,["mousePitch"]),e.interactive&&e.dragRotate&&t.dragRotate.enable();let d=dA(e),f=new gA(e,t);t.dragPan=new MA(i,d,f),this._add("mousePan",d),this._add("touchPan",f,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&t.dragPan.enable(e.dragPan);let m=new vA,_=new yA;t.touchZoomRotate=new CA(i,_,m,n),this._add("touchRotate",m,["touchPan","touchZoom"]),this._add("touchZoom",_,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&t.touchZoomRotate.enable(e.touchZoomRotate),this._add("blockableMapEvent",new aA(t));let g=t.scrollZoom=new SA(t,()=>this._triggerRenderFrame(),this._transformProvider);this._add("scrollZoom",g,["mousePan"]),e.interactive&&e.scrollZoom&&t.scrollZoom.enable(e.scrollZoom);let x=t.keyboard=new wA(t,this._transformProvider);this._add("keyboard",x),e.interactive&&e.keyboard&&t.keyboard.enable()}_add(e,t,i){this._handlers.push({handlerName:e,handler:t,allowed:i}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(let{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(let{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!qs(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,t,i){for(let r in e)if(r!==i&&!t?.includes(r))return!0;return!1}_getMapTouches(e){let t=[];for(let i of e){let r=i.target;this._el.contains(r)&&t.push(i)}return t}mergeHandlerResult(e,t,i,r,a){if(!i)return;j(e,i);let s={handlerName:r,originalEvent:i.originalEvent||a};i.zoomDelta!==void 0&&(t.zoom=s),i.panDelta!==void 0&&(t.drag=s),i.rollDelta!==void 0&&(t.roll=s),i.pitchDelta!==void 0&&(t.pitch=s),i.bearingDelta!==void 0&&(t.rotate=s)}_applyChanges(){let e={},t={},i={};for(let[r,a,s]of this._changes)r.panDelta&&(e.panDelta=(e.panDelta||new E(0,0))._add(r.panDelta)),r.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+r.zoomDelta),r.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+r.bearingDelta),r.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+r.pitchDelta),r.rollDelta&&(e.rollDelta=(e.rollDelta||0)+r.rollDelta),r.around!==void 0&&(e.around=r.around),r.pinchAround!==void 0&&(e.pinchAround=r.pinchAround),r.noInertia&&(e.noInertia=r.noInertia),j(t,a),j(i,s);this._updateMapTransform(e,t,i),this._changes=[]}_updateMapTransform(e,t,i){let r=this._map,a=this._camera.getTransformForUpdate(),s=r.terrain;if(!rl(e)&&!(s&&this._terrainMovement)){this._fireEvents(t,i,!0);return}this._camera.stop(!0);let{panDelta:o,zoomDelta:n,bearingDelta:l,pitchDelta:u,rollDelta:h,around:c,pinchAround:p}=e;p!==void 0&&(c=p),c||=this._camera.transform.centerPoint,s&&!a.isPointOnMapSurface(c)&&(c=a.centerPoint);let d={panDelta:o,zoomDelta:n,rollDelta:h,pitchDelta:u,bearingDelta:l,around:c};this._camera.cameraHelper.useGlobeControls&&!a.isPointOnMapSurface(c)&&(c=a.centerPoint);let f=c.distSqr(a.centerPoint)<.01?a.center:a.screenPointToLocation(o?c.sub(o):c);this._handleMapControls({terrain:s,tr:a,deltasForHelper:d,preZoomAroundLoc:f,combinedEventsInProgress:t,panDelta:o}),this._camera.applyUpdatedTransform(a),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,i,!0)}_handleMapControls({terrain:e,tr:t,deltasForHelper:i,preZoomAroundLoc:r,combinedEventsInProgress:a,panDelta:s}){let o=this._camera.cameraHelper;if(o.handleMapControlsRollPitchBearingZoom(i,t),!e){o.handleMapControlsPan(i,t,r);return}if(o.useGlobeControls){!this._terrainMovement&&(a.drag||a.zoom)&&(this._terrainMovement=!0,this._camera.elevationFreeze=!0),o.handleMapControlsPan(i,t,r);return}if(!this._terrainMovement&&(a.drag||a.zoom)){this._terrainMovement=!0,this._camera.elevationFreeze=!0,o.handleMapControlsPan(i,t,r);return}if(a.drag&&this._terrainMovement&&s){t.setCenter(t.screenPointToLocation(t.centerPoint.sub(s)));return}o.handleMapControlsPan(i,t,r)}_fireEvents(e,t,i){let r=qs(this._eventsInProgress),a=qs(e),s={};for(let h in e){let{originalEvent:c}=e[h];this._eventsInProgress[h]||(s[`${h}start`]=c),this._eventsInProgress[h]=e[h]}!r&&a&&this._fireEvent("movestart",a.originalEvent);for(let h in s)this._fireEvent(h,s[h]);a&&this._fireEvent("move",a.originalEvent);for(let h in e){let{originalEvent:c}=e[h];this._fireEvent(h,c)}let o={},n;for(let h in this._eventsInProgress){let{handlerName:c,originalEvent:p}=this._eventsInProgress[h];this._handlersById[c].isActive()||(delete this._eventsInProgress[h],n=t[c]||p,o[`${h}end`]=n)}for(let h in o)this._fireEvent(h,o[h]);let l=qs(this._eventsInProgress),u=(r||a)&&!l;if(u&&this._terrainMovement){this._camera.elevationFreeze=!1,this._terrainMovement=!1;let h=this._camera.getTransformForUpdate();this._map.getCenterClampedToGround()&&h.recalculateZoomAndCenter(this._map.terrain),this._camera.applyUpdatedTransform(h)}if(i&&u){this._updatingCamera=!0;let h=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),c=p=>p!==0&&-this._bearingSnap<p&&p<this._bearingSnap;h&&(h.essential||!ft.prefersReducedMotion)?(c(h.bearing||this._map.getBearing())&&(h.bearing=0),h.freezeElevation=!0,this._map.easeTo(h,{originalEvent:n})):(this._map.fire(new U("moveend",{originalEvent:n})),c(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(e,t){this._map.fire(new U(e,t?{originalEvent:t}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new RA("renderFrame",{timeStamp:e})),this._applyChanges()})}
vendor: 22,494 bytes, line 804
804_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}},LA=class extends Ze{constructor(e){super(),this._renderFrameCallback=()=>{let t=Math.min((_e()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this.transform=new Ao,this.cameraHelper=new Co,e.minZoom!==void 0&&this.transform.setMinZoom(e.minZoom),e.maxZoom!==void 0&&this.transform.setMaxZoom(e.maxZoom),e.minPitch!==void 0&&this.transform.setMinPitch(e.minPitch),e.maxPitch!==void 0&&this.transform.setMaxPitch(e.maxPitch),e.renderWorldCopies!==void 0&&this.transform.setRenderWorldCopies(e.renderWorldCopies),e.transformConstrain!==null&&this.transform.setConstrainOverride(e.transformConstrain),this._moving=!1,this._zooming=!1,this._bearingSnap=e.bearingSnap,this._zoomSnap=e.zoomSnap,this._requestRenderFrame=e.requestRenderFrame,this._cancelRenderFrame=e.cancelRenderFrame,this.terrain=e.terrain,this._centerClampedToGround=e.centerClampedToGround??!0,this.transformCameraUpdate=e.transformCameraUpdate??null,this._stopHandlers=e.stopHandlers??(()=>{}),this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(e,t){e.apply(this.transform,!0),this.transform=e,this.cameraHelper=t}getCenter(){return new W(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,t){return this.jumpTo({elevation:e},t),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,t,i){return e=E.convert(e).mult(-1),this.panTo(this.transform.center,j({offset:e},t),i)}panTo(e,t,i){return this.easeTo(j({center:e},t),i)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,t,i){return this.easeTo(j({zoom:e},t),i)}zoomIn(e,t){return this.zoomTo(xt(this.getZoom()+1,this._zoomSnap),e,t),this}zoomOut(e,t){return this.zoomTo(xt(this.getZoom()-1,this._zoomSnap),e,t),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,t){return e!=this.transform.fov&&(this.transform.setFov(e),this.fire(new U("movestart",t)).fire(new U("move",t)).fire(new U("moveend",t))),this}getBearing(){return this.transform.bearing}setZoomSnap(e){return this._zoomSnap=e,this}getZoomSnap(){return this._zoomSnap}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(e,t,i){return this.easeTo(j({bearing:e},t),i)}resetNorth(e,t){return this.rotateTo(0,j({duration:1e3},e),t),this}resetNorthPitch(e,t){return this.easeTo(j({bearing:0,pitch:0,roll:0,duration:1e3},e),t),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}getRoll(){return this.transform.roll}setRoll(e,t){return this.jumpTo({roll:e},t),this}cameraForBounds(e,t){e=ni.convert(e).adjustAntiMeridian();let i=t?.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),i,t)}_cameraForBoxAndBearing(e,t,i,r){let a={top:0,bottom:0,right:0,left:0};if(r=j({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},r),typeof r.padding=="number"){let u=r.padding;r.padding={top:u,bottom:u,right:u,left:u}}let s=j(a,r.padding);r.padding=s;let o=this.transform,n=new ni(e,t),l=this.cameraHelper.cameraForBoxAndBearing(r,s,n,i,o);return l&&this._zoomSnap&&(l.zoom=xt(l.zoom,this._zoomSnap,-1)),l}fitBounds(e,t,i){return this._fitInternal(this.cameraForBounds(e,t),t,i)}fitScreenCoordinates(e,t,i,r,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(E.convert(e)),this.transform.screenPointToLocation(E.convert(t)),i,r),r,a)}_fitInternal(e,t,i){return e?(t=j(e,t),delete t.padding,t.linear?this.easeTo(t,i):this.flyTo(t,i)):this}jumpTo(e,t){this.stop(),"zoom"in e&&this._zoomSnap&&(e.zoom=xt(e.zoom,this._zoomSnap));let i=this.getTransformForUpdate(),r=!1,a=!1,s=!1,o=i.zoom;this.terrain&&i.setElevation(this.terrain.getElevationForLngLatZoom(e.center?W.convert(e.center):i.center,e.zoom||i.tileZoom)),this.cameraHelper.handleJumpToCenterZoom(i,e);let n=i.zoom!==o;return"elevation"in e&&i.elevation!==+e.elevation&&i.setElevation(+e.elevation),"bearing"in e&&i.bearing!==+e.bearing&&(r=!0,i.setBearing(+e.bearing)),"pitch"in e&&i.pitch!==+e.pitch&&(a=!0,i.setPitch(+e.pitch)),"roll"in e&&i.roll!==+e.roll&&(s=!0,i.setRoll(+e.roll)),e.padding!=null&&!i.isPaddingEqual(e.padding)&&i.setPadding(e.padding),this.applyUpdatedTransform(i),this.fire(new U("movestart",t)).fire(new U("move",t)),n&&this.fire(new U("zoomstart",t)).fire(new U("zoom",t)).fire(new U("zoomend",t)),r&&this.fire(new U("rotatestart",t)).fire(new U("rotate",t)).fire(new U("rotateend",t)),a&&this.fire(new U("pitchstart",t)).fire(new U("pitch",t)).fire(new U("pitchend",t)),s&&this.fire(new U("rollstart",t)).fire(new U("roll",t)).fire(new U("rollend",t)),this.fire(new U("moveend",t))}calculateCameraOptionsFromTo(e,t,i,r=0){let a=ye.fromLngLat(e,t),s=ye.fromLngLat(i,r),o=s.x-a.x,n=s.y-a.y,l=s.z-a.z,u=Math.hypot(o,n,l);if(u===0)throw Error("Can't calculate camera options with same From and To");let h=Math.hypot(o,n),c=lt(this.transform.cameraToCenterDistance/u/this.transform.tileSize),p=Math.atan2(o,-n)*180/Math.PI,d=Math.acos(h/u)*180/Math.PI;return d=l<0?90-d:90+d,{center:s.toLngLat(),elevation:r,zoom:c,pitch:d,bearing:p}}calculateCameraOptionsFromCameraLngLatAltRotation(e,t,i,r,a){let s=this.transform.calculateCenterFromCameraLngLatAlt(e,t,i,r);return{center:s.center,elevation:s.elevation,zoom:s.zoom,bearing:i,pitch:r,roll:a}}easeTo(e,t){this._stop(!1,e.easeId),e=j({offset:[0,0],duration:500,easing:hl},e),"zoom"in e&&this._zoomSnap&&(e.zoom=xt(e.zoom,this._zoomSnap)),(e.animate===!1||!e.essential&&ft.prefersReducedMotion)&&(e.duration=0);let i=this.getTransformForUpdate(),r=this.getBearing(),a=i.pitch,s=i.roll,o="bearing"in e?this._normalizeBearing(e.bearing,r):r,n="pitch"in e?+e.pitch:a,l="roll"in e?this._normalizeBearing(e.roll,s):s,u="padding"in e?e.padding:i.padding,h=E.convert(e.offset),c,p;e.around&&(c=W.convert(e.around),p=i.locationToScreenPoint(c));let d={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},f=this.cameraHelper.handleEaseTo(i,{bearing:o,pitch:n,roll:l,padding:u,around:c,aroundPoint:p,offsetAsPoint:h,offset:e.offset,zoom:e.zoom,center:e.center});return this._rotating||=r!==o,this._pitching||=n!==a,this._rolling||=l!==s,this._padding=!i.isPaddingEqual(u),this._zooming||=f.isZooming,this._easeId=e.easeId,this._prepareEase(t,e.noMoveStart,d),this.terrain&&this._prepareElevation(f.elevationCenter),this._ease(m=>{f.easeFunc(m),this.terrain&&!e.freezeElevation&&this._updateElevation(m),this.applyUpdatedTransform(i),this._fireMoveEvents(t)},m=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(t,m)},e),this}_prepareEase(e,t,i={}){this._moving=!0,!t&&!i.moving&&this.fire(new U("movestart",e)),this._zooming&&!i.zooming&&this.fire(new U("zoomstart",e)),this._rotating&&!i.rotating&&this.fire(new U("rotatestart",e)),this._pitching&&!i.pitching&&this.fire(new U("pitchstart",e)),this._rolling&&!i.rolling&&this.fire(new U("rollstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this.elevationFreeze=!0}_updateElevation(e){(this._elevationStart===void 0||this._elevationCenter===void 0)&&this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let t=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&t!==this._elevationTarget){let i=this._elevationTarget-this._elevationStart,r=(t-(i*e+this._elevationStart))/(1-e);this._elevationStart+=e*(i-r),this._elevationTarget=t}this.transform.setElevation($e.number(this._elevationStart,this._elevationTarget,e))}_finalizeElevation(){this.elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}getTransformForUpdate(){return!this.transformCameraUpdate&&!this.terrain?this.transform:(this._requestedCameraState||=this.transform.clone(),this._requestedCameraState)}_elevateCameraIfInsideTerrain(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90)return{};let t=e.getCameraLngLat(),i=e.getCameraAltitude(),r=this.terrain?this.terrain.getElevationForLngLatZoom(t,e.zoom):0;if(i<r){let a=this.calculateCameraOptionsFromTo(t,r,e.center,e.elevation);return{pitch:a.pitch,zoom:a.zoom}}return{}}applyUpdatedTransform(e){let t=[];if(t.push(r=>this._elevateCameraIfInsideTerrain(r)),this.transformCameraUpdate&&t.push(r=>this.transformCameraUpdate(r)),!t.length)return;let i=e.clone();for(let r of t){let a=i.clone(),{center:s,zoom:o,roll:n,pitch:l,bearing:u,elevation:h}=r(a);s&&a.setCenter(s),h!==void 0&&a.setElevation(h),o!==void 0&&a.setZoom(o),n!==void 0&&a.setRoll(n),l!==void 0&&a.setPitch(l),u!==void 0&&a.setBearing(u),i.apply(a,!1)}this.transform.apply(i,!1)}_fireMoveEvents(e){this.fire(new U("move",e)),this._zooming&&this.fire(new U("zoom",e)),this._rotating&&this.fire(new U("rotate",e)),this._pitching&&this.fire(new U("pitch",e)),this._rolling&&this.fire(new U("roll",e))}_afterEase(e,t){if(this._easeId&&t&&this._easeId===t)return;delete this._easeId;let i=this._zooming,r=this._rotating,a=this._pitching,s=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,i&&this.fire(new U("zoomend",e)),r&&this.fire(new U("rotateend",e)),a&&this.fire(new U("pitchend",e)),s&&this.fire(new U("rollend",e)),this.fire(new U("moveend",e))}flyTo(e,t){if(!e.essential&&ft.prefersReducedMotion){let P=as(e,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(P,t)}this.stop(),e=j({offset:[0,0],speed:1.2,curve:1.42,easing:hl},e),"zoom"in e&&this._zoomSnap&&(e.zoom=xt(e.zoom,this._zoomSnap));let i=this.getTransformForUpdate(),r=i.bearing,a=i.pitch,s=i.roll,o=i.padding,n="bearing"in e?this._normalizeBearing(e.bearing,r):r,l="pitch"in e?+e.pitch:a,u="roll"in e?this._normalizeBearing(e.roll,s):s,h="padding"in e?e.padding:i.padding,c=E.convert(e.offset),p=i.centerPoint.add(c),d=i.screenPointToLocation(p),f=this.cameraHelper.handleFlyTo(i,{bearing:n,pitch:l,roll:u,padding:h,locationAtOffset:d,offsetAsPoint:c,center:e.center,minZoom:e.minZoom,zoom:e.zoom}),m=e.curve,_=Math.max(i.width,i.height),g=_/f.scaleOfZoom,x=f.pixelPathLength,y=_/f.scaleOfMinZoom;m=Math.min(m,Math.sqrt(y/x*2));let v=m*m;function w(P){let S=(g*g-_*_+(P?-1:1)*v*v*x*x)/(2*(P?g:_)*v*x);return Math.log(Math.sqrt(S*S+1)-S)}function b(P){return(Math.exp(P)-Math.exp(-P))/2}function T(P){return(Math.exp(P)+Math.exp(-P))/2}function I(P){return b(P)/T(P)}let M=w(!1),D=function(P){return T(M)/T(M+m*P)},L=function(P){return _*((T(M)*I(M+m*P)-b(M))/v)/x},z=(w(!0)-M)/m;if(Math.abs(x)<2e-6||!isFinite(z)){if(Math.abs(_-g)<1e-6)return this.easeTo(e,t);let P=g<_?-1:1;z=Math.abs(Math.log(g/_))/m,L=()=>0,D=S=>Math.exp(P*m*S)}if("duration"in e)e.duration=+e.duration;else{let P="screenSpeed"in e?+e.screenSpeed/m:+e.speed;e.duration=1e3*z/P}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=r!==n,this._pitching=l!==a,this._rolling=u!==s,this._padding=!i.isPaddingEqual(h),this._prepareEase(t,!1),this.terrain&&this._prepareElevation(f.targetCenter),this._ease(P=>{let S=P*z,F=1/D(S),O=L(S);this._rotating&&i.setBearing($e.number(r,n,P)),this._pitching&&i.setPitch($e.number(a,l,P)),this._rolling&&i.setRoll($e.number(s,u,P)),this._padding&&(i.interpolatePadding(o,h,P),p=i.centerPoint.add(c)),f.easeFunc(P,F,O,p),this.terrain&&!e.freezeElevation&&this._updateElevation(P),this.applyUpdatedTransform(i),this._fireMoveEvents(t)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(t)},e),this}isEasing(){return!!this._easeFrameId}stop(e){return this._stop(e)}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let i=this._onEaseEnd;delete this._onEaseEnd,i.call(this,t)}return e||this._stopHandlers(),this}_ease(e,t,i){i.animate===!1||i.duration===0?(e(1),t()):(this._easeStart=_e(),this._easeOptions=i,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,t){e=Zt(e,-180,180);let i=Math.abs(e-t);return Math.abs(e-360-t)<i&&(e-=360),Math.abs(e+360-t)<i&&(e+=360),e}isMoving(){return this._moving}isZooming(){return this._zooming}isRotating(){return this._rotating}};const Tg={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};var FA=class{constructor(e=Tg){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=t=>{t&&(t.type==="terrain"||t.dataType==="style"||t.dataType==="source"&&(t.sourceDataType==="metadata"||t.sourceDataType==="visibility"))&&this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):!this._container.classList.contains("maplibregl-compact")&&!this._container.classList.contains("maplibregl-attrib-empty")&&(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=N.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=N.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=N.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,t){let i=this._map._getUIString(`AttributionControl.${t}`);e.title=i,e.setAttribute("aria-label",i)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(r=>typeof r=="string"?r:"")):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){let r=this._map.style.stylesheet;this.styleOwner=r.owner,this.styleId=r.id}let t=this._map.style.tileManagers;for(let r in t){let a=t[r];if(a.used||a.usedForTerrain){let s=a.getSource();s.attribution&&!e.includes(s.attribution)&&e.push(s.attribution)}}e=e.filter(r=>String(r).trim()),e.sort((r,a)=>r.length-a.length),e=e.filter((r,a)=>{for(let s=a+1;s<e.length;s++)if(e[s].includes(r))return!1;return!0});let i=e.join(" | ");i!==this._attribHTML&&(this._attribHTML=i,e.length?(this._innerContainer.innerHTML=N.sanitize(i),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}},BA=class{constructor(e={}){this._updateCompact=()=>{let t=this._container.children;if(t.length){let i=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&i.classList.add("maplibregl-compact"):i.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options?.compact,this._container=N.create("div","maplibregl-ctrl");let t=N.create("a","maplibregl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://maplibre.org/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}},OA=class{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){let t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){let t=this._currentlyRunning,i=t?this._queue.concat(t):this._queue;for(let r of i)if(r.id===e){r.cancelled=!0;return}}run(e=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let t=this._currentlyRunning=this._queue;this._queue=[];for(let i of t)if(!i.cancelled&&(i.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}};const $A=Me([{name:"a_pos3d",type:"Int16",components:3}]);var VA=class extends Ze{constructor(e){super(),this._lastTilesetChange=_e(),this.tileManager=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null,this.releaseAllRTT()}getSource(){return this.tileManager._source}update(e,t){this.tileManager.update(e,t),this._renderableTilesKeys=[];let i={};for(let r of sa(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:t,calculateTileZoom:this.tileManager._source.calculateTileZoom}))i[r.key]=!0,this._renderableTilesKeys.push(r.key),this._tiles[r.key]||(r.terrainRttPosMatrix32f=new Float32Array(16),Jt(r.terrainRttPosMatrix32f,0,C,C,0,0,1),this._tiles[r.key]=new k_(r,this.tileSize),this._lastTilesetChange=_e());for(let r in this._tiles)i[r]||(this._tiles[r].releaseRTT(this.tileManager.map.painter),delete this._tiles[r])}releaseRTT(e){for(let t in this._tiles){let i=this._tiles[t];(i.tileID.equals(e)||i.tileID.isChildOf(e)||e.isChildOf(i.tileID))&&i.releaseRTT(this.tileManager.map.painter)}}releaseAllRTT(){for(let e in this._tiles)this._tiles[e].releaseRTT(this.tileManager.map.painter)}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,t){return t?this._getTerrainCoordsForTileRanges(e,t):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){let t={};for(let i of this._renderableTilesKeys){let r=this._tiles[i].tileID,a=e.clone(),s=tr();if(r.canonical.equals(e.canonical))Jt(s,0,C,C,0,0,1);else if(r.canonical.isChildOf(e.canonical)){let o=r.canonical.z-e.canonical.z,n=r.canonical.x-(r.canonical.x>>o<<o),l=r.canonical.y-(r.canonical.y>>o<<o),u=C>>o;Jt(s,0,u,u,0,0,1),Fe(s,s,[-n*u,-l*u,0])}else if(e.canonical.isChildOf(r.canonical)){let o=e.canonical.z-r.canonical.z,n=e.canonical.x-(e.canonical.x>>o<<o),l=e.canonical.y-(e.canonical.y>>o<<o),u=C>>o;Jt(s,0,C,C,0,0,1),Fe(s,s,[n*u,l*u,0]),tt(s,s,[1/2**o,1/2**o,0])}else continue;a.terrainRttPosMatrix32f=new Float32Array(s),t[i]=a}return t}_getTerrainCoordsForTileRanges(e,t){let i={};for(let r of this._renderableTilesKeys){let a=this._tiles[r].tileID;if(!this._isWithinTileRanges(a,t))continue;let s=e.clone(),o=tr();if(a.canonical.z===e.canonical.z){let n=e.canonical.x-a.canonical.x+e.wrap*(1<<e.canonical.z),l=e.canonical.y-a.canonical.y;Jt(o,0,C,C,0,0,1),Fe(o,o,[n*C,l*C,0])}else if(a.canonical.z>e.canonical.z){let n=a.canonical.z-e.canonical.z,l=a.canonical.x-(a.canonical.x>>n<<n)+e.wrap*(1<<a.canonical.z),u=a.canonical.y-(a.canonical.y>>n<<n),h=e.canonical.x-(a.canonical.x>>n),c=e.canonical.y-(a.canonical.y>>n),p=C>>n;Jt(o,0,p,p,0,0,1),Fe(o,o,[-l*p+h*C,-u*p+c*C,0])}else{let n=e.canonical.z-a.canonical.z,l=e.canonical.x-(e.canonical.x>>n<<n)+e.wrap*(1<<e.canonical.z),u=e.canonical.y-(e.canonical.y>>n<<n),h=(e.canonical.x>>n)-a.canonical.x,c=(e.canonical.y>>n)-a.canonical.y,p=C<<n;Jt(o,0,p,p,0,0,1),Fe(o,o,[l*C+h*p,u*C+c*p,0])}s.terrainRttPosMatrix32f=new Float32Array(o),i[r]=s}return i}getSourceTile(e,t){let i=this.tileManager._source,r=e.overscaledZ-this.deltaZoom;if(r>i.maxzoom&&(r=i.maxzoom),r<i.minzoom)return;this._sourceTileCache[e.key]||=e.scaledTo(r).key;let a=this.findTileInCaches(this._sourceTileCache[e.key]);if(!a?.dem&&t)for(;r>=i.minzoom&&!a?.dem;)a=this.findTileInCaches(e.scaledTo(r--).key);return a}findTileInCaches(e){let t=this.tileManager.getTileByID(e);return t||(t=this.tileManager._outOfViewCache.getByKey(e),t)}anyTilesAfterTime(e=_e()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,t){let i=t[e.canonical.z];return!!i&&(e.wrap>i.minWrap||e.wrap<i.maxWrap||e.canonical.x>=i.minTileXWrapped&&e.canonical.x<=i.maxTileXWrapped&&e.canonical.y>=i.minTileY&&e.canonical.y<=i.maxTileY)}},jA=class{constructor(e,t,i,r="auto"){this._meshCache={},this.painter=e,this.tileManager=new VA(t),this.options=i,this.exaggeration=typeof i.exaggeration=="number"?i.exaggeration:1,this._terrainSkirtLength=r,this.qual
804ityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}destroy(){this._fbo&&=(this._fbo.destroy(),null),this._fboCoordsTexture&&=(this._fboCoordsTexture.destroy(),null),this._fboDepthTexture&&=(this._fboDepthTexture.destroy(),null),this._emptyDemTexture&&=(this._emptyDemTexture.destroy(),null),this._emptyDepthTexture&&=(this._emptyDepthTexture.destroy(),null),this._coordsTexture&&=(this._coordsTexture.destroy(),null);for(let e in this._meshCache)this._meshCache[e].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(e,t,i,r=C){let a=e.normalizeCoordinates(t,i,r);if(!a)return 0;let s=this.getTerrainData(a.tileID),o=s.tile?.dem;if(!o)return 0;let n=uy([],[a.x/r*C,a.y/r*C],s.u_terrain_matrix),l=[n[0]*o.dim,n[1]*o.dim];return o.sampleBilinear(l[0],l[1])}getElevationForLngLatZoom(e,t){if(!Jc(t,e.wrap()))return 0;let{tileID:i,mercatorX:r,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(e,t);return this.getElevation(i,r%C,a%C,C)}getElevationForLngLat(e,t){let i=sa(t,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this}),r=0;for(let a of i)a.canonical.z>r&&(r=Math.min(a.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(e,r)}getElevation(e,t,i,r=C){return this.getDEMElevation(e,t,i,r)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){let r=this.painter.context,a=new xe({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new ke(r,a,r.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new ke(r,new xe({width:1,height:1}),r.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(r.gl.NEAREST,r.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=Xt([])}let t=this.tileManager.getSourceTile(e,!0);if(t?.dem&&(!t.demTexture||t.needsTerrainPrepare)){let r=this.painter.context;t.demTexture||=this.painter.getTileTexture(t.dem.stride),t.demTexture?t.demTexture.update(t.dem.getPixels(),{premultiply:!1}):t.demTexture=new ke(r,t.dem.getPixels(),r.gl.RGBA,{premultiply:!1}),t.demTexture.bind(r.gl.NEAREST,r.gl.CLAMP_TO_EDGE),t.needsTerrainPrepare=!1}let i=t&&t.toString()+t.tileID.key+e.key;if(i&&!this._demMatrixCache[i]){let r=this.tileManager.getSource().maxzoom,a=e.canonical.z-t.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=r?a=e.canonical.z-r:ge("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let s=e.canonical.x-(e.canonical.x>>a<<a),o=e.canonical.y-(e.canonical.y>>a<<a),n=Ug(new Float64Array(16),[1/(C<<a),1/(C<<a),0]);Fe(n,n,[s*C,o*C,0]),this._demMatrixCache[i]={matrix:n,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:t?.dem?.dim||1,u_terrain_matrix:i?this._demMatrixCache[i].matrix:this._emptyDemMatrix,u_terrain_unpack:t?.dem?.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(t?.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:t}}getFramebuffer(e){let t=this.painter,i=t.width/devicePixelRatio,r=t.height/devicePixelRatio;return this._fbo&&(this._fbo.width!==i||this._fbo.height!==r)&&(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new ke(t.context,{width:i,height:r,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new ke(t.context,{width:i,height:r,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=t.context.createFramebuffer(i,r,!0,!1),this._fbo.depthAttachment.set(t.context.createRenderbuffer(t.context.gl.DEPTH_COMPONENT16,i,r))),this._fbo.colorAttachment.set(e==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let t=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let r=0,a=0;r<this._coordsTextureSize;r++)for(let s=0;s<this._coordsTextureSize;s++,a+=4)t[a+0]=s&255,t[a+1]=r&255,t[a+2]=s>>8<<4|r>>8,t[a+3]=0;let i=new ke(e,new xe({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(t.buffer)),e.gl.RGBA,{premultiply:!1});return i.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=i,i}pointCoordinate(e){this.painter.maybeDrawDepth(!0),this.painter.maybeDrawCoords();let t=new Uint8Array(4),i=this.painter.context,r=i.gl,a=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),s=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),o=Math.round(this.painter.height/devicePixelRatio);i.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),r.readPixels(a,o-s-1,1,1,r.RGBA,r.UNSIGNED_BYTE,t),i.bindFramebuffer.set(null);let n=t[0]+(t[2]>>4<<8),l=t[1]+((t[2]&15)<<8),u=this.coordsIndex[255-t[3]],h=u&&this.tileManager.getTileByID(u);if(!h)return null;
804let c=this._coordsTextureSize,p=(1<<h.tileID.canonical.z)*c;return new ye((h.tileID.canonical.x*c+n)/p+h.tileID.wrap,(h.tileID.canonical.y*c+l)/p,this.getElevation(h.tileID,n,l,c))}depthAtPoint(e){let t=new Uint8Array(4),i=this.painter.context,r=i.gl;return i.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),r.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,r.RGBA,r.UNSIGNED_BYTE,t),i.bindFramebuffer.set(null),(t[0]/(256*256*256)+t[1]/(256*256)+t[2]/256+t[3])/256}getTerrainMesh(e){let t=this.painter.style.projection?.transitionState>0,i=t&&e.canonical.y===0,r=t&&e.canonical.y===(1<<e.canonical.z)-1,a=`m_${i?"n":""}_${r?"s":""}`;if(this._meshCache[a])return this._meshCache[a];let s=this.painter.context,o=new rx,n=new hi,l=this.meshSize,u=C/l,h=l*l;for(let p=0;p<=l;p++)for(let d=0;d<=l;d++)o.emplaceBack(d*u,p*u,0);for(let p=0;p<h;p+=l+1)for(let d=0;d<l;d++)n.emplaceBack(d+p,l+d+p+1,l+d+p+2),n.emplaceBack(d+p,l+d+p+2,d+p+1);this._terrainSkirtLength!=="none"&&this._buildSkirts(o,n,l,u,i,r);let c=new ys(s.createVertexBuffer(o,$A.members),s.createIndexBuffer(n),Te.simpleSegment(0,0,o.length,n.length));return this._meshCache[a]=c,c}getSkirtLength(e){return 2*Math.PI*Vi/2**Math.max(e,0)/5}getMinTileElevationForLngLatZoom(e,t){if(!Jc(t,e.wrap()))return 0;let{tileID:i}=this._getOverscaledTileIDFromLngLatZoom(e,t);return this.getMinMaxElevation(i).minElevation??0}getMinMaxElevation(e){let t=this.tileManager.getSourceTile(e,!0),i={minElevation:null,maxElevation:null};return t?.dem&&(i.minElevation=t.dem.min*this.exaggeration,i.maxElevation=t.dem.max*this.exaggeration),i}_getOverscaledTileIDFromLngLatZoom(e,t){let i=ye.fromLngLat(e.wrap()),r=(1<<t)*C,a=i.x*r,s=i.y*r;return{tileID:new et(t,0,t,Math.floor(a/C),Math.floor(s/C)),mercatorX:a,mercatorY:s}}_buildSkirts(e,t,i,r,a,s){let o=e.length,n=o+(i+1),l=(i+1)*i,u=a?Ra:0,h=+!a,c=s?Lr:C,p=+!s;for(let m=0;m<=i;m++)e.emplaceBack(m*r,u,h);for(let m=0;m<=i;m++)e.emplaceBack(m*r,c,p);for(let m=0;m<i;m++)t.emplaceBack(l+m,n+m,n+m+1),t.emplaceBack(l+m,n+m+1,l+m+1),t.emplaceBack(0+m,o+m+1,o+m),t.emplaceBack(0+m,0+m+1,o+m+1);let d=e.length,f=d+(i+1)*2;for(let m of[0,1])for(let _=0;_<=i;_++)for(let g of[0,1])e.emplaceBack(m*C,_*r,g);for(let m=0;m<i*2;m+=2)t.emplaceBack(d+m,d+m+1,d+m+3),t.emplaceBack(d+m,d+m+3,d+m+2),t.emplaceBack(f+m,f+m+3,f+m+1),t.emplaceBack(f+m,f+m+2,f+m+3)}};const Ir={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};var NA=class{constructor(e,t){this.painter=e,this.terrain=t,this.rttSize=t.tileManager.tileSize*t.qualityFactor}getTexture(e){return e.getRTT(this._stacks.length-1).texture}
804prepareForRender(e,t){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=e._order.filter(r=>!e._layers[r].isHidden(t));let i=new Set;for(let r of this._renderableLayerIds){let a=e._layers[r],s=a.source;s&&Ir[a.type]&&i.add(s)}this._coordsAscending={},this._rttFingerprints={};for(let r of i){let a=e.tileManagers[r];if(!a)continue;this._coordsAscending[r]={};let s=this._coordsAscending[r],o=a.getSource(),n=o instanceof gs?o.terrainTileRanges:null;for(let h of a.getVisibleCoordinates()){let c=this.terrain.tileManager.getTerrainCoords(h,n);for(let p in c)s[p]||=[],s[p].push(c[p])}this._rttFingerprints[r]={};let l=this._rttFingerprints[r],u=a.getState().revision;for(let h in s)l[h]=`${s[h].map(c=>c.key).sort().join()}#${u}`}for(let r of this._renderableTiles)for(let a in this._rttFingerprints){let s=this._rttFingerprints[a][r.tileID.key];s&&s!==r.rttFingerprint[a]&&r.releaseRTT(this.painter)}}renderLayer(e,t){if(e.isHidden(this.painter.transform.zoom))return!1;let i={...t,isRenderingToTexture:!0},r=e.type,a=this.painter,s=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(Ir[r]&&((!this._prevType||!Ir[this._prevType])&&this._stacks.push([]),this._prevType=r,this._stacks[this._stacks.length-1].push(e.id),!s))return!0;if(Ir[this._prevType]||Ir[r]&&s){this._prevType=r;let o=this._stacks.length-1,n=this._stacks[o]||[];for(let l of this._renderableTiles){if(this._rttTiles.push(l),l.getRTT(o))continue;let u=l.acquireRTT(a,o,this.rttSize);a.bindRTT(u),a.context.clear({color:K.transparent,stencil:0}),a.currentStencilSource=void 0;for(let h of n){let c=a.style._layers[h],p=c.source?this._coordsAscending[c.source][l.tileID.key]:[l.tileID];a.context.viewport.set([0,0,this.rttSize,this.rttSize]),a.renderTileClippingMasks(c,p,!0),a.renderLayer(a,a.style.tileManagers[c.source],c,p,i),c.source&&(l.rttFingerprint[c.source]=this._rttFingerprints[c.source][l.tileID.key])}}return UM(this.painter,this.terrain,this._rttTiles,i),this._rttTiles=[],Ir[r]}return!1}};const UA={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Drag to rotate map, click to reset north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use â + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},GA=b_,hd={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:Tg,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:Bt.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,rotateSpeed:.8,pitchSpeed:-.5,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGroun
804d:!0,terrainSkirtLength:"auto",zoomLevelsToOverscale:4,anisotropicFilterPitch:20};var wz=class extends Ze{get _ownerWindow(){return this._container?.ownerDocument?.defaultView||window}constructor(e){super(),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new OA,this._controls=[],this._mapId=Td(),this._missingStyleImageResolver=null,this._lostContextStyle={style:null,images:null},this._contextLost=a=>{if(a.preventDefault(),this._frameRequest&&=(this._frameRequest.abort(),null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),!this.style){this.fire(new Nn("webglcontextlost",{originalEvent:a}));return}for(let s of Object.values(this.style._layers))if(s.type==="custom"&&console.warn(`Custom layer with id '${s.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),s._listeners)for(let[o]of Object.entries(s._listeners))console.warn(`Custom layer with id '${s.id}' had event listeners for event '${o}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new Nn("webglcontextlost",{originalEvent:a}))},this._contextRestored=a=>{this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style&&(this.style.imageManager.images=this._lostContextStyle.images),this._lostContextStyle={style:null,images:null},this._setupPainter(),this.painter&&(this.resize(),this._update(),this._resizeInternal(),this.fire(new Nn("webglcontextrestored",{originalEvent:a})))},this._onMapScroll=a=>{if(a.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()};let t={...hd,...e,canvasContextAttributes:{...hd.canvasContextAttributes,...e.canvasContextAttributes}};if(t.minZoom!=null&&t.maxZoom!=null&&t.minZoom>t.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(t.minPitch!=null&&t.maxPitch!=null&&t.minPitch>t.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(t.minPitch!=null&&t.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(t.maxPitch!=null&&t.maxPitch>180)throw Error("maxPitch must be less than or equal to 180");if(this._camera=new LA({minZoom:t.minZoom,maxZoom:t.maxZoom,minPitch:t.minPitch,maxPitch:t.maxPitch,bearingSnap:t.bearingSnap,zoomSnap:t.zoomSnap,renderWorldCopies:t.renderWorldCopies,centerClampedToGround:t.centerClampedToGround,terrain:this.terrain,transformConstrain:t.transformConstrain,requestRenderFrame:a=>this._requestRenderFrame(a),cancelRenderFrame:a=>this._cancelRenderFrame(a),transformCameraUpdate:t.transformCameraUpdate,stopHandlers:()=>this._handlers?.stop(!1)}),this._camera.setEventedParent(this),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._maxTileCacheZoomLevels=t.maxTileCacheZoomLevels,this._canvasContextAttributes={...t.canvasContextAttributes},this._trackResize=t.trackResize===!0,this._terrainSkirtLength=t.terrainSkirtLength,this._refreshExpiredTiles=t.refreshExpiredTiles===!0,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions===!0,this._collectResourceTiming=t.collectResourceTiming===!0,this._locale={...UA,...t.locale},this._clickTolerance=t.clickTolerance,this._overridePixelRatio=t.pixelRatio,this._maxCanvasSize=t.maxCanvasSize,this._zoomLevelsToOverscale=t.zoomLevelsToOverscale,this.cancelPendingTileRequestsWhileZooming=t.cancelPendingTileRequestsWhileZooming===!0,this.setAnisotropicFilterPitch(t.anisotropicFilterPitch),t.reduceMotion!==void 0&&(ft.prefersReducedMotion=t.reduceMotion),this._imageQueueHandle=Ti.addThrottleControl(()=>this.isMoving()),this._requestManager=new ZT(t.transformRequest),this._container=this._resolveContainer(t.container),t.maxBounds&&this.setMaxBounds(t.maxBounds),this._setupContainer(),this._setupPainter(),!this.painter)return;this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.depthDirty=!0,this._update(!0)}),this.once("idle",()=>this._idleTriggered=!0),this._handlers=new kA(this,this._camera,t),typeof window<"u"&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver());let i=typeof t.hash=="string"&&t.hash||void 0;this._hash=t.hash?new YM(i).addTo(this):void 0,this._hash?._onHashChange()||(this.jumpTo({center:t.center,elevation:t.elevation,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch,roll:t.roll}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,j({},t.fitBoundsOptions,{duration:0}))));let r=typeof t.style=="string"||t.style?.projection?.type!=="globe";this.resize(null,r),this._localIdeographFontFamily=t.localIdeographFontFamily,this._val
vendor: 15,701 bytes, line 804
804idateStyle=t.validateStyle,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new FA(typeof t.attributionControl=="boolean"?void 0:t.attributionControl)),t.maplibreLogo&&this.addControl(new BA,t.logoPosition),this.on("style.load",()=>{if(r||this._resizeTransform(),this._camera.transform.unmodified){let a=as(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(a)}}),this.on("data",a=>{this._update(a.dataType==="style"),this.fire(a.dataType==="style"?new Gt("styledata",a):new be("sourcedata",a))}),this.on("dataloading",a=>{this.fire(a.dataType==="style"?new Gt("styledataloading",a):new be("sourcedataloading",a))}),this.on("dataabort",a=>{this.fire(new be("sourcedataabort",a))})}_getMapId(){return this._mapId}setGlobalStateProperty(e,t){return this.style.setGlobalStateProperty(e,t),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(e,t){if(t===void 0&&(t=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e?.onAdd)return this.fire(new G(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let i=e.onAdd(this);this._controls.push(e);let r=this._controlPositions[t];return t.includes("bottom")?r.insertBefore(i,r.firstChild):r.appendChild(i),this}removeControl(e){if(!e?.onRemove)return this.fire(new G(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let t=this._controls.indexOf(e);return t>-1&&this._controls.splice(t,1),e.onRemove(this),this}hasControl(e){return this._controls.includes(e)}coveringTiles(e){return sa(this._camera.transform,e)}setTransformCameraUpdate(e){this._camera.transformCameraUpdate=e}getCenter(){return new W(this._camera.transform.center.lng,this._camera.transform.center.lat)}setCenter(e,t){return this._camera.setCenter(e,t),this}getCenterElevation(){return this._camera.transform.elevation}setCenterElevation(e,t){return this._camera.setCenterElevation(e,t),this}setCenterClampedToGround(e){this._camera.setCenterClampedToGround(e)}panBy(e,t,i){return this._camera.panBy(e,t,i),this}panTo(e,t,i){return this._camera.panTo(e,t,i),this}getZoom(){return this._camera.transform.zoom}setZoom(e,t){return this._camera.setZoom(e,t),this}zoomTo(e,t,i){return this._camera.zoomTo(e,t,i),this}zoomIn(e,t){return this._camera.zoomIn(e,t),this}zoomOut(e,t){return this._camera.zoomOut(e,t),this}getVerticalFieldOfView(){return this._camera.transform.fov}setVerticalFieldOfView(e,t){return this._camera.setVerticalFieldOfView(e,t),this}getBearing(){return this._camera.transform.bearing}setBearing(e,t){return this._camera.setBearing(e,t),this}getZoomSnap(){return this._camera.getZoomSnap()}setZoomSnap(e){return this._camera.setZoomSnap(e),this}getPadding(){return this._camera.transform.padding}setPadding(e,t){return this._camera.setPadding(e,t),this}rotateTo(e,t,i){return this._camera.rotateTo(e,t,i),this}resetNorth(e,t){return this._camera.resetNorth(e,t),this}resetNorthPitch(e,t){return this._camera.resetNorthPitch(e,t),this}snapToNorth(e,t){return this._camera.snapToNorth(e,t),this}getPitch(){return this._camera.transform.pitch}setPitch(e,t){return this._camera.setPitch(e,t),this}getRoll(){return this._camera.transform.roll}setRoll(e,t){return this._camera.setRoll(e,t),this}cameraForBounds(e,t){return this._camera.cameraForBounds(e,t)}fitBounds(e,t,i){return this._camera.fitBounds(e,t,i),this}fitScreenCoordinates(e,t,i,r,a){return this._camera.fitScreenCoordinates(e,t,i,r,a),this}jumpTo(e,t){return this._camera.jumpTo(e,t),this}calculateCameraOptionsFromCameraLngLatAltRotation(e,t,i,r,a){return this._camera.calculateCameraOptionsFromCameraLngLatAltRotation(e,t,i,r,a)}easeTo(e,t){return this._camera.easeTo(e,t),this}flyTo(e,t){return this._camera.flyTo(e,t),this}stop(){return this._camera.stop(),this}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLat(W.convert(e),this._camera.transform):null}getCenterClampedToGround(){return this._camera.getCenterClampedToGround()}calculateCameraOptionsFromTo(e,t,i,r){return r==null&&this.terrain&&(r=this.terrain.getElevationForLngLat(i,this._camera.transform)),this._camera.calculateCameraOptionsFromTo(e,t,i,r)}resize(e,t=!0){if(this._lostContextStyle.style!==null)return this;this._resizeInternal(t);let i=!this._camera._moving;return i&&(this.stop(),this.fire(new U("movestart",e)).fire(new U("move",e))),this.fire(new Xe("resize",e)),i&&this.fire(new U("moveend",e)),this}_resizeInternal(e=!0){let[t,i]=this._containerDimensions(),r=this._getClampedPixelRatio(t,i);if(this._resizeCanvas(t,i,r),this.painter.resize(t,i,r),this.painter.overLimit()){let a=this.painter.context.gl;this._maxCanvasSize=[a.drawingBufferWidth,a.drawingBufferHeight];let s=this._getClampedPixelRatio(t,i);this._resizeCanvas(t,i,s),this.painter.resize(t,i,s)}this._resizeTransform(e)}_resizeTransform(e=!0){let[t,i]=this._containerDimensions();this._camera.transform.resize(t,i,e),this._camera._requestedCameraState?.resize(t,i,e)}_getClampedPixelRatio(e,t){let{0:i,1:r}=this._maxCanvasSize,a=this.getPixelRatio(),s=e*a,o=t*a,n=s>i?i/s:1,l=o>r?r/o:1;return Math.min(n,l)*a}getPixelRatio(){return this._overridePixelRatio??devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this._camera.transform.getBounds()}getMaxBounds(){return this._camera.transform.getMaxBounds()}setMaxBounds(e){return this._camera.transform.setMaxBounds(ni.convert(e)),this._update()}setMinZoom(e){if(e??=-2,e>=-2&&e<=this._camera.transform.maxZoom){let t=this._camera.transform.zoom,i=this._camera.getTransformForUpdate();return i.setMinZoom(e),this._camera.applyUpdatedTransform(i),this._update(),t!==this._camera.transform.zoom&&this.fire(new U("zoomstart")).fire(new U("zoom")).fire(new U("zoomend")).fire(new U("movestart")).fire(new U("move")).fire(new U("moveend")),this}else throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this._camera.transform.minZoom}setMaxZoom(e){if(e??=22,e>=this._camera.transform.minZoom){let t=this._camera.transform.zoom,i=this._camera.getTransformForUpdate();return i.setMaxZoom(e),this._camera.applyUpdatedTransform(i),this._update(),t!==this._camera.transform.zoom&&this.fire(new U("zoomstart")).fire(new U("zoom")).fire(new U("zoomend")).fire(new U("movestart")).fire(new U("move")).fire(new U("moveend")),this}else throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this._camera.transform.maxZoom}setMinPitch(e){if(e??=0,e<0)throw Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this._camera.transform.maxPitch){let t=this._camera.transform.pitch,i=this._camera.getTransformForUpdate();return i.setMinPitch(e),this._camera.applyUpdatedTransform(i),this._update(),t!==this._camera.transform.pitch&&this.fire(new U("pitchstart")).fire(new U("pitch")).fire(new U("pitchend")).fire(new U("movestart")).fire(new U("move")).fire(new U("moveend")),this}else throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this._camera.transform.minPitch}setMaxPitch(e){if(e??=60,e>180)throw Error("maxPitch must be less than or equal to 180");if(e>=this._camera.transform.minPitch){let t=this._camera.transform.pitch,i=this._camera.getTransformForUpdate();return i.setMaxPitch(e),this._camera.applyUpdatedTransform(i),this._update(),t!==this._camera.transform.pitch&&this.fire(new U("pitchstart")).fire(new U("pitch")).fire(new U("pitchend")).fire(new U("movestart")).fire(new U("move")).fire(new U("moveend")),this}else throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this._camera.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(e){if(e??=20,e>180)throw Error("anisotropicFilterPitch must be less than or equal to 180");if(e<0)throw Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=e,this._update()}getRenderWorldCopies(){return this._camera.transform.renderWorldCopies}setRenderWorldCopies(e){return this._camera.transform.setRenderWorldCopies(e),this._update()}setTransformConstrain(e){return this._camera.transform.setConstrainOverride(e),this._update()}project(e){return this._camera.transform.locationToScreenPoint(W.convert(e),this.style&&this.terrain)}unproject(e){return this._camera.transform.screenPointToLocation(E.convert(e),this.terrain)}isMoving(){return this._camera.isMoving()||this._handlers?.isMoving()||!1}isZooming(){return this._camera.isZooming()||this._handlers?.isZooming()||!1}isRotating(){return this._camera.isRotating()||this._handlers?.isRotating()||!1}_createDelegatedListener(e,t,i){if(e==="mouseenter"||e==="mouseover"){let r=!1;return{layers:t,listener:i,delegates:{mousemove:a=>{let s=t.filter(n=>this.getLayer(n)),o=s.length===0?[]:this.queryRenderedFeatures(a.point,{layers:s});o.length?r||(r=!0,i.call(this,new Rt(e,this,a.originalEvent,{features:o}))):r=!1},mouseout:()=>{r=!1}}}}else if(e==="mouseleave"||e==="mouseout"){let r=!1;return{layers:t,listener:i,delegates:{mousemove:a=>{let s=t.filter(o=>this.getLayer(o));(s.length===0?[]:this.queryRenderedFeatures(a.point,{layers:s})).length?r=!0:r&&(r=!1,i.call(this,new Rt(e,this,a.originalEvent)))},mouseout:a=>{r&&(r=!1,i.call(this,new Rt(e,this,a.originalEvent)))}}}}else{let r=a=>{let s=t.filter(n=>this.getLayer(n)),o=s.length===0?[]:this.queryRenderedFeatures(a.point,{layers:s});o.length&&(a.features=o,i.call(this,a),delete a.features)};return{layers:t,listener:i,delegates:{[e]:r}}}}_saveDelegatedListener(e,t){this._delegatedListeners||={},this._delegatedListeners[e]||=[],this._delegatedListeners[e].push(t)}_removeDelegatedListener(e,t,i){if(!this._delegatedListeners?.[e])return;let r=this._delegatedListeners[e];for(let a=0;a<r.length;a++){let s=r[a];if(s.listener===i&&s.layers.length===t.length&&s.layers.every(o=>t.includes(o))){for(let o in s.delegates)this.off(o,s.delegates[o]);r.splice(a,1);return}}}on(e,t,i){if(i===void 0)return super.on(e,t);let r=typeof t=="string"?[t]:t,a=this._createDelegatedListener(e,r,i);this._saveDelegatedListener(e,a);for(let s in a.delegates)this.on(s,a.delegates[s]);return{unsubscribe:()=>{this._removeDelegatedListener(e,r,i)}}}once(e,t,i){if(i===void 0)return super.once(e,t);let r=typeof t=="string"?[t]:t,a=this._createDelegatedListener(e,r,i);for(let s in a.delegates){let o=a.delegates[s];a.delegates[s]=(...n)=>{this._removeDelegatedListener(e,r,i),o(...n)}}this._saveDelegatedListener(e,a);for(let s in a.delegates)this.once(s,a.delegates[s]);return this}off(e,t,i){if(i===void 0)return super.off(e,t);let r=typeof t=="string"?[t]:t;return this._removeDelegatedListener(e,r,i),this}queryRenderedFeatures(e,t){if(!this.style)return[];let i,r=e instanceof E||Array.isArray(e),a=r?e:[[0,0],[this._camera.transform.width,this._camera.transform.height]];if(t||=(r?{}:e)||{},a instanceof E||typeof a[0]=="number")i=[E.convert(a)];else{let s=E.convert(a[0]),o=E.convert(a[1]);i=[s,new E(o.x,s.y),o,new E(s.x,o.y),s]}return this.style.queryRenderedFeatures(i,t,this._camera.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(e,t){return t=j({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},t),t.diff!==!1&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(e,t))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){let t=this._locale[e];if(t==null)throw Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){if(this._diffStyleRequest?.abort(),this._diffStyleRequest=null,t.transformStyle&&this.style&&!this.style._loaded){this.style.once("style.load",()=>this._updateStyle(e,t));return}let i=this.style&&t.transformStyle?this.style.serialize():void 0;if(this.style&&(this.style.setEventedParent(null),this.style._remove(!e)),e)this.style=new Hp(this,t||{});else return this._frameRequest&&=(this._frameRequest.abort(),null),this.style?.projection?.destroy(),delete this.style,this;return this.style.setEventedParent(this,{style:this.style}),typeof e=="string"?this.style.loadURL(e,t,i):this.style.loadJSON(e,t,i),this}_lazyInitEmptyStyle(){this.style||(this.style=new Hp(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}async _diffStyle(e,t){if(this._diffStyleRequest?.abort(),typeof e=="string"){let i=e;this._diffStyleRequest=new AbortController;let r=this._diffStyleRequest;try{let a=await this._requestManager.transformRequest(i,"Style");if(r.signal.aborted){this._diffStyleRequest=null;return}let s=await Lo(a,r);this._diffStyleRequest=null,this._updateDiff(s.data,t)}catch(a){this._diffStyleRequest=null,Ui(a)||this.fire(new G(ht(a)))}}else typeof e=="object"&&(this._diffStyleRequest=null,this._updateDiff(e,t))}_updateDiff(e,t){try{this.style.setState(e,t)&&this._update(!0)}catch(i){ge(`Unable to perform style diff: ${ht(i).message}. Rebuilding the style from scratch.`),this._updateStyle(e,t)}}getStyle(){if(this.style)return this.style.serialize()}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){if(!this.style){ge("There is no style added to the map.");return}return this.style.loaded()}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){let t=this.style?.tileManagers[e];if(t===void 0){this.fire(new G(Error(`There is no tile manager with ID '${e}'`)));return}return t.loaded()}setTerrain(e,t={}){if(this.style._checkLoaded(),e&&ps(this,_t.terrain,{value:e},t))return this;if(this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),!e)this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture=null,this._camera.terrain=null,this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0);else{let i=this.style.tileManagers[e.source];if(!i)throw Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);this.terrain===null&&i.reload();for(let r in this.style._layers){let a=this.style._layers[r];a.type==="hillshade"&&a.source===e.source&&ge("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),a.type==="color-relief"&&a.source===e.source&&ge("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain&&this.terrain.destroy(),this.terrain=new jA(this.painter,i,e,this._terrainSkirtLength),this.painter.renderToTexture=new NA(this.painter,this.terrain),this._camera.terrain=this.terrain,this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this._camera.transform.setElevation(this.terrain.getElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this._terrainDataCallback=r=>{r.dataType==="style"?this.terrain.tileManager.releaseAllRTT():r.dataType==="source"&&r.tile&&(r.sourceId===e.source&&!this._camera.elevationFreeze&&(this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this.getCenterClampedToGroun
804d()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom))),r.source?.type==="image"?this.terrain.tileManager.releaseAllRTT():this.terrain.tileManager.releaseRTT(r.tile.tileID))},this.style.on("data",this._terrainDataCallback)}return this.fire(new WT({terrain:e})),this}getTerrain(){return this.terrain?.options??null}areTilesLoaded(){let e=this.style?.tileManagers;for(let t of Object.values(e))if(!t.areTilesLoaded())return!1;return!0}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){return this.style?.getSource(e)}setSourceTileLodParams(e,t,i){if(i){let r=this.getSource(i);if(!r)throw Error(`There is no source with ID "${i}", cannot set LOD parameters`);r.calculateTileZoom=vu(Math.max(1,e),Math.max(1,t))}else for(let r in this.style.tileManagers)this.style.tileManagers[r].getSource().calculateTileZoom=vu(Math.max(1,e),Math.max(1,t));return this._update(!0),this}refreshTiles(e,t){let i=this.style.tileManagers[e];if(!i)throw Error(`There is no tile manager with ID "${e}", cannot refresh tile`);t===void 0?i.reload(!0):i.refreshTiles(t.map(r=>new an(r.z,r.x,r.y)))}addImage(e,t,i={}){this._lazyInitEmptyStyle();let r=this._createStyleImage(t,i);return r?(this.style.addImage(e,r),r.userImage?.onAdd&&r.userImage.onAdd(this,e),this):this}setMissingStyleImageResolver(e){return this._missingStyleImageResolver=e,this.style?.setMissingImageResolver(e),this}_createStyleImage(e,t={}){let{pixelRatio:i=1,sdf:r=!1,stretchX:a,stretchY:s,content:o,textFitWidth:n,textFitHeight:l}=t;if(e instanceof HTMLImageElement||ar(e)){let{width:u,height:h,data:c}=ft.getImageData(e);return{data:new xe({width:u,height:h},c),pixelRatio:i,stretchX:a,stretchY:s,content:o,textFitWidth:n,textFitHeight:l,sdf:r,version:0}}else{if(e.width===void 0||e.height===void 0)return this.fire(new G(Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))),null;{let{width:u,height:h,data:c}=e,p=e;return{data:new xe({width:u,height:h},new Uint8Array(c)),pixelRatio:i,stretchX:a,stretchY:s,content:o,textFitWidth:n,textFitHeight:l,sdf:r,version:0,userImage:p}}}}updateImage(e,t){let i=this.style.getImage(e);if(!i)return this.fire(new G(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:r,height:a,data:s}=t instanceof HTMLImageElement||ar(t)?ft.getImageData(t):t;if(r===void 0||a===void 0)return this.fire(new G(Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(r!==i.data.width||a!==i.data.height)return this.fire(new G(Error("The width and height of the updated image must be that same as the previous version of the image")));let o=!(t instanceof HTMLImageElement||ar(t));return i.data.replace(s,o),this.style.updateImage(e,i),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new G(Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}async loadImage(e){return Ti.getImage(await this._requestManager.transformRequest(e,"Image"),new AbortController)}listImages(){return this.style?.listImages()??[]}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style?.getLayer(e)}getLayersOrder(){return this.style?.getLayersOrder()??[]}setLayerZoomRange(e,t,i){return this.style.setLayerZoomRange(e,t,i),this._update(!0)}setFilter(e,t,i={}){return this.style?.setFilter(e,t,i),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,i,r={}){return this.style?.setPaintProperty(e,t,i,r),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,i,r={}){return this.style.setLayoutProperty(e,t,i,r),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setGlyphs(e,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(e,t,i={}){return this._lazyInitEmptyStyle(),this.style.addSprite(e,t,i,r=>{r||this._update(!0)}),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(e,t,i=>{i||this._update(!0)}),this}setLight(e,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSky(e,t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]}_setupResizeObserver(){let e=!1,t=wg(r=>{this._trackResize&&!this._removed&&(this.resize(r),this.redraw())},50),i=this._ownerWindow.ResizeObserver??ResizeObserver;this._resizeObserver=new i(r=>{if(!e){e=!0;return}t(r)}),this._resizeObserver.observe(this._container)}
vendor: 13,190 bytes, line 804
804_resolveContainer(e){if(typeof e=="string"){let t=document.getElementById(e);if(!t)throw Error(`Container '${e}' not found.`);return t}if(e instanceof HTMLElement||e&&typeof e=="object"&&e.nodeType===1)return e;throw Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){let e=this._container;e.classList.add("maplibregl-map");let t=this._canvasContainer=N.create("div","maplibregl-canvas-container",e);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=N.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let i=this._containerDimensions(),r=this._getClampedPixelRatio(i[0],i[1]);this._resizeCanvas(i[0],i[1],r);let a=this._controlContainer=N.create("div","maplibregl-control-container",e),s=this._controlPositions={};for(let o of["top-left","top-right","bottom-left","bottom-right"])s[o]=N.create("div",`maplibregl-ctrl-${o} `,a);this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(e,t,i){this._canvas.width=Math.floor(i*e),this._canvas.height=Math.floor(i*t),this._canvas.style.width=`${e}px`,this._canvas.style.height=`${t}px`}_setupPainter(){let e={...this._canvasContextAttributes,alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0},t=null;this._canvas.addEventListener("webglcontextcreationerror",r=>{t=r},{once:!0});let i=this._canvas.getContext("webgl2",e);if(!i){this.fire(new G(new XM(e,t)));return}this.painter=new HM(i,this._camera.transform)}migrateProjection(e,t){this._camera.migrateProjection(e,t),this.painter.transform=e,this.fire(new HT({newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style?._loaded?(this._styleDirty||=e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_render(e){let t=this._idleTriggered?this._fadeDuration:0,i=this.style.projection?.transitionState>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let r=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let o=this._camera.transform.zoom,n=_e();this.style.zoomHistory.update(o,n);let l=new Se(o,{now:n,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),u=l.crossFadingFactor();(u!==1||u!==this._crossFadingFactor)&&(r=!0,this._crossFadingFactor=u),this.style.update(l)}let a=this.style.projection?.transitionState>0!==i;this._camera.transform.setTransitionState(this.style.projection?.transitionState),this.style&&(this._sourcesDirty||a)&&(this._sourcesDirty=!1,this.style._updateSources(this._camera.transform)),this.terrain?(this.terrain.tileManager.update(this._camera.transform,this.terrain),this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),!this._camera.elevationFreeze&&this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom))):(this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0)),this._placementDirty=this.style?._updatePlacement(this._camera.transform,this.showCollisionBoxes,t,this._crossSourceCollisions,a),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new Xe("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new Xe("load"))),this.style&&(this.style.hasTransitions()||r)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let s=this._sourcesDirty||this._styleDirty||this._placementDirty;return s||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new Xe("idle")),this._loaded&&!this._fullyLoaded&&!s&&(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&=(this._frameRequest.abort(),null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(let t of this._controls)t.onRemove(this);this._controls=[],this._frameRequest&&=(this._frameRequest.abort(),null),this._renderTaskQueue.clear(),this._diffStyleRequest?.abort(),this.painter.destroy(),this._handlers.destroy(),this.setStyle(null),typeof window<"u"&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),Ti.removeThrottleControl(this._imageQueueHandle),this._resizeObserver?.disconnect();let e=this.painter.context.gl.getExtension("WEBGL_lose_context");e?.loseContext&&e.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),this._removed=!0,this.fire(new Xe("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,ft.frame(this._frameRequest,e=>{this._frameRequest=null;try{this._render(e)}catch(t){if(!Ui(t))throw t}},()=>{},this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get version(){return GA}getCameraTargetElevation(){return this._camera.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(e){return this._lazyInitEmptyStyle(),this.style.setProjection(e),this._update(!0)}};const ZA={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};var Tz=class{constructor(e){this._updateZoomButtons=()=>{let t=this._map.getZoom(),i=t===this._map.getMaxZoom(),r=t===this._map.getMinZoom();this._zoomInButton.disabled=i,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",i.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},this._rotateCompassArrow=()=>{let t=this._map.getPitch(),i=this._map.getRoll(),r=this._map.getBearing(),a=1/Math.cos(De(t))**.5;if(this.options.visualizePitch&&this.options.visualizeRoll){this._compassIcon.style.transform=`scale(${a}) rotateZ(${-i}deg) rotateX(${t}deg) rotateZ(${-r}deg)`;return}if(this.options.visualizePitch){this._compassIcon.style.transform=`scale(${a}) rotateX(${t}deg) rotateZ(${-r}deg)`;return}if(this.options.visualizeRoll){this._compassIcon.style.transform=`rotate(${-r-i}deg)`;return}this._compassIcon.style.transform=`rotate(${-r}deg)`},this._setButtonTitle=(t,i)=>{let r=this._map._getUIString(`NavigationControl.${i}`);t.title=r,t.setAttribute("aria-label",r)},this.options=j({},ZA,e),this._container=N.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),N.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),N.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=N.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new qA(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(e,t){let i=N.create("button",e,this._container);return i.type="button",i.addEventListener("click",t),i}},qA=class{constructor(e,t,i=!1){this.mousedown=a=>{this.startMove(a,N.mousePos(this.element,a)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)},this.mousemove=a=>{this.move(a,N.mousePos(this.element,a))},this.mouseup=a=>{this._rotatePitchHandler.dragEnd(a),this.offTemp()},this.touchstart=a=>{a.targetTouches.length===1?(this._startPos=this._lastPos=N.touchPos(this.element,a.targetTouches)[0],this.startMove(a,this._startPos),window.addEventListener("touchmove",this.touchmove,{passive:!1}),window.addEventListener("touchend",this.touchend)):this.reset()},this.touchmove=a=>{a.targetTouches.length===1?(this._lastPos=N.touchPos(this.element,a.targetTouches)[0],this.move(a,this._lastPos)):this.reset()},this.touchend=a=>{a.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=t;let r=new pA;this._rotatePitchHandler=new xs({clickTolerance:3,move:(a,s)=>{let o=t.getBoundingClientRect(),n=new E((o.bottom-o.top)/2,(o.right-o.left)/2);return{bearingDelta:Id(new E(a.x,s.y),s,n),pitchDelta:i?(s.y-a.y)*-.5:void 0}},moveStateManager:r,enable:!0,assignEvents:()=>{}}),this.map=e,t.addEventListener("mousedown",this.mousedown),t.addEventListener("touchstart",this.touchstart,{passive:!1}),t.addEventListener("touchcancel",this.reset)}startMove(e,t){this._rotatePitchHandler.dragStart(e,t),N.disableDrag()}move(e,t){let i=this.map,{bearingDelta:r,pitchDelta:a}=this._rotatePitchHandler.dragMove(e,t)||{};r&&i.setBearing(i.getBearing()+r),a&&i.setPitch(i.getPitch()+a)}off(){let e=this.element;e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){N.enableDrag(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend)}};let Ji;async function WA(e=!1){if(Ji!==void 0&&!e)return Ji;if(window.navigator.permissions===void 0)return Ji=!!window.navigator.geolocation,Ji;try{Ji=(await window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Ji=!!window.navigator.geolocation}return Ji}function Sg(e,t,i,r=!1){if(r||!i.getCoveringTilesDetailsProvider().allowWorldCopies())return e?.wrap();let a=new W(e.lng,e.lat);if(e=new W(e.lng,e.lat),t){let s=new W(e.lng-360,e.lat),o=new W(e.lng+360,e.lat),n=i.locationToScreenPoint(e).distSqr(t);i.locationToScreenPoint(s).distSqr(t)<n?e=s:i.locationToScreenPoint(o).distSqr(t)<n&&(e=o)}for(;Math.abs(e.lng-i.center.lng)>180;){let s=i.locationToScreenPoint(e);if(s.x>=0&&s.y>=0&&s.x<=i.width&&s.y<=i.height)break;e.lng>i.center.lng?e.lng-=360:e.lng+=360}
804return e.lng!==a.lng&&i.isPointOnMapSurface(i.locationToScreenPoint(e))?e:a}const Fh={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Pg(e,t,i){let r=e.classList;for(let a in Fh)r.remove(`maplibregl-${i}-anchor-${a}`);r.add(`maplibregl-${i}-anchor-${t}`)}var al=class extends Ot{},HA=class extends Ot{},cd=class extends Ze{constructor(e){if(super(),this._onClick=t=>{this.fire(new HA("click",{originalEvent:t}))},this._onKeyPress=t=>{(t.code==="Space"||t.code==="Enter")&&this.togglePopup()},this._onMapClick=t=>{let i=t.originalEvent.target,r=this._element;this._popup&&(i===r||r.contains(i))&&this.togglePopup()},this._update=t=>{if(!this._map)return;let i=this._map.loaded()&&!this._map.isMoving();(t?.type==="terrain"||t?.type==="render"&&!i)&&this._map.once("render",this._update),this._lngLat=Sg(this._lngLat,this._flatPos,this._map._camera.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map._camera.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let r="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?r=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(r=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let a="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?a="rotateX(0deg)":this._pitchAlignment==="map"&&(a=`rotateX(${this._map.getPitch()}deg)`),!this._subpixelPositioning&&(!t||t.type==="moveend")&&(this._pos=this._pos.round()),this._element.style.transform=`${Fh[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${a} ${r}`,ft.frameAsync(new AbortController,this._map._ownerWindow).then(()=>{this._updateOpacity(t?.type==="moveend")}).catch(()=>{})},this._onMove=t=>{if(!this._isDragging){let i=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=i}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new al("dragstart"))),this.fire(new al("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new al("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e?.anchor||"center",this._color=e?.color||"#3FB1CE",this._scale=e?.scale||1,this._draggable=e?.draggable||!1,this._clickTolerance=e?.clickTolerance||0,this._subpixelPositioning=e?.subpixelPositioning||!1,this._isDragging=!1,this._roleManaged=!1,this._state="inactive",this._rotation=e?.rotation||0,this._rotationAlignment=e?.rotationAlignment||"auto",this._pitchAlignment=e?.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e?.opacity,e?.opacityWhenCovered),e?.element)this._element=e.element,this._offset=E.convert(e?.offset||[0,0]);else{this._defaultMarker=!0,this._element=N.create("div");let t=N.createNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"display","block"),t.setAttributeNS(null,"height","41px"),t.setAttributeNS(null,"width","27px"),t.setAttributeNS(null,"viewBox","0 0 27 41");let i=N.createNS("http://www.w3.org/2000/svg","g");i.setAttributeNS(null,"stroke","none"),i.setAttributeNS(null,"stroke-width","1"),i.setAttributeNS(null,"fill","none"),i.setAttributeNS(null,"fill-rule","evenodd");let r=N.createNS("http://www.w3.org/2000/svg","g");r.setAttributeNS(null,"fill-rule","nonzero");let a=N.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"transform","translate(3.0, 29.0)"),a.setAttributeNS(null,"fill","#000000");for(let d of[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}]){let f=N.createNS("http://www.w3.org/2000/svg","ellipse");f.setAttributeNS(null,"opacity","0.04"),f.setAttributeNS(null,"cx","10.5"),f.setAttributeNS(null,"cy","5.80029008"),f.setAttributeNS(null,"rx",d.rx),f.setAttributeNS(null,"ry",d.ry),a.appendChild(f)}let s=N.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill",this._color);let o=N.createNS("http://www.w3.org/2000/svg","path");o.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),s.appendChild(o);let n=N.createNS("http://www.w3.org/2000/svg","g");n.setAttributeNS(null,"opacity","0.25"),n.setAttributeNS(null,"fill","#000000");let l=N.createNS("http://www.w3.org/2000/svg","path");l.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),n.appendChild(l);let u=N.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"transform","translate(6.0, 7.0)"),u.setAttributeNS(null,"fill","#FFFFFF");let h=N.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"transform","translate(8.0, 8.0)");let c=N.createNS("http://www.w3.org/2000/svg","circle");c.setAttributeNS(null,"fill","#000000"),c.setAttributeNS(null,"opacity","0.25"),c.setAttributeNS(null,"cx","5.5"),c.setAttributeNS(null,"cy","5.5"),c.setAttributeNS(null,"r","5.4999962");let p=N.createNS("http://www.w3.org/2000/svg","circle");p.setAttributeNS(null,"fill","#FFFFFF"),p.setAttributeNS(null,"cx","5.5"),p.setAttributeNS(null,"cy","5.5"),p.setAttributeNS(null,"r","5.4999962"),h.appendChild(c),h.appendChild(p),r.appendChild(a),r.appendChild(s),r.appendChild(n),r.appendChild(u),r.appendChild(h),t.appendChild(r),t.setAttributeNS(null,"height",`${41*this._scale}px`),t.setAttributeNS(null,"width",`${27*this._scale}px`),this._element.appendChild(t),this._offset=E.convert(e?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",t=>{t.preventDefault()}),this._element.addEventListener("mousedown",t=>{t.preventDefault()}),Pg(this._element,this._anchor,"marker"),e?.className)for(let t of e.className.split(" "))this._element.classList.add(t);this._popup=null}addTo(e){return this.remove(),this._map=e,this._defaultMarker&&!this._element.hasAttribute("aria-label")&&this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),this._updateAccessibilityRole(),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),e.on("projectiontransition",this._update),this._element.addEventListener("click",this._onClick),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),this._element.removeEventListener("click",this._onClick),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=W.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){let t=38.1,i=13.5,r=13.5/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
vendor: 7,959 bytes, line 804
8040,-38.1],"bottom-left":[r,(t-i+r)*-1],"bottom-right":[-r,(t-i+r)*-1],left:[i,(t-i)*-1],right:[-13.5,(t-i)*-1]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this._updateAccessibilityRole(),this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){let e=this._popup;if(this._element.style.opacity===this._opacityWhenCovered)return this;if(e)e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map));else return this;return this}_updateOpacity(e=!1){let t=this._map?.terrain,i=this._map._camera.transform.isLocationOccluded(this._lngLat);if(!t||i){let p=i?this._opacityWhenCovered:this._opacity;this._element.style.opacity!==p&&(this._element.style.opacity=p,this._element.classList.toggle("maplibregl-marker-covered",i));return}if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let r=this._map,a=r.terrain.depthAtPoint(this._pos),s=r.terrain.getElevationForLngLat(this._lngLat,r._camera.transform),o=r._camera.transform.lngLatToCameraDepth(this._lngLat,s),n=.006;if(o-a<n){this._element.style.opacity=this._opacity,this._element.classList.remove("maplibregl-marker-covered");return}let l=-this._offset.y/r._camera.transform.pixelsPerMeter,u=Math.sin(r.getPitch()*Math.PI/180)*l,h=r.terrain.depthAtPoint(new E(this._pos.x,this._pos.y-this._offset.y)),c=r._camera.transform.lngLatToCameraDepth(this._lngLat,s+u)-h>n;this._popup?.isOpen()&&c&&this._popup.remove(),this._element.style.opacity=c?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",c)}getOffset(){return this._offset}setOffset(e){return this._offset=E.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._element.classList.toggle("maplibregl-marker-draggable",this._draggable),this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this._updateAccessibilityRole(),this}isDraggable(){return this._draggable}_updateAccessibilityRole(){if(!this._defaultMarker||this._element.hasAttribute("role")&&!this._roleManaged)return;let e=this._draggable||this._popup?"button":"img";this._element.setAttribute("role",e),this._roleManaged=!0}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,t){return(this._opacity===void 0||e===void 0&&t===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=String(e)),t!==void 0&&(this._opacityWhenCovered=String(t)),this._map&&this._updateOpacity(!0),this}};const XA={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Ws=0,xa=!1;var Er=class extends Ot{},pd=class extends Ot{},YA=class extends Ot{},Sz=class extends Ze{constructor(e){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t)){this._setErrorState(),this.fire(new pd("outofmaxbounds",t)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(t),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new pd("geolocate",t)),this._finish()}},this._updateCamera=t=>{let i=new W(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,a=j({bearing:this._map.getBearing()},this.options.fitBoundsOptions),s=ni.fromLngLat(i,r);this._map.fitBounds(s,a,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let i=new W(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=t.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=t=>{if(this._map){if(t.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&xa)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new YA("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=t=>{if(!this._map)return;let i=t?.[0]instanceof ResizeObserverEntry;!t.geolocateSource&&this._watchState==="ACTIVE_LOCK"&&!i&&!this._map.isZooming()&&(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new Er("trackuserlocationend")),this.fire(new Er("userlocationlostfocus")))},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",t=>{t.preventDefault()}),this._geolocateButton=N.create("button","maplibregl-ctrl-geolocate",this._container),N.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(t===!1){ge("Geolocation support is not available so the GeolocateControl will be disabled.");let i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{let i=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
804se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=N.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new cd({element:this._dotElement}),this._circleElement=N.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new cd({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",this._onMoveStart)}},this.options=j({},XA,e)}onAdd(e){return this._map=e,this._container=N.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),WA().then(t=>this._finishSetupUI(t)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("movestart",this._onMoveStart),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,Ws=0,xa=!1}_isOutOfMapMaxBounds(e){let t=this._map.getMaxBounds(),i=e.coords;return t&&(i.longitude<t.getWest()||i.longitude>t.getEast()||i.latitude<t.getSouth()||i.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":case"BACKGROUND_ERROR":break;case"OFF":case void 0:break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let e=this._userLocationDotMarker.getLngLat();if(!this.options.showUserLocation||!this.options.showAccuracyCircle||!this._accuracy||!e)return;let t=this._map.project(e),i=this._map.unproject([t.x+100,t.y]),r=e.distanceTo(i)/100,a=2*this._accuracy/r;this._circleElement.style.width=`${a.toFixed(2)}px`,this._circleElement.style.height=`${a.toFixed(2)}px`}trigger(){if(!this._setup)return ge("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new Er("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Ws--,xa=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new Er("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new Er("trackuserlocationstart")),this.fire(new Er("userlocationfocus"));break;default:throw Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Ws++;let e;Ws>1?(e={maximumAge:6e5,timeout:0},xa=!0):(e=this.options.positionOptions,xa=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","fal
804se"),this.options.showUserLocation&&this._updateMarker(null)}};const KA={maxWidth:100,unit:"metric"};var Pz=class{constructor(e){this._onMove=()=>{dd(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,dd(this._map,this._container,this.options)},this.options={...KA,...e}}getDefaultPosition(){return"bottom-left"}onAdd(e){return this._map=e,this._container=N.create("div","maplibregl-ctrl maplibregl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._onMove),this._map=void 0}};function dd(e,t,i){let r=i?.maxWidth||100,a=e._container.clientHeight/2,s=e._container.clientWidth/2,o=e.unproject([s-r/2,a]),n=e.unproject([s+r/2,a]),l=Math.round(e.project(n).x-e.project(o).x),u=Math.min(r,l,e._container.clientWidth),h=o.distanceTo(n);if(i?.unit==="imperial"){let c=3.2808*h;c>5280?ba(t,u,c/5280,e._getUIString("ScaleControl.Miles")):ba(t,u,c,e._getUIString("ScaleControl.Feet"))}else i?.unit==="nautical"?ba(t,u,h/1852,e._getUIString("ScaleControl.NauticalMiles")):h>=1e3?ba(t,u,h/1e3,e._getUIString("ScaleControl.Kilometers")):ba(t,u,h,e._getUIString("ScaleControl.Meters"))}function ba(e,t,i,r){let a=QA(i),s=a/i;e.style.width=`${t*s}px`,e.innerHTML=`${a} ${r}`}function JA(e){let t=10**Math.ceil(-Math.log(e)/Math.LN10);return Math.round(e*t)/t}function QA(e){let t=10**(`${Math.floor(e)}`.length-1),i=e/t;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:JA(i),t*i}var fd=class extends Ot{},Iz=class extends Ze{constructor(e={}){super(),this._onFullscreenChange=()=>{let t=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;t?.shadowRoot?.fullscreenElement;)t=t.shadowRoot.fullscreenElement;t===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,this._pseudo=e.pseudo??!1,e?.container&&(e.container instanceof HTMLElement?this._container=e.container:ge("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(e){return this._map=e,this._container||=this._map.getContainer(),this._controlContainer=N.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let e=this._fullscreenButton=N.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);N.create("span","maplibregl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new fd("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new fd("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},Ez=class{constructor(e){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=e}onAdd(e){return this._map=e,this._container=N.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=N.create("button","maplibregl-ctrl-terrain",this._container),N.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.t
vendor: 10,917 bytes, line 804
804ype="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){this._container.remove(),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},Mz=class{constructor(){this._toggleProjection=()=>{let e=this._map.getProjection()?.type;e==="mercator"||!e?this._map.setProjection({type:"globe"}):this._map.setProjection({type:"mercator"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),this._map.getProjection()?.type==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(e){return this._map=e,this._container=N.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=N.create("button","maplibregl-ctrl-globe",this._container),N.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}};const eC={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0},tC=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");var md=class extends Ot{},Az=class extends Ze{constructor(e){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(this._map._camera.transform.isLocationOccluded(this.getLngLat())?this._container.style.opacity=`${this.options.locationOccludedOpacity}`:this._container.style.opacity="")},this.remove=()=>(this._content&&this._content.remove(),this._container&&(this._container.remove(),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousemove",this._update),this._map.off("mouseup",this._update),this._map.off("drag",this._update),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new md("close"))),this),this._update=t=>{let i=this._lngLat||this._trackPointer;if(!this._map||!i||!this._content)return;if(!this._container){if(this._container=N.create("div","maplibregl-popup",this._map.getContainer()),this._tip=N.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let l of this.options.className.split(" "))this._container.classList.add(l);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=Sg(this._lngLat,this._flatPos,this._map._camera.transform,this._trackPointer);let r;if(t&&"point"in t&&t.point&&(r=t.point),this._trackPointer&&!r)return;let a=this._flatPos=this._pos=this._trackPointer&&r?r:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&r?r:this._map._camera.transform.locationToScreenPoint(this._lngLat));let s=this.options.anchor,o=Ig(this.options.offset);if(!s){let l=this._container.offsetWidth,u=this._container.offsetHeight,h=iC(this.options.padding),c;c=a.y+o.bottom.y<u+h.top?["top"]:a.y>this._map._camera.transform.height-u-h.bottom?["bottom"]:[],a.x<l/2+h.left?c.push("left"):a.x>this._map._camera.transform.width-l/2-h.right&&c.push("right"),s=c.length===0?"bottom":c.join("-")}let n=a.add(o[s]);this.options.subpixelPositioning||(n=n.round()),this._container.style.transform=`${Fh[s]} translate(${n.x}px,${n.y}px)`,Pg(this._container,s,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=j(Object.create(eC),e)}addTo(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._map.on("terrain",this._update),this._map.on("projectiontransition",this._update),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._update),this._map.on("mouseup",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new md("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=W.convert(e),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._update),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._update),this._map.on("drag",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){let t=document.createDocumentFragment(),i=document.createElement("body"),r;for(i.innerHTML=e;r=i.firstChild,r;)t.appendChild(r);return this.setDOMContent(t)}getMaxWidth(){return this._container?.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=N.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(e){return this._container&&this._container.classList.add(e),this}removeClassName(e){return this._container&&this._container.classList.remove(e),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){if(this._container)return this._container.classList.toggle(e)}setSubpixelPositioning(e){this.options.subpixelPositioning=e}setPadding(e){this.options.padding=e,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=N.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let e=this._container.querySelector(tC);e&&e.focus()}};function Ig(e){if(!e)return Ig(new E(0,0));if(typeof e=="number"){let t=Math.round(Math.abs(e)/Math.SQRT2);return{center:new E(0,0),top:new E(0,e),"top-left":new E(t,t),"top-right":new E(-t,t),bottom:new E(0,-e),"bottom-left":new E(t,-t),"bottom-right":new E(-t,-t),left:new E(e,0),right:new E(-e,0)}}else if(e instanceof E||Array.isArray(e)){let t=E.convert(e);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}else return{center:E.convert(e.center||[0,0]),top:E.convert(e.top||[0,0]),"top-left":E.convert(e["top-left"]||[0,0]),"top-right":E.convert(e["top-right"]||[0,0]),bottom:E.convert(e.bottom||[0,0]),"bottom-left":E.convert(e["bottom-left"]||[0,0]),"bottom-right":E.convert(e["bottom-right"]||[0,0]),left:E.convert(e.left||[0,0]),right:E.convert(e.right||[0,0])}}function iC(e){return e?{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}:{top:0,right:0,bottom:0,left:0}}const rC=b_;function Cz(e,t){return is().setRTLTextPlugin(e,t)}function Dz(){return is().getRTLTextPluginStatus()}function zz(){return rC}function Rz(){return ln.workerCount}function kz(e){ln.workerCount=e}function Lz(){return Bt.MAX_PARALLEL_IMAGE_REQUESTS}function Fz(e){Bt.MAX_PARALLEL_IMAGE_REQUESTS=e}function Bz(){return Bt.WORKER_URL}function Oz(e){Bt.WORKER_URL=e}async function $z(e){await P_().broadcast("IS",e)}export{lo as AJAXError,FA as AttributionControl,sA as BoxZoomHandler,BS as CanvasSource,DA as CooperativeGesturesHandler,PA as DoubleClickZoomHandler,MA as DragPanHandler,AA as DragRotateHandler,C as EXTENT,$p as EdgeInsets,G as ErrorEvent,Ot as Event,Ze as Evented,Iz as FullscreenControl,fd as FullscreenEvent,XM as GPUInitializationError,RS as GeoJSONSource,Sz as GeolocateControl,YA as GeolocateErrorEvent,Er as GeolocateEvent,pd as GeolocatePositionEvent,Mz as GlobeControl,YM as Hash,gs as ImageSource,wA as KeyboardHandler,W as LngLat,ni as LngLatBounds,BA as LogoControl,wz as Map,mp as MapBoxZoomEvent,Nn as MapContextEvent,Xe as MapLibreEvent,wz as MapLibreMap,Rt as MapMouseEvent,U as MapMovementEvent,HT as MapProjectionEvent,be as MapSourceDataEvent,Gt as MapStyleDataEvent,XT as MapStyleImageMissingEvent,fp as MapStyleLoadEvent,WT as MapTerrainEvent,Bs as MapTouchEvent,qT as MapWheelEvent,cd as Marker,HA as MarkerClickEvent,al as MarkerDragEvent,ye as MercatorCoordinate,Tz as NavigationControl,E as Point,Az as Popup,md as PopupEvent,PS as RasterDEMTileSource,C_ as RasterTileSource,Pz as ScaleControl,SA as ScrollZoomHandler,Hp as Style,Ez as TerrainControl,xA as TwoFingersTouchPitchHandler,vA as TwoFingersTouchRotateHandler,yA as TwoFingersTouchZoomHandler,CA as TwoFingersTouchZoomRotateHandler,SS as VectorTileSource,FS as VideoSource,aC as addProtocol,bz as addSourceType,xz as clearPrewarmedResources,Bt as config,NP as createTileMesh,P_ as getGlobalDispatcher,Lz as getMaxParallelImageRequests,Dz as getRTLTextPluginStatus,zz as getVersion,Rz as getWorkerCount,Bz as getWorkerUrl,$z as importScriptInWorkers,yz as isTimeFrozen,_e as now,vz as prewarm,sC as removeProtocol,gz as restoreNow,Fz as setMaxParallelImageRequests,_z as setNow,Cz as setRTLTextPlugin,kz as setWorkerCount,Oz as setWorkerUrl};
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.