vendor: 16,110 bytes, lines 1-2
1/*! For license information please see 8677.js.LICENSE.txt */ 2"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8677],{8677:function(e,t,i){i.r(t),i.d(t,{default:function(){return rS}});var r=i(761),a=i(6490),n=Object.create,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,h=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,c=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),p=(e,t,i,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var a,n=l(t),h=0,c=n.length;h<c;h++)a=n[h],!u.call(e,a)&&a!==i&&o(e,a,{get:(e=>t[e]).bind(null,a),enumerable:!(r=s(t,a))||r.enumerable});return e};function d(e,t){this.x=e,this.y=t}let f,m;function g(){return f??=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap,f}function _(){if(null==m&&(m=!1,g())){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let t=0;t<25;t++){let i=4*t;e.fillStyle=`rgb(${i},${i+1},${i+2})`,e.fillRect(t%5,Math.floor(t/5),1,1)}let t=e.getImageData(0,0,5,5).data;for(let e=0;e<100;e++)if(e%4!=3&&t[e]!==e){m=!0;break}}}return m||!1}d.prototype={clone(){return new d(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),n=t.y+r*(this.x-t.x)+i*(this.y-t.y);return this.x=a,this.y=n,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:d},d.convert=function(e){if(e instanceof d)return e;if(Array.isArray(e))return new d(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new d(+e.x,+e.y);throw Error("Expected [x, y] or {x, y} point format")};var y=typeof Float32Array<"u"?Float32Array:Array;function v(){var e=new y(9);return y!=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 x(){var e=new y(16);return y!=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 b(e){var t=new y(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 w(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 T(e,t){var i=t[0],r=t[1],a=t[2],n=t[3],o=t[4],s=t[5],l=t[6],h=t[7],u=t[8],c=t[9],p=t[10],d=t[11],f=t[12],m=t[13],g=t[14],_=t[15],y=i*s-r*o,v=i*l-a*o,x=i*h-n*o,b=r*l-a*s,w=r*h-n*s,T=a*h-n*l,S=u*m-c*f,P=u*g-p*f,E=u*_-d*f,C=c*g-p*m,M=c*_-d*m,I=p*_-d*g,A=y*I-v*M+x*C+b*E-w*P+T*S;return A?(A=1/A,e[0]=(s*I-l*M+h*C)*A,e[1]=(a*M-r*I-n*C)*A,e[2]=(m*T-g*w+_*b)*A,e[3]=(p*w-c*T-d*b)*A,e[4]=(l*E-o*I-h*P)*A,e[5]=(i*I-a*E+n*P)*A,e[6]=(g*x-f*T-_*v)*A,e[7]=(u*T-p*x+d*v)*A,e[8]=(o*M-s*E+h*S)*A,e[9]=(r*E-i*M-n*S)*A,e[10]=(f*w-m*x+_*y)*A,e[11]=(c*x-u*w-d*y)*A,e[12]=(s*P-o*C-l*S)*A,e[13]=(i*C-r*P+a*S)*A,e[14]=(m*v-f*b-g*y)*A,e[15]=(u*b-c*v+p*y)*A,e):null}function S(e,t,i){var r=t[0],a=t[1],n=t[2],o=t[3],s=t[4],l=t[5],h=t[6],u=t[7],c=t[8],p=t[9],d=t[10],f=t[11],m=t[12],g=t[13],_=t[14],y=t[15],v=i[0],x=i[1],b=i[2],w=i[3];return e[0]=v*r+x*s+b*c+w*m,e[1]=v*a+x*l+b*p+w*g,e[2]=v*n+x*h+b*d+w*_,e[3]=v*o+x*u+b*f+w*y,v=i[4],x=i[5],b=i[6],w=i[7],e[4]=v*r+x*s+b*c+w*m,e[5]=v*a+x*l+b*p+w*g,e[6]=v*n+x*h+b*d+w*_,e[7]=v*o+x*u+b*f+w*y,v=i[8],x=i[9],b=i[10],w=i[11],e[8]=v*r+x*s+b*c+w*m,e[9]=v*a+x*l+b*p+w*g,e[10]=v*n+x*h+b*d+w*_,e[11]=v*o+x*u+b*f+w*y,v=i[12],x=i[13],b=i[14],w=i[15],e[12]=v*r+x*s+b*c+w*m,e[13]=v*a+x*l+b*p+w*g,e[14]=v*n+x*h+b*d+w*_,e[15]=v*o+x*u+b*f+w*y,e}function P(e,t,i){var r,a,n,o,s,l,h,u,c,p,d,f,m=i[0],g=i[1],_=i[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*_+t[12],e[13]=t[1]*m+t[5]*g+t[9]*_+t[13],e[14]=t[2]*m+t[6]*g+t[10]*_+t[14],e[15]=t[3]*m+t[7]*g+t[11]*_+t[15]):(r=t[0],a=t[1],n=t[2],o=t[3],s=t[4],l=t[5],h=t[6],u=t[7],c=t[8],p=t[9],d=t[10],f=t[11],e[0]=r,e[1]=a,e[2]=n,e[3]=o,e[4]=s,e[5]=l,e[6]=h,e[7]=u,e[8]=c,e[9]=p,e[10]=d,e[11]=f,e[12]=r*m+s*g+c*_+t[12],e[13]=a*m+l*g+p*_+t[13],e[14]=n*m+h*g+d*_+t[14],e[15]=o*m+u*g+f*_+t[15]),e}function E(e,t,i){var r=i[0],a=i[1],n=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]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function C(e,t,i){var r=Math.sin(i),a=Math.cos(i),n=t[4],o=t[5],s=t[6],l=t[7],h=t[8],u=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]=n*a+h*r,e[5]=o*a+u*r,e[6]=s*a+c*r,e[7]=l*a+p*r,e[8]=h*a-n*r,e[9]=u*a-o*r,e[10]=c*a-s*r,e[11]=p*a-l*r,e}function M(e,t,i){var r=Math.sin(i),a=Math.cos(i),n=t[0],o=t[1],s=t[2],l=t[3],h=t[8],u=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]=n*a-h*r,e[1]=o*a-u*r,e[2]=s*a-c*r,e[3]=l*a-p*r,e[8]=n*r+h*a,e[9]=o*r+u*a,e[10]=s*r+c*a,e[11]=l*r+p*a,e}function I(e,t,i){var r=Math.sin(i),a=Math.cos(i),n=t[0],o=t[1],s=t[2],l=t[3],h=t[4],u=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]=n*a+h*r,e[1]=o*a+u*r,e[2]=s*a+c*r,e[3]=l*a+p*r,e[4]=h*a-n*r,e[5]=u*a-o*r,e[6]=c*a-s*r,e[7]=p*a-l*r,e}Math.PI,Math.PI;var A=function(e,t,i,r,a){var n=1/Math.tan(t/2);if(e[0]=n/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=a&&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 z=function(e,t,i,r,a,n,o){var s=1/(t-i),l=1/(r-a),h=1/(n-o);return e[0]=-2*s,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*h,e[11]=0,e[12]=(t+i)*s,e[13]=(a+r)*l,e[14]=(o+n)*h,e[15]=1,e};function k(){var e=new y(3);return y!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function D(e){var t=new y(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function R(e){var t=e[0],i=e[1],r=e[2];return Math.sqrt(t*t+i*i+r*r)}function L(e,t,i){var r=new y(3);return r[0]=e,r[1]=t,r[2]=i,r}function F(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e}function B(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function O(e,t){var i=t[0],r=t[1],a=t[2],n=i*i+r*r+a*a;return n>0&&(n=1/Math.sqrt(n)),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function V(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function j(e,t,i){var r=t[0],a=t[1],n=t[2],o=i[0],s=i[1],l=i[2];return e[0]=a*l-n*s,e[1]=n*o-r*l,e[2]=r*s-a*o,e}function N(e,t,i){var r=i[0],a=i[1],n=i[2],o=i[3],s=t[0],l=t[1],h=t[2],u=a*h-n*l,c=n*s-r*h,p=r*l-a*s;return u+=u,c+=c,p+=p,e[0]=s+o*u+a*p-n*c,e[1]=l+o*c+n*u-r*p,e[2]=h+o*p+r*c-a*u,e}function q(e,t,i,r){var a=[],n=[];return a[0]=t[0]-i[0],a[1]=t[1]-i[1],a[2]=t[2]-i[2],n[0]=a[0],n[1]=a[1]*Math.cos(r)-a[2]*Math.sin(r),n[2]=a[1]*Math.sin(r)+a[2]*Math.cos(r),e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2],e}function U(e,t,i,r){var a=[],n=[];return a[0]=t[0]-i[0],a[1]=t[1]-i[1],a[2]=t[2]-i[2],n[0]=a[2]*Math.sin(r)+a[0]*Math.cos(r),n[1]=a[1],n[2]=a[2]*Math.cos(r)-a[0]*Math.sin(r),e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2],e}function G(e,t,i,r){var a=[],n=[];return a[0]=t[0]-i[0],a[1]=t[1]-i[1],a[2]=t[2]-i[2],n[0]=a[0]*Math.cos(r)-a[1]*Math.sin(r),n[1]=a[0]*Math.sin(r)+a[1]*Math.cos(r),n[2]=a[2],e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2],e}var Z=function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e},W=R;function H(e,t,i){var r=t[0],a=t[1],n=t[2],o=t[3];return e[0]=i[0]*r+i[4]*a+i[8]*n+i[12]*o,e[1]=i[1]*r+i[5]*a+i[9]*n+i[13]*o,e[2]=i[2]*r+i[6]*a+i[10]*n+i[14]*o,e[3]=i[3]*r+i[7]*a+i[11]*n+i[15]*o,e}!function(){var e=k()}();var X=function(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 Y(){var e=new y(4);return y!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function K(e,t,i,r){var a,n,o,s,l=t[0],h=t[1],u=t[2],c=t[3],p=i[0],d=i[1],f=i[2],m=i[3],g=l*p+h*d+u*f+c*m;return g<0&&(g=-g,p=-p,d=-d,f=-f,m=-m),1-g>1e-6?(a=Math.acos(g),n=Math.sin(a),o=Math.sin((1-r)*a)/n,s=Math.sin(r*a)/n):(o=1-r,s=r),e[0]=o*l+s*p,e[1]=o*h+s*d,e[2]=o*u+s*f,e[3]=o*c+s*m,e}function J(e,t,i,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",n=Math.PI/360;t*=n,r*=n,i*=n;var o=Math.sin(t),s=Math.cos(t),l=Math.sin(i),h=Math.cos(i),u=Math.sin(r),c=Math.cos(r);switch(a){case"xyz":e[0]=o*h*c+s*l*u,e[1]=s*l*c-o*h*u,e[2]=s*h*u+o*l*c,e[3]=s*h*c-o*l*u;break;case"xzy":e[0]=o*h*c-s*l*u,e[1]=s*l*c-o*h*u,e[2]=s*h*u+o*l*c,e[3]=s*h*c+o*l*u;break;case"yxz":e[0]=o*h*c+s*l*u,e[1]=s*l*c-o*h*u,e[2]=s*h*u-o*l*c,e[3]=s*h*c+o*l*u;break;case"yzx":e[0]=o*h*c+s*l*u,e[1]=s*l*c+o*h*u,e[2]=s*h*u-o*l*c,e[3]=s*h*c-o*l*u;break;case"zxy":e[0]=o*h*c-s*l*u,e[1]=s*l*c+o*h*u,e[2]=s*h*u+o*l*c,e[3]=s*h*c-o*l*u;break;case"zyx":e[0]=o*h*c-s*l*u,e[1]=s*l*c+o*h*u,e[2]=s*h*u-o*l*c,e[3]=s*h*c+o*l*u;break;default:throw Error("Unknown angle order "+a)}return e}!function(){var e=function(){var e=new y(4);return y!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}()}();function Q(){var e=new y(2);return y!=Float32Array&&(e[0]=0,e[1]=0),e}function ee(e,t){var i=new y(2);return i[0]=e,i[1]=t,i}function te(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e}function ie(e){var t=e[0],i=e[1];return Math.sqrt(t*t+i*i)}function re(e){return e[0]=0,e[1]=0,e}(function(){var e=k(),t=L(1,0,0),i=L(0,1,0)})(),function(){var e=Y(),t=Y()}(),function(){var e=v()}();var ae=function(e){var t=e[0],i=e[1];return t*t+i*i};!function(){var e=Q()}();const ne=8192;function oe(e,t,i){return t*(ne/(e.tileSize*2**(i-e.tileID.overscaledZ)))}function se(e){return e instanceof Error?e:Error("string"==typeof e?e:String(e))}function le(){return new Float64Array(4)}function he(){return new Float64Array(3)}function ue(){return new Float64Array(16)}function ce(){let e=new Float64Array(16);return w(e),e}function pe(){let e=new Float32Array(16);return w(e),e}function de(e,t,i,r,a=!1){if(!i[0]&&!i[1])return[0,0];let n=a?"map"===r?-e.bearingInRadians:0:"viewport"===r?e.bearingInRadians:0;if(n){let e=Math.sin(n),t=Math.cos(n);i=[i[0]*t-i[1]*e,i[0]*e+i[1]*t]}return[a?i[0]:oe(t,i[0],e.zoom),a?i[1]:oe(t,i[1],e.zoom)]}function fe(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]}function me(e,t,i){let r=function(e){var t=e[0],i=e[1],r=e[2],a=e[3],n=e[4],o=e[5],s=e[6],l=e[7],h=e[8];return t*(h*n-o*l)+i*(-h*a+o*s)+r*(l*a-n*s)}([e[0],e[1],e[2],t[0],t[1],t[2],i[0],i[1],i[2]]);if(0===r)return null;let a=j([],[t[0],t[1],t[2]],[i[0],i[1],i[2]]),n=j([],[i[0],i[1],i[2]],[e[0],e[1],e[2]]),o=j([],[e[0],e[1],e[2]],[t[0],t[1],t[2]]),s=B([],a,-e[3]);return F(s,s,B([],n,-t[3])),F(s,s,B([],o,-i[3])),B(s,s,1/r),s}function ge(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 0===a?null:(-r-i[3])/a}function _e(e,t,i,r){let a=Math.sqrt(e*e+t*t),n=Math.sqrt(i*i+r*r),o=(e/=a)*(i/=n)+(t/=a)*(r/=n),s=Math.acos(o);return-t*i+e*r>0?s:-s}function ye(e,t){let i=xe(e,360),r=xe(t,360),a=r-i,n=r>i?a-360:a+360;return Math.abs(a)<Math.abs(n)?a:n}function ve(e,t){let i=xe(e,2*Math.PI),r=xe(t,2*Math.PI);return Math.min(Math.abs(i-r),Math.abs(i-r+2*Math.PI),Math.abs(i-r-2*Math.PI))}function xe(e,t){return(e%t+t)%t}function be(e,t,i,r,a){return we(r,a,Ee((e-t)/(i-t),0,1))}function we(e,t,i){return e*(1-i)+t*i}function Te(e){let t=1/0,i=1/0,r=-1/0,a=-1/0;for(let n of e)t=Math.min(t,n.x),i=Math.min(i,n.y),r=Math.max(r,n.x),a=Math.max(a,n.y);return[t,i,r,a]}function Se(e,t,i,r){return function(e,t,i,r){let a=3*e,n=3*(i-e)-a,o=1-a-n,s=3*t,l=3*(r-t)-s,h=1-s-l;return function(e,t=1e-6){if(e<=0)return 0;if(e>=1)return 1;let i=e;for(let r=0;r<8;r++){let r=((o*i+n)*i+a)*i-e;if(Math.abs(r)<t)return((h*i+l)*i+s)*i;let u=(3*o*i+2*n)*i+a;if(Math.abs(u)<1e-6)break;i-=r/u}let r=0,u=1;i=e;for(let s=0;s<20;s++){let s=((o*i+n)*i+a)*i;if(Math.abs(s-e)<t)break;e>s?r=i:u=i,i=.5*(r+u)}return((h*i+l)*i+s)*i}}(e,t,i,r)}const Pe=Se(.25,.1,.25,1);function Ee(e,t,i){return Math.min(i,Math.max(t,e))}function Ce(e,t,i){let r=i-t,a=((e-t)%r+r)%r+t;return a===t?i:a}function Me(e,...t){for(let i of t)for(let t in i)e[t]=i[t];return e}function Ie(e,t){let i={};for(let r of t)r in e&&(i[r]=e[r]);return i}let Ae=1;function ze(){return Ae++}function ke(e){return 2**e}function De(e){return Math.log(e)/Math.LN2}function Re(e,t,i){if(t<=0)return e;let r=1/t;return void 0===i||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 Le(e,t,i){let r={};for(let a in e)r[a]=t.call(i||this,e[a],a,e);return r}function Fe(e,t,i){let r={};for(let a in e)t.call(i||this,e[a],a,e)&&(r[a]=e[a]);return r}function Be(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(!Be(e[i],t[i]))return!1;return!0}if("object"==typeof e&&e&&null!==t){if("object"!=typeof t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let i in e)if(!Be(e[i],t[i]))return!1;return!0}return e===t}function Oe(e){return Array.isArray(e)?e.map(Oe):"object"==typeof e&&e?Le(e,Oe):e}const Ve={};function je(e){Ve[e]||(typeof console<"u"&&console.warn(e),Ve[e]=!0)}function Ne(e,t,i){return(i.y-e.y)*(t.x-e.x)>(t.y-e.y)*(i.x-e.x)}function qe(e){return typeof WorkerGlobalScope<"u"&&void 0!==e&&e instanceof WorkerGlobalScope}let $e=null;function Ue(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap}const Ge="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";async function Ze(e,t,i,r,a){if(typeof VideoFrame>"u")throw Error("VideoFrame not supported");let n=new VideoFrame(e,{timestamp:0});try{let o=n?.format;if(!o||!o.startsWith("BGR")&&!o.startsWith("RGB"))throw Error(`Unrecognized format ${o}`);let s=o.startsWith("BGR"),l=new Uint8ClampedArray(r*a*4);if(await n.copyTo(l,function(e,t,i,r,a){let n=4*Math.max(-t,0),o=(Math.max(0,i)-i)*r*4+n,s=4*r,l=Math.max(0,t),h=Math.max(0,i);return{rect:{x:l,y:h,width:Math.min(e.width,t+r)-l,height:Math.min(e.height,i+a)-h},layout:[{offset:o,stride:s}]}}(e,t,i,r,a)),s)for(let e=0;e<l.length;e+=4){let t=l[e];l[e]=l[e+2],l[e+2]=t}return l}finally{n.close()}}function We(e,t,i,r){return e.addEventListener(t,i,r),{unsubscribe:()=>{e.removeEventListener(t,i,r)}}}function He(e){return e*Math.PI/180}function Xe(e){return e/Math.PI*180}function Ye(e,t){return e.roll==t.roll&&e.pitch==t.pitch&&e.bearing==t.bearing}function Ke(e,t,i){let r=ee(t.x-i.x,t.y-i.y),a=ee(e.x-i.x,e.y-i.y),n=r[0]*a[1]-r[1]*a[0];return Xe(Math.atan2(n,function(e,t){return e[0]*t[0]+e[1]*t[1]}(r,a)))}function Je(e,t,i){let r=new Float64Array(4);return J(r,e,t-90,i),r}const Qe=85.051129,et={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0}
vendor: 5,070 bytes, line 2
2,tt={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0};function it(e,t){return et[t]&&"touches"in e}function rt(e,t){if(!tt[t])return!1;let i=e,r=(i?.target)?.ownerDocument?.defaultView||window;return i instanceof r.MouseEvent||i instanceof r.WheelEvent}function at(e){return et[e]||tt[e]}const nt="AbortError";var ot=class extends Error{constructor(e=nt){super(e instanceof Error?e.message:e),this.name=nt,e instanceof Error&&e.stack&&(this.stack=e.stack)}};function st(e){return e instanceof Error&&"AbortError"===e.name}function lt(e){if(e.aborted)throw new ot(e.reason)}const ht={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function ut(e){return ht.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))]}const ct="global-dispatcher";var pt=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 dt(){if(qe(self))return self.worker?.referrer;if("blob:"===window.location.protocol)try{return window.parent.location.href}catch{}return window.location.href}const ft=async function(e,t){if(e.url.includes("://")&&!/^https?:|^file:/.test(e.url)){let i=ut(e.url);if(i){let r=await i(e,t);return r.data||"arrayBuffer"!==e.type?r:Me(r,{data:new ArrayBuffer(0)})}if(qe(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:e,targetMapId:ct},t)}if(!(e=>e.startsWith("file:")||dt()?.startsWith("file:")&&!/^\w+:/.test(e))(e.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return async function(e,t){let i,r,a=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:dt(),referrerPolicy:e.referrerPolicy,signal:t.signal});"json"===e.type&&!a.headers.has("Accept")&&a.headers.set("Accept","application/json");try{i=await fetch(a)}catch(t){throw st(t)?t:new pt(0,se(t).message,e.url,new Blob)}if(!i.ok){let t=await i.blob();throw new pt(i.status,i.statusText,e.url,t)}r="arrayBuffer"===e.type||"image"===e.type?i.arrayBuffer():"json"===e.type?i.json():i.text();let n=await r;return lt(t.signal),{data:n,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires"),etag:i.headers.get("ETag")}}(e,t);if(qe(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:e,mustQueue:!0,targetMapId:ct},t)}return function(e,t){return new Promise(((i,r)=>{let a=new XMLHttpRequest;a.open(e.method||"GET",e.url,!0),("arrayBuffer"===e.type||"image"===e.type)&&(a.responseType="arraybuffer");for(let t in e.headers)a.setRequestHeader(t,e.headers[t]);"json"===e.type&&(a.responseType="text",e.headers?.Accept||a.setRequestHeader("Accept","application/json")),a.withCredentials="include"===e.credentials,a.onerror=()=>{r(Error(a.statusText))},a.onload=()=>{if(!t.signal.aborted)if((a.status>=200&&a.status<300||0===a.status)&&null!==a.response){let t=a.response;if("json"===e.type)try{t=JSON.parse(a.response)}catch(e){return void r(e)}i({data:t,cacheControl:a.getResponseHeader("Cache-Control"),expires:a.getResponseHeader("Expires"),etag:a.getResponseHeader("ETag")})}else{let t=new Blob([a.response],{type:a.getResponseHeader("Content-Type")});r(new pt(a.status,a.statusText,e.url,t))}},t.signal.addEventListener("abort",(()=>{a.abort(),r(new ot(t.signal.reason))})),a.send(e.body)}))}(e,t)},mt=(e,t)=>ft(Me(e,{type:"json"}),t);function gt(e){if(!e||e.startsWith("data:image/"))return!0;if(e.startsWith("blob:")&&(e=e.slice(5)).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}function _t(e,t,i){i[e]?.includes(t)||(i[e]||=[],i[e].push(t))}function yt(e,t,i){if(i?.[e]){let r=i[e].indexOf(t);-1!==r&&i[e].splice(r,1)}}var vt=class{constructor(e,t={}){Me(this,t),this.type=e}},xt=class extends vt{constructor(e,t={}){super("error",Me({error:e},t))}},bt=class{on(e,t){return this._listeners||={},_t(e,t,this._listeners),{unsubscribe:()=>{this.off(e,t)}}}off(e,t){return yt(e,t,this._listeners),yt(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners||={},_t(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){"string"==typeof e&&(e=new vt(e,t||{}));let i=e.type;if(this.listens(i)){e.target=this;let t=this._listeners?.[i]?this._listeners[i].slice():[];for(let i of t)i.call(this,e);let r=this._oneTimeListeners?.[i]?this._oneTimeListeners[i].slice():[];for(let t of r)yt(i,t,this._oneTimeListeners),t.call(this,e);let a=this._eventedParent;a&&(Me(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),a.fire(e))}else e instanceof xt&&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}};
vendor: 14,615 bytes, line 2
2const wt={$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 2
2"],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"}]}}}}}
2,Tt=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function St(e,t){let i={};for(let t in e)"ref"!==t&&(i[t]=e[t]);return Tt.forEach((e=>{e in t&&(i[e]=t[e])})),i}function Pt(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]=St(e[i],t[e[i].ref]));return e}function Et(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(!Et(e[i],t[i]))return!1;return!0}if("object"==typeof e&&e&&null!==t){if("object"!=typeof t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let i in e)if(!Et(e[i],t[i]))return!1;return!0}return e===t}function Ct(e,t){e.push(t)}function Mt(e,t,i){Ct(i,{command:"addSource",args:[e,t[e]]})}function It(e,t,i){Ct(t,{command:"removeSource",args:[e]}),i[e]=!0}function At(e,t,i,r){It(e,i,r),Mt(e,t,i)}function zt(e,t,i){let r;for(r in e[i])if(Object.prototype.hasOwnProperty.call(e[i],r)&&"data"!==r&&!Et(e[i][r],t[i][r]))return!1;for(r in t[i])if(Object.prototype.hasOwnProperty.call(t[i],r)&&"data"!==r&&!Et(e[i][r],t[i][r]))return!1;return!0}function kt(e,t,i,r,a,n){e||={},t||={};for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(Et(e[o],t[o])||i.push({command:n,args:[r,o,t[o],a]}));for(let o in t)!Object.prototype.hasOwnProperty.call(t,o)||Object.prototype.hasOwnProperty.call(e,o)||Et(e[o],t[o])||i.push({command:n,args:[r,o,t[o],a]})}function Dt(e){return e.id}function Rt(e,t){return e[t.id]=t,e}function Lt(e,t){if(!e)return[{command:"setStyle",args:[t]}];let i=[];try{if(!Et(e.version,t.version))return[{command:"setStyle",args:[t]}];Et(e.center,t.center)||i.push({command:"setCenter",args:[t.center]}
vendor: 5,494 bytes, line 2
2),Et(e.state,t.state)||i.push({command:"setGlobalState",args:[t.state]}),Et(e.centerAltitude,t.centerAltitude)||i.push({command:"setCenterAltitude",args:[t.centerAltitude]}),Et(e.zoom,t.zoom)||i.push({command:"setZoom",args:[t.zoom]}),Et(e.bearing,t.bearing)||i.push({command:"setBearing",args:[t.bearing]}),Et(e.pitch,t.pitch)||i.push({command:"setPitch",args:[t.pitch]}),Et(e.roll,t.roll)||i.push({command:"setRoll",args:[t.roll]}),Et(e.sprite,t.sprite)||i.push({command:"setSprite",args:[t.sprite]}),Et(e.glyphs,t.glyphs)||i.push({command:"setGlyphs",args:[t.glyphs]}),Et(e.transition,t.transition)||i.push({command:"setTransition",args:[t.transition]}),Et(e.light,t.light)||i.push({command:"setLight",args:[t.light]}),Et(e.terrain,t.terrain)||i.push({command:"setTerrain",args:[t.terrain]}),Et(e.sky,t.sky)||i.push({command:"setSky",args:[t.sky]}),Et(e.projection,t.projection)||i.push({command:"setProjection",args:[t.projection]});let r={},a=[];!function(e,t,i,r){let a;for(a in e||={},t||={},e)Object.prototype.hasOwnProperty.call(e,a)&&(Object.prototype.hasOwnProperty.call(t,a)||It(a,i,r));for(a in t)Object.prototype.hasOwnProperty.call(t,a)&&(Object.prototype.hasOwnProperty.call(e,a)?Et(e[a],t[a])||("geojson"===e[a].type&&"geojson"===t[a].type&&zt(e,t,a)?Ct(i,{command:"setGeoJSONSourceData",args:[a,t[a].data]}):At(a,t,i,r)):Mt(a,t,i))}(e.sources,t.sources,a,r);let n=[];e.layers&&e.layers.forEach((e=>{"source"in e&&r[e.source]?i.push({command:"removeLayer",args:[e.id]}):n.push(e)})),i=i.concat(a),function(e,t,i){e||=[],t||=[];let r,a,n,o,s,l=e.map(Dt),h=t.map(Dt),u=e.reduce(Rt,{}),c=t.reduce(Rt,{}),p=l.slice(),d=Object.create(null);for(let e=0,t=0;e<l.length;e++)r=l[e],Object.prototype.hasOwnProperty.call(c,r)?t++:(Ct(i,{command:"removeLayer",args:[r]}),p.splice(p.indexOf(r,t),1));for(let e=0,t=0;e<h.length;e++)r=h[h.length-1-e],p[p.length-1-e]!==r&&(Object.prototype.hasOwnProperty.call(u,r)?(Ct(i,{command:"removeLayer",args:[r]}),p.splice(p.lastIndexOf(r,p.length-t),1)):t++,o=p[p.length-e],Ct(i,{command:"addLayer",args:[c[r],o]}),p.splice(p.length-e,0,r),d[r]=!0);for(let e=0;e<h.length;e++)if(r=h[e],a=u[r],n=c[r],!d[r]&&!Et(a,n)){if(!Et(a.source,n.source)||!Et(a["source-layer"],n["source-layer"])||!Et(a.type,n.type)){Ct(i,{command:"removeLayer",args:[r]}),o=p[p.lastIndexOf(r)+1],Ct(i,{command:"addLayer",args:[n,o]});continue}for(s in kt(a.layout,n.layout,i,r,null,"setLayoutProperty"),kt(a.paint,n.paint,i,r,null,"setPaintProperty"),Et(a.filter,n.filter)||Ct(i,{command:"setFilter",args:[r,n.filter]}),(!Et(a.minzoom,n.minzoom)||!Et(a.maxzoom,n.maxzoom))&&Ct(i,{command:"setLayerZoomRange",args:[r,n.minzoom,n.maxzoom]}),a)Object.prototype.hasOwnProperty.call(a,s)&&"layout"!==s&&"paint"!==s&&"filter"!==s&&"metadata"!==s&&"minzoom"!==s&&"maxzoom"!==s&&(0===s.indexOf("paint.")?kt(a[s],n[s],i,r,s.slice(6),"setPaintProperty"):Et(a[s],n[s])||Ct(i,{command:"setLayerProperty",args:[r,s,n[s]]}));for(s in n)!Object.prototype.hasOwnProperty.call(n,s)||Object.prototype.hasOwnProperty.call(a,s)||"layout"!==s&&"paint"!==s&&"filter"!==s&&"metadata"!==s&&"minzoom"!==s&&"maxzoom"!==s&&(0===s.indexOf("paint.")?kt(a[s],n[s],i,r,s.slice(6),"setPaintProperty"):Et(a[s],n[s])||Ct(i,{command:"setLayerProperty",args:[r,s,n[s]]}))}}(n,t.layers,i)}catch(e){console.warn("Unable to compute style diff:",e),i=[{command:"setStyle",args:[t]}]}return i}var Ft=class{constructor(e,t,i,r,a="error"){this.message=(e?`${e}: `:"")+i,r&&(this.identifier=r),this.severity=a,null!=t&&t.__line__&&(this.line=t.__line__)}},Bt=class extends Error{constructor(e,t){super(t),this.message=t,this.key=e}},Ot=class e{constructor(e,t=[]){this.parent=e,this.bindings={};for(let[e,i]of t)this.bindings[e]=i}concat(t){return new e(this,t)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}};const Vt={kind:"null"},jt={kind:"number"},Nt={kind:"string"},qt={kind:"boolean"},$t={kind:"color"},Ut={kind:"projectionDefinition"},Gt={kind:"object"},Zt={kind:"value"},Wt={kind:"error"},Ht={kind:"collator"},Xt={kind:"formatted"},Yt={kind:"padding"},Kt={kind:"colorArray"},Jt={kind:"numberArray"},Qt={kind:"resolvedImage"},ei={kind:"variableAnchorOffsetCollection"};function ti(e,t){return{kind:"array",itemType:e,N:t}}function ii(e){if("array"===e.kind){let t=ii(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const ri=[Vt,jt,Nt,qt,$t,Ut,Xt,Gt,ti(Zt),Yt,Jt,Kt,Qt,ei];function ai(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!ai(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(let e of ri)if(!ai(e,t))return null}return`Expected ${ii(e)} but found ${ii(t)} instead.`}function ni(e,t){return t.some((t=>t.kind===e.kind))}function oi(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}function si(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}const li=.96422,hi=.82521,ui=4/29,ci=6/29,pi=3*ci*ci,di=Math.PI/180,fi=180/Math.PI;function mi(e){return(e%=360)<0&&(e+=360),e}function gi([e,t,i,r]){let a,n,o=yi((.2225045*(e=_i(e))+.7168786*(t=_i(t))+.0606169*(i=_i(i)))/1);
vendor: 4,633 bytes, line 2
2e===t&&t===i?a=n=o:(a=yi((.4360747*e+.3850649*t+.1430804*i)/li),n=yi((.0139322*e+.0971045*t+.7141733*i)/hi));let s=116*o-16;return[s<0?0:s,500*(a-o),200*(o-n),r]}function _i(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function yi(e){return e>.008856451679035631?e**(1/3):e/pi+ui}function vi([e,t,i,r]){let a=(e+16)/116,n=isNaN(t)?a:a+t/500,o=isNaN(i)?a:a-i/200;return a=1*bi(a),n=li*bi(n),o=hi*bi(o),[xi(3.1338561*n-1.6168667*a-.4906146*o),xi(-.9787684*n+1.9161415*a+.033454*o),xi(.0719453*n-.2289914*a+1.4052427*o),r]}function xi(e){return(e=e<=.00304?12.92*e:1.055*e**(1/2.4)-.055)<0?0:e>1?1:e}function bi(e){return e>ci?e*e*e:pi*(e-ui)}const wi=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function Ti(e,t){return wi(e,t)?e[t]:void 0}function Si(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];let t=Ti(Ii,e);if(t){let[e,i,r]=t;return[e/255,i/255,r/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let t=e.length<6?1:2,i=1;return[Pi(e.slice(i,i+=t)),Pi(e.slice(i,i+=t)),Pi(e.slice(i,i+=t)),Pi(e.slice(i,i+t)||"ff")]}if(e.startsWith("rgb")){let t=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){let[e,i,r,a,n,o,s,l,h,u,c,p]=t,d=[a||" ",s||" ",u].join("");if(" "===d||" /"===d||",,"===d||",,,"===d){let e=[r,o,h].join(""),t="%%%"===e?100:""===e?255:0;if(t){let e=[Ci(+i/t,0,1),Ci(+n/t,0,1),Ci(+l/t,0,1),c?Ei(+c,p):1];if(Mi(e))return e}}return}}let i=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){let[e,t,r,a,n,o,s,l,h]=i,u=[r||" ",n||" ",s].join("");if(" "===u||" /"===u||",,"===u||",,,"===u){let e=[+t,Ci(+a,0,100),Ci(+o,0,100),l?Ei(+l,h):1];if(Mi(e))return function([e,t,i,r]){function a(r){let a=(r+e/30)%12,n=t*Math.min(i,1-i);return i-n*Math.max(-1,Math.min(a-3,9-a,1))}return e=mi(e),t/=100,i/=100,[a(0),a(8),a(4),r]}(e)}}}function Pi(e){return parseInt(e.padEnd(2,e),16)/255}function Ei(e,t){return Ci(t?e/100:e,0,1)}function Ci(e,t,i){return Math.min(Math.max(t,e),i)}function Mi(e){return!e.some(Number.isNaN)}const Ii={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,569 bytes, line 2
2ive:[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 Ai(e,t,i){return e+i*(t-e)}function zi(e,t,i){return e.map(((e,r)=>Ai(e,t[r],i)))}var ki=class e{constructor(e,t,i,r=1,a=!0){this.r=e,this.g=t,this.b=i,this.a=r,a||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter("rgb",[e,t,i,r]))}static{this.black=new e(0,0,0,1)}static{this.white=new e(1,1,1,1)}static{this.transparent=new e(0,0,0,0)}static{this.red=new e(1,0,0,1)}static parse(t){if(t instanceof e)return t;if("string"!=typeof t)return;let i=Si(t);return i?new e(...i,!1):void 0}get rgb(){let{r:e,g:t,b:i,a:r}=this,a=r||1/0;return this.overwriteGetter("rgb",[e/a,t/a,i/a,r])}get hcl(){return this.overwriteGetter("hcl",function(e){let[t,i,r,a]=gi(e),n=Math.sqrt(i*i+r*r);return[Math.round(1e4*n)?mi(Math.atan2(r,i)*fi):NaN,n,t,a]}(this.rgb))}get lab(){return this.overwriteGetter("lab",gi(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,i,r]=this.rgb;return`rgba(${[e,t,i].map((e=>Math.round(255*e))).join(",")},${r})`}static interpolate(t,i,r,a="rgb"){switch(a){case"rgb":{let[a,n,o,s]=zi(t.rgb,i.rgb,r);return new e(a,n,o,s,!1)}case"hcl":{let a,n,[o,s,l,h]=t.hcl,[u,c,p,d]=i.hcl;if(isNaN(o)||isNaN(u))isNaN(o)?isNaN(u)?a=NaN:(a=u,(1===l||0===l)&&(n=c)):(a=o,(1===p||0===p)&&(n=s));else{let e=u-o;u>o&&e>180?e-=360:u<o&&o-u>180&&(e+=360),a=o+r*e}let[f,m,g,_]=function([e,t,i,r]){return e=isNaN(e)?0:e*di,vi([i,Math.cos(e)*t,Math.sin(e)*t,r])}([a,n??Ai(s,c,r),Ai(l,p,r),Ai(h,d,r)]);return new e(f,m,g,_,!1)}case"lab":{let[a,n,o,s]=vi(zi(t.lab,i.lab,r));return new e(a,n,o,s,!1)}}}},Di=class{constructor(e,t,i){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}};const Ri=["bottom","center","top"];var Li=class{constructor(e,t,i,r,a,n){this.text=e,this.image=t,this.scale=i,this.fontStack=r,this.textColor=a,this.verticalAlign=n}},Fi=class e{constructor(e){this.sections=e}static fromString(t){return new e([new Li(t,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(t){return t instanceof e?t:e.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}},Bi=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if("number"==typeof t)return new e([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let e of t)if("number"!=typeof e)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]]}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,i,r){return new e(zi(t.values,i.values,r))}},Oi=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if("number"==typeof t)return new e([t]);if(Array.isArray(t)){for(let e of t)if("number"!=typeof e)return;return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,i,r){return new e(zi(t.values,i.values,r))}},Vi=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if("string"==typeof t){let i=ki.parse(t);return i?new e([i]):void 0}if(!Array.isArray(t))return;let i=[];for(let e of t){if("string"!=typeof e)return;let t=ki.parse(e);if(!t)return;i.push(t)}return new e(i)}toString(){return JSON.stringify(this.values)}static interpolate(t,i,r,a="rgb"){let n=[];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 e=0;e<t.values.length;e++)n.push(ki.interpolate(t.values[e],i.values[e],r,a));return new e(n)}},ji=class extends Error{constructor(e,t){super(e),this.name="RuntimeError",this.path=t}toJSON(){return this.message}};const Ni=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);var qi=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let e=0;e<t.length;e+=2){let i=t[e],r=t[e+1];if("string"!=typeof i||!Ni.has(i)||!Array.isArray(r)||2!==r.length||"number"!=typeof r[0]||"number"!=typeof r[1])return}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,i,r,a){let n=t.values,o=i.values;if(n.length!==o.length)throw new ji(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${i.toString()}`,a);let s=[];for(let e=0;e<n.length;e+=2){if(n[e]!==o[e])throw new ji(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${n[e]}, to[${e}]: ${o[e]}`,a);s.push(n[e]);let[t,i]=n[e+1],[l,h]=o[e+1];s.push([Ai(t,l,r),Ai(i,h,r)])}return new e(s)}},$i=class e{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(t){return t?new e({name:t,available:!1}):null}},Ui=class e{constructor(e,t,i){this.from=e,this.to=t,this.transition=i}toString(){return this.from===this.to&&1===this.transition?this.from:JSON.stringify([this.from,this.to,this.transition])}static interpolate(t,i,r){return new e(t,i,r)}static parse(t){return t instanceof e?t:Array.isArray(t)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]&&"number"==typeof t[2]?new e(t[0],t[1],t[2]):"object"==typeof t&&"string"==typeof t.from&&"string"==typeof t.to&&"number"==typeof t.transition?new e(t.from,t.to,t.transition):"string"==typeof t?new e(t,t,1):void 0}};function Gi(e,t,i,r){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:`Invalid rgba value [${[e,t,i,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof r?[e,t,i,r]:[e,t,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Zi(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof Ui||e instanceof ki||e instanceof Di||e instanceof Fi||e instanceof Bi||e instanceof Oi||e instanceof Vi||e instanceof qi||e instanceof $i)return!0;if(Array.isArray(e)){for(let t of e)if(!Zi(t))return!1;return!0}if("object"==typeof e){for(let t in e)if(!Zi(e[t]))return!1;return!0}return!1}function Wi(e){if(null===e)return Vt;if("string"==typeof e)return Nt;if("boolean"==typeof e)return qt;if("number"==typeof e)return jt;if(e instanceof ki)return $t;if(e instanceof Ui)return Ut;if(e instanceof Di)return Ht;if(e instanceof Fi)return Xt;if(e instanceof Bi)return Yt;if(e instanceof Oi)return Jt;if(e instanceof Vi)return Kt;if(e instanceof qi)return ei;if(e instanceof $i)return Qt;if(Array.isArray(e)){let t,i=e.length;for(let i of e){let e=Wi(i);if(t){if(t===e)continue;t=Zt;break}t=e}return ti(t||Zt,i)}return Gt}function Hi(e){let t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof ki||e instanceof Ui||e instanceof Fi||e instanceof Bi||e instanceof Oi||e instanceof Vi||e instanceof qi||e instanceof $i?e.toString():JSON.stringify(e)}var Xi=class e{constructor(e,t){this.type=e,this.value=t}static parse(t,i){if(2!==t.length)return i.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Zi(t[1]))return i.error("invalid value");let r=t[1],a=Wi(r),n=i.expectedType;return"array"===a.kind&&0===a.N&&n&&"array"===n.kind&&("number"!=typeof n.N||0===n.N)&&(a=n),new e(a,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}};const Yi={string:Nt,number:jt,boolean:qt,object:Gt};var Ki=class e{constructor(e,t,i){this.type=e,this.args=t,this.key=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let r,a=1,n=t[0];if("array"===n){let e,n;if(t.length>2){let r=t[1];if("string"!=typeof r||!(r in Yi)||"object"===r)return i.error('The item type argument of "array" must be one of string, number, boolean',1);e=Yi[r],a++}else e=Zt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return i.error('The length argument to "array" must be a positive integer literal',2);n=t[2],a++}r=ti(e,n)}else{if(!Yi[n])throw Error(`Types doesn't contain name = ${n}`);r=Yi[n]}let o=[];for(;a<t.length;a++){let e=i.parse(t[a],a,Zt);if(!e)return null;o.push(e)}return new e(r,o,i.key)}evaluate(e){for(let t=0;t<this.args.length;t++){let i=this.args[t].evaluate(e);
vendor: 8,158 bytes, line 2
2if(!ai(this.type,Wi(i)))return i;if(t===this.args.length-1)throw new ji(`Expected value to be of type ${ii(this.type)}, but found ${ii(Wi(i))} instead.`,this.key)}throw Error()}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}};const Ji={"to-boolean":qt,"to-color":$t,"to-number":jt,"to-string":Nt};var Qi=class e{constructor(e,t,i){this.type=e,this.args=t,this.key=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let r=t[0];if(!Ji[r])throw Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return i.error("Expected one argument.");let a=Ji[r],n=[];for(let e=1;e<t.length;e++){let r=i.parse(t[e],e,Zt);if(!r)return null;n.push(r)}return new e(a,n,i.key)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let t,i;for(let r of this.args){if(t=r.evaluate(e),i=null,t instanceof ki)return t;if("string"==typeof t){let i=e.parseColor(t);if(i)return i}else if(Array.isArray(t)&&(i=t.length<3||t.length>4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:Gi(t[0],t[1],t[2],t[3]),!i))return new ki(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new ji(i||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"padding":{let t;for(let i of this.args){t=i.evaluate(e);let r=Bi.parse(t);if(r)return r}throw new ji(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"numberArray":{let t;for(let i of this.args){t=i.evaluate(e);let r=Oi.parse(t);if(r)return r}throw new ji(`Could not parse numberArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"colorArray":{let t;for(let i of this.args){t=i.evaluate(e);let r=Vi.parse(t);if(r)return r}throw new ji(`Could not parse colorArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"variableAnchorOffsetCollection":{let t;for(let i of this.args){t=i.evaluate(e);let r=qi.parse(t);if(r)return r}throw new ji(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"number":{let t=null;for(let i of this.args){if(t=i.evaluate(e),null===t)return 0;let r=Number(t);if(!isNaN(r))return r}throw new ji(`Could not convert ${JSON.stringify(t)} to number.`,this.key)}case"formatted":return Fi.fromString(Hi(this.args[0].evaluate(e)));case"resolvedImage":return $i.fromString(Hi(this.args[0].evaluate(e)));case"projectionDefinition":{let t=this.args[0].evaluate(e);if(Ui.parse(t))return t;throw new ji(`Could not parse projectionDefinition from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}default:return Hi(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}};const er=["Unknown","Point","LineString","Polygon"];var tr=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?"number"==typeof this.feature.type?er[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(e){let t=this._parseColorCache.get(e);return t||(t=ki.parse(e),this._parseColorCache.set(e,t)),t}},ir=class e{constructor(e,t,i=[],r,a=new Ot,n=[]){this.registry=e,this.path=i,this.key=i.map((e=>`[${e}]`)).join(""),this.scope=a,this.errors=n,this.expectedType=r,this._isConstant=t}parse(e,t,i,r,a={}){return t?this.concat(t,i,r)._parse(e,a):this._parse(e,a)}_parse(e,t){(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e)&&(e=["literal",e]);let i=this.key;function r(e,t,r){return"assert"===r?new Ki(t,[e],i):"coerce"===r?new Qi(t,[e],i):e}if(Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let i=e[0];if("string"!=typeof i)return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let a=this.registry[i];if(a){let i=a.parse(e,this);if(!i)return null;if(this.expectedType){let e=this.expectedType,a=i.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==a.kind){if("projectionDefinition"===e.kind&&["string","array","value"].includes(a.kind)||["color","formatted","resolvedImage"].includes(e.kind)&&["value","string"].includes(a.kind)||["padding","numberArray"].includes(e.kind)&&["value","number","array"].includes(a.kind)||"colorArray"===e.kind&&["value","string","array"].includes(a.kind)||"variableAnchorOffsetCollection"===e.kind&&["value","array"].includes(a.kind))i=r(i,e,t.typeAnnotation||"coerce");else if(this.checkSubtype(e,a))return null}else i=r(i,e,t.typeAnnotation||"assert")}if(!(i instanceof Xi)&&"resolvedImage"!==i.type.kind&&this._isConstant(i)){let t=new tr;try{i=new Xi(i.type,i.evaluate(t))}catch(e){return this.error(e.message),null}}return i}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(t,i,r){let a="number"==typeof t?this.path.concat(t):this.path,n=r?this.scope.concat(r):this.scope;return new e(this.registry,this._isConstant,a,i||null,n,this.errors)}error(e,...t){let i=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new Bt(i,e))}checkSubtype(e,t){let i=ai(e,t);return i&&this.error(i),i}},rr=class e{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let t of this.bindings)e(t[1]);e(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 e=1;e<t.length-1;e+=2){let a=t[e];if("string"!=typeof a)return i.error(`Expected string, but found ${typeof a} instead.`,e);if(/[^a-zA-Z0-9_]/.test(a))return i.error("Variable names must contain only alphanumeric characters or '_'.",e);let n=i.parse(t[e+1],e+1);if(!n)return null;r.push([a,n])}let a=i.parse(t[t.length-1],t.length-1,i.expectedType,r);return a?new e(r,a):null}outputDefined(){return this.result.outputDefined()}},ar=class e{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(t,i){if(2!==t.length||"string"!=typeof t[1])return i.error("'var' expression requires exactly one string literal argument.");let r=t[1];return i.scope.has(r)?new e(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(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}};function nr(e,t,i){let r,a,n=e.length-1,o=0,s=n,l=0;for(;o<=s;)if(l=Math.floor((o+s)/2),r=e[l],a=e[l+1],r<=t){if(l===n||t<a)return l;o=l+1}else{if(!(r>t))throw new ji("Input is not a number.",i);s=l-1}return 0}var or=class e{constructor(e,t,i,r){this.type=e,this.input=t,this.key=r,this.labels=[],this.outputs=[];for(let[e,t]of i)this.labels.push(e),this.outputs.push(t)}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,jt);if(!r)return null;let a=[],n=null;i.expectedType&&"value"!==i.expectedType.kind&&(n=i.expectedType);for(let e=1;e<t.length;e+=2){let r=1===e?-1/0:t[e],o=t[e+1],s=e,l=e+1;if("number"!=typeof r)return i.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not c
2omputed expressions) for the input values.',s);if(a.length&&a[a.length-1][0]>=r)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);let h=i.parse(o,l,n);if(!h)return null;n||=h.type,a.push([r,h])}return new e(n,r,a,i.key)}evaluate(e){let t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);let r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);let a=t.length;return r>=t[a-1]?i[a-1].evaluate(e):i[nr(t,r,this.key)].evaluate(e)}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}};var sr=class e{constructor(e,t,i,r,a,n){this.type=e,this.operator=t,this.interpolation=i,this.input=r,this.key=n,this.labels=[],this.outputs=[];for(let[e,t]of a)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,i,r){let a=0;if("exponential"===e.name)a=lr(t,e.base,i,r);else if("linear"===e.name)a=lr(t,1,i,r);else if("cubic-bezier"===e.name){let n=e.controlPoints;a=function(e,t,i,r){let a=3*e,n=3*(i-e)-a,o=1-a-n,s=3*t,l=3*(r-t)-s,h=1-s-l;return function(e,t=1e-6){if(e<=0)return 0;if(e>=1)return 1;let i=e;for(let r=0;r<8;r++){let r=((o*i+n)*i+a)*i-e;if(Math.abs(r)<t)return((h*i+l)*i+s)*i;let u=(3*o*i+2*n)*i+a;if(Math.abs(u)<1e-6)break;i-=r/u}let r=0,u=1;i=e;for(let s=0;s<20;s++){let s=((o*i+n)*i+a)*i;if(Math.abs(s-e)<t)break;e>s?r=i:u=i,i=.5*(r+u)}return((h*i+l)*i+s)*i}}(n[0],n[1],n[2],n[3])(lr(t,1,i,r))}return a}static parse(t,i){let[r,a,n,...o]=t;if(!Array.isArray(a)||0===a.length)return i.error("Expected an interpolation type expression.",1);if("linear"===a[0])a={name:"linear"};else if("exponential"===a[0]){let e=a[1];if("number"!=typeof e)return i.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:e}}else{if("cubic-bezier"!==a[0])return i.error(`Unknown interpolation type ${String(a[0])}`,1,0);{let e=a.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:e}}}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(n=i.parse(n,2,jt),!n)return null;let s=[],l=null;"interpolate-hcl"!==r&&"interpolate-lab"!==r||i.expectedType==Kt?i.expectedType&&"value"!==i.expectedType.kind&&(l=i.expectedType):l=$t;for(let e=0;e<o.length;e+=2){let t=o[e],r=o[e+1],a=e+3,n=e+4;if("number"!=typeof t)return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(s.length&&s[s.length-1][0]>=t)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',a);let h=i.parse(r,n,l);if(!h)return null;l||=h.type,s.push([t,h])}return si(l,jt)||si(l,Ut)||si(l,$t)||si(l,Yt)||si(l,Jt)||si(l,Kt)||si(l,ei)||si(l,ti(jt))?new e(l,r,a,n,s,i.key):i.error(`Type ${ii(l)} is not interpolatable.`)}evaluate(t){let i=this.labels,r=this.outputs;if(1===i.length)return r[0].evaluate(t);let a=this.input.evaluate(t);if(a<=i[0])return r[0].evaluate(t);let n=i.length;if(a>=i[n-1])return r[n-1].evaluate(t);let o=nr(i,a,this.key),s=i[o],l=i[o+1],h=e.interpolationFactor(this.interpolation,a,s,l),u=r[o].evaluate(t),c=r[o+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Ai(u,c,h);case"color":return ki.interpolate(u,c,h);case"padding":return Bi.interpolate(u,c,h);case"colorArray":return Vi.interpolate(u,c,h);case"numberArray":return Oi.interpolate(u,c,h);case"variableAnchorOffsetCollection":return qi.interpolate(u,c,h,this.key);case"array":return zi(u,c,h);case"projectionDefinition":return Ui.interpolate(u,c,h)}case"interpolate-hcl":switch(this.type.kind){case"color":return ki.interpolate(u,c,h,"hcl");case"colorArray":return Vi.interpolate(u,c,h,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return ki.interpolate(u,c,h,"lab");case"colorArray":return Vi.interpolate(u,c,h,"lab")}}}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}};function lr(e,t,i,r){let a=r-i,n=e-i;return 0===a?0:1===t?n/a:(t**+n-1)/(t**+a-1)}const hr={color:ki.interpolate,number:Ai,padding:Bi.interpolate,numberArray:Oi.interpolate,colorArray:Vi.interpolate,variableAnchorOffsetCollection:qi.interpolate,array:zi};var ur=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let r=null,a=i.expectedType;a&&"value"!==a.kind&&(r=a);let n=[];for(let e of t.slice(1)){let t=i.parse(e,1+n.length,r,void 0,{typeAnnotation:"omit"});if(!t)return null;r||=t.type,n.push(t)}if(!r)throw Error("No output type");return a&&n.some((e=>ai(a,e.type)))?new e(Zt,n):new e(r,n)}evaluate(e){let t,i=null,r=0;for(let a of this.args)if(r++,i=a.evaluate(e),i&&i instanceof $i&&!i.available&&(t||=i.name,i=null,r===this.args.length&&(i=t)),null!==i)break;return i}
vendor: 5,633 bytes, line 2
2eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}};function cr(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function pr(e,t,i,r){return 0===r.compare(t,i)}function dr(e,t,i){let r="=="!==e&&"!="!==e;return class a{constructor(e,t,i,r){this.lhs=e,this.rhs=t,this.key=i,this.collator=r,this.type=qt,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");let i=e[0],n=t.parse(e[1],1,Zt);if(!n)return null;if(!cr(i,n.type))return t.concat(1).error(`"${i}" comparisons are not supported for type '${ii(n.type)}'.`);let o=t.parse(e[2],2,Zt);if(!o)return null;if(!cr(i,o.type))return t.concat(2).error(`"${i}" comparisons are not supported for type '${ii(o.type)}'.`);if(n.type.kind!==o.type.kind&&"value"!==n.type.kind&&"value"!==o.type.kind)return t.error(`Cannot compare types '${ii(n.type)}' and '${ii(o.type)}'.`);r&&("value"===n.type.kind&&"value"!==o.type.kind?n=new Ki(o.type,[n],t.key):"value"!==n.type.kind&&"value"===o.type.kind&&(o=new Ki(n.type,[o],t.key)));let s=null;if(4===e.length){if("string"!==n.type.kind&&"string"!==o.type.kind&&"value"!==n.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,Ht),!s)return null}return new a(n,o,t.key,s)}evaluate(a){let n=this.lhs.evaluate(a),o=this.rhs.evaluate(a);if(r&&this.hasUntypedArgument){let t=Wi(n),i=Wi(o);if(t.kind!==i.kind||"string"!==t.kind&&"number"!==t.kind)throw new ji(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${i.kind}) instead.`,this.key)}if(this.collator&&!r&&this.hasUntypedArgument){let e=Wi(n),i=Wi(o);if("string"!==e.kind||"string"!==i.kind)return t(a,n,o)}return this.collator?i(a,n,o,this.collator.evaluate(a)):t(a,n,o)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}const fr=dr("==",(function(e,t,i){return t===i}),pr),mr=dr("!=",(function(e,t,i){return t!==i}),(function(e,t,i,r){return!pr(0,t,i,r)})),gr=dr("<",(function(e,t,i){return t<i}),(function(e,t,i,r){return r.compare(t,i)<0})),_r=dr(">",(function(e,t,i){return t>i}),(function(e,t,i,r){return r.compare(t,i)>0})),yr=dr("<=",(function(e,t,i){return t<=i}),(function(e,t,i,r){return r.compare(t,i)<=0})),vr=dr(">=",(function(e,t,i){return t>=i}),(function(e,t,i,r){return r.compare(t,i)>=0}));var xr=class e{constructor(e,t,i){this.type=Ht,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=t}static parse(t,i){if(2!==t.length)return i.error("Expected one argument.");let r=t[1];if("object"!=typeof r||Array.isArray(r))return i.error("Collator options argument must be an object.");let a=i.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,qt);if(!a)return null;let n=i.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,qt);if(!n)return null;let o=null;return r.locale&&(o=i.parse(r.locale,1,Nt),!o)?null:new e(a,n,o)}evaluate(e){return new Di(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}},br=class e{constructor(e){this.type=Xt,this.sections=e}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return i.error("First argument must be an image or text section.");let a=[],n=!1;for(let e=1;e<=t.length-1;++e){let r=t[e];if(n&&"object"==typeof r&&!Array.isArray(r)){n=!1;let e=null;if(r["font-scale"]&&(e=i.parse(r["font-scale"],1,jt),!e))return null;let t=null;if(r["text-font"]&&(t=i.parse(r["text-font"],1,ti(Nt)),!t))return null;let o=null;if(r["text-color"]&&(o=i.parse(r["text-color"],1,$t),!o))return null;let s=null;if(r["vertical-align"]){if("string"==typeof r["vertical-align"]&&!Ri.includes(r["vertical-align"]))return i.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${r["vertical-align"]}' instead.`);if(s=i.parse(r["vertical-align"],1,Nt),!s)return null}let l=a[a.length-1];l.scale=e,l.font=t,l.textColor=o,l.verticalAlign=s}else{let r=i.parse(t[e],1,Zt);if(!r)return null;let o=r.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,a.push({content:r,scale:null,font:null,textColor:null,verticalAlign:null})}}return new e(a)}evaluate(e){return new Fi(this.sections.map((t=>{let i=t.content.evaluate(e);return Wi(i)===Qt?new Li("",i,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new Li(Hi(i),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)})))}eachChild(e){for(let t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}};const wr=8192;function Tr(e,t){let i=function(e){return(180+e)/360}(e[0]),r=function(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}(e[1]),a=2**t.z;return[Math.round(i*a*wr),Math.round(r*a*wr)]}function Sr(e,t){let i=2**t.z,r=(e[0]/wr+t.x)/i,a=(e[1]/wr+t.y)/i;return[Pr(r),Er(a)]}function Pr(e){return 360*e-180}function Er(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180)
vendor: 5,756 bytes, line 2
2)-90}function Cr(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 Mr(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Ir(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 Ar(e,t,i){let r=e[0]-t[0],a=e[1]-t[1],n=e[0]-i[0],o=e[1]-i[1];return r*o-n*a==0&&r*n<=0&&a*o<=0}function zr(e,t,i,r){let a=[t[0]-e[0],t[1]-e[1]];return 0!==function(e,t){return e[0]*t[1]-e[1]*t[0]}([r[0]-i[0],r[1]-i[1]],a)&&!(!Br(e,t,i,r)||!Br(i,r,e,t))}function kr(e,t,i){for(let r of i)for(let i=0;i<r.length-1;++i)if(zr(e,t,r[i],r[i+1]))return!0;return!1}function Dr(e,t,i=!1){let r=!1;for(let a of t)for(let t=0;t<a.length-1;t++){if(Ar(e,a[t],a[t+1]))return i;Ir(e,a[t],a[t+1])&&(r=!r)}return r}function Rr(e,t){for(let i of t)if(Dr(e,i))return!0;return!1}function Lr(e,t){for(let i of e)if(!Dr(i,t))return!1;for(let i=0;i<e.length-1;++i)if(kr(e[i],e[i+1],t))return!1;return!0}function Fr(e,t){for(let i of t)if(Lr(e,i))return!0;return!1}function Br(e,t,i,r){let a=e[0]-i[0],n=e[1]-i[1],o=t[0]-i[0],s=t[1]-i[1],l=r[0]-i[0],h=r[1]-i[1],u=a*h-l*n,c=o*h-l*s;return u>0&&c<0||u<0&&c>0}function Or(e,t,i){let r=[];for(let a=0;a<e.length;a++){let n=[];for(let r=0;r<e[a].length;r++){let o=Tr(e[a][r],i);Cr(t,o),n.push(o)}r.push(n)}return r}function Vr(e,t,i){let r=[];for(let a=0;a<e.length;a++){let n=Or(e[a],t,i);r.push(n)}return r}function jr(e,t,i,r){if(e[0]<i[0]||e[0]>i[2]){let t=.5*r,a=e[0]-i[0]>t?-r:i[0]-e[0]>t?r:0;0===a&&(a=e[0]-i[2]>t?-r:i[2]-e[0]>t?r:0),e[0]+=a}Cr(t,e)}function Nr(e,t,i,r){let a=2**r.z*wr,n=[r.x*wr,r.y*wr],o=[];for(let r of e)for(let e of r){let r=[e.x+n[0],e.y+n[1]];jr(r,t,i,a),o.push(r)}return o}function qr(e,t,i,r){let a=2**r.z*wr,n=[r.x*wr,r.y*wr],o=[];for(let i of e){let e=[];for(let r of i){let i=[r.x+n[0],r.y+n[1]];Cr(t,i),e.push(i)}o.push(e)}if(t[2]-t[0]<=a/2){!function(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}(t);for(let e of o)for(let r of e)jr(r,t,i,a)}return o}var $r=class e{constructor(e,t){this.type=qt,this.geojson=e,this.geometries=t}static parse(t,i){if(2!==t.length)return i.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Zi(t[1])){let i=t[1];if("FeatureCollection"===i.type){let t=[];for(let e of i.features){let{type:i,coordinates:r}=e.geometry;"Polygon"===i&&t.push(r),"MultiPolygon"===i&&t.push(...r)}if(t.length)return new e(i,{type:"MultiPolygon",coordinates:t})}else if("Feature"===i.type){let t=i.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new e(i,i.geometry)}else if("Polygon"===i.type||"MultiPolygon"===i.type)return new e(i,i)}return i.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(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("Polygon"===t.type){let n=Or(t.coordinates,r,a),o=Nr(e.geometry(),i,r,a);if(!Mr(i,r))return!1;for(let e of o)if(!Dr(e,n))return!1}if("MultiPolygon"===t.type){let n=Vr(t.coordinates,r,a),o=Nr(e.geometry(),i,r,a);if(!Mr(i,r))return!1;for(let e of o)if(!Rr(e,n))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(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("Polygon"===t.type){let n=Or(t.coordinates,r,a),o=qr(e.geometry(),i,r,a);if(!Mr(i,r))return!1;for(let e of o)if(!Lr(e,n))return!1}if("MultiPolygon"===t.type){let n=Vr(t.coordinates,r,a),o=qr(e.geometry(),i,r,a);if(!Mr(i,r))return!1;for(let e of o)if(!Fr(e,n))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},Ur=class{constructor(e=[],t=(e,t)=>e<t?-1:+(e>t)){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:i}=this,r=t[e];for(;e>0;){let a=e-1>>1,n=t[a];if(i(r,n)>=0)break;t[e]=n,e=a}t[e]=r}_down(e){let{data:t,compare:i}=this,r=this.length>>1,a=t[e];for(;e<r;){let r=1+(e<<1),n=r+1;if(n<this.length&&i(t[n],t[r])<0&&(r=n),i(t[r],a)>=0)break;t[e]=t[r],e=r}t[e]=a}};function Gr(e,t,i=0,r=e.length-1,a=Wr){for(;r>i;){if(r-i>600){let n=r-i+1,o=t-i+1,s=Math.log(n),l=.5*Math.exp(2*s/3),h=.5*Math.sqrt(s*l*(n-l)/n)*(o-n/2<0?-1:1);Gr(e,t,Math.max(i,Math.floor(t-o*l/n+h)),Math.min(r,Math.floor(t+(n-o)*l/n+h)),a)}let n=e[t],o=i,s=r;for(Zr(e,i,t),a(e[r],n)>0&&Zr(e,i,r);o<s;){for(Zr(e,o,s),o++,s--;a(e[o],n)<0;)o++;for(;a(e[s],n)>0;)s--}0===a(e[i],n)?Zr(e,i,s):(s++,Zr(e,s,r)),s<=t&&(i=s+1),t<=s&&(r=s-1)}}function Zr(e,t,i){let r=e[t];e[t]=e[i],e[i]=r}function Wr(e,t){return e<t?-1:+(e>t)}function Hr(e,t){if(e.length<=1)return[e];let i,r,a=[];for(let t of e){let e=Yr(t);0!==e&&(t.area=Math.abs(e),void 0===r&&(r=e<0),r===e<0?(i&&a.push(i),i=[t]):i.push(t))}if(i&&a.push(i),t>1)for(let e=0;e<a.length;e++)a[e].length<=t||(Gr(a[e],t,1,a[e].length-1,Xr),a[e]=a[e].slice(0,t));return a}function Xr(e,t){return t.area-e.area}function Yr(e){let t=0;for(let i,r,a=0,n=e.length,o=n-1;a<n;o=a++)i=e[a],r=e[o],t+=(r.x-i.x)*(i.y+r.y);return t}const Kr=1/298.257223563,Jr=Kr*(2-Kr),Qr=Math.PI/180;var ea=class{constructor(e){let t=6378.137*Qr*1e3,i=Math.cos(e*Qr),r=1/(1-Jr*(1-i*i)),a=Math.sqrt(r);this.kx=t*a*i,this.ky=t*a*r*(1-Jr)}distance(e,t){let i=this.wrap(e[0]-t[0])*this.kx,r=(e[1]-t[1])*this.ky;return Math.sqrt(i*i+r*r)}pointOnLine(e,t){let i,r,a,n,o=1/0;for(let s=0;s<e.length-1;s++){let l=e[s][0],h=e[s][1],u=this.wrap(e[s+1][0]-l)*this.kx,c=(e[s+1][1]-h)*this.ky,p=0;
vendor: 4,701 bytes, line 2
2(0!==u||0!==c)&&(p=(this.wrap(t[0]-l)*this.kx*u+(t[1]-h)*this.ky*c)/(u*u+c*c),p>1?(l=e[s+1][0],h=e[s+1][1]):p>0&&(l+=u/this.kx*p,h+=c/this.ky*p)),u=this.wrap(t[0]-l)*this.kx,c=(t[1]-h)*this.ky;let d=u*u+c*c;d<o&&(o=d,i=l,r=h,a=s,n=p)}return{point:[i,r],index:a,t:Math.max(0,Math.min(1,n))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}};function ta(e,t){return t[0]-e[0]}function ia(e){return e[1]-e[0]+1}function ra(e,t){return e[1]>=e[0]&&e[1]<t}function aa(e,t){if(e[0]>e[1])return[null,null];let i=ia(e);if(t){if(2===i)return[e,null];let t=Math.floor(i/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===i)return[e,null];let r=Math.floor(i/2)-1;return[[e[0],e[0]+r],[e[0]+r+1,e[1]]]}function na(e,t){if(!ra(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)Cr(i,e[r]);return i}function oa(e){let t=[1/0,1/0,-1/0,-1/0];for(let i of e)for(let e of i)Cr(t,e);return t}function sa(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function la(e,t,i){if(!sa(e)||!sa(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 ha(e,t,i){let r=i.pointOnLine(t,e);return i.distance(e,r.point)}function ua(e,t,i,r,a){let n=Math.min(ha(e,[i,r],a),ha(t,[i,r],a)),o=Math.min(ha(i,[e,t],a),ha(r,[e,t],a));return Math.min(n,o)}function ca(e,t,i,r,a){if(!ra(t,e.length)||!ra(r,i.length))return 1/0;let n=1/0;for(let o=t[0];o<t[1];++o){let t=e[o],s=e[o+1];for(let e=r[0];e<r[1];++e){let r=i[e],o=i[e+1];if(zr(t,s,r,o))return 0;n=Math.min(n,ua(t,s,r,o,a))}}return n}function pa(e,t,i,r,a){if(!ra(t,e.length)||!ra(r,i.length))return NaN;let n=1/0;for(let o=t[0];o<=t[1];++o)for(let t=r[0];t<=r[1];++t)if(n=Math.min(n,a.distance(e[o],i[t])),0===n)return n;return n}function da(e,t,i){if(Dr(e,t,!0))return 0;let r=1/0;for(let a of t){let t=a[0],n=a[a.length-1];if(t!==n&&(r=Math.min(r,ha(e,[n,t],i)),0===r))return r;let o=i.pointOnLine(a,e);if(r=Math.min(r,i.distance(e,o.point)),0===r)return r}return r}function fa(e,t,i,r){if(!ra(t,e.length))return NaN;for(let r=t[0];r<=t[1];++r)if(Dr(e[r],i,!0))return 0;let a=1/0;for(let n=t[0];n<t[1];++n){let t=e[n],o=e[n+1];for(let e of i)for(let i=0,n=e.length,s=n-1;i<n;s=i++){let n=e[s],l=e[i];if(zr(t,o,n,l))return 0;a=Math.min(a,ua(t,o,n,l,r))}}return a}function ma(e,t){for(let i of e)for(let e of i)if(Dr(e,t,!0))return!0;return!1}function ga(e,t,i,r=1/0){let a=oa(e),n=oa(t);if(r!==1/0&&la(a,n,i)>=r)return r;if(Mr(a,n)){if(ma(e,t))return 0}else if(ma(t,e))return 0;let o=1/0;for(let r of e)for(let e=0,a=r.length,n=a-1;e<a;n=e++){let a=r[n],s=r[e];for(let e of t)for(let t=0,r=e.length,n=r-1;t<r;n=t++){let r=e[n],l=e[t];if(zr(a,s,r,l))return 0;o=Math.min(o,ua(a,s,r,l,i))}}return o}function _a(e,t,i,r,a,n){if(!n)return;let o=la(na(r,n),a,i);o<t&&e.push([o,n,[0,0]])}function ya(e,t,i,r,a,n,o){if(!n||!o)return;let s=la(na(r,n),na(a,o),i);s<t&&e.push([s,n,o])}function va(e,t,i,r,a=1/0){let n=Math.min(r.distance(e[0],i[0][0]),a);if(0===n)return n;let o=new Ur([[0,[0,e.length-1],[0,0]]],ta),s=oa(i);for(;o.length>0;){let a=o.pop();if(a[0]>=n)continue;let l=a[1],h=t?50:100;if(ia(l)<=h){if(!ra(l,e.length))return NaN;if(t){let t=fa(e,l,i,r);if(isNaN(t)||0===t)return t;n=Math.min(n,t)}else for(let t=l[0];t<=l[1];++t){let a=da(e[t],i,r);if(n=Math.min(n,a),0===n)return 0}}else{let i=aa(l,t);_a(o,n,r,e,s,i[0]),_a(o,n,r,e,s,i[1])}}return n}function xa(e,t,i,r,a,n=1/0){let o=Math.min(n,a.distance(e[0],i[0]));if(0===o)return o;let s=new Ur([[0,[0,e.length-1],[0,i.length-1]]],ta);for(;s.length>0;){let n=s.pop();if(n[0]>=o)continue;let l=n[1],h=n[2],u=t?50:100,c=r?50:100;if(ia(l)<=u&&ia(h)<=c){if(!ra(l,e.length)&&ra(h,i.length))return NaN;let n;if(t&&r)n=ca(e,l,i,h,a),o=Math.min(o,n);else if(t&&!r){let t=e.slice(l[0],l[1]+1);for(let e=h[0];e<=h[1];++e)if(n=ha(i[e],t,a),o=Math.min(o,n),0===o)return o}else if(!t&&r){let t=i.slice(h[0],h[1]+1);for(let i=l[0];i<=l[1];++i)if(n=ha(e[i],t,a),o=Math.min(o,n),0===o)return o}else n=pa(e,l,i,h,a),o=Math.min(o,n)}else{let n=aa(l,t),u=aa(h,r);ya(s,o,a,e,i,n[0],u[0]),ya(s,o,a,e,i,n[0],u[1]),ya(s,o,a,e,i,n[1],u[0]),ya(s,o,a,e,i,n[1],u[1])}}return o}function ba(e){return"MultiPolygon"===e.type?e.coordinates.map((e=>({type:"Polygon",coordinates:e}))):"MultiLineString"===e.type?e.coordinates.map((e=>({type:"LineString",coordinates:e}))):"MultiPoint"===e.type?e.coordinates.map((e=>({type:"Point",coordinates:e}))):[e]}var wa=class e{constructor(e,t){this.type=jt,this.geojson=e,this.geometries=t}static parse(t,i){if(2!==t.length)return i.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Zi(t[1])){let i=t[1];
vendor: 15,409 bytes, line 2
2if("FeatureCollection"===i.type)return new e(i,i.features.map((e=>ba(e.geometry))).flat());if("Feature"===i.type)return new e(i,ba(i.geometry));if("type"in i&&"coordinates"in i)return new e(i,ba(i))}return i.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){let i=e.geometry(),r=i.flat().map((t=>Sr([t.x,t.y],e.canonical)));if(0===i.length)return NaN;let a=new ea(r[0][1]),n=1/0;for(let e of t){switch(e.type){case"Point":n=Math.min(n,xa(r,!1,[e.coordinates],!1,a,n));break;case"LineString":n=Math.min(n,xa(r,!1,e.coordinates,!0,a,n));break;case"Polygon":n=Math.min(n,va(r,!1,e.coordinates,a,n))}if(0===n)return n}return n}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){let i=e.geometry(),r=i.flat().map((t=>Sr([t.x,t.y],e.canonical)));if(0===i.length)return NaN;let a=new ea(r[0][1]),n=1/0;for(let e of t){switch(e.type){case"Point":n=Math.min(n,xa(r,!0,[e.coordinates],!1,a,n));break;case"LineString":n=Math.min(n,xa(r,!0,e.coordinates,!0,a,n));break;case"Polygon":n=Math.min(n,va(r,!0,e.coordinates,a,n))}if(0===n)return n}return n}(e,this.geometries);if("Polygon"===e.geometryType())return function(e,t){let i=e.geometry();if(0===i.length||0===i[0].length)return NaN;let r=Hr(i,0).map((t=>t.map((t=>t.map((t=>Sr([t.x,t.y],e.canonical))))))),a=new ea(r[0][0][0][1]),n=1/0;for(let e of t)for(let t of r){switch(e.type){case"Point":n=Math.min(n,va([e.coordinates],!1,t,a,n));break;case"LineString":n=Math.min(n,va(e.coordinates,!0,t,a,n));break;case"Polygon":n=Math.min(n,ga(t,e.coordinates,a,n))}if(0===n)return n}return n}(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},Ta=class e{constructor(e){this.key=e,this.type=Zt}static parse(t,i){if(2!==t.length)return i.error(`Expected 1 argument, but found ${t.length-1} instead.`);let r=t[1];return null==r?i.error("Global state property must be defined."):"string"==typeof r?new e(r):i.error(`Global state property must be string, but found ${typeof t[1]} instead.`)}evaluate(e){let t=e.globals?.globalState;return t&&0!==Object.keys(t).length?Ti(t,this.key)??null:null}eachChild(){}outputDefined(){return!1}};const Sa={"==":fr,"!=":mr,">":_r,"<":gr,">=":vr,"<=":yr,array:Ki,at:class e{constructor(e,t,i,r){this.type=e,this.index=t,this.input=i,this.key=r}static parse(t,i){if(3!==t.length)return i.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let r=i.parse(t[1],1,jt),a=i.parse(t[2],2,ti(i.expectedType||Zt));if(!r||!a)return null;let n=a.type;return new e(n.itemType,r,a,i.key)}evaluate(e){let t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new ji(`Array index out of bounds: ${t} < 0.`,this.key);if(t>=i.length)throw new ji(`Array index out of bounds: ${t} > ${i.length-1}.`,this.key);if(t!==Math.floor(t))throw new ji(`Array index must be an integer, but found ${t} instead.`,this.key);return i[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},boolean:Ki,case:class e{constructor(e,t,i){this.type=e,this.branches=t,this.otherwise=i}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&&"value"!==i.expectedType.kind&&(r=i.expectedType);let a=[];for(let e=1;e<t.length-1;e+=2){let n=i.parse(t[e],e,qt);if(!n)return null;let o=i.parse(t[e+1],e+1,r);if(!o)return null;a.push([n,o]),r||=o.type}let n=i.parse(t[t.length-1],t.length-1,r);if(!n)return null;if(!r)throw Error("Can't infer output type");return new e(r,a,n)}evaluate(e){for(let[t,i]of this.branches)if(t.evaluate(e))return i.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[t,i]of this.branches)e(t),e(i);e(this.otherwise)}outputDefined(){return this.branches.every((([e,t])=>t.outputDefined()))&&this.otherwise.outputDefined()}},coalesce:ur,collator:xr,format:br,image:class e{constructor(e){this.type=Qt,this.input=e}static parse(t,i){if(2!==t.length)return i.error("Expected two arguments.");let r=i.parse(t[1],1,Nt);return r?new e(r):i.error("No image name provided.")}evaluate(e){let t=this.input.evaluate(e),i=$i.fromString(t);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(t)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}},in:class e{constructor(e,t,i){this.needle=e,this.haystack=t,this.key=i,this.type=qt}static parse(t,i){if(3!==t.length)return i.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let r=i.parse(t[1],1,Zt),a=i.parse(t[2],2,Zt);return r&&a?ni(r.type,[qt,Nt,jt,Vt,Zt])?new e(r,a,i.key):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${ii(r.type)} instead`):null}evaluate(e){let t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!oi(t,["boolean","string","number","null"]))throw new ji(`Expected first argument to be of type boolean, string, number or null, but found ${ii(Wi(t))} instead.`,this.key);if(!oi(i,["string","array"]))throw new ji(`Expected second argument to be of type array or string, but found ${ii(Wi(i))} instead.`,this.key);return i.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},"index-of":class e{constructor(e,t,i,r){this.needle=e,this.haystack=t,this.key=i,this.fromIndex=r,this.type=jt}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,Zt),a=i.parse(t[2],2,Zt);if(!r||!a)return null;if(!ni(r.type,[qt,Nt,jt,Vt,Zt]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${ii(r.type)} instead`);if(4===t.length){let n=i.parse(t[3],3,jt);return n?new e(r,a,i.key,n):null}return new e(r,a,i.key)}evaluate(e){let t,i=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!oi(i,["boolean","string","number","null"]))throw new ji(`Expected first argument to be of type boolean, string, number or null, but found ${ii(Wi(i))} instead.`,this.key);if(this.fromIndex&&(t=this.fromIndex.evaluate(e)),oi(r,["string"])){let e=r.indexOf(i,t);return-1===e?-1:[...r.slice(0,e)].length}if(oi(r,["array"]))return r.indexOf(i,t);throw new ji(`Expected second argument to be of type array or string, but found ${ii(Wi(r))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},interpolate:sr,"interpolate-hcl":sr,"interpolate-lab":sr,length:class e{constructor(e,t){this.input=e,this.key=t,this.type=jt}static parse(t,i){if(2!==t.length)return i.error(`Expected 1 argument, but found ${t.length-1} instead.`);let r=i.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?i.error(`Expected argument of type string or array, but found ${ii(r.type)} instead.`):new e(r,i.key):null}evaluate(e){let t=this.input.evaluate(e);if("string"==typeof t)return[...t].length;if(Array.isArray(t))return t.length;throw new ji(`Expected value to be of type string or array, but found ${ii(Wi(t))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}},let:rr,literal:Xi,match:class e{constructor(e,t,i,r,a,n){this.inputType=e,this.type=t,this.input=i,this.cases=r,this.outputs=a,this.otherwise=n}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&&"value"!==i.expectedType.kind&&(a=i.expectedType);let n={},o=[];for(let e=2;e<t.length-1;e+=2){let s=t[e],l=t[e+1];Array.isArray(s)||(s=[s]);let h=i.concat(e);if(0===s.length)return h.error("Expected at least one branch label.");for(let e of s){if("number"!=typeof e&&"string"!=typeof e)return h.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>2**53-1)return h.error(`Branch labels must be integers no larger than ${2**53-1}.`);if("number"==typeof e&&Math.floor(e)!==e)return h.error("Numeric branch labels must be integer values.");if(r){if(h.checkSubtype(r,Wi(e)))return null}else r=Wi(e);if(void 0!==n[String(e)])return h.error("Branch labels must be unique.");n[String(e)]=o.length}let u=i.parse(l,e,a);if(!u)return null;a||=u.type,o.push(u)}let s=i.parse(t[1],1,Zt);if(!s)return null;let l=i.parse(t[t.length-1],t.length-1,a);return!l||"value"!==s.type.kind&&i.concat(1).checkSubtype(r,s.type)?null:new e(r,a,s,n,o,l)}evaluate(e){let t=this.input.evaluate(e);return(Wi(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}},number:Ki,"number-format":class e{constructor(e,t,i,r,a,n){this.type=Nt,this.number=e,this.locale=t,this.currency=i,this.unit=r,this.minFractionDigits=a,this.maxFractionDigits=n}static parse(t,i){if(3!==t.length)return i.error("Expected two arguments.");let r=i.parse(t[1],1,jt);if(!r)return null;let a=t[2];if("object"!=typeof a||Array.isArray(a))return i.error("NumberFormat options argument must be an object.");let n=null;if(a.locale&&(n=i.parse(a.locale,1,Nt),!n))return null;let o=null;if(a.currency&&(o=i.parse(a.currency,1,Nt),!o))return null;let s=null;if(a.unit&&(s=i.parse(a.unit,1,Nt),!s))return null;if(o&&s)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,jt),!l))return null;let h=null;return a["max-fraction-digits"]&&(h=i.parse(a["max-fraction-digits"],1,jt),!h)?null:new e(r,n,o,s,l,h)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},object:Ki,slice:class e{constructor(e,t,i,r,a){this.type=e,this.input=t,this.beginIndex=i,this.key=r,this.endIndex=a}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,Zt),a=i.parse(t[2],2,jt);if(!r||!a)return null;if(!ni(r.type,[ti(Zt),Nt,Zt]))return i.error(`Expected first argument to be of type array or string, but found ${ii(r.type)} instead`);if(4===t.length){let n=i.parse(t[3],3,jt);return n?new e(r.type,r,a,i.key,n):null}return new e(r.type,r,a,i.key)}evaluate(e){let t,i=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(this.endIndex&&(t=this.endIndex.evaluate(e)),oi(i,["string"]))return[...i].slice(r,t).join("");if(oi(i,["array"]))return i.slice(r,t);throw new ji(`Expected first argument to be of type array or string, but found ${ii(Wi(i))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}},step:or,string:Ki,"to-boolean":Qi,"to-color":Qi,"to-number":Qi,"to-string":Qi,var:ar,within:$r,distance:wa,"global-state":Ta};var Pa=class e{constructor(e,t,i,r,a){this.name=e,this.type=t,this._evaluate=i,this.args=r,this.key=a}evaluate(e){return this._evaluate(e,this.args,this.key)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(t,i){let r=t[0],a=e.definitions[r];if(!a)return i.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);let n=Array.isArray(a)?a[0]:a.type,o=Array.isArray(a)?[[a[1],a[2]]]:a.overloads,s=o.filter((([e])=>!Array.isArray(e)||e.length===t.length-1)),l=null;for(let[a,o]of s){l=new ir(i.registry,Aa,i.path,null,i.scope);let s=[],h=!1;for(let e=1;e<t.length;e++){let i=t[e],r=Array.isArray(a)?a[e-1]:a.type,n=l.parse(i,1+s.length,r);if(!n){h=!0;break}s.push(n)}if(!h){if(Array.isArray(a)&&a.length!==s.length){l.error(`Expected ${a.length} arguments, but found ${s.length} instead.`);continue}for(let e=0;e<s.length;e++){let t=Array.isArray(a)?a[e]:a.type,i=s[e];l.concat(e+1).checkSubtype(t,i.type)}if(0===l.errors.length)return new e(r,n,o,s,i.key)}}if(1===s.length)i.errors.push(...l.errors);else{let e=(s.length?s:o).map((([e])=>function(e){return Array.isArray(e)?`(${e.map(ii).join(", ")})`:`(${ii(e.type)}...)`}(e))).join(" | "),r=[];for(let e=1;e<t.length;e++){let a=i.parse(t[e],1+r.length);if(!a)return null;r.push(ii(a.type))}i.error(`Expected arguments of type ${e}, but found (${r.join(", ")}) instead.`)}return null}static register(t,i){e.definitions=i;for(let r in i)t[r]=e}};function Ea(e,[t,i,r,a],n){t=t.evaluate(e),i=i.evaluate(e),r=r.evaluate(e);let o=a?a.evaluate(e):1,s=Gi(t,i,r,o);if(s)throw new ji(s,n);return new ki(t/255,i/255,r/255,o,!1)}function Ca(e,t){return e in t&&void 0!==t[e]}function Ma(e,t){let i=t[e];return void 0===i?null:i}function Ia(e){return{type:e}}function Aa(e){if(e instanceof ar)return Aa(e.boundExpression);if(e instanceof Pa&&"error"===e.name||e instanceof xr||e instanceof $r||e instanceof wa||e instanceof Ta)return!1;let t=e instanceof Qi||e instanceof Ki,i=!0;return e.eachChild((e=>{i&&=t?Aa(e):e instanceof Xi})),!!i&&(za(e)&&Da(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]))}function za(e){if(e instanceof Pa&&("get"===e.name&&1===e.args.length||"feature-state"===e.name||"has"===e.name&&1===e.args.length||"properties"===e.name||"geometry-type"===e.name||"id"===e.name||/^filter-/.test(e.name))||e instanceof $r||e instanceof wa)return!1;let t=!0;return e.eachChild((e=>{t&&!za(e)&&(t=!1)})),t}function ka(e){if(e instanceof Pa&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!ka(e)&&(t=!1)})),t}function Da(e,t){if(e instanceof Pa&&t.indexOf(e.name)>=0)return!1;let i=!0;return e.eachChild((e=>{i&&!Da(e,t)&&(i=!1)})),i}function Ra(e){return{result:"success",value:e}}function La(e){return{result:"error",value:e}}function Fa(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function Ba(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Oa(e){return!!e.expression&&e.expression.interpolated}function Va(e,...t){for(let i of t)for(let t in i)e[t]=i[t];return e}function ja(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function Na(e){return"object"==typeof e&&!!e&&!Array.isArray(e)&&Wi(e)===Gt}function qa(e){return e}function $a(e,t){let i=e.stops&&"object"==typeof e.stops[0][0],r=i||void 0!==e.property,a=i||!r,n=e.type||(Oa(t)?"exponential":"interval"),o=function(e){switch(e.type){case"color":return ki.parse;case"padding":return Bi.parse;case"numberArray":return Oi.parse;case"colorArray":return Vi.parse;default:return null}}(t);if(o&&(e=Va({},e),e.stops&&=e.stops.map((e=>[e[0],o(e[1])])),e.default?e.default=o(e.default):e.default=o(t.default)),e.colorSpace&&!function(e){return"rgb"
vendor: 4,073 bytes, line 2
2===e||"hcl"===e||"lab"===e}(e.colorSpace))throw Error(`Unknown color space: "${e.colorSpace}"`);let s,l,h=function(e){switch(e){case"exponential":return Wa;case"interval":return Za;case"categorical":return Ga;case"identity":return Ha;default:throw Error(`Unknown function type "${e}"`)}}(n);if("categorical"===n){s=Object.create(null);for(let t of e.stops)s[t[0]]=t[1];l=typeof e.stops[0][0]}if(i){let i={},r=[];for(let t=0;t<e.stops.length;t++){let a=e.stops[t],n=a[0].zoom;void 0===i[n]&&(i[n]={zoom:n,type:e.type,property:e.property,default:e.default,stops:[]},r.push(n)),i[n].stops.push([a[0].value,a[1]])}let a=[];for(let e of r)a.push([i[e].zoom,$a(i[e],t)]);let n={name:"linear"};return{kind:"composite",interpolationType:n,interpolationFactor:sr.interpolationFactor.bind(void 0,n),zoomStops:a.map((e=>e[0])),evaluate({zoom:i},r){return Wa({stops:a,base:e.base},t,i).evaluate(i,r)}}}if(a){let i="exponential"===n?{name:"exponential",base:void 0===e.base?1:e.base}:null;return{kind:"camera",interpolationType:i,interpolationFactor:sr.interpolationFactor.bind(void 0,i),zoomStops:e.stops.map((e=>e[0])),evaluate:({zoom:i})=>h(e,t,i,s,l)}}return{kind:"source",evaluate(i,r){let a=r&&r.properties?r.properties[e.property]:void 0;return void 0===a?Ua(e.default,t.default):h(e,t,a,s,l)}}}function Ua(e,t,i){return void 0!==e?e:void 0!==t?t:void 0!==i?i:void 0}function Ga(e,t,i,r,a){return Ua(typeof i===a?r[i]:void 0,e.default,t.default)}function Za(e,t,i){if("number"!==ja(i))return Ua(e.default,t.default);let r=e.stops.length;if(1===r||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=nr(e.stops.map((e=>e[0])),i,"");return e.stops[a][1]}function Wa(e,t,i){let r=void 0===e.base?1:e.base;if("number"!==ja(i))return Ua(e.default,t.default);let a=e.stops.length;if(1===a||i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[a-1][0])return e.stops[a-1][1];let n=nr(e.stops.map((e=>e[0])),i,""),o=function(e,t,i,r){let a=r-i,n=e-i;return 0===a?0:1===t?n/a:(t**+n-1)/(t**+a-1)}(i,r,e.stops[n][0],e.stops[n+1][0]),s=e.stops[n][1],l=e.stops[n+1][1],h=hr[t.type]||qa;return"function"==typeof s.evaluate?{evaluate(...t){let i=s.evaluate.apply(void 0,t),r=l.evaluate.apply(void 0,t);if(void 0!==i&&void 0!==r)return h(i,r,o,e.colorSpace)}}:h(s,l,o,e.colorSpace)}function Ha(e,t,i){switch(t.type){case"color":i=ki.parse(i);break;case"formatted":i=Fi.fromString(i.toString());break;case"resolvedImage":i=$i.fromString(i.toString());break;case"padding":i=Bi.parse(i);break;case"colorArray":i=Vi.parse(i);break;case"numberArray":i=Oi.parse(i);break;default:ja(i)!==t.type&&("enum"!==t.type||!t.values[i])&&(i=void 0)}return Ua(i,e.default,t.default)}Pa.register(Sa,{error:[Wt,[Nt],(e,[t],i)=>{throw new ji(t.evaluate(e),i)}],typeof:[Nt,[Zt],(e,[t])=>ii(Wi(t.evaluate(e)))],"to-rgba":[ti(jt,4),[$t],(e,[t])=>{let[i,r,a,n]=t.evaluate(e).rgb;return[255*i,255*r,255*a,n]}],rgb:[$t,[jt,jt,jt],Ea],rgba:[$t,[jt,jt,jt,jt],Ea],has:{type:qt,overloads:[[[Nt],(e,[t])=>Ca(t.evaluate(e),e.properties())],[[Nt,Gt],(e,[t,i])=>Ca(t.evaluate(e),i.evaluate(e))]]},get:{type:Zt,overloads:[[[Nt],(e,[t])=>Ma(t.evaluate(e),e.properties())],[[Nt,Gt],(e,[t,i])=>Ma(t.evaluate(e),i.evaluate(e))]]},"feature-state":[Zt,[Nt],(e,[t])=>Ma(t.evaluate(e),e.featureState||{})],properties:[Gt,[],e=>e.properties()],"geometry-type":[Nt,[],e=>e.geometryType()],id:[Zt,[],e=>e.id()],zoom:[jt,[],e=>e.globals.zoom],"heatmap-density":[jt,[],e=>e.globals.heatmapDensity||0],elevation:[jt,[],e=>e.globals.elevation||0],"line-progress":[jt,[],e=>e.globals.lineProgress||0],accumulated:[Zt,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[jt,Ia(jt),(e,t)=>{let i=0;for(let r of t)i+=r.evaluate(e);return i}],"*":[jt,Ia(jt),(e,t)=>{let i=1;for(let r of t)i*=r.evaluate(e);return i}],"-":{type:jt,overloads:[[[jt,jt],(e,[t,i])=>t.evaluate(e)-i.evaluate(e)],[[jt],(e,[t])=>-t.evaluate(e)]]},"/":[jt,[jt,jt],(e,[t,i])=>t.evaluate(e)/i.evaluate(e)],"%":[jt,[jt,jt],(e,[t,i])=>t.evaluate(e)%i.evaluate(e)],ln2:[jt,[],()=>Math.LN2],pi:[jt,[],()=>Math.PI],e:[jt,[],()=>
vendor: 21,953 bytes, line 2
2Math.E],"^":[jt,[jt,jt],(e,[t,i])=>t.evaluate(e)**+i.evaluate(e)],sqrt:[jt,[jt],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[jt,[jt],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[jt,[jt],(e,[t])=>Math.log(t.evaluate(e))],log2:[jt,[jt],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[jt,[jt],(e,[t])=>Math.sin(t.evaluate(e))],cos:[jt,[jt],(e,[t])=>Math.cos(t.evaluate(e))],tan:[jt,[jt],(e,[t])=>Math.tan(t.evaluate(e))],asin:[jt,[jt],(e,[t])=>Math.asin(t.evaluate(e))],acos:[jt,[jt],(e,[t])=>Math.acos(t.evaluate(e))],atan:[jt,[jt],(e,[t])=>Math.atan(t.evaluate(e))],min:[jt,Ia(jt),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[jt,Ia(jt),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[jt,[jt],(e,[t])=>Math.abs(t.evaluate(e))],round:[jt,[jt],(e,[t])=>{let i=t.evaluate(e);return i<0?-Math.round(-i):Math.round(i)}],floor:[jt,[jt],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[jt,[jt],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[qt,[Nt,Zt],(e,[t,i])=>e.properties()[t.value]===i.value],"filter-id-==":[qt,[Zt],(e,[t])=>e.id()===t.value],"filter-type-==":[qt,[Nt],(e,[t])=>e.geometryType()===t.value],"filter-<":[qt,[Nt,Zt],(e,[t,i])=>{let r=e.properties()[t.value],a=i.value;return typeof r==typeof a&&r<a}],"filter-id-<":[qt,[Zt],(e,[t])=>{let i=e.id(),r=t.value;return typeof i==typeof r&&i<r}],"filter->":[qt,[Nt,Zt],(e,[t,i])=>{let r=e.properties()[t.value],a=i.value;return typeof r==typeof a&&r>a}],"filter-id->":[qt,[Zt],(e,[t])=>{let i=e.id(),r=t.value;return typeof i==typeof r&&i>r}],"filter-<=":[qt,[Nt,Zt],(e,[t,i])=>{let r=e.properties()[t.value],a=i.value;return typeof r==typeof a&&r<=a}],"filter-id-<=":[qt,[Zt],(e,[t])=>{let i=e.id(),r=t.value;return typeof i==typeof r&&i<=r}],"filter->=":[qt,[Nt,Zt],(e,[t,i])=>{let r=e.properties()[t.value],a=i.value;return typeof r==typeof a&&r>=a}],"filter-id->=":[qt,[Zt],(e,[t])=>{let i=e.id(),r=t.value;return typeof i==typeof r&&i>=r}],"filter-has":[qt,[Zt],(e,[t])=>{let i=t.value,r=e.properties();return i in r&&void 0!==r[i]}],"filter-has-id":[qt,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[qt,[ti(Nt)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[qt,[ti(Zt)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[qt,[Nt,ti(Zt)],(e,[t,i])=>i.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[qt,[Nt,ti(Zt)],(e,[t,i])=>function(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}(e.properties()[t.value],i.value,0,i.value.length-1)],all:{type:qt,overloads:[[[qt,qt],(e,[t,i])=>t.evaluate(e)&&i.evaluate(e)],[Ia(qt),(e,t)=>{for(let i of t)if(!i.evaluate(e))return!1;return!0}]]},any:{type:qt,overloads:[[[qt,qt],(e,[t,i])=>t.evaluate(e)||i.evaluate(e)],[Ia(qt),(e,t)=>{for(let i of t)if(i.evaluate(e))return!0;return!1}]]},"!":[qt,[qt],(e,[t])=>!t.evaluate(e)],"is-supported-script":[qt,[Nt],(e,[t])=>{let i=e.globals&&e.globals.isSupportedScript;return!i||i(t.evaluate(e))}],upcase:[Nt,[Nt],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[Nt,[Nt],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[Nt,Ia(Zt),(e,t)=>t.map((t=>Hi(t.evaluate(e)))).join("")],split:[ti(Nt),[Nt,Nt],(e,[t,i])=>t.evaluate(e).split(i.evaluate(e))],join:[Nt,[ti(Nt),Nt],(e,[t,i])=>t.evaluate(e).join(i.evaluate(e))],"resolved-locale":[Nt,[Ht],(e,[t])=>t.evaluate(e).resolvedLocale()]});var Xa=class{constructor(e,t,i,r){this.expression=e,this._warningHistory={},this._evaluator=new tr,this._defaultValue=i?sn(i):null,this._enumValues=i&&"enum"===i.type?i.values:null,this._globalState=r,this._rootKey=t}evaluateWithoutErrorHandling(e,t,i,r,a,n){return this._globalState&&(e=ln(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=n,this.expression.evaluate(this._evaluator)}evaluate(e,t,i,r,a,n){this._globalState&&(e=ln(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=n||null;try{let e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new ji(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`,"");return e}catch(e){let t=e instanceof ji?e.path:"",i=`${t}|${e.message}`;return this._warningHistory[i]||(this._warningHistory[i]=!0,typeof console<"u"&&console.warn(Ya(this._rootKey,t,e.message,this._defaultValue))),this._defaultValue}}};function Ya(e,t,i,r){return`${e}${t}: ${i}${null==r?"":` Falling back to ${String(r)}.`}`}function Ka(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 Ja(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Sa}function Qa(e,t,i,r){Ka(t);let a=new ir(Sa,Aa,[],i?function(e){let t={color:$t,string:Nt,number:jt,enum:Nt,boolean:qt,formatted:Xt,padding:Yt,numberArray:Jt,colorArray:Kt,projectionDefinition:Ut,resolvedImage:Qt,variableAnchorOffsetCollection:ei};return"array"===e.type?ti(t[e.value]||Zt,e.length):t[e.type]}(i):void 0),n=a.parse(e,void 0,void 0,void 0,i&&"string"===i.type?{typeAnnotation:"coerce"}:void 0);return n?Ra(new Xa(n,t,i,r)):La(a.errors)}var en=class{constructor(e,t,i){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!ka(t.expression),this.globalStateRefs=on(t.expression),this._globalState=i}evaluateWithoutErrorHandling(e,t,i,r,a,n){return this._globalState&&(e=ln(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,a,n)}evaluate(e,t,i,r,a,n){return this._globalState&&(e=ln(e,this._globalState)),this._styleExpression.evaluate(e,t,i,r,a,n)}},tn=class{constructor(e,t,i,r,a){this.kind=e,this.zoomStops=i,this._styleExpression=t,this.isStateDependent="camera"!==e&&!ka(t.expression),this.globalStateRefs=on(t.expression),this.interpolationType=r,this._globalState=a}evaluateWithoutErrorHandling(e,t,i,r,a,n){return this._globalState&&(e=ln(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,a,n)}evaluate(e,t,i,r,a,n){return this._globalState&&(e=ln(e,this._globalState)),this._styleExpression.evaluate(e,t,i,r,a,n)}interpolationFactor(e,t,i){return this.interpolationType?sr.interpolationFactor(this.interpolationType,e,t,i):0}};function rn(e,t,i,r){let a=Qa(e,t,i,r);if("error"===a.result)return a;let n=a.value.expression,o=za(n);if(!o&&!Fa(i))return La([new Bt("","data expressions not supported")]);let s=Da(n,["zoom"]);if(!s&&!Ba(i))return La([new Bt("","zoom expressions not supported")]);let l=nn(n);if(!l&&!s)return La([new Bt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof Bt)return La([l]);if(l instanceof sr&&!Oa(i))return La([new Bt("",'"interpolate" expressions cannot be used with this property')]);if(!l)return Ra(new en(o?"constant":"source",a.value,r));let h=l instanceof sr?l.interpolation:void 0;return Ra(new tn(o?"camera":"composite",a.value,l.labels,h,r))}var an=class e{constructor(e,t,i){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,Ka(t),this._parameters=e,this._specification=i,this._rootKey=t,this._defaultValue=sn(i),this._warningHistory={};let r=$a(this._parameters,this._specification);this.kind=r.kind,this.interpolationFactor=r.interpolationFactor,this.zoomStops=r.zoomStops,this.interpolationType=r.interpolationType,this._innerEvaluate=r.evaluate}evaluate(e,t){try{return this._innerEvaluate(e,t)}catch(e){let t=e instanceof Error?e.message:String(e),i=`|${t}`;return this._warningHistory[i]||(this._warningHistory[i]=!0,typeof console<"u"&&console.warn(Ya(this._rootKey,"",t,this._defaultValue))),this._defaultValue}}static deserialize(t){return new e(t._parameters,t._rootKey,t._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification,_rootKey:e._rootKey}}};function nn(e){let t=null;if(e instanceof rr)t=nn(e.result);else if(e instanceof ur){for(let i of e.args)if(t=nn(i),t)break}else(e instanceof or||e instanceof sr)&&e.input instanceof Pa&&"zoom"===e.input.name&&(t=e);return t instanceof Bt||e.eachChild((e=>{let i=nn(e);i instanceof Bt?t=i:!t&&i?t=new Bt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&i&&t!==i&&(t=new Bt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function on(e,t=new Set){return e instanceof Ta&&t.add(e.key),e.eachChild((e=>{on(e,t)})),t}function sn(e){if("color"===e.type&&Na(e.default))return new ki(0,0,0,0);switch(e.type){case"color":return ki.parse(e.default)||null;case"padding":return Bi.parse(e.default)||null;case"numberArray":return Oi.parse(e.default)||null;case"colorArray":return Vi.parse(e.default)||null;case"variableAnchorOffsetCollection":return qi.parse(e.default)||null;case"projectionDefinition":return Ui.parse(e.default)||null;default:return void 0===e.default?null:e.default}}function ln(e,t){let{zoom:i,heatmapDensity:r,elevation:a,lineProgress:n,isSupportedScript:o,accumulated:s}=e??{};return{zoom:i,heatmapDensity:r,elevation:a,lineProgress:n,isSupportedScript:o,accumulated:s,globalState:t}}function hn(e){if("boolean"==typeof e)return"neutral";if(!Array.isArray(e)||0===e.length)return"legacy";switch(e[0]){case"has":return e.length<2||"$id"===e[1]||"$type"===e[1]?"legacy":2===e.length?"neutral":"expression";case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]))?"expression":"legacy";case"!in":case"!has":case"none":return"legacy";case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2])?"expression":"legacy";case"any":case"all":return function(e){let t=!1;for(let i of e){let e=hn(i);if("expression"===e)return"expression";"legacy"===e&&(t=!0)}return t?"legacy":"neutral"}(e.slice(1));default:return"expression"}}function un(e){return"legacy"!==hn(e)}function cn(e){return"$type"===e?["geometry-type"]:"$id"===e?["id"]:["get",e]}function pn(e){if(("<"===e[0]||"<="===e[0]||">"===e[0]||">="===e[0])&&"$type"===e[1])return`"$type" cannot be use with operator "${e[0]}"`;let t=function(e){switch(e[0]){case"==":case"!=":case"<":case"<=":case">":case">=":return 3!==e.length||"string"!=typeof e[1]?null:[e[0],cn(e[1]),e[2]];case"in":case"!in":{if(e.length<2||"string"!=typeof e[1])return null;let t=["in",cn(e[1]),["literal",e.slice(2)]];return"!in"===e[0]?["!",t]:t}case"has":case"!has":{if(2!==e.length||"string"!=typeof e[1]||"$type"===e[1]||"$id"===e[1])return null;let t=["has",e[1]];return"!has"===e[0]?["!",t]:t}default:return null}}(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 dn(e,t,i){let r=i[e];return Array.isArray(r)?un(r)?fn(r,t.concat(e)):{path:t.concat(e),legacyFilter:r}:null}function fn(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=dn(i,t,e);if(r)return r}break;case"!":{let i=dn(1,t,e);if(i)return i;break}case"case":for(let i=1;i<e.length-1;i+=2){let r=dn(i,t,e);if(r)return r}}return null}const mn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function gn(e,t,i){if(null==e)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};un(e)?function(e,t){let i=fn(e);if(!i||typeof console>"u")return;let r=i.path.map((e=>`[${e}]`)).join("");console.warn(`${t}${r}: ${pn(i.legacyFilter)}`)}(e,t):e=vn(e);let r=Qa(e,t,mn,i);if("error"===r.result)throw Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return{filter:(e,t,i)=>r.value.evaluate(e,t,{},i),needGeometry:yn(e),getGlobalStateRefs:()=>on(r.value.expression)}}function _n(e,t){return e<t?-1:+(e>t)}function yn(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(yn(e[t]))return!0;return!1}function vn(e){if(!e)return!0;let t=e[0];return e.length<=1?"any"!==t:"=="===t?xn(e[1],e[2],"=="):"!="===t?Tn(xn(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?xn(e[1],e[2],t):"any"===t?function(e){return["any"].concat(e.map(vn))}(e.slice(1)):"all"===t?["all"].concat(e.slice(1).map(vn)):"none"===t?["all"].concat(e.slice(1).map(vn).map(Tn)):"in"===t?bn(e[1],e.slice(2)):"!in"===t?Tn(bn(e[1],e.slice(2))):"has"===t?wn(e[1]):"!has"!==t||Tn(wn(e[1]))}function xn(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 bn(e,t){if(0===t.length)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((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(_n)]]:["filter-in-small",e,["literal",t]]}}function wn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Tn(e){return["!",e]}function Sn(e){let t=e.key,i=e.value;return i?[new Ft(t,i,"constants have been deprecated as of v8")]:[]}function Pn(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function En(e){if(Array.isArray(e))return e.map(En);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let i in e)t[i]=En(e[i]);return t}return Pn(e)}function Cn(e){let t=e.key,i=e.value,r=e.valueSpec||{},a=e.objectElementValidators||{},n=e.style,o=e.styleSpec,s=e.validateSpec,l=[],h=ja(i);if("object"!==h)return[new Ft(t,i,`object expected, ${h} found`)];for(let e in i){let h,u=e.split(".")[0],c=Ti(r,u)||r["*"];if(Ti(a,u))h=a[u];else if(Ti(r,u)){if(void 0===i[e])continue;h=s}else if(a["*"])h=a["*"];else{if(!r["*"]){l.push(new Ft(t,i[e],`unknown property "${e}"`));continue}h=s}l=l.concat(h({key:(t&&`${t}.`)+e,value:i[e],valueSpec:c,style:n,styleSpec:o,object:i,objectKey:e,validateSpec:s},i))}for(let e in r)a[e]||r[e].required&&void 0===r[e].default&&void 0===i[e]&&l.push(new Ft(t,i,`missing required property "${e}"`));return l}function Mn(e){let t=e.value,i=e.valueSpec,r=e.validateSpec,a=e.style,n=e.styleSpec,o=e.key,s=e.arrayElementValidator||r;if("array"!==ja(t))return[new Ft(o,t,`array expected, ${ja(t)} found`)];if(i.length&&t.length!==i.length)return[new Ft(o,t,`array length ${i.length} expected, length ${t.length} found`)];let l={type:i.value,values:i.values};n.$version<7&&(l.function=i.function),"object"===ja(i.value)&&(l=i.value);let h=[];for(let i=0;i<t.length;i++)h=h.concat(s({array:t,arrayIndex:i,value:t[i],valueSpec:l,validateSpec:e.validateSpec,style:a,styleSpec:n,key:`${o}[${i}]`}));return h}function In(e){let t=e.key,i=e.value,r=e.valueSpec,a=ja(i);return"number"===a&&i!=i&&(a="NaN"),"number"===a?"minimum"in r&&i<r.minimum?[new Ft(t,i,`${i} is less than the minimum value ${r.minimum}`)]:"maximum"in r&&i>r.maximum?[new Ft(t,i,`${i} is greater than the maximum value ${r.maximum}`)]:[]:[new Ft(t,i,`number expected, ${a} found`)]}function An(e){let t,i,r,a=e.valueSpec,n=Pn(e.value.type),o={},s="categorical"!==n&&void 0===e.value.property,l=!s,h="array"===ja(e.value.stops)&&"array"===ja(e.value.stops[0])&&"object"===ja(e.value.stops[0][0]),u=Cn({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===n)return[new Ft(e.key,e.value,'identity function may not have a "stops" property')];let t=[],i=e.value;return t=t.concat(Mn({key:e.key,value:i,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:c})),"array"===ja(i)&&0===i.length&&t.push(new Ft(e.key,i,"array must have at least one stop")),t},default:function(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:a,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===n&&s&&u.push(new Ft(e.key,e.value,'missing required property "property"')),"identity"!==n&&!e.value.stops&&u.push(new Ft(e.key,e.value,'missing required property "stops"')),"exponential"===n&&e.valueSpec.expression&&!Oa(e.valueSpec)&&u.push(new Ft(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Fa(e.valueSpec)?u.push(new Ft(e.key,e.value,"property functions not supported")):s&&!Ba(e.valueSpec)&&u.push(new Ft(e.key,e.value,"zoom functions not supported"))),("categorical"===n||h)&&void 0===e.value.property&&u.push(new Ft(e.key,e.value,'"property" property is required')),u;function c(e){let t=[],n=e.value,s=e.key;if("array"!==ja(n))return[new Ft(s,n,`array expected, ${ja(n)} found`)];if(2!==n.length)return[new Ft(s,n,`array length 2 expected, length ${n.length} found`)];if(h){if("object"!==ja(n[0]))return[new Ft(s,n,`object expected, ${ja(n[0])} found`)];if(void 0===n[0].zoom)return[new Ft(s,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new Ft(s,n,"object stop key must have value")];if(r&&r>Pn(n[0].zoom))return[new Ft(s,n[0].zoom,"stop zoom values must appear in ascending order")];Pn(n[0].zoom)!==r&&(r=Pn(n[0].zoom),i=void 0,o={}),t=t.concat(Cn({key:`${s}[0]`,value:n[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:In,value:p}}))}else t=t.concat(p({key:`${s}[0]`,value:n[0],valueSpec:{},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},n));return Ja(En(n[1]))?t.concat([new Ft(`${s}[1]`,n[1],"expressions are not allowed in function stops.")]):t.concat(e.validateSpec({key:`${s}[1]`,value:n[1],valueSpec:a,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function p(e,r){let s=ja(e.value),l=Pn(e.value),h=null===e.value?r:e.value;if(t){if(s!==t)return[new Ft(e.key,h,`${s} stop domain type must match previous stop domain type ${t}`)]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Ft(e.key,h,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==n){let t=`number expected, ${s} found`;return Fa(a)&&void 0===n&&(t+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ft(e.key,h,t)]}return"categorical"!==n||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==n&&"number"===s&&void 0!==i&&l<i?[new Ft(e.key,h,"stop domain values must appear in ascending order")]:(i=l,"categorical"===n&&l in o?[new Ft(e.key,h,"stop domain values must be unique")]:(o[l]=!0,[])):[new Ft(e.key,h,`integer expected, found ${l}`)]}}function zn(e){let t=("property"===e.expressionContext?rn:Qa)(En(e.value),e.key,e.valueSpec);if("error"===t.result)return t.value.map((t=>new Ft(`${e.key}${t.key}`,e.value,t.message)));let i=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!i.outputDefined())return[new Ft(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===e.expressionContext&&"layout"===e.propertyType&&!ka(i))return[new Ft(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!ka(i))return[new Ft(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!Da(i,["zoom","feature-state"]))return[new Ft(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!za(i))return[new Ft(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function kn(e){let t=e.key,i=e.value,r=ja(i);return"string"===r?ki.parse(String(i))?[]:[new Ft(t,i,`color expected, "${i}" found`)]:[new Ft(t,i,`color expected, ${r} found`)]}function Dn(e){let t=e.key,i=e.value,r=e.valueSpec,a=[];return Array.isArray(r.values)?-1===r.values.indexOf(Pn(i))&&a.push(new Ft(t,i,`expected one of [${r.values.join(", ")}], ${JSON.stringify(i)} found`)):-1===Object.keys(r.values).indexOf(Pn(i))&&a.push(new Ft(t,i,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(i)} found`)),a}function Rn(e,t){let i=e;for(let e of t)i=i[e];return i}function Ln(e,t){let i=fn(t);return i?[new Ft(`${e.key}${i.path.map((e=>`[${e}]`)).join("")}`,Rn(e.value,i.path),pn(i.legacyFilter),null,"warning")]:[]}function Fn(e){let t=En(e.value);return un(t)?[...Ln(e,t),...zn(Va({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}}))]:Bn(e)}function Bn(e){let t=e.value,i=e.key;if("array"!==ja(t))return[new Ft(i,t,`array expected, ${ja(t)} found`)];let r,a=e.styleSpec,n=[];if(t.length<1)return[new Ft(i,t,"filter array must have at least 1 element")];switch(n=n.concat(Dn({key:`${i}[0]`,value:t[0],valueSpec:a.filter_operator,style:e.style,styleSpec:e.styleSpec})),Pn(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===Pn(t[1])&&n.push(new Ft(i,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":3!==t.length&&n.push(new Ft(i,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(r=ja(t[1]),"string"!==r&&n.push(new Ft(`${i}[1]`,t[1],`string expected, ${r} found`)));for(let o=2;o<t.length;o++)r=ja(t[o]),"$type"===Pn(t[1])?n=n.concat(Dn({key:`${i}[${o}]`,value:t[o],valueSpec:a.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==r&&"number"!==r&&"boolean"!==r&&n.push(new Ft(`${i}[${o}
2]`,t[o],`string, number, or boolean expected, ${r} found`));break;case"any":case"all":case"none":for(let r=1;r<t.length;r++)n=n.concat(Bn({key:`${i}[${r}]`,value:t[r],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":r=ja(t[1]),2===t.length?"string"!==r&&n.push(new Ft(`${i}[1]`,t[1],`string expected, ${r} found`)):n.push(new Ft(i,t,`filter array for "${t[0]}" operator must have 2 elements`))}return n}function On(e,t){let i=e.key,r=e.validateSpec,a=e.style,n=e.styleSpec,o=e.value,s=e.objectKey,l=n[`${t}_${e.layerType}`];if(!l)return[];let h=s.match(/^(.*)-transition$/);if("paint"===t&&h&&l[h[1]]&&l[h[1]].transition)return r({key:i,value:o,valueSpec:n.transition,style:a,styleSpec:n});let u,c=e.valueSpec||l[s];if(!c)return[new Ft(i,o,`unknown property "${s}"`)];if("string"===ja(o)&&Fa(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(o)))return[new Ft(i,o,`"${s}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(u[1])} }\`.`)];let p=[];return"symbol"===e.layerType&&"text-font"===s&&Na(En(o))&&"identity"===Pn(o.type)&&p.push(new Ft(i,o,'"text-font" does not support identity functions')),p.concat(r({key:e.key,value:o,valueSpec:c,style:a,styleSpec:n,expressionContext:"property",propertyType:t,propertyKey:s}))}function Vn(e){return On(e,"paint")}function jn(e){return On(e,"layout")}function Nn(e){let t=[],i=e.value,r=e.key,a=e.style,n=e.styleSpec;if("object"!==ja(i))return[new Ft(r,i,`object expected, ${ja(i)} found`)];!i.type&&!i.ref&&t.push(new Ft(r,i,'either "type" or "ref" is required'));let o=Pn(i.type),s=Pn(i.ref);
vendor: 4,161 bytes, line 2
2if(i.id){let n=Pn(i.id);for(let o=0;o<e.arrayIndex;o++){let e=a.layers[o];Pn(e.id)===n&&t.push(new Ft(r,i.id,`duplicate layer id "${i.id}", previously used at line ${e.id.__line__}`))}}if("ref"in i){let e;["type","source","source-layer","filter","layout"].forEach((e=>{e in i&&t.push(new Ft(r,i[e],`"${e}" is prohibited for ref layers`))})),a.layers.forEach((t=>{Pn(t.id)===s&&(e=t)})),e?e.ref?t.push(new Ft(r,i.ref,"ref cannot reference another ref layer")):o=Pn(e.type):t.push(new Ft(r,i.ref,`ref layer "${s}" not found`))}else if("background"!==o)if(i.source){let e=a.sources&&a.sources[i.source],n=e&&Pn(e.type);e?"vector"===n&&"raster"===o?t.push(new Ft(r,i.source,`layer "${i.id}" requires a raster source`)):"raster-dem"!==n&&"hillshade"===o||"raster-dem"!==n&&"color-relief"===o?t.push(new Ft(r,i.source,`layer "${i.id}" requires a raster-dem source`)):"raster"===n&&"raster"!==o?t.push(new Ft(r,i.source,`layer "${i.id}" requires a vector source`)):"vector"!==n||i["source-layer"]?"raster-dem"===n&&"hillshade"!==o&&"color-relief"!==o?t.push(new Ft(r,i.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):"line"===o&&i.paint&&i.paint["line-gradient"]&&("geojson"!==n||!e.lineMetrics)&&t.push(new Ft(r,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new Ft(r,i,`layer "${i.id}" must specify a "source-layer"`)):t.push(new Ft(r,i.source,`source "${i.source}" not found`))}else t.push(new Ft(r,i,'missing required property "source"'));return"raster"===o&&i.paint?.resampling&&i.paint?.["raster-resampling"]&&t.push(new Ft(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(Cn({key:r,value:i,valueSpec:n.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(){return[]},type(){return e.validateSpec({key:`${r}.type`,value:i.type,valueSpec:n.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:i,objectKey:"type"})},filter:Fn,layout(e){return Cn({layer:i,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(e){return jn(Va({layerType:o},e))}}})},paint(e){return Cn({layer:i,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(e){return Vn(Va({layerType:o},e))}}})}}})),t}function qn(e){let t=e.value,i=e.key,r=ja(t);return"string"===r?[]:[new Ft(i,t,`string expected, ${r} found`)]}const $n={promoteId:function({key:e,value:t}){if("string"===ja(t))return qn({key:e,value:t});{let i=[];for(let r in t)i.push(...qn({key:`${e}.${r}`,value:t[r]}));return i}}};function Un(e){let t=e.value,i=e.key,r=e.styleSpec,a=e.style,n=e.validateSpec;if(!t.type)return[new Ft(i,t,'"type" is required')];let o,s=Pn(t.type);switch(s){case"vector":case"raster":return o=Cn({key:i,value:t,valueSpec:r[`source_${s.replace("-","_")}`],style:e.style,styleSpec:r,objectElementValidators:$n,validateSpec:n}),o;case"raster-dem":return o=function(e){let t=e.sourceName??"",i=e.value,r=e.styleSpec,a=r.source_raster_dem,n=e.style,o=[],s=ja(i);if(void 0===i)return o;if("object"!==s)return o.push(new Ft("source_raster_dem",i,`object expected, ${s} found`)),o;let l="custom"===Pn(i.encoding),h=["redFactor","greenFactor","blueFactor","baseShift"],u=e.value.encoding?`"${e.value.encoding}"`:"Default";for(let s in i)!l&&h.includes(s)?o.push(new Ft(s,i[s],`In "${t}": "${s}" is only valid when "encoding" is set to "custom". ${u} encoding found`)):a[s]?o=o.concat(e.validateSpec({key:s,value:i[s],valueSpec:a[s],validateSpec:e.validateSpec,style:n,styleSpec:r})):o.push(new Ft(s,i[s],`unknown property "${s}"`));return o}({sourceName:i,value:t,style:e.style,styleSpec:r,validateSpec:n}),o;case"geojson":if(o=Cn({key:i,value:t,valueSpec:r.source_geojson,style:a,styleSpec:r,validateSpec:n,objectElementValidators:$n}),t.cluster)for(let e in t.clusterProperties){let[r,a]=t.clusterProperties[e],s="string"==typeof r?[r,["accumulated"],["get",e]]:r;
vendor: 4,299 bytes, line 2
2o.push(...zn({key:`${i}.${e}.map`,value:a,validateSpec:n,expressionContext:"cluster-map"})),o.push(...zn({key:`${i}.${e}.reduce`,value:s,validateSpec:n,expressionContext:"cluster-reduce"}))}return o;case"video":return Cn({key:i,value:t,valueSpec:r.source_video,style:a,validateSpec:n,styleSpec:r});case"image":return Cn({key:i,value:t,valueSpec:r.source_image,style:a,validateSpec:n,styleSpec:r});case"canvas":return[new Ft(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Dn({key:`${i}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:a,validateSpec:n,styleSpec:r})}}function Gn(e){let t=e.value,i=e.styleSpec,r=i.light,a=e.style,n=[],o=ja(t);if(void 0===t)return n;if("object"!==o)return n=n.concat([new Ft("light",t,`object expected, ${o} found`)]),n;for(let o in t){let s=o.match(/^(.*)-transition$/);n=s&&r[s[1]]&&r[s[1]].transition?n.concat(e.validateSpec({key:o,value:t[o],valueSpec:i.transition,validateSpec:e.validateSpec,style:a,styleSpec:i})):r[o]?n.concat(e.validateSpec({key:o,value:t[o],valueSpec:r[o],validateSpec:e.validateSpec,style:a,styleSpec:i})):n.concat([new Ft(o,t[o],`unknown property "${o}"`)])}return n}function Zn(e){let t=e.value,i=e.styleSpec,r=i.sky,a=e.style,n=ja(t);if(void 0===t)return[];if("object"!==n)return[new Ft("sky",t,`object expected, ${n} 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 Ft(n,t[n],`unknown property "${n}"`)]);return o}function Wn(e){let t=e.value,i=e.styleSpec,r=i.terrain,a=e.style,n=[],o=ja(t);if(void 0===t)return n;if("object"!==o)return n=n.concat([new Ft("terrain",t,`object expected, ${o} found`)]),n;for(let o in t)n=r[o]?n.concat(e.validateSpec({key:o,value:t[o],valueSpec:r[o],validateSpec:e.validateSpec,style:a,styleSpec:i})):n.concat([new Ft(o,t[o],`unknown property "${o}"`)]);return n}function Hn(e){let t=[],i=e.value,r=e.key;if(Array.isArray(i)){let a=[],n=[];for(let o in i)i[o].id&&a.includes(i[o].id)&&t.push(new Ft(r,i,`all the sprites' ids must be unique, but ${i[o].id} is duplicated`)),a.push(i[o].id),i[o].url&&n.includes(i[o].url)&&t.push(new Ft(r,i,`all the sprites' URLs must be unique, but ${i[o].url} is duplicated`)),n.push(i[o].url),t=t.concat(Cn({key:`${r}[${o}]`,value:i[o],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:e.validateSpec}));return t}return qn({key:r,value:i})}function Xn(e){return!!e&&e.constructor===Object}function Yn(e){return Xn(e.value)?[]:[new Ft(e.key,e.value,`object expected, ${ja(e.value)} found`)]}const Kn={"*"(){return[]},array:Mn,boolean:function(e){let t=e.value,i=e.key,r=ja(t);return"boolean"===r?[]:[new Ft(i,t,`boolean expected, ${r} found`)]},number:In,color:kn,constants:Sn,enum:Dn,filter:Fn,function:An,layer:Nn,object:Cn,source:Un,light:Gn,sky:Zn,terrain:Wn,projection:function(e){let t=e.value,i=e.styleSpec,r=i.projection,a=e.style,n=ja(t);if(void 0===t)return[];if("object"!==n)return[new Ft("projection",t,`object expected, ${n} 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 Ft(n,t[n],`unknown property "${n}"`)]);return o},projectionDefinition:function(e){let t=e.key,i=e.value;i=i instanceof String?i.valueOf():i;let r=ja(i);return"array"!==r||function(e){return Array.isArray(e)&&3===e.length&&"string"==typeof e[0]&&"string"==typeof e[1]&&"number"==typeof e[2]}(i)||function(e){return!!["interpolate","step","literal"].includes(e[0])}(i)?["array","string"].includes(r)?[]:[new Ft(t,i,`projection expected, invalid type "${r}" found`)]:[new Ft(t,i,`projection expected, invalid array ${JSON.stringify(i)} found`)]},string:qn,formatted:function(e){return 0===qn(e).length?[]:zn(e)},resolvedImage:function(e){return 0===qn(e).length?[]:zn(e)},padding:function(e){let t=e.key,i=e.value;if("array"===ja(i)){if(i.length<1||i.length>4)return[new Ft(t,i,`padding requires 1 to 4 values; ${i.length} values found`)];let r={type:"number"},a=[];for(let n=0;n<i.length;n++)a=a.concat(e.validateSpec({key:`${t}[${n}]`,value:i[n],validateSpec:e.validateSpec,valueSpec:r}));return a}return In({key:t,value:i,valueSpec:{}}
vendor: 4,929 bytes, line 2
2)},numberArray:function(e){let t=e.key,i=e.value;if("array"===ja(i)){let r={type:"number"};if(i.length<1)return[new Ft(t,i,"array length at least 1 expected, length 0 found")];let a=[];for(let n=0;n<i.length;n++)a=a.concat(e.validateSpec({key:`${t}[${n}]`,value:i[n],validateSpec:e.validateSpec,valueSpec:r}));return a}return In({key:t,value:i,valueSpec:{}})},colorArray:function(e){let t=e.key,i=e.value;if("array"===ja(i)){if(i.length<1)return[new Ft(t,i,"array length at least 1 expected, length 0 found")];let e=[];for(let r=0;r<i.length;r++)e=e.concat(kn({key:`${t}[${r}]`,value:i[r],valueSpec:{}}));return e}return kn({key:t,value:i,valueSpec:{}})},variableAnchorOffsetCollection:function(e){let t=e.key,i=e.value,r=ja(i),a=e.styleSpec;if("array"!==r||i.length<1||i.length%2!=0)return[new Ft(t,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let n=[];for(let r=0;r<i.length;r+=2)n=n.concat(Dn({key:`${t}[${r}]`,value:i[r],valueSpec:a.layout_symbol["text-anchor"]})),n=n.concat(Mn({key:`${t}[${r+1}]`,value:i[r+1],valueSpec:{length:2,value:"number"},validateSpec:e.validateSpec,style:e.style,styleSpec:a}));return n},sprite:Hn,state:Yn,fontFaces:function(e){let t=e.key,i=e.value,r=e.validateSpec,a=e.styleSpec,n=e.style;if(!Xn(i))return[new Ft(t,i,`object expected, ${ja(i)} found`)];let o=[];for(let e in i){let s=i[e],l=ja(s);if("string"===l)o.push(...qn({key:`${t}.${e}`,value:s}));else if("array"===l){let i={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[l,h]of s.entries())o.push(...Cn({key:`${t}.${e}[${l}]`,value:h,valueSpec:i,styleSpec:a,style:n,validateSpec:r}))}else o.push(new Ft(`${t}.${e}`,s,`string or array expected, ${l} found`))}return o}};function Jn(e){let t=e.value,i=e.valueSpec,r=e.styleSpec;return e.validateSpec=Jn,i.expression&&Na(Pn(t))?An(e):i.expression&&Ja(En(t))?zn(e):i.type&&Kn[i.type]?Kn[i.type](e):Cn(Va({},e,{valueSpec:i.type?r[i.type]:i}))}function Qn(e){let t=e.value,i=e.key,r=qn(e);return r.length||(-1===t.indexOf("{fontstack}")&&r.push(new Ft(i,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&r.push(new Ft(i,t,'"glyphs" url must include a "{range}" token'))),r}function eo(e,t=wt){let i=[];return i=i.concat(Jn({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:Jn,objectElementValidators:{glyphs:Qn,"*"(){return[]}}})),e.constants&&(i=i.concat(Sn({key:"constants",value:e.constants,style:e,styleSpec:t,validateSpec:Jn}))),io(i)}function to(e){return function(t){return e(Object.assign({},t,{validateSpec:Jn}))}}function io(e){return[].concat(e).sort(((e,t)=>e.line-t.line))}function ro(e){return function(...t){return io(e.apply(this,t))}}eo.source=ro(to(Un)),eo.sprite=ro(to(Hn)),eo.glyphs=ro(to(Qn)),eo.light=ro(to(Gn)),eo.sky=ro(to(Zn)),eo.terrain=ro(to(Wn)),eo.state=ro(to(Yn)),eo.layer=ro(to(Nn)),eo.filter=ro(to(Fn)),eo.paintProperty=ro(to(Vn)),eo.layoutProperty=ro(to(jn));const ao={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"};var no=class{constructor(e,t,i){this._rootKey=t,this._globalState=i,this.setValue(e)}evaluate(){return this._literalValue??this._compiledValue.evaluate({})}setValue(e){if(null==e||"visible"===e||"none"===e)return this._literalValue="none"===e?"none":"visible",this._compiledValue=void 0,void(this._globalStateRefs=new Set);let t=Qa(e,this._rootKey,ao,this._globalState);if("error"===t.result)throw this._literalValue="visible",this._compiledValue=void 0,Error(t.value.map((e=>`${e.key}: ${e.message}`)).join(", "));this._literalValue=void 0,this._compiledValue=t.value,this._globalStateRefs=on(t.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};const oo=eo,so=new Set(Object.keys(wt).filter((e=>e.startsWith("source_"))).map((e=>e.slice(7).replaceAll("_","-"))));function lo(e,t){let i=function(e){return Object.entries(e.sources??{}).filter((([,e])=>!so.has(e.type))).map((([e])=>`sources.${e}`))}(t);return ho(e,oo(t).filter((({message:e})=>!i.some((t=>e.startsWith(`${t}:`)||e.startsWith(`${t}.`))))))}function ho(e,t){let i=!1;for(let r of t)"warning"!==r.severity?(e.fire(new xt(Error(r.message))),i=!0):je(r.message);return i}function uo(e,t,i,r){return!1!==r?.validate&&ho(e,t({styleSpec:wt,...i}))}var co=class e{constructor(e,t,i){let r=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let a=new Int32Array(this.arrayBuffer);e=a[0],t=a[1],i=a[2],this.d=t+2*i;for(let e=0;e<this.d*this.d;e++){let t=a[3+e],i=a[3+e+1];r.push(t===i?null:a.subarray(t,i))}let n=a[3+r.length],o=a[3+r.length+1];this.keys=a.subarray(n,o),this.bboxes=a.subarray(o),this.insert=this._insertReadonly}else{this.d=t+2*i;for(let e=0;e<this.d*this.d;e++)r.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=i,this.scale=t/e,this.uid=0;let a=i/t*e;this.min=-a,this.max=e+a}
vendor: 7,750 bytes, line 2
2insert(e,t,i,r,a){this._forEachCell(t,i,r,a,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(a)}_insertReadonly(){throw Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,t,i,r,a,n){this.cells[a].push(n)}query(e,t,i,r,a){let n=this.min,o=this.max;if(e<=n&&t<=n&&o<=i&&o<=r&&!a)return[...this.keys];{let n=[];return this._forEachCell(e,t,i,r,this._queryCell,n,{},a),n}}_queryCell(e,t,i,r,a,n,o,s){let l=this.cells[a];if(null!==l){let a=this.keys,h=this.bboxes;for(let u of l)if(void 0===o[u]){let l=4*u;(s?s(h[l+0],h[l+1],h[l+2],h[l+3]):e<=h[l+2]&&t<=h[l+3]&&i>=h[l+0]&&r>=h[l+1])?(o[u]=!0,n.push(a[u])):o[u]=!1}}}_forEachCell(e,t,i,r,a,n,o,s){let l=this._convertToCellCoord(e),h=this._convertToCellCoord(t),u=this._convertToCellCoord(i),c=this._convertToCellCoord(r);for(let p=l;p<=u;p++)for(let l=h;l<=c;l++){let h=this.d*l+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(l),this._convertFromCellCoord(p+1),this._convertFromCellCoord(l+1)))&&a.call(this,e,t,i,r,h,n,o,s))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,t=3+this.cells.length+1+1,i=0;for(let e of this.cells)i+=e.length;let r=new Int32Array(t+i+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;let a=t;for(let t=0;t<e.length;t++){let i=e[t];r[3+t]=a,r.set(i,a),a+=i.length}return r[3+e.length]=a,r.set(this.keys,a),a+=this.keys.length,r[3+e.length+1]=a,r.set(this.bboxes,a),a+=this.bboxes.length,r.buffer}static serialize(e,t){let i=e.toArrayBuffer();return t&&t.push(i),{buffer:i}}static deserialize(t){return new e(t.buffer)}};const po={};function fo(e,t,i={}){if(po[e])throw Error(`${e} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),po[e]={klass:t,omit:i.omit||[],shallow:i.shallow||[]}}fo("Object",Object),fo("Set",Set),fo("TransferableGridIndex",co),fo("Color",ki),fo("Error",Error),fo("AJAXError",pt),fo("ResolvedImage",$i),fo("StylePropertyFunction",an),fo("StyleExpression",Xa,{omit:["_evaluator"]}),fo("ZoomDependentExpression",tn),fo("ZoomConstantExpression",en),fo("CompoundExpression",Pa,{omit:["_evaluate"]});for(let e in Sa)Sa[e]._classRegistryKey||fo(`Expression_${e}`,Sa[e]);function mo(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||"ArrayBuffer"===e.constructor?.name)}function go(e){let t=e.constructor;return e.$name||t._classRegistryKey}function _o(e){return!function(e){if("object"!=typeof e||!e)return!1;let t=go(e);return t&&"Object"!==t}(e)&&(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||e instanceof Error||mo(e)||Ue(e)||ArrayBuffer.isView(e)||e instanceof ImageData)}function yo(e,t){if(_o(e))return(mo(e)||Ue(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 i=[];for(let r of e)i.push(yo(r,t));return i}if("object"!=typeof e)throw Error("can't serialize object of type "+typeof e);let i=go(e);if(!i)throw Error(`can't serialize object of unregistered class ${e.constructor.name}`);if(!po[i])throw Error(`${i} is not registered.`);let{klass:r}=po[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 r in e){if(!e.hasOwnProperty(r)||po[i].omit.includes(r))continue;let n=e[r];void 0!==n&&(a[r]=po[i].shallow.includes(r)?n:yo(n,t))}e instanceof Error&&(a.message=e.message)}if(a.$name)throw Error("$name property is reserved for worker serialization logic.");return"Object"!==i&&(a.$name=i),a}function vo(e){if(_o(e))return e;if(Array.isArray(e))return e.map(vo);if("object"!=typeof e)throw Error("can't deserialize object of type "+typeof e);let t=go(e)||"Object";if(!po[t])throw Error(`can't deserialize unregistered class ${t}`);let{klass:i}=po[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 i of Object.keys(e)){if("$name"===i)continue;let a=e[i];r[i]=po[t].shallow.includes(i)?a:vo(a)}return r}var xo=class{constructor(){this.first=!0}update(e,t){let i=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=i,!0))}};function bo(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 wo(e){for(let t of e)if(bo(t.codePointAt(0)))return!0;return!1}function To(e){let t=e.map((e=>{try{return RegExp(`\\p{sc=${e}}`,"u").source}catch{return null}})).filter((e=>e));return new RegExp(t.join("|"),"u")}To(["Arab","Dupl","Mong","Ougr","Syrc"]);const So=To("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 Po(e){return So.test(String.fromCodePoint(e))}function Eo(e,t){return!(!t&&Po(e))&&!function(e){return/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(e))}(e)}function Co(e){for(let t of e)if(Po(t.codePointAt(0)))return!0;return!1}const Mo=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(Mo.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getRTLTextPluginStatus(){return this.pluginStatus}
vendor: 4,156 bytes, line 2
2async syncState(e,t){if(this.isParsed())return this.getState();if("loading"!==e.pluginStatus)return this.setState(e),e;let i=e.pluginURL,r=new Promise((e=>{this.loadScriptResolve=e})),a=new Promise((e=>setTimeout((()=>e()),this.TIMEOUT)));if(await t(i),await Promise.race([r,a]),this.isParsed()){let e={pluginStatus:"loaded",pluginURL:i};return this.setState(e),e}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${i}`)}};var Io=class{constructor(e,t){this.isSupportedScript=Ao,this.zoom=e,t?(this.now=t.now||0,this.fadeDuration=t.fadeDuration||0,this.zoomHistory=t.zoomHistory||new xo,this.transition=t.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new xo,this.transition={})}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,t=e-Math.floor(e),i=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*t}}};function Ao(e){return function(e,t){for(let i of e)if(!Eo(i.codePointAt(0),t))return!1;return!0}(e,"loaded"===Mo.getRTLTextPluginStatus())}const zo="-transition";var ko=class{constructor(e,t,i,r){this.property=e,this.value=t,this.expression=function(e,t,i,r){if(Na(e))return new an(e,t,i);if(Ja(e)){let a=rn(e,t,i,r);if("error"===a.result)throw Error(a.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return a.value}{let t=e;return"color"===i.type&&"string"==typeof e?t=ki.parse(e):"padding"!==i.type||"number"!=typeof e&&!Array.isArray(e)?"numberArray"!==i.type||"number"!=typeof e&&!Array.isArray(e)?"colorArray"!==i.type||"string"!=typeof e&&!Array.isArray(e)?"variableAnchorOffsetCollection"===i.type&&Array.isArray(e)?t=qi.parse(e):"projectionDefinition"===i.type&&"string"==typeof e&&(t=Ui.parse(e)):t=Vi.parse(e):t=Oi.parse(e):t=Bi.parse(e),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>t}}}(void 0===t?e.specification.default:t,i,e.specification,r)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,t,i){return this.property.possiblyEvaluate(this,e,t,i)}},Do=class{constructor(e,t,i){this.property=e,this.value=new ko(e,void 0,t,i)}transitioned(e,t){return new Lo(this.property,this.value,t,Me({},e.transition,this.transition),e.now)}untransitioned(){return new Lo(this.property,this.value,null,{},0)}},Ro=class{constructor(e,t,i){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=i,this._rootKey=t}_propertyRootKey(e){return`${this._rootKey}.${String(e)}`}hasProperty(e){return e in this._properties.defaultTransitionablePropertyValues}getValue(e){return Oe(this._values[e].value.value)}setValue(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new Do(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].value=new ko(this._values[e].property,null===t?void 0:Oe(t),this._propertyRootKey(e),this._globalState)}getTransition(e){return Oe(this._values[e].transition)}setTransition(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new Do(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].transition=Oe(t)||void 0}serialize(){let e={};for(let t of Object.keys(this._values)){let i=this.getValue(t);void 0!==i&&(e[t]=i);let r=this.getTransition(t);void 0!==r&&(e[`${t}${zo}`]=r)}return e}transitioned(e,t){let i=new Fo(this._properties);for(let r of Object.keys(this._values))i._values[r]=this._values[r].transitioned(e,t._values[r]);return i}untransitioned(){let e=new Fo(this._properties);for(let t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}},Lo=class{constructor(e,t,i,r,a){this.property=e,this.value=t,this.begin=a+r.delay||0,this.end=this.begin+r.duration||0,e.specification.transition&&(r.delay||r.duration)&&(this.prior=i)}possiblyEvaluate(e,t,i){let r=e.now||0,a=this.value.possiblyEvaluate(e,t,i),n=this.prior;if(!n)return a;
vendor: 5,641 bytes, line 2
2if(r>this.end||this.value.isDataDriven())return this.prior=null,a;if(r<this.begin)return n.possiblyEvaluate(e,t,i);{let o=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(n.possiblyEvaluate(e,t,i),a,function(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)}(o))}}},Fo=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,i){let r=new Vo(this._properties);for(let a of Object.keys(this._values))r._values[a]=this._values[a].possiblyEvaluate(e,t,i);return r}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}},Bo=class{constructor(e,t,i){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._globalState=i,this._rootKey=t}_propertyRootKey(e){return`${this._rootKey}.${String(e)}`}hasValue(e){return void 0!==this._values[e].value}hasProperty(e){return e in this._properties.defaultPropertyValues}getValue(e){return Oe(this._values[e].value)}setValue(e,t){this._values[e]=new ko(this._values[e].property,null===t?void 0:Oe(t),this._propertyRootKey(e),this._globalState)}serialize(){let e={};for(let t of Object.keys(this._values)){let i=this.getValue(t);void 0!==i&&(e[t]=i)}return e}possiblyEvaluate(e,t,i){let r=new Vo(this._properties);for(let a of Object.keys(this._values))r._values[a]=this._values[a].possiblyEvaluate(e,t,i);return r}},Oo=class{constructor(e,t,i){this.property=e,this.value=t,this.parameters=i}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,i,r){return this.property.evaluate(this.value,this.parameters,e,t,i,r)}},Vo=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}};function jo(e){if(Array.isArray(e))return e.length;let t=e?.values;return Array.isArray(t)?t.length:void 0}function No(e,t){let i=jo(e),r=jo(t);return void 0!==i&&void 0!==r&&i!==r}var qo=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t){if(e.isDataDriven())throw Error("Value should not be data driven");return e.expression.evaluate(t)}interpolate(e,t,i){if(No(e,t))return je(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),t;let r=hr[this.specification.type];return r?r(e,t,i):e}},$o=class{constructor(e,t,i){this.specification=e,this.name=t,this.overrides=i}possiblyEvaluate(e,t,i,r){return"constant"===e.expression.kind||"camera"===e.expression.kind?new Oo(this,{kind:"constant",value:e.expression.evaluate(t,null,{},i,r)},t):new Oo(this,e.expression,t)}interpolate(e,t,i){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new Oo(this,{kind:"constant",value:void 0},e.parameters);if(No(e.value.value,t.value.value))return je(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),t;let r=hr[this.specification.type];if(r){let a=r(e.value.value,t.value.value,i);return new Oo(this,{kind:"constant",value:a},e.parameters)}return e}evaluate(e,t,i,r,a,n){return"constant"===e.kind?e.value:e.evaluate(t,i,r,a,n)}},Uo=class extends $o{possiblyEvaluate(e,t,i,r){if(void 0===e.value)return new Oo(this,{kind:"constant",value:void 0},t);if("constant"===e.expression.kind){let a=e.expression.evaluate(t,null,{},i,r),n="resolvedImage"===e.property.specification.type&&"string"!=typeof a?a.name:a,o=this._calculate(n,n,n,t);return new Oo(this,{kind:"constant",value:o},t)}if("camera"===e.expression.kind){let i=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new Oo(this,{kind:"constant",value:i},t)}return new Oo(this,e.expression,t)}evaluate(e,t,i,r,a,n){if("source"===e.kind){let o=e.evaluate(t,i,r,a,n);return this._calculate(o,o,o,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},i,r),e.evaluate({zoom:Math.floor(t.zoom)},i,r),e.evaluate({zoom:Math.floor(t.zoom)+1},i,r),t):e.value}_calculate(e,t,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:i,to:t}}interpolate(e){return e}},Go=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t,i,r){if(void 0!==e.value){if("constant"===e.expression.kind){let a=e.expression.evaluate(t,null,{},i,r);return this._calculate(a,a,a,t)}return this._calculate(e.expression.evaluate(new Io(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Io(Math.floor(t.zoom),t)),e.expression.evaluate(new Io(Math.floor(t.zoom+1),t)),t)}}_calculate(e,t,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:i,to:t}}interpolate(e){return e}},Zo=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t,i,r){return!!e.expression.evaluate(t,null,{},i,r)}interpolate(){return!1}},Wo=class{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let t in e){let i=e[t];i.specification.overridable&&this.overridableProperties.push(t);let r=this.defaultPropertyValues[t]=new ko(i,void 0,i.name,void 0),a=this.defaultTransitionablePropertyValues[t]=new Do(i,i.name,void 0);this.defaultTransitioningPropertyValues[t]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=r.possiblyEvaluate({})}}};fo("DataDrivenProperty",$o),fo("DataConstantProperty",qo),fo("CrossFadedDataDrivenProperty",Uo),fo("
2CrossFadedProperty",Go),fo("ColorRampProperty",Zo);const Ho=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",Xo=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?";var Yo=class extends bt{constructor(e,t,i){if(super(),this.id=e.id,this.type=e.type,this._globalState=i,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=function(e,t,i){return new no(e,t,i)}(this.visibility,`layers[${this.id}].layout.visibility`,i),"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=gn(e.filter,`layers[${this.id}].filter`,i)),t.layout&&(this._unevaluatedLayout=new Bo(t.layout,`layers[${this.id}].layout`,i)),t.paint)){this._transitionablePaint=new Ro(t.paint,`layers[${this.id}].paint`,i);for(let t in e.paint)this.setPaintProperty(t,e.paint[t],{validate:!1});for(let t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Vo(t.paint)}}setFilter(e){this.filter=e,this._featureFilter=gn(e,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){if("visibility"===e)return this.visibility;if(this._transitionablePaint?.hasProperty(e))throw Error(e+Ho);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${e}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;for(let t of this._visibilityExpression.getGlobalStateRefs())e.add(t);if(this._unevaluatedLayout)for(let t in this._unevaluatedLayout._values){let i=this._unevaluatedLayout._values[t];for(let t of i.getGlobalStateRefs())e.add(t)}for(let t of this._featureFilter.getGlobalStateRefs())e.add(t);return e}getPaintAffectingGlobalStateRefs(){let e=new globalThis.Map;if(this._transitionablePaint)for(let t in this._transitionablePaint._values){let i=this._transitionablePaint._values[t].value;for(let r of i.getGlobalStateRefs()){let a=e.get(r)??[];a.push({name:t,value:i.value}),e.set(r,a)}}return e}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(e,t,i={}){if("visibility"===e)return this.visibility=t,this._visibilityExpression.setValue(t),void this.recalculateVisibility();this._transitionablePaint?.hasProperty(e)?this.fire(new xt(Error(e+Ho))):null!=t&&this._validate(oo.layoutProperty,`layers.${this.id}.layout.${e}`,e,t,i)||this._unevaluatedLayout.setValue(e,t)}getPaintProperty(e){if(e.endsWith("-transition")){let t=e.slice(0,-11);if("visibility"===t||this._unevaluatedLayout?.hasProperty(t))throw Error(e+Xo);return this._transitionablePaint.getTransition(t)}if("visibility"===e||this._unevaluatedLayout?.hasProperty(e))throw Error(e+Xo);return this._transitionablePaint.getValue(e)}setPaintProperty(e,t,i={}){if("visibility"===e||this._unevaluatedLayout?.hasProperty(e))return this.fire(new xt(Error(e+Xo))),!1;if(null!=t&&this._validate(oo.paintProperty,`layers.${this.id}.paint.${e}`,e,t,i))return!1;if(e.endsWith("-transition"))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;{let i=this._transitionablePaint._values[e],r="cross-faded-data-driven"===i.property.specification["property-type"],a=i.value.isDataDriven(),n=i.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);let o=this._transitionablePaint._values[e].value;return o.isDataDriven()||a||r||this._handleOverridablePaintPropertyUpdate(e,n,o)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,i){return!1}isHidden(e=this.minzoom,t=!1){return!!(this.minzoom&&e<(t?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&e>=this.maxzoom)||"none"===this._evaluatedVisibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}
vendor: 33,118 bytes, line 2
2serialize(){let e={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&&(e.layout||={},e.layout.visibility=this.visibility),Fe(e,((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}_validate(e,t,i,r,a={}){return uo(this,e,{key:t,layerType:this.type,objectKey:i,value:r},a)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let t=this.paint.get(e);if(t instanceof Oo&&Fa(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}};let Ko;var Jo={get paint(){return Ko||=new Wo({"raster-opacity":new qo(wt.paint_raster["raster-opacity"],"raster-opacity"),"raster-hue-rotate":new qo(wt.paint_raster["raster-hue-rotate"],"raster-hue-rotate"),"raster-brightness-min":new qo(wt.paint_raster["raster-brightness-min"],"raster-brightness-min"),"raster-brightness-max":new qo(wt.paint_raster["raster-brightness-max"],"raster-brightness-max"),"raster-saturation":new qo(wt.paint_raster["raster-saturation"],"raster-saturation"),"raster-contrast":new qo(wt.paint_raster["raster-contrast"],"raster-contrast"),resampling:new qo(wt.paint_raster.resampling,"resampling"),"raster-resampling":new qo(wt.paint_raster["raster-resampling"],"raster-resampling"),"raster-fade-duration":new qo(wt.paint_raster["raster-fade-duration"],"raster-fade-duration")})}};const Qo=e=>"raster"===e.type;var es=class extends Yo{constructor(e,t){super(e,Jo,t)}};const ts={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};var is=class{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},rs=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_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(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function as(e,t=1){let i=0,r=0;return{members:e.map((e=>{let a=function(e){return ts[e].BYTES_PER_ELEMENT}(e.type),n=i=ns(i,Math.max(t,a)),o=e.components||1;return r=Math.max(r,a),i+=a*o,{name:e.name,type:e.type,components:o,offset:n}})),size:ns(i,Math.max(r,t)),alignment:t}}function ns(e,t){return Math.ceil(e/t)*t}var os=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){let i=this.length;return this.resize(i+1),this.emplace(i,e,t)}emplace(e,t,i){let r=2*e;return this.int16[r+0]=t,this.int16[r+1]=i,e}};os.prototype.bytesPerElement=4,fo("StructArrayLayout2i4",os);var ss=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)}emplace(e,t,i,r){let a=3*e;return this.int16[a+0]=t,this.int16[a+1]=i,this.int16[a+2]=r,e}};ss.prototype.bytesPerElement=6,fo("StructArrayLayout3i6",ss);var ls=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,r){let a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,r)}emplace(e,t,i,r,a){let n=4*e;return this.int16[n+0]=t,this.int16[n+1]=i,this.int16[n+2]=r,this.int16[n+3]=a,e}};ls.prototype.bytesPerElement=8,fo("StructArrayLayout4i8",ls);var hs=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,r,a,n){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,r,a,n)}emplace(e,t,i,r,a,n,o){let s=6*e;return this.int16[s+0]=t,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=a,this.int16[s+4]=n,this.int16[s+5]=o,e}};hs.prototype.bytesPerElement=12,fo("StructArrayLayout2i4i12",hs);var us=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,r,a,n){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,r,a,n)}emplace(e,t,i,r,a,n,o){let s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=i,this.uint8[l+4]=r,this.uint8[l+5]=a,this.uint8[l+6]=n,this.uint8[l+7]=o,e}};us.prototype.bytesPerElement=8,fo("StructArrayLayout2i4ub8",us);var cs=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){let i=this.length;return this.resize(i+1),this.emplace(i,e,t)}emplace(e,t,i){let r=2*e;return this.float32[r+0]=t,this.float32[r+1]=i,e}};cs.prototype.bytesPerElement=8,fo("StructArrayLayout2f8",cs);var ps=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,r,a,n,o,s,l,h){let u=this.length;return this.resize(u+1),this.emplace(u,e,t,i,r,a,n,o,s,l,h)}emplace(e,t,i,r,a,n,o,s,l,h,u){let c=10*e;return this.uint16[c+0]=t,this.uint16[c+1]=i,this.uint16[c+2]=r,this.uint16[c+3]=a,this.uint16[c+4]=n,this.uint16[c+5]=o,this.uint16[c+6]=s,this.uint16[c+7]=l,this.uint16[c+8]=h,this.uint16[c+9]=u,e}};ps.prototype.bytesPerElement=20,fo("StructArrayLayout10ui20",ps);var ds=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,r,a,n,o,s){let l=this.length;return this.resize(l+1),this.emplace(l,e,t,i,r,a,n,o,s)}emplace(e,t,i,r,a,n,o,s,l){let h=8*e;return this.uint16[h+0]=t,this.uint16[h+1]=i,this.uint16[h+2]=r,this.uint16[h+3]=a,this.uint16[h+4]=n,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,e}};ds.prototype.bytesPerElement=16,fo("StructArrayLayout8ui16",ds);var fs=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,r,a,n,o,s,l,h,u,c){let p=this.length;return this.resize(p+1),this.emplace(p,e,t,i,r,a,n,o,s,l,h,u,c)}emplace(e,t,i,r,a,n,o,s,l,h,u,c,p){let d=12*e;return this.int16[d+0]=t,this.int16[d+1]=i,this.int16[d+2]=r,this.int16[d+3]=a,this.uint16[d+4]=n,this.uint16[d+5]=o,this.uint16[d+6]=s,this.uint16[d+7]=l,this.int16[d+8]=h,this.int16[d+9]=u,this.int16[d+10]=c,this.int16[d+11]=p,e}};fs.prototype.bytesPerElement=24,fo("StructArrayLayout4i4ui4i24",fs);var ms=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)}emplace(e,t,i,r){let a=3*e;return this.float32[a+0]=t,this.float32[a+1]=i,this.float32[a+2]=r,e}};ms.prototype.bytesPerElement=12,fo("StructArrayLayout3f12",ms);var gs=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let i=1*e;return this.uint32[i+0]=t,e}};gs.prototype.bytesPerElement=4,fo("StructArrayLayout1ul4",gs);var _s=class extends rs{_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(e,t,i,r,a,n,o,s,l){let h=this.length;return this.resize(h+1),this.emplace(h,e,t,i,r,a,n,o,s,l)}emplace(e,t,i,r,a,n,o,s,l,h){let u=10*e,c=5*e;return this.int16[u+0]=t,this.int16[u+1]=i,this.int16[u+2]=r,this.int16[u+3]=a,this.int16[u+4]=n,this.int16[u+5]=o,this.uint32[c+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=h,e}};_s.prototype.bytesPerElement=20,fo("StructArrayLayout6i1ul2ui20",_s);var ys=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,r,a,n){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,r,a,n)}emplace(e,t,i,r,a,n,o){let s=6*e;return this.int16[s+0]=t,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=a,this.int16[s+4]=n,this.int16[s+5]=o,e}};ys.prototype.bytesPerElement=12,fo("StructArrayLayout2i2i2i12",ys);var vs=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,r,a){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,i,r,a)}emplace(e,t,i,r,a,n){let o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=i,this.float32[o+2]=r,this.int16[s+6]=a,this.int16[s+7]=n,e}};vs.prototype.bytesPerElement=16,fo("StructArrayLayout2f1f2i16",vs);var xs=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,r,a,n){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,r,a,n)}emplace(e,t,i,r,a,n,o){let s=16*e,l=4*e,h=8*e;return this.uint8[s+0]=t,this.uint8[s+1]=i,this.float32[l+1]=r,this.float32[l+2]=a,this.int16[h+6]=n,this.int16[h+7]=o,e}};xs.prototype.bytesPerElement=16,fo("StructArrayLayout2ub2f2i16",xs);var bs=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)}emplace(e,t,i,r){let a=3*e;return this.uint16[a+0]=t,this.uint16[a+1]=i,this.uint16[a+2]=r,e}};bs.prototype.bytesPerElement=6,fo("StructArrayLayout3ui6",bs);var ws=class extends rs{_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(e,t,i,r,a,n,o,s,l,h,u,c,p,d,f,m,g){let _=this.length;return this.resize(_+1),this.emplace(_,e,t,i,r,a,n,o,s,l,h,u,c,p,d,f,m,g)}emplace(e,t,i,r,a,n,o,s,l,h,u,c,p,d,f,m,g,_){let y=24*e,v=12*e,x=48*e;return this.int16[y+0]=t,this.int16[y+1]=i,this.uint16[y+2]=r,this.uint16[y+3]=a,this.uint32[v+2]=n,this.uint32[v+3]=o,this.uint32[v+4]=s,this.uint16[y+10]=l,this.uint16[y+11]=h,this.uint16[y+12]=u,this.float32[v+7]=c,this.float32[v+8]=p,this.uint8[x+36]=d,this.uint8[x+37]=f,this.uint8[x+38]=m,this.uint32[v+10]=g,this.int16[y+22]=_,e}};ws.prototype.bytesPerElement=48,fo("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ws);var Ts=class extends rs{_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(e,t,i,r,a,n,o,s,l,h,u,c,p,d,f,m,g,_,y,v,x,b,w,T,S,P,E,C){let M=this.length;return this.resize(M+1),this.emplace(M,e,t,i,r,a,n,o,s,l,h,u,c,p,d,f,m,g,_,y,v,x,b,w,T,S,P,E,C)}emplace(e,t,i,r,a,n,o,s,l,h,u,c,p,d,f,m,g,_,y,v,x,b,w,T,S,P,E,C,M){let I=32*e,A=16*e;return this.int16[I+0]=t,this.int16[I+1]=i,this.int16[I+2]=r,this.int16[I+3]=a,this.int16[I+4]=n,this.int16[I+5]=o,this.int16[I+6]=s,this.int16[I+7]=l,this.uint16[I+8]=h,this.uint16[I+9]=u,this.uint16[I+10]=c,this.uint16[I+11]=p,this.uint16[I+12]=d,this.uint16[I+13]=f,this.uint16[I+14]=m,this.uint16[I+15]=g,this.uint16[I+16]=_,this.uint16[I+17]=y,this.uint16[I+18]=v,this.uint16[I+19]=x,this.uint16[I+20]=b,this.uint16[I+21]=w,this.uint16[I+22]=T,this.uint32[A+12]=S,this.float32[A+13]=P,this.float32[A+14]=E,this.uint16[I+30]=C,this.uint16[I+31]=M,e}};Ts.prototype.bytesPerElement=64,fo("StructArrayLayout8i15ui1ul2f2ui64",Ts);var Ss=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let i=1*e;return this.float32[i+0]=t,e}};Ss.prototype.bytesPerElement=4,fo("StructArrayLayout1f4",Ss);var Ps=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)}emplace(e,t,i,r){let a=6*e,n=3*e;return this.uint16[a+0]=t,this.float32[n+1]=i,this.float32[n+2]=r,e}};Ps.prototype.bytesPerElement=12,fo("StructArrayLayout1ui2f12",Ps);var Es=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)}emplace(e,t,i,r){let a=2*e,n=4*e;return this.uint32[a+0]=t,this.uint16[n+2]=i,this.uint16[n+3]=r,e}};Es.prototype.bytesPerElement=8,fo("StructArrayLayout1ul2ui8",Es);var Cs=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){let i=this.length;return this.resize(i+1),this.emplace(i,e,t)}emplace(e,t,i){let r=2*e;return this.uint16[r+0]=t,this.uint16[r+1]=i,e}};Cs.prototype.bytesPerElement=4,fo("StructArrayLayout2ui4",Cs);var Ms=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let i=1*e;return this.uint16[i+0]=t,e}};Ms.prototype.bytesPerElement=2,fo("StructArrayLayout1ui2",Ms);var Is=class extends rs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,r){let a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,r)}emplace(e,t,i,r,a){let n=4*e;return this.float32[n+0]=t,this.float32[n+1]=i,this.float32[n+2]=r,this.float32[n+3]=a,e}};Is.prototype.bytesPerElement=16,fo("StructArrayLayout4f16",Is);var As=class extends is{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 d(this.anchorPointX,this.anchorPointY)}};As.prototype.size=20;var zs=class extends _s{get(e){return new As(this,e)}};fo("CollisionBoxArray",zs);var ks=class extends is{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(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}};ks.prototype.size=48;var Ds=class extends ws{get(e){return new ks(this,e)}};fo("PlacedSymbolArray",Ds);var Rs=class extends is{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(e){this._structArray.uint32[this._pos4+12]=e}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]}};Rs.prototype.size=64;var Ls=class extends Ts{get(e){return new Rs(this,e)}};fo("SymbolInstanceArray",Ls);var Fs=class extends Ss{getoffsetX(e){return this.float32[1*e+0]}};fo("GlyphOffsetArray",Fs);var Bs=class extends ss{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}};fo("SymbolLineVertexArray",Bs);var Os=class extends is{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]}};Os.prototype.size=12;var Vs=class extends Ps{get(e){return new Os(this,e)}};fo("TextAnchorOffsetArray",Vs);var js=class extends is{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]}};js.prototype.size=8;var Ns=class extends Es{get(e){return new js(this,e)}};fo("FeatureIndexArray",Ns);var qs=class extends os{},$s=class extends ss{},Us=class extends ls{},Gs=class extends os{},Zs=class extends os{},Ws=class extends hs{},Hs=class extends us{},Xs=class extends cs{},Ys=class extends ps{},Ks=class extends ds{},Js=class extends fs{},Qs=class extends ms{},el=class extends gs{},tl=class extends ys{},il=class extends vs{},rl=class extends xs{},al=class extends bs{},nl=class extends bs{},ol=class extends Cs{},sl=class extends Ms{};const ll=as([{name:"a_pos",components:2,type:"Int16"}],4),hl=ll.members;ll.size,ll.alignment;var ul=class e{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(t,i,r,a){let n=this.segments[this.segments.length-1];return t>e.MAX_VERTEX_ARRAY_LENGTH&&je(`Max vertices per segment is ${e.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${e.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!n||n.vertexLength+t>e.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==a?this.createNewSegment(i,r,a):n}createNewSegment(e,t,i){let r={vertexOffset:e.length,primitiveOffset:t.length,vertexLength:0,primitiveLength:0,vaos:{}};return void 0!==i&&(r.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(r),r}getOrCreateLatestSegment(e,t,i){return this.prepareSegment(0,e,t,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let t in e.vaos)e.vaos[t].destroy()}static simpleSegment(t,i,r,a){return new e([{vertexOffset:t,primitiveOffset:i,vertexLength:r,primitiveLength:a,vaos:{},sortKey:0}])}};function cl(e,t){return 256*(e=Ee(Math.floor(e),0,255))+(t=Ee(Math.floor(t),0,255))}ul.MAX_VERTEX_ARRAY_LENGTH=65535,fo("SegmentVector",ul);const pl=as([{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"}]),dl=as([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var fl=c(((e,t)=>{void 0!==t&&(t.exports=function(e,t){for(var i,r,a=3&e.length,n=e.length-a,o=t,s=3432918353,l=461845907,h=0;h<n;)r=255&e.charCodeAt(h)|(255&e.charCodeAt(++h))<<8|(255&e.charCodeAt(++h))<<16|(255&e.charCodeAt(++h))<<24,++h,o=27492+(65535&(i=5*(65535&(o=(o^=r=(65535&(r=(r=(65535&r)*s+(((r>>>16)*s&65535)<<16)&4294967295)<<15|r>>>17))*l+(((r>>>16)*l&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(i>>>16)&65535)<<16);switch(r=0,a){case 3:r^=(255&e.charCodeAt(h+2))<<16;case 2:r^=(255&e.charCodeAt(h+1))<<8;case 1:o^=r=(65535&(r=(r=(65535&(r^=255&e.charCodeAt(h)))*s+(((r>>>16)*s&65535)<<16)&4294967295)<<15|r>>>17))*l+(((r>>>16)*l&65535)<<16)&4294967295}return o^=e.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0})})),ml=c(((e,t)=>{t.exports=function(e,t){for(var i,r=e.length,a=t^r,n=0;r>=4;)i=1540483477*(65535&(i=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+((1540483477*(i>>>16)&65535)<<16),a=1540483477*(65535&a)+((1540483477*(a>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),r-=4,++n;switch(r){case 3:a^=(255&e.charCodeAt(n+2))<<16;case 2:a^=(255&e.charCodeAt(n+1))<<8;case 1:a=1540483477*(65535&(a^=255&e.charCodeAt(n)))+((1540483477*(a>>>16)&65535)<<16)}return a=1540483477*(65535&(a^=a>>>13))+((1540483477*(a>>>16)&65535)<<16),(a^=a>>>15)>>>0}})),gl=((e,t,i)=>(i=null==e?{}:n(h(e)),p(!t&&e&&e.__esModule?i:o(i,"default",{value:e,enumerable:!0}),e)))(c(((e,t)=>{var i=fl(),r=ml();t.exports=i,t.exports.murmur3=i,t.exports.murmur2=r}))(),1),_l=class e{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,i,r){this.ids.push(yl(e)),this.positions.push(t,i,r)}getPositions(e){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let t=yl(e),i=0,r=this.ids.length-1;for(;i<r;){let e=i+r>>1;this.ids[e]>=t?r=e:i=e+1}let a=[];for(;this.ids[i]===t;){let e=this.positions[3*i],t=this.positions[3*i+1],r=this.positions[3*i+2];a.push({index:e,start:t,end:r}),i++}return a}static serialize(e,t){let i=new Float64Array(e.ids),r=new Uint32Array(e.positions);return vl(i,r,0,i.length-1),t&&t.push(i.buffer,r.buffer),{ids:i,positions:r}}static deserialize(t){let i=new e;return i.ids=t.ids,i.positions=t.positions,i.indexed=!0,i}};function yl(e){let t=+e;return!isNaN(t)&&t<=2**53-1?t:(0,gl.default)(String(e))}function vl(e,t,i,r){for(;i<r;){let a=e[i+r>>1],n=i-1,o=r+1;for(;;){do{n++}while(e[n]<a);do{o--}while(e[o]>a);if(n>=o)break;xl(e,n,o),xl(t,3*n,3*o),xl(t,3*n+1,3*o+1),xl(t,3*n+2,3*o+2)}o-i<r-o?(vl(e,t,i,o),i=o+1):(vl(e,t,o+1,r),r=o)}}function xl(e,t,i){let r=e[t];e[t]=e[i],e[i]=r}fo("FeaturePositionMap",_l);var bl=class{constructor(e,t){this.gl=e.gl,this.location=t}},wl=class extends bl{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))}},Tl=class extends bl{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}},Sl=class extends bl{constructor(e,t){super(e,t),this.current=[0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1])&&(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))}},Pl=class extends bl{constructor(e,t){super(e,t),this.current=[0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2])&&(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))}},El=class extends bl{constructor(e,t){super(e,t),this.current=[0,0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}},Cl=class extends bl{constructor(e,t){super(e,t),this.current=ki.transparent}set(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}},Ml=class extends bl{constructor(e,t){super(e,t),this.current=[]}set(e){if(e!=this.current){this.current=e;let t=new Float32Array(4*e.length);for(let i=0;i<e.length;i++)t[4*i]=e[i].r,t[4*i+1]=e[i].g,t[4*i+2]=e[i].b,t[4*i+3]=e[i].a;this.gl.uniform4fv(this.location,t)}}},Il=class extends bl{constructor(e,t){super(e,t),this.current=[]}set(e){if(e!=this.current){this.current=e;let t=new Float32Array(e);this.gl.uniform1fv(this.location,t)}}};const Al=new Float32Array(16);var zl=class extends bl{constructor(e,t){super(e,t),this.current=Al}set(e){if(e[12]!==this.current[12]||e[0]!==this.current[0])return this.current=e,void this.gl.uniformMatrix4fv(this.location,!1,e);for(let t=1;t<16;t++)if(e[t]!==this.current[t]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);break}}};function kl(e){return[cl(255*e.r,255*e.g),cl(255*e.b,255*e.a)]}var Dl=class{constructor(e,t,i){this.value=e,this.uniformNames=t.map((e=>`u_${e}`)),this.type=i}setUniform(e,t,i){e.set(i.constantOr(this.value))}getBinding(e,t,i){return"color"===this.type?new Cl(e,t):new Tl(e,t)}},Rl=class{constructor(e,t){this.uniformNames=t.map((e=>`u_${e}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setConstantDashPositions(e,t){this.dashTo=[0,e.y,e.height,e.width],this.dashFrom=[0,t.y,t.height,t.width]}setUniform(e,t,i,r){let a=null;"u_pattern_to"===r?a=this.patternTo:"u_pattern_from"===r?a=this.patternFrom:"u_dasharray_to"===r?a=this.dashTo:"u_dasharray_from"===r?a=this.dashFrom:"u_pixel_ratio_to"===r?a=this.pixelRatioTo:"u_pixel_ratio_from"===r&&(a=this.pixelRatioFrom),null!==a&&e.set(a)}getBinding(e,t,i){return i.startsWith("u_pattern")||i.startsWith("u_dasharray_")?new El(e,t):new Tl(e,t)}},Ll=class{constructor(e,t,i,r){this.expression=e,this.type=i,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===i?2:1,offset:0}))),this.paintVertexArray=new r}populatePaintArray(e,t,i){let r=this.paintVertexArray.length,a=this.expression.evaluate(new Io(0,i),t,{},i.canonical,[],i.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(r,e,a)}updatePaintArray(e,t,i,r,a){let n=this.expression.evaluate(new Io(0,a),i,r);this._setPaintValue(e,t,n)}_setPaintValue(e,t,i){if("color"===this.type){let r=kl(i);for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r[0],r[1])}else{for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}}upload(e){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},Fl=class{constructor(e,t,i,r,a,n){this.expression=e,this.uniformNames=t.map((e=>`u_${e}_t`)),this.type=i,this.useIntegerZoom=r,this.zoom=a,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===i?4:2,offset:0}))),this.paintVertexArray=new n}populatePaintArray(e,t,i){let r=this.expression.evaluate(new Io(this.zoom,i),t,{},i.canonical,[],i.formattedSection),a=this.expression.evaluate(new Io(this.zoom+1,i),t,{},i.canonical,[],i.formattedSection),n=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(n,e,r,a)}updatePaintArray(e,t,i,r,a){let n=this.expression.evaluate(new Io(this.zoom,a),i,r),o=this.expression.evaluate(new Io(this.zoom+1,a),i,r);this._setPaintValue(e,t,n,o)}_setPaintValue(e,t,i,r){if("color"===this.type){let a=kl(i),n=kl(r);for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,a[0],a[1],n[0],n[1])}else{for(let a=e;a<t;a++)this.paintVertexArray.emplace(a,i,r);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(r))}}upload(e){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t){let i=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,r=Ee(this.expression.interpolationFactor(i,this.zoom,this.zoom+1),0,1);e.set(r)}getBinding(e,t,i){return new Tl(e,t)}},Bl=class{constructor(e,t,i,r,a,n){this.expression=e,this.type=t,this.useIntegerZoom=i,this.zoom=r,this.layerId=n,this.zoomInPaintVertexArray=new a,this.zoomOutPaintVertexArray=new a}populatePaintArray(e,t,i){let r=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(r,e,this.getPositionIds(t),i)}updatePaintArray(e,t,i,r,a){this._setPaintValues(e,t,this.getPositionIds(i),a)}_setPaintValues(e,t,i,r){let a=this.getPositions(r);if(!a||!i)return;let n=a[i.min],o=a[i.mid],s=a[i.max];if(n&&o&&s)for(let i=e;i<t;i++)this.emplace(this.zoomInPaintVertexArray,i,n,o),this.emplace(this.zoomOutPaintVertexArray,i,s,o)}upload(e){if(this.zoomInPaintVertexArray?.arrayBuffer.byteLength&&this.zoomOutPaintVertexArray?.arrayBuffer.byteLength){let t=this.getVertexAttributes();this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,t,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,t,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},Ol=class extends Bl{getPositions(e){return e.imagePositions}getPositionIds(e){return e.patterns?.[this.layerId]}getVertexAttributes(){return pl.members}emplace(e,t,i,r){e.emplace(t,i.tlbr[0],i.tlbr[1],i.tlbr[2],i.tlbr[3],r.tlbr[0],r.tlbr[1],r.tlbr[2],r.tlbr[3],i.pixelRatio,r.pixelRatio)}},Vl=class extends Bl{getPositions(e){return e.dashPositions}getPositionIds(e){return e.dashes?.[this.layerId]}getVertexAttributes(){return dl.members}emplace(e,t,i,r){e.emplace(t,0,i.y,i.height,i.width,0,r.y,r.height,r.width)}},jl=class{constructor(e,t,i){this.binders={},this._buffers=[];let r=[];for(let a in e.paint._values){if(!i(a))continue;let n=e.paint.get(a);if(!(n instanceof Oo&&Fa(n.property.specification)))continue;let o=ql(a,e.type),s=n.value,l=n.property.specification.type,h=n.property.useIntegerZoom,u=n.property.specification["property-type"],c="cross-faded"===u||"cross-faded-data-driven"===u;if("constant"===s.kind)this.binders[a]=c?new Rl(s.value,o):new Dl(s.value,o,l),r.push(`/u_${a}`);else if("source"===s.kind||c){let i=$l(a,l,"source");
vendor: 4,235 bytes, line 2
2this.binders[a]=c?"line-dasharray"===a?new Vl(s,l,h,t,i,e.id):new Ol(s,l,h,t,i,e.id):new Ll(s,o,l,i),r.push(`/a_${a}`)}else{let e=$l(a,l,"composite");this.binders[a]=new Fl(s,o,l,h,t,e),r.push(`/z_${a}`)}}this.cacheKey=r.sort().join("")}getMaxValue(e){let t=this.binders[e];return t instanceof Ll||t instanceof Fl?t.maxValue:0}populatePaintArrays(e,t,i){for(let r in this.binders){let a=this.binders[r];(a instanceof Ll||a instanceof Fl||a instanceof Bl)&&a.populatePaintArray(e,t,i)}}setConstantPatternPositions(e,t){for(let i in this.binders){let r=this.binders[i];r instanceof Rl&&r.setConstantPatternPositions(e,t)}}setConstantDashPositions(e,t){for(let i in this.binders){let r=this.binders[i];r instanceof Rl&&r.setConstantDashPositions(e,t)}}updatePaintArrays(e,t,i,r,a){let n=!1;for(let o of e){let e=t.getPositions(o.id);for(let t of e){let e=i.feature(t.index);for(let i in this.binders){let s=this.binders[i];(s instanceof Ll||s instanceof Fl||s instanceof Bl)&&!0===s.expression.isStateDependent&&(s.expression=r.paint.get(i).value,s.updatePaintArray(t.start,t.end,e,o.state,a),n=!0)}}}return n}defines(){let e=[];for(let t in this.binders){let i=this.binders[t];(i instanceof Dl||i instanceof Rl)&&e.push(...i.uniformNames.map((e=>`#define HAS_UNIFORM_${e}`)))}return e}getBinderAttributes(){let e=[];for(let t in this.binders){let i=this.binders[t];if(i instanceof Ll||i instanceof Fl)for(let t of i.paintVertexAttributes)e.push(t.name);else if(i instanceof Bl){let t=i.getVertexAttributes();for(let i of t)e.push(i.name)}}return e}getBinderUniforms(){let e=[];for(let t in this.binders){let i=this.binders[t];if(i instanceof Dl||i instanceof Rl||i instanceof Fl)for(let t of i.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){let i=[];for(let r in this.binders){let a=this.binders[r];if(a instanceof Dl||a instanceof Rl||a instanceof Fl)for(let n of a.uniformNames)if(t[n]){let o=a.getBinding(e,t[n],n);i.push({name:n,property:r,binding:o})}}return i}setUniforms(e,t,i,r){for(let{name:e,property:a,binding:n}of t)this.binders[a].setUniform(n,r,i.get(a),e)}updatePaintBuffers(e){this._buffers=[];for(let t in this.binders){let i=this.binders[t];if(e&&i instanceof Bl){let t=2===e.fromScale?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer;t&&this._buffers.push(t)}else(i instanceof Ll||i instanceof Fl)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}}upload(e){for(let t in this.binders){let i=this.binders[t];(i instanceof Ll||i instanceof Fl||i instanceof Bl)&&i.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let t=this.binders[e];(t instanceof Ll||t instanceof Fl||t instanceof Bl)&&t.destroy()}}},Nl=class{constructor(e,t,i=()=>!0){this.programConfigurations={};for(let r of e)this.programConfigurations[r.id]=new jl(r,t,i);this.needsUpload=!1,this._featureMap=new _l,this._bufferOffset=0}populatePaintArrays(e,t,i,r){for(let i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(e,t,r);void 0!==t.id&&this._featureMap.add(t.id,i,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,i,r){for(let a of i)this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(e,this._featureMap,t,a,r)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}};function ql(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}
2-`,"").replace(/-/g,"_")]}function $l(e,t,i){let r={color:{source:cs,composite:Is},number:{source:Ss,composite:cs}};return function(e){return{"line-pattern":{source:Ys,composite:Ys},"fill-pattern":{source:Ys,composite:Ys},"fill-extrusion-pattern":{source:Ys,composite:Ys},"line-dasharray":{source:Ks,composite:Ks}}[e]}(e)?.[i]||r[t][i]}fo("ConstantBinder",Dl),fo("CrossFadedConstantBinder",Rl),fo("SourceExpressionBinder",Ll),fo("CrossFadedPatternBinder",Ol),fo("CrossFadedDasharrayBinder",Vl),fo("CompositeExpressionBinder",Fl),fo("ProgramConfiguration",jl,{omit:["_buffers"]}),fo("ProgramConfigurationSet",Nl);const Ul=16383,Gl=-Ul-1;function Zl(e){let t=ne/e.extent,i=e.loadGeometry();for(let e of i)for(let i of e){let e=Math.round(i.x*t),r=Math.round(i.y*t);i.x=Ee(e,Gl,Ul),i.y=Ee(r,Gl,Ul),(e<i.x||e>i.x+1||r<i.y||r>i.y+1)&&je("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return i}function Wl(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Zl(e):[]}}const Hl=-32768;function Xl(e,t,i,r,a){e.emplaceBack(Hl+8*t+r,Hl+8*i+a)}var Yl=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new Gs,this.indexArray=new nl,this.segments=new ul,this.programConfigurations=new Nl(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,i){let r=this.layers[0],a=[],n=null,o=!1,s="heatmap"===r.type;if("circle"===r.type){let e=r;n=e.layout.get("circle-sort-key"),o=!n.isConstant(),s||="map"===e.paint.get("circle-pitch-alignment")}let l=s?t.subdivisionGranularity.circle:1,h=new Io(this.zoom),u=this.layers[0]._featureFilter.needGeometry;for(let{feature:t,id:r,index:s,sourceLayerIndex:l}of e){let e=Wl(t,u);if(!this.layers[0]._featureFilter.filter(h,e,i))continue;let c=o?n.evaluate(e,{},i):void 0,p={id:r,properties:t.properties,type:t.type,sourceLayerIndex:l,index:s,geometry:u?e.geometry:Zl(t),patterns:{},sortKey:c};a.push(p)}o&&a.sort(((e,t)=>
vendor: 4,860 bytes, line 2
2e.sortKey-t.sortKey));for(let r of a){let{geometry:a,index:n,sourceLayerIndex:o}=r,s=e[n].feature;this.addFeature(r,a,n,i,l),t.featureIndex.insert(s,a,n,o,this.index)}}update(e,t,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:i})}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,hl),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())}addFeature(e,t,i,r,a=1){let n;switch(a){case 1:n=[0,7];break;case 3:n=[0,2,5,7];break;case 5:n=[0,1,3,4,6,7];break;case 7:n=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${a}; valid values are 1, 3, 5, 7.`)}let o=n.length;for(let i of t)for(let t of i){let i=t.x,r=t.y;if(i<0||i>=8192||r<0||r>=8192)continue;let a=this.segments.prepareSegment(o*o,this.layoutVertexArray,this.indexArray,e.sortKey),s=a.vertexLength;for(let e=0;e<o;e++)for(let t=0;t<o;t++)Xl(this.layoutVertexArray,i,r,n[t],n[e]);for(let e=0;e<o-1;e++)for(let t=0;t<o-1;t++){let i=s+e*o+t,r=s+(e+1)*o+t;this.indexArray.emplaceBack(i,r+1,i+1),this.indexArray.emplaceBack(i,r,r+1)}a.vertexLength+=o*o,a.primitiveLength+=(o-1)*(o-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,{imagePositions:{},canonical:r})}};function Kl(e,t){for(let i of e)if(oh(t,i))return!0;for(let i of t)if(oh(e,i))return!0;return th(e,t)}function Jl(e,t,i){return!!oh(e,t)||rh(t,e,i)}function Ql(e,t){if(1===e.length)return nh(t,e[0]);for(let i of t)for(let t of i)if(oh(e,t))return!0;for(let i of e)if(nh(t,i))return!0;for(let i of t)if(th(e,i))return!0;return!1}function eh(e,t,i){if(e.length>1){if(th(e,t))return!0;for(let r of t)if(rh(r,e,i))return!0}for(let r of e)if(rh(r,t,i))return!0;return!1}function th(e,t){if(0===e.length||0===t.length)return!1;for(let i=0;i<e.length-1;i++){let r=e[i],a=e[i+1];for(let e=0;e<t.length-1;e++){if(ih(r,a,t[e],t[e+1]))return!0}}return!1}function ih(e,t,i,r){return Ne(e,i,r)!==Ne(t,i,r)&&Ne(e,t,i)!==Ne(e,t,r)}function rh(e,t,i){let r=i*i;if(1===t.length)return e.distSqr(t[0])<r;for(let i=1;i<t.length;i++){if(ah(e,t[i-1],t[i])<r)return!0}return!1}function ah(e,t,i){let r=t.distSqr(i);if(0===r)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 nh(e,t){let i,r,a,n=!1;for(let o of e){i=o;for(let e=0,o=i.length-1;e<i.length;o=e++)r=i[e],a=i[o],r.y>t.y!=a.y>t.y&&t.x<(a.x-r.x)*(t.y-r.y)/(a.y-r.y)+r.x&&(n=!n)}return n}function oh(e,t){let i=!1;for(let r=0,a=e.length-1;r<e.length;a=r++){let n=e[r],o=e[a];n.y>t.y!=o.y>t.y&&t.x<(o.x-n.x)*(t.y-n.y)/(o.y-n.y)+n.x&&(i=!i)}return i}function sh(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 n=Ne(e,t,i[0]);return n!==Ne(e,t,i[1])||n!==Ne(e,t,i[2])||n!==Ne(e,t,i[3])}function lh(e,t,i){let r=t.paint.get(e).value;return"constant"===r.kind?r.value:i.programConfigurations.get(t.id).getMaxValue(e)}function hh(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function uh(e,t,i,r,a){if(!t[0]&&!t[1])return e;let n=d.convert(t)._mult(a);"viewport"===i&&n._rotate(-r);let o=[];for(let t of e)o.push(t.sub(n));return o}function ch(e){let t=[];for(let i=0;i<e.length;i++){let r=e[i],a=t.at(-1);(0===i||a&&!r.equals(a))&&t.push(r)}return t}function ph({queryGeometry:e,size:t},i){return Jl(e,i,t)}function dh({queryGeometry:e,size:t,transform:i,unwrappedTileID:r,getElevation:a},n){return Jl(e,n,t*(i.projectTileCoordinates(n.x,n.y,r,a).signedDistanceFromCamera/i.cameraToCenterDistance))}function fh({queryGeometry:e,size:t,transform:i,unwrappedTileID:r,getElevation:a},n){let o=i.projectTileCoordinates(n.x,n.y,r,a).signedDistanceFromCamera,s=t*(i.cameraToCenterDistance/o);return Jl(e,_h(n,i,r,a),s)}function mh({queryGeometry:e,size:t,transform:i,unwrappedTileID:r,getElevation:a},n){return Jl(e,_h(n,i,r,a),t)}function gh({queryGeometry:e,size:t,transform:i,unwrappedTileID:r,getElevation:a,pitchAlignment:n="map",pitchScale:o="map"},s){let l="map"===n?"map"===o?ph:dh:"map"===o?fh:mh,h={queryGeometry:e,size:t,transform:i,unwrappedTileID:r,getElevation:a};for(let e of s)for(let t of e)if(l(h,t))return!0;return!1}function _h(e,t,i,r){let a=t.projectTileCoordinates(e.x,e.y,i,r).point;return new d((.5*a.x+.5)*t.width,(.5*-a.y+.5)*t.height)}let yh;fo("CircleBucket",Yl,{omit:["layers"]});let vh;var xh={get paint(){return vh||=new Wo({"circle-radius":new $o(wt.paint_circle["circle-radius"],"cir
2cle-radius"),"circle-color":new $o(wt.paint_circle["circle-color"],"circle-color"),"circle-blur":new $o(wt.paint_circle["circle-blur"],"circle-blur"),"circle-opacity":new $o(wt.paint_circle["circle-opacity"],"circle-opacity"),"circle-translate":new qo(wt.paint_circle["circle-translate"],"circle-translate"),"circle-translate-anchor":new qo(wt.paint_circle["circle-translate-anchor"],"circle-translate-anchor"),"circle-pitch-scale":new qo(wt.paint_circle["circle-pitch-scale"],"circle-pitch-scale"),"circle-pitch-alignment":new qo(wt.paint_circle["circle-pitch-alignment"],"circle-pitch-alignment"),"circle-stroke-width":new $o(wt.paint_circle["circle-stroke-width"],"circle-stroke-width"),"circle-stroke-color":new $o(wt.paint_circle["circle-stroke-color"],"circle-stroke-color"),"circle-stroke-opacity":new $o(wt.paint_circle["circle-stroke-opacity"],"circle-stroke-opacity")})},get layout(){return yh||=new Wo({"circle-sort-key":new $o(wt.layout_circle["circle-sort-key"],"circle-sort-key")})}};var bh=class extends Yo{constructor(e,t){super(e,xh,t)}createBucket(e){return new Yl(e)}queryRadius(e){let t=e;return lh("circle-radius",this,t)+lh("circle-stroke-width",this,t)+hh(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:i,geometry:r,transform:a,pixelsToTileUnits:n,unwrappedTileID:o,getElevation:s}){let l,h,u=uh(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-a.bearingInRadians,n),c=this.paint.get("circle-radius").evaluate(t,i)+this.paint.get("circle-stroke-width").evaluate(t,i),p=this.paint.get("circle-pitch-scale"),d=this.paint.get("circle-pitch-alignment");return"map"===d?(l=u,h=c*n):(l=function(e,t,i,r){return e.map((e=>_h(e,t,i,r)))}(u,a,o,s),h=c),gh({queryGeometry:l,size:h,transform:a,unwrappedTileID:o,getElevation:s,pitchAlignment:d,pitchScale:p},r)}},wh=class extends Yl{};let Th;fo("HeatmapBucket",wh,{omit:["layers"]});var Sh={get paint(){return Th||=new Wo({"heatmap-radius":new $o(wt.paint_heatmap["heatmap-radius"],"heatmap-radius"),"heatmap-weight":new $o(wt.paint_heatmap["heatmap-weight"],"heatmap-weight"),"heatmap-intensity":new qo(wt.paint_heatmap["heatmap-intensity"],"heatmap-intensity"),"heatmap-color":new Zo(wt.paint_heatmap["heatmap-color"],"heatmap-color"),"heatmap-opacity":new qo(wt.paint_heatmap["heatmap-opacity"],"heatmap-opacity")})}};function Ph(e,{width:t,height:i},r,a){if(a){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}`)}else a=new Uint8Array(t*i*r);return e.width=t,e.height=i,e.data=a,e}function Eh(e,{width:t,height:i},r){if(t===e.width&&i===e.height)return;let a=Ph({},{width:t,height:i},r);Ch(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 Ch(e,t,i,r,a,n){if(0===a.width||0===a.height)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,s=t.data;if(o===s)throw Error("srcData equals dstData, so image is already copied");for(let l=0;l<a.height;l++){let h=((i.y+l)*e.width+i.x)*n,u=((r.y+l)*t.width+r.x)*n;for(let e=0;e<a.width*n;e++)s[u+e]=o[h+e]}return t}var Mh=class e{constructor(e,t){Ph(this,e,1,t)}resize(e){Eh(this,e,1)}clone(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,i,r,a){Ch(e,t,i,r,a,1)}},Ih=class e{constructor(e,t){Ph(this,e,4,t)}resize(e){Eh(this,e,4)}replace(e,t){t?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e}clone(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,i,r,a){Ch(e,t,i,r,a,4)}setPixel(e,t,i){let r=4*(e*this.width+t);this.data[r+0]=Math.round(255*i.r/i.a),this.data[r+1]=Math.round(255*i.g/i.a),this.data[r+2]=Math.round(255*i.b/i.a),this.data[r+3]=Math.round(255*i.a)}};function Ah(e){let t=new Uint8Array(e.length);for(let i=0;i<e.length;i+=4){let r=e[i+3];
vendor: 6,106 bytes, line 2
2t[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}function zh(e){let t={},i=e.resolution||256,r=e.clips?e.clips.length:1,a=e.image||new Ih({width:i,height:r});if(!function(e){return Math.log(e)/Math.LN2%1==0}(i))throw Error(`width is not a power of 2 - ${i}`);let n=(r,n,o)=>{t[e.evaluationKey]=o;let s=e.expression.evaluate(t);a.setPixel(r/4/i,n/4,s)};if(e.clips)for(let t=0,a=0;t<r;++t,a+=4*i)for(let r=0,o=0;r<i;r++,o+=4){let s=r/(i-1),{start:l,end:h}=e.clips[t];n(a,o,l*(1-s)+h*s)}else for(let e=0,t=0;e<i;e++,t+=4){n(0,t,e/(i-1))}return a}fo("AlphaImage",Mh),fo("RGBAImage",Ih);const kh="big-fb";var Dh=class extends Yo{createBucket(e){return new wh(e)}constructor(e,t){super(e,Sh,t),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=zh({expression:e,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has("big-fb")&&this.heatmapFbos.delete(kh)}queryRadius(e){return lh("heatmap-radius",this,e)}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:i,geometry:r,transform:a,pixelsToTileUnits:n,unwrappedTileID:o,getElevation:s}){return gh({queryGeometry:e,size:this.paint.get("heatmap-radius").evaluate(t,i)*n,transform:a,unwrappedTileID:o,getElevation:s},r)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&!this.isHidden()}};let Rh;var Lh={get paint(){return Rh||=new Wo({"hillshade-illumination-direction":new qo(wt.paint_hillshade["hillshade-illumination-direction"],"hillshade-illumination-direction"),"hillshade-illumination-altitude":new qo(wt.paint_hillshade["hillshade-illumination-altitude"],"hillshade-illumination-altitude"),"hillshade-illumination-anchor":new qo(wt.paint_hillshade["hillshade-illumination-anchor"],"hillshade-illumination-anchor"),"hillshade-exaggeration":new qo(wt.paint_hillshade["hillshade-exaggeration"],"hillshade-exaggeration"),"hillshade-shadow-color":new qo(wt.paint_hillshade["hillshade-shadow-color"],"hillshade-shadow-color"),"hillshade-highlight-color":new qo(wt.paint_hillshade["hillshade-highlight-color"],"hillshade-highlight-color"),"hillshade-accent-color":new qo(wt.paint_hillshade["hillshade-accent-color"],"hillshade-accent-color"),"hillshade-method":new qo(wt.paint_hillshade["hillshade-method"],"hillshade-method"),resampling:new qo(wt.paint_hillshade.resampling,"resampling")})}};var Fh=class extends Yo{constructor(e,t){super(e,Lh,t),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,t=this.paint.get("hillshade-illumination-altitude").values,i=this.paint.get("hillshade-highlight-color").values,r=this.paint.get("hillshade-shadow-color").values,a=Math.max(e.length,t.length,i.length,r.length);e=e.concat(Array(a-e.length).fill(e.at(-1))),t=t.concat(Array(a-t.length).fill(t.at(-1))),i=i.concat(Array(a-i.length).fill(i.at(-1))),r=r.concat(Array(a-r.length).fill(r.at(-1)));let n=t.map(He);return{directionRadians:e.map(He),altitudeRadians:n,shadowColor:r,highlightColor:i}}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&!this.isHidden()}};let Bh;var Oh={get paint(){return Bh||=new Wo({"color-relief-opacity":new qo(wt["paint_color-relief"]["color-relief-opacity"],"color-relief-opacity"),"color-relief-color":new Zo(wt["paint_color-relief"]["color-relief-color"],"color-relief-color"),resampling:new qo(wt["paint_color-relief"].resampling,"resampling")})}};function Vh(e){return"data"in e}var jh=class{constructor(e,t,i,r){this.context=e,this.format=i,this.texture=e.gl.createTexture(),this._ownedHandle=this.texture,this.update(t,r)}update(e,t,i){let{width:r,height:a}=e,n=(this.size?.[0]!==r||this.size[1]!==a)&&!i,{context:o}=this,{gl:s}=o;this.useMipmap=!!t?.useMipmap,n&&this.size&&this.format===s.RGBA&&(s.deleteTexture(this.texture),this.texture=s.createTexture(),this._ownedHandle=this.texture),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1);let l=this.format===s.RGBA&&!1!==t?.premultiply;if(n)if(this.size=[r,a],this.format===s.RGBA&&r>0&&a>0){let t=this.useMipmap?Math.floor(Math.log2(Math.max(r,a)))+1:1;if(s.texStorage2D(s.TEXTURE_2D,t,s.RGBA8,r,a),Vh(e)){o.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:t}=e;l&&t&&(t=Ah(t)),t&&s.texSubImage2D(s.TEXTURE_2D,0,0,0,r,a,s.RGBA,s.UNSIGNED_BYTE,t)}else o.pixelStoreUnpackPremultiplyAlpha.set(l),s.texSubImage2D(s.TEXTURE_2D,0,0,0,s.RGBA,s.UNSIGNED_BYTE,e)}else Vh(e)?(o.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(e,l,r,a,s)):(o.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(e,s));else{let{x:t,y:n}=i||{x:0,y:0};Vh(e)?(o.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(e,l,t,n,r,a,s)):(o.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(e,t,n,s))}this.useMipmap&&s.generateMipmap(s.TEXTURE_2D),o.pixelStoreUnpackFlipY.setDefault(),o.pixelStoreUnpack.setDefault(),o.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(e,t){t.texImage2D(t.TEXTURE_2D,0,this.format,this.format,t.UNSIGNED_BYTE,e)}_uploadRawData(e,t,i,r,a){let{data:n}=e;t&&n&&(n=Ah(n)),a.texImage2D(a.TEXTURE_2D,0,this.format,i,r,0,this.format,a.UNSIGNED_BYTE,n)}_updateDomImage(e,t,i,r){r.texSubImage2D(r.TEXTURE_2D,0,t,i,r.RGBA,r.UNSIGNED_BYTE,e)}_updateRawData(e,t,i,r,a,n,o){let{data:s}=e;t&&s&&(s=Ah(s)),o.texSubImage2D(o.TEXTURE_2D,0,i,r,a,n,o.RGBA,o.UNSIGNED_BYTE,s)}bind(e,t,i){let{context:r}=this,{gl:a}=r;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),a.bindTexture(a.TEXTURE_2D,this.texture),i===a.LINEAR_MIPMAP_NEAREST&&!this.useMipmap&&(i=a.LINEAR),e!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,i||e),this.filter=e),t!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,t),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,t),this.wrap=t)}
2destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},Nh=class e{static{this.byteViewCache=new WeakMap}constructor(t,i,r,a=1,n=1,o=1,s=0){if(this.uid=t,i.height!==i.width)throw RangeError("DEM tiles must be square");if(r&&!["mapbox","terrarium","custom"].includes(r))return void je(`"${r}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=i.height;let l=this.dim=i.height-2;switch(this.data=new Uint32Array(i.data.buffer),e.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=n,this.blueFactor=o,this.baseShift=s;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let e=0;e<l;e++)this.data[this._idx(-1,e)]=this.data[this._idx(0,e)],this.data[this._idx(l,e)]=this.data[this._idx(l-1,e)],this.data[this._idx(e,-1)]=this.data[this._idx(e,0)],this.data[this._idx(e,l)]=this.data[this._idx(e,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 h=this._getByteView();this.min=2**53-1,this.max=-(2**53-1);for(let e=0;e<l;e++)for(let t=0;t<l;t++){let i=4*this._idx(e,t),r=this._unpackAtIndex(h,i);r>this.max&&(this.max=r),r<this.min&&(this.min=r)}}get(e,t){let i=this._getByteView(),r=4*this._idx(e,t);return this._unpackAtIndex(i,r)}sampleBilinear(e,t){let i=Math.floor(e),r=Math.floor(t);if(i<-1||i>=this.dim||r<-1||r>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${t}, dim: ${this.dim}`);let a=this._getByteView(),n=4*((r+1)*this.stride+i+1),o=4*this.stride,s=e-i,l=t-r;return this._unpackAtIndex(a,n)*(1-s)*(1-l)+this._unpackAtIndex(a,n+4)*s*(1-l)+this._unpackAtIndex(a,n+o)*(1-s)*l+this._unpackAtIndex(a,n+o+4)*s*l}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${t}, dim: ${this.dim}`);return(t+1)*this.stride+(e+1)}unpack(e,t,i){return e*this.redFactor+t*this.greenFactor+i*this.blueFactor-this.baseShift}pack(e){return qh(e,this.getUnpackVector())}getPixels(){return new Ih({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,t,i){if(this.dim!==e.dim)throw Error("dem dimension mismatch");let r=t*this.dim,a=t*this.dim+this.dim,n=i*this.dim,o=i*this.dim+this.dim;switch(t){case-1:r=a-1;break;case 1:a=r+1}switch(i){case-1:n=o-1;break;case 1:o=n+1}let s=-t*this.dim,l=-i*this.dim;for(let t=n;t<o;t++)for(let i=r;i<a;i++)this.data[this._idx(i,t)]=e.data[this._idx(i+s,t+l)]}_getByteView(){let t=e.byteViewCache.get(this);return t?.buffer!==this.data.buffer&&(t=new Uint8Array(this.data.buffer),e.byteViewCache.set(this,t)),t}_unpackAtIndex(e,t){return this.unpack(e[t],e[t+1],e[t+2])}};function qh(e,t){let i=t[0],r=t[1],a=t[2],n=t[3],o=Math.min(i,r,a),s=Math.round((e+n)/o);return{r:Math.floor(s*o/i)%256,g:Math.floor(s*o/r)%256,b:Math.floor(s*o/a)%256}}fo("DEMData",Nh);var $h=class extends Yo{constructor(e,t){super(e,Oh,t)}_createColorRamp(e){let t={elevationStops:[],colorStops:[]},i=this._transitionablePaint._values["color-relief-color"].value.expression;if(i instanceof en&&i._styleExpression.expression instanceof sr){this.colorRampExpression=i;let e=i._styleExpression.expression;t.elevationStops=e.labels,t.colorStops=[];for(let i of t.elevationStops)t.colorStops.push(e.evaluate({globals:{elevation:i}}))}if(t.elevationStops.length<1&&(t.elevationStops=[0],t.colorStops=[ki.transparent]),t.elevationStops.length<2&&(t.elevationStops.push(t.elevationStops[0]+1),t.colorStops.push(t.colorStops[0])),t.elevationStops.length<=e)return t;let r={elevationStops:[],colorStops:[]},a=(t.elevationStops.length-1)/(e-1);for(let e=0;e<t.elevationStops.length-.5;e+=a)r.elevationStops.push(t.elevationStops[Math.round(e)]),r.colorStops.push(t.colorStops[Math.round(e)]);return je(`Too many colors in specification of ${this.id}
2 color-relief layer, may not render properly. Max possible colors: ${e}, provided: ${t.elevationStops.length}`),r}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(e,t,i){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let r=this._createColorRamp(t),a=new Ih({width:r.colorStops.length,height:1}),n=new Ih({width:r.colorStops.length,height:1});for(let e=0;e<r.elevationStops.length;e++){let t=qh(r.elevationStops[e],i);n.setPixel(0,e,new ki(t.r/255,t.g/255,t.b/255,1)),a.setPixel(0,e,r.colorStops[e])}return this.colorRampTextures={elevationTexture:new jh(e,n,e.gl.RGBA),colorTexture:new jh(e,a,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}};const Uh=as([{name:"a_pos",components:2,type:"Int16"}],4),Gh=Uh.members;function Zh(e,t,i){let r=i.patternDependencies,a=!1;for(let i of t){let t=i.paint.get(`${e}-pattern`);t.isConstant()||(a=!0);let n=t.constantOr(null);n&&(a=!0,r[n.to]=!0,r[n.from]=!0)}return a}function Wh(e,t,i,r,a){let{zoom:n}=r,o=a.patternDependencies;for(let r of t){let t=r.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:n-1},i,{},a.availableImages),s=t.evaluate({zoom:n},i,{},a.availableImages),l=t.evaluate({zoom:n+1},i,{},a.availableImages);e=e?.name?e.name:e,s=s?.name?s.name:s,l=l?.name?l.name:l,o[e]=!0,o[s]=!0,o[l]=!0,i.patterns[r.id]={min:e,mid:s,max:l}}}return i}Uh.size,Uh.alignment;const Hh=new Set;let Xh=!1;function Yh(e,t,i=2){let r=t&&t.length,a=r?t[0]*i:e.length;Hh.size&&Hh.clear();let n=Kh(e,0,a,i,!0),o=[];if(!n||n.next===n.prev)return o;let s=0,l=0,h=0;if(r&&(n=function(e,t,i,r){let a=[];for(let i=0,n=t.length;i<n;i++){let o=Kh(e,t[i]*r,i<n-1?t[i+1]*r:e.length,r,!1);o===o.next&&Hh.add(o),a.push(wu(o))}a.sort(nu),function(e,t){let i=Math.ceil((e+2*t)/16)+t+2;su.length<4*i&&(su=new Float64Array(4*i)),lu=0}(e.length/r,t.length),cu(i,i),au=!0;for(let e=0;e<a.length;e++)i=ou(a[e],i);return au=!1,Jh(i)}(e,t,n,i)),e.length>80*i){s=e[0],l=e[1];let t=s,r=l;for(let n=i;n<a;n+=i){let i=e[n],a=e[n+1];i<s&&(s=i),a<l&&(l=a),i>t&&(t=i),a>r&&(r=a)}h=Math.max(t-s,r-l),h=0===h?0:32767/h}return Qh(n,o,s,l,h),o}function Kh(e,t,i,r,a){let n=null;if(a===function(e,t,i,r){let a=0;for(let n=t,o=i-r;n<i;n+=r)a+=(e[o]-e[n])*(e[n+1]+e[o+1]),o=n;return a}(e,t,i,r)>0)for(let a=t;a<i;a+=r)n=zu(a/r|0,e[a],e[a+1],n);else for(let a=i-r;a>=t;a-=r)n=zu(a/r|0,e[a],e[a+1],n);return n&&Eu(n,n.next)&&(ku(n),n=n.next),n}function Jh(e,t=e){let i,r=t===e,a=e;do{i=!1,a===a.next||0!==Hh.size&&Hh.has(a)||!Eu(a,a.next)&&0!==Pu(a.prev,a,a.next)?(r||a!==t)&&(a=a.next,i=!r):((r||a===t)&&(t=a.prev),Xh=!0,ku(a),a=a.prev,i=!0)}while(i||a!==t);return t}function Qh(e,t,i,r,a){a&&function(e,t,i,r){let a=e,n=0;do{a.z=bu(a.x,a.y,t,i,r),mu[n++]=a,a=a.next}while(a!==e);!function(e){if(e<=32){for(let t=1;t<e;t++){let e=mu[t],i=e.z,r=t-1;for(;r>=0&&mu[r].z>i;)mu[r+1]=mu[r],r--;mu[r+1]=e}return}_u.length<e&&(_u=new Uint32Array(e),yu=new Uint32Array(e),gu=Array(e));for(let t=0;t<e;t++)_u[t]=mu[t].z;xu(e,mu,_u,gu,yu,0),xu(e,gu,yu,mu,_u,8),xu(e,mu,_u,gu,yu,16),xu(e,gu,yu,mu,_u,24)}(n);let o=null;for(let e=0;e<n;e++){let t=mu[e];t.prevZ=o,o&&(o.nextZ=t),o=t}o.nextZ=null}(e,i,r,a);let n=e,o=!1;for(;e.prev!==e.next;){let s=e.prev,l=e.next;if(Pu(s,e,l)<0&&(a?tu(e,i,r,a):eu(e)))t.push(s.i,e.i,l.i),ku(e),e=l,n=l;else if((e=l)===n){if(Xh=!1,e=Jh(e),Xh){n=e;continue}if(!o){n=e=iu(e,t),o=!0;continue}ru(e,t,i,r,a);break}}}function eu(e){let t=e.prev,i=e,r=e.next,a=t.x,n=i.x,o=r.x,s=t.y,l=i.y,h=r.y,u=Math.min(a,n,o),c=Math.min(s,l,h),p=Math.max(a,n,o),d=Math.max(s,l,h),f=r.next;for(;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=c&&f.y<=d&&(a!==f.x||s!==f.y)&&Tu(a,s,n,l,o,h,f.x,f.y)&&Pu(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function tu(e,t,i,r){let a=e.prev,n=e,o=e.next,s=a.x,l=n.x,h=o.x,u=a.y,c=n.y,p=o.y,d=Math.min(s,l,h),f=Math.min(u,c,p),m=Math.max(s,l,h),g=Math.max(u,c,p),_=bu(d,f,t,i,r),y=bu(m,g,t,i,r),v=e.prevZ;for(;v&&v.z>=_;){if(v.x>=d&&v.x<=m&&v.y>=f&&v.y<=g&&v!==o&&(s!==v.x||u!==v.y)&&Tu(s,u,l,c,h,p,v.x,v.y)&&Pu(v.prev,v,v.next)>=0)return!1;v=v.prevZ}let x=e.nextZ;for(;x&&x.z<=y;){if(x.x>=d&&x.x<=m&&x.y>=f&&x.y<=g&&x!==o&&(s!==x.x||u!==x.y)&&Tu(s,u,l,c,h,p,x.x,x.y)&&Pu(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function iu(e,t){let i=e,r=!1;do{let a=i.prev,n=i.next.next;Cu(a,i,i.next,n,!1)&&Iu(a,n)&&Iu(n,a)&&(t.push(a.i,i.i,n.i),ku(i),ku(i.next),i=e=n,r=!0),i=i.next}while(i!==e);return r?Jh(i):i}function ru(e,t,i,r,a){let n=e;do{let e=n.next.next;for(;e!==n.prev;){if(n.i!==e.i&&Su(n,e)){let o=Au(n,e);return n=Jh(n,n.next),o=Jh(o,o.next),Qh(n,t,i,r,a),void Qh(o,t,i,r,a)}e=e.next}n=n.next}while(n!==e)}let au=!1;function nu(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 ou(e,t){let i=function(e,t){let i,r=t,a=e.x,n=e.y,o=-1/0;
vendor: 21,228 bytes, line 2
2if(Eu(e,r))return r;for(let t=0,s=0;t<lu;t++,s+=4){if(n<su[s+1]||n>su[s+3]||su[s]>a||su[s+2]<=o)continue;let l=pu(t);r=du(t);do{if(r.prev.next===r){if(Eu(e,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let e=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=a&&e>o&&(o=e,i=r.x<r.next.x?r:r.next,e===a))return i}}r=r.next}while(r!==l)}if(!i)return null;let s=i.x,l=i.y,h=Math.min(n,l),u=Math.max(n,l),c=1/0;for(let t=0,p=0;t<lu;t++,p+=4){if(su[p+2]<s||su[p]>a||su[p+3]<h||su[p+1]>u)continue;let d=pu(t);r=du(t);do{if(r.prev.next===r&&a>=r.x&&r.x>=s&&a!==r.x&&Tu(n<l?a:o,n,s,l,n<l?o:a,n,r.x,r.y)){let t=Math.abs(n-r.y)/(a-r.x);(Iu(r,e)||r.y===n&&r.next.y===n&&r.next.x>a)&&(t<c||t===c&&(r.x>i.x||r.x===i.x&&fu(i,r)))&&(i=r,c=t)}r=r.next}while(r!==d)}return i}(e,t);if(!i)return t;let r=Au(i,e);return cu(i,r.next.next),Jh(r,r.next),Jh(i,i.next)}let su=new Float64Array,lu=0;const hu=[],uu=[];function cu(e,t){let i=e;do{let e=lu++;hu[e]=i;let r=1/0,a=1/0,n=-1/0,o=-1/0,s=0;do{let t=i.next;i.z=e,i.x<r&&(r=i.x),i.x>n&&(n=i.x),i.y<a&&(a=i.y),i.y>o&&(o=i.y),t.x<r&&(r=t.x),t.x>n&&(n=t.x),t.y<a&&(a=t.y),t.y>o&&(o=t.y),i=t}while(++s<16&&i!==t);uu[e]=i;let l=4*e;su[l]=r,su[l+1]=a,su[l+2]=n,su[l+3]=o}while(i!==t)}function pu(e){let t=uu[e];for(;t.prev.next!==t;)t=t.next;return uu[e]=t,t}function du(e){let t=hu[e];for(;t.prev.next!==t;)t=t.next;return hu[e]=t,t}function fu(e,t){return Pu(e.prev,e,t.prev)<0&&Pu(t.next,e,e.next)<0}const mu=[];let gu=[],_u=new Uint32Array,yu=new Uint32Array;const vu=new Uint32Array(256);function xu(e,t,i,r,a,n){vu.fill(0);for(let t=0;t<e;t++)vu[i[t]>>>n&255]++;let o=0;for(let e=0;e<256;e++){let t=vu[e];vu[e]=o,o+=t}for(let o=0;o<e;o++){let e=i[o],s=vu[e>>>n&255]++;r[s]=t[o],a[s]=e}}function bu(e,t,i,r,a){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*a|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*a|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function wu(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 Tu(e,t,i,r,a,n,o,s){return(a-o)*(t-s)>=(e-o)*(n-s)&&(e-o)*(r-s)>=(i-o)*(t-s)&&(i-o)*(n-s)>=(a-o)*(r-s)}function Su(e,t){let i=Eu(e,t)&&Pu(e.prev,e,e.next)>0&&Pu(t.prev,t,t.next)>0;return e.next.i!==t.i&&(i||Iu(e,t)&&Iu(t,e)&&(0!==Pu(e.prev,e,t.prev)||0!==Pu(e,t.prev,t)))&&!function(e,t){let i=Math.min(e.x,t.x),r=Math.max(e.x,t.x),a=Math.min(e.y,t.y),n=Math.max(e.y,t.y),o=e;do{let s=o.next;if(o.x>r&&s.x>r||o.x<i&&s.x<i||o.y>n&&s.y>n||o.y<a&&s.y<a)o=s;else{if(o.i!==e.i&&s.i!==e.i&&o.i!==t.i&&s.i!==t.i&&Cu(o,s,e,t))return!0;o=s}}while(o!==e);return!1}(e,t)&&(i||function(e,t){let i=e,r=!1,a=(e.x+t.x)/2,n=(e.y+t.y)/2;do{let e=i.next;i.y>n!=e.y>n&&a<(e.x-i.x)*(n-i.y)/(e.y-i.y)+i.x&&(r=!r),i=e}while(i!==e);return r}(e,t))}function Pu(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function Eu(e,t){return e.x===t.x&&e.y===t.y}function Cu(e,t,i,r,a=!0){let n=Pu(e,t,i),o=Pu(e,t,r),s=Pu(i,r,e),l=Pu(i,r,t);return(n>0&&o<0||n<0&&o>0)&&(s>0&&l<0||s<0&&l>0)||!!a&&!!(0===n&&Mu(e,i,t)||0===o&&Mu(e,r,t)||0===s&&Mu(i,e,r)||0===l&&Mu(i,t,r))}function Mu(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 Iu(e,t){return Pu(e.prev,e,e.next)<0?Pu(e,t,e.next)>=0&&Pu(e,e.prev,t)>=0:Pu(e,t,e.prev)<0||Pu(e,e.next,t)<0}function Au(e,t){let i=Du(e.i,e.x,e.y),r=Du(t.i,t.x,t.y),a=e.next,n=t.prev;return e.next=t,t.prev=e,i.next=a,a.prev=i,r.next=i,i.prev=r,n.next=r,r.prev=n,r}function zu(e,t,i,r){let a=Du(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 ku(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),au&&function(e,t){let i=4*e.z;t.x<su[i]&&(su[i]=t.x),t.y<su[i+1]&&(su[i+1]=t.y),t.x>su[i+2]&&(su[i+2]=t.x),t.y>su[i+3]&&(su[i+3]=t.y)}(e.prev,e.next)}function Du(e,t,i){return{i:e,x:t,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null}}var Ru=class{constructor(e,t){if(t>e)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=t}getGranularityForZoomLevel(e){let t=1<<e;return Math.max(Math.floor(this._baseZoomGranularity/t),this._minGranularity,1)}},Lu=class e{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}static{this.noSubdivision=new e({fill:new Ru(0,0),line:new Ru(0,0),tile:new Ru(0,0),stencil:new Ru(0,0),circle:1})}};fo("SubdivisionGranularityExpression",Ru),fo("SubdivisionGranularitySetting",Lu);const Fu=-32768,Bu=32767;var Ou=class{constructor(e,t){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=e,this._granularityCellSize=ne/e,this._canonical=t}_getKey(e,t){return(e+=32768)<<16|(t+=32768)}_vertexToIndex(e,t){if(e<-32768||t<-32768||e>32767||t>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let i=0|Math.round(e),r=0|Math.round(t),a=this._getKey(i,r);if(this._vertexDictionary.has(a))return this._vertexDictionary.get(a);let n=this._vertexBuffer.length/2;return this._vertexDictionary.set(a,n),this._vertexBuffer.push(i,r),n}_subdivideTrianglesScanline(e){if(this._granularity<2)return function(e,t){let i=[];for(let r=0;r<t.length;r+=3){let a=t[r],n=t[r+1],o=t[r+2],s=e[2*a],l=e[2*a+1],h=e[2*n],u=e[2*n+1],c=e[2*o];(h-s)*(e[2*o+1]-l)-(u-l)*(c-s)>0?(i.push(a),i.push(o),i.push(n)):(i.push(a),i.push(n),i.push(o))}return i}(this._vertexBuffer,e);let t=[],i=e.length;for(let r=0;r<i;r+=3){let i=[e[r+0],e[r+1],e[r+2]],a=[this._vertexBuffer[2*e[r+0]+0],this._vertexBuffer[2*e[r+0]+1],this._vertexBuffer[2*e[r+1]+0],this._vertexBuffer[2*e[r+1]+1],this._vertexBuffer[2*e[r+2]+0],this._vertexBuffer[2*e[r+2]+1]],n=1/0,o=1/0,s=-1/0,l=-1/0;for(let e=0;e<3;e++){let t=a[2*e],i=a[2*e+1];n=Math.min(n,t),s=Math.max(s,t),o=Math.min(o,i),l=Math.max(l,i)}if(n===s||o===l)continue;let h=Math.floor(n/this._granularityCellSize),u=Math.ceil(s/this._granularityCellSize),c=Math.floor(o/this._granularityCellSize),p=Math.ceil(l/this._granularityCellSize);if(h!==u||c!==p)for(let e=c;e<p;e++){let r=this._scanlineGenerateVertexRingForCellRow(e,a,i);Nu(this._vertexBuffer,r,t)}else t.push(...i)}return t}_scanlineGenerateVertexRingForCellRow(e,t,i){let r=e*this._granularityCellSize,a=r+this._granularityCellSize,n=[];for(let e=0;e<3;e++){let o=t[2*e],s=t[2*e+1],l=t[2*(e+1)%6],h=t[(2*(e+1)+1)%6],u=t[2*(e+2)%6],c=t[(2*(e+2)+1)%6],p=l-o,d=h-s,f=0===p,m=0===d,g=(r-s)/d,_=(a-s)/d,y=Math.min(g,_),v=Math.max(g,_);if(!m&&(y>=1||v<=0)||m&&(s<r||s>a)){h>=r&&h<=a&&n.push(i[(e+1)%3]);continue}if(!m&&y>0){let e=o+p*y,t=s+d*y;n.push(this._vertexToIndex(e,t))}let x=o+p*Math.max(y,0),b=o+p*Math.min(v,1);if(f||this._generateIntraEdgeVertices(n,o,s,l,h,x,b),!m&&v<1){let e=o+p*v,t=s+d*v;n.push(this._vertexToIndex(e,t))}(m||h>=r&&h<=a)&&n.push(i[(e+1)%3]),!m&&(h<=r||h>=a)&&this._generateInterEdgeVertices(n,o,s,l,h,u,c,b,r,a)}return n}_generateIntraEdgeVertices(e,t,i,r,a,n,o){let s=r-t,l=a-i,h=0===l,u=h?Math.min(t,r):Math.min(n,o),c=h?Math.max(t,r):Math.max(n,o),p=Math.floor(u/this._granularityCellSize)+1,d=Math.ceil(c/this._granularityCellSize)-1;if(h?t<r:n<o)for(let r=p;r<=d;r++){let a=r*this._granularityCellSize,n=i+l*(a-t)/s;e.push(this._vertexToIndex(a,n))}else for(let r=d;r>=p;r--){let a=r*this._granularityCellSize,n=i+l*(a-t)/s;e.push(this._vertexToIndex(a,n))}}_generateInterEdgeVertices(e,t,i,r,a,n,o,s,l,h){let u=a-i,c=n-r,p=o-a,d=(l-a)/p,f=(h-a)/p,m=Math.min(d,f),g=Math.max(d,f),_=r+c*m,y=Math.floor(Math.min(_,s)/this._granularityCellSize)+1,v=Math.ceil(Math.max(_,s)/this._granularityCellSize)-1,x=s<_,b=0===p;if(b&&(o===l||o===h))return;if(b||m>=1||g<=0){let e=i-o,r=(l-o)/e,a=(h-o)/e,u=n+(t-n)*Math.min(r,a);y=Math.floor(Math.min(u,s)/this._granularityCellSize)+1,v=Math.ceil(Math.max(u,s)/this._granularityCellSize)-1,x=s<u}let w=u>0?h:l;if(x)for(let t=y;t<=v;t++){let i=t*this._granularityCellSize;e.push(this._vertexToIndex(i,w))}else for(let t=v;t>=y;t--){let i=t*this._granularityCellSize;e.push(this._vertexToIndex(i,w))}}_generateOutline(e){let t=[];for(let i of e){let e=ju(i,this._granularity,!0),r=this._pointArrayToIndices(e),a=[];for(let e=1;e<r.length;e++)a.push(r[e-1]),a.push(r[e]);t.push(a)}return t}_handlePoles(e){let t=!1,i=!1;this._canonical&&(0===this._canonical.y&&(t=!0),this._canonical.y===(1<<this._canonical.z)-1&&(i=!0)),(t||i)&&this._fillPoles(e,t,i)}_ensureNoPoleVertices(){let e=this._vertexBuffer;for(let t=0;t<e.length;t+=2){let i=e[t+1];-32768===i&&(e[t+1]=-32767),32767===i&&(e[t+1]=Bu-1)}}_generatePoleQuad(e,t,i,r,a,n){r>a==(-32768===n)?(e.push(i),e.push(t),e.push(this._vertexToIndex(r,n)),e.push(this._vertexToIndex(a,n)),e.push(i),e.push(this._vertexToIndex(r,n))):(e.push(t),e.push(i),e.push(this._vertexToIndex(r,n)),e.push(i),e.push(this._vertexToIndex(a,n)),e.push(this._vertexToIndex(r,n)))}_fillPoles(e,t,i){let r=this._vertexBuffer,a=ne,n=e.length;for(let o=2;o<n;o+=3){let n=e[o-2],s=e[o-1],l=e[o],h=r[2*n],u=r[2*n+1],c=r[2*s],p=r[2*s+1],d=r[2*l],f=r[2*l+1];t&&(0===u&&0===p&&this._generatePoleQuad(e,n,s,h,c,Fu),0===p&&0===f&&this._generatePoleQuad(e,s,l,c,d,Fu),0===f&&0===u&&this._generatePoleQuad(e,l,n,d,h,Fu)),i&&(u===a&&p===a&&this._generatePoleQuad(e,n,s,h,c,Bu),p===a&&f===a&&this._generatePoleQuad(e,s,l,c,d,Bu),f===a&&u===a&&this._generatePoleQuad(e,l,n,d,h,Bu))}}_initializeVertices(e){for(let t=0;t<e.length;t+=2)this._vertexToIndex(e[t],e[t+1])}subdividePolygonInternal(e,t){if(this._used)throw Error("Subdivision: multiple use not allowed.");this._used=!0;let i,{flattened:r,holeIndices:a}=function(e){let t=[],i=[];for(let r of e)if(0!==r.length){r!==e[0]&&t.push(i.length/2);for(let e of r)i.push(e.x),i.push(e.y)}return{flattened:i,holeIndices:t}}(e);this._initializeVertices(r);try{let e=Yh(r,a),t=this._convertIndices(r,e);i=this._subdivideTrianglesScanline(t)}catch(e){console.error(e)}let n=[];return t&&(n=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(i),this._granularity>=2&&0===this._canonical?.z&&(i=this._removeTrianglesOutsideTileX(i),n=n.map((e=>this._removeLinesOutsideTileX(e)))),{verticesFlattened:this._vertexBuffer,indicesTriangles:i,indicesLineList:n}}_vertexOutsideTileX(e){let t=this._vertexBuffer[2*e];return t<0||t>8192}_removeTrianglesOutsideTileX(e){let t=[];for(let i=0;i<e.length;i+=3)this._vertexOutsideTileX(e[i])||this._vertexOutsideTileX(e[i+1])||this._vertexOutsideTileX(e[i+2])||t.push(e[i],e[i+1],e[i+2]);return t}_removeLinesOutsideTileX(e){let t=[];for(let i=0;i<e.length;i+=2)this._vertexOutsideTileX(e[i])||this._vertexOutsideTileX(e[i+1])||t.push(e[i],e[i+1]);return t}_convertIndices(e,t){let i=[];for(let r of t){let t=e[2*r],a=e[2*r+1];i.push(this._vertexToIndex(t,a))}return i}_pointArrayToIndices(e){let t=[];for(let i of e)t.push(this._vertexToIndex(i.x,i.y));return t}};function Vu(e,t,i,r=!0){return new Ou(i,t).subdividePolygonInternal(e,r)}function ju(e,t,i=!1){if(!e||e.length<1||e.length<2)return[];let r=e[0],a=e[e.length-1],n=i&&(r.x!==a.x||r.y!==a.y);if(t<2)return n?[...e,e[0]]:[...e];let o=Math.floor(ne/t),s=[];s.push(new d(e[0].x,e[0].y));let l=e.length,h=n?l:l-1;for(let t=0;t<h;t++){let i=e[t],r=t<l-1?e[t+1]:e[0],a=i.x,n=i.y,h=r.x,u=r.y,c=a!==h,p=n!==u;if(!c&&!p)continue;let f=h-a,m=u-n,g=Math.abs(f),_=Math.abs(m),y=a,v=n;for(;;){let e=f>0?(Math.floor(y/o)+1)*o:(Math.ceil(y/o)-1)*o,t=m>0?(Math.floor(v/o)+1)*o:(Math.ceil(v/o)-1)*o,i=Math.abs(y-e),r=Math.abs(v-t),a=Math.abs(y-h),n=Math.abs(v-u),l=c?i/g:1/0,x=p?r/_:1/0;if((a<=i||!c)&&(n<=r||!p))break;if(l<x&&c||!p){y=e,v+=m*l;let t=new d(y,Math.round(v));(s[s.length-1].x!==t.x||s[s.length-1].y!==t.y)&&s.push(t)}else{y+=f*x,v=t;let e=new d(Math.round(y),v);(s[s.length-1].x!==e.x||s[s.length-1].y!==e.y)&&s.push(e)}}let x=new d(h,u);(s[s.length-1].x!==x.x||s[s.length-1].y!==x.y)&&s.push(x)}return s}function Nu(e,t,i){if(0===t.length)throw Error("Subdivision vertex ring is empty.");let r=0,a=e[2*t[0]];for(let i=1;i<t.length;i++){let n=e[2*t[i]];n<a&&(a=n,r=i)}let n=t.length,o=r,s=(o+1)%n;for(;;){let r=o-1>=0?o-1:n-1,a=(s+1)%n,l=e[2*t[r]],h=e[2*t[r]+1],u=e[2*t[a]],c=e[2*t[a]+1],p=e[2*t[o]],d=e[2*t[o]+1],f=e[2*t[s]],m=e[2*t[s]+1],g=!1;if(l<u)g=!0;else if(l>u)g=!1;else{let e=m-d,t=-(f-p),i=d<m?1:-1;((l-p)*e+(h-d)*t)*i>((u-p)*e+(c-d)*t)*i&&(g=!0)}if(g){let e=t[r],a=t[o],l=t[s];e!==a&&e!==l&&a!==l&&i.push(l,a,e),o--,o<0&&(o=n-1)}else{let e=t[a],r=t[o],l=t[s];e!==r&&e!==l&&r!==l&&i.push(l,r,e),s++,s>=n&&(s=0)}if(r===a)break}}function qu(e,t,i,r,a,n,o,s,l){let h=a.length/2,u=o&&s&&l;if(h<ul.MAX_VERTEX_ARRAY_LENGTH){let c,p,d=t.prepareSegment(h,i,r),f=d.vertexLength;for(let e=0;e<n.length;e+=3)r.emplaceBack(f+n[e],f+n[e+1],f+n[e+2]);d.vertexLength+=h,d.primitiveLength+=n.length/3,u&&(p=o.prepareSegment(h,i,s),c=p.vertexLength,p.vertexLength+=h);for(let t=0;t<a.length;t+=2)e(a[t],a[t+1]);if(u)for(let e of l){for(let t=1;t<e.length;t+=2)s.emplaceBack(c+e[t-1],c+e[t]);p.primitiveLength+=e.length/2}}else(function(e,t,i,r,a,n){let o=[];for(let e=0;e<r.length/2;e++)o.push(-1);let s={count:0},l=0,h=e.getOrCreateLatestSegment(t,i),u=h.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,g=o[d]<l,_=o[f]<l,y=+!!m+ +!!g+ +!!_;h.vertexLength+y>ul.MAX_VERTEX_ARRAY_LENGTH&&(h=e.createNewSegment(t,i),l=s.count,m=!0,g=!0,_=!0,u=0);let v=$u(o,r,n,s,p,m,h),x=$u(o,r,n,s,d,g,h),b=$u(o,r,n,s,f,_,h);i.emplaceBack(u+v-l,u+x-l,u+b-l),h.primitiveLength++}})(t,i,r,a,n,e),u&&function(e,t,i,r,a,n){let o=[];for(let e=0;e<r.length/2;e++)o.push(-1);let s={count:0},l=0,h=e.getOrCreateLatestSegment(t,i),u=h.vertexLength;for(let c of a)for(let a=1;a<c.length;a+=2){let p=c[a-1],d=c[a],f=o[p]<l,m=o[d]<l,g=+!!f+ +!!m;h.vertexLength+g>ul.MAX_VERTEX_ARRAY_LENGTH&&(h=e.createNewSegment(t,i),l=s.count,f=!0,m=!0,u=0);let _=$u(o,r,n,s,p,f,h),y=$u(o,r,n,s,d,m,h);i.emplaceBack(u+_-l,u+y-l),h.primitiveLength++}}(o,i,s,a,l,e),t.forceNewSegmentOnNextPrepare(),o?.forceNewSegmentOnNextPrepare()}function $u(e,t,i,r,a,n,o){if(n){let n=r.count;return i(t[2*a],t[2*a+1]),e[a]=r.count,r.count++,o.vertexLength++,n}return e[a]}var Uu=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new Zs,this.indexArray=new nl,this.indexArray2=new ol,this.programConfigurations=new Nl(e.layers,e.zoom),this.segments=new ul,this.segments2=new ul,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,i){this.hasDependencies=Zh("fill",this.layers,t);let r=this.layers[0].layout.get("fill-sort-key"),a=!r.isConstant(),n=[],o=new Io(this.zoom),s=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:h,index:u,sourceLayerIndex:c}of e){let e=Wl(l,s);if(!this.layers[0]._featureFilter.filter(o,e,i))continue;let p=a?r.evaluate(e,{},i,t.availableImages):void 0,d={id:h,properties:l.properties,type:l.type,sourceLayerIndex:c,index:u,geometry:s?e.geometry:Zl(l),patterns:{},sortKey:p};n.push(d)}a&&n.sort(((e,t)=>e.sortKey-t.sortKey));for(let r of n){let{geometry:a,index:n,sourceLayerIndex:o}=r;if(this.hasDependencies){let e=Wh("fill",this.layers,r,{zoom:this.zoom},t);this.patternFeatures.push(e)}else this.addFeature(r,a,n,i,{},t.subdivisionGranularity);let s=e[n].feature;t.featureIndex.insert(s,a,n,o,this.index)}}update(e,t,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:i})}addFeatures(e,t,i){for(let r of this.patternFeatures)this.addFeature(r,r.geometry,r.index,t,i,e.subdivisionGranularity)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Gh),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),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(e,t,i,r,a,n){for(let e of Hr(t,500)){let t=Vu(e,r,n.fill.getGranularityForZoomLevel(r.z)),i=this.layoutVertexArray;qu(((e,t)=>{i.emplaceBack(e,t)}),this.segments,this.layoutVertexArray,this.indexArray,t.verticesFlattened,t.indicesTriangles,this.segments2,this.indexArray2,t.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,{imagePositions:a,canonical:r})}};let Gu;fo("FillBucket",Uu,{omit:["layers","patternFeatures"]});let Zu;var Wu={get paint(){return Zu||=new Wo({"fill-antialias":new qo(wt.paint_fill["fill-antialias"],"fill-antialias"),"fill-opacity":new $o(wt.paint_fill["fill-opacity"],"fill-opacity"),"fill-layer-opacity":new qo(wt.paint_fill["fill-layer-opacity"],"fill-layer-opacity"),"fill-color":new $o(wt.paint_fill["fill-color"],"fill-color"),"fill-outline-color":new $o(wt.paint_fill["fill-outline-color"],"fill-outline-color"),"fill-translate":new qo(wt.paint_fill["fill-translate"],"fill-translate"),"fill-translate-anchor":new qo(wt.paint_fill["fill-translate-anchor"],"fill-translate-anchor"),"fill-pattern":new Uo(wt.paint_fill["fill-pattern"],"fill-pattern")})},get layout(){return Gu||=new Wo({"fill-sort-key":new $o(wt.layout_fill["fill-sort-key"],"fill-sort-key")})}};var Hu=class extends Yo{constructor(e,t){super(e,Wu,t)}recalculate(e,t){super.recalculate(e,t);let i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new Uu(e)}queryRadius(){return hh(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:t,transform:i,pixelsToTileUnits:r}){return Ql(uh(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-i.bearingInRadians,r),t)}isTileClipped(){return!0}};const Xu=as([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Yu=as([{name:"a_centroid",components:2,type:"Int16"}],4),Ku=Xu.members;Xu.size,Xu.alignment;var Ju=class{constructor(e,t,i,r,a){for(this.properties=Object.create(null),this.extent=i,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=r,this._values=a;e.pos<t;){let t=e.readVarint();if(8===t)this.id=e.readVarint();else if(18===t){let t=e.readVarint()+e.pos;for(;e.pos<t;){let t=r[e.readVarint()],i=a[e.readVarint()];this.properties[t]=i}}else 24===t?this.type=e.readVarint():(34===t&&(this._geometry=e.pos),e.skip(t))}}loadGeometry(){if(this._geometry<0)throw Error("feature has no geometry");let e=this._pbf;e.pos=this._geometry;let t,i=e.readVarint()+e.pos,r=[],a=1,n=0,o=0,s=0;for(;e.pos<i;){if(n<=0){let t=e.readVarint();if(a=7&t,n=t>>3,0===n)continue}if(n--,1===a)o+=e.readSVarint(),s+=e.readSVarint(),t&&r.push(t),t=[new d(o,s)];else if(2===a)o+=e.readSVarint(),s+=e.readSVarint(),t&&t.push(new d(o,s));else{if(7!==a)throw Error(`unknown command ${a}`);t&&t.push(t[0].clone())}}return t&&r.push(t),r}bbox(){if(this._geometry<0)throw Error("feature has no geometry");let e=this._pbf;e.pos=this._geometry;let t=e.readVarint()+e.pos,i=1,r=0,a=0,n=0,o=1/0,s=-1/0,l=1/0,h=-1/0;for(;e.pos<t;){if(r<=0){let t=e.readVarint();if(i=7&t,r=t>>3,0===r)continue}if(r--,1===i||2===i)a+=e.readSVarint(),n+=e.readSVarint(),a<o&&(o=a),a>s&&(s=a),n<l&&(l=n),n>h&&(h=n);else if(7!==i)throw Error(`unknown command ${i}`)}return[o,l,s,h]}toGeoJSON(e,t,i){let r,a=this.extent*2**i,n=this.extent*e,o=this.extent*t,s=this.loadGeometry();function l(e){return[360*(e.x+n)/a-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+o)/a)*Math.PI))-90]}function h(e){return e.map(l)}if(1===this.type){let e=[];for(let t of s)e.push(t[0]);let t=h(e);r=1===e.length?{type:"Point",coordinates:t[0]}:{type:"MultiPoint",coordinates:t}}else if(2===this.type){let e=s.map(h);r=1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}}else{if(3!==this.type)throw Error("unknown feature type");{let e=Qu(s),t=[];for(let i of e)t.push(i.map(h));r=1===t.length?{type:"Polygon",coordinates:t[0]}:{type:"MultiPolygon",coordinates:t}}}let u={type:"Feature",geometry:r,properties:this.properties};return null!=this.id&&(u.id=this.id),u}};function Qu(e){let t=e.length;if(t<=1)return[e];let i,r,a=[];for(let n=0;n<t;n++){let t=ec(e[n]);0!==t&&(void 0===r&&(r=t<0),r===t<0?(i&&a.push(i),i=[e[n]]):i&&i.push(e[n]))}return i&&a.push(i),a}function ec(e){let t=0;for(let i,r,a=0,n=e.length,o=n-1;a<n;o=a++)i=e[a],r=e[o],t+=(r.x-i.x)*(i.y+r.y);return t}Ju.types=["Unknown","Point","LineString","Polygon"];var tc=class{constructor(e,t){for(this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],void 0===t&&(t=e.length);e.pos<t;){let t=e.readVarint();10===t?this.name=e.readString():18===t?(this._features.push(e.pos),e.skip(t)):26===t?this._keys.push(e.readString()):34===t?this._values.push(ic(e)):40===t?this.extent=e.readVarint():120===t?this.version=e.readVarint():e.ski
vendor: 4,602 bytes, line 2
2p(t)}this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[e];let t=this._pbf.readVarint()+this._pbf.pos;return new Ju(this._pbf,t,this.extent,this._keys,this._values)}};function ic(e){let t=null,i=e.readVarint()+e.pos;for(;e.pos<i;){let i=e.readVarint();t=10===i?e.readString():21===i?e.readFloat():25===i?e.readDouble():32===i?e.readVarint(!0):40===i?e.readVarint():48===i?e.readSVarint():56===i?e.readBoolean():(e.skip(i),null)}if(null==t)throw Error("unknown feature value");return t}var rc=class{constructor(e,t=e.length){let i=Object.create(null);for(;e.pos<t;){let t=e.readVarint();if(26===t){let t=new tc(e,e.readVarint()+e.pos);t.length&&(i[t.name]=t)}else e.skip(t)}this.layers=i}};const ac=8192;function nc(e,t,i,r,a,n,o,s){e.emplaceBack(t,i,2*Math.floor(r*ac)+o,a*ac*2,n*ac*2,Math.round(s))}var oc=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new Ws,this.centroidVertexArray=new qs,this.indexArray=new nl,this.programConfigurations=new Nl(e.layers,e.zoom),this.segments=new ul,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,i){this.features=[],this.hasDependencies=Zh("fill-extrusion",this.layers,t);let r=new Io(this.zoom),a=this.layers[0]._featureFilter.needGeometry;for(let{feature:n,id:o,index:s,sourceLayerIndex:l}of e){let e=Wl(n,a);if(!this.layers[0]._featureFilter.filter(r,e,i))continue;let h={id:o,sourceLayerIndex:l,index:s,geometry:a?e.geometry:Zl(n),properties:n.properties,type:n.type,patterns:{}};this.hasDependencies?this.features.push(Wh("fill-extrusion",this.layers,h,{zoom:this.zoom},t)):this.addFeature(h,h.geometry,s,i,{},t.subdivisionGranularity),t.featureIndex.insert(n,h.geometry,s,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 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ku),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Yu.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,n){for(let i of Hr(t,500)){let t={x:0,y:0,sampleCount:0},a=this.layoutVertexArray.length;this.processPolygon(t,r,e,i,n);let o=this.layoutVertexArray.length-a,s=Math.floor(t.x/t.sampleCount),l=Math.floor(t.y/t.sampleCount);for(let e=0;e<o;e++)this.centroidVertexArray.emplaceBack(s,l)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,{imagePositions:a,canonical:r})}processPolygon(e,t,i,r,a){if(r.length<1||hc(r[0]))return;for(let t of r)0!==t.length&&sc(e,t);let n={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},o=a.fill.getGranularityForZoomLevel(t.z),s="Polygon"===Ju.types[i.type];for(let e of r){if(0===e.length||hc(e))continue;let t=ju(e,o,s);this._generateSideFaces(t,n)}if(!s)return;let l=Vu(r,t,o,!1),h=this.layoutVertexArray;qu(((e,t)=>{nc(h,e,t,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],n=e[r-1];if(lc(a,n))continue;t.segment.vertexLength+4>ul.MAX_VERTEX_ARRAY_LENGTH&&(t.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let o=a.sub(n)._perp()._unit(),s=n.dist(a);i+s>32768&&(i=0),nc(this.layoutVertexArray,a.x,a.y,o.x,o.y,0,0,i),nc(this.layoutVertexArray,a.x,a.y,o.x,o.y,0,1,i),i+=s,nc(this.layoutVertexArray,n.x,n.y,o.x,o.y,0,0,i),nc(this.layoutVertexArray,n.x,n.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 sc(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.sampleC
2ount++)}}function lc(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}function hc(e){return e.every((e=>e.x<0))||e.every((e=>e.x>8192))||e.every((e=>e.y<0))||e.every((e=>e.y>8192))}let uc;fo("FillExtrusionBucket",oc,{omit:["layers","features"]});let cc;var pc={get paint(){return cc||=new Wo({"fill-extrusion-opacity":new qo(wt["paint_fill-extrusion"]["fill-extrusion-opacity"],"fill-extrusion-opacity"),"fill-extrusion-color":new $o(wt["paint_fill-extrusion"]["fill-extrusion-color"],"fill-extrusion-color"),"fill-extrusion-translate":new qo(wt["paint_fill-extrusion"]["fill-extrusion-translate"],"fill-extrusion-translate"),"fill-extrusion-translate-anchor":new qo(wt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"],"fill-extrusion-translate-anchor"),"fill-extrusion-pattern":new Uo(wt["paint_fill-extrusion"]["fill-extrusion-pattern"],"fill-extrusion-pattern"),"fill-extrusion-height":new $o(wt["paint_fill-extrusion"]["fill-extrusion-height"],"fill-extrusion-height"),"fill-extrusion-base":new $o(wt["paint_fill-extrusion"]["fill-extrusion-base"],"fill-extrusion-base"),"fill-extrusion-vertical-gradient":new qo(wt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"],"fill-extrusion-vertical-gradient")})},get layout(){return uc||=new Wo({"fill-extrusion-rounded-corner-distance":new qo(wt["layout_fill-extrusion"]["fill-extrusion-rounded-corner-distance"],"fill-extrusion-rounded-corner-distance")})}};var dc=class extends Yo{constructor(e,t){super(e,pc,t)}createBucket(e){return new oc(e)}queryRadius(){return hh(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:i,geometry:r,transform:a,pixelsToTileUnits:n,pixelPosMatrix:o}){let s=uh(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-a.bearingInRadians,n),l=this.paint.get("fill-extrusion-height").evaluate(t,i),h=this.paint.get("fill-extrusion-base").evaluate(t,i),u=function(e,t,i){let r=[];for(let a of e){let e=[a.x,a.y,i,1];H(e,e,t),r.push(new d(e[0]/e[3],e[1]/e[3]))}return r}(s,o,0),c=function(e,t,i,r){let a=[],n=[],o=r[8]*t,s=r[9]*t,l=r[10]*t,h=r[11]*t,u=r[8]*i,c=r[9]*i,p=r[10]*i,f=r[11]*i;for(let t of e){let e=[],i=[];for(let a of t){let t=a.x,n=a.y,m=r[0]*t+r[4]*n+r[12],g=r[1]*t+r[5]*n+r[13],_=r[2]*t+r[6]*n+r[14],y=r[3]*t+r[7]*n+r[15],v=_+l,x=y+h,b=m+u,w=g+c,T=_+p,S=y+f,P=new d((m+o)/x,(g+s)/x);P.z=v/x,e.push(P);let E=new d(b/S,w/S);E.z=T/S,i.push(E)}a.push(e),n.push(i)}return[a,n]}(r,h,l,o);return function(e,t,i){let r=1/0;Ql(i,t)&&(r=mc(i,t[0]));for(let a=0;a<t.length;a++){let n=t[a],o=e[a];for(let e=0;e<n.length-1;e++){let t=n[e],a=n[e+1],s=o[e],l=[t,a,o[e+1],s,t];Kl(i,l)&&(r=Math.min(r,mc(i,l)))}}return r!==1/0&&r}(c[0],c[1],u)}};function fc(e,t){return e.x*t.x+e.y*t.y}function mc(e,t){if(1===e.length){let i,r=0,a=t[r++];for(;!i||a.equals(i);)if(i=t[r++],!i)return 1/0;for(;r<t.length;r++){let n=t[r],o=e[0],s=i.sub(a),l=n.sub(a),h=o.sub(a),u=fc(s,s),c=fc(s,l),p=fc(l,l),d=fc(h,s),f=fc(h,l),m=u*p-c*c,g=(p*d-c*f)/m,_=(u*f-c*d)/m,y=1-g-_,v=a.z*y+i.z*g+n.z*_;if(isFinite(v))return v}return 1/0}{let e=1/0;for(let i of t)e=Math.min(e,i.z);return e}}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,new Uint32Array(96);const gc="geojsonvt_clip_start",_c="geojsonvt_clip_end";const yc=as([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),vc=yc.members;yc.size,yc.alignment;const xc=as([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),bc=xc.members;xc.size,xc.alignment;const wc=Math.cos(Math.PI/180*37.5);var Tc=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let e of this.layers)this.gradients[e.id]={};this.layoutVertexArray=new Hs,this.layoutVertexArray2=new Xs,this.indexArray=new nl,this.programConfigurations=new Nl(e.layers,e.zoom),this.segments=new ul,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,i){this.hasDependencies=Zh("line",this.layers,t)||this.hasLineDasharray(this.layers);let r=this.layers[0].layout.get("line-sort-key"),a=!r.isConstant(),n=[],o=new Io(this.zoom),s=this.layers[0]._featureFilter.needGeometry;for(let{feature:t,id:l,index:h,sourceLayerIndex:u}of e){let e=Wl(t,s);if(!this.layers[0]._featureFilter.filter(o,e,i))continue;let c=a?r.evaluate(e,{},i):void 0,p={id:l,properties:t.properties,type:t.type,sourceLayerIndex:u,index:h,geometry:s?e.geometry:Zl(t),patterns:{},dashes:{},sortKey:c};n.push(p)}a&&n.sort(((e,t)=>
vendor: 3,305 bytes, line 2
2e.sortKey-t.sortKey));for(let r of n){let{geometry:a,index:n,sourceLayerIndex:o}=r;this.hasDependencies?(Zh("line",this.layers,t)?Wh("line",this.layers,r,{zoom:this.zoom},t):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,r,this.zoom,t),this.patternFeatures.push(r)):this.addFeature(r,a,n,i,{},{},t.subdivisionGranularity);let s=e[n].feature;t.featureIndex.insert(s,a,n,o,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 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,bc)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,vc),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[gc],end:+e.properties[_c]}}addFeature(e,t,i,r,a,n,o){let s=this.layers[0].layout,l=s.get("line-join").evaluate(e,{}),h=s.get("line-cap").evaluate(e,{}),u=s.get("line-miter-limit").evaluate(e,{}),c=s.get("line-round-limit").evaluate(e,{});this.lineClips=this.lineFeatureClips(e);for(let i of t)this.addLine(i,e,l,h,u,c,r,o);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,{imagePositions:a,dashPositions:n,canonical:r})}addLine(e,t,i,r,a,n,o,s){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e=ju(e,o?s.line.getGranularityForZoomLevel(o.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let l="Polygon"===Ju.types[t.type],h=e.length;for(;h>=2&&e[h-1].equals(e[h-2]);)h--;let u=0;for(;u<h-1&&e[u].equals(e[u+1]);)u++;if(h-u<(l?3:2))return;"bevel"===i&&(a=1.05);let c,p,d,f,m,g=this.overscaling<=16?15*ne/(512*this.overscaling):0,_=this.segments.prepareSegment(10*h,this.layoutVertexArray,this.indexArray);this.e1=this.e2=-1,l&&(c=e[h-2],m=e[u].sub(c)._unit()._perp());for(let t=u;t<h;t++){if(d=t===h-1?l?e[u+1]:void 0:e[t+1],d&&e[t].equals(d))continue;m&&(f=m),c&&(p=c),c=e[t],m=d?d.sub(c)._unit()._perp():f,f||=m;let o=f.add(m);(0!==o.x||0!==o.y)&&o._unit();let s=f.x*m.x+f.y*m.y,y=o.x*m.x+o.y*m.y,v=0===y?1/0:1/y,x=2*Math.sqrt(2-2*y),b=y<wc&&p&&d,w=f.x*m.y-f.y*m.x>0;if(b&&t>u){let e=c.dist(p);if(e>2*g){let t=c.sub(c.sub(p)._mult(g/e)._round());this.updateDistance(p,t),this.addCurrentVertex(t,f,0,0,_),p=t}}let T=p&&d,S=T?i:l?"butt":r;if(T&&"round"===S&&(v<n?S="miter":v<=2&&(S="fakeround")),"miter"===S&&v>a&&(S="bevel"),"bevel"===S&&(v>2&&(S="flipbevel"),v<a&&(S="miter")),p&&this.updateDistance(p,c),"miter"
vendor: 15,341 bytes, line 2
2===S)o._mult(v),this.addCurrentVertex(c,o,0,0,_);else if("flipbevel"===S){if(v>100)o=m.mult(-1);else{let e=v*f.add(m).mag()/f.sub(m).mag();o._perp()._mult(e*(w?-1:1))}this.addCurrentVertex(c,o,0,0,_),this.addCurrentVertex(c,o.mult(-1),0,0,_)}else if("bevel"===S||"fakeround"===S){let e=-Math.sqrt(v*v-1),t=w?e:0,i=w?0:e;if(p&&this.addCurrentVertex(c,f,t,i,_),"fakeround"===S){let e=Math.round(180*x/Math.PI/20);for(let t=1;t<e;t++){let i=t/e;if(.5!==i){let e=i-.5;i+=i*e*(i-1)*((1.0904+s*(s*(3.55645-1.43519*s)-3.2452))*e*e+(.848013+s*(.215638*s-1.06021)))}let r=m.sub(f)._mult(i)._add(f)._unit()._mult(w?-1:1);this.addHalfVertex(c,r.x,r.y,!1,w,0,_)}}d&&this.addCurrentVertex(c,m,-t,-i,_)}else if("butt"===S)this.addCurrentVertex(c,o,0,0,_);else if("square"===S){let e=p?1:-1;this.addCurrentVertex(c,o,e,e,_)}else"round"===S&&(p&&(this.addCurrentVertex(c,f,0,0,_),this.addCurrentVertex(c,f,1,1,_,!0)),d&&(this.addCurrentVertex(c,m,-1,-1,_,!0),this.addCurrentVertex(c,m,0,0,_)));if(b&&t<h-1){let e=c.dist(d);if(e>2*g){let t=c.add(d.sub(c)._mult(g/e)._round());this.updateDistance(c,t),this.addCurrentVertex(t,m,0,0,_),c=t}}}}addCurrentVertex(e,t,i,r,a,n=!1){let o=t.x+t.y*i,s=t.y-t.x*i,l=-t.x+t.y*r,h=-t.y-t.x*r;this.addHalfVertex(e,o,s,n,!1,i,a),this.addHalfVertex(e,l,h,n,!0,-r,a),this.distance>16384&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,i,r,a,n))}addHalfVertex({x:e,y:t},i,r,a,n,o,s){let l=.5*(this.lineClips?32767*this.scaledDistance:this.scaledDistance);if(this.layoutVertexArray.emplaceBack(+!!a+(e<<1),+!!n+(t<<1),Math.round(63*i)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&l)<<2,l>>6),this.lineClips){let e=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(e,this.lineClipsArray.length)}let h=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,h,this.e2),s.primitiveLength++),n?this.e2=h:this.e1=h}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 e=t.paint.get("line-dasharray");if(e&&!e.isConstant())return!0}return!1}addLineDashDependencies(e,t,i,r){for(let a of e){let e=a.paint.get("line-dasharray");if(!e||"constant"===e.value.kind)continue;let n="round"===a.layout.get("line-cap").evaluate(t,{}),o={dasharray:e.value.evaluate({zoom:i-1},t,{}),round:n},s={dasharray:e.value.evaluate({zoom:i},t,{}),round:n},l={dasharray:e.value.evaluate({zoom:i+1},t,{}),round:n},h=`${o.dasharray.join(",")},${o.round}`,u=`${s.dasharray.join(",")},${s.round}`,c=`${l.dasharray.join(",")},${l.round}`;r.dashDependencies[h]=o,r.dashDependencies[u]=s,r.dashDependencies[c]=l,t.dashes[a.id]={min:h,mid:u,max:c}}}};let Sc;fo("LineBucket",Tc,{omit:["layers","patternFeatures"]});let Pc;var Ec={get paint(){return Pc||=new Wo({"line-opacity":new $o(wt.paint_line["line-opacity"],"line-opacity"),"line-layer-opacity":new qo(wt.paint_line["line-layer-opacity"],"line-layer-opacity"),"line-color":new $o(wt.paint_line["line-color"],"line-color"),"line-translate":new qo(wt.paint_line["line-translate"],"line-translate"),"line-translate-anchor":new qo(wt.paint_line["line-translate-anchor"],"line-translate-anchor"),"line-width":new $o(wt.paint_line["line-width"],"line-width"),"line-gap-width":new $o(wt.paint_line["line-gap-width"],"line-gap-width"),"line-offset":new $o(wt.paint_line["line-offset"],"line-offset"),"line-blur":new $o(wt.paint_line["line-blur"],"line-blur"),"line-dasharray":new Uo(wt.paint_line["line-dasharray"],"line-dasharray"),"line-pattern":new Uo(wt.paint_line["line-pattern"],"line-pattern"),"line-gradient":new Zo(wt.paint_line["line-gradient"],"line-gradient")})},get layout(){return Sc||=new Wo({"line-cap":new $o(wt.layout_line["line-cap"],"line-cap"),"line-join":new $o(wt.layout_line["line-join"],"line-join"),"line-miter-limit":new $o(wt.layout_line["line-miter-limit"],"line-miter-limit"),"line-round-limit":new $o(wt.layout_line["line-round-limit"],"line-round-limit"),"line-sort-key":new $o(wt.layout_line["line-sort-key"],"line-sort-key")})}},Cc=class extends $o{possiblyEvaluate(e,t){return t=new Io(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=Me({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,i,r)}};let Mc;var Ic=class extends Yo{constructor(e,t){super(e,Ec,t),this.gradientVersion=0,Mc||(Mc=new Cc(Ec.paint.properties["line-width"].specification,"line-floorwidth"),Mc.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){let e=this.gradientExpression();!function(e){return void 0!==e._styleExpression}(e)?this.stepInterpolant=!1:this.stepInterpolant=e._styleExpression.expression instanceof or,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"]=Mc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Tc(e)}queryRadius(e){let t=e,i=Ac(lh("line-width",this,t),lh("line-gap-width",this,t)),r=lh("line-offset",this,t);return i/2+Math.abs(r)+hh(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:i,geometry:r,transform:a,pixelsToTileUnits:n}){let o=uh(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-a.bearingInRadians,n),s=n/2*Ac(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=function(e,t){let i=[];for(let r of e){let e=ch(r),a=[];for(let i=0;i<e.length;i++){let r=e[i],n=e[i-1],o=e[i+1],s=0===i?new d(0,0):r.sub(n)._unit()._perp(),l=i===e.length-1?new d(0,0):o.sub(r)._unit()._perp(),h=s._add(l)._unit(),u=h.x*l.x+h.y*l.y;0!==u&&h._mult(1/u),a.push(h._mult(t)._add(r))}i.push(a)}return i}(r,l*n)),function(e,t,i){for(let r of t){if(e.length>=3)for(let t of r)if(oh(e,t))return!0;if(eh(e,r,i))return!0}return!1}(o,r,s)}isTileClipped(){return!0}};function Ac(e,t){return t>0?t+2*e:e}const zc=as([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),kc=as([{name:"a_projected_pos",components:3,type:"Float32"}],4);as([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Dc=as([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);as([{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 Rc=as([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Lc=as([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Fc(e,t,i){let r=t.layout.get("text-transform").evaluate(i,{});return"uppercase"===r?e=e.toLocaleUpperCase():"lowercase"===r&&(e=e.toLocaleLowerCase()),Mo.applyArabicShaping&&(e=Mo.applyArabicShaping(e)),e}function Bc(e,t,i){for(let r of e.sections)r.text=Fc(r.text,t,i);return e}as([{name:"triangle",components:3,type:"Uint16"}]),as([{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"}]),as([{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"}]),as([{type:"Float32",name:"offsetX"}]),as([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),as([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Oc={"!":"ï¸","#":"ï¼",$:"ï¼","%":"ï¼
","&":"ï¼","(":"︵",")":"︶","*":"ï¼","+":"ï¼",",":"ï¸","-":"︲",".":"ã»","/":"ï¼",":":"ï¸",";":"ï¸","<":"︿","=":"ï¼",">":"ï¹","?":"ï¸","@":"ï¼ ","[":"ï¹","\\":"ï¼¼","]":"ï¹","^":"ï¼¾",_:"︳","`":"ï½","{":"︷","|":"â","}":"︸","~":"ï½","¢":"ï¿ ","£":"ï¿¡","Â¥":"ï¿¥","¦":"¦","¬":"ï¿¢","¯":"ï¿£","â":"︲","â":"︱","â":"ï¹","â":"ï¹","â":"ï¹","â":"ï¹","â¦":"ï¸","â¯":"ï¸","â§":"ã»","â©":"₩","ã":"ï¸","ã":"ï¸","ã":"︿","ã":"ï¹","ã":"︽","ã":"︾","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"︻","ã":"︼","ã":"︹","ã":"︺","ã":"ï¸","ã":"ï¸","ï¼":"ï¸","ï¼":"︵","ï¼":"︶","ï¼":"ï¸","ï¼":"︲","ï¼":"ã»","ï¼":"ï¸","ï¼":"ï¸","ï¼":"︿","ï¼":"ï¹","ï¼":"ï¸","ï¼»":"ï¹","ï¼½":"ï¹","_":"︳","ï½":"︷","ï½":"â","ï½":"︸","ï½":"︵","ï½ ":"︶","。":"ï¸","ï½¢":"ï¹","ï½£":"ï¹"};const Vc=4294967296,jc=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");var Nc=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)*Vc;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Vc;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,a=127&i;return r=t[this.pos++],a|=(127&r)<<7,r<128||(r=t[this.pos++],a|=(127&r)<<14,r<128)||(r=t[this.pos++],a|=(127&r)<<21,r<128)?a:(r=t[this.pos],a|=(15&r)<<28,function(e,t,i){let r,a,n=i.buf;if(a=n[i.pos++],r=(112&a)>>4,a<128||(a=n[i.pos++],r|=(127&a)<<3,a<128)||(a=n[i.pos++],r|=(127&a)<<10,a<128)||(a=n[i.pos++],r|=(127&a)<<17,a<128)||(a=n[i.pos++],r|=(127&a)<<24,a<128)||(a=n[i.pos++],r|=(1&a)<<31,a<128))return function(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}(e,r,t);throw Error("Expected varint not more than 10 bytes")}(a,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&&jc?jc.decode(this.buf.subarray(t,e)):function(e,t,i){let r="",a=t;for(;a<i;){let t,n,o,s=e[a],l=null,h=s>239?4:s>223?3:s>191?2:1;if(a+h>i)break;1===h?s<128&&(l=s):2===h?(t=e[a+1],128==(192&t)&&(l=(31&s)<<6|63&t,l<=127&&(l=null))):3===h?(t=e[a+1],n=e[a+2],128==(192&t)&&128==(192&n)&&(l=(15&s)<<12|(63&t)<<6|63&n,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===h&&(t=e[a+1],n=e[a+2],o=e[a+3],128==(192&t)&&128==(192&n)&&128==(192&o)&&(l=(15&s)<<18|(63&t)<<12|(63&n)<<6|63&o,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,h=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),a+=h}return r}(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 2===this.type?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=7&t,this._valueStart=this.pos,t>>>3}skip(e){let t=7&e;if(0===t)for(;this.buf[this.pos++]>127;);else if(2===t)this.pos=this.readVarint()+this.pos;else if(5===t)this.pos+=4;else{if(1!==t)throw Error(`Unimplemented type: ${t}`);this.pos+=8}}};function qc(e,t,i){1===e&&i.readMessage($c,t)}function $c(e,t,i){if(3===e){let{id:e,bitmap:r,width:a,height:n,left:o,top:s,advance:l}=i.readMessage(Uc,{});t.push({id:e,bitmap:new Mh({width:a+6,height:n+6},r),metrics:{width:a,height:n,left:o,top:s,advance:l}})}}function Uc(e,t,i){1===e?t.id=i.readVarint():2===e?t.bitmap=i.readBytes():3===e?t.width=i.readVarint():4===e?t.height=i.readVarint():5===e?t.left=i.readSVarint():6===e?t.top=i.readSVarint():7===e&&(t.advance=i.readVarint())}function Gc(e){let{userImage:t}=e;return!(!t?.render||!t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}function Zc(e){let t=0,i=0;
2for(let r of e)t+=r.w*r.h,i=Math.max(i,r.w);e.sort(((e,t)=>t.h-e.h));let r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),i),h:1/0}],a=0,n=0;for(let t of e)for(let e=r.length-1;e>=0;e--){let i=r[e];if(!(t.w>i.w||t.h>i.h)){if(t.x=i.x,t.y=i.y,n=Math.max(n,t.y+t.h),a=Math.max(a,t.x+t.w),t.w===i.w&&t.h===i.h){let t=r.pop();t&&e<r.length&&(r[e]=t)}else t.h===i.h?(i.x+=t.w,i.w-=t.w):t.w===i.w?(i.y+=t.h,i.h-=t.h):(r.push({x:i.x+t.w,y:i.y,w:i.w-t.w,h:t.h}),i.y+=t.h,i.h-=t.h);break}}return{w:a,h:n,fill:t/(a*n)||0}}var Wc=class{constructor(e,{pixelRatio:t,version:i,stretchX:r,stretchY:a,content:n,textFitWidth:o,textFitHeight:s}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=r,this.stretchY=a,this.content=n,this.version=i,this.textFitWidth=o,this.textFitHeight=s}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]}};fo("ImagePosition",Wc),fo("ImageAtlas",class{constructor(e,t){let i={},r={};this.haveRenderCallbacks=[];let a=[];this.addImages(e,i,a),this.addImages(t,r,a);let{w:n,h:o}=Zc(a),s=new Ih({width:n||1,height:o||1});for(let t in e){let r=e[t],a=i[t].paddedRect;Ih.copy(r.data,s,{x:0,y:0},{x:a.x+1,y:a.y+1},r.data)}for(let e in t){let i=t[e],a=r[e].paddedRect,n=a.x+1,o=a.y+1,l=i.data.width,h=i.data.height;Ih.copy(i.data,s,{x:0,y:0},{x:n,y:o},i.data),Ih.copy(i.data,s,{x:0,y:h-1},{x:n,y:o-1},{width:l,height:1}),Ih.copy(i.data,s,{x:0,y:0},{x:n,y:o+h},{width:l,height:1}),Ih.copy(i.data,s,{x:l-1,y:0},{x:n-1,y:o},{width:1,height:h}),Ih.copy(i.data,s,{x:0,y:0},{x:n+l,y:o},{width:1,height:h})}this.image=s,this.iconPositions=i,this.patternPositions=r}addImages(e,t,i){for(let r in e){let a=e[r],n={x:0,y:0,w:a.data.width+2,h:a.data.height+2};i.push(n),t[r]=new Wc(n,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})}});var Hc=function(e){return e[e.none=0]="none",e[e.horizontal=1]="horizontal",e[e.vertical=2]="vertical",e[e.horizontalOnly=3]="horizontalOnly",e}(Hc||{});function Xc(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}switch(e){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:t,verticalAlign:i}}function Yc(e,t){let{expression:i}=t;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new Io(e+1))};if("source"===i.kind)return{kind:"source"};{let{zoomStops:t,interpolationType:r}=i,a=0;for(;a<t.length&&t[a]<=e;)a++;a=Math.max(0,a-1);let n=a;for(;n<t.length&&t[n]<e+1;)n++;n=Math.min(t.length-1,n);let o=t[a],s=t[n];return"composite"===i.kind?{kind:"composite",minZoom:o,maxZoom:s,interpolationType:r}:{kind:"camera",minZoom:o,maxZoom:s,minSize:i.evaluate(new Io(o)),maxSize:i.evaluate(new Io(s)),interpolationType:r}}}function Kc(e,{uSize:t,uSizeT:i},{lowerSize:r,upperSize:a}){return"source"===e.kind?r/128:"composite"===e.kind?hr.number(r/128,a/128,i):t}function Jc(e,t){let i=0,r=0;if("constant"===e.kind)r=e.layoutSize;else if("source"!==e.kind){let{interpolationType:a,minZoom:n,maxZoom:o}=e,s=a?Ee(sr.interpolationFactor(a,t,n,o),0,1):0;"camera"===e.kind?r=hr.number(e.minSize,e.maxSize,s):i=s}return{uSizeT:i,uSize:r}}function Qc(e,t,i){let r="never",a=e.get(t);return a?r=a:e.get(i)&&(r="always"),r}const ep=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function tp(e,t,i,r,a,n,o,s,l,h,u,c,p){let d=s?Math.min(32640,Math.round(s[0])):0,f=s?Math.min(32640,Math.round(s[1])):0;e.emplaceBack(t,i,Math.round(32*r),Math.round(32*a),n,o,+!!l+(d<<1),f,16*h,16*u,256*c,256*p)}function ip(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 rp(e){for(let t of e.sections)if(Co(t.text))return!0;return!1}var ap=class{constructor(e){this.layoutVertexArray=new Js,this.indexArray=new nl,this.programConfigurations=e,this.segments=new ul,this.dynamicLayoutVertexArray=new Qs,this.opacityVertexArray=new el,this.hasVisibleVertices=!1,this.placedSymbolArray=new Ds}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,t,i,r){this.isEmpty()||(i&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,zc.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,kc.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,ep,!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())}};fo("SymbolBuffers",ap);var np=class{constructor(e,t,i){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new i,this.segments=new ul,this.collisionVertexArray=new rl}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Dc.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};fo("CollisionBuffers",np);var op=class{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.s
2ourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];let t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Yc(this.zoom,t["text-size"]),this.iconSizeData=Yc(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="never"!==Qc(i,"text-overlap","text-allow-overlap")||"never"!==Qc(i,"icon-overlap","icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==a&&!r.isConstant();let n="viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey;this.sortFeaturesByY=n&&this.canOverlap,"point"===i.get("symbol-placement")&&(this.writingModes=i.get("text-writing-mode").map((e=>Hc[e]))),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=e.sourceID}createArrays(){this.text=new ap(new Nl(this.layers,this.zoom,(e=>e.startsWith("text")))),this.icon=new ap(new Nl(this.layers,this.zoom,(e=>e.startsWith("icon")))),this.glyphOffsetArray=new Fs,this.lineVertexArray=new Bs,this.symbolInstances=new Ls,this.textAnchorOffsets=new Vs}calculateGlyphDependencies(e,t,i,r,a){for(let n of e)if(t[n.codePointAt(0)]=!0,(i||r)&&a){let e=Oc[n];e&&(t[e.codePointAt(0)]=!0)}}populate(e,t,i){let r=this.layers[0],a=r.layout,n=a.get("text-font"),o=a.get("text-field"),s=a.get("icon-image"),l=("constant"!==o.value.kind||o.value.value instanceof Fi&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==n.value.kind||n.value.value.length>0),h="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,u=a.get("symbol-sort-key");if(this.features=[],!l&&!h)return;let c=t.iconDependencies,p=t.glyphDependencies,d=t.availableImages,f=new Io(this.zoom);for(let{feature:t,id:o,index:s,sourceLayerIndex:m}of e){let e,g,_=r._featureFilter.needGeometry,y=Wl(t,_);if(!r._featureFilter.filter(f,y,i))continue;if(_||(y.geometry=Zl(t)),l){let t=r.getValueAndResolveTokens("text-field",y,i,d),a=Fi.factory(t);this.hasRTLText||=rp(a),(!this.hasRTLText||"unavailable"===Mo.getRTLTextPluginStatus()||this.hasRTLText&&Mo.isParsed())&&(e=Bc(a,r,y))}if(h){let e=r.getValueAndResolveTokens("icon-image",y,i,d);g=e instanceof $i?e:$i.fromString(e)}if(!e&&!g)continue;let v=this.sortFeaturesByKey?u.evaluate(y,{},i):void 0,x={id:o,text:e,icon:g,index:s,sourceLayerIndex:m,geometry:y.geometry,properties:t.properties,type:Ju.types[t.type],sortKey:v};if(this.features.push(x),g&&(c[g.name]=!0),e){let t=n.evaluate(y,{},i).join(","),r="viewport"!==a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement");this.allowVerticalPlacement=this.writingModes?.includes(2);for(let i of e.sections)if(i.image)c[i.image.name]=!0;else{let a=wo(e.toString()),n=i.fontStack||t;p[n]||={},this.calculateGlyphDependencies(i.text,p[n],r,this.allowVerticalPlacement,a)}}}"line"===a.get("symbol-placement")&&(this.features=function(e){let t={},i={},r=[],a=0;function n(t){r.push(e[t]),a++}function o(e,t,a){let n=i[e];return delete i[e],i[t]=n,r[n].geometry[0].pop(),r[n].geometry[0]=r[n].geometry[0].concat(a[0]),n}function s(e,i,a){let n=t[i];return delete t[i],t[e]=n,r[n].geometry[0].shift(),r[n].geometry[0]=a[0].concat(r[n].geometry[0]),n}function l(e,t,i){let r=i?t[0][t[0].length-1]:t[0][0];return`${e}:${r.x}:${r.y}`}for(let h=0;h<e.length;h++){let u=e[h],c=u.geometry,p=u.text?u.text.toString():null;if(!p){n(h);continue}let d=l(p,c),f=l(p,c,!0);if(d in i&&f in t&&i[d]!==t[f]){let e=s(d,f,c),a=o(d,f,r[e].geometry);delete t[d],delete i[f],i[l(p,r[a].geometry,!0)]=a,r[e].geometry=null}else d in i?o(d,f,c):f in t?s(d,f,c):(n(h),t[d]=a-1,i[f]=a-1)}return r.filter((e=>e.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>
vendor: 4,478 bytes, line 2
2e.sortKey-t.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 0===this.symbolInstances.length&&!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(void 0!==e.segment){let i=e.dist(t[e.segment+1]),r=e.dist(t[e.segment]),a={};for(let r=e.segment+1;r<t.length;r++)a[r]={x:t[r].x,y:t[r].y,tileUnitDistanceFromAnchor:i},r<t.length-1&&(i+=t[r+1].dist(t[r]));for(let i=e.segment||0;i>=0;i--)a[i]={x:t[i].x,y:t[i].y,tileUnitDistanceFromAnchor:r},i>0&&(r+=t[i-1].dist(t[i]));for(let e=0;e<t.length;e++){let t=a[e];this.lineVertexArray.emplaceBack(t.x,t.y,t.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(e,t,i,r,a,n,o,s,l,h,u,c){let p=e.indexArray,d=e.layoutVertexArray,f=e.segments.prepareSegment(4*t.length,d,p,this.canOverlap?n.sortKey:void 0),m=this.glyphOffsetArray.length,g=f.vertexLength,_=this.allowVerticalPlacement&&2===o?Math.PI/2:0,y=n.text&&n.text.sections;for(let r=0;r<t.length;r++){let{tl:a,tr:o,bl:l,br:h,tex:u,pixelOffsetTL:m,pixelOffsetBR:g,minFontScaleX:v,minFontScaleY:x,glyphOffset:b,isSDF:w,sectionIndex:T}=t[r],S=f.vertexLength,P=b[1];tp(d,s.x,s.y,a.x,P+a.y,u.x,u.y,i,w,m.x,m.y,v,x),tp(d,s.x,s.y,o.x,P+o.y,u.x+u.w,u.y,i,w,g.x,m.y,v,x),tp(d,s.x,s.y,l.x,P+l.y,u.x,u.y+u.h,i,w,m.x,g.y,v,x),tp(d,s.x,s.y,h.x,P+h.y,u.x+u.w,u.y+u.h,i,w,g.x,g.y,v,x),ip(e.dynamicLayoutVertexArray,s,_),p.emplaceBack(S,S+2,S+1),p.emplaceBack(S+1,S+2,S+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(b[0]),(r===t.length-1||T!==t[r+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(d.length,n,n.index,{imagePositions:{},canonical:c,formattedSection:y?.[T]})}e.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,g,l,h,s.segment,i?i[0]:0,i?i[1]:0,r[0],r[1],o,0,!1,0,u)}_addCollisionDebugVertex(e,t,i,r,a,n){return t.emplaceBack(0,0),e.emplaceBack(i.x,i.y,r,a,Math.round(n.x),Math.round(n.y))}addCollisionDebugVertices(e,t,i,r,a,n,o){let s=a.segments.prepareSegment(4,a.layoutVertexArray,a.indexArray),l=s.vertexLength,h=a.layoutVertexArray,u=a.collisionVertexArray,c=o.anchorX,p=o.anchorY;this._addCollisionDebugVertex(h,u,n,c,p,new d(e,t)),this._addCollisionDebugVertex(h,u,n,c,p,new d(i,t)),this._addCollisionDebugVertex(h,u,n,c,p,new d(i,r)),this._addCollisionDebugVertex(h,u,n,c,p,new d(e,r)),s.vertexLength+=4;let f=a.indexArray;f.emplaceBack(l,l+1),f.emplaceBack(l+1,l+2),f.emplaceBack(l+2,l+3),f.emplaceBack(l+3,l),s.primitiveLength+=4}addDebugCollisionBoxes(e,t,i,r){for(let a=e;a<t;a++){let e=this.collisionBoxArray.get(a),t=e.x1,n=e.y1,o=e.x2,s=e.y2;this.addCollisionDebugVertices(t,n,o,s,r?this.textCollisionBox:this.iconCollisionBox,e.anchorPoint,i)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new np(tl,Rc.members,ol),this.iconCollisionBox=new np(tl,Rc.members,ol);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,n,o,s,l){let h={};for(let r=t;r<i;r++){let t=e.get(r);h.textBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},h.textFeatureIndex=t.featureIndex;break}for(let t=r;t<a;t++){let i=e.get(t);h.verticalTextBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,anchorPointX:i.anchorPointX,anchorPointY:i.anch
vendor: 4,427 bytes, line 2
2orPointY},h.verticalTextFeatureIndex=i.featureIndex;break}for(let t=n;t<o;t++){let i=e.get(t);h.iconBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,anchorPointX:i.anchorPointX,anchorPointY:i.anchorPointY},h.iconFeatureIndex=i.featureIndex;break}for(let t=s;t<l;t++){let i=e.get(t);h.verticalIconBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,anchorPointX:i.anchorPointX,anchorPointY:i.anchorPointY},h.verticalIconFeatureIndex=i.featureIndex;break}return h}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+4*i.numGlyphs;for(let t=i.vertexStartIndex;t<r;t+=4)e.indexArray.emplaceBack(t,t+2,t+1),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;let t=Math.sin(e),i=Math.cos(e),r=[],a=[],n=[];for(let e=0;e<this.symbolInstances.length;++e){n.push(e);let o=this.symbolInstances.get(e);r.push(0|Math.round(t*o.anchorX+i*o.anchorY)),a.push(o.featureIndex)}return n.sort(((e,t)=>r[e]-r[t]||a[t]-a[e])),n}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 e of this.symbolInstanceIndexes){let t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex);let i=[t.rightJustifiedTextSymbolIndex,t.centerJustifiedTextSymbolIndex,t.leftJustifiedTextSymbolIndex];for(let e=0;e<i.length;e++){let t=i[e];t>=0&&i.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)}t.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,t.verticalPlacedTextSymbolIndex),t.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.placedIconSymbolIndex),t.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};let sp;fo("SymbolBucket",op,{omit:["layers","collisionBoxArray","features","compareText"]}),op.MAX_GLYPHS=65535,op.addDynamicAttributes=ip;let lp;var hp={get paint(){return lp||=new Wo({"icon-opacity":new $o(wt.paint_symbol["icon-opacity"],"icon-opacity"),"icon-color":new $o(wt.paint_symbol["icon-color"],"icon-color"),"icon-halo-color":new $o(wt.paint_symbol["icon-halo-color"],"icon-halo-color"),"icon-halo-width":new $o(wt.paint_symbol["icon-halo-width"],"icon-halo-width"),"icon-halo-blur":new $o(wt.paint_symbol["icon-halo-blur"],"icon-halo-blur"),"icon-translate":new qo(wt.paint_symbol["icon-translate"],"icon-translate"),"icon-translate-anchor":new qo(wt.paint_symbol["icon-translate-anchor"],"icon-translate-anchor"),"text-opacity":new $o(wt.paint_symbol["text-opacity"],"text-opacity"),"text-color":new $o(wt.paint_symbol["text-color"],"text-color",{runtimeType:$t,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new $o(wt.paint_symbol["text-halo-color"],"text-halo-color"),"text-halo-width":new $o(wt.paint_symbol["text-halo-width"],"text-halo-width"),"text-halo-blur":new $o(wt.paint_symbol["text-halo-blur"],"text-halo-blur"),"text-translate":new qo(wt.paint_symbol["text-translate"],"text-translate"),"text-translate-anchor":new qo(wt.paint_symbol["text-translate-anchor"],"text-translate-anchor")})}
vendor: 19,419 bytes, line 2
2,get layout(){return sp||=new Wo({"symbol-placement":new qo(wt.layout_symbol["symbol-placement"],"symbol-placement"),"symbol-spacing":new qo(wt.layout_symbol["symbol-spacing"],"symbol-spacing"),"symbol-avoid-edges":new qo(wt.layout_symbol["symbol-avoid-edges"],"symbol-avoid-edges"),"symbol-sort-key":new $o(wt.layout_symbol["symbol-sort-key"],"symbol-sort-key"),"symbol-z-order":new qo(wt.layout_symbol["symbol-z-order"],"symbol-z-order"),"icon-allow-overlap":new qo(wt.layout_symbol["icon-allow-overlap"],"icon-allow-overlap"),"icon-overlap":new qo(wt.layout_symbol["icon-overlap"],"icon-overlap"),"icon-ignore-placement":new qo(wt.layout_symbol["icon-ignore-placement"],"icon-ignore-placement"),"icon-optional":new qo(wt.layout_symbol["icon-optional"],"icon-optional"),"icon-rotation-alignment":new qo(wt.layout_symbol["icon-rotation-alignment"],"icon-rotation-alignment"),"icon-size":new $o(wt.layout_symbol["icon-size"],"icon-size"),"icon-text-fit":new qo(wt.layout_symbol["icon-text-fit"],"icon-text-fit"),"icon-text-fit-padding":new qo(wt.layout_symbol["icon-text-fit-padding"],"icon-text-fit-padding"),"icon-image":new $o(wt.layout_symbol["icon-image"],"icon-image"),"icon-rotate":new $o(wt.layout_symbol["icon-rotate"],"icon-rotate"),"icon-padding":new $o(wt.layout_symbol["icon-padding"],"icon-padding"),"icon-keep-upright":new qo(wt.layout_symbol["icon-keep-upright"],"icon-keep-upright"),"icon-offset":new $o(wt.layout_symbol["icon-offset"],"icon-offset"),"icon-anchor":new $o(wt.layout_symbol["icon-anchor"],"icon-anchor"),"icon-pitch-alignment":new qo(wt.layout_symbol["icon-pitch-alignment"],"icon-pitch-alignment"),"text-pitch-alignment":new qo(wt.layout_symbol["text-pitch-alignment"],"text-pitch-alignment"),"text-rotation-alignment":new qo(wt.layout_symbol["text-rotation-alignment"],"text-rotation-alignment"),"text-field":new $o(wt.layout_symbol["text-field"],"text-field"),"text-font":new $o(wt.layout_symbol["text-font"],"text-font"),"text-size":new $o(wt.layout_symbol["text-size"],"text-size"),"text-max-width":new $o(wt.layout_symbol["text-max-width"],"text-max-width"),"text-line-height":new qo(wt.layout_symbol["text-line-height"],"text-line-height"),"text-letter-spacing":new $o(wt.layout_symbol["text-letter-spacing"],"text-letter-spacing"),"text-justify":new $o(wt.layout_symbol["text-justify"],"text-justify"),"text-radial-offset":new $o(wt.layout_symbol["text-radial-offset"],"text-radial-offset"),"text-variable-anchor":new qo(wt.layout_symbol["text-variable-anchor"],"text-variable-anchor"),"text-variable-anchor-offset":new $o(wt.layout_symbol["text-variable-anchor-offset"],"text-variable-anchor-offset"),"text-anchor":new $o(wt.layout_symbol["text-anchor"],"text-anchor"),"text-max-angle":new qo(wt.layout_symbol["text-max-angle"],"text-max-angle"),"text-writing-mode":new qo(wt.layout_symbol["text-writing-mode"],"text-writing-mode"),"text-rotate":new $o(wt.layout_symbol["text-rotate"],"text-rotate"),"text-padding":new qo(wt.layout_symbol["text-padding"],"text-padding"),"text-keep-upright":new qo(wt.layout_symbol["text-keep-upright"],"text-keep-upright"),"text-transform":new $o(wt.layout_symbol["text-transform"],"text-transform"),"text-offset":new $o(wt.layout_symbol["text-offset"],"text-offset"),"text-allow-overlap":new qo(wt.layout_symbol["text-allow-overlap"],"text-allow-overlap"),"text-overlap":new qo(wt.layout_symbol["text-overlap"],"text-overlap"),"text-ignore-placement":new qo(wt.layout_symbol["text-ignore-placement"],"text-ignore-placement"),"text-optional":new qo(wt.layout_symbol["text-optional"],"text-optional")})}},up=class{constructor(e){if(void 0===e.property.overrides)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Vt,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()){e(this.defaultValue.value._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};fo("FormatSectionOverride",up,{omit:["defaultValue"]});const cp=e=>"symbol"===e.type;var pp=class e extends Yo{constructor(e,t){super(e,hp,t)}recalculate(e,t){if(super.recalculate(e,t),"auto"===this.layout.get("icon-rotation-alignment")&&("point"===this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="viewport":this.layout._values["icon-rotation-alignment"]="map"),"auto"===this.layout.get("text-rotation-alignment")&&("point"===this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="viewport":this.layout._values["text-rotation-alignment"]="map"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){let e=this.layout.get("text-writing-mode");if(e){let t=[];for(let i of e)t.includes(i)||t.push(i);this.layout._values["text-writing-mode"]=t}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,t,i,r){let a=this.layout.get(e).evaluate(t,{},i,r),n=this._unevaluatedLayout._values[e];return n.isDataDriven()||Ja(n.value)||!a?a:function(e,t){return t.replace(/{([^{}]+)}/g,((t,i)=>e&&i in e?String(e[i]):""))}(t.properties,a)}createBucket(e){return new op(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let t of hp.paint.overridableProperties){if(!e.hasPaintOverride(this.layout,t))continue;let i=this.paint.get(t),r=new Xa(new up(i),`layers[${this.id}].paint.${i.property.name}`,i.property.specification),a=null;a="constant"===i.value.kind||"source"===i.value.kind?new en("source",r):new tn("composite",r,i.value.zoomStops),this.paint._values[t]=new Oo(i.property,a,i.parameters)}}_handleOverridablePaintPropertyUpdate(t,i,r){return!(!this.layout||i.isDataDriven()||r.isDataDriven())&&e.hasPaintOverride(this.layout,t)}static hasPaintOverride(e,t){let i=e.get("text-field"),r=hp.paint.properties[t],a=!1,n=e=>{for(let t of e)if(r.overrides?.hasOverride(t))return void(a=!0)};if("constant"===i.value.kind&&i.value.value instanceof Fi)n(i.value.value.sections);else if("source"===i.value.kind||"composite"===i.value.kind){let e=t=>{if(!a)if(t instanceof Xi&&Wi(t.value)===Xt){let e=t.value;n(e.sections)}else t instanceof br?n(t.sections):t.eachChild(e)},t=i.value;t._styleExpression&&e(t._styleExpression.expression)}return a}};let dp;var fp={get paint(){return dp||=new Wo({"background-color":new qo(wt.paint_background["background-color"],"background-color"),"background-pattern":new Go(wt.paint_background["background-pattern"],"background-pattern"),"background-opacity":new qo(wt.paint_background["background-opacity"],"background-opacity")})}};var mp=class extends Yo{constructor(e,t){super(e,fp,t)}};var gp=class extends Yo{constructor(e,t){super(e,{},t),this.onAdd=e=>{this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)},this.onRemove=e=>{this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)},this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}};function _p(e,t){if("custom"===e.type)return new gp(e,t);switch(e.type){case"background":return new mp(e,t);case"circle":return new bh(e,t);case"color-relief":return new $h(e,t);case"fill":return new Hu(e,t);case"fill-extrusion":return new dc(e,t);case"heatmap":return new Dh(e,t);case"hillshade":return new Fh(e,t);case"line":return new Ic(e,t);case"raster":return new es(e,t);case"symbol":return new pp(e,t)}}var yp=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 vp={once:!0};var xp=class{constructor(e,t){this.target=e,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new yp((()=>this.process())),this.subscription=We(this.target,"message",(e=>this.receive(e)),!1),this.globalScope=qe(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(1e18*Math.random()).toString(36).substring(0,10),n=t?We(t.signal,"abort",(()=>{n?.unsubscribe(),delete this.resolveRejects[a];let i={id:a,type:"<cancel>",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(i),r(new ot(t.signal.reason))}),vp):null;this.resolveRejects[a]={resolve:e=>{n?.unsubscribe(),i(e)},reject:e=>{n?.unsubscribe(),r(e)}};let o=[],s={...e,id:a,sourceMapId:this.mapId,origin:location.origin,data:yo(e.data,o)};this.target.postMessage(s,{transfer:o})}))}receive(e){let t=e.data,i=t.id,r=["file://","resource://android","null"],a=[t.origin,location.origin],n=t.origin===location.origin,o=a.some((e=>r.includes(e)));if((n||o)&&(!t.targetMapId||this.mapId===t.targetMapId)){if("<cancel>"===t.type){delete this.tasks[i];let e=this.abortControllers[i];return delete this.abortControllers[i],void(e&&e.abort())}if(qe(self)||t.mustQueue)return this.tasks[i]=t,this.taskQueue.push(i),void this.invoker.trigger();this.processTask(i,t)}}process(){if(0===this.taskQueue.length)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("<response>"===t.type){let i=this.resolveRejects[e];if(delete this.resolveRejects[e],!i)return;return void(t.error?i.reject(se(vo(t.error))):i.resolve(vo(t.data)))}if(!this.messageHandlers[t.type])return void this.completeTask(e,null,null);let i=vo(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(t){this.completeTask(e,se(t))}}completeTask(e,t,i){let r=[];delete this.abortControllers[e];let a={id:e,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?yo(t):null,data:yo(i,r)};this.target.postMessage(a,{transfer:r})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};const bp=6371008.8;var wp=class e{constructor(e,t){if(isNaN(e)||isNaN(t))throw Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new e(Ce(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let t=Math.PI/180,i=this.lat*t,r=e.lat*t,a=Math.sin(i)*Math.sin(r)+Math.cos(i)*Math.cos(r)*Math.cos((e.lng-this.lng)*t);return bp*Math.acos(Math.min(a,1))}static convert(t){if(t instanceof e)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new e(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&t)return new e(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 Tp=2*Math.PI*bp;function Sp(e){return Tp*Math.cos(e*Math.PI/180)}function Pp(e){return(180+e)/360}function Ep(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Cp(e,t){return e/Sp(t)}function Mp(e){return 360*e-180}function Ip(e){let t=180-360*e;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}function Ap(e,t){return e*Sp(Ip(t))}var zp=class e{constructor(e,t,i=0){this.x=+e,this.y=+t,this.z=+i}static fromLngLat(t,i=0){let r=wp.convert(t);return new e(Pp(r.lng),Ep(r.lat),Cp(i,r.lat))}toLngLat(){return new wp(Mp(this.x),Ip(this.y))}toAltitude(){return Ap(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Tp*function(e){return 1/Math.cos(e*Math.PI/180)}(Ip(this.y))}};function kp(e,t){let{x:i,y:r}=zp.fromLngLat(t);return!(e<0||e>25||r<0||r>=1||i<0||i>=1)}var Dp=class{constructor(e,t,i){if(!function(e,t,i){return!(e<0||e>25||i<0||i>=2**e||t<0||t>=2**e)}(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=Fp(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=function(e,t,i){t=2**i-t-1;let r=Op(256*e,256*t,i),a=Op(256*(e+1),256*(t+1),i);return`${r[0]},${r[1]},${a[0]},${a[1]}`}(this.x,this.y,this.z),a=function(e,t,i){let r="";for(let a=e;a>0;a--){let e=1<<a-1;r+=(t&e?1:0)+(i&e?2:0)}return r}(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("tms"===i?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 d((e.x*t-this.x)*ne,(e.y*t-this.y)*ne)}toString(){return`${this.z}/${this.x}/${this.y}`}},Rp=class{constructor(e,t){this.wrap=e,this.canonical=t,this.key=Fp(e,t.z,t.z,t.x,t.y)}},Lp=class e{constructor(e,t,i,r,a){if(this.terrainRttPosMatrix32f=null,e<i)throw Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${i}`);this.overscaledZ=e,this.wrap=t,this.canonical=new Dp(i,+r,+a),this.key=Fp(t,e,i,r,a)}clone(){return new e(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.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 e(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new e(t,this.wrap,t,this.canonical.x>>i,this.canonical.y>>i)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,t){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-e;return e>this.canonical.z?Fp(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):Fp(this.wrap*+t,e,e,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(0===e.overscaledZ)return this.overscaledZ>0;let t=this.canonical.z-e.canonical.z;return!(t<0)&&(e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t)}children(t){if(this.overscaledZ>=t)return[new e(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let i=this.canonical.z+1,r=2*this.canonical.x,a=2*this.canonical.y;return[new e(i,this.wrap,i,r,a),new e(i,this.wrap,i,r+1,a),new e(i,this.wrap,i,r,a+1),new e(i,this.wrap,i,r+1,a+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new e(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new e(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return 2**(this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Rp(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new zp(e.x-this.wrap,e.y))}normalizeCoordinates(t,i,r=ne){if(t>=0&&t<r&&i>=0&&i<r)return{tileID:this,x:t,y:i};let a=Math.floor(t/r),n=Math.floor(i/r),o=t-a*r,s=i-n*r,l=this.canonical.z,h=1<<l,u=this.canonical.y+n;if(u<0||u>=h)return null;let c=this.canonical.x+a,p=this.wrap;return c<0?(p-=Math.ceil(-c/h),c=(c%h+h)%h):c>=h&&(p+=Math.floor(c/h),c%=h),{tileID:new e(this.overscaledZ,p,l,c,u),x:o,y:s}}};function Fp(e,t,i,r,a){(e*=2)<0&&(e=-1*e-1);let n=1<<i;return(n*n*e+n*a+r).toString(36)+i.toString(36)+t.toString(36)}const Bp=6378137*Math.PI;function Op(e,t,i){let r=2*Bp/256/2**i;return[e*r-Bp,t*r-Bp]}function Vp(e,t){let i=Math.abs(2*e.wrap)-+(e.wrap<0),r=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||r-i||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}fo("CanonicalTileID",Dp),fo("OverscaledTileID",Lp,{omit:["terrainRttPosMatrix32f"]});var jp=class e{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(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(e){return this.expandBy(-e)}map(t){let i=new e;return i.extend(t(new d(this.minX,this.minY))),i.extend(t(new d(this.maxX,this.minY))),i.extend(t(new d(this.minX,this.maxY))),i.extend(t(new d(this.maxX,this.maxY))),i}static fromPoints(t){let i=new e;for(let e of t)i.extend(e);return i}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}};const Np="_geojsonTileLayer";var qp=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]}},$p=class{constructor(e,t,i,r,a){this.type="Feature",this._vectorTileFeature=e,this._x=i,this._y=r,this._z=t;for(let t in e.properties)"string"!=typeof e.properties[t]||!e.properties[t].startsWith("__$json__:")||(e.properties[t]=JSON.parse(e.properties[t].slice(10)));this.properties=e.properties,this.id=a}projectPoint(e,t,i,r){return[360*(e.x+t)/r-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+i)/r)*Math.PI))-90]}projectLine(e,t,i,r){return e.map((e=>this.projectPoint(e,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 e=[];
vendor: 4,512 bytes, line 2
2for(let t of a)e.push(t[0]);let n=this.projectLine(e,i,r,t);this._geometry=1===e.length?{type:"Point",coordinates:n[0]}:{type:"MultiPoint",coordinates:n};break}case 2:{let e=a.map((e=>this.projectLine(e,i,r,t)));this._geometry=1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e};break}case 3:{let e=Qu(a),n=[];for(let a of e)n.push(a.map((e=>this.projectLine(e,i,r,t))));this._geometry=1===n.length?{type:"Polygon",coordinates:n[0]}:{type:"MultiPolygon",coordinates:n};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)"_geometry"!==t&&"_vectorTileFeature"!==t&&"_x"!==t&&"_y"!==t&&"_z"!==t&&(e[t]=this[t]);return e}},Up=class{constructor(e,t,i){this._name=e,this.dataBuffer=t,"number"==typeof i?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}},Gp=class extends Up{},Zp=class extends Gp{getValueFromBuffer(e){return this.dataBuffer[e]}},Wp=class extends Gp{getValueFromBuffer(e){return this.dataBuffer[e]}},Hp=class extends Up{constructor(e,t,i,r){super(e,t,r),this.delta=i}},Xp=class extends Hp{constructor(e,t,i,r){super(e,Int32Array.of(t),i,r)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}},Yp=class extends Up{constructor(e,t,i,r){super(e,r?Int32Array.of(t):Uint32Array.of(t),i)}getValueFromBuffer(e){return this.dataBuffer[0]}},Kp=class{constructor(e,t,i,r,a=4096){if(this._name=e,this._geometryVector=t,this._idVector=i,this._propertyVectors=r,this._extent=a,0===e.length)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((e=>[e.name,e]))),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 e=this.idVector.getValue(i);r=this.containsMaxSafeIntegerValues(this.idVector)&&null!==e?Number(e):e}let a={coordinates:t[i],type:this.geometryVector.geometryType(i)},n={};for(let e of this.propertyVectors){if(!e)continue;let t=e.name,r=e.getValue(i);null!==r&&(n[t]=r)}e.push({id:r,geometry:a,properties:n})}return e}containsMaxSafeIntegerValues(e){return e instanceof Zp||e instanceof Yp||e instanceof Xp||e instanceof Wp}};const Jp=0,Qp=0,ed=1,td=2,id=3,rd=4,ad=5,nd=6,od=7,sd=8,ld=9,hd=0,ud=1,cd=0;var pd,dd,fd=class{constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}increment(){return this.value++}add(e){this.value+=e}};!function(e){e.NONE="NONE",e.DELTA="DELTA",e.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",e.RLE="RLE",e.MORTON="MORTON",e.PDE="PDE"}(pd||={}),function(e){e.NONE="NONE",e.FAST_PFOR="FAST_PFOR",e.VARINT="VARINT"}(dd||={});const md=new Uint32Array(33);md[0]=0;for(let e=1;e<=32;e++)md[e]=32===e?4294967295:4294967295>>>32-e;const gd=md;function _d(e,t){return e-e%t}function yd(e){return _d(e+31,32)}function vd(e){let t=e>>>0;return((255&t)<<24|(65280&t)<<8|t>>>8&65280|t>>>24&255)>>>0}const xd=function(e){if(!Number.isFinite(e)||e<=0)return 65536;let t=_d(Math.floor(e),256);return 0===t?256:t}(65536),bd=3*xd/256+xd|0;function wd(){let e=new Uint8Array(bd);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 Td(e,t,i,r,a){switch(a){case 1:!function(e,t,i,r){let a=r,n=t;for(let t=0;t<8;t++){let t=e[n++]>>>0;i[a++]=t>>>0&1,i[a++]=t>>>1&1,i[a++]=t>>>2&1,i[a++]=t>>>3&1,i[a++]=t>>>4&1,i[a++]=t>>>5&1,i[a++]=t>>>6&1,i[a++]=t>>>7&1,i[a++]=t>>>8&1,i[a++]=t>>>9&1,i[a++]=t>>>10&1,i[a++]=t>>>11&1,i[a++]=t>>>12&1,i[a++]=t>>>13&1,i[a++]=t>>>14&1,i[a++]=t>>>15&1,i[a++]=t>>>16&1,i[a++]=t>>>17&1,i[a++]=t>>>18&1,i[a++]=t>>>19&1,i[a++]=t>>>20&1,i[a++]=t>>>21&1,i[a++]=t>>>22&1,i[a++]=t>>>23&1,i[a++]=t>>>24&1,i[a++]=t>>>25&1,i[a++]=t>>>26&1,i[a++]=t>>>27&1,i[a++]=t>>>28&1,i[a++]=t>>>29&1,i[a++]=t>>>30&1,i[a++]=t>>>31&1}}(e,t,i,r);break;case 2:!function(e,t,i,r){let a=r,n=t;
vendor: 4,183 bytes, line 2
2for(let t=0;t<8;t++){let t=e[n++]>>>0,r=e[n++]>>>0;i[a++]=t>>>0&3,i[a++]=t>>>2&3,i[a++]=t>>>4&3,i[a++]=t>>>6&3,i[a++]=t>>>8&3,i[a++]=t>>>10&3,i[a++]=t>>>12&3,i[a++]=t>>>14&3,i[a++]=t>>>16&3,i[a++]=t>>>18&3,i[a++]=t>>>20&3,i[a++]=t>>>22&3,i[a++]=t>>>24&3,i[a++]=t>>>26&3,i[a++]=t>>>28&3,i[a++]=t>>>30&3,i[a++]=r>>>0&3,i[a++]=r>>>2&3,i[a++]=r>>>4&3,i[a++]=r>>>6&3,i[a++]=r>>>8&3,i[a++]=r>>>10&3,i[a++]=r>>>12&3,i[a++]=r>>>14&3,i[a++]=r>>>16&3,i[a++]=r>>>18&3,i[a++]=r>>>20&3,i[a++]=r>>>22&3,i[a++]=r>>>24&3,i[a++]=r>>>26&3,i[a++]=r>>>28&3,i[a++]=r>>>30&3}}(e,t,i,r);break;case 3:!function(e,t,i,r){let a=r,n=t;for(let t=0;t<8;t++){let t=e[n++]>>>0,r=e[n++]>>>0,o=e[n++]>>>0;i[a++]=t>>>0&7,i[a++]=t>>>3&7,i[a++]=t>>>6&7,i[a++]=t>>>9&7,i[a++]=t>>>12&7,i[a++]=t>>>15&7,i[a++]=t>>>18&7,i[a++]=t>>>21&7,i[a++]=t>>>24&7,i[a++]=t>>>27&7,i[a++]=7&(t>>>30|(1&r)<<2),i[a++]=r>>>1&7,i[a++]=r>>>4&7,i[a++]=r>>>7&7,i[a++]=r>>>10&7,i[a++]=r>>>13&7,i[a++]=r>>>16&7,i[a++]=r>>>19&7,i[a++]=r>>>22&7,i[a++]=r>>>25&7,i[a++]=r>>>28&7,i[a++]=7&(r>>>31|(3&o)<<1),i[a++]=o>>>2&7,i[a++]=o>>>5&7,i[a++]=o>>>8&7,i[a++]=o>>>11&7,i[a++]=o>>>14&7,i[a++]=o>>>17&7,i[a++]=o>>>20&7,i[a++]=o>>>23&7,i[a++]=o>>>26&7,i[a++]=o>>>29&7}}(e,t,i,r);break;case 4:!function(e,t,i,r){let a=r,n=t;for(let t=0;t<8;t++){let t=e[n++]>>>0,r=e[n++]>>>0,o=e[n++]>>>0,s=e[n++]>>>0;i[a++]=t>>>0&15,i[a++]=t>>>4&15,i[a++]=t>>>8&15,i[a++]=t>>>12&15,i[a++]=t>>>16&15,i[a++]=t>>>20&15,i[a++]=t>>>24&15,i[a++]=t>>>28&15,i[a++]=r>>>0&15,i[a++]=r>>>4&15,i[a++]=r>>>8&15,i[a++]=r>>>12&15,i[a++]=r>>>16&15,i[a++]=r>>>20&15,i[a++]=r>>>24&15,i[a++]=r>>>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++]=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}}(e,t,i,r);break;case 5:!function(e,t,i,r){let a=r,n=t;for(let t=0;t<8;t++){let t=e[n++]>>>0,r=e[n++]>>>0,o=e[n++]>>>0,s=e[n++]>>>0,l=e[n++]>>>0;i[a++]=t>>>0&31,i[a++]=t>>>5&31,i[a++]=t>>>10&31,i[a++]=t>>>15&31,i[a++]=t>>>20&31,i[a++]=t>>>25&31,i[a++]=31&(t>>>30|(7&r)<<2),i[a++]=r>>>3&31,i[a++]=r>>>8&31,i[a++]=r>>>13&31,i[a++]=r>>>18&31,i[a++]=r>>>23&31,i[a++]=31&(r>>>28|(1&o)<<4),i[a++]=o>>>1&31,i[a++]=o>>>6&31,i[a++]=o>>>11&31,i[a++]=o>>>16&31,i[a++]=o>>>21&31,i[a++]=o>>>26&31,i[a++]=31&(o>>>31|(15&s)<<1),i[a++]=s>>>4&31,i[a++]=s>>>9&31,i[a++]=s>>>14&31,i[a++]=s>>>19&31,i[a++]=s>>>24&31,i[a++]=31&(s>>>29|(3&l)<<3),i[a++]=l>>>2&31,i[a++]=l>>>7&31,i[a++]=l>>>12&31,i[a++]=l>>>17&31,i[a++]=l>>>22&31,i[a++]=l>>>27&31}}(e,t,i,r);break;case 6:!function(e,t,i,r){let a=r,n=t;for(let t=0;t<8;t++){let t=e[n++]>>>0,r=e[n++]>>>0,o=e[n++]>>>0,s=e[n++]>>>0,l=e[n++]>>>0,h=e[n++]>>>0;i[a++]=t>>>0&63,i[a++]=t>>>6&63,i[a++]=t>>>12&63,i[a++]=t>>>18&63,i[a++]=t>>>24&63,i[a++]=63&(t>>>30|(15&r)<<2),i[a++]=r>>>4&63,i[a++]=r>>>10&63,i[a++]=r>>>16&63,i[a++]=r>>>22&63,i[a++]=63&(r>>>28|(3&o)<<4),i[a++]=o>>>2&63,i[a++]=o>>>8&63,i[a++]=o>>>14&63,i[a++]=o>>>20&63,i[a++]=o>>>26&63,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++]=63&(s>>>30|(15&l)<<2),i[a++]=l>>>4&63,i[a++]=l>>>10&63,i[a++]=l>>>16&63,i[a++]=l>>>22&63,i[a++]=63&(l>>>28|(3&h)<<4),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}}(e,t,i,r);break;case 7:!function(e,t,i,r){let a=r,n=t;for(let t=0;t<8;t++){let t=e[n++]>>>0,r=e[n++]>>>0,o=e[n++]>>>0,s=e[n++]>>>0,l=e[n++]>>>0,h=e[n++]>>>0,u=e[n++]>>>0;i[a++]=t>>>0&127,i[a++]=t>>>7&127,i[a++]=t>>>14&127,i[a++]=t>>>21&127,i[a++]=127&(t>>>28|(7&r)<<4),i[a++]=r>>>3&127,i[a++]=r>>>10&127,i[a++]=r>>>17&127,i[a++]=r>>>24&127,i[a++]=127&(r>>>31|(63&o)<<1),i[a++]=o>>>6&127,i[a++]=o>>>13&127,i[a++]=o>>>20&127,i[a++]=127&(o>>>27|(3&s)<<5),i[a++]=s>>>2&127,i[a++]=s>>>9&127,i[a++]=s>>>16&127,i[a++]=s>>>23&127,i[a++]=127&(s>>>30|(31&l)<<2),i[a++]=l>>>5&127,i[a++]=l>>>12&127,i[a++]=l>>>19&127,i[a++]=127&(l>>>26|(1&h)<<6),i[a++]=h>>>1&127,i[a++]=h>>>8&127,i[a++]=h>>>15&127,i[a++]=h>>>22&127,i[a++]=127&(h>>>29|(15&u)<<3),i[a++]=u>>>4&127,i[a++]=u>>>11&127,i[a++]=u>>>18&127,i[a++]=u>>>25&127}}(e,t,i,r);break;case 8:!function(e,t,i,r){let a=r,n=t;
vendor: 16,341 bytes, line 2
2for(let t=0;t<8;t++){let t=e[n++]>>>0,r=e[n++]>>>0,o=e[n++]>>>0,s=e[n++]>>>0,l=e[n++]>>>0,h=e[n++]>>>0,u=e[n++]>>>0,c=e[n++]>>>0;i[a++]=t>>>0&255,i[a++]=t>>>8&255,i[a++]=t>>>16&255,i[a++]=t>>>24&255,i[a++]=r>>>0&255,i[a++]=r>>>8&255,i[a++]=r>>>16&255,i[a++]=r>>>24&255,i[a++]=o>>>0&255,i[a++]=o>>>8&255,i[a++]=o>>>16&255,i[a++]=o>>>24&255,i[a++]=s>>>0&255,i[a++]=s>>>8&255,i[a++]=s>>>16&255,i[a++]=s>>>24&255,i[a++]=l>>>0&255,i[a++]=l>>>8&255,i[a++]=l>>>16&255,i[a++]=l>>>24&255,i[a++]=h>>>0&255,i[a++]=h>>>8&255,i[a++]=h>>>16&255,i[a++]=h>>>24&255,i[a++]=u>>>0&255,i[a++]=u>>>8&255,i[a++]=u>>>16&255,i[a++]=u>>>24&255,i[a++]=c>>>0&255,i[a++]=c>>>8&255,i[a++]=c>>>16&255,i[a++]=c>>>24&255}}(e,t,i,r);break;case 16:!function(e,t,i,r){let a=r,n=t;for(let t=0;t<128;t++){let t=e[n++]>>>0;i[a++]=65535&t,i[a++]=t>>>16&65535}}(e,t,i,r);break;default:!function(e,t,i,r,a){let n=gd[a]>>>0,o=t,s=0,l=e[o]>>>0,h=r;for(let t=0;t<8;t++){for(let t=0;t<32;t++)if(s+a<=32){let r=l>>>s&n;i[h+t]=0|r,s+=a,32===s&&(s=0,o++,31!==t&&(l=e[o]>>>0))}else{let r=32-s,u=l>>>s;o++,l=e[o]>>>0;let c=a-r,p=(u|(l&-1>>>32-c>>>0)<<r)&n;i[h+t]=0|p,s=c}h+=32,s=0,t<7&&(l=e[o]>>>0)}}(e,t,i,r,a)}return t+(a<<3)|0}function Sd(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++],n=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:n,bytePosIn:i}}function Pd(e,t,i,r,a,n,o,s,l){let{maxBits:h,exceptionBitWidth:u,bytePosIn:c}=function(e,t,i,r,a,n){if(i+1>t)throw Error(`FastPFOR decode: exception header underflow at block=${n} (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=${n} (bitWidth=${r}, expected ${r}..32)`);let s=o-r|0;if(s<1||s>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${s} at block=${n} (bitWidth=${r}, maxBits=${o})`);if(i+a>t)throw Error(`FastPFOR decode: exception positions underflow at block=${n} (need=${a}, have=${t-i})`);return{maxBits:o,exceptionBitWidth:s,bytePosIn:i}}(a,n,o,i,r,l);if(o=c,1===u){let n=1<<i;for(let i=0;i<r;i=i+1|0){e[a[o++]+t|0]|=n}return o}let p=s.dataToBePacked[u];if(!p)throw Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${u} (bitWidth=${i}, maxBits=${h}) at block ${l}`);let d=s.dataPointers,f=0|d[u],m=0|s.exceptionSizes[u];if(f+r>m)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${u} (ptr=${f}, need ${r}, size=${m}) at block ${l}`);for(let n=0;n<r;n=n+1|0){let r=a[o++],n=0|p[f++];e[r+t|0]|=n<<i}return d[u]=f,o}function Ed(e,t,i,r,a,n){let o=0|i,s=0|e[o];if(s<=0||o+s>e.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${s} at pageStart=${o} (expected > 0 and pageStart+whereMeta < encoded.length=${e.length})`);let l=o+1|0,h=o+s|0,u=e[h]>>>0,c=u+3>>>2,p=h+1,d=p+c;if(d>=e.length)throw Error(`FastPFOR decode: invalid byteSize=${u} (metaInts=${c}, pageStart=${o}, packedEnd=${h}, byteContainerStart=${p}) causes bitmapPos=${d} out of bounds (encoded.length=${e.length})`);let f=function(e,t,i,r){r.byteContainer.length<i&&(r.byteContainer=new Uint8Array(2*i),r.byteContainerI32=void 0);let a=r.byteContainer,n=i>>>2;if(3&a.byteOffset)for(let i=0;i<n;i=i+1|0){let r=0|e[t+i|0],n=i<<2;a[n]=255&r,a[n+1|0]=r>>>8&255,a[n+2|0]=r>>>16&255,a[n+3|0]=r>>>24&255}else{let i=r.byteContainerI32;(!i||i.buffer!==a.buffer||i.byteOffset!==a.byteOffset||i.length<n)&&(i=r.byteContainerI32=new Int32Array(a.buffer,a.byteOffset,a.byteLength>>>2)),i.set(e.subarray(t,t+n))}let o=3&i;if(o>0){let i=0|e[t+n|0],r=n<<2;for(let e=0;e<o;e=e+1|0)a[r+e|0]=i>>>(e<<3)&255}return a}(e,p,u,n),m=u,g=function(e,t,i){let r=0|e[t++],a=i.dataToBePacked;for(let n=2;n<=32;n=n+1|0){if(!(r>>>n-1&1))continue;if(t>=e.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${n}, streamWordIndex=${t}, needWords=1, availableWords=${e.length-t}, encodedWords=${e.length})`);let o=e[t++]>>>0,s=yd(o),l=o*n+31>>>5;if(t+l>e.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${n}, size=${o}, streamWordIndex=${t}, needWords=${l}, availableWords=${e.length-t}, encodedWords=${e.length})`);let h=a[n];(!h||h.length<s)&&(h=a[n]=new Uint32Array(s));let u=0;for(;u<o;u=u+32|0)Md(e,t,h,u,n),t=t+n|0;t=t-((u-o|0)*n>>>5)|0,i.exceptionSizes[n]=o}return t}(e,d,n);return n.dataPointers.fill(0),function(e,t,i,r,a,n,o,s,l,h){let u=0|i,c=0;for(let t=0;t<o;t=t+1|0){let i=Sd(s,l,c,t);c=i.bytePosIn;let r=i.bitWidth,o=i.exceptionCount,p=n+256*t|0;switch(r){case 0:a.fill(0,p,p+256);break;case 32:for(let t=0;t<256;t=t+1|0)a[p+t|0]=0|e[u+t|0];u=u+256|0;break;default:u=Td(e,u,a,p,r)}o>0&&(c=Pd(a,p,r,o,s,l,c,h,t))}if(u!==r)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${t}, packedStart=${i}, consumedPackedEnd=${u}, expectedPackedEnd=${r}, packedWords=${r-i}, encoded.length=${e.length})`)}(e,o,l,h,t,0|r,a/256|0,f,m,n),g}function Cd(e,t,i){let r=0,a=0,n=new Uint32Array(t),o=i??wd();if(e.length>0){let t=0|e[r];if(r=r+1|0,255&t)throw Error(`FastPFOR decode: invalid alignedLength=${t} (expected multiple of 256)`);if(a+t>n.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${a}, alignedLength=${t}, out.length=${n.length})`);r=function(e,t,i,r,a,n){let o=r+_d(a,256),s=r,l=i;for(;s!==o;){let i=Math.min(xd,o-s);l=Ed(e,t,l,s,i,n),s=s+i|0}return l}(e,n,r,a,t,o),a=a+t|0}return function(e,t,i,r,a,n){if(0===n)return t;let o=0,s=t,l=t+i,h=a,u=a,c=a+n,p=0,d=0;for(;s<l&&u<c;){let t=e[s]>>>o&255;if(o+=8,s+=o>>>5,o&=31,p|=(127&t)<<d,128&t)r[u++]=0|p,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=${u-h}/${n}, inPos=${s}, inEnd=${l})`)}if(u!==c)throw Error(`FastPFOR VByte: truncated stream (decoded=${u-h}, expected=${n}, consumedWords=${s-t}/${i}, vbyteStart=${t}, vbyteEnd=${l})`)}(e,r,e.length-r|0,n,a,t-a|0),n}function Md(e,t,i,r,a){switch(a){case 2:return void function(e,t,i,r){let a=r,n=e[t]>>>0,o=e[t+1]>>>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++]=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}(e,t,i,r);case 3:return void function(e,t,i,r){let a=r,n=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>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++]=7&(n>>>30|(1&o)<<2),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++]=7&(o>>>31|(3&s)<<1),i[a++]=s>>>2&7,i[a++]=s>>>5&7,i[a++]=s>>>8&7,i[a++]=s>>>11&7,i[a++]=s>>>14&7,i[a++]=s>>>17&7,i[a++]=s>>>20&7,i[a++]=s>>>23&7,i[a++]=s>>>26&7,i[a]=s>>>29&7}(e,t,i,r);case 4:return void function(e,t,i,r){let a=r,n=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>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++]=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++]=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++]=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}(e,t,i,r);case 5:return void function(e,t,i,r){let a=r,n=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,h=e[t+4]>>>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++]=31&(n>>>30|(7&o)<<2),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++]=31&(o>>>28|(1&s)<<4),i[a++]=s>>>1&31,i[a++]=s>>>6&31,i[a++]=s>>>11&31,i[a++]=s>>>16&31,i[a++]=s>>>21&31,i[a++]=s>>>26&31,i[a++]=31&(s>>>31|(15&l)<<1),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++]=31&(l>>>29|(3&h)<<3),i[a++]=h>>>2&31,i[a++]=h>>>7&31,i[a++]=h>>>12&31,i[a++]=h>>>17&31,i[a++]=h>>>22&31,i[a]=h>>>27&31}(e,t,i,r);case 6:return void function(e,t,i,r){let a=r,n=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,h=e[t+4]>>>0,u=e[t+5]>>>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++]=63&(n>>>30|(15&o)<<2),i[a++]=o>>>4&63,i[a++]=o>>>10&63,i[a++]=o>>>16&63,i[a++]=o>>>22&63,i[a++]=63&(o>>>28|(3&s)<<4),i[a++]=s>>>2&63,i[a++]=s>>>8&63,i[a++]=s>>>14&63,i[a++]=s>>>20&63,i[a++]=s>>>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++]=63&(l>>>30|(15&h)<<2),i[a++]=h>>>4&63,i[a++]=h>>>10&63,i[a++]=h>>>16&63,i[a++]=h>>>22&63,i[a++]=63&(h>>>28|(3&u)<<4),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}(e,t,i,r);case 7:return void function(e,t,i,r){let a=r,n=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,h=e[t+4]>>>0,u=e[t+5]>>>0,c=e[t+6]>>>0;i[a++]=n>>>0&127,i[a++]=n>>>7&127,i[a++]=n>>>14&127,i[a++]=n>>>21&127,i[a++]=127&(n>>>28|(7&o)<<4),i[a++]=o>>>3&127,i[a++]=o>>>10&127,i[a++]=o>>>17&127,i[a++]=o>>>24&127,i[a++]=127&(o>>>31|(63&s)<<1),i[a++]=s>>>6&127,i[a++]=s>>>13&127,i[a++]=s>>>20&127,i[a++]=127&(s>>>27|(3&l)<<5),i[a++]=l>>>2&127,i[a++]=l>>>9&127,i[a++]=l>>>16&127,i[a++]=l>>>23&127,i[a++]=127&(l>>>30|(31&h)<<2),i[a++]=h>>>5&127,i[a++]=h>>>12&127,i[a++]=h>>>19&127,i[a++]=127&(h>>>26|(1&u)<<6),i[a++]=u>>>1&127,i[a++]=u>>>8&127,i[a++]=u>>>15&127,i[a++]=u>>>22&127,i[a++]=127&(u>>>29|(15&c)<<3),i[a++]=c>>>4&127,i[a++]=c>>>11&127,i[a++]=c>>>18&127,i[a]=c>>>25&127}(e,t,i,r);case 8:return void function(e,t,i,r){let a=r,n=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,h=e[t+4]>>>0,u=e[t+5]>>>0,c=e[t+6]>>>0,p=e[t+7]>>>0;i[a++]=n>>>0&255,i[a++]=n>>>8&255,i[a++]=n>>>16&255,i[a++]=n>>>24&255,i[a++]=o>>>0&255,i[a++]=o>>>8&255,i[a++]=o>>>16&255,i[a++]=o>>>24&255,i[a++]=s>>>0&255,i[a++]=s>>>8&255,i[a++]=s>>>16&255,i[a++]=s>>>24&255,i[a++]=l>>>0&255,i[a++]=l>>>8&255,i[a++]=l>>>16&255,i[a++]=l>>>24&255,i[a++]=h>>>0&255,i[a++]=h>>>8&255,i[a++]=h>>>16&255,i[a++]=h>>>24&255,i[a++]=u>>>0&255,i[a++]=u>>>8&255,i[a++]=u>>>16&255,i[a++]=u>>>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}(e,t,i,r);case 9:return void function(e,t,i,r){let a=r,n=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,h=e[t+4]>>>0,u=e[t+5]>>>0,c=e[t+6]>>>0,p=e[t+7]>>>0,d=e[t+8]>>>0;i[a++]=n>>>0&511,i[a++]=n>>>9&511,i[a++]=n>>>18&511,i[a++]=511&(n>>>27|(15&o)<<5),i[a++]=o>>>4&511,i[a++]=o>>>13&511,i[a++]=o>>>22&511,i[a++]=511&(o>>>31|(255&s)<<1),i[a++]=s>>>8&511,i[a++]=s>>>17&511,i[a++]=511&(s>>>26|(7&l)<<6),i[a++]=l>>>3&511,i[a++]=l>>>12&511,i[a++]=l>>>21&511,i[a++]=511&(l>>>30|(127&h)<<2),i[a++]=h>>>7&511,i[a++]=h>>>16&511,i[a++]=511&(h>>>25|(3&u)<<7),i[a++]=u>>>2&511,i[a++]=u>>>11&511,i[a++]=u>>>20&511,i[a++]=511&(u>>>29|(63&c)<<3),i[a++]=c>>>6&511,i[a++]=c>>>15&511,i[a++]=511&(c>>>24|(1&p)<<8),i[a++]=p>>>1&511,i[a++]=p>>>10&511,i[a++]=p>>>19&511,i[a++]=511&(p>>>28|(31&d)<<4),i[a++]=d>>>5&511,i[a++]=d>>>14&511,i[a]=d>>>23&511}(e,t,i,r);case 10:return void function(e,t,i,r){let a=r,n=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,h=e[t+4]>>>0,u=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++]=n>>>0&1023,i[a++]=n>>>10&1023,i[a++]=n>>>20&1023,i[a++]=1023&(n>>>30|(255&o)<<2),i[a++]=o>>>8&1023,i[a++]=o>>>18&1023,i[a++]=1023&(o>>>28|(63&s)<<4),i[a++]=s>>>6&1023,i[a++]=s>>>16&1023,i[a++]=1023&(s>>>26|(15&l)<<6),i[a++]=l>>>4&1023,i[a++]=l>>>14&1023,i[a++]=1023&(l>>>24|(3&h)<<8),i[a++]=h>>>2&1023,i[a++]=h>>>12&1023,i[a++]=h>>>22&1023,i[a++]=u>>>0&1023,i[a++]=u>>>10&1023,i[a++]=u>>>20&1023,i[a++]=1023&(u>>>30|(255&c)<<2),i[a++]=c>>>8&1023,i[a++]=c>>>18&1023,i[a++]=1023&(c>>>28|(63&p)<<4),i[a++]=p>>>6&1023,i[a++]=p>>>16&1023,i[a++]=1023&(p>>>26|(15&d)<<6),i[a++]=d>>>4&1023,i[a++]=d>>>14&1023,i[a++]=1023&(d>>>24|(3&f)<<8),i[a++]=f>>>2&1023,i[a++]=f>>>12&1023,i[a]=f>>>22&1023}(e,t,i,r);case 11:return void function(e,t,i,r){let a=r,n=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,h=e[t+4]>>>0,u=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++]=n>>>0&2047,i[a++]=n>>>11&2047,i[a++]=2047&(n>>>22|(1&o)<<10),i[a++]=o>>>1&2047,i[a++]=o>>>12&2047,i[a++]=2047&(o>>>23|(3&s)<<9),i[a++]=s>>>2&2047,i[a++]=s>>>13&2047,i[a++]=2047&(s>>>24|(7&l)<<8),i[a++]=l>>>3&2047,i[a++]=l>>>14&2047,i[a++]=2047&(l>>>25|(15&h)<<7),i[a++]=h>>>4&2047,i[a++]=h>>>15&2047,i[a++]=2047&(h>>>26|(31&u)<<6),i[a++]=u>>>5&2047,i[a++]=u>>>16&2047,i[a++]=2047&(u>>>27|(63&c)<<5),i[a++]=c>>>6&2047,i[a++]=c>>>17&2047,i[a++]=2047&(c>>>28|(127&p)<<4),i[a++]=p>>>7&2047,i[a++]=p>>>18&2047,i[a++]=2047&(p>>>29|(255&d)<<3),i[a++]=d>>>8&2047,i[a++]=d>>>19&2047,i[a++]=2047&(d>>>30|(511&f)<<2),i[a++]=f>>>9&2047,i[a++]=f>>>20&2047,i[a++]=2047&(f>>>31|(1023&m)<<1),i[a++]=m>>>10&2047,i[a]=m>>>21&2047}(e,t,i,r);case 12:return void function(e,t,i,r){let a=r,n=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,h=e[t+4]>>>0,u=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,g=e[t+11]>>>0;i[a++]=n>>>0&4095,i[a++]=n>>>12&4095,i[a++]=4095&(n>>>24|(15&o)<<8),i[a++]=o>>>4&4095,i[a++]=o>>>16&4095,i[a++]=4095&(o>>>28|(255&s)<<4),i[a++]=s>>>8&4095,i[a++]=s>>>20&4095,i[a++]=l>>>0&4095,i[a++]=l>>>12&4095,i[a++]=4095&(l>>>24|(15&h)<<8),i[a++]=h>>>4&4095,i[a++]=h>>>16&4095,i[a++]=4095&(h>>>28|(255&u)<<4),i[a++]=u>>>8&4095,i[a++]=u>>>20&4095,i[a++]=c>>>0&4095,i[a++]=c>>>12&4095,i[a++]=4095&(c>>>24|(15&p)<<8),i[a++]=p>>>4&4095,i[a++]=p>>>16&4095,i[a++]=4095&(p>>>28|(255&d)<<4),i[a++]=d>>>8&4095,i[a++]=d>>>20&4095,i[a++]=f>>>0&4095,i[a++]=f>>>12&4095,i[a++]=4095&(f>>>24|(15&m)<<8),i[a++]=m>>>4&4095,i[a++]=m>>>16&4095,i[a++]=4095&(m>>>28|(255&g)<<4),i[a++]=g>>>8&4095,i[a]=g>>>20&4095}(e,t,i,r);case 16:return void function(e,t,i,r){let a=r,n=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,h=e[t+4]>>>0,u=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,g=e[t+11]>>>0,_=e[t+12]>>>0,y=e[t+13]>>>0,v=e[t+14]>>>0,x=e[t+15]>>>0;i[a++]=n>>>0&65535,i[a++]=n>>>16&65535,i[a++]=o>>>0&65535,i[a++]=o>>>16&65535,i[a++]=s>>>0&65535,i[a++]=s>>>16&65535,i[a++]=l>>>0&65535,i[a++]=l>>>16&65535,i[a++]=h>>>0&65535,i[a++]=h>>>16&65535,i[a++]=u>>>0&65535,i[a++]=u>>>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++]=g>>>0&65535,i[a++]=g>>>16&65535,i[a++]=_>>>0&65535,i[a++]=_>>>16&65535,i[a++]=y>>>0&65535,i[a++]=y>>>16&65535,i[a++]=v>>>0&65535,i[a++]=v>>>16&65535,i[a++]=x>>>0&65535,i[a]=x>>>16&65535}(e,t,i,r);case 32:for(let a=0;a<32;a=a+1|0)i[r+a|0]=0|e[t+a|0];return}let n=gd[a]>>>0,o=t,s=0,l=e[o]>>>0;for(let t=0;t<32;t++)if(s+a<=32){let h=l>>>s&n;i[r+t]=0|h,s+=a,32===s&&(s=0,o++,31!==t&&(l=e[o]>>>0))}else{let h=32-s,u=l>>>s;o++,l=e[o]>>>0;let c=(u|(l&gd[a-h]>>>0)<<h)&n;i[r+t]=0|c,s=a-h}}function Id(e,t,i){let r=new Uint32Array(i),a=0,n=t.get();for(let t=0;t<r.length;t++){let t=e[n++],i=127&t;t<128?r[a++]=i:(t=e[n++],i|=(127&t)<<7,t<128?r[a++]=i:(t=e[n++],i|=(127&t)<<14,t<128?r[a++]=i:(t=e[n++],i|=(127&t)<<21,t<128||(t=e[n++],i|=(15&t)<<28),r[a++]=i)))}return t.set(n),r}function Ad(e,t,i){let r=new BigUint64Array(i);for(let i=0;i<r.length;i++)r[i]=zd(e,t);return r}function zd(e,t){let i=0n,r=0,a=t.get();for(;a<e.length;){let t=e[a++];if(i|=BigInt(127&t)<<BigInt(r),!(128&t))break;if(r+=7,r>=64)throw Error("Varint too long")}return t.set(a),i}function kd(e,t){let i,r;return r=e[t.get()],t.increment(),i=127&r,r<128||(r=e[t.get()],t.increment(),i|=(127&r)<<7,r<128)||(r=e[t.get()],t.increment(),i|=(127&r)<<14,r<128)||(r=e[t.get()],t.increment(),i|=(127&r)<<21,r<128)?
2i:(r=e[t.get()],i|=(15&r)<<28,function(e,t,i){let r,a;if(a=t[i.get()],i.increment(),r=(112&a)>>4,a<128||(a=t[i.get()],i.increment(),r|=(127&a)<<3,a<128)||(a=t[i.get()],i.increment(),r|=(127&a)<<10,a<128)||(a=t[i.get()],i.increment(),r|=(127&a)<<17,a<128)||(a=t[i.get()],i.increment(),r|=(127&a)<<24,a<128)||(a=t[i.get()],i.increment(),r|=(1&a)<<31,a<128))return 4294967296*r+(e>>>0);throw Error("Expected varint not more than 10 bytes")}(i,e,t))}function Dd(e,t,i,r){return function(e,t,i,r,a){let n=r.get();if(3&i)throw Error(`FastPFOR: invalid encodedByteLength=${i} at offset=${n} (encodedBytes.length=${e.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let o=i>>>2,s=function(e,t){if(t<=e.encodedWords.length)return e.encodedWords;let i=new Uint32Array(Math.max(16,2*t));return e.encodedWords=i,i}(a,o);!function(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),n=i%4!=0,o=n?a+1:a;if(r.length<o)throw RangeError(`decodeBigEndianInt32sInto: out.length=${r.length} < ${o}`);if(a>0){let i=e.byteOffset+t;if(3&i)for(let i=0;i<a;i++){let a=t+4*i;r[i]=e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3]}else{let t=new Uint32Array(e.buffer,i,a);for(let e=0;e<a;e++)r[e]=0|vd(t[e])}}if(n){let n=t+4*a,o=i-4*a,s=0;for(let t=0;t<o;t++)s|=e[n+t]<<24-8*t;r[a]=0|s}}(e,n,i,s);let l=Cd(s.subarray(0,o),t,a.decoderWorkspace);return r.add(i),l}(e,t,i,r,function(e=16){if(e<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${e}`);let t=Math.max(16,0|e);return{encodedWords:new Uint32Array(t),decoderWorkspace:wd()}}(i>>>2))}function Rd(e){return e>>>1^-(1&e)}function Ld(e){return e>>1n^-(1n&e)}function Fd(e){return e%2==1?(e+1)/-2:e/2}function Bd(e,t,i){if(void 0===i){i=0;for(let r=0;r<t;r++)i+=e[r]}let r=new Uint32Array(i),a=0;for(let i=0;i<t;i++){let n=e[i],o=e[i+t];r.fill(o,a,a+n),a+=n}return r}function Od(e,t,i){if(void 0===i){i=0;for(let r=0;r<t;r++)i+=Number(e[r])}let r=new BigUint64Array(i),a=0;for(let i=0;i<t;i++){let n=Number(e[i]),o=e[i+t];r.fill(o,a,a+n),a+=n}return r}function Vd(e,t,i){let r=new Float64Array(i),a=0;for(let i=0;i<t;i++){let n=e[i],o=e[i+t];r.fill(o,a,a+n),a+=n}return r}function jd(e){let t=new Int32Array(e.length);t[0]=Rd(e[0]);let i=e.length/4*4,r=1;if(i>=4)for(;r<i-4;r+=4){let i=e[r],a=e[r+1],n=e[r+2],o=e[r+3];t[r]=Rd(i)+t[r-1],t[r+1]=Rd(a)+t[r],t[r+2]=Rd(n)+t[r+1],t[r+3]=Rd(o)+t[r+2]}for(;r!==e.length;++r)t[r]=Rd(e[r])+t[r-1];return t}function Nd(e){let t=new BigInt64Array(e.length);t[0]=Ld(e[0]);let i=e.length/4*4,r=1;if(i>=4)for(;r<i-4;r+=4){let i=e[r],a=e[r+1],n=e[r+2],o=e[r+3];t[r]=Ld(i)+t[r-1],t[r+1]=Ld(a)+t[r],t[r+2]=Ld(n)+t[r+1],t[r+3]=Ld(o)+t[r+2]}for(;r!==t.length;++r)t[r]=Ld(e[r])+t[r-1];return t}function qd(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 $d(e,t,i,r){if(e.length<2)return new Int32Array(e);let a=new Int32Array(e.length),n=Rd(e[0]),o=Rd(e[1]);a[0]=Ud(Math.round(n*t),i,r),a[1]=Ud(Math.round(o*t),i,r);let s=e.length/16,l=2;if(s>=4)for(;l<s-4;l+=4){let s=e[l],h=e[l+1],u=Rd(s)+n,c=Rd(h)+o;a[l]=Ud(Math.round(u*t),i,r),a[l+1]=Ud(Math.round(c*t),i,r);let p=e[l+2],d=e[l+3];n=Rd(p)+u,o=Rd(d)+c,a[l+2]=Ud(Math.round(n*t),i,r),a[l+3]=Ud(Math.round(o*t),i,r)}for(;l!==e.length;l+=2)n+=Rd(e[l]),o+=Rd(e[l+1]),a[l]=Ud(Math.round(n*t),i,r),a[l+1]=Ud(Math.round(o*t),i,r);return a}function Ud(e,t,i){return Math.min(i,Math.max(t,e))}function Gd(e){let t=new Uint32Array(e.length);t[0]=Rd(e[0])>>>0;for(let i=1;i<e.length;i++)t[i]=t[i-1]+Rd(e[i])>>>0;return t}function Zd(e){let t=new BigUint64Array(e.length);t[0]=BigInt.asUintN(64,Ld(e[0]));for(let i=1;i<e.length;i++)t[i]=BigInt.asUintN(64,t[i-1]+Ld(e[i]));return t}var Wd,Hd,Xd,Yd;!function(e){e.PRESENT="PRESENT",e.DATA="DATA",e.OFFSET="OFFSET",e.LENGTH="LENGTH"}(Wd||={}),function(e){e.NONE="NONE",e.SINGLE="SINGLE",e.SHARED="SHARED",e.VERTEX="VERTEX",e.MORTON="MORTON",e.FSST="FSST"}(Hd||={}),function(e){e.VERTEX="VERTEX",e.INDEX="INDEX",e.STRING="STRING",e.KEY="KEY"}(Xd||={}),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"}(Yd||={});const Kd=[Wd.PRESENT,Wd.DATA,Wd.OFFSET,Wd.LENGTH],Jd=[pd.NONE,pd.DELTA,pd.COMPONENTWISE_DELTA,pd.RLE,pd.MORTON,pd.PDE],Qd=[dd.NONE,dd.FAST_PFOR,dd.VARINT],ef=[Hd.NONE,Hd.SINGLE,Hd.SHARED,Hd.VERTEX,Hd.MORTON,Hd.FSST],tf=[Xd.VERTEX,Xd.INDEX,Xd.STRING,Xd.KEY],rf=[Yd.VAR_BINARY,Yd.GEOMETRIES,Yd.PARTS,Yd.RINGS,Yd.TRIANGLES,Yd.SYMBOL,Yd.DICTIONARY];function af(e,t){let i=function(e,t){let i=e[t.get()],r=Kd[i>>4],a={};switch(r){case Wd.DATA:a={dictionaryType:ef[15&i]};break;case Wd.OFFSET:a={offsetType:tf[15&i]};break;case Wd.LENGTH:a={lengthType:rf[15&i]}}t.increment();let n=e[t.get()],o=Jd[n>>5],s=Jd[n>>2&7],l=Qd[3&n];t.increment();
vendor: 8,688 bytes, line 2
2let h=Id(e,t,2),u=h[0],c=h[1];return{physicalStreamType:r,logicalStreamType:a,logicalLevelTechnique1:o,logicalLevelTechnique2:s,physicalLevelTechnique:l,numValues:u,byteLength:c,decompressedCount:u}}(e,t);return i.logicalLevelTechnique1===pd.MORTON?function(e,t,i){let r=Id(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]}}(i,e,t):pd.RLE!==i.logicalLevelTechnique1&&pd.RLE!==i.logicalLevelTechnique2||dd.NONE===i.physicalLevelTechnique?i:function(e,t,i){let r=Id(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]}}(i,e,t)}var nf;!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"}(nf||={});var of=class{constructor(e,t){this.values=e,this._size=t}get(e){let t=Math.floor(e/8),i=e%8;return 1==(this.values[t]>>i&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 sf(e,t,i){if(!t)return e;let r=t.size(),a=new(0,e.constructor)(r),n=0;for(let o=0;o<r;o++)a[o]=t.get(o)?e[n++]:i;return a}function lf(e,t,i,r,a){return function(e,t,i,r){let a;switch(t.logicalLevelTechnique1){case pd.DELTA:if(t.logicalLevelTechnique2===pd.RLE){let i=t;if(!r)return function(e,t,i){let r=new Int32Array(i),a=0,n=0;for(let i=0;i<t;i++){let o=e[i],s=Rd(e[i+t]);for(let e=0;e<o;e++)n+=s,r[a++]=n}return r}(e,i.runs,i.numRleValues);a=jd(e=Bd(e,i.runs,i.numRleValues))}else a=jd(e);break;case pd.RLE:a=function(e,t,i){if(void 0===i){i=0;for(let r=0;r<t;r++)i+=e[r]}let r=new Int32Array(i),a=0;for(let i=0;i<t;i++){let n=e[i],o=e[i+t];o=Rd(o),r.fill(o,a,a+n),a+=n}return r}(e,t.runs,t.numRleValues);break;case pd.MORTON:qd(e),a=new Int32Array(e);break;case pd.COMPONENTWISE_DELTA:if(i&&!r)return $d(e,i.scale,i.min,i.max);a=function(e){if(e.length<2)return new Int32Array(e);let t=new Int32Array(e.length);t[0]=Rd(e[0]),t[1]=Rd(e[1]);let i=e.length/4*4,r=2;if(i>=4)for(;r<i-4;r+=4){let i=e[r],a=e[r+1],n=e[r+2],o=e[r+3];t[r]=Rd(i)+t[r-2],t[r+1]=Rd(a)+t[r-1],t[r+2]=Rd(n)+t[r],t[r+3]=Rd(o)+t[r+1]}for(;r!==e.length;r+=2)t[r]=Rd(e[r])+t[r-2],t[r+1]=Rd(e[r+1])+t[r-1];return t}(e);break;case pd.NONE:a=function(e){let t=new Int32Array(e.length);for(let i=0;i<e.length;i++)t[i]=Rd(e[i]);return t}(e);break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return r?sf(a,r,0):a}(cf(e,t,i),i,r,a)}function hf(e,t,i,r,a){return function(e,t,i,r){let a;switch(t.logicalLevelTechnique1){case pd.DELTA:if(t.logicalLevelTechnique2===pd.RLE){let i=t;a=Gd(Bd(e,i.runs,i.numRleValues))}else a=Gd(e);break;case pd.RLE:a=Bd(e,t.runs,t.numRleValues);break;case pd.MORTON:qd(e),a=e;break;case pd.COMPONENTWISE_DELTA:a=i&&!r?function(e,t,i,r){let a=$d(e,t,i,r);return new Uint32Array(a)}(e,i.scale,i.min,i.max):function(e){if(e.length<2)return new Uint32Array(e);let t=new Uint32Array(e.length);t[0]=Rd(e[0])>>>0,t[1]=Rd(e[1])>>>0;for(let i=2;i<e.length;i+=2)t[i]=t[i-2]+Rd(e[i])>>>0,t[i+1]=t[i-1]+Rd(e[i+1])>>>0;return t}(e);break;case pd.NONE:a=e;break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return r?sf(a,r,0):a}(cf(e,t,i),i,r,a)}function uf(e,t,i){return function(e,t){if(t.logicalLevelTechnique1===pd.DELTA&&t.logicalLevelTechnique2===pd.NONE)return function(e){let t=new Int32Array(e.length+1);t[0]=0,t[1]=Rd(e[0]);let i=t[1];for(let r=2;r!==t.length;++r)i+=Rd(e[r-1]),t[r]=t[r-1]+i;return new Uint32Array(t)}(e);if(t.logicalLevelTechnique1===pd.RLE&&t.logicalLevelTechnique2===pd.NONE){let i=t;return function(e,t,i){let r=new Uint32Array(i+1);r[0]=0;let a=1,n=r[0];for(let i=0;i<t;i++){let o=e[i],s=e[i+t];for(let e=a;e<a+o;e++)r[e]=s+n,n=r[e];a+=o}return r}(e,i.runs,i.numRleValues)}if(t.logicalLevelTechnique1===pd.NONE&&t.logicalLevelTechnique2===pd.NONE){!function(e){let t=0;for(let i=0;i<e.length;i++)e[i]+=t,t=e[i]}(e);let i=new Uint32Array(t.numValues+1);return i[0]=0,i.set(e,1),i}if(t.logicalLevelTechnique1===pd.DELTA&&t.logicalLevelTechnique2===pd.RLE){let i=t,r=function(e,t,i){let r=new Int32Array(i+1);r[0]=0;let a=1,n=r[0];for(let i=0;i<t;i++){let o=e[i],s=e[i+t];s=Rd(s);for(let e=a;e<a+o;e++)r[e]=s+n,n=r[e];a+=o}return r}(e,i.runs,i.numRleValues);return qd(r),new Uint32Array(r)}throw Error("Only delta encoding is supported for transforming length to offset streams yet.")}(cf(e,t,i),i)}function cf(e,t,i){let r=i.physicalLevelTechnique;switch(r){case dd.FAST_PFOR:return Dd(e,i.numValues,i.byteLength,t);case dd.VARINT:return Id(e,t,i.numValues);case dd.NONE:{let r=t.get(),a=i.byteLength;t.add(a);let n=e.subarray(r,t.get());return new Uint32Array(n)}default:throw Error(`Specified physicalLevelTechnique ${r} is not supported (yet).`)}}function pf(e,t,i){let r=cf(e,t,i);return 1===r.length?Rd(r[0]):function(e){return Rd(e[1])}(r)}function df(e,t,i){let r=cf(e,t,i);return 1===r.length?i.logicalLevelTechnique1===pd.DELTA?Rd(r[0]):r[0]:function(e){return e[1]}(r)}function ff(e,t,i){return function(e){if(2===e.length){let t=Rd(e[1]);return[t,t]}return[Rd(e[2]),Rd(e[3])]}(cf(e,t,i))}function mf(e,t,i){return function(e){if(2===e.length){let t=Ld(e[1]);return[t,t]}return[Ld(e[2]),Ld(e[3])]}(Ad(e,t,i.numValues))}function gf(e,t,i,r){return function(e,t,i){let r;switch(t.logicalLevelTechnique1){case pd.DELTA:if(t.logicalLevelTechnique2===pd.RLE){let a=t;if(!i)return function(e,t,i){let r=new BigInt64Array(i),a=0,n=0n;for(let i=0;i<t;i++){let o=Number(e[i]),s=Ld(e[i+t]);for(let e=0;e<o;e++)n+=s,r[a++]=n}return r}(e,a.runs,a.numRleValues);r=Nd(e=Od(e,a.runs,a.numRleValues))}else r=Nd(e);break;case pd.RLE:r=function(e,t,i){if(void 0===i){i=0;for(let r=0;r<t;r++)i+=Number(e[r])}let r=new BigInt64Array(i),a=0;for(let i=0;i<t;i++){let n=Number(e[i]),o=e[i+t];o=Ld(o),r.fill(o,a,a+n),a+=n}return r}(e,t.runs,t.numRleValues);break;case pd.NONE:r=function(e){let t=new BigInt64Array(e.length);for(let i=0;i<e.length;i++)t[i]=Ld(e[i]);return t}(e);break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return i?sf(r,i,0n):r}(Ad(e,t,i.numValues),i,r)}function _f(e,t,i,r){return function(e,t,i){let r;switch(t.logicalLevelTechnique1){case pd.DELTA:if(t.logicalLevelTechnique2===pd.RLE){let i=t;r=Zd(Od(e,i.runs,i.numRleValues))}else r=Zd(e);break;case pd.RLE:r=Od(e,t.runs,t.numRleValues);break;case pd.NONE:r=e;break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return i?sf(r,i,0n):r}(Ad(e,t,i.numValues),i,r)}function yf(e,t,i){return function(e,t,i){switch(t.logicalLevelTechnique1){case pd.DELTA:if(t.logicalLevelTechnique2===pd.RLE){let i=t;e=Vd(e,i.runs,i.numRleValues)}return function(e){e[0]=Fd(e[0]);let t=e.length/4*4,i=1;if(t>=4)for(;i<t-4;i+=4){let t=e[i],r=e[i+1],a=e[i+2],n=e[i+3];e[i]=Fd(t)+e[i-1],e[i+1]=Fd(r)+e[i],e[i+2]=Fd(a)+e[i+1],e[i+3]=Fd(n)+e[i+2]}for(;i!==e.length;++i)e[i]=Fd(e[i])+e[i-1]}(e),e;case pd.RLE:return function(e,t,i){return i?function(e,t,i){let r=new Float64Array(i),a=0;for(let i=0;i<t;i++){let n=e[i],o=e[i+t];o=Fd(o),r.fill(o,a,a+n),a+=n}return r}(e,t.runs,t.numRleValues):Vd(e,t.runs,t.numRleValues)}(e,t,i);case pd.NONE:return i&&function(e){for(let t=0;t<e.length;t++)e[t]=Fd(e[t])}(e),e;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}}(function(e,t,i){let r=new Float64Array(i);for(let a=0;a<i;a++)r[a]=kd(e,t);return r}(e,t,i.numValues),i,!1)}function vf(e,t,i){let r=Ad(e,t,i.numValues);return 1===r.length?Ld(r[0]):function(e){return Ld(e[1])}(r)}function xf(e,t,i){let r=Ad(e,t,i.numValues);return 1===r.length?i.logicalLevelTechnique1===pd.DELTA?Ld(r[0]):r[0]:function(e){return e[1]}(r)}function bf(e,t,i,r,a="int32"){let n=e.logicalLevelTechnique1;if(n===pd.RLE)return 1===e.runs?nf.CONST:nf.FLAT;if(n!==pd.DELTA||e.logicalLevelTechnique2!==pd.RLE)return 1===e.numValues?nf.CONST:nf.FLAT;let o=t instanceof of?t.size():t,s=e;if(s.numRleValues!==o)return nf.FLAT;if(1===s.runs)return nf.SEQUENCE;
2if(2!==s.runs)return 1===e.numValues?nf.CONST:nf.FLAT;let l=r.get();if(e.physicalLevelTechnique===dd.VARINT)return function(e,t,i){let r=new fd(t.get());if("int64"===i){let t=Ad(e,r,4);return 2n===t[2]&&2n===t[3]}let a=Id(e,r,4);return 2===a[2]&&2===a[3]}(i,r,a)?nf.SEQUENCE:1===e.numValues?nf.CONST:nf.FLAT;let h=r.get(),u=new Int32Array(i.buffer,i.byteOffset+h,4);return r.set(l),2===u[2]&&2===u[3]?nf.SEQUENCE:1===e.numValues?nf.CONST:nf.FLAT}var wf,Tf,Sf,Pf=class extends Gp{getValueFromBuffer(e){return this.dataBuffer[e]}},Ef=class extends Hp{constructor(e,t,i,r){super(e,BigInt64Array.of(t),i,r)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}};function Cf(e,t,i){return{x:Mf(e,t)-i,y:Mf(e>>1,t)-i}}function Mf(e,t){let i=0;for(let r=0;r<t;r++)i|=(e&1<<2*r)>>r;return i}function If(e,t,i,r,a,n,o){return e===Sf.MORTON?function(e,t,i,r,a,n){let o=Array(a?r+1:r);for(let a=0;a<r;a++){let r=Cf(e[t[i+a]],n.numBits,n.coordinateShift);o[a]=new d(r.x,r.y)}return a&&(o[o.length-1]=o[0]),o}(t,i,r,a,n,o):function(e,t,i,r,a){let n=Array(a?r+1:r);for(let a=0;a<2*r;a+=2){let r=2*t[i+a/2],o=e[r],s=e[r+1];n[a/2]=new d(o,s)}return a&&(n[n.length-1]=n[0]),n}(t,i,r,a,n)}function Af(e,t,i,r){let a=Array(r?i+1:i);for(let r=0;r<2*i;r+=2){let i=e[t+r],n=e[t+r+1];a[r/2]=new d(i,n)}return r&&(a[a.length-1]=a[0]),a}!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"}(wf||={}),function(e){e[e.POINT=0]="POINT",e[e.LINESTRING=1]="LINESTRING",e[e.POLYGON=2]="POLYGON"}(Tf||={}),function(e){e[e.MORTON=0]="MORTON",e[e.VEC_2=1]="VEC_2",e[e.VEC_3=2]="VEC_3"}(Sf||={});var zf=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?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getVertex(e){if(this.vertexOffsets&&this.mortonSettings){let t=this.vertexOffsets[e],i=Cf(this.vertexBuffer[t],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[i.x,i.y]}let t=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getGeometries(){return function(e){let t=Array(e.numGeometries),i=1,r=1,a=1,n=0,o=0,s=0,l=e.mortonSettings,h=e.topologyVector,u=h.geometryOffsets,c=h.partOffsets,p=h.ringOffsets,f=e.vertexOffsets,m=!f||0===f.length,g=e.containsPolygonGeometry(),_=e.vertexBuffer;for(let h=0;h<e.numGeometries;h++){let y=e.geometryType(h);switch(y){case wf.POINT:{let h,g;if(m)h=_[o++],g=_[o++];else if(e.vertexBufferType===Sf.MORTON){let e=Cf(_[f[s++]],l.numBits,l.coordinateShift);h=e.x,g=e.y}else{let e=2*f[s++];h=_[e],g=_[e+1]}t[n++]=[[new d(h,g)]],u&&a++,c&&i++,p&&r++}break;case wf.MULTIPOINT:{let e=u[a]-u[a-1];a++;let l=Array(e);if(m)for(let t=0;t<e;t++){let e=_[o++],i=_[o++];l[t]=new d(e,i)}else for(let t=0;t<e;t++){let e=2*f[s++],i=_[e],r=_[e+1];l[t]=new d(i,r)}t[n++]=l.map((e=>[e])),i+=e,r+=e}break;case wf.LINESTRING:{let h,d;g?(h=p[r]-p[r-1],r++):h=c[i]-c[i-1],i++,m?(d=Af(_,o,h,!1),o+=2*h):(d=If(e.vertexBufferType,_,f,s,h,!1,l),s+=h),t[n++]=[d],u&&a++}break;case wf.POLYGON:{let h=c[i]-c[i-1];i++;let d,g=Array(h-1),y=p[r]-p[r-1];if(r++,m){d=Af(_,o,y,!0),o+=2*y;for(let e=0;e<g.length;e++)y=p[r]-p[r-1],r++,g[e]=Af(_,o,y,!0),o+=2*y}else{d=If(e.vertexBufferType,_,f,s,y,!0,l),s+=y;for(let t=0;t<g.length;t++)y=p[r]-p[r-1],r++,g[t]=If(e.vertexBufferType,_,f,s,y,!0,l),s+=y}t[n++]=[d].concat(g),u&&a++}break;case wf.MULTILINESTRING:{let h=u[a]-u[a-1];a++;let d=Array(h);for(let t=0;t<h;t++){let a;g?(a=p[r]-p[r-1],r++):a=c[i]-c[i-1],i++,m?(d[t]=Af(_,o,a,!1),o+=2*a):(d[t]=If(e.vertexBufferType,_,f,s,a,!1,l),s+=a)}t[n++]=d}break;case wf.MULTIPOLYGON:{let h=u[a]-u[a-1];a++;let d=Array(h);for(let t=0;t<h;t++){let a=c[i]-c[i-1];i++;let n,h=Array(a-1),u=p[r]-p[r-1];r++,m?(n=Af(_,o,u,!0),o+=2*u):(n=If(e.vertexBufferType,_,f,s,u,!0,l),s+=u);for(let t=0;t<h.length;t++){let i=p[r]-p[r-1];r++,m?(h[t]=Af(_,o,i,!0),o+=2*i):(h[t]=If(e.vertexBufferType,_,f,s,i,!0,l),s+=i)}d[t]=[n].concat(h)}t[n++]=d.flat()}break;default:throw Error(`The specified geometry type (${y}) is currently not supported.`)}}return t}(this)}get mortonSettings(){return this._mortonSettings}};var kf=class extends zf{constructor(e,t,i,r,a,n,o){super(i,r,a,n,o),this._numGeometries=e,this._geometryType=t}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===wf.POLYGON||this._geometryType===wf.MULTIPOLYGON}containsSingleGeometryType(){return!0}};var Df=class extends zf{constructor(e,t,i,r,a,n){super(e,i,r,a,n),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)===wf.POLYGON||this.geometryType(e)===wf.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}},Rf=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,n=0,o=1,s=1,l=1;for(let t=0;t<this.numGeometries;t++)switch(this.geometryType(t)){case wf.POLYGON:{let h=i[o]-i[o-1];o++;let u=[];for(let e=0;e<h;e++){let e=r[s]-r[s-1];s++;let t=[];for(let i=0;i<e;i++){let e=this._vertexBuffer[n++],i=this._vertexBuffer[n++];t.push(new d(e,i))}t.length>0&&t.push(t[0]),u.push(t)}e[t]=u,a&&l++}break;case wf.MULTIPOLYGON:{let h=a[l]-a[l-1];l++;let u=[];for(let e=0;e<h;e++){let e=i[o]-i[o-1];o++;for(let t=0;t<e;t++){let e=r[s]-r[s-1];s++;let t=[];for(let i=0;i<e;i++){let e=this._vertexBuffer[n++],i=this._vertexBuffer[n++];t.push(new d(e,i))}t.length>0&&t.push(t[0]),u.push(t)}}e[t]=u}}return e}[Symbol.iterator](){return null}};function Lf(e,t,i,r,a,n){return new Ff(e,t,i,r,a,n)}var Ff=class extends Rf{constructor(e,t,i,r,a,n){super(i,r,a,n),this._numGeometries=e,this._geometryType=t}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}};function Bf(e,t,i,r,a){return new Of(e,t,i,r,a)}var Of=class extends Rf{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}};function Vf(e,t,i,r,a){let n,o,s,l,h=af(e,i);
vendor: 6,885 bytes, line 2
2if(bf(h,r,e,i)===nf.CONST){let u,c,p,d,f=df(e,i,h);for(let r=0;r<t-1;r++){let t=af(e,i);switch(t.physicalStreamType){case Wd.LENGTH:switch(t.logicalStreamType.lengthType){case Yd.GEOMETRIES:u=uf(e,i,t);break;case Yd.PARTS:c=uf(e,i,t);break;case Yd.RINGS:p=uf(e,i,t);break;case Yd.TRIANGLES:d=uf(e,i,t)}break;case Wd.OFFSET:switch(t.logicalStreamType.offsetType){case Xd.VERTEX:n=hf(e,i,t);break;case Xd.INDEX:l=hf(e,i,t)}break;case Wd.DATA:if(Hd.VERTEX===t.logicalStreamType.dictionaryType)o=lf(e,i,t,a);else{let r=t;s={numBits:r.numBits,coordinateShift:r.coordinateShift},o=hf(e,i,t,a)}}}return l?void 0!==u||void 0!==c?Lf(r,f,d,l,o,{geometryOffsets:u,partOffsets:c,ringOffsets:p}):Lf(r,f,d,l,o):void 0===s?function(e,t,i,r,a){return new kf(e,t,Sf.VEC_2,i,r,a)}(r,f,{geometryOffsets:u,partOffsets:c,ringOffsets:p},n,o):function(e,t,i,r,a,n){return new kf(e,t,Sf.MORTON,i,r,a,n)}(r,f,{geometryOffsets:u,partOffsets:c,ringOffsets:p},n,o,s)}let u,c,p,d,f,m,g,_=hf(e,i,h);for(let r=0;r<t-1;r++){let t=af(e,i);switch(t.physicalStreamType){case Wd.LENGTH:switch(t.logicalStreamType.lengthType){case Yd.GEOMETRIES:u=hf(e,i,t);break;case Yd.PARTS:c=hf(e,i,t);break;case Yd.RINGS:p=hf(e,i,t);break;case Yd.TRIANGLES:d=uf(e,i,t)}break;case Wd.OFFSET:switch(t.logicalStreamType.offsetType){case Xd.VERTEX:n=hf(e,i,t);break;case Xd.INDEX:l=hf(e,i,t)}break;case Wd.DATA:if(Hd.VERTEX===t.logicalStreamType.dictionaryType)o=lf(e,i,t,a);else{let r=t;s={numBits:r.numBits,coordinateShift:r.coordinateShift},o=hf(e,i,t,a)}}}return u?(f=jf(_,u,2),c&&p?(m=Nf(_,f,c,!1),g=function(e,t,i,r){let a=new Uint32Array(i[i.length-1]+1),n=0;a[0]=n;let o=1,s=1,l=0;for(let h=0;h<e.length;h++){let u=e[h],c=t[h+1]-t[h];if(0!==u&&3!==u)for(let e=0;e<c;e++){let e=i[o]-i[o-1];o++;for(let t=0;t<e;t++)n=a[s++]=n+r[l++]}else for(let e=0;e<c;e++)a[s++]=++n,o++}return a}(_,f,m,p)):c&&(m=function(e,t,i){let r=new Uint32Array(t[t.length-1]+1),a=0;r[0]=a;let n=1,o=0;for(let s=0;s<e.length;s++){let l=e[s],h=t[s+1]-t[s];if(4===l||1===l)for(let e=0;e<h;e++)a=r[n++]=a+i[o++];else for(let e=0;e<h;e++)r[n++]=++a}return r}(_,f,c))):c&&p?(m=jf(_,c,1),g=Nf(_,m,p,!0)):c&&(m=jf(_,c,0)),l&&!m?Bf(_,d,l,o):l?Bf(_,d,l,o,{geometryOffsets:f,partOffsets:m,ringOffsets:g}):void 0===s?function(e,t,i,r){return new Df(Sf.VEC_2,e,t,i,r)}(_,{geometryOffsets:f,partOffsets:m,ringOffsets:g},n,o):function(e,t,i,r,a){return new Df(Sf.MORTON,e,t,i,r,a)}(_,{geometryOffsets:f,partOffsets:m,ringOffsets:g},n,o,s)}function jf(e,t,i){let r=new Uint32Array(e.length+1),a=0;r[0]=a;let n=0;for(let o=0;o<e.length;o++)a=r[o+1]=a+(e[o]>i?t[n++]:1);return r}function Nf(e,t,i,r){let a=new Uint32Array(t[t.length-1]+1),n=0;a[0]=n;let o=1,s=0;for(let l=0;l<e.length;l++){let h=e[l],u=t[l+1]-t[l];if(5===h||2===h||r&&(4===h||1===h))for(let e=0;e<u;e++)n=a[o++]=n+i[s++];else for(let e=0;e<u;e++)a[o++]=++n}return a}var qf=class extends Up{constructor(e,t,i){super(e,t.getBuffer(),i),this.dataVector=t}getValueFromBuffer(e){return this.dataVector.get(e)}},$f=class extends Gp{getValueFromBuffer(e){return this.dataBuffer[e]}},Uf=class extends Up{constructor(e,t,i,r){super(e,r?BigInt64Array.of(t):BigUint64Array.of(t),i)}getValueFromBuffer(e){return this.dataBuffer[0]}};function Gf(e,t,i){for(let r=0;r<e;r++){let e=af(t,i);i.add(e.byteLength)}}function Zf(e,t,i,r,a){let n=function(e,t,i,r){let a=new Uint8Array(t),n=0,o=r.get()+i;for(;n<t&&!(r.get()>=o);){let i=e[r.increment()];if(i<=127){let o=i+3,s=e[r.increment()],l=Math.min(n+o,t);a.fill(s,n,l),n=l}else{let o=256-i;for(let i=0;i<o&&n<t;i++)a[n++]=e[r.increment()]}}return r.set(o),a}(e,Math.ceil(t/8),i,r);return a?function(e,t,i){if(!i)return e;let r=i.size(),a=new of(e,t),n=new of(new Uint8Array(Math.ceil(r/8)),r),o=0;for(let e=0;e<r;e++){let t=!!i.get(e)&&a.get(o++);n.set(e,t)}return n.getBuffer()}(n,t,a):n}const Wf=new TextDecoder;function Hf(e,t,i){return i-t>=12?Wf.decode(e.subarray(t,i)):function(e,t,i){let r="",a=t;for(;a<i;){let t,n,o,s=e[a],l=null,h=s>239?4:s>223?3:s>191?2:1;if(a+h>i)break;1===h?s<128&&(l=s):2===h?(t=e[a+1],128==(192&t)&&(l=(31&s)<<6|63&t,l<=127&&(l=null))):3===h?(t=e[a+1],n=e[a+2],128==(192&t)&&128==(192&n)&&(l=(15&s)<<12|(63&t)<<6|63&n,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===h&&(t=e[a+1],n=e[a+2],o=e[a+3],128==(192&t)&&128==(192&n)&&128==(192&o)&&(l=(15&s)<<18|(63&t)<<12|(63&n)<<6|63&o,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,h=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),a+=h}return r}(e,t,i)}var Xf=class extends Up{constructor(e,t,i,r){super(e,i,r),this.offsetBuffer=t}},Yf=class extends Xf{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 Hf(this.dataBuffer,t,i)}},Kf=class extends Xf{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 Hf(this.dataBuffer,i,r)}};var Jf=class extends Xf{constructor(e,t,i,r,a,n,o){super(e,i,r,o??t.length),this.indexBuffer=t,this.symbolOffsetBuffer=a,this.symbolTableBuffer=n}getValueFromBuffer(e){this.decodedDictionary??=(this.symbolLengthBuffer??=this.offsetToLengthBuffer(this.symbolOffsetBuffer),function(e,t,i){let r=[],a=Array(t.length).fill(0);for(let e=1;e<t.length;e++)a[e]=a[e-1]+t[e-1];for(let n=0;n<i.length;n++)if(255===i[n])r.push(i[++n]);else{let o=t[i[n]],s=a[i[n]];for(let t=0;t<o;t++)r.push(e[s+t])}return new Uint8Array(r)}(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));let t=this.indexBuffer[e],i=this.offsetBuffer[t],r=this.offsetBuffer[t+1];return Hf(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 Qf(e,t,i,r,a){let n=null,o=null,s=null,l=null,h=null,u=a??null,c=null,p=null;for(let e=0;e<r;e++){let e=af(t,i);switch(e.physicalStreamType){case Wd.PRESENT:{let r=new of(Zf(t,e.numValues,e.byteLength,i),e.numValues);u=a??r;break}case Wd.OFFSET:o=hf(t,i,e,void 0,u);break;case Wd.LENGTH:{let r=uf(t,i,e);Yd.DICTIONARY===e.logicalStreamType.lengthType?n=r:Yd.SYMBOL===e.logicalStreamType.lengthType?l=r:c=r;break}case Wd.DATA:{let r=t.subarray(i.get(),i.get()+e.byteLength);i.add(e.byteLength);let a=e.logicalStreamType.dictionaryType;Hd.FSST===a?h=r:Hd.SINGLE===a||Hd.SHARED===a?s=r:Hd.NONE===a&&(p=r);break}}}return function(e,t,i,r,a,n,o){return t?new Jf(e,i,r,a,n,t,o):null}(e,h,o,n,s,l,u)??function(e,t,i,r,a){return t?a?new Kf(e,i,r,t,a):new Kf(e,i,r,t):null}(e,s,o,n,u)??function(e,t,i,r,a){if(!t||!i)return null;if(r)return a?new Kf(e,r,t,i,a):new Kf(e,r,t,i);if(a&&a.size()!==t.length-1){let r=new Uint32Array(a.size()),n=0;for(let e=0;e<a.size();e++)a.get(e)?r[e]=n++:r[e]=0;return new Kf(e,r,t,i,a)}return a?new Yf(e,t,i,a):new Yf(e,t,i)}(e,c,p,o,u)}
2function em(e,t,i,r,a,n){return"scalarType"===i.type?n&&!n.has(i.name)?(Gf(r,e,t),null):function(e,t,i,r,a,n){let o=null;if(0===e)return null;if(n.nullable){let e=af(t,i),r=e.numValues,a=i.get(),n=Zf(t,r,e.byteLength,i);i.set(a+e.byteLength),o=new of(n,e.numValues)}let s=o??r;switch(a.physicalType){case rd:case id:return function(e,t,i,r,a){let n=af(e,t),o=bf(n,a,e,t),s=r.physicalType===id;if(o===nf.FLAT){let r=tm(a)?a:void 0,o=s?lf(e,t,n,void 0,r):hf(e,t,n,void 0,r);return new Zp(i.name,o,a)}if(o===nf.SEQUENCE){let r=ff(e,t,n);return new Xp(i.name,r[0],r[1],n.numRleValues)}let l=s?pf(e,t,n):df(e,t,n);return new Yp(i.name,l,a,s)}(t,i,n,a,s);case ld:{let r=n.nullable?e-1:e;return Qf(n.name,t,i,r,o)}case Qp:return function(e,t,i,r,a){let n=af(e,t),o=n.numValues,s=t.get(),l=tm(a)?a:void 0,h=Zf(e,o,n.byteLength,t,l);t.set(s+n.byteLength);let u=new of(h,o);return new qf(i.name,u,a)}(t,i,n,0,s);case nd:case ad:return function(e,t,i,r,a){let n=af(e,t),o=bf(n,r,e,t,"int64"),s=a.physicalType===ad;if(o===nf.FLAT){let a=tm(r)?r:void 0,o=s?gf(e,t,n,a):_f(e,t,n,a);return new Pf(i.name,o,r)}if(o===nf.SEQUENCE){let r=mf(e,t,n);return new Ef(i.name,r[0],r[1],n.numRleValues)}let l=s?vf(e,t,n):xf(e,t,n);return new Uf(i.name,l,r,s)}(t,i,n,s,a);case od:return function(e,t,i,r){let a=af(e,t),n=tm(r)?r:void 0,o=function(e,t,i,r){let a=t.get(),n=a+i*Float32Array.BYTES_PER_ELEMENT,o=new Uint8Array(e.subarray(a,n)).buffer,s=new Float32Array(o);return t.set(n),r?sf(s,r,0):s}(e,t,a.numValues,n);return new $f(i.name,o,r)}(t,i,n,s);case sd:return function(e,t,i,r){let a=af(e,t),n=tm(r)?r:void 0,o=function(e,t,i,r){let a=t.get(),n=a+i*Float64Array.BYTES_PER_ELEMENT,o=new Uint8Array(e.subarray(a,n)).buffer,s=new Float64Array(o);return t.set(n),r?sf(s,r,0):s}(e,t,a.numValues,n);return new Wp(i.name,o,r)}(t,i,n,s);default:throw Error(`The specified data type for the field is currently not supported: ${a}`)}}(r,e,t,a,i.scalarType,i):0===r?null:function(e,t,i,r){let a=null,n=null,o=null,s=null,l=!1;for(;!l;){let i=af(e,t);switch(i.physicalStreamType){case Wd.LENGTH:Yd.DICTIONARY===i.logicalStreamType.lengthType?a=uf(e,t,i):o=uf(e,t,i);break;case Wd.DATA:Hd.SINGLE===i.logicalStreamType.dictionaryType||Hd.SHARED===i.logicalStreamType.dictionaryType?(n=e.subarray(t.get(),t.get()+i.byteLength),l=!0):s=e.subarray(t.get(),t.get()+i.byteLength),t.add(i.byteLength)}}let h=i.complexType.children,u=[],c=0;for(let l of h){let h=Id(e,t,1)[0];if(0===h)continue;let p,d=l.name?`${i.name}${l.name}`:i.name;if(r&&!r.has(d)){Gf(h,e,t);continue}if("scalarField"!==l.type||l.scalarField.physicalType!==ld)throw Error("Currently only scalar string fields are implemented for a struct.");if(h>1&&!l.nullable||1===h&&l.nullable)throw Error(`The number of streams for the child field ${l.name} does not match its nullability. nullibilty: ${l.nullable}, numStreams: ${h}`);if(l.nullable){let i=af(e,t);p=new of(Zf(e,i.numValues,i.byteLength,t),i.numValues)}let f=hf(e,t,af(e,t),void 0,p);u[c++]=s?new Jf(d,f,a,n,o,s,p):new Kf(d,f,a,n,p)}return u}(e,t,i,n)}function tm(e){return e instanceof of}function im(e){switch(e){case 0:case 1:case 2:case 3:{let t={};t.nullable=!!(1&e),t.columnScope=Jp;let i={type:"logicalType"};return i.logicalType=cd,i.longID=!!(2&e),t.scalarType=i,t.type="scalarType",t}case 4:{let e={nullable:!1};e.columnScope=Jp;let t={type:"physicalType"};return t.physicalType=hd,e.type="complexType",e.complexType=t,e}case 30:{let e={nullable:!1};e.columnScope=Jp;let t={type:"physicalType"};return t.physicalType=ud,e.type="complexType",e.complexType=t,e}default:return function(e){let t;switch(e){case 10:case 11:t=Qp;break;case 12:case 13:t=ed;break;case 14:case 15:t=td;break;case 16:case 17:t=id;break;case 18:case 19:t=rd;break;case 20:case 21:t=ad;break;case 22:case 23:t=nd;break;case 24:case 25:t=od;break;case 26:case 27:t=sd;break;case 28:case 29:t=ld;break;default:return null}let i={};i.nullable=!!(1&e),i.columnScope=Jp;let r={};return r.type="physicalType",r.physicalType=t,i.type="scalarType",i.scalarType=r,i}(e)}}function rm(e){return e>=10}function am(e){return 30===e}function nm(e){if("scalarType"===e.type){let t=e.scalarType;if("physicalType"===t.type)switch(t.physicalType){case Qp:case ed:case td:case id:case rd:case ad:case nd:case od:case sd:return!1;case ld:return!0;default:return!1}if("logicalType"===t.type)return!1}else if("complexType"===e.type){let t=e.complexType;if("physicalType"===t.type)switch(t.physicalType){case hd:case ud:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",e),!1}function om(e){return"scalarType"===e.type&&"logicalType"===e.scalarType?.type&&e.scalarType.logicalType===cd}function sm(e){return"complexType"===e.type&&"physicalType"===e.complexType?.type&&e.complexType.physicalType===hd}const lm=new TextDecoder;function hm(e,t){let i=Id(e,t,1)[0];if(0===i)return"";let r=t.get(),a=r+i,n=e.subarray(r,a);return t.add(i),lm.decode(n)}function um(e,t){let i=Id(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=im(i);if(rm(i)&&(r.name=hm(e,t)),am(i)){let i=Id(e,t,1)[0]>>>0;r.complexType.children=Array(i);for(let a=0;a<i;a++)r.complexType.children[a]=um(e,t)}return function(e){return{name:e.name,nullable:e.nullable,scalarField:e.scalarType,complexField:e.complexType,type:"scalarType"===e.type?"scalarField":"complexField"}}(r)}function cm(e,t){let i=Id(e,t,1)[0]>>>0,r=im(i);if(!r)throw Error(`Unsupported column type code ${i}. Supported: 0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT)`);if(rm(i)?r.name=hm(e,t):i>=0&&i<=3?r.name="id":4===i&&(r.name="geometry"),am(i)){let i=Id(e,t,1)[0]>>>0,a=r.complexType;a.children=Array(i);for(let r=0;r<i;r++)a.children[r]=um(e,t)}return r}function pm(e,t){let i={featureTables:[]},r={};if(r.name=hm(e,t),0===r.name.length)throw Error("Missing layer name");let a=Id(e,t,1)[0]>>>0,n=Id(e,t,1)[0]>>>0;r.columns=Array(n);for(let i=0;i<n;i++)r.columns[i]=cm(e,t);return i.featureTables.push(r),[i,a]}function dm(e,t,i,r,a,n,o=!1){let s=t.scalarType;if("logicalType"!==s?.type||s.logicalType!==cd)throw Error(`ID column must be a logical ID scalar type: ${r}`);let l=s.longID?nd:rd,h="number"==typeof n?void 0:n,u=bf(a,n,e,i,l===nd?"int64":"int32");if(l===rd)switch(u){case nf.FLAT:return new Zp(r,hf(e,i,a,void 0,h),n);case nf.SEQUENCE:{let t=ff(e,i,a);return new Xp(r,t[0],t[1],a.numRleValues)}case nf.CONST:return new Yp(r,df(e,i,a),n,!1)}switch(u){case nf.FLAT:return o?new Wp(r,yf(e,i,a),n):new Pf(r,_f(e,i,a,h),n);case nf.SEQUENCE:{let t=mf(e,i,a);return new Ef(r,t[0],t[1],a.numRleValues)}case nf.CONST:return new Uf(r,xf(e,i,a),n,!1)}throw Error("Vector type not supported for id column.")}var fm=class{constructor(e,t){switch(this._featureData=e,this.properties=this._featureData.properties||{},this._featureData.geometry?.type){case wf.POINT:case wf.MULTIPOINT:this.type=1;break;case wf.LINESTRING:case wf.MULTILINESTRING:this.type=2;break;case wf.POLYGON:case wf.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 e of t)i.push(new d(e.x,e.y));e.push(i)}return e}},mm=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 fm(this.features[e],this.extent)}},gm=class{constructor(e){this.layers={};let t=function(e,t,i=!0){let r=new fd(0),a=[];for(;r.get()<e.length;){let n=Id(e,r,1)[0]>>>0,o=r.get()+n;if(o>e.length)throw Error(`Block overruns tile: ${o} > ${e.length}`);if(Id(e,r,1)[0]>>>0!=1){r.set(o);continue}let[s,l]=pm(e,r),h=s.featureTables[0],u=null,c=null,p=[],d=0;for(let a of h.columns){let n=a.name;if(om(a)){let t=null;if(a.nullable){let i=af(e,r),a=r.get(),n=Zf(e,i.numValues,i.byteLength,r);r.set(a+i.byteLength),t=new of(n,i.numValues)}let o=af(e,r);d=t?t.size():o.decompressedCount,u=dm(e,a,r,n,o,t??d,i)}else if(sm(a)){let i=Id(e,r,1)[0];if(0===d){let t=r.get();d=af(e,r).decompressedCount,r.set(t)}t&&(t.scale=t.extent/l),c=Vf(e,i,r,d,t)}else{let t=nm(a)?Id(e,r,1)[0]:1;if(0===t)continue;let i=em(e,r,a,t,d,void 0);if(i)if(Array.isArray(i))for(let e of i)p.push(e);else p.push(i)}}let f=new Kp(h.name,c,u,p,l);a.push(f),r.set(o)}return a}(new Uint8Array(e));this.layers=t.reduce(((e,t)=>({...e,[t.name]:new mm(t)})),{})}};function _m(e,t,i,r,a){return Le(e,((e,n)=>{let o=t instanceof Vo?t.get(n):null;return o?.evaluate?o.evaluate(i,r,a):o}))}function ym(e,t){return t-e}fo("FeatureIndex",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 co(ne,16,0),this.grid3D=new co(ne,16,0),this.featureIndexArray=new Ns,this.promoteId=t}insert(e,t,i,r,a,n){let o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,r,a);let s=n?this.grid3D:this.grid;for(let e of t){let t=[1/0,1/0,-1/0,-1/0];for(let i of e)t[0]=Math.min(t[0],i.x),t[1]=Math.min(t[1],i.y),t[2]=Math.max(t[2],i.x),t[3]=Math.max(t[3],i.y);t[0]<8192&&t[1]<8192&&t[2]>=0&&t[3]>=0&&s.insert(o,t[0],t[1],t[2],t[3])}}loadVTLayers(){if(!this.vtLayers){if("mlt"===this.encoding)this.vtLayers=new gm(this.rawTileData).layers;else this.vtLayers=new rc(new Nc(this.rawTileData)).layers;this.sourceLayerCoder=new qp(this.vtLayers?Object.keys(this.vtLayers).sort():[Np])}return this.vtLayers}query(e,t,i,r){this.loadVTLayers();let a=e.params,n=ne/e.tileSize/e.scale,o=gn(a.filter,"queryRenderedFeatures filter",a.globalState),s=e.queryGeometry,l=e.queryPadding*n,h=jp.fromPoints(s),u=this.grid.query(h.minX-l,h.minY-l,h.maxX+l,h.maxY+l),c=jp.fromPoints(e.cameraQueryGeometry).expandBy(l),p=this.grid3D.query(c.minX,c.minY,c.maxX,c.maxY,((t,i,r,a)=>function(e,t,i,r,a){for(let n of e)if(t<=n.x&&i<=n.y&&r>=n.x&&a>=n.y)return!0;let n=[new d(t,i),new d(t,a),new d(r,a),new d(r,i)];if(e.length>2)for(let t of n)if(oh(e,t))return!0;for(let t=0;t<e.length-1;t++)if(sh(e[t],e[t+1],n))return!0;return!1}(e.cameraQueryGeometry,t-l,i-l,r+l,a+l)));for(let e of p)u.push(e);u.sort(ym);let f,m={};for(let l of u){if(l===f)continue;f=l;let h=this.featureIndexArray.get(l),u=null;
vendor: 14,257 bytes, line 2
2this.loadMatchingFeature(m,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,o,a.layers,a.availableImages,t,i,r,((t,i,r)=>(u||=Zl(t),i.queryIntersectsFeature({queryGeometry:s,feature:t,featureState:r,geometry:u,zoom:this.z,transform:e.transform,pixelsToTileUnits:n,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation}))))}return m}loadMatchingFeature(e,t,i,r,a,n,o,s,l,h,u){let c=this.bucketLayerIDs[t];if(n&&!c.some((e=>n.has(e))))return;let p=this.sourceLayerCoder.decode(i),d=this.vtLayers[p].feature(r);if(a.needGeometry){let e=Wl(d,!0);if(!a.filter(new Io(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!a.filter(new Io(this.tileID.overscaledZ),d))return;let f=this.getId(d,p);for(let t of c){if(n&&!n.has(t))continue;let i=s[t];if(!i)continue;let a={};f&&h&&(a=h.getState(i.sourceLayer||"_geojsonTileLayer",f));let c=Me({},l[t]);c.paint=_m(c.paint,i.paint,d,a,o),c.layout=_m(c.layout,i.layout,d,a,o);let p=!u||u(d,i,a);if(!p)continue;let m=new $p(d,this.z,this.x,this.y,f);m.layer=c;let g=e[t];void 0===g&&(g=e[t]=[]),g.push({featureIndex:r,feature:m,intersectionZ:p})}}lookupSymbolFeatures(e,t,i,r,a,n,o,s){let l={};this.loadVTLayers();let h=gn(a.filterSpec,"queryRenderedFeatures symbol filter",a.globalState);for(let a of e)this.loadMatchingFeature(l,i,r,a,h,n,o,s,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="string"==typeof this.promoteId?this.promoteId:this.promoteId[t];i=e.properties[r],"boolean"==typeof i&&(i=Number(i)),void 0===i&&e.properties?.cluster&&this.promoteId&&(i=Number(e.properties.cluster_id))}return i}},{omit:["rawTileData","sourceLayerCoder"]});var vm=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;void 0===this.data[r]&&(this.data[r]=[]);let a={value:t,timeout:void 0};if(void 0!==i&&(a.timeout=setTimeout((()=>{this.remove(e,a)}),i)),this.data[r].push(a),this.order.push(r),this.order.length>this.max){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}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),0===this.data[e].length&&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=void 0===t?0:this.data[i].indexOf(t),a=this.data[i][r];return this.data[i].splice(r,1),a.timeout&&clearTimeout(a.timeout),0===this.data[i].length&&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 e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}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 e of t)this.remove(e.value.tileID,e)}};function xm(e,t,i,r,a){let n=[];for(let o of e){let e;for(let s=0;s<o.length-1;s++){let l=o[s],h=o[s+1];l.x<t&&h.x<t||(l.x<t?l=new d(t,l.y+(h.y-l.y)*((t-l.x)/(h.x-l.x)))._round():h.x<t&&(h=new d(t,l.y+(h.y-l.y)*((t-l.x)/(h.x-l.x)))._round()),!(l.y<i&&h.y<i)&&(l.y<i?l=new d(l.x+(h.x-l.x)*((i-l.y)/(h.y-l.y)),i)._round():h.y<i&&(h=new d(l.x+(h.x-l.x)*((i-l.y)/(h.y-l.y)),i)._round()),!(l.x>=r&&h.x>=r)&&(l.x>=r?l=new d(r,l.y+(h.y-l.y)*((r-l.x)/(h.x-l.x)))._round():h.x>=r&&(h=new d(r,l.y+(h.y-l.y)*((r-l.x)/(h.x-l.x)))._round()),!(l.y>=a&&h.y>=a)&&(l.y>=a?l=new d(l.x+(h.x-l.x)*((a-l.y)/(h.y-l.y)),a)._round():h.y>=a&&(h=new d(l.x+(h.x-l.x)*((a-l.y)/(h.y-l.y)),a)._round()),(!e||!l.equals(e[e.length-1]))&&(e=[l],n.push(e)),e.push(h)))))}}return n}var bm=class e extends d{constructor(e,t,i,r){super(e,t),this.angle=i,void 0!==r&&(this.segment=r)}clone(){return new e(this.x,this.y,this.angle,this.segment)}};fo("Anchor",bm);let wm=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 Tm(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 Sm="6.1.0";function Pm(){var e=new y(4);return y!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}let Em,Cm,Mm;const Im={frame(e,t,i,r){let a=r||window,n=a.requestAnimationFrame((e=>{o(),t(e)})),{unsubscribe:o}=We(e.signal,"abort",(()=>{o(),a.cancelAnimationFrame(n),i(new ot(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 Em||=document.createElement("a"),Em.href=e,Em.href},get hardwareConcurrency(){return typeof navigator<"u"&&navigator.hardwareConcurrency||4},get prefersReducedMotion(){return void 0===Mm?!!matchMedia&&(Cm??=matchMedia("(prefers-reduced-motion: reduce)"),Cm.matches):Mm},set prefersReducedMotion(e){Mm=e}},Am=new class{constructor(){this._frozenAt=null}getCurrentTime(){return null===this._frozenAt?performance.now():this._frozenAt}setNow(e){this._frozenAt=e}restoreNow(){this._frozenAt=null}isFrozen(){return null!==this._frozenAt}};function zm(){return Am.getCurrentTime()}var km=class e{static{this.docStyle=typeof window<"u"&&window.document?.documentElement.style}static{this.selectProp=!e.docStyle||"userSelect"in e.docStyle?"userSelect":"webkitUserSelect"}static create(e,t,i){let r=window.document.createElement(e);return void 0!==t&&(r.className=t),i&&i.appendChild(r),r}static createNS(e,t){return window.document.createElementNS(e,t)}static disableDrag(){e.docStyle&&e.selectProp&&(e.userSelect=e.docStyle[e.selectProp],e.docStyle[e.selectProp]="none")}static enableDrag(){e.docStyle&&e.selectProp&&(e.docStyle[e.selectProp]=e.userSelect)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",e.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",e.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",e.suppressClickInternal,!0)}),0)}static getScale(e){let t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}static getPoint(e,t,i){let r=t.boundingClientRect;return new d((i.clientX-r.left)/t.x-e.clientLeft,(i.clientY-r.top)/t.y-e.clientTop)}static mousePos(t,i){let r=e.getScale(t);return e.getPoint(t,r,i)}static touchPos(t,i){let r=[],a=e.getScale(t);for(let n of i)r.push(e.getPoint(t,a,n));return r}static sanitize(t){let i=(new DOMParser).parseFromString(t,"text/html").body||document.createElement("body"),r=i.querySelectorAll("script");for(let e of r)e.remove();return e.clean(i),i.innerHTML}static isPossiblyDangerous(e,t){let i=t.replace(/\s+/g,"").toLowerCase();if(["src","href","xlink:href"].includes(e)&&(i.includes("javascript:")||i.includes("data:"))||e.startsWith("on"))return!0}static clean(t){let i=t.children;for(let t of i)e.removeAttributes(t),e.clean(t)}static removeAttributes(t){for(let{name:i,value:r}of t.attributes)e.isPossiblyDangerous(i,r)&&t.removeAttribute(i)}};let Dm;(function(e){let t,i,r,a;e.resetRequestQueue=()=>{t=[],i=0,r=0,a={}},e.addThrottleControl=e=>{let t=r++;return a[t]=e,t},e.removeThrottleControl=e=>{delete a[e],s()};e.getImage=(e,i,r=!0,a)=>new Promise(((n,o)=>{e.headers||={},e.headers.accept="image/webp,*/*",Me(e,{type:"image"});let l={abortController:i,requestParameters:e,supportImageRefresh:r,imageBitmapOptions:a,state:"queued",onError:e=>{o(e)},onSuccess:e=>{n(e)}};t.push(l),s()}));let n=(e,t)=>"function"==typeof createImageBitmap?(async(e,t)=>{if(0===e.byteLength)return createImageBitmap(new ImageData(1,1),t);let i=new Blob([new Uint8Array(e)],{type:"image/png"});try{return createImageBitmap(i,t)}catch(e){throw Error(`Could not load image because of ${se(e).message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})(e,t):(e=>new Promise(((t,i)=>{let r=new Image;r.onload=()=>{t(r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame((()=>r.src=Ge))},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):Ge})))(e),o=async e=>{e.state="running";let{requestParameters:t,supportImageRefresh:r,imageBitmapOptions:a,onError:o,onSuccess:h,abortController:u}=e,c=!1===r&&!a&&!qe(self)&&!ut(t.url)&&(!t.headers||Object.keys(t.headers).reduce(((e,t)=>e&&"accept"===t),!0));i++;let p=c?l(t,u):ft(t,u);try{let t=await p;delete e.abortController,e.state="completed",t.data instanceof HTMLImageElement||Ue(t.data)?h(t):t.data&&h({data:await n(t.data,a),cacheControl:t.cacheControl,expires:t.expires})}catch(t){delete e.abortController,o(se(t))}finally{i--,s()}},s=()=>{let e=(()=>{for(let e of Object.keys(a))if(a[e]())return!0;return!1})()?ht.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:ht.MAX_PARALLEL_IMAGE_REQUESTS;for(let r=i;r<e&&t.length>0;r++){let e=t.shift();e.abortController.signal.aborted?r--:o(e)}},l=(e,t)=>new Promise(((i,r)=>{let a=new Image,n=e.url,o=e.credentials;o&&"include"===o?a.crossOrigin="use-credentials":(o&&"same-origin"===o||!gt(n))&&(a.crossOrigin="anonymous"),t.signal.addEventListener("abort",(()=>{a.src="",r(new ot(t.signal.reason))})),a.fetchPriority="high",a.onload=()=>{a.onerror=a.onload=null,i({data:a})},a.onerror=()=>{a.onerror=a.onload=null,!t.signal.aborted&&r(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."))},a.src=n}))})(Dm||={}),Dm.resetRequestQueue();var Rm=class{constructor(e){this._transformRequestFn=e??null}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}},Lm=class extends vt{},Fm=class extends Lm{},Bm=class extends Lm{constructor(e={}){super("style.load",e)}},Om=class extends Lm{constructor(e,t={}){super(e,t),this.dataType="style"}},Vm=class extends Lm{constructor(e,t={}){super(e,t),this.dataType="source"}},jm=class extends Lm{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=km.mousePos(t.getCanvas(),i);super(e,Me({point:a,lngLat:t.unproject(a),originalEvent:i},r)),this._defaultPrevented=!1,this.target=t}},Nm=class extends Lm{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,i){let r="touchend"===e?i.changedTouches:i.touches,a=km.touchPos(t.getCanvasContainer(),r),n=a.map((e=>t.unproject(e))),o=a.reduce(((e,t,i,r)=>e.add(t.div(r.length))),new d(0,0));super(e,{points:a,point:o,lngLats:n,lngLat:t.unproject(o),originalEvent:i}),this._defaultPrevented=!1}},qm=class extends Lm{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t){super("wheel",{originalEvent:t}),this._defaultPrevented=!1}},$m=class extends Lm{},Um=class extends Lm{constructor(e={}){super("terrain",e)}},Gm=class extends Lm{constructor(e={}){super("projectiontransition",e)}},Zm=class extends Lm{},Wm=class extends Lm{constructor(e={}){super("styleimagemissing",e)}};function Hm(e){let t=[];if("string"==typeof e)t.push({id:"default",url:e});else if(e&&e.length>0){let i=[];for(let{id:r,url:a}of e){let e=`${r}${a}`;i.includes(e)||(i.push(e),t.push({id:r,url:a}))}}return t}function Xm(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 Ym(e,t,i,r){let a=Hm(e),n=i>1?"@2x":"",o={},s={};for(let{id:e,url:i}of a){o[e]=mt(await t.transformRequest(Xm(i,n,".json"),"SpriteJSON"),r);let a=await t.transformRequest(Xm(i,n,".png"),"SpriteImage");s[e]=Dm.getImage(a,r)}return await Promise.all([...Object.values(o),...Object.values(s)]),async function(e,t){let i={};for(let r in e){i[r]={};let a=Im.getImageCanvasContext((await t[r]).data),n=(await e[r]).data;for(let e in n){let{width:t,height:o,x:s,y:l,sdf:h,pixelRatio:u,stretchX:c,stretchY:p,content:d,textFitWidth:f,textFitHeight:m}=n[e],g={width:t,height:o,x:s,y:l,context:a};i[r][e]={data:null,pixelRatio:u,sdf:h,stretchX:c,stretchY:p,content:d,textFitWidth:f,textFitHeight:m,spriteData:g}}}return i}(o,s)}var Km=class extends bt{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.missingImageResolver=null,this.patterns={},this.atlasImage=new Ih({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 Ih({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(let{ids:e,promiseResolve:t}of this.requestors)t(this._getImagesForIds(e));this.requestors=[]}}getImage(e){let t=this.images[e];if(t&&!t.data&&t.spriteData){let e=t.spriteData;t.data=new Ih({width:e.width,height:e.height},e.context.getImageData(e.x,e.y,e.width,e.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 xt(Error(`Image "${e}" has invalid "stretchX" value`))),i=!1),this._validateStretch(t.stretchY,r?.height)||(this.fire(new xt(Error(`Image "${e}" has invalid "stretchY" value`))),i=!1),this._validateContent(t.content,t)||(this.fire(new xt(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(4!==e.length)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])&&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 t of e)this.images[t]||(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((e=>!this.getImage(e)))),i=this.missingImageResolver;i&&await Promise.all(Array.from(t,(e=>i(e))));let r={};for(let i of e){let e=this.getImage(i);e&&(t.delete(i),r[i]={data:e.data.clone(),pixelRatio:e.pixelRatio,sdf:e.sdf,version:e.version,stretchX:e.stretchX,stretchY:e.stretchY,content:e.content,textFitWidth:e.textFitWidth,textFitHeight:e.textFitHeight,hasRenderCallback:!!e.userImage?.render})}for(let e of t)this.fire(new Wm({id:e})),je(`Image "${e}" 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 t={w:i.data.width+2,h:i.data.height+2,x:0,y:0},r=new Wc(t,i);this.patterns[e]={bin:t,position:r}}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 jh(e,this.atlasImage,t.RGBA),this.atlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE)}_updatePatternAtlas(){let e=[];for(let t in this.patterns)e.push(this.patterns[t].bin);let{w:t,h:i}=Zc(e),r=this.atlasImage;r.resize({width:t||1,height:i||1});for(let e in this.patterns){let{bin:t}=this.patterns[e],i=t.x+1,a=t.y+1,n=this.getImage(e).data,o=n.width,s=n.height;Ih.copy(n,r,{x:0,y:0},{x:i,y:a},{width:o,height:s}),Ih.copy(n,r,{x:0,y:s-1},{x:i,y:a-1},{width:o,height:1}),Ih.copy(n,r,{x:0,y:0},{x:i,y:a+s},{width:o,height:1}),Ih.copy(n,r,{x:o-1,y:0},{x:i-1,y:a},{width:1,height:s}),Ih.copy(n,r,{x:0,y:0},{x:i+o,y:a},{width:1,height:s})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(let t of e){if(this.callbackDispatchedThisFrame[t])continue;this.callbackDispatchedThisFrame[t]=!0;let e=this.getImage(t);e||je(`Image with ID: "${t}" was not found`),Gc(e)&&this.updateImage(t,e)}}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 Jm(e,t,i,r){let a=256*t,n=a+255,o=await((e,t)=>ft(Me(e,{type:"arrayBuffer"}),t))(await r.transformRequest(i.replace("{fontstack}",e).replace("{range}",`${a}-${n}`),"Glyphs"),new AbortController);if(!o?.data)throw Error(`Could not load glyph range. range: ${t}, ${a}-${n}`);let s={};for(let e of function(e){return new Nc(e).readFields(qc,[])}(o.data))s[e.id]=e;return s}const Qm=1e20,eg=new Float64Array(256);for(let e=0;e<256;e++){let t=.5-(e/255)**(1/2.2);eg[e]=t*Math.abs(t)}eg[255]=-1e20;var tg=class{constructor({fontSize:e=24,buffer:t=3,radius:i=8,cutoff:r=.25,fontFamily:a="sans-serif",fontWeight:n="normal",fontStyle:o="normal",lang:s=null}={}){this.buffer=t,this.radius=i,this.cutoff=r,this.lang=s;let l=this.size=e+4*t,h=this._createCanvas(l),u=this.ctx=h.getContext("2d",{willReadFrequently:!0});u.font=`${o} ${n} ${e}px ${a}`,u.textBaseline="alphabetic",u.textAlign="left",u.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:n}=this.ctx.measureText(e),o=Math.ceil(i),s=Math.floor(-a),l=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(n)-s)),h=Math.max(0,Math.min(this.size-this.buffer,o+Math.ceil(r))),u=l+2*this.buffer,c=h+2*this.buffer,p=Math.max(u*c,0),d=new Uint8ClampedArray(p),f={data:d,width:u,height:c,glyphWidth:l,glyphHeight:h,glyphTop:o,glyphLeft:s,glyphAdvance:t};if(0===l||0===h)return f;let{ctx:m,buffer:g,gridInner:_,gridOuter:y}=this;this.lang&&(m.lang=this.lang),m.clearRect(g,g,l,h),m.fillText(e,g-s,g+o
2);let v=m.getImageData(g,g,l,h);y.fill(Qm,0,p),_.fill(0,0,p);let x=3;for(let e=0;e<h;e++){let t=(e+g)*u+g;for(let e=0;e<l;e++,x+=4,t++){let e=v.data[x];if(0===e)continue;let i=eg[e];y[t]=Math.max(0,i),_[t]=Math.max(0,-i)}}ig(y,0,0,u,c,u,this.f,this.v,this.z);let b=Math.min(g,1);ig(_,g-b,g-b,l+2*b,h+2*b,u,this.f,this.v,this.z);let w=255/this.radius,T=255*(1-this.cutoff);for(let e=0;e<p;e++){let t=Math.sqrt(y[e])-Math.sqrt(_[e]);d[e]=Math.round(T-w*t)}return f}};function ig(e,t,i,r,a,n,o,s,l){for(let h=t;h<t+r;h++)rg(e,i*n+h,n,a,o,s,l);for(let h=i;h<i+a;h++)rg(e,h*n+t,1,r,o,s,l)}function rg(e,t,i,r,a,n,o){n[0]=0,o[0]=-1e20,o[1]=Qm,a[0]=e[t];for(let s=1,l=0,h=0;s<r;s++){a[s]=e[t+s*i];let r=s*s;do{let e=n[l];h=(a[s]-a[e]+r-e*e)/(s-e)/2}while(h<=o[l]&&--l>-1);l++,n[l]=s,o[l]=h,o[l+1]=Qm}for(let s=0,l=0;s<r;s++){for(;o[l+1]<s;)l++;let r=n[l],h=s-r;e[t+s*i]=a[r]+h*h}}const ag=wt.layout_symbol["text-font"].default.join(",");var ng=class e{static{this.loadGlyphRange=Jm}static{this.TinySDF=tg}constructor(e,t,i){this.requestManager=e,this.localIdeographFontFamily=t,this.entries={},this.lang=i}setURL(e){this.url=e}async getGlyphs(e){let t=[];for(let i in e)for(let r of e[i])t.push(this._getAndCacheGlyphsPromise(i,r));let i=await Promise.all(t),r={};for(let{stack:e,id:t,glyph:a}of i)r[e]||={},r[e][t]=a&&{id:a.id,bitmap:a.bitmap.clone(),metrics:a.metrics};return r}async _getAndCacheGlyphsPromise(e,t){this.entries[e]??={glyphs:{},requests:{},ranges:{}};let i=this.entries[e],r=i.glyphs[t];return void 0===r?!this.url||this._charUsesLocalIdeographFontFamily(t)?(r=i.glyphs[t]=await this._drawGlyph(i,e,t),{stack:e,id:t,glyph:r}):await this._downloadAndCacheRangePromise(e,t):{stack:e,id:t,glyph:r}}
2async _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]||=e.loadGlyphRange(t,a,this.url,this.requestManager);try{let e=await r.requests[a];for(let t in e)r.glyphs[+t]=e[+t];return r.ranges[a]=!0,{stack:t,id:i,glyph:e[i]||null}}catch(e){let n=r.glyphs[i]=await this._drawGlyph(r,t,i);return this._warnOnMissingGlyphRange(n,a,i,se(e)),{stack:t,id:i,glyph:n}}}_warnOnMissingGlyphRange(e,t,i,r){let a=256*t;je(`Unable to load glyph range ${t}, ${a}-${a+255}. Rendering codepoint U+${i.toString(16).padStart(4,"0").toUpperCase()} locally instead. ${r}`)}_charUsesLocalIdeographFontFamily(e){return!!this.localIdeographFontFamily&&function(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))}(e)}async _drawGlyph(e,t,i){let r=t===ag&&""!==this.localIdeographFontFamily&&this._charUsesLocalIdeographFontFamily(i),a=r?"ideographTinySDF":"tinySDF";e[a]||=this._createTinySDF(r?this.localIdeographFontFamily:t);let n=(await e[a]).draw(String.fromCodePoint(i)),o=/^\p{gc=Cf}+$/u.test(String.fromCodePoint(i));return{id:i,bitmap:new Mh({width:n.width||60,height:n.height||60},n.data),metrics:{width:o?0:n.glyphWidth/2||24,height:n.glyphHeight/2||24,left:n.glyphLeft/2+.5||0,top:n.glyphTop/2-27.5||-8,advance:o?0:n.glyphAdvance/2||24,isDoubleResolution:!0}}}async _createTinySDF(t){let i=t?t.split(","):[];i.push("sans-serif");let r=i.map((e=>/[-\w]+/.test(e)?e:`'${CSS.escape(e)}'`)).join(","),a=this._fontWeight(i[0]),n=this._fontStyle(i[0]);if(typeof document<"u"&&document.fonts?.load)try{await document.fonts.load(`${n} ${a||"normal"} 48px ${r}`)}catch(e){je(`Failed to load font "${r}": ${se(e).message}`)}return new e.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:r,fontWeight:a,fontStyle:n,lang:this.lang})}_fontStyle(e){return/italic/i.test(e)?"italic":/oblique/i.test(e)?"oblique":"normal"}_fontWeight(e){let t,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};for(let[r,a]of Object.entries(i))RegExp(`\\b${r}\\b`,"i").test(e)&&(t=`${a}`);return t}destroy(){for(let e in this.entries){let t=this.entries[e];t.tinySDF=null,t.ideographTinySDF=null,t.glyphs={},t.requests={},t.ranges={}}this.entries={}}};let og;var sg=class extends bt{constructor(e,t){super(),this._transitionable=new Ro(og||=new Wo({anchor:new qo(wt.light.anchor,"anchor"),position:new qo(wt.light.position,"position"),color:new qo(wt.light.color,"color"),intensity:new qo(wt.light.intensity,"intensity")}),"light",t),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}getCartesianPosition(){return function([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)]}(this.properties.get("position"))}setLight(e,t={}){if(!this._validate(oo.light,e,t))for(let t in e){let i=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-11),i):this._transitionable.setValue(t,i)}}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 uo(this,e,{value:t},i)}};let lg;var hg=class extends bt{constructor(e,t){super(),this._transitionable=new Ro(lg||=new Wo({"sky-color":new qo(wt.sky["sky-color"],"sky-color"),"horizon-color":new qo(wt.sky["horizon-color"],"horizon-color"),"fog-color":new qo(wt.sky["fog-color"],"fog-color"),"fog-ground-blend":ne
vendor: 4,132 bytes, line 2
2w qo(wt.sky["fog-ground-blend"],"fog-ground-blend"),"horizon-fog-blend":new qo(wt.sky["horizon-fog-blend"],"horizon-fog-blend"),"sky-horizon-blend":new qo(wt.sky["sky-horizon-blend"],"sky-horizon-blend"),"atmosphere-blend":new qo(wt.sky["atmosphere-blend"],"atmosphere-blend")}),"sky",t),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new Io(0))}setSky(e,t={}){if(!this._validate(oo.sky,e,t)){e||={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0};for(let t in e){let i=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-11),i):this._transitionable.setValue(t,i)}}}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 uo(this,e,{value:t},i)}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}},ug=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=[],a=e.length%2==1?-e[e.length-1]*i:0,n=e[0]*i,o=!0;r.push({left:a,right:n,isDash:o,zeroLength:0===e[0]});let s=e[0];for(let t=1;t<e.length;t++){o=!o;let l=e[t];a=s*i,s+=l,n=s*i,r.push({left:a,right:n,isDash:o,zeroLength:0===l})}return r}addRoundDash(e,t,i){let r=t/2;for(let t=-i;t<=i;t++){let a=this.nextRow+i+t,n=this.width*a,o=0,s=e[o];for(let a=0;a<this.width;a++){a/s.right>1&&(s=e[++o]);let l,h=Math.abs(a-s.left),u=Math.abs(a-s.right),c=Math.min(h,u),p=t/i*(r+1);if(s.isDash){let e=r-Math.abs(p);l=Math.sqrt(c*c+e*e)}else l=r-Math.sqrt(c*c+p*p);this.data[n+a]=Math.max(0,Math.min(255,l+128))}}}addRegularDash(e){for(let t=e.length-1;t>=0;--t){let i=e[t],r=e[t+1];i.zeroLength?e.splice(t,1):r?.isDash===i.isDash&&(r.left=i.left,e.splice(t,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,n=e[a];for(let t=0;t<this.width;t++){t/n.right>1&&(n=e[++a]);let i=Math.abs(t-n.left),o=Math.abs(t-n.right),s=Math.min(i,o),l=n.isDash?s:-s;this.data[r+t]=Math.max(0,Math.min(255,l+128))}}addDash(e,t){let i=t?7:0,r=2*i+1;if(this.nextRow+r>this.height)return je("LineAtlas out of space"),null;let a=0;for(let t of e)a+=t;if(0!==a){let r=this.width/a,n=this.getDashRanges(e,this.width,r);t?this.addRoundDash(n,r,i):this.addRegularDash(n)}let n={y:this.nextRow+i,height:2*i,width:a};return this.nextRow+=r,this.dirty=!0,n}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 cg(e,t){if(t)try{return new Worker(e,{type:"module"})}catch(e){console.warn("Module worker not supported, falling back to classic worker",e)}return new Worker(e)}async function pg(){let e=ht.WORKER_URL||function(){let e="file:///Users/danielspeir/Repos/product/template_jonahsystems_premium/node_modules/maplibre-gl/dist/maplibre-gl.mjs";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}(),t=!e?.endsWith(".cjs");if(!function(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}}(e))return cg(e,t);if(t){let i=function(e){let t=new Blob([`import ${JSON.stringify(new URL(e,"file:///Users/
2danielspeir/Repos/product/template_jonahsystems_premium/node_modules/maplibre-gl/dist/maplibre-gl.mjs").href)}`],{type:"text/javascript"});return URL.createObjectURL(t)}(e);try{return cg(i,t)}finally{URL.revokeObjectURL(i)}}let i=await async function(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)}(e);try{return cg(i,t)}finally{URL.revokeObjectURL(i)}}const dg="maplibre_preloaded_worker_pool";var fg=class e{constructor(){this.active={},this.workersPromise=null}async acquire(t){if(this.active[t]=!0,!this.workersPromise){let t=[];for(;t.length<e.workerCount;)t.push(pg());this.workersPromise=Promise.all(t)}return(await this.workersPromise).slice()}release(e){if(delete this.active[e],0===this.numActive()&&this.workersPromise){let e=this.workersPromise;this.workersPromise=null,e.then((e=>{for(let t of e)t.terminate()}))}}isPreloaded(){return!!this.active[dg]}numActive(){return Object.keys(this.active).length}};const mg=Math.floor(Im.hardwareConcurrency/2);let gg;function _g(){return gg||=new fg,gg}fg.workerCount=function(e){if(null==$e){let t=e.navigator?e.navigator.userAgent:null;$e=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return $e}(globalThis)?Math.max(Math.min(mg,3),1):1;var yg=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(((t,i)=>{let r=new xp(t,e);return r.name=`Worker ${i}`,r})),!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((i=>i.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(){0===this.actors.length&&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 e of this.actors)e.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 vg;function xg(){return vg||(vg=new yg(_g(),ct),vg.registerMessageHandler("GR",((e,t,i)=>ft(t,i)))),vg}function bg(e,t){let i=x();return P(i,i,[1,1,0]),E(i,i,[.5*e.width,.5*e.height,1]),e.calculatePosMatrix?S(i,i,e.calculatePosMatrix(t.toUnwrapped())):i}function wg(e,t,i,r,a,n,o){let s=function(e,t,i){if(e)for(let r of e){let e=t[r];if(e?.source===i&&"fill-extrusion"===e.type)return!0}else for(let e in t){let r=t[e];if(r.source===i&&"fill-extrusion"===r.type)return!0}return!1}(a?.layers??null,t,e.id),l=n.maxPitchScaleFactor(),h=e.tilesIn(r,l,s);h.sort(Sg);let u=[];for(let r of h)u.push({wrappedTileID:r.tileID.wrapped().key,queryResults:r.tile.queryRenderedFeatures(t,i,e.getState(),r.queryGeometry,r.cameraQueryGeometry,r.scale,a,n,l,bg(n,r.tileID),o?(e,t)=>o(r.tileID,e,t):void 0)});return function(e,t){for(let i in e)for(let r of e[i])Pg(r,t);return e}(function(e){let t={},i={};for(let{queryResults:r,wrappedTileID:a}of e){i[a]||={};let e=i[a];for(let i in r){let a=r[i];e[i]||={};let n=e[i];t[i]||=[];for(let e of a)n[e.featureIndex]||(n[e.featureIndex]=!0,t[i].push(e))}}return t}(u),e)}function Tg(e,t,i,r,a,n,o){let s={},l=n.queryRenderedSymbols(r),h=[];for(let e of Object.keys(l).map(Number))h.push(o[e]);h.sort(Sg);for(let i of h){let r=i.featureIndex.lookupSymbolFeatures(l[i.bucketInstanceId],t,i.bucketIndex,i.sourceLayerIndex,{filterSpec:a.filter,globalState:a.globalState},a.layers,a.availableImages,e);for(let e in r){s[e]||=[];let t=r[e];t.sort(((e,t)=>{let r=i.featureSortOrder;if(r){let i=r.indexOf(e.featureIndex);return r.indexOf(t.featureIndex)-i}return t.featureIndex-e.featureIndex}));for(let i of t)s[e].push(i)}}return function(e,t,i){for(let r in e)for(let a of e[r]){Pg(a,i[t[r].source])}return e}(s,e,i)}function Sg(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 Pg(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 Eg(e,t,i,r){let a=e;if(e.url?a=(await mt(await t.transformRequest(e.url,"Source"),i)).data:await Im.frameAsync(i,r),!a)return null;let n=Ie(Me(a,e),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in a&&a.vector_layers&&(n.vectorLayerIds=a.vector_layers.map((e=>e.id))),n}
vendor: 4,761 bytes, line 2
2var Cg=class e{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):Array.isArray(e)&&(4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof wp?new wp(e.lng,e.lat):wp.convert(e),this}setSouthWest(e){return this._sw=e instanceof wp?new wp(e.lng,e.lat):wp.convert(e),this}extend(t){let i,r,a=this._sw,n=this._ne;if(t instanceof wp)i=t,r=t;else{if(!(t instanceof e)){if(Array.isArray(t)){if(4===t.length||t.every(Array.isArray)){let i=t;return this.extend(e.convert(i))}{let e=t;return this.extend(wp.convert(e))}}return t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(wp.convert(t)):this}if(i=t._sw,r=t._ne,!i||!r)return this}return a||n?(a.lng=Math.min(i.lng,a.lng),a.lat=Math.min(i.lat,a.lat),n.lng=Math.max(r.lng,n.lng),n.lat=Math.max(r.lat,n.lat)):(this._sw=new wp(i.lng,i.lat),this._ne=new wp(r.lng,r.lat)),this}getCenter(){return new wp((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 wp(this.getWest(),this.getNorth())}getSouthEast(){return new wp(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(e){let{lng:t,lat:i}=wp.convert(e),r=this._sw.lat<=i&&i<=this._ne.lat,a=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=t&&t>=this._ne.lng),r&&a}intersects(t){if(!((t=e.convert(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=Ce(this.getWest(),-180,180),n=Ce(this.getEast(),-180,180),o=Ce(t.getWest(),-180,180),s=Ce(t.getEast(),-180,180),l=a>n,h=o>s;return!(!l||!h)||(l?s>=a||o<=n:h?n>=o||a<=s:o<=n&&s>=a)}static convert(t){return t instanceof e||!t?t:new e(t)}static fromLngLat(t,i=0){let r=360*i/40075017,a=r/Math.cos(Math.PI/180*t.lat);return new e(new wp(t.lng-a,t.lat-r),new wp(t.lng+a,t.lat+r))}adjustAntiMeridian(){let t=new wp(this._sw.lng,this._sw.lat),i=new wp(this._ne.lng,this._ne.lat);return t.lng>i.lng?new e(t,new wp(i.lng+360,i.lat)):new e(t,i)}},Mg=class{constructor(e,t,i){this.bounds=Cg.convert(this.validateBounds(e)),this.minzoom=t||0,this.maxzoom=i||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){let t=2**e.z,i=Math.floor(Pp(this.bounds.getWest())*t),r=Math.floor(Ep(this.bounds.getNorth())*t),a=Math.ceil(Pp(this.bounds.getEast())*t),n=Math.ceil(Ep(this.bounds.getSouth())*t);return e.x>=i&&e.x<a&&e.y>=r&&e.y<n}},Ig=class extends bt{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,Me(this,Ie(t,["url","scheme","tileSize","promoteId","encoding"])),this._options=Me({type:"vector"},t),this._collectResourceTiming=t.collectResourceTiming,512!==this.tileSize)throw Error("vector tile sources must have a tileSize of 512");this.setEventedParent(r)}async load(e=!1){this._loaded=!1,this.fire(new Vm("dataloading")),this._tileJSONRequest=new AbortController;try{let t=await Eg(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,t&&(Me(this,t),t.bounds&&(this.tileBounds=new Mg(t.bounds,this.minzoom,this.maxzoom)),this.fire(new Vm("data",{sourceDataType:"metadata"})),this.fire(new Vm("data",{sourceDataType:"content",sourceDataChanged:e})))}catch(e){this._tileJSONRequest=null,this._loaded=!0,st(e)||this.fire(new xt(se(e)))}}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 Me({},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.t
vendor: 7,129 bytes, line 2
2ype,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&&"expired"!==e.state){if("loading"===e.state)return new Promise(((t,i)=>{e.reloadPromise={resolve:t,reject:i}}))}else e.actor=this.dispatcher.getReadyActor(),r="LT";e.abortController=new AbortController;try{let t=await e.actor.sendAsync({type:r,data:i},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,t);let a={};return t?.etagUnmodified&&(a.unmodified=!0),a}catch(t){if(delete e.abortController,e.aborted||st(t))return;if(t&&404!==t.status)throw t;this._afterTileLoadWorkerResponse(e,null)}}async _getOverzoomParameters(e){if(e.tileID.canonical.z<=this.maxzoom||void 0===this.map._zoomLevelsToOverscale)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 t=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(t.resolve).catch(t.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.type,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}},Ag=class extends bt{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=Me({type:"raster"},t),Me(this,Ie(t,["url","scheme","tileSize"]))}async load(e=!1){this._loaded=!1,this.fire(new Vm("dataloading")),this._tileJSONRequest=new AbortController;try{let t=await Eg(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,t&&(Me(this,t),t.bounds&&(this.tileBounds=new Mg(t.bounds,this.minzoom,this.maxzoom)),this.fire(new Vm("data",{sourceDataType:"metadata"})),this.fire(new Vm("data",{sourceDataType:"content",sourceDataChanged:e})))}catch(e){this._tileJSONRequest=null,this._loaded=!0,st(e)||this.fire(new xt(se(e)))}}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 Me({},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 t=await Dm.getImage(a,e.abortController,this.map._refreshExpiredTiles,r);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(t?.data){this.map._refreshExpiredTiles&&(t.cacheControl||t.expires)&&e.setExpiryData({cacheControl:t.cacheControl,expires:t.expires});let r=this.map.painter.context,a=r.gl,n=t.data;e.texture=this.map.painter.getTileTexture(n.width),e.texture?e.texture.update(n,{useMipmap:!0,premultiply:i}):(e.texture=new jh(r,n,a.RGBA,{useMipmap:!0,premultiply:i}),e.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(t){if(delete e.abortController,e.aborted)e.state="unloaded";else if(t)throw e.state="errored",t}}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}},zg=class extends Ag{constructor(e,t,i,r){super(e,t,i,r),this.type="raster-dem",this.maxzoom=22,this._options=Me({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 t=await Dm.getImage(i,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(t?.data){let i=t.data;this.map._refreshExpiredTiles&&(t.cacheControl||t.expires)&&e.setExpiryData({cacheControl:t.cacheControl,expires:t.expires});let r=Ue(i)&&g()?i:await this.readImageNow(i),a={type:this.type,uid:e.uid,source:this.id,rawImageData:r,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(e.actor&&"expired"!==e.state&&"reloading"!==e.state)return;await this.dispatcher.waitForInitComplete(),(!e.actor||"expired"===e.state)&&(e.actor=this.dispatcher.getReadyActor()),e.dem=await e.actor.sendAsync({type:"LDT",data:a}),e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}catch(t){if(delete e.abortController,e.aborted)e.state="unloaded";else if(t)throw e.state="errored",t}}async readImageNow(e){if(typeof VideoFrame<"u"&&_()){let t=e.width+2,i=e.height+2;try{return new Ih({width:t,height:i},await Ze(e,-1,-1,t,i))}catch{}}return Im.getImageData(e,1)}_getNeighboringTiles(e){let t=e.canonical,i=2**t.z,r=(t.x-1+i)%i,a=0===t.x?e.wrap-1:e.wrap,n=(t.x+1+i)%i,o=t.x+1===i?e.wrap+1:e.wrap,s={};return s[new Lp(e.overscaledZ,a,t.z,r,t.y).key]={backfilled:!1},s[new Lp(e.overscaledZ,o,t.z,n,t.y).key]={backfilled:!1},t.y>0&&(s[new Lp(e.overscaledZ,a,t.z,r,t.y-1).key]={backfilled:!1},s[new Lp(e.overscaledZ,e.wrap,t.z,t.x,t.y-1).key]={backfilled:!1},s[new Lp(e.overscaledZ,o,t.z,n,t.y-1).key]={backfilled:!1}),t.y+1<i&&(s[new Lp(e.overscaledZ,a,t.z,r,t.y+1).key]={backfilled:!1},s[new Lp(e.overscaledZ,e.wrap,t.z,t.x,t.y+1).key]={backfilled:!1},s[new Lp(e.overscaledZ,o,t.z,n,t.y+1).key]={backfilled:!1}),s}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.t
2ype,uid:e.uid,source:this.id}})}};function kg(e,t){return t?e.properties[t]:e.id}function Dg(e,t,i){if(!e)return t||{};if(!t)return e||{};i&&(Lg(e.add,i),Lg(t.add,i));let r=Fg(e),a=Fg(t);!function(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,Rg(a,r)),e.update.delete(i))}}(r,a);let n={};if((r.removeAll||a.removeAll)&&(n.removeAll=!0),n.remove=new Set([...r.remove,...a.remove]),n.add=new Map([...r.add,...a.add]),n.update=new Map([...r.update,...a.update]),n.remove.size&&n.add.size)for(let e of n.add.keys())n.remove.delete(e);let o=function(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}(n);return i&&function(e,t){if(e)for(let i of e)null!=kg(i,t)&&delete i.id}(o.add,i),o}function Rg(e,t){let i={id:e.id};if(t.removeAllProperties&&(delete e.removeProperties,delete e.addOrUpdateProperties,delete t.removeProperties),t.removeProperties)for(let i of t.removeProperties){let t=e.addOrUpdateProperties.findIndex((e=>e.key===i));t>-1&&e.addOrUpdateProperties.splice(t,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 Lg(e,t){if(e)for(let i of e){let e=kg(i,t);null!=e&&(i.id=e)}}function Fg(e){if(!e)return{};let t={};return t.removeAll=e.removeAll,t.remove=new Set(e.remove||[]),t.add=new Map(e.add?.map((e=>[e.id,e]))),t.update=new Map(e.update?.map((e=>[e.id,e]))),t}function Bg(e){return e&&0!==e.length?"number"==typeof e[0]?[e]:e.flatMap((e=>Bg(e))):[]}function Og(e){return"GeometryCollection"===e.type?e.geometries.flatMap((e=>Og(e))):Bg(e.coordinates)}function Vg(e){let t,i=new Cg;switch(e.type){case"FeatureCollection":t=e.features.flatMap((e=>Og(e.geometry)));break;case"Feature":t=Og(e.geometry);break;default:t=Og(e)}if(0===t.length)return i;for(let e of t){let[t,r]=e;i.extend([t,r])}return i}var jg=class extends bt{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="string"==typeof t.data?{url:t.data}:{geojson:t.data},this._options=Me({},t),this._collectResourceTiming=t.collectResourceTiming,void 0!==t.maxzoom&&(this.maxzoom=t.maxzoom),t.type&&(this.type=t.type),t.attribution&&(this.attribution=t.attribution),this.promoteId=t.promoteId,void 0!==t.clusterMaxZoom&&this.maxzoom<=t.clusterMaxZoom&&je(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${t.clusterMa
2xZoom}".`),this.workerOptions=Me({source:this.id,geojsonVtOptions:{buffer:this._pixelsToTileUnits(void 0===t.buffer?128:t.buffer),tolerance:this._pixelsToTileUnits(void 0===t.tolerance?.375:t.tolerance),extent:ne,maxZoom:this.maxzoom,lineMetrics:t.lineMetrics||!1,generateId:t.generateId||!1,promoteId:"string"==typeof t.promoteId?t.promoteId:void 0,cluster:t.cluster||!1,clusterOptions:{maxZoom:this._getClusterMaxZoom(t.clusterMaxZoom),minPoints:Math.max(2,t.clusterMinPoints||2),extent:ne,radius:this._pixelsToTileUnits(t.clusterRadius||50),log:!1,generateId:t.generateId||!1}},clusterProperties:t.clusterProperties,filter:t.filter},t.workerOptions)}_hasPendingWorkerUpdate(){return void 0!==this._pendingWorkerUpdate.data||void 0!==this._pendingWorkerUpdate.diff||this._pendingWorkerUpdate.updateCluster}_pixelsToTileUnits(e){return e*(ne/this.tileSize)}_tileUnitsToPixels(e){return e/(ne/this.tileSize)}_getClusterMaxZoom(e){let t=e?Math.round(e):this.maxzoom-1;return Number.isInteger(e)||void 0===e||je(`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="string"==typeof e?{url:e}:{geojson:e},this._pendingWorkerUpdate={data:e},this._updateWorkerData()}updateData(e){return this._pendingWorkerUpdate.diff=Dg(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 Vg(await this.getData())}setClusterOptions(e){return this.workerOptions.geojsonVtOptions.cluster=e.cluster,void 0!==e.clusterRadius&&(this.workerOptions.geojsonVtOptions.clusterOptions.radius=this._pixelsToTileUnits(e.clusterRadius)),void 0!==e.clusterMaxZoom&&(this.workerOptions.geojsonVtOptions.clusterOptions.maxZoom=this._getClusterMaxZoom(e.clusterMa
vendor: 5,421 bytes, line 2
2xZoom)),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())return void je(`No pending worker updates for GeoJSONSource ${this.id}.`);let{data:e,diff:t,updateCluster:i}=this._pendingWorkerUpdate,r=this._getLoadGeoJSONParameters(e,t,i);void 0===e?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=Me({type:this.type,source:this.id},this.workerOptions);return"string"==typeof e?(r.request=await this.map._requestManager.transformRequest(Im.resolveURL(e),"Source"),r.request.collectResourceTiming=this._collectResourceTiming,r):void 0!==e?(r.data=e,r):t?(r.dataDiff=t,r):i?(r.updateCluster=!0,r):void 0}async _dispatchWorkerUpdate(e){this._isUpdatingWorker=!0,this.fire(new Vm("dataloading"));try{let t=await e,i=await(await this.actorPromise).sendAsync({type:"LD",data:t});if(this._isUpdatingWorker=!1,this._removed||i.abandoned)return void this.fire(new Vm("dataabort"));i.data&&(this._data={geojson:i.data});let r=this._applyDiffToSource(t.dataDiff),a=this._getShouldReloadTileOptions(r),n={};this._applyResourceTiming(n,i),this.fire(new Vm("data",{...n,sourceDataType:"metadata"})),this.fire(new Vm("data",{...n,sourceDataType:"content",shouldReloadTileOptions:a}))}catch(e){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new Vm("dataabort"));this.fire(new xt(se(e)))}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&&Me(e,{resourceTiming:r})}_applyDiffToSource(e){if(!e)return;let t="string"==typeof this.promoteId?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){let e=function(e,t){let i=new Map;if(null==e||null==e.type)return i;if("Feature"===e.type){let r=kg(e,t);return null==r?void 0:(i.set(r,e),i)}if("FeatureCollection"===e.type){let r=new Set;for(let a of e.features){let e=kg(a,t);if(null==e||r.has(e))return;r.add(e),i.set(e,a)}return i}}(this._data.geojson,t);if(!e)throw Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:e}}if(!this._data.updateable)return;let i=function(e,t,i){let r=[];if(t.removeAll)e.clear();else if(t.remove)for(let i of t.remove){let t=e.get(i);t&&(r.push(t.geometry),e.delete(i))}if(t.add)for(let a of t.add){let t=kg(a,i);if(null==t)continue;let n=e.get(t);n&&r.push(n.geometry),r.push(a.geometry),e.set(t,a)}if(t.update)for(let i of t.update){let t=e.get(i.id);if(!t)continue;let a=!!i.newGeometry,n=i.removeAllProperties||i.removeProperties?.length>0||i.addOrUpdateProperties?.length>0;if(!a&&!n)continue;r.push(t.geometry);let o={...t};if(e.set(i.id,o),a&&(r.push(i.newGeometry),o.geometry=i.newGeometry),n){if(i.removeAllProperties?o.properties={}:o.properties={...o.properties||{}},i.removeProperties)for(let e of i.removeProperties)delete o.properties[e];if(i.addOrUpdateProperties)for(let{key:e,value:t}of i.addOrUpdateProperties)o.properties[e]=t}}return r}(this._data.updateable,e,t);return e.removeAll||this._options.cluster?void 0:i}_getShouldReloadTileOptions(e){if(e)return{affectedBounds:e.filter(Boolean).map((e=>Vg(e)))}}shouldReloadTile(e,{affectedBounds:t}){if("loading"===e.state)return!0;if("unloaded"===e.state)return!1;let{buffer:i,extent:r}=this.workerOptions.geojsonVtOptions,a=function({x:e,y:t,z:i},r=0){let a=Mp((e-r)/2**i),n=Ip((t+1+r)/2**i),o=Mp((e+1+r)/2**i),s=Ip((t-r)/2**i);return new Cg([a,n],[o,s])}(e.tileID.canonical,i/r);for(let e of t)if(a.intersects(e))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,"RT"===t)}catch(t){if(delete e.abortController,e.aborted||st(t))return;throw t}}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 Me({},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}},Ng=class extends bt{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 Vm("dataloading")),this.url=this.options.url;let t=await this.map._requestManager.transformRequest(this.url,"Image");this._request=new AbortController;try{let i=await Dm.getImage(t,this._request);this._request=null,this._loaded=!0,i?.data&&(this.image=i.data,e&&(this.coordinates=e),this._finishLoading())}catch(e){this._request=null,this._loaded=!0,st(e)||this.fire(new xt(se(e)))}}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 Vm("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(zp.fromLngLat);return this.tileID=function(e){let t=jp.fromPoints(e),i=t.width(),r=t.height(),a=Math.max(0,Math.floor(-Math.log(Math.max(i,r))/Math.LN2)),n=2**a;return new Dp(a,Math.floor((t.minX+t.maxX)/2*n),Math.floor((t.minY+t.maxY)/2*n))}(t),this.terrainTileRanges=this._getOverlappingTileRanges(t),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=t.map((e=>this.tileID.getTilePoint(e)._round())),this.flippedWindingOrder=function(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}(this.tileCoords),this.fire(new Vm("data",{sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;let e=this.map.painter.context,t=e.gl;this.texture||(this.texture=new jh(e,this.image,t.RGBA),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE));let i=!1;for(let e in this.tiles){let t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,i=!0)}i&&this.fire(new Vm("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}=jp.fromPoints(e),n={};for(let e=0;e<=25;e++){let o=2**e,s=Math.floor(t*o),l=Math.floor(i*o),h=Math.floor(r*o),u=Math.floor(a*o),c=(s%o+o)%o,p=h%o;n[e]={minWrap:Math.floor(s/o),maxWrap:Math.floor(h/o),minTileXWrapped:c,maxTileXWrapped:p,minTileY:l,maxTileY:u}}return n}};var qg=class extends Ng{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 e=await(e=>{let t=window.document.createElement("video");return t.muted=!0,new Promise((i=>{t.onloadstart=()=>{i(t)};for(let i of e){let e=window.document.createElement("source");gt(i)||(t.crossOrigin="Anonymous"),e.src=i,t.appendChild(e)}}))})(this.urls);if(this._loaded=!0,!e)return;this.video=e,this.video.loop=!0,this.video.addEventListener("playing",this._onPlayingHandler),this.map&&this.video.play(),this._finishLoading()}catch(e){this.fire(new xt(se(e)))}}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 xt(new Ft(`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,184 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(0===Object.keys(this.tiles).length||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 jh(e,this.video,t.RGBA),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE));let i=!1;for(let e in this.tiles){let t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,i=!0)}i&&this.fire(new Vm("data",{sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},$g=class extends Ng{constructor(e,t,i,r){super(e,t,i,r),t.coordinates?(!Array.isArray(t.coordinates)||4!==t.coordinates.length||t.coordinates.some((e=>!Array.isArray(e)||2!==e.length||e.some((e=>"number"!=typeof e)))))&&this.fire(new xt(new Ft(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new xt(new Ft(`sources.${e}`,null,'missing required property "coordinates"'))),t.animate&&"boolean"!=typeof t.animate&&this.fire(new xt(new Ft(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),t.canvas?"string"!=typeof t.canvas&&!(t.canvas instanceof HTMLCanvasElement)&&this.fire(new xt(new Ft(`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 xt(new Ft(`sources.${e}`,null,'missing required property "canvas"'))),this.options=t,this.animate=void 0===t.animate||t.animate}async load(){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 xt(Error("Canvas dimensions cannot be less than or equal to zero."))):(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()||0===Object.keys(this.tiles).length)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 jh(t,this.canvas,i.RGBA,{premultiply:!0}),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let r=!1;for(let e in this.tiles){let t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,r=!0)}r&&this.fire(new Vm("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 Ug={},Gg=e=>{switch(e){case"geojson":return jg;case"image":return Ng;case"raster":return Ag;case"raster-dem":return zg;case"vector":return Ig;case"video":return qg;case"canvas":return $g}return Ug[e]};const Zg="RTLPluginLoaded";var Wg=class extends bt{constructor(...e){super(...e),this.status="unavailable",this.url=null,this.dispatcher=xg()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch((e=>{throw this.status="error",e}))}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=Im.resolveURL(e),!this.url)throw Error(`requested url ${e}
2 is invalid`);if("unavailable"===this.status){if(!t)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if("requested"===this.status)return this._requestImport()}async _requestImport(){await this._syncState("loading"),this.status="loaded",this.fire(new vt(Zg))}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}};let Hg=null;function Xg(){return Hg||=new Wg,Hg}var Yg=class{constructor(e,t){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=e,this.uid=ze(),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=zm(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}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(0!==this.rttObjects.length){for(let t of this.rttObjects)t&&e.releaseRTT(t);this.rttObjects.length=0}}loadVectorData(e,t,i){if(!0!==e?.etagUnmodified)if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){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=function(e,t){let i={};if(!t)return i;for(let r of e){let e=r.layerIds.map((e=>t.getLayer(e))).filter(Boolean);if(0!==e.length){r.layers=e,r.stateDependentLayerIds&&(r.stateDependentLayers=r.stateDependentLayerIds.map((t=>e.filter((e=>e.id===t))[0])));for(let t of e)i[t.id]=r}}return i}(e.buckets,t?.style),this.hasSymbolBuckets=!1;for(let e in this.buckets){let t=this.buckets[e];if(t instanceof op){if(this.hasSymbolBuckets=!0,!i)break;t.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let e in this.buckets){let t=this.buckets[e];if(t instanceof op&&t.hasRTLText){this.hasRTLText=!0,Xg().lazyLoad();break}}this.queryPadding=0;for(let e in this.buckets){let i=this.buckets[e];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(e).queryRadius(i))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),this.dashPositions=e.dashPositions}else this.collisionBoxArray=new zs;else this.state="loaded"}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 t in this.buckets){let i=this.buckets[t];i.uploadPending()&&i.upload(e)}let t=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new jh(e,this.imageAtlas.image,t.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&=(this.glyphAtlasTexture=new jh(e,this.glyphAtlasImage,t.ALPHA),null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,i,r,a,n,o,s,l,h,u){return this.latestFeatureIndex?.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:a,scale:n,tileSize:this.tileSize,pixelPosMatrix:h,transform:s,params:o,queryPadding:this.queryPadding*l,getElevation:u},e,t,i):{}}querySourceFeatures(e,t){let i=this.latestFeatureIndex;if(!i?.rawTileData)return;let r=i.loadVTLayers(),a=t?.sourceLayer?t.sourceLayer:"",n=r._geojsonTileLayer||r[a];if(!n)return;let o=gn(t?.filter,`querySourceFeatures[${a}].filter`,t?.globalState),{z:s,x:l,y:h}=this.tileID.canonical,u={z:s,x:l,y:h};for(let t=0;t<n.length;t++){let r=n.feature(t);if(o.needGeometry){let e=Wl(r,!0);
vendor: 9,480 bytes, line 2
2if(!o.filter(new Io(this.tileID.overscaledZ),e,this.tileID.canonical))continue}else if(!o.filter(new Io(this.tileID.overscaledZ),r))continue;let c=new $p(r,s,l,h,i.getId(r,a));c.tile=u,e.push(c)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){let t=this.expirationTime;if(e.cacheControl){let t=function(e){let t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,i,r,a)=>{let n=r||a;return t[i]=!n||n.toLowerCase(),""})),t["max-age"]){let e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}(e.cacheControl);t["max-age"]&&(this.expirationTime=Date.now()+1e3*t["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){let e=Date.now(),i=!1;if(this.expirationTime>e)i=!1;else if(t)if(this.expirationTime<t)i=!0;else{let r=this.expirationTime-t;r?this.expirationTime=e+Math.max(r,3e4):i=!0}else i=!0;i?(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||0===Object.keys(e).length||this.featureStateRevision===i)return;this.featureStateRevision=i;let r=this.latestFeatureIndex.loadVTLayers();for(let i in this.buckets){if(!t.style.hasLayer(i))continue;let a=this.buckets[i],n=a.layers[0].sourceLayer||"_geojsonTileLayer",o=r[n],s=e[n];if(!o||!s||0===s.length)continue;a.update(s,o,this.imageAtlas?.patternPositions||{},this.dashPositions||{});let l=t?.style?.getLayer(i);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(a)))}}holdingForSymbolFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<zm()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(e){this.symbolFadeHoldUntil=zm()+e}setDependencies(e,t){let i={};for(let e of t)i[e]=!0;this.dependencies[e]=i}hasDependency(e,t){for(let i of e){let e=this.dependencies[i];if(e)for(let i of t)if(e[i])return!0}return!1}};function Kg(e){let t=[];for(let i in e)t.push({id:i,state:e[i]});return t}var Jg=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]||={},Me(this.stateChanges[e][r],i),null===this.deletedStates[e]){this.deletedStates[e]={};for(let t in this.state[e])if(t===r){this.deletedStates[e][r]={};for(let a in this.state[e][t])void 0===i[a]&&(this.deletedStates[e][r][a]=null)}else this.deletedStates[e][t]=null}else if(null===this.deletedStates[e]?.[r]){this.deletedStates[e][r]={};for(let t in this.state[e][r])void 0===i[t]&&(this.deletedStates[e][r][t]=null)}else for(let t in i)null===this.deletedStates[e]?.[r]?.[t]&&delete this.deletedStates[e][r][t]}removeFeatureState(e,t,i){if(null===this.deletedStates[e])return;let r=String(t);if(this.deletedStates[e]||={},i&&void 0!==t)null!==this.deletedStates[e][r]&&(this.deletedStates[e][r]||={},this.deletedStates[e][r][i]=null);else if(void 0!==t)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]||{},n=Me({},r[i],a[i]);if(null===this.deletedStates[e])return{};if(this.deletedStates[e]){let i=this.deletedStates[e][t];if(null===i)return{};for(let e in i)delete n[e]}return n}initializeTileState(e,t){let i={};for(let e in this.state)i[e]=Kg(this.state[e]);e.setFeatureState(i,t,this.revision)}coalesceChanges(e,t){let i={};for(let e in this.stateChanges){this.state[e]||={},i[e]||={};for(let t in this.stateChanges[e])this.state[e][t]||={},Me(this.state[e][t],this.stateChanges[e][t]),i[e][t]=this.state[e][t]}for(let e in this.deletedStates)if(this.state[e]||={},i[e]||={},null===this.deletedStates[e])for(let t in this.state[e])this.state[e][t]={},i[e][t]={};else for(let t in this.deletedStates[e]){if(null===this.deletedStates[e][t])this.state[e][t]={};else for(let i of Object.keys(this.deletedStates[e][t]))delete this.state[e][t][i];i[e][t]=this.state[e][t]}if(this.stateChanges={},this.deletedStates={},0===Object.keys(i).length)return;this.revision++;let r={};for(let e in i)r[e]=Kg(i[e]);e.setFeatureState(r,t,this.revision)}};const Qg=89.25;function e_(e,t){let i=Ee(t.lat,-Qe,Qe);return new d(Pp(t.lng)*e,Ep(i)*e)}function t_(e,t){return new zp(t.x/e,t.y/e).toLngLat()}function i_(e){return e.cameraToCenterDistance*Math.min(.85*Math.tan(He(90-e.pitch)),Math.tan(He(Qg-e.pitch)))}function r_(e,t){let i=e.canonical,r=t/ke(i.z),a=i.x+2**i.z*e.wrap,n=new Float64Array(16);return w(n),P(n,n,[a*r,i.y*r,0]),E(n,n,[r/ne,r/ne,1]),n}function a_(e,t,i,r,a){let n=zp.fromLngLat(e,t),o=a*Cp(1,e.lat),{x:s,y:l,z:h}=n_(i,r),u=o*-s,c=o*-l,p=o*-h;return new zp(n.x+u,n.y+c,n.z+p)}function n_(e,t){let i=He(e),r=He(t),a=Math.cos(-i),n=Math.sin(i);return{x:n*Math.sin(r),y:-n*Math.cos(r),z:a}}function o_(e,t,i){let r=t.intersectsFrustum(e);if(!i||0===r)return r;let a=t.intersectsPlane(i);return 0===a?0:2===r&&2===a?2:1}function s_(e,t,i){let r=0,a=(i-t)/10;for(let n=0;n<10;n++){let o=t+(n+.5)/10*(i-t);r+=a*Math.cos(o)**+e}return r}function l_(e,t){return function(i,r,a,n,o){let s=2*((e-1)/De(Math.cos(He(Qg-o))/Math.cos(He(Qg)))-1),l=Math.acos(a/n),h=2*s_(s-1,0,He(o/2)),u=Math.min(He(Qg),l+He(o/2)),c=s_(s-1,Math.min(u,l-He(o/2)),u),p=Math.atan(r/a),d=i;return d+=De(n/Math.hypot(r,a)/Math.max(.5,Math.cos(He(o/2)))),d+=s*De(Math.cos(p))/2,d-=De(Math.max(1,c/h/t))/2,d}}const h_=l_(9.314,3);function u_(e,t){let i=(t.roundZoom?Math.round:Math.floor)(e.zoom+De(e.tileSize/t.tileSize));return Math.max(0,i)}function c_(e,t){let i=e.getCameraFrustum(),r=e.getClippingPlane(),a=e.screenPointToMercatorCoordinate(e.getCameraPoint()),n=zp.fromLngLat(e.center,e.elevation);a.z=n.z+Math.cos(e.pitchInRadians)*e.cameraToCenterDistance/e.worldSize;let o=function(e){let t=Ee((15-(Qg-e.pitch-e.fov/2))/15,0,1);return e.elevation+500*t}(e),s=e.getCoveringTilesDetailsProvider(),l=s.allowVariableZoom(e,t),h=u_(e,t),u=t.minzoom||0,c=void 0===t.maxzoom?e.maxZoom:t.maxzoom,p=Math.min(Math.max(0,h),c),d=2**p,f=[d*a.x,d*a.y,0],m=[d*n.x,d*n.y,0],g=Math.hypot(n.x-a.x,n.y-a.y),_=Math.abs(n.z-a.z),y=Math.hypot(g,_),v=e=>({zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}),x=[],b=[];if(e.renderWorldCopies&&s.allowWorldCopies())for(let e=1;e<=3;e++)x.push(v(-e)),x.push(v(e));for(x.push(v(0));x.length>0;){let d=x.pop(),g=d.x,v=d.y,w=d.fullyVisible,T={x:g,y:v,z:d.zoom},S=s.getTileBoundingVolume(T,d.wrap,o,t);if(!w){let e=o_(i,S,r);if(0===e)continue;w=2===e}let P=s.distanceToTile2d(a.x,a.y,T,S),E=h;l&&(E=(t.calculateTileZoom||h_)(e.zoom+De(e.tileSize/t.tileSize),P,_,y,e.fov)),E=(t.roundZoom?Math.round:Math.floor)(E),E=Math.max(0,E);let C=Math.min(E,c);if(d.wrap=s.getWrap(n,T,d.wrap),d.zoom>=C){if(d.zoom<u)continue;let e=p-d.zoom,i=f[0]-.5-(g<<e),r=f[1]-.5-(v<<e),a=t.reparseOverscaled?Math.max(d.zoom,E):d.zoom;b.push({tileID:new Lp(d.zoom===c?a:d.zoom,d.wrap,d.zoom,g,v),distanceSq:ae([m[0]-.5-g,m[1]-.5-v]),tileDistanceToCamera:Math.sqrt(i*i+r*r)})}else for(let e=0;e<4;e++){let t=(g<<1)+e%2,i=(v<<1)+(e>>1),r=d.zoom+1;x.push({zoom:r,x:t,y:i,wrap:d.wrap,fullyVisible:w})}}return b.sort(((e,t)=>e.distanceSq-t.distanceSq)).map((e=>e.tileID))}const p_=jp.fromPoints([new d(0,0),new d(ne,ne)]);function d_(e){return"raster"===e||"image"===e||"video"===e}function f_(e,t,i,r,a,n,o){let s=zm(),l=function(e){if(!e.length)return new Set;let t=Math.max(...e.map((e=>e.canonical.z))),i=1/0,r=-1/0,a=1/0,n=-1/0,o=[];for(let s of e){let{x:e,y:l,z:h}=s.canonical,u=2**(t-h),c=e*u,p=l*u;o.push({id:s,x:c,y:p}),c<i&&(i=c),c>r&&(r=c),p<a&&(a=p),p>n&&(n=p)}let s=new Set;for(let e of o)(e.x===i||e.x===r||e.y===a||e.y===n)&&s.add(e.id);return s}(t);for(let h of t){let t=e.getTileById(h.key);(0===t.fadingDirection||0===t.fadeOpacity)&&t.resetFadeLogic(),!m_(e,t,i,s,r,a,o)&&(g_(e,t,i,s,n,o)||y_(t,l,s,o)||t.resetFadeLogic())}}function m_(e,t,i,r,a,n,o){if(!t.hasData())return!1;let{tileID:s,fadingRole:l,fadingDirection:h,fadingParentID:u}=t;if(0===l&&1===h&&u)return i[u.key]=u,!0;let c=Math.max(s.overscaledZ-a,n);for(let a=s.overscaledZ-1;a>=c;a--){let n=s.scaledTo(a),l=e.getLoadedTile(n);if(l)return t.setCrossFadeLogic({fadingRole:0,fadingDirection:1,fadingParentID:l.tileID,fadeEndTime:r+o}),l.setCrossFadeLogic({fadingRole:1,fadingDirection:0,fadeEndTime:r+o}),i[n.key]=n,!0}return!1}function g_(e,t,i,r,a,n){if(!t.hasData())return!1;let o=t.tileID.children(a),s=__(e,t,o,i,r,a,n);if(s)return!0;for(let l of o)__(e,t,l.children(a),i,r,a,n)&&(s=!0);return s}function __(e,t,i,r,a,n,o){if(i[0].overscaledZ>=n)return!1;let s=!1;for(let n of i){let i=e.getLoadedTile(n);if(!i)continue;let{fadingRole:l,fadingDirection:h,fadingParentID:u}=i;(0!==l||0!==h||!u)&&(i.setCrossFadeLogic({fadingRole:0,fadingDirection:0,fadingParentID:t.tileID,fadeEndTime:a+o}),t.setCrossFadeLogic({fadingRole:1,fadingDirection:1,fadeEndTime:a+o})),r[n.key]=n,s=!0}return s}function y_(e,t,i,r){let a=e.tileID;if(e.selfFading)return!0;
vendor: 13,119 bytes, line 2
2if(e.hasData())return!1;if(t.has(a)){let t=i+r;return e.setSelfFadeLogic(t),!0}return!1}function v_(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,n=t.tileID.key;(0!==i||0!==r)&&(Math.abs(r)>1||(Math.abs(i)>1&&(1===Math.abs(i+a)?i+=a:1===Math.abs(i-a)&&(i-=a)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,i,r),e.neighboringTiles?.[n]&&(e.neighboringTiles[n].backfilled=!0))))}var x_=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((e=>e.tileID)).sort(Vp).map((e=>e.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 e of this.getAllIds())this.isIdRenderable(e,t)&&i.push(this.getTileById(e));return t?i.sort(((t,i)=>{let r=t.tileID,a=i.tileID,n=new d(r.canonical.x,r.canonical.y)._rotate(-e),o=new d(a.canonical.x,a.canonical.y)._rotate(-e);return r.overscaledZ-a.overscaledZ||o.y-n.y||o.x-n.x})).map((e=>e.tileID.key)):i.map((e=>e.tileID)).sort(Vp).map((e=>e.key))}},b_=class e extends bt{static{this.maxUnderzooming=10}static{this.maxOverzooming=3}constructor(e,t,i){super(),this.id=e,this.dispatcher=i,this.on("data",(e=>{this._dataHandler(e)})),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((e,t,i,r)=>{let a=new(Gg(t.type))(e,t,i,r);if(a.id!==e)throw Error(`Expected Source id to be ${e} instead of ${a.id}`);return a})(e,t,i,this),this._inViewTiles=new x_,this._outOfViewCache=new vm(0,(e=>this._unloadTile(e))),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new Jg,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source?.onAdd&&this._source.onAdd(e)}onRemove(e){for(let e of this._inViewTiles.getAllTiles())e.unloadVectorData();this.clearTiles(),this._source?.onRemove&&this._source.onRemove(e),this._inViewTiles=new x_}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let e of this._inViewTiles.getAllTiles())if("loaded"!==e.state&&"errored"!==e.state)return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;let e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}async _loadTile(e,t,i){try{let r=await this._source.loadTile(e);this._tileLoaded(e,t,i,r)}catch(t){e.state="errored",404===t.status?this.update(this.transform,this.terrain):this._source.fire(new xt(se(t),{tile:e}))}}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new Vm("dataabort",{tile:e,coord:e.tileID}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.map?this.map.painter:null);for(let t of this._inViewTiles.getAllTiles())t.upload(e),t.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(e){return this._inViewTiles.getRenderableIds(this.transform?.bearingInRadians,e)}hasRenderableParent(e){let t=e.overscaledZ-1;if(t>=this._source.minzoom){let i=this.getLoadedTile(e.scaledTo(t));if(i)return this._inViewTiles.isIdRenderable(i.tileID.key)}return!1}reload(e,t=void 0){if(this._paused)this._shouldReloadOnResume=!0;else{this._outOfViewCache.reset();for(let i of this._inViewTiles.getAllIds()){let r=this._inViewTiles.getTileById(i);t&&!this._source.shouldReloadTile(r,t)||(e?this._reloadTile(i,"errored"===r.state?"loading":"expired"):"errored"!==r.state&&this._reloadTile(i,"reloading"))}}}async _reloadTile(e,t){let i=this._inViewTiles.getTileById(e);i&&("loading"!==i.state&&(i.state=t),await this._loadTile(i,e,t))}_tileLoaded(e,t,i,r){e.timeAdded=zm(),e.selfFading&&(e.fadeEndTime=e.timeAdded+this._rasterFadeDuration),"expired"===i&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(t,e),!r?.unmodified&&("raster-dem"===this.getSource().type&&e.dem&&function(e,t){let i=t.getRenderableIds();for(let r of i){if(!e.neighboringTiles?.[r])continue;let i=t.getTileById(r);e.neighboringTiles[r].backfilled||v_(e,i),!i.neighboringTiles?.[e.tileID.key]?.backfilled&&v_(i,e)}}(e,this._inViewTiles),e.featureStateRevision=-1,this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new Vm("data",{tile:e,coord:e.tileID})))}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._inViewTiles.getTileById(e)}_retainLoadedChildren(t,i){let r=this._getLoadedDescendents(i),a=new Set;for(let n of i){let i=r[n.key];if(!i?.length){a.add(n);continue}let o=n.overscaledZ+e.maxOverzooming,s=i.filter((e=>e.tileID.overscaledZ<=o));if(!s.length){a.add(n);continue}let l=Math.min(...s.map((e=>e.tileID.overscaledZ))),h=s.filter((e=>e.tileID.overscaledZ===l)).map((e=>e.tileID));for(let e of h)t[e.key]=e;this._areDescendentsComplete(h,l,n.overscaledZ)||a.add(n)}return a}_getLoadedDescendents(e){let t={};for(let i of this._inViewTiles.getAllTiles().filter((e=>e.hasData())))for(let r of e)i.tileID.isChildOf(r)&&(t[r.key]||=[],t[r.key].push(i));return t}_areDescendentsComplete(e,t,i){return 1===e.length&&e[0].isOverscaled()?e[0].overscaledZ===t:4**(t-i)===e.length}getLoadedTile(e){return this._inViewTiles.getLoadedTile(e)}updateCacheSize(e){let t=(Math.ceil(e.width/this._source.tileSize)+1)*(Math.ceil(e.height/this._source.tileSize)+1),i=null===this._maxTileCacheZoomLevels?ht.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels,r=Math.floor(t*i),a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._outOfViewCache.setMaxSize(a)}handleWrapJump(e){let t=(e-(void 0===this._prevLng?e:this._prevLng))/360,i=Math.round(t);this._prevLng=e,i&&(this._inViewTiles.handleWrapJump(i),this._resetTileReloadTimers())}update(e,t){if(!this._sourceLoaded||this._paused)return;let i;this.transform=e,this.terrain=t,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((e=>new Lp(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y))):(i=c_(e,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:"vector"===this._source.type&&void 0!==this.map._zoomLevelsToOverscale?Math.max(this._source.maxzoom,e.maxZoom-this.map._zoomLevelsToOverscale):this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:t,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(i=i.filter((e=>this._source.hasTile(e))))):i=[],this.usedForTerrain&&(i=this._addTerrainIdealTiles(i));let r=0===i.length&&!this._updated&&this._didEmitContent;this._updated=!0,r&&this.fire(new Vm("data",{sourceDataType:"idle",sourceId:this.id}));let a=u_(e,this._source),n=this._updateRetainedTiles(i,a),o=d_(this._source.type);o&&this._rasterFadeDuration>0&&!t&&f_(this._inViewTiles,i,n,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),o?this._cleanUpRasterTiles(n):this._cleanUpVectorTiles(n)}_cleanUpRasterTiles(e){for(let t of this._inViewTiles.getAllIds())e[t]||this._removeTile(t)}_cleanUpVectorTiles(e){for(let t of this._inViewTiles.getAllIds()){let i=this._inViewTiles.getTileById(t);e[t]?i.clearSymbolFadeHold():i.hasSymbolBuckets?i.holdingForSymbolFade()?i.symbolFadeFinished()&&this._removeTile(t):i.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(t)}}_addTerrainIdealTiles(e){let t=[];for(let i of e)if(i.canonical.z>this._source.minzoom){let e=i.scaledTo(i.canonical.z-1);t.push(e);let r=i.scaledTo(Math.max(this._source.minzoom,Math.min(i.canonical.z,5)));t.push(r)}return e.concat(t)}releaseSymbolFadeTiles(){for(let e of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(e).holdingForSymbolFade()&&this._removeTile(e)}_updateRetainedTiles(t,i){let r=new Set;for(let e of t)this._addTile(e).hasData()||r.add(e);let a=t.reduce(((e,t)=>(e[t.key]=t,e)),{}),n=this._retainLoadedChildren(a,r),o={},s=Math.max(i-e.maxUnderzooming,this._source.minzoom);for(let e of n){let t=this._inViewTiles.getTileById(e.key),i=t?.wasRequested();for(let r=e.overscaledZ-1;r>=s;--r){let n=e.scaledTo(r);if(o[n.key])break;if(o[n.key]=!0,t=this.getTile(n),!t&&i&&(t=this._addTile(n)),t){let e=t.hasData();if((e||!this.map?.cancelPendingTileRequestsWhileZooming||i)&&(a[n.key]=n),i=t.wasRequested(),e)break}}}return a}_addTile(e){let t=this._inViewTiles.getTileById(e.key);if(t)return t;t=this._outOfViewCache.getAndRemove(e),t&&(t.resetFadeLogic(),this._setTileReloadTimer(e.key,t),t.tileID=e,this._state.initializeTileState(t,this.map?this.map.painter:null));let i=t;return t||(t=new Yg(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(t,e.key,t.state)),t.uses++,this._inViewTiles.setTile(e.key,t),i||this._source.fire(new Vm("dataloading",{tile:t,coord:t.tileID})),t}_setTileReloadTimer(e,t){this._clearTileReloadTimer(e);let i=t.getExpiryTimeout();if(i){let t=()=>{this._reloadTile(e,"expired"),delete this._timers[e]};this._timers[e]=setTimeout(t,i)}}_clearTileReloadTimer(e){let t=this._timers[e];t&&(clearTimeout(t),delete this._timers[e])}_resetTileReloadTimers(){for(let e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(let e of this._inViewTiles.getAllIds()){let t=this._inViewTiles.getTileById(e);this._setTileReloadTimer(e,t)}}refreshTiles(e){for(let t of this._inViewTiles.getAllIds()){let i=this._inViewTiles.getTileById(t);!this._inViewTiles.isIdRenderable(t)&&"errored"!=i.state||e.some((e=>e.equals(i.tileID.canonical)))&&this._reloadTile(t,"expired")}}_removeTile(e){let t=this._inViewTiles.getTileById(e);t&&(t.uses--,this._inViewTiles.deleteTileById(e),this._clearTileReloadTimer(e),!(t.uses>0)&&(t.hasData()&&"reloading"!==t.state?this._outOfViewCache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}_dataHandler(e){if("source"===e.dataType){if("metadata"===e.sourceDataType)return void(this._sourceLoaded=!0);"content"!==e.sourceDataType||!this._sourceLoaded||this._paused||(this.reload(e.sourceDataChanged,e.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let e of this._inViewTiles.getAllIds())this._removeTile(e);this._outOfViewCache.reset()}tilesIn(e,t,i){let r=[],a=this.transform;if(!a)return r;let n=a.getCoveringTilesDetailsProvider().allowWorldCopies(),o=i?a.getCameraQueryGeometry(e):e,s=e=>a.screenPointToMercatorCoordinate(e,this.terrain),l=this.transformBbox(e,s,!n),h=this.transformBbox(o,s,!n),u=this.getIds(),c=jp.fromPoints(h);for(let e of u){let i=this._inViewTiles.getTileById(e);if(i.holdingForSymbolFade())continue;let o=n?[i.tileID]:[i.tileID.unwrapTo(-1),i.tileID.unwrapTo(0)],s=2**(a.zoom-i.tileID.overscaledZ),u=t*i.queryPadding*ne/i.tileSize/s;for(let e of o){let t=c.map((t=>e.getTilePoint(new zp(t.x,t.y))));if(t.expandBy(u),t.intersects(p_)){let t=l.map((t=>e.getTilePoint(t))),a=h.map((t=>e.getTilePoint(t)));r.push({tile:i,tileID:n?e:e.unwrapTo(0),queryGeometry:t,cameraQueryGeometry:a,scale:s})}}}return r}transformBbox(e,t,i){let r=e.map(t);if(i){let i=jp.fromPoints(e);i.shrinkBy(.001*Math.min(i.width(),i.height()));let a=i.map(t);jp.fromPoints(r).covers(a)||(r=r.map((e=>e.x>.5?new zp(e.x-1,e.y,e.z):e)))}return r}getVisibleCoordinates(e){let t=this.getRenderableIds(e).map((e=>this._inViewTiles.getTileById(e).tileID));return this.transform&&this.transform.populateCache(t),t}hasTransition(){return!!this._source.hasTransition()||d_(this._source.type)&&function(e,t){if(t<=0)return!1;let i=zm();for(let t of e.getAllTiles())if(t.fadeEndTime>=i)return!0;return!1}(this._inViewTiles,this._rasterFadeDuration)}setRasterFadeDuration(e){this._rasterFadeDuration=e}setFeatureState(e,t,i){e||=Np,this._state.updateState(e,t,i)}removeFeatureState(e,t,i){e||=Np,this._state.removeFeatureState(e,t,i)}getFeatureState(e,t){return e||=Np,this._state.getState(e,t)}
vendor: 15,802 bytes, line 2
2setDependencies(e,t,i){let r=this._inViewTiles.getTileById(e);r&&r.setDependencies(t,i)}reloadTilesForDependencies(e,t){for(let i of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(i).hasDependency(e,t)&&this._reloadTile(i,"reloading");this._outOfViewCache.filter((i=>!i.hasDependency(e,t)))}areTilesLoaded(){for(let e of this._inViewTiles.getAllTiles())if("loaded"!==e.state&&"errored"!==e.state)return!1;return!0}},w_=class{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let e=1;e<this.points.length;e++)this._distances[e]=this._distances[e-1]+this.points[e].dist(this.points[e-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(e){if(1===this.points.length)return this.points[0];e=Ee(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,n=this._distances[a],o=i-n,s=o>0?(r-n)/o:0;return this.points[a].mult(1-s).add(this.points[t].mult(s))}};function T_(e,t){let i=!0;return"always"===e||("never"===e||"never"===t)&&(i=!1),i}var S_=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 e=0;e<this.xCellCount*this.yCellCount;e++)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,n){this.boxCells[a].push(n)}_insertCircleCell(e,t,i,r,a,n){this.circleCells[a].push(n)}_query(e,t,i,r,a,n,o){if(i<0||e>this.width||r<0||t>this.height)return[];let s=[];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 e=0;e<this.boxKeys.length;e++)s.push({key:this.boxKeys[e],x1:this.bboxes[4*e],y1:this.bboxes[4*e+1],x2:this.bboxes[4*e+2],y2:this.bboxes[4*e+3]});for(let e=0;e<this.circleKeys.length;e++){let t=this.circles[3*e],i=this.circles[3*e+1],r=this.circles[3*e+2];s.push({key:this.circleKeys[e],x1:t-r,y1:i-r,x2:t+r,y2:i+r})}}else{let l={hitTest:a,overlapMode:n,seenUids:{box:{},circle:{}}};this._forEachCell(e,t,i,r,this._queryCell,s,l,o)}return s}query(e,t,i,r){return this._query(e,t,i,r,!1,null)}hitTest(e,t,i,r,a,n){return this._query(e,t,i,r,!0,a,n).length>0}hitTestCircle(e,t,i,r,a){let n=e-i,o=e+i,s=t-i,l=t+i;if(o<0||n>this.width||l<0||s>this.height)return!1;let h=[],u={hitTest:!0,overlapMode:r,circle:{x:e,y:t,radius:i},seenUids:{box:{},circle:{}}};return this._forEachCell(n,s,o,l,this._queryCellCircle,h,u,a),h.length>0}_queryCell(e,t,i,r,a,n,o,s){let{seenUids:l,hitTest:h,overlapMode:u}=o,c=this.boxCells[a],p=1e-6;if(null!==c){let a=this.bboxes;for(let o of c)if(!l.box[o]){l.box[o]=!0;let c=4*o,d=this.boxKeys[o];if(e<=a[c+2]+p&&t<=a[c+3]+p&&i>=a[c+0]-p&&r>=a[c+1]-p&&(!s||s(d))&&(!h||!T_(u,d.overlapMode))&&(n.push({key:d,x1:a[c],y1:a[c+1],x2:a[c+2],y2:a[c+3]}),h))return!0}}let d=this.circleCells[a];if(null!==d){let a=this.circles;for(let o of d)if(!l.circle[o]){l.circle[o]=!0;let c=3*o,p=this.circleKeys[o];if(this._circleAndRectCollide(a[c],a[c+1],a[c+2],e,t,i,r)&&(!s||s(p))&&(!h||!T_(u,p.overlapMode))){let e=a[c],t=a[c+1],i=a[c+2];if(n.push({key:p,x1:e-i,y1:t-i,x2:e+i,y2:t+i}),h)return!0}}}return!1}_queryCellCircle(e,t,i,r,a,n,o,s){let{circle:l,seenUids:h,overlapMode:u}=o,c=this.boxCells[a];if(null!==c){let e=this.bboxes;for(let t of c)if(!h.box[t]){h.box[t]=!0;let i=4*t,r=this.boxKeys[t];if(this._circleAndRectCollide(l.x,l.y,l.radius,e[i+0],e[i+1],e[i+2],e[i+3])&&(!s||s(r))&&!T_(u,r.overlapMode))return n.push(!0),!0}}let p=this.circleCells[a];if(null!==p){let e=this.circles;for(let t of p)if(!h.circle[t]){h.circle[t]=!0;let i=3*t,r=this.circleKeys[t];if(this._circlesCollide(e[i],e[i+1],e[i+2],l.x,l.y,l.radius)&&(!s||s(r))&&!T_(u,r.overlapMode))return n.push(!0),!0}}}_forEachCell(e,t,i,r,a,n,o,s){let l=this._convertToXCellCoord(e),h=this._convertToYCellCoord(t),u=this._convertToXCellCoord(i),c=this._convertToYCellCoord(r);for(let p=l;p<=u;p++)for(let l=h;l<=c;l++){let h=this.xCellCount*l+p;if(a.call(this,e,t,i,r,h,n,o,s))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,n){let o=r-e,s=a-t,l=i+n;return l*l>o*o+s*s}_circleAndRectCollide(e,t,i,r,a,n,o){let s=(n-r)/2,l=Math.abs(e-(r+s));if(l>s+i)return!1;let h=(o-a)/2,u=Math.abs(t-(a+h));if(u>h+i)return!1;if(l<=s||u<=h)return!0;let c=l-s,p=u-h;return c*c+p*p<=i*i}};function P_(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,n=t[4]*i,o=t[8]*r,s=t[1]*i,l=t[5]*i,h=t[9]*r,u=t[2]*i,c=t[6]*i,p=t[10]*r;e[0]=a,e[1]=n,e[2]=o,e[4]=s,e[5]=l,e[6]=h,e[8]=u,e[9]=c,e[10]=p;let d=t[12],f=t[13],m=t[14];return e[12]=-a*d-s*f-u*m,e[13]=-n*d-l*f-c*m,e[14]=-o*d-h*f-p*m,e[3]=0,e[7]=0,e[11]=0,e[15]=1,e}const E_=x();function C_(e,t,i){let r=x();if(!e){let{vecSouth:e,vecEast:i}=I_(t),a=Pm();a[0]=i[0],a[1]=i[1],a[2]=e[0],a[3]=e[1],function(e,t){var i=t[0],r=t[1],a=t[2],n=t[3],o=i*n-a*r;o&&(o=1/o,e[0]=n*o,e[1]=-r*o,e[2]=-a*o,e[3]=i*o)}(a,a),r[0]=a[0],r[1]=a[1],r[4]=a[2],r[5]=a[3]}return E(r,r,[1/i,1/i,1]),r}function M_(e,t,i,r){if(e){let e=x();if(!t){let{vecSouth:t,vecEast:r}=I_(i);e[0]=r[0],e[1]=r[1],e[4]=t[0],e[5]=t[1]}return E(e,e,[r,r,1]),e}return i.pixelsToClipSpaceMatrix}function I_(e){let t=Math.cos(e.rollInRadians),i=Math.sin(e.rollInRadians),r=Math.cos(e.pitchInRadians),a=Math.cos(e.bearingInRadians),n=Math.sin(e.bearingInRadians),o=Q();o[0]=-a*r*i-n*t,o[1]=-n*r*i+a*t;let s=ie(o);s<1e-9?re(o):te(o,o,1/s);let l=Q();l[0]=a*r*t-n*i,l[1]=n*r*t+a*i;let h=ie(l);return h<1e-9?re(l):te(l,l,1/h),{vecEast:l,vecSouth:o}}function A_(e,t,i,r){let a;r?(a=[e,t,r(e,t),1],H(a,a,i)):(a=[e,t,0,1],W_(a,a,i));let n=a[3];return{point:new d(a[0]/n,a[1]/n),signedDistanceFromCamera:n,isOccluded:!1}}function z_(e,t){return.5+e/t*.5}function k_(e,t){return e.x>=-t[0]&&e.x<=t[0]&&e.y>=-t[1]&&e.y<=t[1]}function D_(e,t,i,r,a,n,o,s,l,h,u,c,p){let f=i?e.textSizeData:e.iconSizeData,m=Jc(f,t.transform.zoom),g=[256/t.width*2+1,256/t.height*2+1],_=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;_.clear();let y=e.lineVertexArray,v=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,x=t.transform.width/t.transform.height,b=!1;for(let i=0;i<v.length;i++){let w=v.get(i);if(w.hidden||2===w.writingMode&&!b){Z_(w.numGlyphs,_);continue}b=!1;let T=new d(w.anchorX,w.anchorY),S={getElevation:p,pitchedLabelPlaneMatrix:r,lineVertexArray:y,pitchWithMap:n,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:t.transform,tileAnchorPoint:T,unwrappedTileID:l,width:h,height:u,translation:c},P=N_(w.anchorX,w.anchorY,S);if(!k_(P.point,g)){Z_(w.numGlyphs,_);continue}let E=P.signedDistanceFromCamera,C=z_(t.transform.cameraToCenterDistance,E),M=Kc(f,m,w),I=n?M*t.transform.getPitchedTextCorrection(w.anchorX,w.anchorY,l)/C:M*C,A=F_({projectionContext:S,pitchedLabelPlaneMatrixInverse:a,symbol:w,fontSize:I,flip:!1,keepUpright:o,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:_,aspectRatio:x,rotateToLine:s});b=A.useVertical,(A.notEnoughRoom||b||A.needsFlipping&&F_({projectionContext:S,pitchedLabelPlaneMatrixInverse:a,symbol:w,fontSize:I,flip:!0,keepUpright:o,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:_,aspectRatio:x,rotateToLine:s}).notEnoughRoom)&&Z_(w.numGlyphs,_)}i?e.text.dynamicLayoutVertexBuffer.updateData(_):e.icon.dynamicLayoutVertexBuffer.updateData(_)}function R_(e,t,i,r,a,n,o,s){let l=n.glyphStartIndex+n.numGlyphs,h=n.lineStartIndex,u=n.lineStartIndex+n.lineLength,c=t.getoffsetX(n.glyphStartIndex),p=t.getoffsetX(l-1),d=U_(e*c,i,r,a,n.segment,h,u,s,o);if(!d)return null;let f=U_(e*p,i,r,a,n.segment,h,u,s,o);return!f||s.projectionCache.anyProjectionOccluded?null:{first:d,last:f}}function L_(e,t,i,r){return 1===e&&Math.abs(i.y-t.y)>Math.abs(i.x-t.x)*r?{useVertical:!0}:(2===e?t.y<i.y:t.x>i.x)?{needsFlipping:!0}:null}function F_(e){let t,{projectionContext:i,pitchedLabelPlaneMatrixInverse:r,symbol:a,fontSize:n,flip:o,keepUpright:s,glyphOffsetArray:l,dynamicLayoutVertexArray:h,aspectRatio:u,rotateToLine:c}=e,p=n/24,f=a.lineOffsetX*p,m=a.lineOffsetY*p;if(a.numGlyphs>1){let e=a.glyphStartIndex+a.numGlyphs,n=a.lineStartIndex,h=a.lineStartIndex+a.lineLength,d=R_(p,l,f,m,o,a,c,i);if(!d)return{notEnoughRoom:!0};let g=j_(d.first.point.x,d.first.point.y,i,r),_=j_(d.last.point.x,d.last.point.y,i,r);if(s&&!o){let e=L_(a.writingMode,g,_,u);if(e)return e}t=[d.first];for(let r=a.glyphStartIndex+1;r<e-1;r++){let e=U_(p*l.getoffsetX(r),f,m,o,a.segment,n,h,i,c);if(!e)return{notEnoughRoom:!0};t.push(e)}t.push(d.last)}else{if(s&&!o){let e=V_(i.tileAnchorPoint.x,i.tileAnchorPoint.y,i).point,t=a.lineStartIndex+a.segment+1,n=new d(i.lineVertexArray.getx(t),i.lineVertexArray.gety(t)),o=V_(n.x,n.y,i),s=o.signedDistanceFromCamera>0?o.point:B_(i.tileAnchorPoint,n,e,1,i),l=j_(e.x,e.y,i,r),h=j_(s.x,s.y,i,r),c=L_(a.writingMode,l,h,u);if(c)return c}let e=U_(p*l.getoffsetX(a.glyphStartIndex),f,m,o,a.segment,a.lineStartIndex,a.lineStartIndex+a.lineLength,i,c);if(!e||i.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};t=[e]}for(let e of t)ip(h,e.point,e.angle);return{}}function B_(e,t,i,r,a){let n=e.add(e.sub(t)._unit()),o=V_(n.x,n.y,a).point,s=i.sub(o);return i.add(s._mult(r/s.mag()))}function O_(e,t,i){let r=t.projectionCache;if(r.projections[e])return r.projections[e];let a=new d(t.lineVertexArray.getx(e),t.lineVertexArray.gety(e)),n=V_(a.x,a.y,t);if(n.signedDistanceFromCamera>0)return r.projections[e]=n.point,r.anyProjectionOccluded||=n.isOccluded,n.point;let o=e-i.direction,s=0===i.distanceFromAnchor?t.tileAnchorPoint:new d(t.lineVertexArray.getx(o),t.lineVertexArray.gety(o)),l=i.absOffsetX-i.distanceFromAnchor+1;return B_(s,a,i.previousVertex,l,t)}function V_(e,t,i){let r,a=e+i.translation[0],n=t+i.translation[1];return i.pitchWithMap?(r=A_(a,n,i.pitchedLabelPlaneMatrix,i.getElevation),r.isOccluded=!1):(r=i.transform.projectTileCoordinates(a,n,i.unwrappedTileID,i.getElevation),r.point.x=(.5*r.point.x+.5)*i.width,r.point.y=(.5*-r.point.y+.5)*i.height),r}function j_(e,t,i,r){if(i.pitchWithMap){let a=[e,t,0,1];return H(a,a,r),i.transform.projectTileCoordinates(a[0]/a[3],a[1]/a[3],i.unwrappedTileID,i.getElevation).point}return{x:e/i.width*2-1,y:1-t/i.height*2}}function N_(e,t,i){return i.transform.projectTileCoordinates(e,t,i.unwrappedTileID,i.getElevation)}function q_(e,t,i){return e._unit()._perp()._mult(t*i)}function $_(e,t,i,r,a,n,o,s,l){if(s.projectionCache.offsets[e])return s.projectionCache.offsets[e];let h=i.add(t);if(e+l.direction<r||e+l.direction>=a)return s.projectionCache.offsets[e]=h,h;let u=O_(e+l.direction,s,l),c=q_(u.sub(i),o,l.direction),p=i.add(c),f=u.add(c);return s.projectionCache.offsets[e]=function(e,t,i,r){let a=t.y-e.y,n=t.x-e.x,o=r.y-i.y,s=r.x-i.x,l=o*n-s*a;if(0===l)return null;let h=(s*(e.y-i.y)-o*(e.x-i.x))/l;return new d(e.x+h*n,e.y+h*a)}(n,h,p,f)||h,s.projectionCache.offsets[e]}function U_(e,t,i,r,a,n,o,s,l){let h=r?e-t:e+t,u=h>0?1:-1,c=0;r&&(u*=-1,c=Math.PI),u<0&&(c+=Math.PI);let p,d=u>0?n+a:n+a+1;s.projectionCache.cachedAnchorPoint?p=s.projectionCache.cachedAnchorPoint:(p=V_(s.tileAnchorPoint.x,s.tileAnchorPoint.y,s).point,s.projectionCache.cachedAnchorPoint=p);let f,m,g,_=p,y=p,v=0,x=0,b=Math.abs(h),w=[];for(;v+x<=b;){if(d+=u,d<n||d>=o)return null;v+=x,y=_,m=f;let e={absOffsetX:b,direction:u,distanceFromAnchor:v,previousVertex:y};if(_=O_(d,s,e),0===i)w.push(y),g=_.sub(y);else{let t,r=_.sub(y);t=0===r.mag()?q_(O_(d+u,s,e).sub(_),i,u):q_(r,i,u),m||=y.add(t),f=$_(d,t,_,n,o,m,i,s,e),w.push(m),g=f.sub(m)}x=g.mag()}let T=(b-v)/x,S=g._mult(T)._add(m||y),P=c+Math.atan2(_.y-y.y,_.x-y.x);return w.push(S),{point:S,angle:l?P:0,path:w}}const G_=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Z_(e,t){for(let i=0;i<e;i++){let e=t.length;t.resize(e+4),t.float32.set(G_,3*e)}}function W_(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}var H_=class{constructor(e,t=new S_(e.width+200,e.height+200,25),i=new S_(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,n,o,s,l,h,u,c){let p,d=e.anchorPointX+s[0],f=e.anchorPointY+s[1],m=this.projectAndGetPerspectiveRatio(d,f,a,h,c),g=i*m.perspectiveRatio;if(n||o)p=this._projectCollisionBox(e,g,r,a,n,o,s,m,h,u,c);else{let t=m.x+(u?u.x*g:0),i=m.y+(u?u.y*g:0);p={allPointsOccluded:!1,box:[t+e.x1*g,i+e.y1*g,t+e.x2*g,i+e.y2*g]}}let[_,y,v,x]=p.box,b=n?p.allPointsOccluded:m.isOccluded,w=b;return w||=m.perspectiveRatio<this.perspectiveRatioCutoff,w||=!this.isInsideGrid(_,y,v,x),w||"always"!==t&&this.grid.hitTest(_,y,v,x,t,l)?{box:[_,y,v,x],placeable:!1,offscreen:!1,occluded:b}:{box:[_,y,v,x],placeable:!0,offscreen:this.isOffscreen(_,y,v,x),occluded:b}}placeCollisionCircles(e,t,i,r,a,n,o,s,l,h,u,c,p,f){let m=[],g=new d(t.anchorX,t.anchorY),_=this.getPerspectiveRatio(g.x,g.y,n,f),y=(l?a*this.transform.getPitchedTextCorrection(t.anchorX,t.anchorY,n)/_:a*_)/24,v=t.lineOffsetX*y,x=t.lineOffsetY*y,b={getElevation:f,pitchedLabelPlaneMatrix:o,lineVertexArray:i,pitchWithMap:l,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:g,unwrappedTileID:n,width:this.transform.width,height:this.transform.height,translation:p},w=R_(y,r,v,x,!1,t,!1,b),T=!1,S=!1,P=!0;if(w){let t=.5*u*_+c,i=new d(-100,-100),r=new d(this.screenRightBoundary,this.screenBottomBoundary),a=new w_,n=w.first,o=w.last,p=[];for(let e=n.path.length-1;e>=1;e--)p.push(n.path[e]);for(let e=1;e<o.path.length;e++)p.push(o.path[e]);let f=2.5*t;if(l){let e=this.projectPathToScreenSpace(p,b);p=e.some((e=>e.signedDistanceFromCamera<=0))?[]:e.map((e=>e.point))}let g=[];if(p.length>0){let e=p[0].clone(),t=p[0].clone();for(let i=1;i<p.length;i++)e.x=Math.min(e.x,p[i].x),e.y=Math.min(e.y,p[i].y),t.x=Math.max(t.x,p[i].x),t.y=Math.max(t.y,p[i].y);g=e.x>=i.x&&t.x<=r.x&&e.y>=i.y&&t.y<=r.y?[p]:t.x<i.x||e.x>r.x||t.y<i.y||e.y>r.y?[]:xm([p],i.x,i.y,r.x,r.y)}for(let i of g){a.reset(i,.25*t);let r=0;r=a.length<=.5*t?1:Math.ceil(a.paddedLength/f)+1;for(let i=0;i<r;i++){let n=i/Math.max(r-1,1),o=a.lerp(n),l=o.x+100,u=o.y+100;m.push(l,u,t,0);let c=l-t,p=u-t,d=l+t,f=u+t;if(P&&=this.isOffscreen(c,p,d,f),S||=this.isInsideGrid(c,p,d,f),"always"!==e&&this.grid.hitTestCircle(l,u,t,e,h)&&(T=!0,!s))return{circles:[],offscreen:!1,collisionDetected:T}}}}return{circles:!s&&T||!S||_<this.perspectiveRatioCutoff?[]:m,offscreen:P,collisionDetected:T}}projectPathToScreenSpace(e,t){return function(e){let t=0,i=0,r=0,a=0;for(let n=0;n<e.length;n++)e[n].isOccluded?(r=n+1,a=0):(a++,a>i&&(i=a,t=r));return e.slice(t,t+i)}(function(e,t){let i=E_;return function(e,t){let i=1/(t[0]*t[5]-t[1]*t[4]);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
2]=1/t[10],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1/t[15]}(i,t.pitchedLabelPlaneMatrix),e.map((e=>{let r=A_(e.x,e.y,i,t.getElevation),a=t.transform.projectTileCoordinates(r.point.x,r.point.y,t.unwrappedTileID,t.getElevation);return a.point.x=(.5*a.point.x+.5)*t.width,a.point.y=(.5*-a.point.y+.5)*t.height,a}))}(e,t))}queryRenderedSymbols(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};let t=[],i=new jp;for(let r of e){let e=new d(r.x+100,r.y+100);i.extend(e),t.push(e)}let{minX:r,minY:a,maxX:n,maxY:o}=i,s=this.grid.query(r,a,n,o).concat(this.ignoredGrid.query(r,a,n,o)),l={},h={};for(let e of s){let i=e.key;void 0===l[i.bucketInstanceId]&&(l[i.bucketInstanceId]={}),!l[i.bucketInstanceId][i.featureIndex]&&Kl(t,[new d(e.x1,e.y1),new d(e.x2,e.y1),new d(e.x2,e.y2),new d(e.x1,e.y2)])&&(l[i.bucketInstanceId][i.featureIndex]=!0,void 0===h[i.bucketInstanceId]&&(h[i.bucketInstanceId]=[]),h[i.bucketInstanceId].push(i.featureIndex))}return h}insertCollisionBox(e,t,i,r,a,n){let o={bucketInstanceId:r,featureIndex:a,collisionGroupID:n,overlapMode:t};(i?this.ignoredGrid:this.grid).insert(o,e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,i,r,a,n){let o=i?this.ignoredGrid:this.grid,s={bucketInstanceId:r,featureIndex:a,collisionGroupID:n,overlapMode:t};for(let t=0;t<e.length;t+=4)o.insertCircle(s,e[t],e[t+1],e[t+2])}projectAndGetPerspectiveRatio(e,t,i,r,a){if(a){let i;r?(i=[e,t,r(e,t),1],H(i,i,a)):(i=[e,t,0,1],W_(i,i,a));let n=i[3];return{x:(i[0]/n+1)/2*this.transform.width+100,y:(-i[1]/n+1)/2*this.transform.height+100,perspectiveRatio:.5+this.transform.cameraToCenterDistance/n*.5,isOccluded:!1,signedDistanceFromCamera:n}}{let a=this.transform.projectTileCoordinates(e,t,i,r);return{x:(a.point.x+1)/2*this.transform.width+100,y:(1-a.point.y)/2*this.transform.height+100,perspectiveRatio:.5+this.transform.cameraToCenterDistance/a.signedDistanceFromCamera*.5,isOccluded:a.isOccluded,signedDistanceFromCamera:a.signedDistanceFromCamera}}}getPerspectiveRatio(e,t,i,r){let a=this.transform.projectTileCoordinates(e,t,i,r);return.5+this.transform.cameraToCenterDistance/a.signedDistanceFromCamera*.5}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=w([]);return P(e,e,[-100,-100,0]),e}_projectCollisionBox(e,t,i,r,a,n,o,s,l,h,u){let c=1,p=0,f=0,m=1,g=e.anchorPointX+o[0],_=e.anchorPointY+o[1];if(n&&!a){let e=this.projectAndGetPerspectiveRatio(g+1,_,r,l,u),t=e.x-s.x,i=e.y-s.y,a=Math.atan(i/t)+(t<0?Math.PI:0),n=Math.sin(a),o=Math.cos(a);c=o,p=n,f=-n,m=o}else if(!n&&a){let e=I_(this.transform);c=e.vecEast[0],p=e.vecEast[1],f=e.vecSouth[0],m=e.vecSouth[1]}let y=s.x,v=s.y,x=t;if(a&&(y=g,v=_,x=2**-(this.transform.zoom-i.overscaledZ),x*=this.transform.getPitchedTextCorrection(g,_,r),!h)){x*=Ee(.5+s.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4)}h&&(y+=c*h.x*x+f*h.y*x,v+=p*h.x*x+m*h.y*x);let b=e.x1*x,w=e.x2*x,T=(b+w)/2,S=e.y1*x,P=e.y2*x,E=(S+P)/2,C=[{offsetX:b,offsetY:S},{offsetX:T,offsetY:S},{offsetX:w,offsetY:S},{offsetX:w,offsetY:E},{offsetX:w,offsetY:P},{offsetX:T,offsetY:P},{offsetX:b,offsetY:P},{offsetX:b,offsetY:E}],M=[];for(let{offsetX:e,offsetY:t}of C)M.push(new d(y+c*e+f*t,v+p*e+m*t));let I=!1;if(a){let e=M.map((e=>this.projectAndGetPerspectiveRatio(e.x,e.y,r,l,u)));I=e.some((e=>!e.isOccluded)),M=e.map((e=>new d(e.x,e.y)))}else I=!0;return{box:Te(M),allPointsOccluded:!I}}},X_=class{constructor(e,t,i,r){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):r&&i?1:0,this.placed=i}isHidden(){return 0===this.opacity&&!this.placed}},Y_=class{constructor(e,t,i,r,a){this.text=new X_(e?e.text:null,t,i,a),this.icon=new X_(e?e.icon:null,t,r,a)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}},K_=class{constructor(e,t,i){this.text=e,this.icon=t,this.skipFade=i}},J_=class{constructor(e,t,i,r,a){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=i,this.bucketIndex=r,this.tileID=a}},Q_=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:e=>e.collisionGroupID===t}}return this.collisionGroups[e]}};function ey(e,t,i,r,a){let{horizontalAlign:n,verticalAlign:o}=Xc(e),s=-(o-.5)*i;return new d(-(n-.5)*t+r[0]*a,s+r[1]*a)}var ty=class{constructor(e,t,i,r,a){this.transform=e.clone(),this.terrain=t,this.collisionIndex=new H_(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=i,this.retainedQueryData={},this.collisionGroups=new Q_(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),n=i.latestFeatureIndex;if(!a||!n||t.id!==a.layerIds[0])return;let o=i.collisionBoxArray,s=a.layers[0].layout,l=a.layers[0].paint,h=2**(this.transform.zoom-i.tileID.overscaledZ
vendor: 4,370 bytes, line 2
2),u=i.tileSize/ne,c=i.tileID.toUnwrapped(),p="map"===s.get("text-rotation-alignment"),d=oe(i,1,this.transform.zoom),f=de(this.collisionIndex.transform,i,l.get("text-translate"),l.get("text-translate-anchor")),m=de(this.collisionIndex.transform,i,l.get("icon-translate"),l.get("icon-translate-anchor")),g=C_(p,this.transform,d);this.retainedQueryData[a.bucketInstanceId]=new J_(a.bucketInstanceId,n,a.sourceLayerIndex,a.index,i.tileID);let _={bucket:a,layout:s,translationText:f,translationIcon:m,unwrappedTileID:c,pitchedLabelPlaneMatrix:g,scale:h,textPixelRatio:u,holdingForFade:i.holdingForSymbolFade(),collisionBoxArray:o,partiallyEvaluatedTextSize:Jc(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(r)for(let t of a.sortKeyRanges){let{sortKey:i,symbolInstanceStart:r,symbolInstanceEnd:a}=t;e.push({sortKey:i,symbolInstanceStart:r,symbolInstanceEnd:a,parameters:_})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:_})}attemptAnchorPlacement(e,t,i,r,a,n,o,s,l,h,u,c,p,d,f,m,g,_,y,v){let x=wm[e.textAnchor],b=[e.textOffset0,e.textOffset1],w=ey(x,i,r,b,a),T=this.collisionIndex.placeCollisionBox(t,c,s,l,h,o,n,m,u.predicate,y,w,v);if((!_||this.collisionIndex.placeCollisionBox(_,c,s,l,h,o,n,g,u.predicate,y,w,v).placeable)&&T.placeable){let e;if(this.prevPlacement?.variableOffsets[p.crossTileID]&&this.prevPlacement?.placements[p.crossTileID]?.text&&(e=this.prevPlacement.variableOffsets[p.crossTileID].anchor),0===p.crossTileID)throw Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[p.crossTileID]={textOffset:b,width:i,height:r,anchor:x,textBoxScale:a,prevAnchor:e},this.markUsedJustification(d,x,p,f),d.allowVerticalPlacement&&(this.markUsedOrientation(d,f,p),this.placedOrientations[p.crossTileID]=f),{shift:w,placedGlyphBoxes:T}}}placeLayerBucketPart(e,t,i){let{bucket:r,layout:a,translationText:n,translationIcon:o,unwrappedTileID:s,pitchedLabelPlaneMatrix:l,textPixelRatio:h,holdingForFade:u,collisionBoxArray:c,partiallyEvaluatedTextSize:p,collisionGroup:d}=e.parameters,f=a.get("text-optional"),m=a.get("icon-optional"),g=Qc(a,"text-overlap","text-allow-overlap"),_="always"===g,y=Qc(a,"icon-overlap","icon-allow-overlap"),v="always"===y,x="map"===a.get("text-rotation-alignment"),b="map"===a.get("text-pitch-alignment"),w="none"!==a.get("icon-text-fit"),T="viewport-y"===a.get("symbol-z-order"),S=_&&(v||!r.hasIconData()||m),P=v&&(_||!r.hasTextData()||f);!r.collisionArrays&&c&&r.deserializeCollisionBoxes(c);let E=this.retainedQueryData[r.bucketInstanceId].tileID,C=this._getTerrainElevationFunc(E),M=this.transform.getFastPathSimpleProjectionMatrix(E),I=(e,c,v)=>{if(t[e.crossTileID])return;if(u)return void(this.placements[e.crossTileID]=new K_(!1,!1,!1));let T=!1,I=!1,A=!0,z=null,k={box:null,placeable:!1,offscreen:null,occluded:!1},D={box:null,placeable:!1,offscreen:null},R=null,L=null,F=null,B=0,O=0,V=0;c.textFeatureIndex?B=c.textFeatureIndex:e.useRuntimeCollisionCircles&&(B=e.featureIndex),c.verticalTextFeatureIndex&&(O=c.verticalTextFeatureIndex);let j=c.textBox;if(j){let t=t=>{let i=1;if(r.allowVerticalPlacement&&!t&&this.prevPlacement){let t=this.prevPlacement.placedOrientations[e.crossTileID];t&&(this.placedOrientations[e.crossTileID]=t,i=t,this.markUsedOrientation(r,i,e))}return i},a=(t,i)=>{if(r.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&c.verticalTextBox){for(let e of r.writingModes)if(2===e?(k=i(),D=k):k=t(),k?.placeable)break}else k=t()},l=e.textAnchorOffsetStartIndex,u=e.textAnchorOffsetEndIndex;if(u===l){let i=(t,i)=>{let a=this.collisionIndex.placeCollisionBox(t,g,h,E,s,b,x,n,d.predicate,C,void 0,M);return a?.placeable&&(this.markUsedOrientation(r,i,e),this.placedOrientations[e.crossTileID]=i),a};a((()=>i(j,1)),(()=>{let t=c.verticalTextBox;return r.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&t?i(t,2):{box:null,offscreen:null}})),t(k?.placeable)}else{let p=wm[this.prevPlacement?.variableOffsets[e.crossTileID]?.anchor],f=(t,a,c)=>{let f=t.x2-t.x1,m=t.y2-t.y1,_=e.textBoxScale,v=w&&"never"===y?a:null,S=null,P="never"===g?1:2,I="never";p&&P++;for(let i=0;i<P;i++){for(let i=l;i<u;i++){let a=r.textAnchorOffsets.get(i);if(p&&a.textAnchor!==p)continue;let l=this.attemptAnchorPlacement(a,t,f,m,_,x,b,h,E,s,d,I,e,r,c,n,o,v,C);if(l&&(S=l.placedGlyphBoxes,S?.placeable))return T=!0,z=l.shift,
2S}p?p=null:I=g}return i&&!S&&(S={box:this.collisionIndex.placeCollisionBox(j,"always",h,E,s,b,x,n,d.predicate,C,void 0,M).box,offscreen:!1,placeable:!1,occluded:!1}),S};a((()=>f(j,c.iconBox,1)),(()=>{let t=c.verticalTextBox,i=k?.placeable;return r.allowVerticalPlacement&&!i&&e.numVerticalGlyphVertices>0&&t?f(t,c.verticalIconBox,2):{box:null,occluded:!0,offscreen:null}})),k&&(T=k.placeable,A=k.offscreen);let m=t(k?.placeable);if(!T&&this.prevPlacement){let t=this.prevPlacement.variableOffsets[e.crossTileID];t&&(this.variableOffsets[e.crossTileID]=t,this.markUsedJustification(r,t.anchor,e,m))}}}if(R=k,T=R?.placeable,A=R?.offscreen,e.useRuntimeCollisionCircles&&e.centerJustifiedTextSymbolIndex>=0){let t=r.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),o=Kc(r.textSizeData,p,t),h=a.get("text-padding"),u=e.collisionCircleDiameter;L=this.collisionIndex.placeCollisionCircles(g,t,r.lineVertexArray,r.glyphOffsetArray,o,s,l,i,b,d.predicate,u,h,n,C),L.circles.length&&L.collisionDetected&&!i&&je("Collisions detected, but collision boxes are not shown"),T=_||L.circles.length>0&&!L.collisionDetected,A&&=L.offscreen}if(c.iconFeatureIndex&&(V=c.iconFeatureIndex),c.iconBox){let e=e=>this.collisionIndex.placeCollisionBox(e,y,h,E,s,b,x,o,d.predicate,C,w&&z?z:void 0,M);D&&D.placeable&&c.verticalIconBox?(F=e(c.verticalIconBox),I=F.placeable):(F=e(c.iconBox),I=F.placeable),A&&=F.offscreen}let N=f||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,q=m||0===e.numIconVertices;N||q?q?N||(I&&=T):T=I&&T:I=T=I&&T;let $=T&&R.placeable,U=I&&F.placeable;if($&&(D&&D.placeable&&O?this.collisionIndex.insertCollisionBox(R.box,g,a.get("text-ignore-placement"),r.bucketInstanceId,O,d.ID):this.collisionIndex.insertCollisionBox(R.box,g,a.get("text-ignore-placement"),r.bucketInstanceId,B,d.ID)),U&&this.collisionIndex.insertCollisionBox(F.box,y,a.get("icon-ignore-placement"),r.bucketInstanceId,V,d.ID),L&&T&&this.collisionIndex.insertCollisionCircles(L.circles,g,a.get("text-ignore-placement"),r.bucketInstanceId,B,d.ID),i&&this.storeCollisionData(r.bu
vendor: 13,118 bytes, line 2
2cketInstanceId,v,c,R,F,L),0===e.crossTileID)throw Error("symbolInstance.crossTileID can't be 0");if(0===r.bucketInstanceId)throw Error("bucket.bucketInstanceId can't be 0");let G=(T||S)&&!R?.occluded,Z=(I||P)&&!F?.occluded;this.placements[e.crossTileID]=new K_(G,Z,A||r.justReloaded),t[e.crossTileID]=!0};if(T){if(0!==e.symbolInstanceStart)throw Error("bucket.bucketInstanceId should be 0");let t=r.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let e=t.length-1;e>=0;--e){let i=t[e];I(r.symbolInstances.get(i),r.collisionArrays[i],i)}}else for(let t=e.symbolInstanceStart;t<e.symbolInstanceEnd;t++)I(r.symbolInstances.get(t),r.collisionArrays[t],t);r.justReloaded=!1}storeCollisionData(e,t,i,r,a,n){if(i.textBox||i.iconBox){let n,o;this.collisionBoxArrays.has(e)?n=this.collisionBoxArrays.get(e):(n=new Map,this.collisionBoxArrays.set(e,n)),n.has(t)?o=n.get(t):(o={text:null,icon:null},n.set(t,o)),i.textBox&&(o.text=r.box),i.iconBox&&(o.icon=a.box)}if(n){let t=this.collisionCircleArrays[e];void 0===t&&(t=this.collisionCircleArrays[e]=[]);for(let e=0;e<n.circles.length;e+=4)t.push(n.circles[e+0]-100),t.push(n.circles[e+1]-100),t.push(n.circles[e+2]),t.push(+!!n.collisionDetected)}}markUsedJustification(e,t,i,r){let a,n={left:i.leftJustifiedTextSymbolIndex,center:i.centerJustifiedTextSymbolIndex,right:i.rightJustifiedTextSymbolIndex};a=2===r?i.verticalPlacedTextSymbolIndex:n[Tm(t)];let o=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex,i.verticalPlacedTextSymbolIndex];for(let t of o)t>=0&&(e.text.placedSymbolArray.get(t).crossTileID=a>=0&&t!==a?0:i.crossTileID)}markUsedOrientation(e,t,i){let r=1===t||3===t?t:0,a=2===t?t:0,n=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];for(let t of n)e.text.placedSymbolArray.get(t).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:{},n=t?t.variableOffsets:{},o=t?t.placedOrientations:{};for(let e in this.placements){let t=this.placements[e],n=a[e];n?(this.opacities[e]=new Y_(n,r,t.text,t.icon),i||=t.text!==n.text.placed,i||=t.icon!==n.icon.placed):(this.opacities[e]=new Y_(null,r,t.text,t.icon,t.skipFade),i||=t.text||t.icon)}for(let e in a){let t=a[e];if(!this.opacities[e]){let a=new Y_(t,r,!1,!1);a.isHidden()||(this.opacities[e]=a,i||=t.text.placed,i||=t.icon.placed)}}for(let e in n)!this.variableOffsets[e]&&this.opacities[e]&&!this.opacities[e].isHidden()&&(this.variableOffsets[e]=n[e]);for(let e in o)!this.placedOrientations[e]&&this.opacities[e]&&!this.opacities[e].isHidden()&&(this.placedOrientations[e]=o[e]);if(t&&void 0===t.lastPlacementChangeTime)throw Error("Last placement time for previous placement is not defined");i?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){let i={};for(let r of t){let t=r.getBucket(e);t&&r.latestFeatureIndex&&e.id===t.layerIds[0]&&this.updateBucketOpacities(t,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],n=a.layout,o=new Y_(null,0,!1,!1,!0),s=n.get("text-allow-overlap"),l=n.get("icon-allow-overlap"),h=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),u="map"===n.get("text-rotation-alignment"),c="map"===n.get("text-pitch-alignment"),p="none"!==n.get("icon-text-fit"),f=new Y_(null,0,s&&(l||!e.hasIconData()||n.get("icon-optional")),l&&(s||!e.hasTextData()||n.get("text-optional")),!0);!e.collisionArrays&&r&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(r);let m=(e,t,i)=>{for(let r=0;r<t/4;r++)e.opacityVertexArray.emplaceBack(i);e.hasVisibleVertices||=i!==ly},g=this.collisionBoxArrays.get(e.bucketInstanceId);for(let t=0;t<e.symbolInstances.length;t++){let r=e.symbolInstances.get(t),{numHorizontalGlyphVertices:a,numVerticalGlyphVertices:n,crossTileID:s}=r,l=i[s],_=this.opacities[s];l?_=o:_||(_=f,this.opacities[s]=_),i[s]=!0;let y=a>0||n>0,v=r.numIconVertices>0,x=this.placedOrientations[r.crossTileID],b=2===x,w=1===x||3===x;if(y){let t=sy(_.text),i=b?ly:t;m(e.text,a,i);let o=w?ly:t;m(e.text,n,o);let s=_.text.isHidden(),l=[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex];for(let t of l)t>=0&&(e.text.placedSymbolArray.get(t).hidden=s||b?1:0);r.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).hidden=s||w?1:0);let h=this.variableOffsets[r.crossTileID];h&&this.markUsedJustification(e,h.anchor,r,x);let u=this.placedOrientations[r.crossTileID];u&&(this.markUsedJustification(e,"left",r,u),this.markUsedOrientation(e,u,r))}if(v){let t=sy(_.icon),i=!(p&&r.verticalPlacedIconSymbolIndex&&b);if(r.placedIconSymbolIndex>=0){let a=i?t:ly;m(e.icon,r.numIconVertices,a),e.icon.placedSymbolArray.get(r.placedIconSymbolIndex).hidden=_.icon.isHidden()}if(r.verticalPlacedIconSymbolIndex>=0){let a=i?ly:t;m(e.icon,r.numVerticalIconVertices,a),e.icon.placedSymbolArray.get(r.verticalPlacedIconSymbolIndex).hidden=_.icon.isHidden()}}let T=g?.has(t)?g.get(t):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){let i=e.collisionArrays[t];if(i){let t=new d(0,0);if(i.textBox||i.verticalTextBox){let r=!0;if(h){let e=this.variableOffsets[s];e?(t=ey(e.anchor,e.width,e.height,e.textOffset,e.textBoxScale),u&&t._rotate(c?-this.transform.bearingInRadians:this.transform.bearingInRadians)):r=!1}if(i.textBox||i.verticalTextBox){let a;i.textBox&&(a=b),i.verticalTextBox&&(a=w),iy(e.textCollisionBox.collisionVertexArray,_.text.placed,!r||a,T.text,t.x,t.y)}}if(i.iconBox||i.verticalIconBox){let r,a=!(w||!i.verticalIconBox);i.iconBox&&(r=a),i.verticalIconBox&&(r=!a),iy(e.iconCollisionBox.collisionVertexArray,_.icon.placed,r,T.icon,p?t.x:0,p?t.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 0===this.fadeDuration?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 iy(e,t,i,r,a,n){(!r||0===r.length)&&(r=[0,0,0,0]);let o=r[0]-100,s=r[1]-100,l=r[2]-100,h=r[3]-100;e.emplaceBack(+!!t,+!!i,a||0,n||0,o,s),e.emplaceBack(+!!t,+!!i,a||0,n||0,l,s),e.emplaceBack(+!!t,+!!i,a||0,n||0,l,h),e.emplaceBack(+!!t,+!!i,a||0,n||0,o,h)}const ry=2**25,ay=2**24,ny=2**17,oy=65536;function sy(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;let t=+!!e.placed,i=Math.floor(127*e.opacity);return i*ry+t*ay+i*ny+t*oy+512*i+256*t+2*i+t}const ly=0;var hy=class{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,t,i,r,a){let n=this._bucketParts;for(;this._currentTileIndex<e.length;){let i=e[this._currentTileIndex];if(t.getBucketParts(n,r,i,this._sortAcrossTiles),this._currentTileIndex++,a())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,n.sort(((e,t)=>e.sortKey-t.sortKey)));this._currentPartIndex<n.length;){let e=n[this._currentPartIndex];if(t.placeLayerBucketPart(e,this._seenCrossTileIDs,i),this._currentPartIndex++,a())return!0}return!1}},uy=class{constructor(e,t,i,r,a,n,o,s){this.placement=new ty(e,t,n,o,s),this._currentPlacementIndex=i.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=a,this._done=!1}isDone(){return this._done}continuePlacement(e,t,i){let r=zm(),a=()=>!this._forceFullPlacement&&zm()-r>2;for(;this._currentPlacementIndex>=0;){let r=t[e[this._currentPlacementIndex]],n=this.placement.collisionIndex.transform.zoom;if(cp(r)&&r.layout&&(!r.minzoom||r.minzoom<=n)&&(!r.maxzoom||r.maxzoom>n)){if(this._inProgressLayer||=new hy(r),this._inProgressLayer.continuePlacement(i[r.source],this.placement,this._showCollisionBoxes,r,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}};const cy=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],py=new Uint32Array(96);var dy=class e{static from(t){if(!t||void 0===t.byteLength||t.buffer)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[i,r]=new Uint8Array(t,0,2);if(219!==i)throw Error("Data does not appear to be in a KDBush format.");let a=r>>4;if(1!==a)throw Error(`Got v${a} data when expected v1.`);let n=cy[15&r];if(!n)throw Error("Unrecognized array type.");let[o]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new e(s,o,n,void 0,t)}constructor(e,t=64,i=Float64Array,r=ArrayBuffer,a){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let n=cy.indexOf(this.ArrayType),o=2*e*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-s%8)%8;if(n<0)throw Error(`Unexpected typed array class: ${i}.`);if(a)this.data=a,this.ids=new this.IndexArrayType(a,8,e),this.coords=new i(a,8+s+l,2*e),this._pos=2*e,this._finished=!0;else{let a=this.data=new r(8+o+s+l);this.ids=new this.IndexArrayType(a,8,e),this.coords=new i(a,8+s+l,2*e),this._pos=0,this._finished=!1,new Uint8Array(a,0,2).set([219,16+n]),new Uint16Array(a,2,1)[0]=t,new Uint32Array(a,4,1)[0]=e}}add(e,t){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=t,i}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return fy(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,i,r){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:n,nodeSize:o}=this;py[0]=0,py[1]=a.length-1,py[2]=0;let s=3,l=[];for(;s>0;){let h=py[--s],u=py[--s],c=py[--s];if(u-c<=o){for(let o=c;o<=u;o++){let s=n[2*o],h=n[2*o+1];s>=e&&s<=i&&h>=t&&h<=r&&l.push(a[o])}continue}let p=c+u>>1,d=n[2*p],f=n[2*p+1];d>=e&&d<=i&&f>=t&&f<=r&&l.push(a[p]),(0===h?e<=d:t<=f)&&(py[s++]=c,py[s++]=p-1,py[s++]=1-h),(0===h?i>=d:r>=f)&&(py[s++]=p+1,py[s++]=u,py[s++]=1-h)}return l}within(e,t,i){let r=[];return this.withinInto(e,t,i,r),r}withinInto(e,t,i,r){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:n,nodeSize:o}=this;py[0]=0,py[1]=a.length-1,py[2]=0;let s=3,l=0,h=i*i;for(;s>0;){let u=py[--s],c=py[--s],p=py[--s];if(c-p<=o){for(let i=p;i<=c;i++)yy(n[2*i],n[2*i+1],e,t)<=h&&(r[l++]=a[i]);continue}let d=p+c>>1,f=n[2*d],m=n[2*d+1];yy(f,m,e,t)<=h&&(r[l++]=a[d]),(0===u?e-i<=f:t-i<=m)&&(py[s++]=p,py[s++]=d-1,py[s++]=1-u),(0===u?e+i>=f:t+i>=m)&&(py[s++]=d+1,py[s++]=c,py[s++]=1-u)}return l}};function fy(e,t,i,r,a,n){if(a-r<=i)return;let o=r+a>>1;
vendor: 5,843 bytes, line 2
2my(e,t,o,r,a,n),fy(e,t,i,r,o-1,1-n),fy(e,t,i,o+1,a,1-n)}function my(e,t,i,r,a,n){for(;a>r;){if(a-r>600){let o=a-r+1,s=i-r+1,l=Math.log(o),h=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*h*(o-h)/o)*(s-o/2<0?-1:1);my(e,t,i,Math.max(r,Math.floor(i-s*h/o+u)),Math.min(a,Math.floor(i+(o-s)*h/o+u)),n)}let o=t[2*i+n],s=r,l=a;for(gy(e,t,r,i),t[2*a+n]>o&&gy(e,t,r,a);s<l;){for(gy(e,t,s,l),s++,l--;t[2*s+n]<o;)s++;for(;t[2*l+n]>o;)l--}t[2*r+n]===o?gy(e,t,r,l):(l++,gy(e,t,l,a)),l<=i&&(r=l+1),i<=l&&(a=l-1)}}function gy(e,t,i,r){_y(e,i,r),_y(t,2*i,2*r),_y(t,2*i+1,2*r+1)}function _y(e,t,i){let r=e[t];e[t]=e[i],e[i]=r}function yy(e,t,i,r){let a=e-i,n=t-r;return a*a+n*n}const vy=.03125;var xy=class{constructor(e,t,i){this.tileID=e,this.bucketInstanceId=i,this._symbolsByKey={};let r=new Map;for(let e=0;e<t.length;e++){let i=t.get(e),a=i.key,n=r.get(a);n?n.push(i):r.set(a,[i])}for(let[e,t]of r){let i={positions:t.map((e=>({x:Math.floor(e.anchorX*vy),y:Math.floor(e.anchorY*vy)}))),crossTileIDs:t.map((e=>e.crossTileID))};if(i.positions.length>128){let e=new dy(i.positions.length,16,Uint16Array);for(let{x:t,y:r}of i.positions)e.add(t,r);e.finish(),delete i.positions,i.index=e}this._symbolsByKey[e]=i}}getScaledCoordinates(e,t){let{x:i,y:r,z:a}=this.tileID.canonical,{x:n,y:o,z:s}=t.canonical,l=vy/2**(s-a),h=(n*ne+e.anchorX)*l,u=(o*ne+e.anchorY)*l,c=i*ne*vy,p=r*ne*vy;return{x:Math.floor(h-c),y:Math.floor(u-p)}}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 n=e.get(a);if(n.crossTileID)continue;let o=this._symbolsByKey[n.key];if(!o)continue;let s=this.getScaledCoordinates(n,t);if(o.index){let e=o.index.range(s.x-r,s.y-r,s.x+r,s.y+r).sort();for(let t of e){let e=o.crossTileIDs[t];if(!i[e]){i[e]=!0,n.crossTileID=e;break}}}else if(o.positions)for(let e=0;e<o.positions.length;e++){let t=o.positions[e],a=o.crossTileIDs[e];if(Math.abs(t.x-s.x)<=r&&Math.abs(t.y-s.y)<=r&&!i[a]){i[a]=!0,n.crossTileID=a;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((({crossTileIDs:e})=>e))}},by=class{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}},wy=class{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){let t=Math.round((e-this.lng)/360);if(0!==t)for(let e in this.indexes){let i=this.indexes[e],r={};for(let e in i){let a=i[e];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+t),r[a.tileID.key]=a}this.indexes[e]=r}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 e=0;e<t.symbolInstances.length;e++){t.symbolInstances.get(e).crossTileID=0}this.usedCrossTileIDs[e.overscaledZ]||={};let r=this.usedCrossTileIDs[e.overscaledZ];for(let i in this.indexes){let a=this.indexes[i];if(Number(i)>e.overscaledZ)for(let i in a){let n=a[i];n.tileID.isChildOf(e)&&n.findMatches(t.symbolInstances,e,r)}else{let n=a[e.scaledTo(Number(i)).key];n&&n.findMatches(t.symbolInstances,e,r)}}for(let e=0;e<t.symbolInstances.length;e++){let a=t.symbolInstances.get(e);a.crossTileID||(a.crossTileID=i.generate(),r[a.crossTileID]=!0)}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new xy(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(let i of t.getCrossTileIDsLists())for(let t of i)delete this.usedCrossTileIDs[e][t]}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}},Ty=class{constructor(){this.layerIndexes={},this.crossTileIDs=new by,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,i){let r=this.layerIndexes[e.id];void 0===r&&(r=this.layerIndexes[e.id]=new wy);let a=!1,n={};r.handleWrapJump(i);for(let i of t){let t=i.getBucket(e);e.id===t?.layerIds[0]&&(t.bucketInstanceId||=(this.maxBucketInstanceId+=1,this.maxBucketInstanceId),r.addBucket(i.tileID,t,this.crossTileIDs)&&(a=!0),n[t.bucketInstanceId]=!0)}return r.removeStaleBuckets(n)&&(a=!0),a}pruneUnusedLayers(e){let t={};for(let i of e)t[i]=!0;for(let e in this.layerIndexes)t[e]||delete this.layerIndexes[e]}},Sy="void main() {fragColor=vec4(1.0);}";const Py={prelude:Ey("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nout highp vec4 fragColor;","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 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\n);}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);
2return (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\n);}\n#ifdef TERRAIN3D\nuniform 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;\n#endif\nconst 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) {\n#ifdef TERRAIN3D\nhighp 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));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 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;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\n#ifdef GLOBE\nif ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}\n#endif\nvec2 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;\n#else\nreturn 0.0;\n#endif\n}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;"),projectionMercator:Ey("\nvoid 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:Ey("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\nuniform 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\n);}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));
2float 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\n);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:Ey("uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","layout(location=0) in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:Ey("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;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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);}"),circle:Ey("in vec3 v_data;flat in float v_visibility;\n#pragma maplibre: define highp vec4 color\n#pragma maplibre: define mediump float radius\n#pragma maplibre: define lowp float blur\n#pragma maplibre: define lowp float opacity\n#pragma maplibre: define highp vec4 stroke_color\n#pragma maplibre: define mediump float stroke_width\n#pragma maplibre: define lowp float stroke_opacity\nvoid main() {\n#pragma maplibre: initialize highp vec4 color\n#pragma maplibre: initialize mediump float radius\n#pragma maplibre: initialize lowp float blur\n#pragma maplibre: initialize lowp float opacity\n#pragma maplibre: initialize highp vec4 stroke_color\n#pragma maplibre: initialize mediump float stroke_width\n#pragma maplibre: initialize lowp float stroke_opacity\nvec2 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
2/(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;}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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;\n#pragma maplibre: define highp vec4 color\n#pragma maplibre: define mediump float radius\n#pragma maplibre: define lowp float blur\n#pragma maplibre: define lowp float opacity\n#pragma maplibre: define highp vec4 stroke_color\n#pragma maplibre: define mediump float stroke_width\n#pragma maplibre: define lowp float stroke_opacity\nvoid main(void) {\n#pragma maplibre: initialize highp vec4 color\n#pragma maplibre: initialize mediump float radius\n#pragma maplibre: initialize lowp float blur\n#pragma maplibre: initialize lowp float opacity\n#pragma maplibre: initialize highp vec4 stroke_color\n#pragma maplibre: initialize mediump float stroke_width\n#pragma maplibre: initialize lowp float stroke_opacity\nvec2 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) {\n#ifdef GLOBE\nvec3 center_vector=projectToSphere(circle_center);\n#endif\nfloat 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 {\n#ifdef GLOBE\nvec4 projected_center=interpolateProjection(circle_center,center_vector,ele);\n#else\nvec4 projected_center=projectTileWithElevation(circle_center,ele);\n#endif\ncorner_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);}\n#ifdef GLOBE\nvec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);\n#else\ngl_Position=projectTileWithElevation(corner_position,ele);\n#endif\n} 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);}"),clippingMask:Ey(Sy,"layout(location=0) in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:Ey("uniform highp float u_intensity;in vec2 v_extrude;\n#pragma maplibre: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma maplibre: initialize highp float weight\nfloat 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);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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;\n#pragma maplibre: define highp float weight\n#pragma maplibre: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma maplibre: initialize highp float weight\n#pragma maplibre: initialize mediump float radius\nvec2 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);\n#ifdef GLOBE\nvec2 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);\n#else\ngl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));\n#endif\n}"),heatmapTexture:Ey("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;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(0.0);\n#endif\n}","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:Ey("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:Ey("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:Ey("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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\n{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));\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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:Ey("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:Ey(Sy,"layout(location=0) in vec2 a_pos;void main() {\n#ifdef GLOBE\ngl_Position=projectTileFor3D(a_pos,0.0);\n#else\ngl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);\n#endif\n}"),fill:Ey("#pragma maplibre: define highp vec4 color\n#pragma maplibre: define lowp float opacity\nvoid main() {\n#pragma maplibre: initialize highp vec4 color\n#pragma maplibre: initialize lowp float opacity\nfragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;\n#pragma maplibre: define highp vec4 color\n#pragma maplibre: define lowp float opacity\nvoid main() {\n#pragma maplibre: initialize highp vec4 color\n#pragma maplibre: initialize lowp float opacity\nif (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:Ey("in vec2 v_pos;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma maplibre: define highp vec4 outline_color\n#pragma maplibre: define lowp float opacity\nvoid main() {\n#pragma maplibre: initialize highp vec4 outline_color\n#pragma maplibre: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_world;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma maplibre: define highp vec4 outline_color\n#pragma maplibre: define lowp float opacity\nvoid main() {\n#pragma maplibre: initialize highp vec4 outline_color\n#pragma maplibre: initialize lowp float opacity\nif (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;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}"),fillOutlinePattern:Ey("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;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma maplibre: define lowp float opacity\n#pragma maplibre: define lowp vec4 pattern_from\n#pragma maplibre: define lowp vec4 pattern_to\nvoid main() {\n#pragma maplibre: initialize lowp float opacity\n#pragma maplibre: initialize mediump vec4 pattern_from\n#pragma maplibre: initialize mediump vec4 pattern_to\nvec2 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;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma maplibre: define lowp float opacity\n#pragma maplibre: define lowp vec4 pattern_from\n#pragma maplibre: define lowp vec4 pattern_to\n#pragma maplibre: define lowp float pixel_ratio_from\n#pragma maplibre: define lowp float pixel_ratio_to\nvoid main() {\n#pragma maplibre: initialize lowp float opacity\n#pragma maplibre: initialize mediump vec4 pattern_from\n#pragma maplibre: initialize mediump vec4 pattern_to\n#pragma maplibre: initialize lowp float pixel_ratio_from\n#pragma maplibre: initialize lowp float pixel_ratio_to\nif (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;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}"),fillPattern:Ey("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;\n#pragma maplibre: define lowp float opacity\n#pragma maplibre: define lowp vec4 pattern_from\n#pragma maplibre: define lowp vec4 pattern_to\nvoid main() {\n#pragma maplibre: initialize lowp float opacity\n#pragma maplibre: initialize mediump vec4 pattern_from\n#pragma maplibre: initialize mediump vec4 pattern_to\nvec2 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;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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;\n#pragma maplibre: define lowp float opacity\n#pragma maplibre: define lowp vec4 pattern_from\n#pragma maplibre: define lowp vec4 pattern_to\n#pragma maplibre: define lowp float pixel_ratio_from\n#pragma maplibre: define lowp float pixel_ratio_to\nvoid main() {\n#pragma maplibre: initialize lowp float opacity\n#pragma maplibre: initialize mediump vec4 pattern_from\n#pragma maplibre: initialize mediump vec4 pattern_to\n#pragma maplibre: initialize lowp float pixel_ratio_from\n#pragma maplibre: initialize lowp float pixel_ratio_to\nif (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:Ey("in vec4 v_color;void main() {fragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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;\n#ifdef TERRAIN3D\nlayout(location=2) in vec2 a_centroid;\n#endif\nout vec4 v_color;\n#pragma maplibre: define highp float base\n#pragma maplibre: define highp float height\n#pragma maplibre: define highp vec4 color\nvoid main() {\n#pragma maplibre: initialize hi
2ghp float base\n#pragma maplibre: initialize highp float height\n#pragma maplibre: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=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;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nfloat 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);\n#ifdef GLOBE\nmat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);\n#endif\ndirectional=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:Ey("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;\n#pragma maplibre: define lowp float base\n#pragma maplibre: define lowp float height\n#pragma maplibre: define lowp vec4 pattern_from\n#pragma maplibre: define lowp vec4 pattern_to\n#pragma maplibre: define lowp float pixel_ratio_from\n#pragma maplibre: define lowp float pixel_ratio_to\nvoid main() {\n#pragma maplibre: initialize lowp float base\n#pragma maplibre: initialize lowp float height\n#pragma maplibre: initialize mediump vec4 pattern_from\n#pragma maplibre: initialize mediump vec4 pattern_to\n#pragma maplibre: initialize lowp float pixel_ratio_from\n#pragma maplibre: initialize lowp float pixel_ratio_to\nvec2 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;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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;\n#ifdef TERRAIN3D\nlayout(location=2) in vec2 a_centroid;\n#endif\n#ifdef GLOBE\nout vec3 v_sphere_pos;\n#endif\nout vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;\n#pragma maplibre: define lowp float base\n#pragma maplibre: define lowp float height\n#pragma maplibre: define lowp vec4 pattern_from\n#pragma maplibre: define lowp vec4 pattern_to\n#pragma maplibre: define lowp float pixel_ratio_from\n#pragma maplibre: define lowp float pixel_ratio_to\nvoid main() {\n#pragma maplibre: initialize lowp float base\n#pragma maplibre: initialize lowp float height\n#pragma maplibre: initialize mediump vec4 pattern_from\n#pragma maplibre: initialize mediump vec4 pattern_to\n#pragma maplibre: initialize lowp float pixel_ratio_from\n#pragma maplibre: initialize lowp float pixel_ratio_to\nvec2 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;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=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;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nvec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: 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:Ey("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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
2ow(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);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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:Ey("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];\n#define PI 3.141592653589793\n#define STANDARD 0\n#define COMBINED 1\n#define IGOR 2\n#define MULTIDIRECTIONAL 3\n#define BASIC 4\nfloat 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\n{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\n{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);}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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:Ey("uniform lowp float u_device_pixel_ratio;flat in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma maplibre: define highp vec4 color\n#pragma maplibre: define lowp float blur\n#pragma maplibre: define lowp float opacity\nvoid main() {\n#pragma maplibre: initialize highp vec4 color\n#pragma maplibre: initialize lowp float blur\n#pragma maplibre: initialize lowp float opacity\nclipAntimeridian();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);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nlayout(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;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma maplibre: define highp vec4 color\n#pragma maplibre: define lowp float blur\n#pragma maplibre: define lowp float opacity\n#pragma maplibre: define mediump float gapwidth\n#pragma maplibre: define lowp float offset\n#pragma maplibre: define mediump float width\nvoid main() {\n#pragma maplibre: initialize highp vec4 color\n#pragma maplibre: initialize lowp float blur\n#pragma maplibre: initialize lowp float opacity\n#pragma maplibre: initialize mediump float gapwidth\n#pragma maplibre: initialize lowp float offset\n#pragma maplibre: initialize mediump float width\nif (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);
2float 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;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:Ey("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;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma maplibre: define lowp float blur\n#pragma maplibre: define lowp float opacity\nvoid main() {\n#pragma maplibre: initialize lowp float blur\n#pragma maplibre: initialize lowp float opacity\nclipAntimeridian();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);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nlayout(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;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma maplibre: define lowp float blur\n#pragma maplibre: define lowp float opacity\n#pragma maplibre: define mediump float gapwidth\n#pragma maplibre: define lowp float offset\n#pragma maplibre: define mediump float width\nvoid main() {\n#pragma maplibre: initialize lowp float blur\n#pragma maplibre: initialize lowp float opacity\n#pragma maplibre: initialize mediump float gapwidth\n#pragma maplibre: initialize lowp float offset\n#pragma maplibre: initialize mediump float width\nif (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;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:Ey("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma maplibre: define lowp vec4 pattern_from\n#pragma maplibre: define lowp vec4 pattern_to\n#pragma maplibre: define lowp float pixel_ratio_from\n#pragma maplibre: define lowp float pixel_ratio_to\n#pragma maplibre: define lowp float blur\n#pragma maplibre: define lowp float opacity\nvoid main() {\n#pragma maplibre: initialize mediump vec4 pattern_from\n#pragma maplibre: initialize mediump vec4 pattern_to\n#pragma maplibre: initialize lowp float pixel_ratio_from\n#pragma maplibre: initialize lowp float pixel_ratio_to\n#pragma maplibre: initialize lowp float blur\n#pragma maplibre: initialize lowp float opacity\nclipAntimeridian();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;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nlayout(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;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma maplibre: define lowp float blur\n#pragma maplibre: define lowp float opacity\n#pragma maplibre: define lowp float offset\n#pragma maplibre: define mediump float gapwidth\n#pragma maplibre: define mediump float width\n#pragma maplibre: define lowp float floorwidth\n#pragma maplibre: define lowp vec4 pattern_from\n#pragma maplibre: define lowp vec4 pattern_to\n#pragma maplibre: define lowp float pixel_ratio_from\n#pragma maplibre: define lowp float pixel_ratio_to\nvoid main() {\n#pragma maplibre: initialize lowp float blur\n#pragma maplibre: initialize lowp float opacity\n#pragma maplibre: initialize lowp float offset\n#pragma maplibre: initialize mediump float gapwidth\n#pragma maplibre: initialize mediump float width\n#pragma maplibre: initialize lowp float floorwidth\n#pragma maplibre: initialize mediump vec4 pattern_from\n#pragma maplibre: initialize mediump vec4 pattern_to\n#pragma maplibre: initialize lowp float pixel_ratio_from\n#pragma maplibre: initialize lowp float pixel_ratio_to\nif (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);
2float 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;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:Ey("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;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma maplibre: define highp vec4 color\n#pragma maplibre: define lowp float blur\n#pragma maplibre: define lowp float opacity\n#pragma maplibre: define mediump float width\n#pragma maplibre: define lowp float floorwidth\n#pragma maplibre: define mediump vec4 dasharray_from\n#pragma maplibre: define mediump vec4 dasharray_to\nvoid main() {\n#pragma maplibre: initialize highp vec4 color\n#pragma maplibre: initialize lowp float blur\n#pragma maplibre: initialize lowp float opacity\n#pragma maplibre: initialize mediump float width\n#pragma maplibre: initialize lowp float floorwidth\n#pragma maplibre: initialize mediump vec4 dasharray_from\n#pragma maplibre: initialize mediump vec4 dasharray_to\nclipAntimeridian();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);
2float 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);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nlayout(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;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma maplibre: define highp vec4 color\n#pragma maplibre: define lowp float blur\n#pragma maplibre: define lowp float opacity\n#pragma maplibre: define mediump float gapwidth\n#pragma maplibre: define lowp float offset\n#pragma maplibre: define mediump float width\n#pragma maplibre: define lowp float floorwidth\n#pragma maplibre: define mediump vec4 dasharray_from\n#pragma maplibre: define mediump vec4 dasharray_to\nvoid main() {\n#pragma maplibre: initialize highp vec4 color\n#pragma maplibre: initialize lowp float blur\n#pragma maplibre: initialize lowp float opacity\n#pragma maplibre: initialize mediump float gapwidth\n#pragma maplibre: initialize lowp float offset\n#pragma maplibre: initialize mediump float width\n#pragma maplibre: initialize lowp float floorwidth\n#pragma maplibre: initialize mediump vec4 dasharray_from\n#pragma maplibre: initialize mediump vec4 dasharray_to\nif (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;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nfloat 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:Ey("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;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma maplibre: define lowp float blur\n#pragma maplibre: define lowp float opacity\n#pragma maplibre: define mediump float width\n#pragma maplibre: define lowp float floorwidth\n#pragma maplibre: define mediump vec4 dasharray_from\n#pragma maplibre: define mediump vec4 dasharray_to\nvoid main() {\n#pragma maplibre: initialize lowp float blur\n#pragma maplibre: initialize lowp float opacity\n#pragma maplibre: initialize mediump float width\n#pragma maplibre: initialize lowp float floorwidth\n#pragma maplibre: initialize mediump vec4 dasharray_from\n#pragma maplibre: initialize mediump vec4 dasharray_to\nclipAntimeridian();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);
2float 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);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nlayout(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;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma maplibre: define lowp float blur\n#pragma maplibre: define lowp float opacity\n#pragma maplibre: define mediump float gapwidth\n#pragma maplibre: define lowp float offset\n#pragma maplibre: define mediump float width\n#pragma maplibre: define lowp float floorwidth\n#pragma maplibre: define mediump vec4 dasharray_from\n#pragma maplibre: define mediump vec4 dasharray_to\nvoid main() {\n#pragma maplibre: initialize lowp float blur\n#pragma maplibre: initialize lowp float opacity\n#pragma maplibre: initialize mediump float gapwidth\n#pragma maplibre: initialize lowp float offset\n#pragma maplibre: initialize mediump float width\n#pragma maplibre: initialize lowp float floorwidth\n#pragma maplibre: initialize mediump vec4 dasharray_from\n#pragma maplibre: initialize mediump vec4 dasharray_to\nif (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;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nfloat 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:Ey("uniform sampler2D u_image;uniform float u_opacity;in vec2 v_pos;void main() {fragColor=texture(u_image,v_pos)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(0.0);\n#endif\n}","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:Ey("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);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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;\n#ifdef GLOBE\nif (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}\n#endif\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Ey("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;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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;\n#pragma maplibre: define lowp float opacity\nvoid main() {\n#pragma maplibre: initialize lowp float opacity\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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;\n#ifdef GLOBE\nif(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);}\n#endif\nvec4 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:Ey("#define SDF_PX 8.0\nuniform 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;\n#pragma maplibre: define highp vec4 fill_color\n#pragma maplibre: define highp vec4 halo_color\n#pragma maplibre: define lowp float halo_width\n#pragma maplibre: define lowp float halo_blur\nvoid main() {\n#pragma maplibre: initialize highp vec4 fill_color\n#pragma maplibre: initialize highp vec4 halo_color\n#pragma maplibre: initialize lowp float halo_width\n#pragma maplibre: initialize lowp float halo_blur\nfloat 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;}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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;\n#pragma maplibre: define highp vec4 fill_color\n#pragma maplibre: define highp vec4 halo_color\n#pragma maplibre: define lowp float opacity\n#pragma maplibre: define lowp float halo_width\n#pragma maplibre: define lowp float halo_blur\nvoid main() {\n#pragma maplibre: initialize highp vec4 fill_color\n#pragma maplibre: initialize highp vec4 halo_color\n#pragma maplibre: initialize lowp float opacity\n#pragma maplibre: initialize lowp float halo_width\n#pragma maplibre: initialize lowp float halo_blur\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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;\n#ifdef GLOBE\nif(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);}\n#endif\nvec4 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:Ey("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform bool u_is_text;uniform sampler2D u_texture;uniform sampler2D u_textur
2e_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;in vec4 v_data0;in vec3 v_data1;flat in float v_is_sdf;\n#pragma maplibre: define highp vec4 fill_color\n#pragma maplibre: define highp vec4 halo_color\n#pragma maplibre: define lowp float halo_width\n#pragma maplibre: define lowp float halo_blur\nvoid main() {\n#pragma maplibre: initialize highp vec4 fill_color\n#pragma maplibre: initialize highp vec4 halo_color\n#pragma maplibre: initialize lowp float halo_width\n#pragma maplibre: initialize lowp float halo_blur\nfloat 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;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\nreturn;}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;}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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;\n#pragma maplibre: define highp vec4 fill_color\n#pragma maplibre: define highp vec4 halo_color\n#pragma maplibre: define lowp float opacity\n#pragma maplibre: define lowp float halo_width\n#pragma maplibre: define lowp float halo_blur\nvoid main() {\n#pragma maplibre: initialize highp vec4 fill_color\n#pragma maplibre: initialize highp vec4 halo_color\n#pragma maplibre: initialize lowp float opacity\n#pragma maplibre: initialize lowp float halo_width\n#pragma maplibre: initialize lowp float halo_blur\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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;\n#ifdef GLOBE\nif(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);}\n#endif\nvec4 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:Ey("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);
2float 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:Ey("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:Ey("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:Ey("#ifdef GL_ES\nprecision highp float;\n#endif\nin 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\n);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:Ey("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 Ey(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),n=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=n?
vendor: 10,498 bytes, line 2
2n.concat(a):a,s=r?r.length:0,l={};return e=e.replace(i,((e,t,i,r,a)=>(l[a]=!0,"define"===t?`\n#ifndef HAS_UNIFORM_u_${a}\nin ${i} ${r} ${a};\n#else\nuniform ${i} ${r} u_${a};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${a}\n ${i} ${r} ${a} = u_${a};\n#endif\n`))),t=t.replace(i,((e,t,i,r,a)=>{let n="float"===r?"vec2":"vec4",o=a.match(/color/)?"color":n;return l[a]?"define"===t?`\n#ifndef HAS_UNIFORM_u_${a}\nuniform lowp float u_${a}_t;\nlayout(location = ${s++}) in ${i} ${n} a_${a};\nout ${i} ${r} ${a};\n#else\nuniform ${i} ${r} u_${a};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${a}\n ${a} = a_${a};\n#else\n ${i} ${r} ${a} = u_${a};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${a}\n ${a} = unpack_mix_${o}(a_${a}, u_${a}_t);\n#else\n ${i} ${r} ${a} = u_${a};\n#endif\n`:"define"===t?`\n#ifndef HAS_UNIFORM_u_${a}\nuniform lowp float u_${a}_t;\nlayout(location = ${s++}) in ${i} ${n} a_${a};\n#else\nuniform ${i} ${r} u_${a};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${a}\n ${i} ${r} ${a} = a_${a};\n#else\n ${i} ${r} ${a} = u_${a};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${a}\n ${i} ${r} ${a} = unpack_mix_${o}(a_${a}, u_${a}_t);\n#else\n ${i} ${r} ${a} = u_${a};\n#endif\n`})),{fragmentSource:e,vertexSource:t,staticAttributes:r,staticUniforms:o}}var Cy=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 My=as([{name:"a_pos",type:"Int16",components:2}]),Iy="#define PROJECTION_MERCATOR",Ay="mercator";var zy=class{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return Ay}get shaderDefine(){return Iy}get shaderPreludeCode(){return Py.projectionMercator}get vertexShaderPreludeCode(){return Py.projectionMercator.vertexSource}get subdivisionGranularity(){return Lu.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}destroy(){}getMeshFromTileID(e,t,i,r,a){if(this._cachedMesh)return this._cachedMesh;let n=new qs;n.emplaceBack(0,0),n.emplaceBack(ne,0),n.emplaceBack(0,ne),n.emplaceBack(ne,ne);let o=e.createVertexBuffer(n,My.members),s=ul.simpleSegment(0,0,4,2),l=new nl;l.emplaceBack(1,0,2),l.emplaceBack(1,2,3);let h=e.createIndexBuffer(l);return this._cachedMesh=new Cy(o,h,s),this._cachedMesh}recalculate(){}hasTransition(){return!1}},ky=class e{constructor(e=0,t=0,i=0,r=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(i)||i<0||isNaN(r)||r<0)throw Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=i,this.right=r}interpolate(e,t,i){return null!=t.top&&null!=e.top&&(this.top=hr.number(e.top,t.top,i)),null!=t.bottom&&null!=e.bottom&&(this.bottom=hr.number(e.bottom,t.bottom,i)),null!=t.left&&null!=e.left&&(this.left=hr.number(e.left,t.left,i)),null!=t.right&&null!=e.right&&(this.right=hr.number(e.right,t.right,i)),this}getCenter(e,t){return new d(Ee((this.left+e-this.right)/2,0,e),Ee((this.top+t-this.bottom)/2,0,t))}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new e(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}};function Dy(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 Ry(e){return Math.max(0,Math.floor(e))}var Ly=class{constructor(e,t){this.applyConstrain=(e,t)=>null===this._constrainOverride?this._callbacks.defaultConstrain(e,t):this._constrainOverride(e,t),this._callbacks=e,this._tileSize=512,this._renderWorldCopies=void 0===t?.renderWorldCopies||!!t?.renderWorldCopies,this._minZoom=t?.minZoom||0,this._maxZoom=t?.maxZoom||22,this._minPitch=null==t?.minPitch?0:t?.minPitch,this._maxPitch=null==t?.maxPitch?60:t?.maxPitch,this._constrainOverride=t?.constrainOverride??null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new wp(0,0),this._elevation=0,this._zoom=0,this._tileZoom=Ry(this._zoom),this._scale=ke(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new ky,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=Ry(this._zoom),this._scale=ke(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 ky(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){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get constrainOverride(){return this._constrainOverride}setConstrainOverride(e){void 0===e&&(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 d(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(e){let t=Ce(e,-180,180)*Math.PI/180;this._bearingInRadians!==t&&(this._unmodified=!1,this._bearingInRadians=t,this._calcMatrices(),this._rotationMatrix=Pm(),function(e,t,i){var r=t[0],a=t[1],n=t[2],o=t[3],s=Math.sin(i),l=Math.cos(i);e[0]=r*l+n*s,e[1]=a*l+o*s,e[2]=r*-s+n*l,e[3]=a*-s+o*l}(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=Ee(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 Xe(this._fovInRadians)}setFov(e){e=Ee(e,.1,150),this.fov!==e&&(this._unmodified=!1,this._fovInRadians=He(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=ke(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 2!==this._latRange?.length||2!==this._lngRange?.length?null:new Cg([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=[-Qe,Qe])}getCameraQueryGeometry(e,t){if(1===t.length)return[t[0],e];{let{minX:i,minY:r,maxX:a,maxY:n}=jp.fromPoints(t).extend(e);return[new d(i,r),new d(a,r),new d(a,n),new d(i,n),new d(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}
vendor: 5,355 bytes, line 2
2_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let e=w(new Float64Array(16));E(e,e,[this._width/2,-this._height/2,1]),P(e,e,[1,-1,0]),this._clipSpaceToPixelsMatrix=e,e=w(new Float64Array(16)),E(e,e,[1,-1,1]),P(e,e,[-1,-1,0]),E(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,n,o=void 0===i?this.bearing:i,s=r=void 0===r?this.pitch:r,{distanceToCenter:l,clampedElevation:h}=this._distanceToCenterFromAltElevationPitch(t,this.elevation,s),{x:u,y:c}=n_(s,o),p=zp.fromLngLat(e,t),d=Ap(1,p.y),f=0;do{if(f+=1,f>10)break;n=l/d;let e=u*n,t=c*n;a=new zp(p.x+e,p.y+t),d=1/a.meterInMercatorCoordinateUnits()}while(Math.abs(l-n*d)>1e-12);return{center:a.toLngLat(),elevation:h,zoom:De(this.height/2/Math.tan(this.fovInRadians/2)/n/this.tileSize)}}recalculateZoomAndCenter(e){if(this.elevation-e==0)return;let t=1/this.worldSize,i=Cp(1,this.center.lat)*this.worldSize,r=zp.fromLngLat(this.center,this.elevation),a=r.x/t,n=r.y/t,o=r.z/t,s=this.pitch,l=this.bearing,{x:h,y:u,z:c}=n_(s,l),p=this.cameraToCenterDistance,d=a+p*-h,f=n+p*-u,m=o+p*c,{distanceToCenter:g,clampedElevation:_}=this._distanceToCenterFromAltElevationPitch(m/i,e,s),y=g*i,v=new zp((d+h*y)*t,(f+u*y)*t,0).toLngLat(),x=Cp(1,v.lat),b=De(this.height/2/Math.tan(this.fovInRadians/2)/g/x/this.tileSize);this._elevation=_,this._center=v,this.setZoom(b)}_distanceToCenterFromAltElevationPitch(e,t,i){let r,a=-Math.cos(He(i)),n=e-t,o=t;return a*n>=0||Math.abs(a)<.1?(r=1e4,o=e+r*a):r=-n/a,{distanceToCenter:r,clampedElevation:o}}getCameraPoint(){let e=this.pitchInRadians,t=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new d(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=Cp(1,this.center.lat)*this.worldSize,t=this.cameraToCenterDistance/e;return a_(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/ne,1/t/ne]}},Fy=class e{constructor(e,t){this.min=e,this.max=t,this.center=B([],F([],this.min,this.max),.5)}quadrant(t){let i=[t%2==0,t<2],r=D(this.min),a=D(this.max);for(let e=0;e<i.length;e++)r[e]=i[e]?this.min[e]:this.center[e],a[e]=i[e]?this.center[e]:this.max[e];return a[2]=this.max[2],new e(r,a)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersectsFrustum(e){let t=!0;for(let i of e.planes){let e=this.intersectsPlane(i);if(0===e)return 0;1===e&&(t=!1)}return t?2:e.aabb.min[0]>this.max[0]||e.aabb.min[1]>this.max[1]||e.aabb.min[2]>this.max[2]||e.aabb.max[0]<this.min[0]||e.aabb.max[1]<this.min[1]||e.aabb.max[2]<this.min[2]?0:1}intersectsPlane(e){let t=e[3],i=e[3];for(let r=0;r<3;r++)e[r]>0?(t+=e[r]*this.min[r],i+=e[r]*this.max[r]):(i+=e[r]*this.min[r],t+=e[r]*this.max[r]);return t>=0?2:i<0?0:1}},By=class{distanceToTile2d(e,t,i,r){let a=r,n=a.distanceX([e,t]),o=a.distanceY([e,t]);return Math.hypot(n,o)}getWrap(e,t,i){return i}getTileBoundingVolume(e,t,i,r){let a=Math.min(0,i),n=Math.max(0,i);if(r?.terrain){let i=new Lp(e.z,t,e.z,e.x,e.y),o=r.terrain.getMinMaxElevation(i);a=o.minElevation??a,n=o.maxElevation??n}let o=1<<e.z;return new Fy([t+e.x/o,e.y/o,a],[t+(e.x+1)/o,(e.y+1)/o,n])}allowVariableZoom(e,t){let i=Ee(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(){}},Oy=class e{constructor(e,t,i){this.points=e,this.planes=t,this.aabb=i}static fromInvProjectionMatrix(t,i=1,r=0,a,n){let o=n?[[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]],s=2**r,l=[[-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]].map((e=>function(e,t,i,r){let a=H([],e,t),n=1/a[3]/i*r;return X(a,a,[n,n,1/a[3],n])}(e,t,i,s)));a&&function(e,t,i,r){let a=r?4:0,n=r?0:4,o=0,s=[],l=[];for(let t=0;t<4;t++){let i=Z([],e[t+n],e[t+a]),r=R(i);B(i,i,1/r),s.push(r),l.push(i)}for(let t=0;t<4;t++){let r=ge(e[t+a],l[t],i);o=null!==r&&r>=0?Math.max(o,r):Math.max(o,s[t])}let h=function(e,t){let i=Z([],e[t[0]],e[t[1]]),r=Z([],e[t[2]],e[t[1]]),a=[0,0,0,0];return O(a,j([],i,r)),a[3]=-V(a,e[t[0]]),a}(e,t),u=function(e,t){let i=function(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}([],e,1/W(e)),r=Z([],t,B([],i,V(t,i))),a=W(r);if(a>0){let e=Math.sqrt(1-i[3]*i[3]);return fe(t,F([],B([],i,-i[3]),B([],r,e/a)))}return null}(i,h);if(null!==u){let e=u/V(l[0],h);o=Math.min(o,e)}for(let t=0;t<4;t++){let i=Math.min(o,s[t]);e[t+n]=[e[t+a][0]+l[t][0]*i,e[t+a][1]+l[t][1]*i,e[t+a][2]+l[t][2]*i,1]}}(l,o[0],a,n);let h=o.map((e=>{let t=O([],j([],Z([],l[e[0]],l[e[1]]),Z([],l[e[2]],l[e[1]]))),i=-V(t,l[e[1]]);return t.concat(i)})),u=[1/0,1/0,1/0],c=[-1/0,-1/0,-1/0];for(let e of l)for(let t=0;t<3;t++)u[t]=Math.min(u[t],e[t]),c[t]=Math.max(c[t],e[t]);return new e(l,h,new Fy(u,c))}};
2var Vy=class e{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(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,t,i){this._helper.interpolatePadding(e,t,i)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,t,i=!0){this._helper.resize(e,t,i)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}setConstrainOverride(e){this._helper.setConstrainOverride(e)}overrideNearFarZ(e,t){this._helper.overrideNearFarZ(e,t)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}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(e){}constructor(e){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this.defaultConstrain=(e,t)=>{t=Ee(+t,this.minZoom,this.maxZoom);let i={center:new wp(e.lng,e.lat),zoom:t},r=this._helper._lngRange;!this._helper._renderWorldCopies&&null===r&&(r=[-179.9999999999,179.9999999999]);let a=this.tileSize*ke(i.zoom),n=0,o=a,s=0,l=a,h=0,u=0,{x:c,y:p}=this.size;if(this._helper._latRange){let e=this._helper._latRange;n=Ep(e[1])*a,o=Ep(e[0])*a,o-n<p&&(h=p/(o-n))}r&&(s=Ce(Pp(r[0])*a,0,a),l=Ce(Pp(r[1])*a,0,a),l<s&&(l+=a),l-s<c&&(u=c/(l-s)));let f,m,{x:g,y:_}=e_(a,e),y=Math.max(u||0,h||0);if(y)return i.center=t_(a,new d(u?(l+s)/2:g,h?(o+n)/2:_)).wrap(),i.zoom+=De(y),i;if(this._helper._latRange){let e=p/2;_-e<n&&(m=n+e),_+e>o&&(m=o-e)}if(r){let e=(s+l)/2,t=g;
2this._helper._renderWorldCopies&&(t=Ce(g,e-a/2,e+a/2));let i=c/2;t-i<s&&(f=s+i),t+i>l&&(f=l-i)}return(void 0!==f||void 0!==m)&&(i.center=t_(a,new d(f??g,m??_)).wrap()),i},this.applyConstrain=(e,t)=>this._helper.applyConstrain(e,t),this._helper=new Ly({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(e,t)=>this.defaultConstrain(e,t)},e),this._coveringTilesDetailsProvider=new By}clone(){let t=new e;return t.apply(this,!1),t}apply(e,t,i){this._helper.apply(e,t,i)}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(e){let t=[new Rp(0,e)];if(this._helper._renderWorldCopies){let i=this.screenPointToMercatorCoordinate(new d(0,0)),r=this.screenPointToMercatorCoordinate(new d(this._helper._width,0)),a=this.screenPointToMercatorCoordinate(new d(this._helper._width,this._helper._height)),n=this.screenPointToMercatorCoordinate(new d(0,this._helper._height)),o=Math.floor(Math.min(i.x,r.x,a.x,n.x)),s=Math.floor(Math.max(i.x,r.x,a.x,n.x));for(let i=o-1;i<=s+1;i++)0!==i&&t.push(new Rp(i,e))}return t}getCameraFrustum(){return Oy.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){let t=this.screenPointToLocation(this.centerPoint,e),i=e?e.getElevationForLngLatZoom(t,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(i)}setLocationAtPoint(e,t){let i=Cp(this.elevation,this.center.lat),r=this.screenPointToMercatorCoordinateAtZ(t,i),a=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,i),n=zp.fromLngLat(e),o=new zp(n.x-(r.x-a.x),n.y-(r.y-a.y));this.setCenter(o?.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(e,t){return t?this.coordinatePoint(zp.fromLngLat(e),t.getElevationForLngLat(e,this),this._pixelMatrix3D):this.coordinatePoint(zp.fromLngLat(e))}screenPointToLocation(e,t){return this.screenPointToMercatorCoordinate(e,t)?.toLngLat()}screenPointToMercatorCoordinate(e,t){if(t){let i=t.pointCoordinate(e);if(null!=i)return i}return this.screenPointToMercatorCoordinateAtZ(e)}screenPointToMercatorCoordinateAtZ(e,t){let i=t||0,r=[e.x,e.y,0,1],a=[e.x,e.y,1,1];H(r,r,this._pixelMatrixInverse),H(a,a,this._pixelMatrixInverse);let n=r[3],o=a[3],s=r[0]/n,l=a[0]/o,h=r[1]/n,u=a[1]/o,c=r[2]/n,p=a[2]/o,d=c===p?0:(i-c)/(p-c);return new zp(hr.number(s,l,d)/this.worldSize,hr.number(h,u,d)/this.worldSize,i)}coordinatePoint(e,t=0,i=this._pixelMatrix){let r=[e.x*this.worldSize,e.y*this.worldSize,t,1];return H(r,r,i),new d(r[0]/r[3],r[1]/r[3])}getBounds(){let e=Math.max(0,this._helper._height/2-i_(this));return(new Cg).extend(this.screenPointToLocation(new d(0,e))).extend(this.screenPointToLocation(new d(this._helper._width,e))).extend(this.screenPointToLocation(new d(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new d(0,this._helper._height)))}isPointOnMapSurface(e,t){return t?null!=t.pointCoordinate(e):e.y>this.height/2-i_(this)}calculatePosMatrix(e,t=!1,i=!1){let r=e.key??Fp(e.wrap,e.canonical.z,e.canonical.z,e.canonical.x,e.canonical.y),a=t?this._alignedPosMatrixCache:this._posMatrixCache;if(a.has(r)){let e=a.get(r);return i?e.f32:e.f64}let n=r_(e,this.worldSize);S(n,t?this._alignedProjMatrix:this._viewProjMatrix,n);let o={f64:n,f32:new Float32Array(n)};return a.set(r,o),i?o.f32:o.f64}calculateFogMatrix(e){let t=e.key,i=this._fogMatrixCacheF32;if(i.has(t))return i.get(t);let r=r_(e,this.worldSize);return S(r,this._fogMatrix,r),i.set(t,new Float32Array(r)),i.get(t)}calculateCenterFromCameraLngLatAlt(e,t,i,r){return this._helper.calculateCenterFromCameraLngLatAlt(e,t,i,r)}_calculateNearFarZIfNeeded(e,t,i){if(!this._helper.autoCalculateNearFarZ)return;let r=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),a=e-r*this._helper._pixelPerMeter/Math.cos(t),n=r<0?a:e,o=Math.PI/2+this.pitchInRadians,s=He(this.fov)*(Math.abs(Math.cos(He(this.roll)))*this.height+Math.abs(Math.sin(He(this.roll)))*this.width)/this.height*(.5+i.y/this.height),l=Math.sin(s)*n/Math.sin(Ee(Math.PI-o-s,.01,Math.PI-.01)),h=i_(this),u=Math.atan(h/this._helper.cameraToCenterDistance),c=He(.75),p=u>c?2*u*(.5+i.y/(2*h)):c,d=Math.sin(p)*n/Math.sin(Ee(Math.PI-o-p,.01,Math.PI-.01)),f=Math.min(l,d);this._helper._farZ=1.01*(Math.cos(Math.PI/2-t)*f+n),this._helper._nearZ=this._helper._height/50}
vendor: 39,055 bytes, line 2
2_calcMatrices(){if(!this._helper._height)return;let e=this.centerOffset,t=e_(this.worldSize,this.center),i=t.x,r=t.y;this._helper._pixelPerMeter=Cp(1,this.center.lat)*this.worldSize;let a,n=He(Math.min(this.pitch,Qg)),o=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(n));this._calculateNearFarZIfNeeded(o,n,e),a=new Float64Array(16),A(a,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),function(e,t){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]}(this._invProjMatrix,a),a[8]=2*-e.x/this._helper._width,a[9]=2*e.y/this._helper._height,this._projectionMatrix=b(a),E(a,a,[1,-1,1]),P(a,a,[0,0,-this._helper.cameraToCenterDistance]),I(a,a,-this.rollInRadians),C(a,a,this.pitchInRadians),I(a,a,-this.bearingInRadians),P(a,a,[-i,-r,0]),this._mercatorMatrix=E([],a,[this.worldSize,this.worldSize,this.worldSize]),E(a,a,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=S(new Float64Array(16),this.clipSpaceToPixelsMatrix,a),P(a,a,[0,0,-this.elevation]),this._viewProjMatrix=a,this._invViewProjMatrix=T([],a);let s=[0,0,-1,1];H(s,s,this._invViewProjMatrix),this._cameraPosition=[s[0]/s[3],s[1]/s[3],s[2]/s[3]],this._fogMatrix=new Float64Array(16),A(this._fogMatrix,this.fovInRadians,this.width/this.height,o,this._helper._farZ),this._fogMatrix[8]=2*-e.x/this.width,this._fogMatrix[9]=2*e.y/this.height,E(this._fogMatrix,this._fogMatrix,[1,-1,1]),P(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),I(this._fogMatrix,this._fogMatrix,-this.rollInRadians),C(this._fogMatrix,this._fogMatrix,this.pitchInRadians),I(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),P(this._fogMatrix,this._fogMatrix,[-i,-r,0]),E(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),P(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=S(new Float64Array(16),this.clipSpaceToPixelsMatrix,a);let l=this._helper._width%2/2,h=this._helper._height%2/2,u=Math.cos(this.bearingInRadians),c=Math.sin(-this.bearingInRadians),p=i-Math.round(i)+u*l+c*h,d=r-Math.round(r)+u*h+c*l,f=new Float64Array(a);if(P(f,f,[p>.5?p-1:p,d>.5?d-1:d,0]),this._alignedProjMatrix=f,a=T(new Float64Array(16),this._pixelMatrix),!a)throw Error("failed to invert matrix");this._pixelMatrixInverse=a,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;let e=this.screenPointToMercatorCoordinate(new d(0,0)),t=[e.x*this.worldSize,e.y*this.worldSize,0,1];return H(t,t,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){let e=Cp(1,this.center.lat)*this.worldSize,t=this._helper.cameraToCenterDistance/e;return a_(this.center,this.elevation,this.pitch,this.bearing,t).toLngLat()}lngLatToCameraDepth(e,t){let i=zp.fromLngLat(e),r=[i.x*this.worldSize,i.y*this.worldSize,t,1];return H(r,r,this._viewProjMatrix),r[2]/r[3]}getProjectionData(e){let t,{overscaledTileID:i,aligned:r,applyTerrainMatrix:a}=e,n=this._helper.getMercatorTileCoordinates(i),o=i?this.calculatePosMatrix(i,r,!0):null;return t=i?.terrainRttPosMatrix32f&&a?i.terrainRttPosMatrix32f:o||pe(),{mainMatrix:t,tileMercatorCoords:n,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:t,clipAntimeridian:!1}}isLocationOccluded(e){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(e,t,i){return 1}transformLightDirection(e){return D(e)}getRayDirectionFromPixel(e){throw Error("Not implemented.")}projectTileCoordinates(e,t,i,r){let a,n=this.calculatePosMatrix(i);r?(a=[e,t,r(e,t),1],H(a,a,n)):(a=[e,t,0,1],W_(a,a,n));let o=a[3];return{point:new d(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}populateCache(e){for(let t of e)this.calculatePosMatrix(t)}getProjectionDataForCustomLayer(e=!0){let t=new Lp(0,0,0,0,0),i=this.getProjectionData({overscaledTileID:t,applyGlobeMatrix:e}),r=r_(t,this.worldSize);S(r,this._viewProjMatrix,r);let a=[ne,ne,this.worldSize/this._helper.pixelsPerMeter],n=ue();return E(n,r,a),{...i,tileMercatorCoords:[0,0,1,1],fallbackMatrix:n,mainMatrix:n}}getFastPathSimpleProjectionMatrix(e){return this.calculatePosMatrix(e)}};function jy(){je("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function Ny(e){if(e.useSlerp)if(e.k<1){let t=Je(e.startEulerAngles.roll,e.startEulerAngles.pitch,e.startEulerAngles.bearing),i=Je(e.endEulerAngles.roll,e.endEulerAngles.pitch,e.endEulerAngles.bearing),r=new Float64Array(4);K(r,t,i,e.k);let a=function(e){let t=new Float64Array(9);!function(e,t){var i=t[0],r=t[1],a=t[2],n=t[3],o=i+i,s=r+r,l=a+a,h=i*o,u=r*o,c=r*s,p=a*o,d=a*s,f=a*l,m=n*o,g=n*s,_=n*l;e[0]=1-c-f,e[3]=u-_,e[6]=p+g,e[1]=u+_,e[4]=1-h-f,e[7]=d-m,e[2]=p-g,e[5]=d+m,e[8]=1-h-c}(t,e);let i,r,a=Xe(-Math.asin(Ee(t[2],-1,1)));return Math.hypot(t[5],t[8])<.001?(i=0,r=-Xe(Math.atan2(t[3],t[4]))):(i=Xe(0===t[5]&&0===t[8]?0:Math.atan2(t[5],t[8])),r=Xe(0===t[1]&&0===t[0]?0:Math.atan2(t[1],t[0]))),{roll:i,pitch:a+90,bearing:r}}(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(hr.number(e.startEulerAngles.roll,e.endEulerAngles.roll,e.k)),e.tr.setPitch(hr.number(e.startEulerAngles.pitch,e.endEulerAngles.pitch,e.k)),e.tr.setBearing(hr.number(e.startEulerAngles.bearing,e.endEulerAngles.bearing,e.k))}function qy(e,t,i,r,a){let n=a.padding,o=e_(a.worldSize,i.getNorthWest()),s=e_(a.worldSize,i.getNorthEast()),l=e_(a.worldSize,i.getSouthEast()),h=e_(a.worldSize,i.getSouthWest()),u=He(-r),c=o.rotate(u),p=s.rotate(u),f=l.rotate(u),m=h.rotate(u),g=new d(Math.max(c.x,p.x,m.x,f.x),Math.max(c.y,p.y,m.y,f.y)),_=new d(Math.min(c.x,p.x,m.x,f.x),Math.min(c.y,p.y,m.y,f.y)),y=g.sub(_),v=a.width-(n.left+n.right+t.left+t.right),x=a.height-(n.top+n.bottom+t.top+t.bottom),b=v/y.x,w=x/y.y;if(w<0||b<0)return void jy();let T=Math.min(De(a.scale*Math.min(b,w)),e.maxZoom),S=d.convert(e.offset),P=new d((t.left-t.right)/2,(t.top-t.bottom)/2).rotate(He(r)),E=S.add(P).mult(a.scale/ke(T));return{center:t_(a.worldSize,o.add(l).div(2).sub(E)),zoom:T,bearing:r}}var $y=class{get useGlobeControls(){return!1}handlePanInertia(e,t){let i=e.mag(),r=Math.abs(i_(t));return{easingOffset:e.mult(Math.min(.75*r/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 qy(e,t,i,r,a)}handleJumpToCenterZoom(e,t){let i=void 0===t.zoom?e.zoom:+t.zoom;e.zoom!==i&&e.setZoom(+t.zoom),void 0!==t.center&&e.setCenter(wp.convert(t.center))}handleEaseTo(e,t){let i=e.zoom,r=e.padding,a={roll:e.roll,pitch:e.pitch,bearing:e.bearing},n={roll:void 0===t.roll?e.roll:t.roll,pitch:void 0===t.pitch?e.pitch:t.pitch,bearing:void 0===t.bearing?e.bearing:t.bearing},o=void 0!==t.zoom,s=!e.isPaddingEqual(t.padding),l=!1,h=o?+t.zoom:e.zoom,u=e.centerPoint.add(t.offsetAsPoint),c=e.screenPointToLocation(u),{center:p,zoom:d}=e.applyConstrain(wp.convert(t.center||c),h??i);Dy(e,p);let f=e_(e.worldSize,c),m=e_(e.worldSize,p).sub(f),g=ke(d-i);return l=d!==i,{easeFunc:o=>{if(l&&e.setZoom(hr.number(i,d,o)),Ye(a,n)||Ny({startEulerAngles:a,endEulerAngles:n,tr:e,k:o,useSlerp:a.roll!=n.roll}),s&&(e.interpolatePadding(r,t.padding,o),u=e.centerPoint.add(t.offsetAsPoint)),t.around)e.setLocationAtPoint(t.around,t.aroundPoint);else{let t=ke(e.zoom-i),r=(d>i?Math.min(2,g):Math.max(.5,g))**(1-o),a=t_(e.worldSize,f.add(m.mult(o*r)).mult(t));e.setLocationAtPoint(e.renderWorldCopies?a.wrap():a,u)}},isZooming:l,elevationCenter:p}}handleFlyTo(e,t){let i=void 0!==t.zoom,r=e.zoom,a=e.applyConstrain(wp.convert(t.center||t.locationAtOffset),i?+t.zoom:r),n=a.center,o=a.zoom;Dy(e,n);let s=e.worldSize,l=e_(s,t.locationAtOffset),h=e_(s,n).sub(l),u=h.mag(),c=ke(o-r),p=void 0===t.minZoom?e.minZoom:+t.minZoom,d=Math.max(p,e.minZoom),f=Math.min(d,r,o),m=e.applyConstrain(n,f).zoom;return{easeFunc:(t,i,a,u)=>{e.setZoom(1===t?o:r+De(i));let c=1===t?n:t_(s,l.add(h.mult(a)));e.setLocationAtPoint(e.renderWorldCopies?c.wrap():c,u)},scaleOfZoom:c,targetCenter:n,scaleOfMinZoom:ke(m-r),pixelPathLength:u}}};let Uy;function Gy(e,t){let i=function(e,t){let i=void 0===e.granularity?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),n=r+1,o=a+1,s=e.generateBorders?-1:0,l=e.generateBorders||e.extendToNorthPole?-1:0,h=i+ +!!e.generateBorders,u=i+(e.generateBorders||e.extendToSouthPole?1:0),c=n*o,p=r*a*6,d=n*o>65536;if(d&&"16bit"===t)throw Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");let f=d||"32bit"===t,m=new Int16Array(2*c),g=0;for(let t=l;t<=u;t++)for(let r=s;r<=h;r++){let a=r/i*ne;-1===r&&(a=-64),r===i+1&&(a=8256);let n=t/i*ne;-1===t&&(n=e.extendToNorthPole?Fu:-64),t===i+1&&(n=e.extendToSouthPole?Bu:8256),m[g++]=a,m[g++]=n}let _=f?new Uint32Array(p):new Uint16Array(p),y=0;for(let e=0;e<a;e++)for(let t=0;t<r;t++){let i=t+e*n,r=t+1+e*n,a=t+(e+1)*n,o=t+1+(e+1)*n;_[y++]=i,_[y++]=a,_[y++]=r,_[y++]=r,_[y++]=a,_[y++]=o}return{vertices:m.buffer.slice(0),indices:_.buffer.slice(0),uses32bitIndices:f}}(t,"16bit"),r=qs.deserialize({arrayBuffer:i.vertices,length:i.vertices.byteLength/2/2}),a=nl.deserialize({arrayBuffer:i.indices,length:i.indices.byteLength/2/3});return new Cy(e.createVertexBuffer(r,My.members),e.createIndexBuffer(a),ul.simpleSegment(0,0,r.length,a.length))}const Zy=new Lu({fill:new Ru(128,2),line:new Ru(512,0),tile:new Ru(128,32),stencil:new Ru(128,1),circle:3});var Wy=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 Py.projectionGlobe}get vertexShaderPreludeCode(){return Py.projectionMercator.vertexSource}get subdivisionGranularity(){return Zy}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 n=("stencil"===a?Zy.stencil:Zy.tile).getGranularityForZoomLevel(t.z),o=0===t.y&&r,s=t.y===(1<<t.z)-1&&r;return this._getMesh(e,{granularity:n,generateBorders:i,extendToNorthPole:o,extendToSouthPole:s})}_getMesh(e,t){let i=this._getMeshKey(t);if(i in this._tileMeshCache)return this._tileMeshCache[i];let r=Gy(e,t);return this._tileMeshCache[i]=r,r}recalculate(e){}hasTransition(){return!1}},Hy=class extends bt{constructor(e,t){super(),this._transitionable=new Ro(Uy||=new Wo({type:new qo(wt.projection.type,"type")}),"projection",t),this.setProjection(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new Io(0)),this._mercatorProjection=new zy,this._verticalPerspectiveProjection=new Wy}get transitionState(){let e=this.properties.get("type");if("string"==typeof e&&"mercator"===e)return 0;if("string"==typeof e&&"vertical-perspective"===e)return 1;if(e instanceof Ui){if(e.from===e.to)return"mercator"===e.from?0:1;if("vertical-perspective"===e.from&&"mercator"===e.to)return 1-e.transition;if("mercator"===e.from&&"vertical-perspective"===e.to)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 Xy(e){let t=Jy(e.worldSize,e.center.lat);return 2*Math.PI*t}function Yy(e,t,i,r,a){let n=1/(1<<a),o=t/ne*n+r*n,s=xe((e/ne*n+i*n)*Math.PI*2+Math.PI,2*Math.PI),l=2*Math.atan(Math.exp(Math.PI-o*Math.PI*2))-.5*Math.PI,h=Math.cos(l),u=new Float64Array(3);return u[0]=Math.sin(s)*h,u[1]=Math.sin(l),u[2]=Math.cos(s)*h,u}function Ky(e){return function(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}(e.lng*Math.PI/180,e.lat*Math.PI/180)}function Jy(e,t){return e/(2*Math.PI)/Math.cos(t*Math.PI/180)}function Qy(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,n=Math.acos(a);return new wp(Ce((r>0?n:-n)/Math.PI*180,-180,180),t)}return new wp(0,t)}function ev(e){return Math.cos(e*Math.PI/180)}function tv(e,t){let i=ev(e);return De(ev(t)/i)}function iv(e,t){let i=e.rotate(t.bearingInRadians),r=t.zoom+tv(t.center.lat,0),a=we(1/ev(t.center.lat),1/ev(Math.min(Math.abs(t.center.lat),60)),be(r,7,3,0,1)),n=function(e,t){return 360/Xy({worldSize:e,center:{lat:t}})}(t.worldSize,t.center.lat);return new wp(t.center.lng-i.x*n*a,Ee(t.center.lat+i.y*n,-Qe,Qe))}function rv(e){let t=.5*e,i=Math.sin(t),r=Math.cos(t);return Math.log(i+r)-Math.log(r-i)}function av(e,t,i,r){let a=e.lat+i*r;if(Math.abs(i)>1){let n=e.lat+i,o=(Math.sign(n)===Math.sign(e.lat)?Math.abs(e.lat):-Math.abs(e.lat))*Math.PI/180,s=Math.abs(e.lat+i)*Math.PI/180,l=rv(o+r*(s-o)),h=rv(o),u=(l-h)/(rv(s)-h);return new wp(e.lng+t*u,a)}return new wp(e.lng+t*r,a)}var nv=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)}`,n=this._cache.get(a);if(n)return n;let o=this._cachePrevious.get(a);if(o)return this._cache.set(a,o),o;let s=this._boundingVolumeFactory(e,t,i,r);return this._cache.set(a,s),this._hadAnyChanges=!0,s}},ov=class e{constructor(e,t,i,r){this.min=i,this.max=r,this.points=e,this.planes=t}static fromAabb(t,i){let r=[];for(let e=0;e<8;e++)r.push([1&~e?t[0]:i[0],1==(e>>1&1)?i[1]:t[1],1==(e>>2&1)?i[2]:t[2]]);return new e(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=J([],r[0],r[1],r[2]),n=N([],[i[0],0,0],a),o=N([],[0,i[1],0],a),s=N([],[0,0,i[2]],a),l=[...t],h=[...t];for(let e=0;e<8;e++)for(let i=0;i<3;i++){let r=t[i]+n[i]*(1&~e?-1:1)+o[i]*(1==(e>>1&1)?1:-1)+s[i]*(1==(e>>2&1)?1:-1);l[i]=Math.min(l[i],r),h[i]=Math.max(h[i],r)}let u=[];for(let e=0;e<8;e++){let i=[...t];F(i,i,B([],n,1&~e?-1:1)),F(i,i,B([],o,1==(e>>1&1)?1:-1)),F(i,i,B([],s,1==(e>>2&1)?1:-1)),u.push(i)}return new e(u,[[...n,-V(n,u[0])],[...o,-V(o,u[0])],[...s,-V(s,u[0])],[-n[0],-n[1],-n[2],-V(n,u[7])],[-o[0],-o[1],-o[2],-V(o,u[7])],[-s[0],-s[1],-s[2],-V(s,u[7])]],l,h)}intersectsFrustum(e){let t=!0,i=this.points.length,r=this.planes.length,a=e.planes.length,n=e.points.length;for(let r=0;r<a;r++){let a=e.planes[r],n=0;for(let e=0;e<i;e++){let t=this.points[e];a[0]*t[0]+a[1]*t[1]+a[2]*t[2]+a[3]>=0&&n++}if(0===n)return 0;n<i&&(t=!1)}if(t)return 2;for(let t=0;t<r;t++){let i=this.planes[t],r=0;for(let t=0;t<n;t++){let a=e.points[t];i[0]*a[0]+i[1]*a[1]+i[2]*a[2]+i[3]>=0&&r++}if(0===r)return 0}return 1}intersectsPlane(e){let t=this.points.length,i=0;for(let r=0;r<t;r++){let t=this.points[r];e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]>=0&&i++}return i===t?2:0===i?0:1}};function sv(e,t,i){let r=e-t;return r<0?-r:Math.max(0,r-i)}function lv(e,t,i,r,a){let n,o=e-i;return n=o<0?Math.min(-o,1+o-a):o>a?Math.min(Math.max(o-a,0),1-o):0,Math.max(n,sv(t,r,a))}var hv=class{constructor(){this._boundingVolumeCache=new nv(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(e,t,i,r){let a=1<<i.z,n=1/a,o=i.x/a,s=i.y/a,l=2;return l=Math.min(l,lv(e,t,o,s,n)),l=Math.min(l,lv(e,t,o+.5,-s-n,n)),l=Math.min(l,lv(e,t,o+.5,2-s-n,n)),l}getWrap(e,t,i){let r=1<<t.z,a=1/r,n=t.x/r,o=sv(e.x,n,a),s=sv(e.x,n-1,a),l=sv(e.x,n+1,a),h=Math.min(o,s,l);return h===l?1:h===s?-1:0}allowVariableZoom(e,t){return u_(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),n=Math.max(0,i);if(r?.terrain){let i=new Lp(e.z,t,e.z,e.x,e.y),o=r.terrain.getMinMaxElevation(i);a=o.minElevation??a,n=o.maxElevation??n}if(a/=bp,n/=bp,a+=1,n+=1,e.z<=0)return ov.fromAabb([-n,-n,-n],[n,n,n]);if(1===e.z)return ov.fromAabb([0===e.x?-n:0,0===e.y?0:-n,-n],[0===e.x?0:n,0===e.y?n:0,n]);{let t=[Yy(0,0,e.x,e.y,e.z),Yy(ne,0,e.x,e.y,e.z),Yy(ne,ne,e.x,e.y,e.z),Yy(0,ne,e.x,e.y,e.z)],i=[];for(let e of t)i.push(B([],e,n));if(n!==a)for(let e of t)i.push(B([],e,a));0===e.y&&i.push([0,1,0]),e.y===(1<<e.z)-1&&i.push([0,-1,0]);let r=[1,1,1],o=[-1,-1,-1];for(let e of i)for(let t=0;t<3;t++)r[t]=Math.min(r[t],e[t]),o[t]=Math.max(o[t],e[t]);let s=Yy(4096,4096,e.x,e.y,e.z),l=j([],[0,1,0],s);O(l,l);let h=j([],s,l);O(h,h);let u=j([],t[2],t[1]);O(u,u);let c=j([],t[0],t[3]);O(c,c),i.push(B([],s,n)),e.y>=(1<<e.z)/2&&i.push(B([],Yy(4096,0,e.x,e.y,e.z),n)),e.y<(1<<e.z)/2&&i.push(B([],Yy(4096,ne,e.x,e.y,e.z),n));let p=uv(s,i),d=uv(h,i),f=[-s[0],-s[1],-s[2],p.max],m=[s[0],s[1],s[2],-p.min],g=[-h[0],-h[1],-h[2],d.max],_=[h[0],h[1],h[2],-d.min],y=[...u,0],v=[...c,0],x=[];return 0===e.y?x.push(me(v,y,f),me(v,y,m)):x.push(me(g,y,f),me(g,y,m),me(g,v,f),me(g,v,m)),e.y===(1<<e.z)-1?x.push(me(v,y,f),me(v,y,m)):x.push(me(_,y,f),me(_,y,m),me(_,v,f),me(_,v,m)),new ov(x,[f,m,g,_,y,v],r,o)}}};function uv(e,t){let i=1/0,r=-1/0;for(let a of t){let t=V(e,a);i=Math.min(i,t),r=Math.max(r,t)}return{min:i,max:r}}var cv=class e{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(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,t,i){this._helper.interpolatePadding(e,t,i)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,t){this._helper.resize(e,t)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}setConstrainOverride(e){this._helper.setConstrainOverride(e)}overrideNearFarZ(e,t){this._helper.overrideNearFarZ(e,t)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}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(e){}constructor(e){this._cachedClippingPlane=le(),this._projectionMatrix=ce(),this._globeViewProjMatrix32f=pe(),this._globeViewProjMatrixF64=ce(),this._globeViewProjMatrixF64Inverted=ce(),this._globeProjMatrixInverted=ce(),this._cameraPosition=he(),this.defaultConstrain=(e,t)=>{let i=Ee(e.lat,-Qe,Qe),r=Ee(+t,this.minZoom+tv(0,i),this.maxZoom);return{center:new wp(e.lng,i),zoom:r}},this.applyConstrain=(e,t)=>this._helper.applyConstrain(e,t),this._helper=new Ly({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(e,t)=>this.defaultConstrain(e,t)},e),this._coveringTilesDetailsProvider=new hv}clone(){let t=new e;return t.apply(this,!1),t}apply(e,t){this._helper.apply(e,t)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixF64}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){let e=he();return e[0]=this._cameraPosition[0],e[1]=this._cameraPosition[1],e[2]=this._cameraPosition[2],e}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(e){let{overscaledTileID:t,applyGlobeMatrix:i}=e,r=this._helper.getMercatorTileCoordinates(t);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:r,clippingPlane:this._cachedClippingPlane,projectionTransition:+!!i,fallbackMatrix:this._globeViewProjMatrix32f,clipAntimeridian:0===t?.canonical.z}}_computeClippingPlane(e){let t=this.pitchInRadians,i=this.cameraToCenterDistance/e,r=Math.sin(t)*i,a=Math.cos(t)*i+1,n=1/Math.sqrt(r*r+a*a)*1,o=-r,s=a,l=Math.sqrt(o*o+s*s);o/=l,s/=l;let h=[0,o,s];G(h,h,[0,0,0],-this.bearingInRadians),q(h,h,[0,0,0],-1*this.center.lat*Math.PI/180),U(h,h,[0,0,0],this.center.lng*Math.PI/180);let u=1/R(h);return B(h,h,u),[...h,-n*u]}isLocationOccluded(e){return!this.isSurfacePointVisible(Ky(e))}transformLightDirection(e){let t=this._helper._center.lng*Math.PI/180,i=this._helper._center.lat*Math.PI/180,r=Math.cos(i),a=[Math.sin(t)*r,Math.sin(i),Math.cos(t)*r],n=[a[2],0,-a[0]],o=[0,0,0];j(o,n,a),O(n,n),O(o,o);let s=[0,0,0];return O(s,[n[0]*e[0]+o[0]*e[1]+a[0]*e[2],n[1]*e[0]+o[1]*e[1]+a[1]*e[2],n[2]*e[0]+o[2]*e[1]+a[2]*e[2]]),s}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(e,t,i){let r=function(e,t,i){let r=1/(1<<i.z);return new zp(e/ne*r+i.x*r,t/ne*r+i.y*r)}(e,t,i.canonical),a=function(e,t){return[xe(e*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-t*Math.PI*2))-.5*Math.PI]}(r.x,r.y);return this.getCircleRadiusCorrection()/Math.cos(a[1])}projectTileCoordinates(e,t,i,r){let a=i.canonical,n=Yy(e,t,a.x,a.y,a.z),o=1+(r?r(e,t):0)/bp,s=[n[0]*o,n[1]*o,n[2]*o,1];H(s,s,this._globeViewProjMatrixF64);let l=this._cachedClippingPlane,h=l[0]*n[0]+l[1]*n[1]+l[2]*n[2]+l[3]<0;return{point:new d(s[0]/s[3],s[1]/s[3]),signedDistanceFromCamera:s[3],isOccluded:h}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;let e=Jy(this.worldSize,this.center.lat),t=ue();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*e),A(t,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);let i=this.centerOffset;t[8]=2*-i.x/this._helper._width,t[9]=2*i.y/this._helper._height,this._projectionMatrix=b(t),this._globeProjMatrixInverted=ue(),T(this._globeProjMatrixInverted,t),P(t,t,[0,0,-this.cameraToCenterDistance]),I(t,t,this.rollInRadians),C(t,t,-this.pitchInRadians),I(t,t,this.bearingInRadians),P(t,t,[0,0,-e]);let r=he();r[0]=e,r[1]=e,r[2]=e,C(t,t,this.center.lat*Math.PI/180),M(t,t,-this.center.lng*Math.PI/180),E(t,t,r),this._globeViewProjMatrixF64=t,this._globeViewProjMatrix32f=new Float32Array(t),this._globeViewProjMatrixF64Inverted=ue(),T(this._globeViewProjMatrixF64Inverted,t);let a=he();this._cameraPosition=he(),this._cameraPosition[2]=this.cameraToCenterDistance/e,G(this._cameraPosition,this._cameraPosition,a,-this.rollInRadians),q(this._cameraPosition,this._cameraPosition,a,this.pitchInRadians),G(this._cameraPosition,this._cameraPosition,a,-this.bearingInRadians),F(this._cameraPosition,this._cameraPosition,[0,0,1]),q(this._cameraPosition,this._cameraPosition,a,-this.center.lat*Math.PI/180),U(this._cameraPosition,this._cameraPosition,a,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(e);let n=b(this._globeViewProjMatrixF64Inverted);E(n,n,[1,1,-1]),this._cachedFrustum=Oy.fromInvProjectionMatrix(n,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(e){je("calculateFogMatrix is not supported on globe projection.");let t=ue();return w(t),t}getVisibleUnwrappedCoordinates(e){return[new Rp(0,e)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){e?je("terrain is not fully supported on vertical perspective projection."):this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(e,t){if(!this._globeViewProjMatrixF64)return 1;let i=Ky(e);B(i,i,1+t/bp);let r=le();return H(r,[i[0],i[1],i[2],1],this._globeViewProjMatrixF64),r[2]/r[3]}populateCache(e){}getBounds(){let e=.5*this.width,t=.5*this.height,i=[new d(0,0),new d(e,0),new d(this.width,0),new d(this.width,t),new d(this.width,this.height),new d(e,this.height),new d(0,this.height),new d(0,t)],r=[];for(let e of i)r.push(this.unprojectScreenPoint(e));let a=0,n=0,o=0,s=0,l=this.center;for(let e of r){let t=ye(l.lng,e.lng),i=ye(l.lat,e.lat);t<n&&(n=t),t>a&&(a=t),i<s&&(s=i),i>o&&(o=i)}let h=[l.lng+n,l.lat+s,l.lng+a,l.lat+o];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 Cg(h)}calculateCenterFromCameraLngLatAlt(e,t,i,r){return this._helper.calculateCenterFromCameraLngLatAlt(e,t,i,r)}setLocationAtPoint(e,t){let i=Ky(this.unprojectScreenPoint(t)),r=Ky(e),a=he();!function(e){e[0]=0,e[1]=0,e[2]=0}(a);let n=he();U(n,i,a,-this.center.lng*Math.PI/180),q(n,n,a,this.center.lat*Math.PI/180);let o=r[0]*r[0]+r[2]*r[2],s=n[0]*n[0];if(o<s)return;let l=Math.sqrt(o-s),h=-l,u=_e(r[0],r[2],n[0],l),c=_e(r[0],r[2],n[0],h),p=he();U(p,r,a,-u);let d=_e(p[1],p[2],n[1],n[2]),f=he();U(f,r,a,-c);let m,g,_=_e(f[1],f[2],n[1],n[2]),y=.5*Math.PI,v=d>=-y&&d<=y,x=_>=-y&&_<=y;if(v&&x){let e=this.center.lng*Math.PI/180,t=this.center.lat*Math.PI/180;ve(u,e)+ve(d,t)<ve(c,e)+ve(_,t)?(m=u,g=d):(m=c,g=_)}else if(v)m=u,g=d;else{if(!x)return;m=c,g=_}let b=m/Math.PI*180,w=g/Math.PI*180,T=this.center.lat;this.setCenter(new wp(b,Ee(w,-90,90))),this.setZoom(this.zoom+tv(T,this.center.lat))}locationToScreenPoint(e,t){let i=Ky(e);return t&&B(i,i,1+t.getElevationForLngLatZoom(e,this._helper._tileZoom)/bp),this._projectSurfacePointToScreen(i)}_projectSurfacePointToScreen(e){let t=le();return H(t,[...e,1],this._globeViewProjMatrixF64),t[0]/=t[3],t[1]/=t[3],new d((.5*t[0]+.5)*this.width,(.5*-t[1]+.5)*this.height)}screenPointToMercatorCoordinate(e,t){if(t){let i=t.pointCoordinate(e);if(i)return i}return zp.fromLngLat(this.unprojectScreenPoint(e))}screenPointToLocation(e,t){return this.screenPointToMercatorCoordinate(e,t)?.toLngLat()}isPointOnMapSurface(e,t){let i=this._cameraPosition,r=this.getRayDirectionFromPixel(e);return!!this.rayPlanetIntersection(i,r)}getRayDirectionFromPixel(e){let t=le();t[0]=e.x/this.width*2-1,t[1]=-1*(e.y/this.height*2-1),t[2]=1,t[3]=1,H(t,t,this._globeViewProjMatrixF64Inverted),t[0]/=t[3],t[1]/=t[3],t[2]/=t[3];let i=he();i[0]=t[0]-this._cameraPosition[0],i[1]=t[1]-this._cameraPosition[1],i[2]=t[2]-this._cameraPosition[2];let r=he();return O(r,i),r}isSurfacePointVisible(e){let t=this._cachedClippingPlane;return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]>=0}isSurfacePointOnScreen(e){if(!this.isSurfacePointVisible(e))return!1;let t=le();return H(t,[...e,1],this._globeViewProjMatrixF64),t[0]/=t[3],t[1]/=t[3],t[2]/=t[3],t[0]>-1&&t[0]<1&&t[1]>-1&&t[1]<1&&t[2]>-1&&t[2]<1}rayPlanetIntersection(e,t){let i=V(e,t),r=he(),a=he();B(a,t,i),Z(r,e,a);let n=1-V(r,r);if(n<0)return null;let o=V(e,e)-1,s=-i+(i<0?1:-1)*Math.sqrt(n),l=o/s,h=s;return{tMin:Math.min(l,h),tMax:Math.max(l,h)}}unprojectScreenPoint(e){let t=this._cameraPosition,i=this.getRayDirectionFromPixel(e),r=this.rayPlanetIntersection(t,i);if(r){let e=he();F(e,t,[i[0]*r.tMin,i[1]*r.tMin,i[2]*r.tMin]);let a=he();return O(a,e),Qy(a)}let a=this._cachedClippingPlane,n=a[0]*i[0]+a[1]*i[1]+a[2]*i[2],o=-fe(a,t)/n,s=he();if(o>0)F(s,t,[i[0]*o,i[1]*o,i[2]*o]);else{let e=he();F(e,t,[2*i[0],2*i[1],2*i[2]]);let r=fe(this._cachedClippingPlane,e);Z(s,e,[this._cachedClippingPlane[0]*r,this._cachedClippingPlane[1]*r,this._cachedClippingPlane[2]*r])}let l=function(e){let t=he();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])}}(a);return Qy(function(e,t,i){let r=he();Z(r,i,e);let a=he();return function(e,t,i,r){e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r}(a,e,r,t/W(r)),a}(l.center,l.radius,s))}getProjectionDataForCustomLayer(e=!0){let t=this.getProjectionData({overscaledTileID:new Lp(0,0,0,0,0),applyGlobeMatrix:e});return t.tileMercatorCoords=[0,0,1,1],t}getFastPathSimpleProjectionMatrix(e){}},pv=class e{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(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,t,i){this._helper.interpolatePadding(e,t,i)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,t,i=!0){this._helper.resize(e,t,i)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}setConstrainOverride(e){this._helper.setConstrainOverride(e)}overrideNearFarZ(e,t){this._helper.overrideNearFarZ(e,t)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}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(e){this._globeness=e,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(e){this._globeness=1,this.defaultConstrain=(e,t)=>this.currentTransform.defaultConstrain(e,t),this.applyConstrain=(e,t)=>this._helper.applyConstrain(e,t),this._helper=new Ly({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(e,t)=>this.defaultConstrain(e,t)},e),this._globeness=1,this._mercatorTransform=new Vy,this._verticalPerspectiveTransform=new cv}clone(){let t=new e;return t._globeness=this._globeness,t.apply(this,!1),t}apply(e,t){this._helper.apply(e,t),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(e){let t=this._mercatorTransform.getProjectionData(e),i=this._verticalPerspectiveTransform.getProjectionData(e);return{mainMatrix:this.isGlobeRendering?i.mainMatrix:t.mainMatrix,clippingPlane:i.clippingPlane,tileMercatorCoords:i.tileMercatorCoords,projectionTransition:e.applyGlobeMatrix?this._globeness:0,fallbackMatrix:t.fallbackMatrix,clipAntimeridian:i.clipAntimeridian}}isLocationOccluded(e){return this.currentTransform.isLocationOccluded(e)}transformLightDirection(e){return this.currentTransform.transformLightDirection(e)}getPixelScale(){return we(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return we(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(e,t,i){return we(this._mercatorTransform.getPitchedTextCorrection(e,t,i),this._verticalPerspectiveTransform.getPitchedTextCorrection(e,t,i),this._globeness)}projectTileCoordinates(e,t,i,r){return this.currentTransform.projectTileCoordinates(e,t,i,r)}_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(e){return this.currentTransform.calculateFogMatrix(e)}getVisibleUnwrappedCoordinates(e){return this.currentTransform.getVisibleUnwrappedCoordinates(e)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(e){this.currentTransform.recalculateZoomAndCenter(e)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(e,t){return this.currentTransform.lngLatToCameraDepth(e,t)}populateCache(e){this._mercatorTransform.populateCache(e),this._verticalPerspectiveTransform.populateCache(e)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(e,t,i,r){return this._helper.calculateCenterFromCameraLngLatAlt(e,t,i,r)}setLocationAtPoint(e,t){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(e,t),void this.apply(this._mercatorTransform,!1);this._verticalPerspectiveTransform.setLocationAtPoint(e,t),this.apply(this._verticalPerspectiveTransform,!1)}locationToScreenPoint(e,t){return this.currentTransform.locationToScreenPoint(e,t)}screenPointToMercatorCoordinate(e,t){return this.currentTransform.screenPointToMercatorCoordinate(e,t)}screenPointToLocation(e,t){return this.currentTransform.screenPointToLocation(e,t)}
2isPointOnMapSurface(e,t){return this.currentTransform.isPointOnMapSurface(e,t)}getRayDirectionFromPixel(e){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(e)}getProjectionDataForCustomLayer(e=!0){let t=this._mercatorTransform.getProjectionDataForCustomLayer(e);if(!this.isGlobeRendering)return t;let i=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(e);return i.fallbackMatrix=t.mainMatrix,i}getFastPathSimpleProjectionMatrix(e){return this.currentTransform.getFastPathSimpleProjectionMatrix(e)}},dv=class e{get useGlobeControls(){return!0}handlePanInertia(e,t){let i=iv(e,t);return Math.abs(i.lng-t.center.lng)>180&&(i.lng=t.center.lng+179.5*Math.sign(i.lng-t.center.lng)),{easingCenter:i,easingOffset:new d(0,0)}}handleMapControlsRollPitchBearingZoom(e,t){let i=e.around,r=t.screenPointToLocation(i);e.bearingDelta&&t.setBearing(t.bearing+e.bearingDelta),e.pitchDelta&&t.setPitch(t.pitch+e.pitchDelta),e.rollDelta&&t.setRoll(t.roll+e.rollDelta);let a=t.zoom;e.zoomDelta&&t.setZoom(t.zoom+e.zoomDelta);let n=t.zoom-a;if(0===n)return;let o=ye(t.center.lng,r.lng),s=o/(Math.abs(o/180)+1),l=ye(t.center.lat,r.lat),h=t.getRayDirectionFromPixel(i),u=t.cameraPosition,c=-1*V(u,h),p=he();F(p,u,[h[0]*c,h[1]*c,h[2]*c]);let d=R(p)-1,f=Math.exp(.5*-Math.max(d-.3,0)),m=Jy(t.worldSize,t.center.lat)/Math.min(t.width,t.height),g=be(m,.9,.5,1,.25),_=(1-ke(-n))*Math.min(f,g),y=t.center.lat,v=t.zoom,x=new wp(t.center.lng+s*_,Ee(t.center.lat+l*_,-Qe,Qe));t.setLocationAtPoint(r,i);let b=t.center,w=be(Math.abs(o),45,85,0,1),T=be(m,.75,.35,0,1),S=Math.max(w,T)**.25,P=ye(b.lng,x.lng),E=ye(b.lat,x.lat);t.setCenter(new wp(b.lng+P*S,b.lat+E*S).wrap()),t.setZoom(v+tv(y,t.center.lat))}handleMapControlsPan(e,t,i){if(!e.panDelta)return;let r=t.center.lat,a=t.zoom;t.setCenter(iv(e.panDelta,t).wrap()),t.setZoom(a+tv(r,t.center.lat))}cameraForBoxAndBearing(t,i,r,a,n){let o=qy(t,i,r,a,n),s=i.left/n.width*2-1,l=(n.width-i.right)/n.width*2-1,h=i.top/n.height*-2+1,u=(n.height-i.bottom)/n.height*-2+1,c=ye(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()),g=p+.5*ye(p,d),_=f+.5*ye(f,m),y=n.clone();y.setCenter(o.center),y.setBearing(o.bearing),y.setPitch(0),y.setRoll(0),y.setZoom(o.zoom);let v=y.modelViewProjectionMatrix,x=[Ky(r.getNorthWest()),Ky(r.getNorthEast()),Ky(r.getSouthWest
vendor: 4,698 bytes, line 2
2()),Ky(r.getSouthEast()),Ky(new wp(d,_)),Ky(new wp(p,_)),Ky(new wp(g,f)),Ky(new wp(g,m))],b=Ky(o.center),w=1/0;for(let t of x)s<0&&(w=e.getLesserNonNegativeNonNull(w,e.solveVectorScale(t,b,v,"x",s))),l>0&&(w=e.getLesserNonNegativeNonNull(w,e.solveVectorScale(t,b,v,"x",l))),h>0&&(w=e.getLesserNonNegativeNonNull(w,e.solveVectorScale(t,b,v,"y",h))),u<0&&(w=e.getLesserNonNegativeNonNull(w,e.solveVectorScale(t,b,v,"y",u)));if(Number.isFinite(w)&&0!==w)return o.zoom=Math.min(y.zoom+De(w),t.maxZoom),o;jy()}handleJumpToCenterZoom(e,t){let i=e.center.lat,r=e.applyConstrain(t.center?wp.convert(t.center):e.center,e.zoom).center;e.setCenter(r.wrap());let a=void 0===t.zoom?e.zoom+tv(i,r.lat):+t.zoom;e.zoom!==a&&e.setZoom(a)}handleEaseTo(e,t){let i=e.zoom,r=e.center,a=e.padding,n={roll:e.roll,pitch:e.pitch,bearing:e.bearing},o={roll:void 0===t.roll?e.roll:t.roll,pitch:void 0===t.pitch?e.pitch:t.pitch,bearing:void 0===t.bearing?e.bearing:t.bearing},s=void 0!==t.zoom,l=!e.isPaddingEqual(t.padding),h=!1,u=t.center?wp.convert(t.center):r,c=e.applyConstrain(u,i).center;Dy(e,c);let p=e.clone();p.setCenter(c),p.setZoom(s?+t.zoom:i+tv(r.lat,u.lat)),p.setBearing(t.bearing);let f=new d(Ee(e.centerPoint.x+t.offsetAsPoint.x,0,e.width),Ee(e.centerPoint.y+t.offsetAsPoint.y,0,e.height));p.setLocationAtPoint(c,f);let m=(t.offset&&t.offsetAsPoint.mag())>0?p.center:c,g=s?+t.zoom:i+tv(r.lat,m.lat),_=i+tv(r.lat,0),y=g+tv(m.lat,0),v=ye(r.lng,m.lng),x=ye(r.lat,m.lat),b=ke(y-_);return h=g!==i,{easeFunc:i=>{if(Ye(n,o)||Ny({startEulerAngles:n,endEulerAngles:o,tr:e,k:i,useSlerp:n.roll!=o.roll}),l&&e.interpolatePadding(a,t.padding,i),t.around)je("Easing around a point is not supported under globe projection."),e.setLocationAtPoint(t.around,t.aroundPoint);else{let t=i*(y>_?Math.min(2,b):Math.max(.5,b))**(1-i),a=av(r,v,x,t);e.setCenter(a.wrap())}if(h){let t=hr.number(_,y,i)+tv(0,e.center.lat);e.setZoom(t)}},isZooming:h,elevationCenter:m}}handleFlyTo(e,t){let i=void 0!==t.zoom,r=e.center,a=e.zoom,n=e.padding,o=!e.isPaddingEqual(t.padding),s=e.applyConstrain(wp.convert(t.center||t.locationAtOffset),a).center,l=i?+t.zoom:e.zoom+tv(e.center.lat,s.lat),h=e.clone();h.setCenter(s),h.setZoom(l),h.setBearing(t.bearing);let u=new d(Ee(e.centerPoint.x+t.offsetAsPoint.x,0,e.width),Ee(e.centerPoint.y+t.offsetAsPoint.y,0,e.height));h.setLocationAtPoint(s,u);let c=h.center;Dy(e,c);let p=function(e,t,i){let r=V(Ky(t),Ky(i)),a=Math.acos(r),n=Xy(e);return a/(2*Math.PI)*n}(e,r,c),f=a+tv(r.lat,0),m=l+tv(c.lat,0),g=ke(m-f),_="number"==typeof t.minZoom?+t.minZoom:e.minZoom,y=Math.max(_,e.minZoom)+tv(c.lat,0),v=Math.min(y,f,m)+tv(0,c.lat),x=ke(e.applyConstrain(c,v).zoom+tv(c.lat,0)-f),b=ye(r.lng,c.lng),w=ye(r.lat,c.lat);return{easeFunc:(i,a,s,h)=>{let u=av(r,b,w,s);o&&e.interpolatePadding(n,t.padding,i);let p=1===i?c:u;e.setCenter(p.wrap());let d=f+De(a);e.setZoom(1===i?l:d+tv(0,p.lat))},scaleOfZoom:g,targetCenter:c,scaleOfMinZoom:x,pixelPathLength:p}}static solveVectorScale(e,t,i,r,a){let n=a,o="x"===r?[i[0],i[4],i[8],i[12]]:[i[1],i[5],i[9],i[13]],s=[i[3],i[7],i[11],i[15]],l=e[0]*o[0]+e[1]*o[1]+e[2]*o[2],h=e[0]*s[0]+e[1]*s[1]+e[2]*s[2],u=t[0]*o[0]+t[1]*o[1]+t[2]*o[2],c=t[0]*s[0]+t[1]*s[1]+t[2]*s[2];return u+n*h===l+n*c||s[3]*(l-u)+o[3]*(c-h)+l*c==u*h?null:(u+o[3]-n*c-n*s[3])/(u-l-n*c+n*h)}static getLesserNonNegativeNonNull(e,t){return null!==t&&t>=0&&t<e?t:e}},fv=class{constructor(e){this._globe=e,this._mercatorCameraHelper=new $y,this._verticalPerspectiveCameraHelper=new dv}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)}};const mv=function(){let e={},t=wt.$version;for(let i in wt.$root){let r=wt.$root[i];if(r.required){let a=null;a="version"===i?t:"array"===r.type?[]:{},null!=a&&(e[i]=a)}}return e}();var gv=class extends bt{constructor(e,t={}){super(),this._rtlPluginLoaded=()=>{for(let e in this.tileManagers){let t=this.tileManagers[e].getSource().type;("vector"===t||"geojson"===t)&&this.tileManagers[e].reload()}},this.map=e,this.dispatcher=new yg(_g(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",((e,t)=>
2this.getGlyphs(e,t))),this.dispatcher.registerMessageHandler("GI",((e,t)=>this.getImages(e,t))),this.dispatcher.registerMessageHandler("GDA",((e,t)=>this.getDashes(e,t))),this.imageManager=new Km,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 ng(e._requestManager,t.localIdeographFontFamily,i),this.lineAtlas=new ug(256,512),this.crossTileSymbolIndex=new Ty,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",dt()),Xg().on(Zg,this._rtlPluginLoaded),this.on("data",(e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;let t=this.tileManagers[e.sourceId];if(!t)return;let i=t.getSource();if(i?.vectorLayerIds)for(let e in this._layers){let t=this._layers[e];t.source===i.id&&this._validateLayer(t)}}))}_setInitialValues(){this._spritesImagesIds={},this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new xo,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=null===t?this.stylesheet.state?.[e]?.default??null:t;if(Be(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)Be(this._globalState[i],e[i].default)||(t.push(i),this._globalState[i]=e[i].default);this._applyGlobalStateChanges(t)}_applyGlobalStateChanges(e){if(0===e.length)return;let t=new Set,i={};for(let r of e){i[r]=this._globalState[r];for(let e in this._layers){let i=this._layers[e],a=i.getLayoutAffectingGlobalStateRefs(),n=i.getPaintAffectingGlobalStateRefs(),o=i.getVisibilityAffectingGlobalStateRefs();if(a.has(r)&&t.add(i.source),n.has(r))for(let{name:e,value:t}of n.get(r))this._updatePaintProperty(i,e,t);o?.has(r)&&(i.recalculateVisibility(),this._updateLayer(i))}}this.dispatcher.broadcast("UGS",i);for(let e in this.tileManagers)t.has(e)&&(this._reloadSource(e),this._changed=!0)}async loadURL(e,t={},i){this.fire(new Om("dataloading")),t.validate="boolean"!=typeof t.validate||t.validate,this._loadStyleRequest=new AbortController;let r=this._loadStyleRequest;try{let a=await this.map._requestManager.transformRequest(e,"Style");lt(r.signal);let n=await mt(a,r);this._loadStyleRequest===r&&(this._loadStyleRequest=null),this._load(n.data,t,i)}catch(e){this._loadStyleRequest===r&&(this._loadStyleRequest=null),e&&!r.signal.aborted&&this.fire(new xt(se(e)))}}loadJSON(e,t={},i){this.fire(new Om("dataloading")),this._frameRequest=new AbortController,Im.frameAsync(this._frameRequest,this.map._ownerWindow).then((()=>{this._frameRequest=null,t.validate=!1!==t.validate,this._load(e,t,i)})).catch((()=>{}))}loadEmpty(){this.fire(new Om("dataloading")),this._load(mv,{validate:!1})}_load(e,t,i){let r=t.transformStyle?t.transformStyle(i,e):e;if(!t.validate||!lo(this,r)){r={...r},this._loaded=!0,this.stylesheet=r;for(let e in r.sources)this.addSource(e,r.sources[e],{validate:!1});r.sprite?this._loadSprite(r.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(r.glyphs),this._createLayers(),this.light=new sg(this.stylesheet.light??{},this._globalState),this._setProjectionInternal(this.stylesheet.projection?.type||"mercator"),this.sky=new hg(this.stylesheet.sky,this._globalState),this.map.setTerrain(this.stylesheet.terrain??null,{validate:!1}),this.fire(new Om("data")),this.fire(new Bm)}}_createLayers(){let e=Pt(this.stylesheet.layers);this.setGlobalState(this.stylesheet.state??null),this.dispatcher.broadcast("SL",e),this._order=e.map((e=>e.id)),this._layers={},this._serializedLayers=null;for(let t of e){let e=_p(t,this._globalState);if(e.setEventedParent(this,{layer:{id:t.id}}),this._layers[t.id]=e,Qo(e)&&this.tileManagers[e.source]){let i=t.paint?.["raster-fade-duration"]??e.paint.get("raster-fade-duration");this.tileManagers[e.source].setRasterFadeDuration(i)}}}_loadSprite(e,t=!1,i=void 0){this.imageManager.setLoaded(!1);let r,a=new AbortController;this._spriteRequest=a,Ym(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((e=>{if(this._spriteRequest=null,e)for(let i in e){this._spritesImagesIds[i]=[];let r=this._spritesImagesIds[i]?this._spritesImagesIds[i].filter((t=>!(t in e))):[];for(let e of r)this.imageManager.removeImage(e),this._changedImages[e]=!0;for(let r in e[i]){let a="default"===i?r:`${i}:${r}`;this._spritesImagesIds[i].push(a),a in this.imageManager.images?this.imageManager.updateImage(a,e[i][r],!1):this.imageManager.addImage(a,e[i][r]),t&&(this._changedImages[a]=!0)}}})).catch((e=>{this._spriteRequest=null,r=e,a.signal.aborted||this.fire(new xt(r))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),t&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new Om("data")),i&&i(r)}))}_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 Om("data"))}_validateLayer(e){let t=this.tileManagers[e.source];if(!t)return;let i=e.sourceLayer;if(!i)return;let r=t.getSource();("geojson"===r.type||r.vectorLayerIds&&!r.vectorLayerIds.includes(i))&&this.fire(new xt(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||0===e.length)return Object.values(t?Oe(i):i);let r=[];for(let a of e)if(i[a]){let e=t?Oe(i[a]):i[a];r.push(e)}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 t=this._layers[i];"custom"!==t.type&&(e[i]=t.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 t=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);(t.length||i.length)&&this._updateWorkerLayers(t,i);for(let e in this._updatedSources){let t=this._updatedSources[e];if("reload"===t)this._reloadSource(e);else{if("clear"!==t)throw Error(`Invalid action ${t}`);this._clearSource(e)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let t in this._updatedPaintProps)this._layers[t].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}let i={};for(let e in this.tileManagers){let t=this.tileManagers[e];i[e]=t.used,t.used=!1}for(let t of this._order){let i=this._layers[t];
vendor: 16,447 bytes, line 2
2i.recalculate(e,this._availableImages),!i.isHidden(e.zoom)&&i.source&&(this.tileManagers[i.source].used=!0)}for(let e in i){let t=this.tileManagers[e];!!i[e]!=!!t.used&&t.fire(new Vm("data",{sourceDataType:"visibility",sourceId:e}))}this.light.recalculate(e),this.sky.recalculate(e),this.projection.recalculate(e),this.z=e.zoom,t&&this.fire(new Om("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??1)&&lo(this,e))return!1;(e=Oe(e)).layers=Pt(e.layers);let r=Lt(i,e),a=this._getOperationsToPerform(r);if(a.unimplemented.length>0)throw Error(`Unimplemented: ${a.unimplemented.join(", ")}.`);if(0===a.operations.length)return!1;for(let e of a.operations)e();return this.stylesheet=e,this._serializedLayers=null,this.fire(new Bm({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)}return{operations:t,unimplemented:i}}addImage(e,t){this.getImage(e)?this.fire(new xt(Error(`An image named "${e}" already exists.`))):(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){this.getImage(e)?(this.imageManager.removeImage(e),this._afterImageUpdated(e)):this.fire(new xt(Error(`An image named "${e}" does not exist.`)))}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._imagesListDirty=!0,this._changed=!0,this.fire(new Om("data"))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,t,i={}){if(this._checkLoaded(),void 0!==this.tileManagers[e])throw Error(`Source "${e}" already exists.`);if(!t.type)throw Error(`The type property must be defined, but only the following properties were given: ${Object.keys(t).join(", ")}.`);if(so.has(t.type)&&this._validate(oo.source,`sources.${e}`,t,null,i))return;this.map?._collectResourceTiming&&(t.collectResourceTiming=!0);let r=this.tileManagers[e]=new b_(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(),void 0===this.tileManagers[e])throw Error(`There is no source with this ID=${e}`);for(let t in this._layers)if(this._layers[t].source===e)return this.fire(new xt(Error(`Source "${e}" cannot be removed while layer "${t}" is using it.`)));let t=this.tileManagers[e];delete this.tileManagers[e],delete this._updatedSources[e],t.fire(new Vm("data",{sourceDataType:"metadata",sourceId:e})),t.setEventedParent(null),t.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,t){if(this._checkLoaded(),void 0===this.tileManagers[e])throw Error(`There is no source with this ID=${e}`);let i=this.tileManagers[e].getSource();if("geojson"!==i.type)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,a=e.id;if(this.getLayer(a))return void this.fire(new xt(Error(`Layer "${a}" already exists on this map.`)));if("custom"===e.type){if(ho(this,function(e){let t=[],i=e.id;return void 0===i&&t.push(new Ft(`layers.${i}`,null,'missing required property "id"')),void 0===e.render&&t.push(new Ft(`layers.${i}`,null,'missing required method "render"')),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push(new Ft(`layers.${i}`,null,'property "renderingMode" must be either "2d" or "3d"')),t}(e)))return;r=_p(e,this._globalState)}else{if("source"in e&&"object"==typeof e.source&&(this.addSource(a,e.source),e=Me(e=Oe(e),{source:a})),this._validate(oo.layer,`layers.${a}`,e,{arrayIndex:-1},i))return;r=_p(e,this._globalState),this._validateLayer(r),r.setEventedParent(this,{layer:{id:a}})}let n=t?this._order.indexOf(t):this._order.length;if(t&&-1===n)this.fire(new xt(Error(`Cannot add layer "${a}" before non-existing layer "${t}".`)));else{if(this._order.splice(n,0,a),this._layerOrderChanged=!0,this._layers[a]=r,this._removedLayers[a]&&r.source&&"custom"!==r.type){let e=this._removedLayers[a];delete this._removedLayers[a],e.type===r.type?(this._updatedSources[r.source]="reload",this.tileManagers[r.source].pause()):this._updatedSources[r.source]="clear"}this._updateLayer(r),r.onAdd&&r.onAdd(this.map)}}moveLayer(e,t){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new xt(Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));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;t&&-1===r?this.fire(new xt(Error(`Cannot move layer "${e}" before non-existing layer "${t}".`))):(this._order.splice(r,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();let t=this._layers[e];if(!t)return void this.fire(new xt(Error(`Cannot remove non-existing layer "${e}".`)));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);r?(r.minzoom!==t||r.maxzoom!==i)&&(null!=t&&(r.minzoom=t),null!=i&&(r.maxzoom=i),this._updateLayer(r)):this.fire(new xt(Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,t,i={}){this._checkLoaded();let r=this.getLayer(e);if(r){if(!Be(r.filter,t)){if(null==t)return r.setFilter(void 0),void this._updateLayer(r);this._validate(oo.filter,`layers.${r.id}.filter`,t,null,i)||(r.setFilter(Oe(t)),this._updateLayer(r))}}else this.fire(new xt(Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return Oe(this.getLayer(e).filter)}setLayoutProperty(e,t,i,r={}){this._checkLoaded();let a=this.getLayer(e);a?Be(a.getLayoutProperty(t),i)||(a.setLayoutProperty(t,i,r),this._updateLayer(a)):this.fire(new xt(Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,t){let i=this.getLayer(e);if(i)return i.getLayoutProperty(t);this.fire(new xt(Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,t,i,r={}){this._checkLoaded();let a=this.getLayer(e);a?Be(a.getPaintProperty(t),i)||this._updatePaintProperty(a,t,i,r):this.fire(new xt(Error(`Cannot style non-existing layer "${e}".`)))}_updatePaintProperty(e,t,i,r={}){e.setPaintProperty(t,i,r)&&this._updateLayer(e),Qo(e)&&"raster-fade-duration"===t&&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(void 0===a)return void this.fire(new xt(Error(`The source '${i}' does not exist in the map's style.`)));let n=a.getSource().type;if("geojson"===n&&r)return void this.fire(new xt(Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===n&&!r)return void this.fire(new xt(Error("The sourceLayer parameter must be provided for vector source types.")));if(void 0===e.id)return void this.fire(new xt(Error("The feature id parameter must be provided.")));let o=["__proto__","constructor","prototype"];t&&Object.keys(t).some((e=>o.includes(e)))?this.fire(new xt(Error(`The feature state should not include one of the following keys: ${o}`))):a.setFeatureState(r,e.id,t)}removeFeatureState(e,t){this._checkLoaded();let i=e.source,r=this.tileManagers[i];if(void 0===r)return void this.fire(new xt(Error(`The source '${i}' does not exist in the map's style.`)));let a=r.getSource().type,n="vector"===a?e.sourceLayer:void 0;"vector"!==a||n?t&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new xt(Error("A feature id is required to remove its specific state property."))):r.removeFeatureState(n,e.id,t):this.fire(new xt(Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();let t=e.source,i=e.sourceLayer,r=this.tileManagers[t];if(void 0!==r){if("vector"!==r.getSource().type||i)return void 0===e.id&&this.fire(new xt(Error("The feature id parameter must be provided."))),r.getFeatureState(i,e.id);this.fire(new xt(Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new xt(Error(`The source '${t}' does not exist in the map's style.`)))}getTransition(){return Me({duration:300,delay:0},this.stylesheet?.transition)}serialize(){if(!this._loaded)return;let e=Le(this.tileManagers,(e=>e.serialize())),t=this._serializeByIds(this._order,!0),i=this.map.getTerrain()||void 0,r=this.stylesheet;return Fe({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},(e=>void 0!==e))}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.tileManagers[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.tileManagers[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){let t=e=>"fill-extrusion"===this._layers[e].type,i={},r=[];for(let a=this._order.length-1;a>=0;a--){let n=this._order[a];if(t(n)){i[n]=a;for(let t of e){let e=t[n];if(e)for(let t of e)r.push(t)}}}r.sort(((e,t)=>t.intersectionZ-e.intersectionZ));let a=[];for(let n=this._order.length-1;n>=0;n--){let o=this._order[n];if(t(o))for(let e=r.length-1;e>=0;e--){let t=r[e].feature;if(i[t.layer.id]<n)break;a.push(t),r.pop()}else for(let t of e){let e=t[o];if(e)for(let t of e)a.push(t.feature)}}return a}queryRenderedFeatures(e,t,i){t?.filter&&this._validate(oo.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 xt(Error("parameters.layers must be an Array or a Set of strings"))),[];for(let e of t.layers){let t=this._layers[e];if(!t)return this.fire(new xt(Error(`The layer '${e}' does not exist in the map's style and cannot be queried for features.`))),[];r[t.source]=!0}}let a=[];t.availableImages=this._availableImages;let n=this._serializedAllLayers(),o=t.layers instanceof Set?t.layers:Array.isArray(t.layers)?new Set(t.layers):null,s={...t,layers:o,globalState:this._globalState};for(let o in this.tileManagers)t.layers&&!r[o]||a.push(wg(this.tileManagers[o],this._layers,n,e,s,i,this.map.terrain?(e,t,i)=>this.map.terrain.getElevation(e,t,i):void 0));return this.placement&&a.push(Tg(this._layers,n,this.tileManagers,e,s,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(e,t){t?.filter&&this._validate(oo.filter,"querySourceFeatures.filter",t.filter,null,t);let i=this.tileManagers[e];return i?function(e,t){let i=e.getRenderableIds().map((t=>e.getTileByID(t))),r=[],a={};for(let e of i){let i=e.tileID.canonical.key;a[i]||(a[i]=!0,e.querySourceFeatures(r,t))}return r}(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 t in e)if(!Be(e[t],i[t])){r=!0;break}if(!r)return;let a={now:zm(),transition:Me({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 t in e)if(!Be(e[t],i[t])){r=!0;break}if(!r)return;let a={now:zm(),transition:Me({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,t),this.sky.updateTransitions(a)}_setProjectionInternal(e){let t=function(e,t,i){let r={constrainOverride:t};if(Array.isArray(e)){let t=new Hy({type:e},i);return{projection:t,transform:new pv(r),cameraHelper:new fv(t)}}switch(e){case"mercator":return{projection:new zy,transform:new Vy(r),cameraHelper:new $y};case"globe":{let e=new Hy({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]},{});return{projection:e,transform:new pv(r),cameraHelper:new fv(e)}}case"vertical-perspective":return{projection:new Wy,transform:new cv(r),cameraHelper:new dv};default:return je(`Unknown projection name: ${e}. Falling back to mercator projection.`),{projection:new zy,transform:new Vy(r),cameraHelper:new $y}}}(e,this.map._camera?.transform.constrainOverride,this._globalState);this.projection=t.projection,this.map.migrateProjection(t.transform,t.cameraHelper);for(let e in this.tileManagers)this.tileManagers[e].reload()}_validate(e,t,i,r,a={}){return uo(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),Xg().off(Zg,this._rtlPluginLoaded);for(let e in this._layers)this._layers[e].setEventedParent(null);for(let e in this.tileManagers){let t=this.tileManagers[e];t.setEventedParent(null),t.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 n=!1,o=!1,s={};for(let t of this._order){let i=this._layers[t];
2if("symbol"!==i.type)continue;if(!s[i.source]){let e=this.tileManagers[i.source];s[i.source]=e.getRenderableIds(!0).map((t=>e.getTileByID(t))).sort(((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)))}let r=this.crossTileSymbolIndex.addLayer(i,s[i.source],e.center.lng);n||=r}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),a||=this._layerOrderChanged||0===i,(a||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(zm(),e.zoom))&&(this.pauseablePlacement=new uy(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,s),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(zm()),o=!0),n&&this.pauseablePlacement.placement.setStale()),o||n)for(let e of this._order){let t=this._layers[e];"symbol"===t.type&&this.placement.updateLayerOpacities(t,s[t.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(zm())}_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={}){this._checkLoaded(),(!e||!this._validate(oo.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[e,r]of Object.entries(t.dashes))i[e]=this.lineAtlas.getDash(r.dasharray,r.round);return i}addSprite(e,t,i={},r){this._checkLoaded();let a=[{id:e,url:t}],n=[...Hm(this.stylesheet.sprite),...a];this._validate(oo.sprite,"sprite",n,null,i)||(this.stylesheet.sprite=n,this._loadSprite(a,!0,r))}removeSprite(e){this._checkLoaded();let t=Hm(this.stylesheet.sprite);if(t.find((t=>t.id===e))){if(this._spritesImagesIds[e])for(let t of this._spritesImagesIds[e])this.imageManager.removeImage(t),this._changedImages[t]=!0;t.splice(t.findIndex((t=>t.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 Om("data"))}else this.fire(new xt(Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return Hm(this.stylesheet.sprite)}setSprite(e,t={},i){this._checkLoaded(),(!e||!this._validate(oo.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 _v=as([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);var yv=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,n,o,s,l){this.context=e;let h=this.boundPaintVertexBuffers.length!==r.length;for(let e=0;!h&&e<r.length;e++)this.boundPaintVertexBuffers[e]!==r[e]&&(h=!0);!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==i||h||this.boundIndexBuffer!==a||this.boundVertexOffset!==n||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s||this.boundDynamicVertexBuffer3!==l?this.freshBind(t,i,r,a,n,o,s,l):(e.bindVertexArray.set(this.vao),o&&o.bind(),a?.dynamicDraw&&a.bind(),s&&s.bind(),l&&l.bind())}freshBind(e,t,i,r,a,n,o,s){let l=e.numAttributes,h=this.context,u=h.gl;this.vao&&this.destroy(),this.vao=h.createVertexArray(),h.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=r,this.boundVertexOffset=a,this.boundDynamicVertexBuffer=n,this.boundDynamicVertexBuffer2=o,this.boundDynamicVertexBuffer3=s,t.enableAttributes(u,e);for(let t of i)t.enableAttributes(u,e);n&&n.enableAttributes(u,e),o&&o.enableAttributes(u,e),s&&s.enableAttributes(u,e),t.bind(),t.setVertexAttribPointers(u,e,a);for(let t of i)t.bind(),t.setVertexAttribPointers(u,e,a);n&&(n.bind(),n.setVertexAttribPointers(u,e,a)),r&&r.bind(),o&&(o.bind(),o.setVertexAttribPointers(u,e,a)),s&&(s.bind(),s.setVertexAttribPointers(u,e,a)),h.currentNumAttributes=l}destroy(){this.vao&&=(this.context.deleteVertexArray(this.vao),null)}};const vv=(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"):ki.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"):ki.white,u_horizon_fog_blend:i?i.properties.get("horizon-fog-blend"):1,u_is_globe_mode:+!!a}),xv=e=>({u_ele_delta:e}),bv=(e,t)=>
2({u_terrain_coords_id:e/255,u_texture:0,u_ele_delta:t});function wv(e){let t=[];for(let i of e){if(null===i)continue;let e=i.split(" ");t.push(e.pop())}return t}var Tv=class{constructor(e,t,i,r,a,n,o,s,l=[]){let h=e.gl;this.program=h.createProgram();let u=wv(t.staticAttributes),c=i?i.getBinderAttributes():[],p=u.concat(c),d=Py.prelude.staticUniforms?wv(Py.prelude.staticUniforms):[],f=o.staticUniforms?wv(o.staticUniforms):[],m=t.staticUniforms?wv(t.staticUniforms):[],g=i?i.getBinderUniforms():[],_=d.concat(f).concat(m).concat(g),y=[];for(let e of _)y.includes(e)||y.push(e);let v=i?i.defines():[];v.unshift("#version 300 es"),a&&v.push("#define OVERDRAW_INSPECTOR;"),n&&v.push("#define TERRAIN3D;"),s&&v.push(s),l&&v.push(...l);let x=v.concat(Py.prelude.fragmentSource,o.fragmentSource,t.fragmentSource).join("\n"),b=v.concat(Py.prelude.vertexSource,o.vertexSource,t.vertexSource).join("\n"),w=h.createShader(h.FRAGMENT_SHADER);if(h.isContextLost())return void(this.failedToCreate=!0);if(h.shaderSource(w,x),h.compileShader(w),!h.getShaderParameter(w,h.COMPILE_STATUS))throw Error(`Could not compile fragment shader: ${h.getShaderInfoLog(w)}`);h.attachShader(this.program,w);let T=h.createShader(h.VERTEX_SHADER);if(h.isContextLost())return void(this.failedToCreate=!0);if(h.shaderSource(T,b),h.compileShader(T),!h.getShaderParameter(T,h.COMPILE_STATUS))throw Error(`Could not compile vertex shader: ${h.getShaderInfoLog(T)}`);h.attachShader(this.program,T),this.attributes={};let S={};this.numAttributes=p.length;for(let e=0;e<this.numAttributes;e++)p[e]&&(this.attributes[p[e]]=e);h.linkProgram(this.program);for(let e in this.attributes){let t=h.getAttribLocation(this.program,e);t>=0&&(this.attributes[e]=t)}if(!h.getProgramParameter(this.program,h.LINK_STATUS))throw Error(`Program failed to link: ${h.getProgramInfoLog(this.program)}`);h.deleteShader(T),h.deleteShader(w);for(let e of y)if(e&&!S[e]){let t=h.getUniformLocation(this.program,e);t&&(S[e]=t)}this.fixedUniforms=r(e,S),this.terrainUniforms=((e,t)=>({u_depth:new wl(e,t.u_depth),u_terrain:new wl(e,t.u_terrain),u_terrain_dim:new Tl(e,t.u_terrain_dim),u_terrain_matrix:new zl(e,t.u_terrain_matrix),u_terrain_unpack:new El(e,t.u_terrain_unpack),u_terrain_exaggeration:new Tl(e,t.u_terrain_exaggeration)}))(e,S),this.projectionUniforms=((e,t)=>({u_projection_matrix:new zl(e,t.u_projection_matrix),u_projection_tile_mercator_coords:new El(e,t.u_projection_tile_mercator_coords),u_projection_clipping_plane:new El(e,t.u_projection_clipping_plane),u_projection_transition:new Tl(e,t.u_projection_transition),u_projection_fallback_matrix:new zl(e,t.u_projection_fallback_matrix),u_projection_clip_antimeridian:new wl(e,t.u_projection_clip_antimeridian)}))(e,S),this.binderUniforms=i?i.getUniforms(e,S):[]}draw(e,t,i,r,a,n,o,s,l,h,u,c,p,d,f,m,g,_,y){let v=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(i),e.setStencilMode(r),e.setColorMode(a),e.setCullFace(n),s){e.activeTexture.set(v.TEXTURE2),v.bindTexture(v.TEXTURE_2D,s.depthTexture),e.activeTexture.set(v.TEXTURE3),v.bindTexture(v.TEXTURE_2D,s.texture);for(let e in this.terrainUniforms)this.terrainUniforms[e].set(s[e])}if(l){let e=(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}))(l);for(let t in this.projectionUniforms)this.projectionUniforms[t].set(e[t])}if(o)for(let e in this.fixedUniforms)this.fixedUniforms[e].set(o[e]);m&&m.setUniforms(e,this.binderUniforms,d,{zoom:f});let x=0;switch(t){case v.LINES:x=2;break;case v.TRIANGLES:x=3;break;case v.LINE_STRIP:x=1}for(let i of p.get())i.vaos||={},i.vaos[h]||=new yv,i.vaos[h].bind(e,this,u,m?m.getPaintVertexBuffers():[],c,i.vertexOffset,g,_,y),v.drawElements(t,i.primitiveLength*x,v.UNSIGNED_SHORT,i.primitiveOffset*x*2)}};function Sv(e,t,i){let r=1/oe(i,1,t.transform.tileZoom),a=2**i.tileID.overscaledZ,n=i.tileSize*2**t.transform.tileZoom/a,o=n*(i.tileID.canonical.x+i.tileID.wrap*a),s=n*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,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}const Pv=(e,t,i,r)=>{let a=e.style.light,n=a.getCartesianPosition(),o=v();"viewport"===a.properties.get("anchor")&&function(e,t){var i=Math.sin(t),r=Math.cos(t);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}(o,e.transform.bearingInRadians),function(e,t,i){var r=t[0],a=t[1],n=t[2];e[0]=r*i[0]+a*i[3]+n*i[6],e[1]=r*i[1]+a*i[4]+n*i[7],e[2]=r*i[2]+a*i[5]+n*i[8]}(n,n,o);let s=e.transform.transformLightDirection(n),l=a.properties.get("color");return{u_lightpos:n,u_lightpos_globe:s,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}},Ev=(e,t,i,r,a,n,o)=>
2Me(Pv(e,t,i,r),Sv(n,e,o),{u_height_factor:-(2**a.overscaledZ)/o.tileSize/8}),Cv=(e,t,i,r)=>Me(Sv(t,e,i),{u_fill_translate:r}),Mv=e=>({u_fill_translate:e}),Iv=(e,t)=>({u_world:e,u_fill_translate:t}),Av=(e,t,i,r,a)=>Me(Cv(e,t,i,a),{u_world:r}),zv=(e,t,i,r,a)=>{let n,o,s=e.transform,l=0;if("map"===i.paint.get("circle-pitch-alignment")){let e=oe(t,1,s.zoom);n=!0,o=[e,e],l=e/(ne*2**t.tileID.overscaledZ)*2*Math.PI*a}else n=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_pitch_with_map:+n,u_device_pixel_ratio:e.pixelRatio,u_extrude_scale:o,u_globe_extrude_scale:l,u_translate:r}},kv=e=>({u_pixel_extrude_scale:[1/e.width,1/e.height]}),Dv=e=>({u_viewport_size:[e.width,e.height]}),Rv=(e,t=1)=>({u_color:e,u_overlay:0,u_overlay_scale:t}),Lv=(e,t,i,r)=>{let a=oe(e,1,t)/(ne*2**e.tileID.overscaledZ)*2*Math.PI*r;return{u_extrude_scale:oe(e,1,t),u_intensity:i,u_globe_extrude_scale:a}},Fv=(e,t,i,r)=>{let a=x();z(a,0,e.width,e.height,0,0,1);let n=e.context.gl;return{u_matrix:a,u_world:[n.drawingBufferWidth,n.drawingBufferHeight],u_image:i,u_color_ramp:r,u_opacity:t.paint.get("heatmap-opacity")}},Bv=(e,t,i)=>{let r,a=i.paint.get("hillshade-accent-color");switch(i.paint.get("hillshade-method")){case"basic":r=4;break;case"combined":r=1;break;case"igor":r=2;break;case"multidirectional":r=3;break;default:r=0}let n=i.getIlluminationProperties();for(let t=0;t<n.directionRadians.length;t++)"viewport"===i.paint.get("hillshade-illumination-anchor")&&(n.directionRadians[t]+=e.transform.bearingInRadians);return{u_image:0,u_latrange:Vv(e,t.tileID),u_exaggeration:i.paint.get("hillshade-exaggeration"),u_altitudes:n.altitudeRadians,u_azimuths:n.directionRadians,u_accent:a,u_method:r,u_highlights:n.highlightColor,u_shadows:n.shadowColor}},Ov=(e,t)=>{let i=t.stride,r=x();return z(r,0,ne,-ne,0,0,1),P(r,r,[0,-ne,0]),{u_matrix:r,u_image:1,u_dimension:[i,i],u_zoom:e.overscaledZ,u_unpack:t.getUnpackVector()}};function Vv(e,t){let i=2**t.canonical.z,r=t.canonical.y;return[new zp(0,r/i).toLngLat().lat,new zp(0,(r+1)/i).toLngLat().lat]}const jv=(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")}),Nv=(e,t,i,r)=>{let a=e.transform;return{u_translation:Wv(e,t,i),u_ratio:r/oe(t,1,a.zoom),u_device_pixel_ratio:e.pixelRatio,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},qv=(e,t,i,r,a)=>Me(Nv(e,t,i,r),{u_image:0,u_image_height:a}),$v=(e,t,i,r,a)=>{let n=e.transform,o=Zv(t,n);return{u_translation:Wv(e,t,i),u_texsize:t.imageAtlasTexture.size,u_ratio:r/oe(t,1,n.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/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}},Uv=(e,t,i,r,a)=>{let n=Zv(t,e.transform);return Me(Nv(e,t,i,r),{u_tileratio:n,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})},Gv=(e,t,i,r,a,n)=>{let o=Zv(t,e.transform);return Me(Nv(e,t,i,r),{u_image:0,u_image_height:n,u_tileratio:o,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 Zv(e,t){return 1/oe(e,1,t.tileZoom)}function Wv(e,t,i){return de(e.transform,t,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}const Hv=(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:Kv(r.paint.get("raster-saturation")),u_contrast_factor:Yv(r.paint.get("raster-contrast")),u_spin_weights:Xv(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 Xv(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 Yv(e){return e>0?1/(1-e):1+e}function Kv(e){return e>0?1-1/(1.001-e):-e}const Jv=(e,t,i,r,a,n,o,s,l,h,u,c,p,d)=>{let f=o.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),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:s,u_coord_matrix:l,u_is_text:+u,u_pitch_with_map:+r,u_is_along_line:a,u_is_variable_anchor:n,u_texsize:c,u_texture:0,u_translation:h,u_pitched_scale:p,u_is_offset:d}},Qv=(e,t,i,r,a,n,o,s,l,h,u,c,p,d,f)=>{let m=o.transform;return Me(Jv(e,t,i,r,a,n,o,s,l,h,u,c,d,f),{u_gamma_scale:r?Math.cos(m.pitch
2*Math.PI/180)*m.cameraToCenterDistance:1,u_device_pixel_ratio:o.pixelRatio,u_is_halo:+!!p,u_is_plain:1})},ex=(e,t,i,r,a,n,o,s,l,h,u,c,p,d)=>Me(Qv(e,t,i,r,a,n,o,s,l,h,!0,u,!0,p,d),{u_texsize_icon:c,u_texture_icon:1}),tx=(e,t)=>({u_opacity:e,u_color:t}),ix=(e,t,i,r,a)=>Me(function(e,t,i,r){let a=i.imageManager.getPattern(e.from.toString()),n=i.imageManager.getPattern(e.to.toString()),{width:o,height:s}=i.imageManager.getPixelSize(),l=2**r.tileID.overscaledZ,h=r.tileSize*2**i.transform.tileZoom/l,u=h*(r.tileID.canonical.x+r.tileID.wrap*l),c=h*r.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:a.tl,u_pattern_br_a:a.br,u_pattern_tl_b:n.tl,u_pattern_br_b:n.br,u_texsize:[o,s],u_mix:t.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:n.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/oe(r,1,i.transform.tileZoom),u_pixel_coord_upper:[u>>16,c>>16],u_pixel_coord_lower:[65535&u,65535&c]}}(i,a,t,r),{u_opacity:e}),rx=(e,t)=>{},ax={fillExtrusion:(e,t)=>({u_lightpos:new Pl(e,t.u_lightpos),u_lightpos_globe:new Pl(e,t.u_lightpos_globe),u_lightintensity:new Tl(e,t.u_lightintensity),u_lightcolor:new Pl(e,t.u_lightcolor),u_vertical_gradient:new Tl(e,t.u_vertical_gradient),u_opacity:new Tl(e,t.u_opacity),u_fill_translate:new Sl(e,t.u_fill_translate)}),fillExtrusionPattern:(e,t)=>({u_lightpos:new Pl(e,t.u_lightpos),u_lightpos_globe:new Pl(e,t.u_lightpos_globe),u_lightintensity:new Tl(e,t.u_lightintensity),u_lightcolor:new Pl(e,t.u_lightcolor),u_vertical_gradient:new Tl(e,t.u_vertical_gradient),u_height_factor:new Tl(e,t.u_height_factor),u_opacity:new Tl(e,t.u_opacity),u_fill_translate:new Sl(e,t.u_fill_translate),u_image:new wl(e,t.u_image),u_texsize:new Sl(e,t.u_texsize),u_pixel_coord_upper:new Sl(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new Sl(e,t.u_pixel_coord_lower),u_scale:new Pl(e,t.u_scale),u_fade:new Tl(e,t.u_fade)}),fill:(e,t)=>({u_fill_translate:new Sl(e,t.u_fill_translate)}),fillPattern:(e,t)=>({u_image:new wl(e,t.u_image),u_texsize:new Sl(e,t.u_texsize),u_pixel_coord_upper:new Sl(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new Sl(e,t.u_pixel_coord_lower),u_scale:new Pl(e,t.u_scale),u_fade:new Tl(e,t.u_fade),u_fill_translate:new Sl(e,t.u_fill_translate)}),fillOutline:(e,t)=>({u_world:new Sl(e,t.u_world),u_fill_translate:new Sl(e,t.u_fill_translate)}),fillOutlinePattern:(e,t)=>({u_world:new Sl(e,t.u_world),u_image:new wl(e,t.u_image),u_texsize:new Sl(e,t.u_texsize),u_pixel_coord_upper:new Sl(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new Sl(e,t.u_pixel_coord_lower),u_scale:new Pl(e,t.u_scale),u_fade:new Tl(e,t.u_fade),u_fill_translate:new Sl(e,t.u_fill_translate)}),circle:(e,t)=>({u_camera_to_center_distance:new Tl(e,t.u_camera_to_center_distance),u_scale_with_map:new wl(e,t.u_scale_with_map),u_pitch_with_map:new wl(e,t.u_pitch_with_map),u_extrude_scale:new Sl(e,t.u_extrude_scale),u_device_pixel_ratio:new Tl(e,t.u_device_pixel_ratio),u_globe_extrude_scale:new Tl(e,t.u_globe_extrude_scale),u_translate:new Sl(e,t.u_translate)}),collisionBox:(e,t)=>({u_pixel_extrude_scale:new Sl(e,t.u_pixel_extrude_scale)}),collisionCircle:(e,t)=>({u_viewport_size:new Sl(e,t.u_viewport_size)}),debug:(e,t)=>({u_color:new Cl(e,t.u_color),u_overlay:new wl(e,t.u_overlay),u_overlay_scale:new Tl(e,t.u_overlay_scale)}),depth:rx,clippingMask:rx,heatmap:(e,t)=>({u_extrude_scale:new Tl(e,t.u_extrude_scale),u_intensity:new Tl(e,t.u_intensity),u_globe_extrude_scale:new Tl(e,t.u_globe_extrude_scale)}),heatmapTexture:(e,t)=>({u_matrix:new zl(e,t.u_matrix),u_world:new Sl(e,t.u_world),u_image:new wl(e,t.u_image),u_color_ramp:new wl(e,t.u_color_ramp),u_opacity:new Tl(e,t.u_opacity)}),hillshade:(e,t)=>({u_image:new wl(e,t.u_image),u_latrange:new Sl(e,t.u_latrange),u_exaggeration:new Tl(e,t.u_exaggeration),u_altitudes:new Il(e,t.u_altitudes),u_azimuths:new Il(e,t.u_azimuths),u_accent:new Cl(e,t.u_accent),u_method:new wl(e,t.u_method),u_shadows:new Ml(e,t.u_shadows),u_highlights:new Ml(e,t.u_highlights)}),hillshadePrepare:(e,t)=>({u_matrix:new zl(e,t.u_matrix),u_image:new wl(e,t.u_image),u_dimension:new Sl(e,t.u_dimension),u_zoom:new Tl(e,t.u_zoom),u_unpack:new El(e,t.u_unpack)}),colorRelief:(e,t)=>({u_image:new wl(e,t.u_image),u_unpack:new El(e,t.u_unpack),u_dimension:new Sl(e,t.u_dimension),u_elevation_stops:new wl(e,t.u_elevation_stops),u_color_stops:new wl(e,t.u_color_stops),u_color_ramp_size:new wl(e,t.u_color_ramp_size),u_opacity:new Tl(e,t.u_opacity)}),line:(e,t)=>({u_translation:new Sl(e,t.u_translation),u_ratio:new Tl(e,t.u_ratio),u_device_pixel_ratio:new Tl(e,t.u_device_pixel_ratio),u_units_to_pixels:new Sl(e,t.u_units_to_pixels)}),lineGradient:(e,t)=>
2({u_translation:new Sl(e,t.u_translation),u_ratio:new Tl(e,t.u_ratio),u_device_pixel_ratio:new Tl(e,t.u_device_pixel_ratio),u_units_to_pixels:new Sl(e,t.u_units_to_pixels),u_image:new wl(e,t.u_image),u_image_height:new Tl(e,t.u_image_height)}),linePattern:(e,t)=>({u_translation:new Sl(e,t.u_translation),u_texsize:new Sl(e,t.u_texsize),u_ratio:new Tl(e,t.u_ratio),u_device_pixel_ratio:new Tl(e,t.u_device_pixel_ratio),u_image:new wl(e,t.u_image),u_units_to_pixels:new Sl(e,t.u_units_to_pixels),u_scale:new Pl(e,t.u_scale),u_fade:new Tl(e,t.u_fade)}),lineSDF:(e,t)=>({u_translation:new Sl(e,t.u_translation),u_ratio:new Tl(e,t.u_ratio),u_device_pixel_ratio:new Tl(e,t.u_device_pixel_ratio),u_units_to_pixels:new Sl(e,t.u_units_to_pixels),u_image:new wl(e,t.u_image),u_mix:new Tl(e,t.u_mix),u_tileratio:new Tl(e,t.u_tileratio),u_crossfade_from:new Tl(e,t.u_crossfade_from),u_crossfade_to:new Tl(e,t.u_crossfade_to),u_lineatlas_width:new Tl(e,t.u_lineatlas_width),u_lineatlas_height:new Tl(e,t.u_lineatlas_height)}),lineGradientSDF:(e,t)=>({u_translation:new Sl(e,t.u_translation),u_ratio:new Tl(e,t.u_ratio),u_device_pixel_ratio:new Tl(e,t.u_device_pixel_ratio),u_units_to_pixels:new Sl(e,t.u_units_to_pixels),u_image:new wl(e,t.u_image),u_image_height:new Tl(e,t.u_image_height),u_tileratio:new Tl(e,t.u_tileratio),u_crossfade_from:new Tl(e,t.u_crossfade_from),u_crossfade_to:new Tl(e,t.u_crossfade_to),u_image_dash:new wl(e,t.u_image_dash),u_mix:new Tl(e,t.u_mix),u_lineatlas_width:new Tl(e,t.u_lineatlas_width),u_lineatlas_height:new Tl(e,t.u_lineatlas_height)}),layerOpacity:(e,t)=>({u_image:new wl(e,t.u_image),u_opacity:new Tl(e,t.u_opacity)}),raster:(e,t)=>({u_tl_parent:new Sl(e,t.u_tl_parent),u_scale_parent:new Tl(e,t.u_scale_parent),u_buffer_scale:new Tl(e,t.u_buffer_scale),u_fade_t:new Tl(e,t.u_fade_t),u_opacity:new Tl(e,t.u_opacity),u_image0:new wl(e,t.u_image0),u_image1:new wl(e,t.u_image1),u_brightness_low:new Tl(e,t.u_brightness_low),u_brightness_high:new Tl(e,t.u_brightness_high),u_saturation_factor:new Tl(e,t.u_saturation_factor),u_contrast_factor:new Tl(e,t.u_contrast_factor),u_spin_weights:new Pl(e,t.u_spin_weights),u_coords_top:new El(e,t.u_coords_top),u_coords_bottom:new El(e,t.u_coords_bottom)}),symbolIcon:(e,t)=>({u_is_size_zoom_constant:new wl(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new wl(e,t.u_is_size_feature_constant),u_size_t:new Tl(e,t.u_size_t),u_size:new Tl(e,t.u_size),u_camera_to_center_distance:new Tl(e,t.u_camera_to_center_distance),u_pitch:new Tl(e,t.u_pitch),u_rotate_symbol:new wl(e,t.u_rotate_symbol),u_aspect_ratio:new Tl(e,t.u_aspect_ratio),u_fade_change:new Tl(e,t.u_fade_change),u_label_plane_matrix:new zl(e,t.u_label_plane_matrix),u_coord_matrix:new zl(e,t.u_coord_matrix),u_is_text:new wl(e,t.u_is_text),u_pitch_with_map:new wl(e,t.u_pitch_with_map),u_is_along_line:new wl(e,t.u_is_along_line),u_is_variable_anchor:new wl(e,t.u_is_variable_anchor),u_texsize:new Sl(e,t.u_texsize),u_texture:new wl(e,t.u_texture),u_translation:new Sl(e,t.u_translation),u_pitched_scale:new Tl(e,t.u_pitched_scale),u_is_offset:new wl(e,t.u_is_offset)}),symbolSDF:(e,t)=>({u_is_size_zoom_constant:new wl(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new wl(e,t.u_is_size_feature_constant),u_size_t:new Tl(e,t.u_size_t),u_size:new Tl(e,t.u_size),u_camera_to_center_distance:new Tl(e,t.u_camera_to_center_distance),u_pitch:new Tl(e,t.u_pitch),u_rotate_symbol:new wl(e,t.u_rotate_symbol),u_aspect_ratio:new Tl(e,t.u_aspect_ratio),u_fade_change:new Tl(e,t.u_fade_change),u_label_plane_matrix:new zl(e,t.u_label_plane_matrix),u_coord_matrix:new zl(e,t.u_coord_matrix),u_is_text:new wl(e,t.u_is_text),u_pitch_with_map:new wl(e,t.u_pitch_with_map),u_is_along_line:new wl(e,t.u_is_along_line),u_is_variable_anchor:new wl(e,t.u_is_variable_anchor),u_texsize:new Sl(e,t.u_texsize),u_texture:new wl(e,t.u_texture),u_gamma_scale:new Tl(e,t.u_gamma_scale),u_device_pixel_ratio:new Tl(e,t.u_device_pixel_ratio),u_is_halo:new wl(e,t.u_is_halo),u_is_plain:new wl(e,t.u_is_plain),u_translation:new Sl(e,t.u_translation),u_pitched_scale:new Tl(e,t.u_pitched_scale),u_is_offset:new wl(e,t.u_is_offset)}),symbolTextAndIcon:(e,t)=>({u_is_size_zoom_constant:new wl(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new wl(e,t.u_is_size_feature_constant),u_size_t:new Tl(e,t.u_size_t),u_size:new Tl(e,t.u_size),u_camera_to_center_distance:new Tl(e,t.u_camera_to_center_distance),u_pitch:new Tl(e,t.u_pitch),u_rotate_symbol:new wl(e,t.u_rotate_symbol),u_aspect_ratio:new Tl(e,t.u_aspect_ratio),u_fade_change:new Tl(e,t.u_fade_change),u_label_plane_matrix:new zl(e,t.u_label_plane_matrix
2),u_coord_matrix:new zl(e,t.u_coord_matrix),u_is_text:new wl(e,t.u_is_text),u_pitch_with_map:new wl(e,t.u_pitch_with_map),u_is_along_line:new wl(e,t.u_is_along_line),u_is_variable_anchor:new wl(e,t.u_is_variable_anchor),u_texsize:new Sl(e,t.u_texsize),u_texsize_icon:new Sl(e,t.u_texsize_icon),u_texture:new wl(e,t.u_texture),u_texture_icon:new wl(e,t.u_texture_icon),u_gamma_scale:new Tl(e,t.u_gamma_scale),u_device_pixel_ratio:new Tl(e,t.u_device_pixel_ratio),u_is_halo:new wl(e,t.u_is_halo),u_translation:new Sl(e,t.u_translation),u_pitched_scale:new Tl(e,t.u_pitched_scale),u_is_offset:new wl(e,t.u_is_offset)}),background:(e,t)=>({u_opacity:new Tl(e,t.u_opacity),u_color:new Cl(e,t.u_color)}),backgroundPattern:(e,t)=>({u_opacity:new Tl(e,t.u_opacity),u_image:new wl(e,t.u_image),u_pattern_tl_a:new Sl(e,t.u_pattern_tl_a),u_pattern_br_a:new Sl(e,t.u_pattern_br_a),u_pattern_tl_b:new Sl(e,t.u_pattern_tl_b),u_pattern_br_b:new Sl(e,t.u_pattern_br_b),u_texsize:new Sl(e,t.u_texsize),u_mix:new Tl(e,t.u_mix),u_pattern_size_a:new Sl(e,t.u_pattern_size_a),u_pattern_size_b:new Sl(e,t.u_pattern_size_b),u_scale_a:new Tl(e,t.u_scale_a),u_scale_b:new Tl(e,t.u_scale_b),u_pixel_coord_upper:new Sl(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new Sl(e,t.u_pixel_coord_lower),u_tile_units_to_pixels:new Tl(e,t.u_tile_units_to_pixels)}),terrain:(e,t)=>({u_texture:new wl(e,t.u_texture),u_ele_delta:new Tl(e,t.u_ele_delta),u_fog_matrix:new zl(e,t.u_fog_matrix),u_fog_color:new Cl(e,t.u_fog_color),u_fog_ground_blend:new Tl(e,t.u_fog_ground_blend),u_fog_ground_blend_opacity:new Tl(e,t.u_fog_ground_blend_opacity),u_horizon_color:new Cl(e,t.u_horizon_color),u_horizon_fog_blend:new Tl(e,t.u_horizon_fog_blend),u_is_globe_mode:new Tl(e,t.u_is_globe_mode)}),terrainDepth:(e,t)=>({u_ele_delta:new Tl(e,t.u_ele_delta)}),terrainCoords:(e,t)=>({u_texture:new wl(e,t.u_texture),u_terrain_coords_id:new Tl(e,t.u_terrain_coords_id),u_ele_delta:new Tl(e,t.u_ele_delta)}),atmosphere:(e,t)=>({u_sun_pos:new Pl(e,t.u_sun_pos),u_atmosphere_blend:new Tl(e,t.u_atmosphere_blend),u_globe_position:new Pl(e,t.u_globe_position),u_globe_radius:new Tl(e,t.u_globe_radius),u_inv_proj_matrix:new zl(e,t.u_inv_proj_matrix)}),sky:(e,t)=>({u_sky_color:new Cl(e,t.u_sky_color),u_horizon_color:new Cl(e,t.u_horizon_color),u_horizon:new Sl(e,t.u_horizon),u_horizon_normal:new Sl(e,t.u_horizon_normal),u_sky_horizon_blend:new Tl(e,t.u_sky_horizon_blend),u_sky_blend:new Tl(e,t.u_sky_blend)})};var nx=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 ox={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};var sx=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)}enableAttributes(e,t){for(let i of this.attributes){let r=t.attributes[i.name];void 0!==r&&e.enableVertexAttribArray(r)}}setVertexAttribPointers(e,t,i){for(let r of this.attributes){let a=t.attributes[r.name];void 0!==a&&e.vertexAttribPointer(a,r.components,e[ox[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)}},lx=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)}},hx=class extends lx{getDefault(){return ki.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)}},ux=class extends lx{getDefault(){return 1}set(e){e===this.current&&!this.dirty||(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}},cx=class extends lx{getDefault(){return 0}set(e){e===this.current&&!this.dirty||(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}
2,px=class extends lx{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)}},dx=class extends lx{getDefault(){return!0}set(e){e===this.current&&!this.dirty||(this.gl.depthMask(e),this.current=e,this.dirty=!1)}},fx=class extends lx{getDefault(){return 255}set(e){e===this.current&&!this.dirty||(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}},mx=class extends lx{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)}},gx=class extends lx{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)}},_x=class extends lx{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}},yx=class extends lx{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)}},vx=class extends lx{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}},xx=class extends lx{getDefault(){return this.gl.LESS}set(e){e===this.current&&!this.dirty||(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}},bx=class extends lx{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}},wx=class extends lx{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)}},Tx=class extends lx{getDefault(){return ki.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)}},Sx=class extends lx{getDefault(){return this.gl.FUNC_ADD}set(e){e===this.current&&!this.dirty||(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}},Px=class extends lx{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}},Ex=class extends lx{getDefault(){return this.gl.BACK}set(e){e===this.current&&!this.dirty||(this.gl.cullFace(e),this.current=e,this.dirty=!1)}},Cx=class extends lx{getDefault(){return this.gl.CCW}set(e){e===this.current&&!this.dirty||(this.gl.frontFace(e),this.current=e,this.dirty=!1)}},Mx=class extends lx{getDefault(){return null}set(e){e===this.current&&!this.dirty||(this.gl.useProgram(e),this.current=e,this.dirty=!1)}},Ix=class extends lx{getDefault(){return this.gl.TEXTURE0}set(e){e===this.current&&!this.dirty||(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}},Ax=class extends lx{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)}},zx=class extends lx{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}},kx=class extends lx{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}},Dx=class extends lx{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}},Rx=class extends lx{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}},Lx=class extends lx{getDefault(){return null}set(e){let t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}},Fx=class extends lx{getDefault(){return null}set(e){e===this.current&&!this.dirty||(this.gl.bindVertexArray(e),this.current=e,this.dirty=!1)}},Bx=class extends lx{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}},Ox=class extends lx{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}},Vx=class extends lx{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}},jx=class extends lx{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}},Nx=class extends jx{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}},qx=class extends jx{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}},$x=class extends jx{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}},Ux=class{constructor(e,t,i,r,a){this.context=e,this.width=t,this.height=i;let n=e.gl,o=this.framebuffer=n.createFramebuffer();
vendor: 30,142 bytes, line 2
2if(this.colorAttachment=new Nx(e,o),r)this.depthAttachment=a?new $x(e,o):new qx(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 t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}e.deleteFramebuffer(this.framebuffer)}},Gx=class{constructor(e,t,i){this.blendFunction=e,this.blendColor=t,this.mask=i}};Gx.Replace=[1,0],Gx.disabled=new Gx(Gx.Replace,ki.transparent,[!1,!1,!1,!1]),Gx.unblended=new Gx(Gx.Replace,ki.transparent,[!0,!0,!0,!0]),Gx.alphaBlended=new Gx([1,771],ki.transparent,[!0,!0,!0,!0]);var Zx=class{constructor(e){this.gl=e,this.clearColor=new hx(this),this.clearDepth=new ux(this),this.clearStencil=new cx(this),this.colorMask=new px(this),this.depthMask=new dx(this),this.stencilMask=new fx(this),this.stencilFunc=new mx(this),this.stencilOp=new gx(this),this.stencilTest=new _x(this),this.depthRange=new yx(this),this.depthTest=new vx(this),this.depthFunc=new xx(this),this.blend=new bx(this),this.blendFunc=new wx(this),this.blendColor=new Tx(this),this.blendEquation=new Sx(this),this.cullFace=new Px(this),this.cullFaceSide=new Ex(this),this.frontFace=new Cx(this),this.program=new Mx(this),this.activeTexture=new Ix(this),this.viewport=new Ax(this),this.bindFramebuffer=new zx(this),this.bindRenderbuffer=new kx(this),this.bindTexture=new Dx(this),this.bindVertexBuffer=new Rx(this),this.bindElementBuffer=new Lx(this),this.bindVertexArray=new Fx(this),this.pixelStoreUnpack=new Bx(this),this.pixelStoreUnpackPremultiplyAlpha=new Ox(this),this.pixelStoreUnpackFlipY=new Vx(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 nx(this,e,t)}createVertexBuffer(e,t,i){return new sx(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 Ux(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])),void 0!==t&&(a|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),void 0!==i&&(a|=r.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),r.clear(a)}setCullFace(e){!1===e.enable?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(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(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})):this.stencilTest.set(!1)}setColorMode(e){Be(e.blendFunction,Gx.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)}},Wx=class{constructor(e,t,i){this.func=e,this.mask=t,this.range=i}};Wx.ReadOnly=!1,Wx.ReadWrite=!0,Wx.disabled=new Wx(519,Wx.ReadOnly,[0,1]);const Hx=7680;var Xx=class{constructor(e,t,i,r,a,n){this.test=e,this.ref=t,this.mask=i,this.fail=r,this.depthFail=a,this.pass=n}};Xx.disabled=new Xx({func:519,mask:0},0,0,Hx,Hx,Hx);const Yx=2305;var Kx=class{constructor(e,t,i){this.enable=e,this.mode=t,this.frontFace=i}};let Jx;function Qx(e,t,i,r,a){let n=e.context,o=e.transform,s=n.gl,l=e.useProgram("collisionBox"),h=[],u=0,c=0;for(let p of r){let r=t.getTile(p).getBucket(i);if(!r)continue;let d=a?r.textCollisionBox:r.iconCollisionBox,f=r.collisionCircleArray;f.length>0&&(h.push({circleArray:f,circleOffset:c,coord:p}),u+=f.length/4,c=u),d&&l.draw(n,s.LINES,Wx.disabled,Xx.disabled,e.colorModeForRenderPass(),Kx.disabled,kv(e.transform),e.style.map.terrain?.getTerrainData(p),o.getProjectionData({overscaledTileID:p,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),i.id,d.layoutVertexBuffer,d.indexBuffer,d.segments,null,e.transform.zoom,null,null,d.collisionVertexBuffer)}if(!a||!h.length)return;let p=e.useProgram("collisionCircle"),d=new il;d.resize(4*u),d._trim();let f=0;for(let e of h)for(let t=0;t<e.circleArray.length/4;t++){let i=4*t,r=e.circleArray[i+0],a=e.circleArray[i+1],n=e.circleArray[i+2],o=e.circleArray[i+3];d.emplace(f++,r,a,n,o,0),d.emplace(f++,r,a,n,o,1),d.emplace(f++,r,a,n,o,2),d.emplace(f++,r,a,n,o,3)}(!Jx||Jx.length<2*u)&&(Jx=function(e){let t=2*e,i=new al;i.resize(t),i._trim();for(let e=0;e<t;e++){let t=6*e;i.uint16[t+0]=4*e+0,i.uint16[t+1]=4*e+1,i.uint16[t+2]=4*e+2,i.uint16[t+3]=4*e+2,i.uint16[t+4]=4*e+3,i.uint16[t+5]=4*e+0}return i}(u));let m=n.createIndexBuffer(Jx,!0),g=n.createVertexBuffer(d,Lc.members,!0);for(let t of h){let r=Dv(e.transform);p.draw(n,s.TRIANGLES,Wx.disabled,Xx.disabled,e.colorModeForRenderPass(),Kx.disabled,r,e.style.map.terrain?.getTerrainData(t.coord),null,i.id,g,m,ul.simpleSegment(0,2*t.circleOffset,t.circleArray.length,t.circleArray.length/2),null,e.transform.zoom,null,null,null)}g.destroy(),m.destroy()}Kx.disabled=new Kx(!1,1029,Yx),Kx.backCCW=new Kx(!0,1029,Yx),Kx.frontCCW=new Kx(!0,1028,Yx);const eb=w(new Float32Array(16));function tb(e,t,i,r,a,n){let{horizontalAlign:o,verticalAlign:s}=Xc(e),l=-(s-.5)*i;return new d((-(o-.5)*t/a+r[0])*n,(l/a+r[1])*n)}function ib(e,t,i,r,a,n){let o=t.tileAnchorPoint.add(new d(t.translation[0],t.translation[1]));if(t.pitchWithMap){let e=r.mult(n);i||(e=e.rotate(-a));let s=o.add(e);return A_(s.x,s.y,t.pitchedLabelPlaneMatrix,t.getElevation).point}if(i){let i=V_(t.tileAnchorPoint.x+1,t.tileAnchorPoint.y,t).point.sub(e),a=Math.atan(i.y/i.x)+(i.x<0?Math.PI:0);return e.add(r.rotate(a))}return e.add(r)}function rb(e,t,i,r,a,n,o,s,l,h,u,c){let p=e.text.placedSymbolArray,f=e.text.dynamicLayoutVertexArray,m=e.icon.dynamicLayoutVertexArray,g={};f.clear();for(let m=0;m<p.length;m++){let _=p.get(m),y=e.allowVerticalPlacement&&!_.placedOrientation,v=_.hidden||!_.crossTileID||y?null:r[_.crossTileID];if(v){let r=new d(_.anchorX,_.anchorY),p={getElevation:c,width:a.width,height:a.height,pitchedLabelPlaneMatrix:n,lineVertexArray:null,pitchWithMap:i,transform:a,projectionCache:null,tileAnchorPoint:r,translation:h,unwrappedTileID:u},m=i?N_(r.x,r.y,p):V_(r.x,r.y,p),y=z_(a.cameraToCenterDistance,m.signedDistanceFromCamera),x=Kc(e.textSizeData,s,_)*y/24;i&&(x*=e.tilePixelRatio/o);let{width:b,height:w,anchor:T,textOffset:S,textBoxScale:P}=v,E=tb(T,b,w,S,P,x),C=a.getPitchedTextCorrection(r.x+h[0],r.y+h[1],u),M=ib(m.point,p,t,E,-a.bearingInRadians,C),I=e.allowVerticalPlacement&&2===_.placedOrientation?Math.PI/2:0;for(let e=0;e<_.numGlyphs;e++)ip(f,M,I);l&&_.associatedIconIndex>=0&&(g[_.associatedIconIndex]={shiftedAnchor:M,angle:I})}else Z_(_.numGlyphs,f)}if(l){m.clear();let t=e.icon.placedSymbolArray;for(let e=0;e<t.length;e++){let i=t.get(e);if(i.hidden)Z_(i.numGlyphs,m);else{let t=g[e];if(t)for(let e=0;e<i.numGlyphs;e++)ip(m,t.shiftedAnchor,t.angle);else Z_(i.numGlyphs,m)}}e.icon.dynamicLayoutVertexBuffer.updateData(m)}e.text.dynamicLayoutVertexBuffer.updateData(f)}function ab(e,t,i){return i.iconsInText&&t?"symbolTextAndIcon":e?"symbolSDF":"symbolIcon"}function nb(e,t,i,r,a,n,o,s,l,h,u,c,p){let d=e.context,f=d.gl,m=e.transform,g="map"===s,_="map"===l,y="viewport"!==s&&"point"!==i.layout.get("symbol-placement"),v=g&&!_&&!y,b=!i.layout.get("symbol-sort-key").isConstant(),w=!1,T=e.getDepthModeForSublayer(0,Wx.ReadOnly),S=i._unevaluatedLayout.hasValue("text-variable-anchor")||i._unevaluatedLayout.hasValue("text-variable-anchor-offset"),P=[],E=m.getCircleRadiusCorrection();for(let s of r){let r=t.getTile(s),l=r.getBucket(i);if(!l)continue;let u=a?l.text:l.icon;if(!u?.segments.get().length||!u.hasVisibleVertices)continue;let c,d,T,C,M=u.programConfigurations.get(i.id),I=a||l.sdfIcons,A=a?l.textSizeData:l.iconSizeData,z=_||0!==m.pitch,k=e.useProgram(ab(I,a,l),M),D=Jc(A,m.zoom),R=e.style.map.terrain?.getTerrainData(s),L=[0,0],F=null;if(a){if(d=r.glyphAtlasTexture,T=f.LINEAR,c=r.glyphAtlasTexture.size,l.iconsInText){L=r.imageAtlasTexture.size,F=r.imageAtlasTexture;let t="composite"===A.kind||"camera"===A.kind;C=z||e.options.rotating||e.options.zooming||t?f.LINEAR:f.NEAREST}}else{let t=1!==i.layout.get("icon-size").constantOr(0)||l.iconsNeedLinear;d=r.imageAtlasTexture,T=I||e.options.rotating||e.options.zooming||t||z?f.LINEAR:f.NEAREST,c=r.imageAtlasTexture.size}let B=oe(r,1,e.transform.zoom),O=C_(g,e.transform,B),V=M_(_,g,e.transform,B),j=de(m,r,n,o),N=m.getProjectionData({overscaledTileID:s,applyGlobeMatrix:!p,applyTerrainMatrix:!0}),q=S&&l.hasTextData(),$="none"!==i.layout.get("icon-text-fit")&&q&&l.hasIconData(),U=i._unevaluatedLayout.hasValue("icon-offset");if(y){let t=x();P_(t,O);let r=e.style.map.terrain?(t,i)=>e.style.map.terrain.getElevation(s,t,i):null;D_(l,e,a,O,t,_,h,"map"===i.layout.get("text-rotation-alignment"),s.toUnwrapped(),m.width,m.height,j,r)}let G,Z=a&&S||$,W=_?O:e.transform.clipSpaceToPixelsMatrix,H=y||Z?eb:W,X=I&&0!==i.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1);G=I?l.iconsInText?ex(A.kind,D,v,_,y,Z,e,H,V,j,c,L,E,U):Qv(A.kind,D,v,_,y,Z,e,H,V,j,a,c,X,E,U):Jv(A.kind,D,v,_,y,Z,e,H,V,j,a,c,E,U);let Y={program:k,buffers:u,uniformValues:G,projectionData:N,atlasTexture:d,atlasTextureIcon:F,atlasInterpolation:T,atlasInterpolationIcon:C,isSDF:I,hasHalo:X};if(b&&l.canOverlap){w=!0;let e=u.segments.get();for(let t of e)P.push({segments:new ul([t]),sortKey:t.sortKey,state:Y,terrainData:R})}else P.push({segments:u.segments,sortKey:0,state:Y,terrainData:R})}w&&P.sort(((e,t)=>e.sortKey-t.sortKey));let C=i.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(null)??1/0,M=24*i.layout.get("text-letter-spacing").constantOr(0)<0||C>1;for(let t of P){let r=t.state;d.activeTexture.set(f.TEXTURE0),r.atlasTexture.bind(r.atlasInterpolation,f.CLAMP_TO_EDGE),r.atlasTextureIcon&&(d.activeTexture.set(f.TEXTURE1),r.atlasTextureIcon&&r.atlasTextureIcon.bind(r.atlasInterpolationIcon,f.CLAMP_TO_EDGE));let a=r.isSDF&&r.hasHalo;if(a){let a=r.uniformValues;a.u_is_halo=1,M&&(a.u_is_plain=0,ob(r.buffers,t.segments,i,e,r.program,T,u,c,a,r.projectionData,t.terrainData),a.u_is_halo=0,a.u_is_plain=1)}ob(r.buffers,t.segments,i,e,r.program,T,u,c,r.uniformValues,r.projectionData,t.terrainData),a&&!M&&(r.uniformValues.u_is_halo=0)}}function ob(e,t,i,r,a,n,o,s,l,h,u){let c=r.context,p=c.gl;a.draw(c,p.TRIANGLES,n,o,s,Kx.backCCW,l,u,h,i.id,e.layoutVertexBuffer,e.indexBuffer,t,i.paint,r.transform.zoom,e.programConfigurations.get(i.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function sb(e,t,i,r,a){let n=e.context,o=n.gl,s=Xx.disabled,l=new Gx([o.ONE,o.ONE],ki.transparent,[!0,!0,!0,!0]),h=t.getBucket(i);if(!h)return;let u=r.key,c=i.heatmapFbos.get(u);c||(c=hb(n,t.tileSize,t.tileSize),i.heatmapFbos.set(u,c)),n.bindFramebuffer.set(c.framebuffer),n.viewport.set([0,0,t.tileSize,t.tileSize]),n.clear({color:ki.transparent});let p=h.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(n,o.TRIANGLES,Wx.disabled,s,l,Kx.disabled,Lv(t,e.transform.zoom,i.paint.get("heatmap-intensity"),1),m,f,i.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,i.paint,e.transform.zoom,p)}function lb(e,t,i,r,a){let n=e.context,o=n.gl,s=e.transform;n.setColorMode(e.colorModeForRenderPass());let l=ub(n,t),h=i.key,u=t.heatmapFbos.get(h);if(!u)return;n.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,u.colorAttachment.get()),n.activeTexture.set(o.TEXTURE1),l.bind(o.LINEAR,o.CLAMP_TO_EDGE);let c=s.getProjectionData({overscaledTileID:i,applyTerrainMatrix:a,applyGlobeMatrix:!r});e.useProgram("heatmapTexture").draw(n,o.TRIANGLES,Wx.disabled,Xx.disabled,e.colorModeForRenderPass(),Kx.disabled,Fv(e,t,0,1),null,c,t.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments,t.paint,s.zoom),u.destroy(),t.heatmapFbos.delete(h)}function hb(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 n=e.createFramebuffer(t,i,!1,!1);return n.colorAttachment.set(a),n}function ub(e,t){return t.colorRampTexture||=new jh(e,t.colorRamp,e.gl.RGBA),t.colorRampTexture}function cb(e,t,i,r){let a=e.context,n=a.bindFramebuffer.get(),o=a.viewport.get(),[,,s,l]=o;return function(e,t,i){let r=e.context.gl;if(!e.layerOpacityFbo){let a=e.context.createFramebuffer(t,i,!0,!0),n=r.createTexture();return r.bindTexture(r.TEXTURE_2D,n),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),a.colorAttachment.set(n),a.depthAttachment.set(e.context.createRenderbuffer(r.DEPTH_STENCIL,t,i)),e.layerOpacityFbo=a,void e.context.bindFramebuffer.set(e.layerOpacityFbo.framebuffer)}if(e.layerOpacityFbo.width===t&&e.layerOpacityFbo.height===i)return void e.context.bindFramebuffer.set(e.layerOpacityFbo.framebuffer);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)}(e,s,l),a.viewport.set([0,0,s,l]),a.clear({color:ki.transparent,depth:1,stencil:0}),e.currentStencilSource=void 0,e.renderTileClippingMasks(t,i,r),{compositeTarget:n,compositeViewport:o}}function pb(e,t,i,r){let a=e.context,n=a.gl;a.bindFramebuffer.set(i.compositeTarget),a.viewport.set(i.compositeViewport),a.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,e.layerOpacityFbo.colorAttachment.get()),e.useProgram("layerOpacity").draw(a,n.TRIANGLES,Wx.disabled,Xx.disabled,e.colorModeForRenderPass(),Kx.disabled,((e,t)=>({u_image:t,u_opacity:e}))(t,0),null,null,r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom),e.currentStencilSource=void 0}function db(e,t,i,r,a,n,o,s){let l=256;if(a.stepInterpolant){let r=t.getSource().maxzoom,a=o.canonical.z===r?Math.ceil(1<<e.transform.maxZoom-o.canonical.z):1;l=Ee(function(e){return e<=1?1:2**Math.ceil(Math.log(e)/Math.LN2)}(n.maxLineLength/ne*1024*a),256,i.maxTextureSize)}return s.gradient=zh({expression:a.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:s.gradient||void 0,clips:n.lineClipsArray}),s.texture?s.texture.update(s.gradient):s.texture=new jh(i,s.gradient,r.RGBA),s.version=a.gradientVersion,s.texture}function fb(e,t,i,r,a){e.activeTexture.set(t.TEXTURE0),i.imageAtlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE),r.updatePaintBuffers(a)}function mb(e,t,i,r,a,n){(a||e.lineAtlas.dirty)&&(t.activeTexture.set(i.TEXTURE0),e.lineAtlas.bind(t)),r.updatePaintBuffers(n)}function gb(e,t,i,r,a,n,o){let s=n.gradients[a.id],l=s.texture;a.gradientVersion!==s.version&&(l=db(e,t,i,r,a,n,o,s)),i.activeTexture.set(r.TEXTURE0),l.bind(a.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE)}function _b(e,t,i,r,a,n,o,s,l){let h=n.gradients[a.id],u=h.texture;a.gradientVersion!==h.version&&(u=db(e,t,i,r,a,n,o,h)),i.activeTexture.set(r.TEXTURE0),u.bind(a.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE),i.activeTexture.set(r.TEXTURE1),e.lineAtlas.bind(i),s.updatePaintBuffers(l)}function yb(e,t,i,r,a,n){let o,{isRenderingToTexture:s}=a,l=e.getDepthModeForSublayer(0,Wx.ReadOnly),h=e.colorModeForRenderPass(),u=i.paint.get("line-dasharray"),c=u.constantOr(1),p=i.paint.get("line-pattern"),d=p.constantOr(1),f=i.paint.get("line-gradient"),m=i.getCrossfadeParameters();o=d?"linePattern":c&&f?"lineGradientSDF":c?"lineSDF":f?"lineGradient":"line";let g=e.context,_=g.gl,y=e.transform,v=!0;for(let a of r){let r=t.getTile(a);if(d&&!r.patternsLoaded())continue;let x=r.getBucket(i);if(!x)continue;let b=x.programConfigurations.get(i.id),w=e.context.program.get(),T=e.useProgram(o,b),S=v||T.program!==w,P=n?e.getTerrainDataForTile(a,s):null,E=p.constantOr(null),C=u?.constantOr(null);if(E&&r.imageAtlas){let e=r.imageAtlas,t=e.patternPositions[E.to.toString()],i=e.patternPositions[E.from.toString()];t&&i&&b.setConstantPatternPositions(t,i)}else if(C){let t="round"===i.layout.get("line-cap").constantOr(null),r=e.lineAtlas.getDash(C.to,t),a=e.lineAtlas.getDash(C.from,t);b.setConstantDashPositions(r,a)}let M,I=y.getProjectionData({overscaledTileID:a,applyGlobeMatrix:!s,applyTerrainMatrix:!0}),A=y.getPixelScale();d?(M=$v(e,r,i,A,m),fb(g,_,r,b,m)):c&&f?(M=Gv(e,r,i,A,m,x.lineClipsArray.length),_b(e,t,g,_,i,x,a,b,m)):c?(M=Uv(e,r,i,A,m),mb(e,g,_,b,S,m)):f?(M=qv(e,r,i,A,x.lineClipsArray.length),gb(e,t,g,_,i,x,a)):M=Nv(e,r,i,A);let z=e.stencilModeForClipping(a);T.draw(g,_.TRIANGLES,l,z,h,Kx.disabled,M,P,I,i.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,i.paint,e.transform.zoom,b,x.layoutVertexBuffer2),v=!1}}function vb(e,t,i,r,a){if(!i||!r?.imageAtlas)return;let n=r.imageAtlas.patternPositions,o=n[i.to.toString()],s=n[i.from.toString()];if(!o&&s&&(o=s),!s&&o&&(s=o),!o||!s){let e=a.getPaintProperty(t);o=n[e],s=n[e]}o&&s&&e.setConstantPatternPositions(o,s)}function xb(e,t,i,r,a){let{isRenderingToTexture:n}=a,o=e.colorModeForRenderPass();wb(e,t,i,r,e.getDepthModeForSublayer(1,Wx.ReadOnly),o,!1,n),bb(e,t,i,r,a)}function bb(e,t,i,r,a){if(!i.paint.get("fill-antialias"))return;let{isRenderingToTexture:n}=a,o=e.colorModeForRenderPass();wb(e,t,i,r,e.getDepthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,Wx.ReadOnly),o,!0,n)}function wb(e,t,i,r,a,n,o,s){let l,h,u,c,p,d=e.context.gl,f="fill-pattern",m=i.paint.get(f),g=m?.constantOr(1),_=i.getCrossfadeParameters(),y=e.transform,v=i.paint.get("fill-translate"),x=i.paint.get("fill-translate-anchor");o?(h=g&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",l=d.LINES):(h=g?"fillPattern":"fill",l=d.TRIANGLES);let b=m.constantOr(null);for(let m of r){let r=t.getTile(m);if(g&&!r.patternsLoaded())continue;let w=r.getBucket(i);if(!w)continue;let T=w.programConfigurations.get(i.id),S=e.useProgram(h,T),P=e.getTerrainDataForTile(m,s);g&&(e.context.activeTexture.set(d.TEXTURE0),r.imageAtlasTexture.bind(d.LINEAR,d.CLAMP_TO_EDGE),T.updatePaintBuffers(_)),vb(T,f,b,r,i);let E=y.getProjectionData({overscaledTileID:m,applyGlobeMatrix:!s,applyTerrainMatrix:!0}),C=de(y,r,v,x);if(o){c=w.indexBuffer2,p=w.segments2;let t=[d.drawingBufferWidth,d.drawingBufferHeight];u="fillOutlinePattern"===h&&g?Av(e,_,r,t,C):Iv(t,C)}else c=w.indexBuffer,p=w.segments,u=g?Cv(e,_,r,C):Mv(C);let M=e.stencilModeForClipping(m);S.draw(e.context,l,a,M,n,Kx.backCCW,u,P,E,i.id,w.layoutVertexBuffer,c,p,i.paint,e.transform.zoom,T)}}function Tb(e,t,i,r,a,n,o,s){let l=e.context,h=l.gl,u="fill-extrusion-pattern",c=i.paint.get(u),p=c.constantOr(1),d=i.getCrossfadeParameters(),f=i.paint.get("fill-extrusion-opacity"),m=c.constantOr(null),g=e.transform;for(let c of r){let r=t.getTile(c),_=r.getBucket(i);if(!_)continue;let y=e.style.map.terrain?.getTerrainData(c),v=_.programConfigurations.get(i.id),x=e.useProgram(p?"fillExtrusionPattern":"fillExtrusion",v);p&&(e.context.activeTexture.set(h.TEXTURE0),r.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),v.updatePaintBuffers(d));let b=g.getProjectionData({overscaledTileID:c,applyGlobeMatrix:!s,applyTerrainMatrix:!0});vb(v,u,m,r,i);let w=de(g,r,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),T=i.paint.get("fill-extrusion-vertical-gradient"),S=p?Ev(e,T,f,w,c,d,r):Pv(e,T,f,w);x.draw(l,l.gl.TRIANGLES,a,n,o,Kx.backCCW,S,y,b,i.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,i.paint,e.transform.zoom,v,e.style.map.terrain&&_.centroidVertexBuffer)}}function Sb(e,t,i,r,a,n,o,s,l){let h=e.style.projection,u=e.context,c=e.transform,p=u.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 d of r){let r=t.getTile(d),g=r.fbo;if(!g)continue;let _=h.getMeshFromTileID(u,d.canonical,s,!0,"raster"),y=e.getTerrainDataForTile(d,l);u.activeTexture.set(p.TEXTURE0),p.bindTexture(p.TEXTURE_2D,g.colorAttachment.get());let v=c.getProjectionData({overscaledTileID:d,aligned:m,applyGlobeMatrix:!l,applyTerrainMatrix:!0});f.draw(u,p.TRIANGLES,n,a[d.overscaledZ],o,Kx.backCCW,Bv(e,r,i),y,v,i.id,_.vertexBuffer,_.indexBuffer,_.segments)}}let Pb=0;function Eb(e,t,i,r,a,n,o,s,l){let h=e.style.projection,u=e.context,c=e.transform,p=u.gl,d=e.useProgram("colorRelief"),f=!e.options.moving,m="nearest"===i.paint.get("resampling")?p.NEAREST:p.LINEAR,g=!0,_=0;for(let y of r){let r=t.getTile(y),v=r.dem;if(g){Pb||=p.getParameter(p.MAX_TEXTURE_SIZE);let e=Pb,{elevationTexture:t,colorTexture:r}=i.getColorRampTextures(u,e,v.getUnpackVector());u.activeTexture.set(p.TEXTURE1),t.bind(p.NEAREST,p.CLAMP_TO_EDGE),u.activeTexture.set(p.TEXTURE4),r.bind(p.LINEAR,p.CLAMP_TO_EDGE),g=!1,_=t.size[0]}if(!v?.data)continue;let x=v.stride,b=v.getPixels();if(u.activeTexture.set(p.TEXTURE0),u.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture||=e.getTileTexture(x),r.demTexture){let e=r.demTexture;e.update(b,{premultiply:!1}),e.bind(m,p.CLAMP_TO_EDGE)}else r.demTexture=new jh(u,b,p.RGBA,{premultiply:!1}),r.demTexture.bind(m,p.CLAMP_TO_EDGE);let w=h.getMeshFromTileID(u,y.canonical,s,!0,"raster"),T=e.getTerrainDataForTile(y,l),S=c.getProjectionData({overscaledTileID:y,aligned:f,applyGlobeMatrix:!l,applyTerrainMatrix:!0});d.draw(u,p.TRIANGLES,n,a[y.overscaledZ],o,Kx.backCCW,jv(i,r.dem,_),T,S,i.id,w.vertexBuffer,w.indexBuffer,w.segments)}}const Cb=[new d(0,0),new d(ne,0),new d(ne,ne),new d(0,ne)];function Mb(e,t,i,r,a,n,o,s,l=!1,h=!1){let u=r[r.length-1].overscaledZ,c=e.context,p=c.gl,d=e.useProgram("raster"),f=e.transform,m=e.style.projection,g=e.colorModeForRenderPass(),_=!e.options.moving,y=i.paint.get("raster-opacity"),v="nearest"===i.paint.get("resampling")||"nearest"===i.paint.get("raster-resampling")?p.NEAREST:p.LINEAR,x=i.paint.get("raster-fade-duration"),b=!!e.style.map.terrain;for(let w of r){let r=e.getDepthModeForSublayer(w.overscaledZ-u,1===y?Wx.ReadWrite:Wx.ReadOnly,p.LESS),T=t.getTile(w);c.activeTexture.set(p.TEXTURE0),T.texture.bind(v,p.CLAMP_TO_EDGE,p.LINEAR_MIPMAP_NEAREST),c.activeTexture.set(p.TEXTURE1);let{parentTile:S,parentScaleBy:P,parentTopLeft:E,fadeValues:C}=Ib(T,t,x,b);T.fadeOpacity=C.tileOpacity,S?(S.fadeOpacity=C.parentTileOpacity,S.texture.bind(v,p.CLAMP_TO_EDGE,p.LINEAR_MIPMAP_NEAREST)):T.texture.bind(v,p.CLAMP_TO_EDGE,p.LINEAR_MIPMAP_NEAREST),T.texture.useMipmap&&c.extTextureFilterAnisotropic&&e.transform.pitch>e.options.anisotropicFilterPitch&&p.texParameterf(p.TEXTURE_2D,c.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,c.extTextureFilterAnisotropicMax);let M=e.getTerrainDataForTile(w,h),I=f.getProjectionData({overscaledTileID:w,aligned:_,applyGlobeMatrix:!h,applyTerrainMatrix:!0}),A=Hv(E,P,C.fadeMix,i,s),z=m.getMeshFromTileID(c,w.canonical,n,o,"raster"),k=a?a[w.overscaledZ]:Xx.disabled;d.draw(c,p.TRIANGLES,r,k,g,l?Kx.frontCCW:Kx.backCCW,A,M,I,i.id,z.vertexBuffer,z.indexBuffer,z.segments)}}function Ib(e,t,i,r){let a={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(0===i||r)return a;if(e.fadingParentID){let r=t.getLoadedTile(e.fadingParentID);if(!r)return a;let n=2**(r.tileID.overscaledZ-e.tileID.overscaledZ);return{parentTile:r,parentScaleBy:n,parentTopLeft:[e.tileID.canonical.x*n%1,e.tileID.canonical.y*n%1],fadeValues:Ab(e,r,i)}}return e.selfFading?{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:zb(e,i)}:a}function Ab(e,t,i){let r=zm(),a=(r-e.timeAdded)/i,n=(r-t.timeAdded)/i,o=1===e.fadingDirection,s=Ee(a,0,1),l=Ee(1-n,0,1),h=o?s:l;return{tileOpacity:h,parentTileOpacity:o?l:s,fadeMix:{opacity:1,mix:1-h}}}function zb(e,t){let i=Ee((zm()-e.timeAdded)/t,0,1);return{tileOpacity:i,fadeMix:{opacity:i,mix:0}}}const kb=new ki(1,0,0,1),Db=new ki(0,1,0,1),Rb=new ki(0,0,1,1),Lb=new ki(1,0,1,1),Fb=new ki(0,1,1,1);function Bb(e,t,i,r){Vb(e,0,t+i/2,e.transform.width,i,r)}function Ob(e,t,i,r){Vb(e,t-i/2,0,i,e.transform.height,r)}function Vb(e,t,i,r,a,n){let o=e.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(t*e.pixelRatio,i*e.pixelRatio,r*e.pixelRatio,a*e.pixelRatio),o.clear({color:n}),s.disable(s.SCISSOR_TEST)}function jb(e,t,i){let r=e.context,a=r.gl,n=e.useProgram("debug"),o=Wx.disabled,s=Xx.disabled,l=e.colorModeForRenderPass(),h="$debug",u=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}`),function(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)}(e,`${m} ${p}kB`);let g=e.transform.getProjectionData({overscaledTileID:i,applyGlobeMatrix:!0,applyTerrainMatrix:!0});n.draw(r,a.TRIANGLES,o,s,Gx.alphaBlended,Kx.disabled,Rv(ki.transparent,f),null,g,h,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments),n.draw(r,a.LINE_STRIP,o,s,l,Kx.disabled,Rv(ki.red),u,g,h,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments)}function Nb(e,t){if(!t.mesh){let i=new qs;i.emplaceBack(-1,-1),i.emplaceBack(1,-1),i.emplaceBack(1,1),i.emplaceBack(-1,1);let r=new nl;r.emplaceBack(0,1,2),r.emplaceBack(0,2,3),t.mesh=new Cy(e.createVertexBuffer(i,My.members),e.createIndexBuffer(r),ul.simpleSegment(0,0,i.length,r.length))}return t.mesh}const qb={symbol:function(e,t,i,r,a,n){if("translucent"!==e.renderPass)return;let{isRenderingToTexture:o}=n,s=Xx.disabled,l=e.colorModeForRenderPass();(i._unevaluatedLayout.hasValue("text-variable-anchor")||i._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(e,t,i,r,a,n,o,s,l){let h=t.transform,u=t.style.map.terrain,c="map"===a,p="map"===n;for(let a of e){let e=r.getTile(a),n=e.getBucket(i);if(!n?.text?.segments.get().length)continue;let d=Jc(n.textSizeData,h.zoom),f=oe(e,1,t.transform.zoom),m=C_(c,t.transform,f),g="none"!==i.layout.get("icon-text-fit")&&n.hasIconData();if(d){let t=2**(h.zoom-e.tileID.overscaledZ),i=u?(e,t)=>u.getElevation(a,e,t):null;rb(n,c,p,l,h,m,t,d,g,de(h,e,o,s),a.toUnwrapped(),i)}}}(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),0!==i.paint.get("icon-opacity").constantOr(1)&&nb(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"),s,l,o),0!==i.paint.get("text-opacity").constantOr(1)&&nb(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"),s,l,o),t.map.showCollisionBoxes&&(Qx(e,t,i,r,!0),Qx(e,t,i,r,!1))},circle:function(e,t,i,r,a){if("translucent"!==e.renderPass)return;let{isRenderingToTexture:n}=a,o=i.paint.get("circle-opacity"),s=i.paint.get("circle-stroke-width"),l=i.paint.get("circle-stroke-opacity"),h=!i.layout.get("
2circle-sort-key").isConstant();if(0===o.constantOr(1)&&(0===s.constantOr(1)||0===l.constantOr(1)))return;let u=e.context,c=u.gl,p=e.transform,d=e.getDepthModeForSublayer(0,Wx.ReadOnly),f=Xx.disabled,m=e.colorModeForRenderPass(),g=[],_=p.getCircleRadiusCorrection();for(let a of r){let r=t.getTile(a),o=r.getBucket(i);if(!o)continue;let s=de(p,r,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),l=o.programConfigurations.get(i.id),u=e.useProgram("circle",l),c=o.layoutVertexBuffer,d=o.indexBuffer,f=e.style.map.terrain?.getTerrainData(a),m={programConfiguration:l,program:u,layoutVertexBuffer:c,indexBuffer:d,uniformValues:zv(e,r,i,s,_),terrainData:f,projectionData:p.getProjectionData({overscaledTileID:a,applyGlobeMatrix:!n,applyTerrainMatrix:!0})};if(h){let e=o.segments.get();for(let t of e)g.push({segments:new ul([t]),sortKey:t.sortKey,state:m})}else g.push({segments:o.segments,sortKey:0,state:m})}h&&g.sort(((e,t)=>e.sortKey-t.sortKey));for(let t of g){let{programConfiguration:r,program:a,layoutVertexBuffer:n,indexBuffer:o,uniformValues:s,terrainData:l,projectionData:h}=t.state,p=t.segments;a.draw(u,c.TRIANGLES,d,f,m,Kx.backCCW,s,l,h,i.id,n,o,p,i.paint,e.transform.zoom,r)}},heatmap:function(e,t,i,r,a){if(0===i.paint.get("heatmap-opacity"))return;let n=e.context,{isRenderingToTexture:o,isRenderingGlobe:s}=a;if(e.style.map.terrain){for(let a of r){let r=t.getTile(a);t.hasRenderableParent(a)||("offscreen"===e.renderPass?sb(e,r,i,a,s):"translucent"===e.renderPass&&lb(e,i,a,o,s))}n.viewport.set([0,0,e.width,e.height])}else"offscreen"===e.renderPass?function(e,t,i,r){let a=e.context,n=a.gl,o=e.transform,s=Xx.disabled,l=new Gx([n.ONE,n.ONE],ki.transparent,[!0,!0,!0,!0]);(function(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(kh);a?(r.bindTexture(r.TEXTURE_2D,a.colorAttachment.get()),e.bindFramebuffer.set(a.framebuffer)):(a=hb(e,t.width/4,t.height/4),i.heatmapFbos.set(kh,a))})(a,e,i),a.clear({color:ki.transparent});for(let h of r){if(t.hasRenderableParent(h))continue;let r=t.getTile(h),u=r.getBucket(i);if(!u)continue;let c=u.programConfigurations.get(i.id),p=e.useProgram("heatmap",c),d=o.getProjectionData({overscaledTileID:h,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),f=o.getCircleRadiusCorrection();p.draw(a,n.TRIANGLES,Wx.disabled,s,l,Kx.backCCW,Lv(r,o.zoom,i.paint.get("heatmap-intensity"),f),null,d,i.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,i.paint,o.zoom,c)}a.viewport.set([0,0,e.width,e.height])}(e,t,i,r):"translucent"===e.renderPass&&function(e,t){let i=e.context,r=i.gl;i.setColorMode(e.colorModeForRenderPass());let a=t.heatmapFbos.get(kh);a&&(i.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,a.colorAttachment.get()),i.activeTexture.set(r.TEXTURE1),ub(i,t).bind(r.LINEAR,r.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(i,r.TRIANGLES,Wx.disabled,Xx.disabled,e.colorModeForRenderPass(),Kx.disabled,Fv(e,t,0,1),null,null,t.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,t.paint,e.transform.zoom))}(e,i)},line:function(e,t,i,r,a){if("translucent"!==e.renderPass)return;let n=i.paint.get("line-opacity"),o=i.paint.get("line-width"),s=i.paint.get("line-layer-opacity");if(0===n.constantOr(1)||0===o.constantOr(1)||0===s)return;let l=!!e.style.map.terrain;if(s<1){let n=cb(e,i,r,l);return yb(e,t,i,r,a,l),void pb(e,s,n,i)}yb(e,t,i,r,a,l)},fill:function(e,t,i,r,a){let n=i.paint.get("fill-color"),o=i.paint.get("fill-opacity"),s=i.paint.get("fill-layer-opacity");if(0===o.constantOr(1)||0===s)return;if(s<1){if("translucent"!==e.renderPass)return;let n=cb(e,i,r,!!e.style.map.terrain);return xb(e,t,i,r,a),void pb(e,s,n,i)}let l=i.paint.get("fill-pattern"),h=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===n.constantOr(ki.transparent).a&&1===o.constantOr(0);if(h&&"opaque"===e.renderPass){let{isRenderingToTexture:n}=a,o=e.colorModeForRenderPass();wb(e,t,i,r,e.getDepthModeForSublayer(1,Wx.ReadWrite),o,!1,n)}else h&&"translucent"===e.renderPass?bb(e,t,i,r,a):"translucent"===e.renderPass&&xb(e,t,i,r,a)},fillExtrusion:function(e,t,i,r,a){let n=i.paint.get("fill-extrusion-opacity");if(0===n)return;let{isRenderingToTexture:o}=a;if("translucent"===e.renderPass){let a=new Wx(e.context.gl.LEQUAL,Wx.ReadWrite,e.depthRangeFor3D);if(1!==n||i.paint.get("fill-extrusion-pattern").constantOr(1))Tb(e,t,i,r,a,Xx.disabled,Gx.disabled,o),Tb(e,t,i,r,a,e.stencilModeFor3D(),e.colorModeForRenderPass(),o);else{let n=e.colorModeForRenderPass();Tb(e,t,i,r,a,Xx.disabled,n,o)}}},hillshade:function(e,t,i,r,a){if("offscreen"!==e.renderPass&&"translucent"!==e.renderPass)return;let{isRenderingToTexture:n}=a,o=e.context,s=e.style.projection.useSubdivision,l=e.getDepthModeForSublayer(0,Wx.ReadOnly),h=e.colorModeForRenderPass();if("offscreen"===e.renderPass)(function(e,t,i,r,a,n,o){let s=e.context,l=s.gl,h="nearest"===r.paint.get("resampling")?l.NEAREST:l.LINEAR;for(let u of i){let i=t.getTile(u),c=i.dem;if(!c?.data||!i.needsHillshadePrepare)continue;let p=c.dim,d=c.stride,f=c.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture||=e.getTileTexture(d),i.demTexture){let e=i.demTexture;e.update(f,{premultiply:!1}),e.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else i.demTexture=new jh(s,f,l.RGBA,{premultiply:!1}),i.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);let m=i.fbo;if(!m){let e=new jh(s,{width:p,height:p,data:null},l.RGBA);e.bind(h,l.CLAMP_TO_EDGE),m=i.fbo=s.createFramebuffer(p,p,!0,!1),m.colorAttachment.set(e.texture)}s.bindFramebuffer.set(m.framebuffer),s.viewport.set([0,0,p,p]),e.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,a,n,o,Kx.disabled,Ov(i.tileID,c),null,null,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),i.needsHillshadePrepare=!1}})(e,t,r,i,l,Xx.disabled,h),o.viewport.set([0,0,e.width,e.height]);else if("translucent"===e.renderPass)if(s){let[a,o,s]=e.stencilConfigForOverlapTwoPass(r);Sb(e,t,i,s,a,l,h,!1,n),Sb(e,t,i,s,o,l,h,!0,n)}else{let[a,o]=e.getStencilConfigForOverlapAndUpdateStencilID(r);Sb(e,t,i,o,a,l,h,!1,n)}},colorRelief:function(e,t,i,r,a){if("translucent"!==e.renderPass||!r.length)return;let{isRenderingToTexture:n}=a,o=e.style.projection.useSubdivision,s=e.getDepthModeForSublayer(0,Wx.ReadOnly),l=e.colorModeForRenderPass();if(o){let[a,o,h]=e.stencilConfigForOverlapTwoPass(r);Eb(e,t,i,h,a,s,l,!1,n),Eb(e,t,i,h,o,s,l,!0,n)}else{let[a,o]=e.getStencilConfigForOverlapAndUpdateStencilID(r);Eb(e,t,i,o,a,s,l,!1,n)}},raster:function(e,t,i,r,a){if("translucent"!==e.renderPass||0===i.paint.get("raster-opacity")||!r.length)return;let{isRenderingToTexture:n}=a,o=t.getSource(),s=e.style.projection.useSubdivision;if(o instanceof Ng)Mb(e,t,i,r,null,!1,!1,o.tileCoords,o.flippedWindingOrder,n);else if(s){let[a,o,s]=e.stencilConfigForOverlapTwoPass(r);Mb(e,t,i,s,a,!1,!0,Cb,!1,n),Mb(e,t,i,s,o,!0,!0,Cb,!1,n)}else{let[a,o]=e.getStencilConfigForOverlapAndUpdateStencilID(r);Mb(e,t,i,o,a,!1,!0,Cb,!1,n)}},background:function(e,t,i,r,a){let n=i.paint.get("background-color"),o=i.paint.get("background-opacity");if(0===o)return;let{isRenderingToTexture:s}=a,l=e.context,h=l.gl,u=e.style.projection,c=e.transform,p=c.tileSize,d=i.paint.get("background-pattern");if(e.isPatternMissing(d))return;let f=!d&&1===n.a&&1===o&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass!==f)return;let m=Xx.disabled,g=e.getDepthModeForSublayer(0,"opaque"===f?Wx.ReadWrite:Wx.ReadOnly),_=e.colorModeForRenderPass(),y=e.useProgram(d?"backgroundPattern":"background"),v=r||c_(c,{tileSize:p,terrain:e.style.map.terrain});d&&(l.activeTexture.set(h.TEXTURE0),e.imageManager.bind(e.context));let x=i.getCrossfadeParameters();for(let t of v){let r=c.getProjectionData({overscaledTileID:t,applyGlobeMatrix:!s,applyTerrainMatrix:!0}),a=d?ix(o,e,d,{tileID:t,tileSize:p},x):tx(o,n),f=e.getTerrainDataForTile(t,s),v=u.getMeshFromTileID(l,t.canonical,!1,!0,"raster");y.draw(l,h.TRIANGLES,g,m,_,Kx.backCCW,a,f,r,i.id,v.vertexBuffer,v.indexBuffer,v.segments)}},sky:function(e,t){let i=e.context,r=i.gl,a=((e,t,i)=>{let r=Math.cos(t.rollInRadians),a=Math.sin(t.rollInRadians),n=i_(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-n*a)*i,(t.height/2+n*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}})(t,e.transform,e.pixelRatio),n=new Wx(r.LEQUAL,Wx.ReadWrite,[0,1]),o=Xx.disabled,s=e.colorModeForRenderPass(),l=e.useProgram("sky"),h=Nb(i,t);l.draw(i,r.TRIANGLES,n,o,s,Kx.disabled,a,null,void 0,"sky",h.vertexBuffer,h.indexBuffer,h.segments)},atmosphere:function(e,t,i){let r=e.context,a=r.gl,n=e.useProgram("atmosphere"),o=new Wx(a.LEQUAL,Wx.ReadOnly,[0,1]),s=e.transform,l=function(e,t){let i=e.getCartesianPosition();!function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2]}(i,i);let r=w(new Float64Array(16));return"map"===e.properties.get("anchor")&&(I(r,r,t.rollInRadians),C(r,r,-t.pitchInRadians),I(r,r,t.bearingInRadians),C(r,r,t.center.lat*Math.PI/180),M(r,r,-t.center.lng*Math.PI/180)
2),function(e,t,i){var r=t[0],a=t[1],n=t[2],o=i[3]*r+i[7]*a+i[11]*n+i[15];o||=1,e[0]=(i[0]*r+i[4]*a+i[8]*n+i[12])/o,e[1]=(i[1]*r+i[5]*a+i[9]*n+i[13])/o,e[2]=(i[2]*r+i[6]*a+i[10]*n+i[14])/o}(i,i,r),i}(i,e.transform),h=s.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),u=t.properties.get("atmosphere-blend")*h.projectionTransition;if(0===u)return;let c=Jy(s.worldSize,s.center.lat),p=s.inverseProjectionMatrix,d=new Float64Array(4);d[3]=1,H(d,d,s.modelViewProjectionMatrix),d[0]/=d[3],d[1]/=d[3],d[2]/=d[3],d[3]=1,H(d,d,p),d[0]/=d[3],d[1]/=d[3],d[2]/=d[3],d[3]=1;let f=((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}))(l,u,[d[0],d[1],d[2]],c,p),m=Nb(r,t);n.draw(r,a.TRIANGLES,o,Xx.disabled,Gx.alphaBlended,Kx.disabled,f,null,null,"atmosphere",m.vertexBuffer,m.indexBuffer,m.segments)},custom:function(e,t,i,r){let{isRenderingGlobe:a}=r,n=e.context,o=i.implementation,s=e.style.projection,l=e.transform,h=l.getProjectionDataForCustomLayer(a),u={farZ:l.farZ,nearZ:l.nearZ,fov:l.fov*Math.PI/180,modelViewProjectionMatrix:l.modelViewProjectionMatrix,projectionMatrix:l.projectionMatrix,shaderData:{variantName:s.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;\nuniform mat4 u_projection_matrix;\n${s.shaderPreludeCode.vertexSource}`,define:s.shaderDefine},defaultProjectionData:h,getProjectionData:e=>l.getProjectionData({overscaledTileID:new Lp(e.tileID.canonical.z,e.tileID.wrap??0,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),aligned:e.aligned,applyGlobeMatrix:e.applyGlobeMatrix,applyTerrainMatrix:e.applyTerrainMatrix})},c=o.renderingMode?o.renderingMode:"2d";if("offscreen"===e.renderPass){let t=o.prerender;t&&(e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),t.call(o,n.gl,u),n.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),n.setStencilMode(Xx.disabled);let t="3d"===c?e.getDepthModeFor3D():e.getDepthModeForSublayer(0,Wx.ReadOnly);n.setDepthMode(t),o.render(n.gl,u),n.setDirty(),e.setBaseState(),n.bindFramebuffer.set(null)}},debug:function(e,t,i){for(let r of i)jb(e,t,r)},debugPadding:function(e){let t=e.transform.padding;Bb(e,e.transform.height-(t.top||0),3,kb),Bb(e,t.bottom||0,3,Db),Ob(e,t.left||0,3,Rb),Ob(e,e.transform.width-(t.right||0),3,Lb);let i=e.transform.centerPoint;!function(e,t,i,r){Vb(e,t-1,i-10,2,20,r),Vb(e,t-10,i-1,20,2,r)}(e,i.x,e.transform.height-i.y,Fb)},terrainDepth:function(e,t){let i=e.context,r=i.gl,a=e.transform,n=Gx.unblended,o=new Wx(r.LEQUAL,Wx.ReadWrite,[0,1]),s=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:ki.transparent,depth:1});for(let e of s){let s=t.getTerrainMesh(e.tileID),h=t.getTerrainData(e.tileID),u=a.getProjectionData({overscaledTileID:e.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),c=xv(t.getSkirtLength(a.zoom));l.draw(i,r.TRIANGLES,o,Xx.disabled,n,Kx.backCCW,c,h,u,"terrain",s.vertexBuffer,s.indexBuffer,s.segments)}i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height])},terrainCoords:function(e,t){let i=e.context,r=i.gl,a=e.transform,n=Gx.unblended,o=new Wx(r.LEQUAL,Wx.ReadWrite,[0,1]),s=t.getCoordsTexture(),l=t.tileManager.getRenderableTiles(),h=e.useProgram("terrainCoords");i.bindFramebuffer.set(t.getFramebuffer("coords").framebuffer),i.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),i.clear({color:ki.transparent,depth:1}),t.coordsIndex=[];for(let e of l){let l=t.getTerrainMesh(e.tileID),u=t.getTerrainData(e.tileID);i.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,s.texture);let c=bv(255-t.coordsIndex.length,t.getSkirtLength(a.zoom)),p=a.getProjectionData({overscaledTileID:e.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});h.draw(i,r.TRIANGLES,o,Xx.disabled,n,Kx.backCCW,c,u,p,"terrain",l.vertexBuffer,l.indexBuffer,l.segments),t.coordsIndex.push(e.tileID.key)}i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height])}};var $b=class e{constructor(e,t){this.drawFunctions=qb,this.context=new Zx(e),this.transform=t,this.layerOpacityFbo=null,this._tileTextures={},this._rttObjectRecyclePool=[],this._rttSharedFbo=null,this.terrainFacilitator={depthDirty:!0,coordsDirty:!1,matrix:w(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=b_.maxOverzooming+b_.maxUnderzooming+1,this.depthEpsilon=1/65536,this.crossTileSymbolIndex=new Ty}resize(e,t,i){if(this.width=Math.floor(e*i),this.height=Math.floor(t*i),this.pixelRatio=i,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let e of this.style._order)this.style._layers[e].resize()}setup(){let e=this.context,t=new qs;t.emplaceBack(0,0),t.emplaceBack(ne,0),t.emplaceBack(0,ne),t.emplaceBack(ne,ne),this.tileExtentBuffer=e.createVertexBuffer(t,My.members),this.tileExtentSegments=ul.simpleSegment(0,0,4,2);let i=new qs;i.emplaceBack(0,0),i.emplaceBack(ne,0),i.emplaceBack(0,ne),i.emplaceBack(ne,ne),this.debugBuffer=e.createVertexBuffer(i,My.members),this.debugSegments=ul.simpleSegment(0,0,4,5);let r=new Us;r.emplaceBack(0,0,0,0),r.emplaceBack(ne,0,ne,0),r.emplaceBack(0,ne,0,ne),r.emplaceBack(ne,ne,ne,ne),this.rasterBoundsBuffer=e.createVertexBuffer(r,_v.members),this.rasterBoundsSegments=ul.simpleSegment(0,0,4,2);let a=new qs;a.emplaceBack(0,0),a.emplaceBack(ne,0),a.emplaceBack(0,ne),a.emplaceBack(ne,ne),this.rasterBoundsBufferPosOnly=e.createVertexBuffer(a,My.members),this.rasterBoundsSegmentsPosOnly=ul.simpleSegment(0,0,4,5);let n=new qs;
2n.emplaceBack(0,0),n.emplaceBack(1,0),n.emplaceBack(0,1),n.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(n,My.members),this.viewportSegments=ul.simpleSegment(0,0,4,2);let o=new sl;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(o);let s=new nl;s.emplaceBack(1,0,2),s.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s);let l=this.context.gl;this.stencilClearMode=new Xx({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.tileExtentMesh=new Cy(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let e=this.context,t=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let i=x();z(i,0,this.width,this.height,0,0,1),E(i,i,[t.drawingBufferWidth,t.drawingBufferHeight,0]);let r={mainMatrix:i,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:i,clipAntimeridian:!1};this.useProgram("clippingMask",null,!0).draw(e,t.TRIANGLES,Wx.disabled,this.stencilClearMode,Gx.disabled,Kx.disabled,null,null,r,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}renderTileClippingMasks(e,t,i){if(this.currentStencilSource===e.source||!e.isTileClipped()||!t?.length)return;this.currentStencilSource=e.source,this.nextStencilID+t.length>256&&this.clearStencil();let r=this.context;r.setColorMode(Gx.disabled),r.setDepthMode(Wx.disabled);let a={};for(let e of t)a[e.key]=this.nextStencilID++;this._renderTileMasks(a,t,i,!0),this._renderTileMasks(a,t,i,!1),this._tileClippingMaskIDs=a}_renderTileMasks(e,t,i,r){let a=this.context,n=a.gl,o=this.style.projection,s=this.transform,l=this.useProgram("clippingMask");for(let h of t){let t=e[h.key],u=this.getTerrainDataForTile(h,i),c=o.getMeshFromTileID(this.context,h.canonical,r,!0,"stencil"),p=s.getProjectionData({overscaledTileID:h,applyGlobeMatrix:!i,applyTerrainMatrix:!0});l.draw(a,n.TRIANGLES,Wx.disabled,new Xx({func:n.ALWAYS,mask:0},t,255,n.KEEP,n.KEEP,n.REPLACE),Gx.disabled,i?Kx.disabled:Kx.backCCW,null,u,p,"$clipping",c.vertexBuffer,c.indexBuffer,c.segments)}}getTerrainDataForTile(e,t){return t&&"mercator"===this.style.projection?.name?null:this.style.map.terrain?.getTerrainData(e)||null}_renderTilesDepthBuffer(){let e=this.context,t=e.gl,i=this.style.projection,r=this.transform,a=this.useProgram("depth"),n=this.getDepthModeFor3D(),o=c_(r,{tileSize:r.tileSize});for(let s of o){let o=this.style.map.terrain?.getTerrainData(s),l=i.getMeshFromTileID(this.context,s.canonical,!0,!0,"raster"),h=r.getProjectionData({overscaledTileID:s,applyGlobeMatrix:!0,applyTerrainMatrix:!0});a.draw(e,t.TRIANGLES,n,Xx.disabled,Gx.disabled,Kx.backCCW,null,o,h,"$clipping",l.vertexBuffer,l.indexBuffer,l.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,t=this.context.gl;return new Xx({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){let t=this.context.gl;return new Xx({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){let t=this.context.gl,i=e.sort(((e,t)=>t.overscaledZ-e.overscaledZ)),r=i[i.length-1].overscaledZ,a=i[0].overscaledZ-r+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();let e={};for(let i=0;i<a;i++)e[i+r]=new Xx({func:t.GEQUAL,mask:255},i+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=a,[e,i]}return[{[r]:Xx.disabled},i]}stencilConfigForOverlapTwoPass(e){let t=this.context.gl,i=e.sort(((e,t)=>t.overscaledZ-e.overscaledZ)),r=i[i.length-1].overscaledZ,a=i[0].overscaledZ-r+1;if(this.clearStencil(),a>1){let e={},n={};for(let i=0;i<a;i++)e[i+r]=new Xx({func:t.GREATER,mask:255},a+1+i,255,t.KEEP,t.KEEP,t.REPLACE),n[i+r]=new Xx({func:t.GREATER,mask:255},1+i,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID=2*a+1,[e,n,i]}return this.nextStencilID=3,[{[r]:new Xx({func:t.GREATER,mask:255},2,255,t.KEEP,t.KEEP,t.REPLACE)},{[r]:new Xx({func:t.GREATER,mask:255},1,255,t.KEEP,t.KEEP,t.REPLACE)},i]}colorModeForRenderPass(){let e=this.context.gl;if(this._showOverdrawInspector){let t=1/8;return new Gx([e.CONSTANT_COLOR,e.ONE],new ki(t,t,t,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?Gx.unblended:Gx.alphaBlended}getDepthModeForSublayer(e,t,i){if(!this.opaquePassEnabledForLayer())return Wx.disabled;let r=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Wx(i||this.context.gl.LEQUAL,t,[r,r])}getDepthModeFor3D(){return new Wx(this.context.gl.LEQUAL,Wx.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,t){this.style=e,this.options=t,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(zm()),this.imageManager.beginFrame();let i=this.style._order,r=this.style.tileManagers,a={},n={},o={},s={isRenderingToTexture:!1,isRenderingGlobe:e.projection?.transitionState>0};for(let e in r){let t=r[e];t.used&&t.prepare(this.context),a[e]=t.getVisibleCoordinates(!1),n[e]=a[e].slice().reverse(),o[e]=t.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let e=0;e<i.length;e++){let t=i[e];if(this.style._layers[t].is3D()){this.opaquePassCutoff=e;break}}this.maybeDrawDepth(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(let e of i){let t=this.style._layers[e];if(!t.hasOffscreenPass()||t.isHidden(this.transform.zoom))continue;let i=n[t.source];"custom"!==t.type&&!i.length||this.renderLayer(this,r[t.source],t,i,s)}if(this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:t.showOverdrawInspector?ki.black:ki.transparent,depth:1}),this.clearStencil(),this.style.sky&&this.drawFunctions.sky(this,this.style.sky),this._showOverdrawInspector=t.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=i.length-1;this.currentLayer>=0;this.currentLayer--){let e=this.style._layers[i[this.currentLayer]],t=r[e.source],n=a[e.source];this.renderTileClippingMasks(e,n,!1),this.renderLayer(this,t,e,n,s)}this.renderPass="translucent";let l=!1;for(this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){let e=this.style._layers[i[this.currentLayer]],t=r[e.source];if(this.renderToTexture?.renderLayer(e,s))continue;!this.opaquePassEnabledForLayer()&&!l&&(l=!0,s.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());let h=("symbol"===e.type?o:n)[e.source];this.renderTileClippingMasks(e,a[e.source],!!this.renderToTexture),this.renderLayer(this,t,e,h,s)}if(s.isRenderingGlobe&&this.drawFunctions.atmosphere(this,this.style.sky,this.style.light),this.options.showTileBoundaries){let e=function(e,t){let i=null,r=Object.values(e._layers).flatMap((i=>i.source&&!i.isHidden(t)?[e.tileManagers[i.source]]:[])),a=r.filter((e=>"vector"===e.getSource().type)),n=r.filter((e=>"vector"!==e.getSource().type)),o=e=>{(!i||i.getSource().maxzoom<e.getSource().maxzoom)&&(i=e)};for(let e of a)o(e);if(!i)for(let e of n)o(e);return i}(this.style,this.transform.zoom);e&&this.drawFunctions.debug(this,e,e.getVisibleCoordinates())}this.options.showPadding&&this.drawFunctions.debugPadding(this),this.context.setDefault()}maybeDrawDepth(e){if(!this.style?.map?.terrain)return;let t=this.terrainFacilitator.matrix,i=this.transform.modelViewProjectionMatrix,r=this.terrainFacilitator.depthDirty;r||=e?!function(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]}(t,i):!function(e,t){var i=e[0],r=e[1],a=e[2],n=e[3],o=e[4],s=e[5],l=e[6],h=e[7],u=e[8],c=e[9],p=e[10],d=e[11],f=e[12],m=e[13],g=e[14],_=e[15],y=t[0],v=t[1],x=t[2],b=t[3],w=t[4],T=t[5],S=t[6],P=t[7],E=t[8],C=t[9],M=t[10],I=t[11],A=t[12],z=t[13],k=t[14],D=t[15];return Math.abs(i-y)<=1e-6*Math.max(1,Math.abs(i),Math.abs(y))&&Math.abs(r-v)<=1e-6*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(a-x)<=1e-6*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(n-b)<=1e-6*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(o-w)<=1e-6*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-T)<=1e-6*Math.max(1,Math.abs(s),Math.abs(T))&&Math.abs(l-S)<=1e-6*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(u-E)<=1e-6*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(c-C)<=1e-6*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(p-M)<=1e-6*Math.max(1,Math.abs(p),Math.abs(M))&&Math.abs(d-I)<=1e-6*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(f-A)<=1e-6*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(m-z)<=1e-6*Math.max(1,Math.abs(m),Math.abs(z))&&Math.abs(g-k)<=1e-6*Math.max(1,Math.abs(g),Math.abs(k))&&Math.abs(_-D)<=1e-6*Math.max(1,Math.abs(_),Math.abs(D))}(t,i),r||=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime),r&&(function(e,t){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]}(t,i),this.terrainFacilitator.renderTime=zm(),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(e,t,i,r,a){if(i.isHidden(this.transform.zoom)||"background"!==i.type&&"custom"!==i.t
vendor: 7,226 bytes, line 2
2ype&&!(r||[]).length)return;this.id=i.id;let n=this.drawFunctions;cp(i)?n.symbol(e,t,i,r,this.style.placement.variableOffsets,a):(e=>"circle"===e.type)(i)?n.circle(e,t,i,r,a):(e=>"heatmap"===e.type)(i)?n.heatmap(e,t,i,r,a):(e=>"line"===e.type)(i)?n.line(e,t,i,r,a):(e=>"fill"===e.type)(i)?n.fill(e,t,i,r,a):(e=>"fill-extrusion"===e.type)(i)?n.fillExtrusion(e,t,i,r,a):(e=>"hillshade"===e.type)(i)?n.hillshade(e,t,i,r,a):(e=>"color-relief"===e.type)(i)?n.colorRelief(e,t,i,r,a):Qo(i)?n.raster(e,t,i,r,a):(e=>"background"===e.type)(i)?n.background(e,t,i,r,a):(e=>"custom"===e.type)(i)&&n.custom(e,t,i,a)}static{this.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50}saveTileTexture(t){let i=this._tileTextures[t.size[0]];i?i.length<e.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?i.push(t):t.destroy():this._tileTextures[t.size[0]]=[t]}getTileTexture(e){let t=this._tileTextures[e];return t&&t.length>0?t.pop():null}acquireRTT(e){let t=this.context.gl,i=this._rttObjectRecyclePool.pop();if(i)return i.size!==e&&(t.bindTexture(t.TEXTURE_2D,i.texture.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,e,0,t.RGBA,t.UNSIGNED_BYTE,null),i.texture.size=[e,e],i.size=e),i;let r=new jh(this.context,{width:e,height:e,data:null},t.RGBA);return r.bind(t.LINEAR,t.CLAMP_TO_EDGE),this.context.extTextureFilterAnisotropic&&t.texParameterf(t.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),{texture:r,size:e}}bindRTT(e){let t=this.context.gl,i=e.size;if(!this._rttSharedFbo){let e=this.context.createFramebuffer(i,i,!0,!0),r=this.context.createRenderbuffer(t.DEPTH_STENCIL,i,i);e.depthAttachment.set(r),this._rttSharedFbo={fbo:e,depthRenderbuffer:r,size:i}}this._rttSharedFbo.size!==i&&(this.context.bindRenderbuffer.set(this._rttSharedFbo.depthRenderbuffer),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,i,i),this.context.bindRenderbuffer.set(null),this._rttSharedFbo.fbo.width=i,this._rttSharedFbo.fbo.height=i,this._rttSharedFbo.size=i),this._rttSharedFbo.fbo.colorAttachment.set(e.texture.texture),this.context.bindFramebuffer.set(this._rttSharedFbo.fbo.framebuffer)}releaseRTT(e){this._rttObjectRecyclePool.push(e)}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;let t=this.imageManager.getPattern(e.from.toString()),i=this.imageManager.getPattern(e.to.toString());return!t||!i}useProgram(e,t,i=!1,r=[]){this.cache||={};let a=!!this.style.map.terrain,n=this.style.projection,o=i?Py.projectionMercator:n.shaderPreludeCode,s=i?Iy:n.shaderDefine,l=`/${i?Ay:n.shaderVariantName}`,h=e+(t?t.cacheKey:"")+l+(this._showOverdrawInspector?"/overdraw":"")+(a?"/terrain":"")+(r?`/${r.join("/")}`:"");return this.cache[h]||=new Tv(this.context,Py[e],t,ax[e],this._showOverdrawInspector,a,o,s,r),this.cache[h]}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 e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;let e=this.context.gl;this.debugOverlayTexture=new jh(this.context,this.debugOverlayCanvas,e.RGBA)}}destroy(){if(this._tileTextures){for(let e in this._tileTextures){let t=this._tileTextures[e];if(t)for(let e of t)e.destroy()}this._tileTextures={}}for(let e of this._rttObjectRecyclePool)e.texture.destroy();if(this._rttObjectRecyclePool=[],this._rttSharedFbo){this._rttSharedFbo.fbo.colorAttachment.set(null),this._rttSharedFbo.fbo.depthAttachment.set(null);let e=this.context.gl;e.deleteRenderbuffer(this._rttSharedFbo.depthRenderbuffer),e.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 e in this.cache){let t=this.cache[e];t?.program&&this.context.gl.deleteProgram(t.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:e,drawingBufferHeight:t}=this.context.gl;return this.width!==e||this.height!==t}},Ub=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 Gb(e,t){let i,r=!1,a=null,n=()=>{a=null,r&&=(e(...i),a=setTimeout(n,t),!1)};return(...e)=>(r=!0,i=e,a||n(),a)}var Zb=class{constructor(e){this._getHashParams=()=>new URLSearchParams(window.location.hash.replace("#","")),this._getCurrentHash=()=>{let e=this._getHashParams();return this._hashName?(e.get(this._hashName)||"").split("/"):([...e.keys()][0]??"").split("/")},this._onHashChange=()=>{let e=this._getCurrentHash();if(!this._isValidHash(e))return!1;let t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0},this._updateHashUnthrottled=()=>{let e=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,e)},this._removeHash=()=>{let e=this._getHashParams();if(this._hashName)e.delete(this._hashName);else{let t=Array.from(e.keys());t.length>0&&e.delete(t[0])}let t=decodeURIComponent(e.toString()).replace(/=&/g,"&").replace(/=$/g,""),i=t?`#${t}`:"",r=window.location.href.replace(/(#.+)?$/,i);r=r.replace("&&","&"),window.history.replaceState(window.history.state,null,r)},this._updateHash=Gb(this._updateHashUnthrottled,300),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(100*this._map.getZoom())/100,r=10**Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),a=Math.round(t.lng*r)/r,n=Math.round(t.lat*r)/r,o=this._map.getBearing(),s=this._map.getPitch(),l="";if(l+=e?`/${a}/${n}/${i}`:`${i}/${n}/${a}
2`,(o||s)&&(l+="/"+Math.round(10*o)/10),s&&(l+=`/${Math.round(s)}`),this._hashName){let e=this._getHashParams();return e.set(this._hashName,l),`#${decodeURIComponent(e.toString()).replace(/=&/g,"&").replace(/=$/g,"")}`}return`#${l}`}_isValidHash(e){if(e.length<3||e.some((e=>isNaN(+e))))return!1;try{new wp(+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 Wb={linearity:.3,easing:Se(0,0,.3,1)},Hb=Me({deceleration:2500,maxSpeed:1400},Wb),Xb=Me({deceleration:20,maxSpeed:1400},Wb),Yb=Me({deceleration:1e3,maxSpeed:360},Wb),Kb=Me({deceleration:1e3,maxSpeed:90},Wb),Jb=Me({deceleration:1e3,maxSpeed:360},Wb);var Qb=class{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:zm(),settings:e})}_drainInertiaBuffer(){let e=this._inertiaBuffer,t=zm();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 d(0,0),pinchAround:void 0,around:void 0};for(let{settings:e}of this._inertiaBuffer)t.zoom+=e.zoomDelta||0,t.bearing+=e.bearingDelta||0,t.pitch+=e.pitchDelta||0,t.roll+=e.rollDelta||0,e.panDelta&&t.pan._add(e.panDelta),e.around&&(t.around=e.around),e.pinchAround&&(t.pinchAround=e.pinchAround);let i=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,r={};if(t.pan.mag()){let a=tw(t.pan.mag(),i,Me({},Hb,e||{})),n=t.pan.mult(a.amount/t.pan.mag()),o=this._map._camera.cameraHelper.handlePanInertia(n,this._map._camera.transform);r.center=o.easingCenter,r.offset=o.easingOffset,ew(r,a)}if(t.zoom){let e=tw(t.zoom,i,Xb);r.zoom=Re(this._map.getZoom()+e.amount,this._map.getZoomSnap(),e.amount),ew(r,e)}if(t.bearing){let e=tw(t.bearing,i,Yb);
vendor: 6,378 bytes, line 2
2r.bearing=this._map.getBearing()+Ee(e.amount,-179,179),ew(r,e)}if(t.pitch){let e=tw(t.pitch,i,Kb);r.pitch=this._map.getPitch()+e.amount,ew(r,e)}if(t.roll){let e=tw(t.roll,i,Jb);r.roll=this._map.getRoll()+Ee(e.amount,-179,179),ew(r,e)}if(r.zoom||r.bearing){let e=void 0===t.pinchAround?t.around:t.pinchAround;r.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),Me(r,{noMoveStart:!0})}};function ew(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function tw(e,t,i){let{maxSpeed:r,linearity:a,deceleration:n}=i,o=Ee(e*a/(t/1e3),-r,r),s=Math.abs(o)/(n*a);return{easing:i.easing,duration:1e3*s,amount:s/2*o}}var iw=class{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new qm(this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new jm(e.type,this._map,e))}mouseup(e){this._map.fire(new jm(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new jm(e.type,this._map,e))}dblclick(e){return this._firePreventable(new jm(e.type,this._map,e))}mouseover(e){this._map.fire(new jm(e.type,this._map,e))}mouseout(e){this._map.fire(new jm(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Nm(e.type,this._map,e))}touchmove(e){this._map.fire(new Nm(e.type,this._map,e))}touchend(e){this._map.fire(new Nm(e.type,this._map,e))}touchcancel(e){this._map.fire(new Nm(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},rw=class{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new jm(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new jm("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new jm(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},aw=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&&"object"==typeof t.boxZoom&&(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&&0===e.button&&(km.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=km.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));let a=Math.min(r.x,i.x),n=Math.max(r.x,i.x),o=Math.min(r.y,i.y),s=Math.max(r.y,i.y);this._box.style.transform=`translate(${a}px,${o}px)`,this._box.style.width=n-a+"px",this._box.style.height=s-o+"px"}mouseupWindow(e,t){if(!this._active||0!==e.button)return;let i=this._startPos,r=t;if(this.reset(),km.suppressClick(),i.x!==r.x||i.y!==r.y)return this._map.fire(new $m("boxzoomend",{originalEvent:e})),this._boxZoomEnd?void this._boxZoomEnd(this._map,i,r,e):{cameraAnimation:e=>e.fitScreenCoordinates(i,r,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&=(this._box.remove(),null),km.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,t){return this._map.fire(new $m(e,{originalEvent:t}))}};function nw(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}var ow=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&&(void 0===this.startTime&&(this.startTime=e.timeStamp),i.length===this.numTouches&&(this.centroid=function(e){let t=new d(0,0);for(let i of e)t._add(i);return t.div(e.length)}(t),this.touches=nw(i,t)))}touchmove(e,t,i){if(this.aborted||!this.centroid)return;let r=nw(i,t);for(let e in this.touches){let t=this.touches[e],i=r[e];(!i||i.dist(t)>30)&&(this.aborted=!0)}}touchend(e,t,i){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){let e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}},sw=class{constructor(e){this.singleTap=new ow(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 t=e.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(r)<30;if((!t||!i)&&this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}},lw=class{constructor(e,t){this._tr=t,this._zoomIn=new sw({numTouches:1,numTaps:2}),this._zoomOut=new sw({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),n=this._tr;return r?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:Re(n.zoom+1,t.getZoomSnap()),around:n.unproject(r)},{originalEvent:e})}):a?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>
vendor: 19,134 bytes, line 2
2t.easeTo({duration:300,zoom:Re(n.zoom-1,t.getZoomSnap()),around:n.unproject(a)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},hw=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))return void this.reset(e);let r=Array.isArray(t)?t[0]:t;return!this._moved&&r.dist(i)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=r,this._move(i,r))}dragEnd(e){!this.isEnabled()||!this._lastPoint||this._moveStateManager.isValidEndEvent(e)&&(this._moved&&km.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 uw={0:1,2:2};var cw=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!function(e,t){let i=uw[t];return void 0===e.buttons||(e.buttons&i)!==i}(e,this._eventButton)}isValidEndEvent(e){return e.button===this._eventButton}},pw=class{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return 1===e.targetTouches.length}_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)}},dw=class{constructor(e=new cw({checkCorrectEvent:()=>!0}),t=new pw){this.mouseMoveStateManager=e,this.oneFingerTouchMoveStateManager=t}_executeRelevantHandler(e,t,i){return e instanceof MouseEvent?t(e):typeof TouchEvent<"u"&&e instanceof TouchEvent?i(e):void 0}startMove(e){this._executeRelevantHandler(e,(e=>{this.mouseMoveStateManager.startMove(e)}),(e=>{this.oneFingerTouchMoveStateManager.startMove(e)}))}endMove(e){this._executeRelevantHandler(e,(e=>{this.mouseMoveStateManager.endMove(e)}),(e=>{this.oneFingerTouchMoveStateManager.endMove(e)}))}isValidStartEvent(e){return!!this._executeRelevantHandler(e,(e=>this.mouseMoveStateManager.isValidStartEvent(e)),(e=>this.oneFingerTouchMoveStateManager.isValidStartEvent(e)))}isValidMoveEvent(e){return!!this._executeRelevantHandler(e,(e=>this.mouseMoveStateManager.isValidMoveEvent(e)),(e=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(e)))}isValidEndEvent(e){return!!this._executeRelevantHandler(e,(e=>this.mouseMoveStateManager.isValidEndEvent(e)),(e=>this.oneFingerTouchMoveStateManager.isValidEndEvent(e)))}};const fw=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=e=>{e.preventDefault()}};var mw=class{constructor(e,t){this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new d(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)return this._shouldBePrevented(i.length)?void this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e):(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=nw(i,t),a=new d(0,0),n=new d(0,0),o=0;for(let e in r){let t=r[e],i=this._touches[e];i&&(a._add(t),n._add(t.sub(i)),o++,r[e]=t)}if(this._touches=r,this._shouldBePrevented(o)||!n.mag())return;let s=n.div(o);return this._sum._add(s),this._sum.mag()<this._clickTolerance?void 0:{around:a.div(o),panDelta:s}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},gw=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,n=_w(i,t,r),o=_w(i,t,a);if(!n||!o)return;let s=this._aroundCenter?null:n.add(o).div(2);return this._move([n,o],s,e)}touchend(e,t,i){if(!this._firstTwoTouches)return;let[r,a]=this._firstTwoTouches,n=_w(i,t,r),o=_w(i,t,a);n&&o||(this._active&&km.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}};function _w(e,t,i){for(let r=0;r<e.length;r++)if(e[r].identifier===i)return t[r]}function yw(e,t){return Math.log(e/t)/Math.LN2}var vw=class extends gw{constructor(){super(),this._zoomRate=1,this._zoomThreshold=.1}setZoomRate(e){this._zoomRate=e??1}setZoomThreshold(e){this._zoomThreshold=e??.1}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(yw(this._distance,this._startDistance))<this._zoomThreshold))return this._active=!0,{zoomDelta:yw(this._distance,i)*this._zoomRate,pinchAround:t}}};function xw(e,t){return 180*e.angleWith(t)/Math.PI}var bw=class extends gw{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:xw(this._vector,r),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());let t=25/(Math.PI*this._minDiameter)*360,i=xw(e,this._startVector);return Math.abs(i)<t}};function ww(e){return Math.abs(e.y)>Math.abs(e.x)}var Tw=class extends gw{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,ww(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]);return this._valid=this.gestureBeginsVertically(r,a,i.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(r.y+a.y)/2*-.5}):void 0}gestureBeginsVertically(e,t,i){if(void 0!==this._valid)return this._valid;let r=e.mag()>=2,a=t.mag()>=2;if(!r&&!a)return;if(!r||!a)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;let n=e.y>0==t.y>0;return ww(e)&&ww(t)&&n}};const Sw={panStep:100,bearingStep:15,pitchStep:10};var Pw=class{constructor(e,t){this._tr=t;let i=Sw;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,n=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(),n=-1);break;case 40:e.shiftKey?r=-1:(e.preventDefault(),n=1);break;default:return}return this._rotationDisabled&&(i=0,r=0),{cameraAnimation:o=>{let s=this._tr;o.easeTo({duration:300,easeId:"keyboardHandler",easing:Ew,zoom:t?Re(s.zoom+t*(e.shiftKey?2:1),o.getZoomSnap()):s.zoom,bearing:s.bearing+i*this._bearingStep,pitch:s.pitch+r*this._pitchStep,offset:[-a*this._panStep,-n*this._panStep],center:s.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 Ew(e){return e*(2-e)}const Cw=4.000244140625;var Mw=class{constructor(e,t,i){this._onTimeout=e=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},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||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let t=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,i=zm(),r=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==t&&t%Cw==0?this._type="wheel":0!==t&&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=km.mousePos(this._map.getCanvas(),e),i=this._tr;this._aroundCenter?this._aroundPoint=i.transform.locationToScreenPoint(wp.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("number"==typeof this._lastExpectedZoom){let t=e.zoom-this._lastExpectedZoom;"number"==typeof this._startZoom&&(this._startZoom+=t),"number"==typeof this._targetZoom&&(this._targetZoom+=t)}if(0!==this._delta){let t="wheel"===this._type&&Math.abs(this._delta)>Cw?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*t)));this._delta<0&&0!==i&&(i=1/i);let r="number"==typeof this._targetZoom?ke(this._targetZoom):e.scale,a=e.applyConstrain(e.getCameraLngLat(),De(r*i)).zoom,n=this._map.getZoomSnap();if("wheel"===this._type&&n>0){let t=Re(e.zoom,n);this._targetZoom=Re(a,n,a-t)}else this._targetZoom=a;"wheel"===this._type&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let t,i="number"==typeof this._targetZoom?this._targetZoom:e.zoom,r=this._startZoom,a=this._easing,n=!1;if("wheel"===this._type&&r&&a){let e=zm()-this._lastWheelEventTime,o=Math.min((e+5)/200,1),s=a(o);t=hr.number(r,i,s),o<1?this._needsRerender=!0:n=!0}else t=i,n=!0;return this._active=!0,n&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout}),200)),this._lastExpectedZoom=t,{noInertia:!0,needsRenderFrame:!n,zoomDelta:t-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let t=Pe;if(this._prevEase){let e=this._prevEase,i=(zm()-e.start)/e.duration,r=e.easing(i+.01)-e.easing(i),a=.27/Math.sqrt(r*r+1e-4)*.01;t=Se(a,Math.sqrt(.0729-a*a),.25,1)}return this._prevEase={start:zm(),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)}},Iw=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()}},Aw=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:Re(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}},zw=class{constructor(){this._tap=new sw({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){let r=t[0],a=e.timeStamp-this._tapTime<500,n=this._tapPoint.dist(r)<30;a&&n?i.length>0&&(this._swipePoint=r,this._swipeTouch=i[0].identifier):this.reset()}else this._tap.touchstart(e,t,i)}touchmove(e,t,i){if(this._tapTime){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}}}else this._tap.touchmove(e,t,i)}touchend(e,t,i){if(this._tapTime)this._swipePoint&&0===i.length&&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}},kw=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()}},Dw=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()}},Rw=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()}},Lw=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=km.create("div","maplibregl-cooperative-gesture-screen",e);let t=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(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 Lm("cooperativegestureprevented",{gestureType:e,originalEvent:t})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}},Fw=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(d.convert(e),this._camera.terrain)}};const Bw=e=>e.zoom||e.drag||e.roll||e.pitch||e.rotate;var Ow=class extends vt{};function Vw(e){return e.panDelta?.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta||e.rollDelta}var jw=class{get _ownerDocument(){return this._el?.ownerDocument||document}get _ownerWindow(){return this._el?.ownerDocument?.defaultView||window}constructor(e,t,i){this.handleWindowEvent=e=>{this.handleEvent(e,`${e.type}Window`)},this.handleEvent=(e,t)=>
vendor: 8,721 bytes, line 2
2{if("blur"===e.type)return void this.stop(!0);this._updatingCamera=!0;let i="renderFrame"===e.type?void 0:e,r={needsRenderFrame:!1},a={},n={};for(let{handlerName:o,handler:s,allowed:l}of this._handlers){if(!s.isEnabled())continue;let h;if(this._blockedByActive(n,l,o))s.reset();else if(s[t||e.type]){if(rt(e,t||e.type)){let i=km.mousePos(this._map.getCanvas(),e);h=s[t||e.type](e,i)}else if(it(e,t||e.type)){let i=e.touches,r=this._getMapTouches(i),a=km.touchPos(this._map.getCanvas(),r);h=s[t||e.type](e,a,r)}else at(t||e.type)||(h=s[t||e.type](e));this.mergeHandlerResult(r,a,h,o,i),h?.needsRenderFrame&&this._triggerRenderFrame()}(h||s.isActive())&&(n[o]=s)}let o={};for(let e in this._previousActiveHandlers)n[e]||(o[e]=i);this._previousActiveHandlers=n,(Object.keys(o).length||Vw(r))&&(this._changes.push([r,a,o]),this._triggerRenderFrame()),(Object.keys(n).length||Vw(r))&&this._camera.stop(!0),this._updatingCamera=!1;let{cameraAnimation:s}=r;s&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],s(this._map))},this._map=e,this._camera=t,this._transformProvider=new Fw(this._camera),this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Qb(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[e,t,i]of this._listeners)e.addEventListener(t,e===this._ownerDocument?this.handleWindowEvent:this.handleEvent,i)}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 iw(t,e));let r=t.boxZoom=new aw(t,e,this._transformProvider);this._add("boxZoom",r),e.interactive&&e.boxZoom&&r.enable();let a=t.cooperativeGestures=new Lw(t,e.cooperativeGestures);this._add("cooperativeGestures",a),e.cooperativeGestures&&a.enable();let n=new lw(t,this._transformProvider),o=new Aw(t,this._transformProvider);t.doubleClickZoom=new Iw(o,n),this._add("tapZoom",n),this._add("clickZoom",o),e.interactive&&e.doubleClickZoom&&t.doubleClickZoom.enable();let s=new zw;this._add("tapDragZoom",s);let l=t.touchPitch=new Tw(t);this._add("touchPitch",l),e.interactive&&e.touchPitch&&t.touchPitch.enable(e.touchPitch);let h=()=>t.project(t.getCenter()),u=function({enable:e,clickTolerance:t,aroundCenter:i=!0,minPixelCenterThreshold:r=100,rotateSpeed:a=.8},n){return new hw({clickTolerance:t,move:(e,t)=>{let o=n();if(i&&Math.abs(o.y-e.y)>r)return{bearingDelta:Ke(new d(e.x,t.y),t,o)};let s=(t.x-e.x)*a;return i&&t.y<o.y&&(s=-s),{bearingDelta:s}},moveStateManager:new cw({checkCorrectEvent:e=>0===e.button&&e.ctrlKey||2===e.button&&!e.ctrlKey}),enable:e,assignEvents:fw})}(e,h),c=function({enable:e,clickTolerance:t,pitchSpeed:i=-.5}){return new hw({clickTolerance:t,move:(e,t)=>({pitchDelta:(t.y-e.y)*i}),moveStateManager:new cw({checkCorrectEvent:e=>0===e.button&&e.ctrlKey||2===e.button}),enable:e,assignEvents:fw})}(e),p=function({enable:e,clickTolerance:t,rollDegreesPerPixelMoved:i=.3},r){return new hw({clickTolerance:t,move:(e,t)=>{let a=r(),n=(t.x-e.x)*i;return t.y<a.y&&(n=-n),{rollDelta:n}},moveStateManager:new cw({checkCorrectEvent:e=>2===e.button&&e.ctrlKey}),enable:e,assignEvents:fw})}(e,h);t.dragRotate=new Dw(e,u,c,p),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",c,["mouseRotate","mouseRoll"]),this._add("mouseRoll",p,["mousePitch"]),e.interactive&&e.dragRotate&&t.dragRotate.enable();let f=function({enable:e,clickTolerance:t}){return new hw({clickTolerance:t,move:(e,t)=>({around:t,panDelta:t.sub(e)}),activateOnStart:!0,moveStateManager:new cw({checkCorrectEvent:e=>0===e.button&&!e.ctrlKey}),enable:e,assignEvents:fw})}(e),m=new mw(e,t);t.dragPan=new kw(i,f,m),this._add("mousePan",f),this._add("touchPan",m,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&t.dragPan.enable(e.dragPan);let g=new bw,_=new vw;t.touchZoomRotate=new Rw(i,_,g,s),this._add("touchRotate",g,["touchPan","touchZoom"]),this._add("touchZoom",_,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&t.touchZoomRotate.enable(e.touchZoomRotate),this._add("blockableMapEvent",new rw(t));let y=t.scrollZoom=new Mw(t,(()=>this._triggerRenderFrame()),this._transformProvider);this._add("scrollZoom",y,["mousePan"]),e.interactive&&e.scrollZoom&&t.scrollZoom.enable(e.scrollZoom);let v=t.keyboard=new Pw(t,this._transformProvider);this._add("keyboard",v),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:e}of this._handlers)e.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!!Bw(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 e=i.target;this._el.contains(e)&&t.push(i)}return t}mergeHandlerResult(e,t,i,r,a){if(!i)return;Me(e,i);let n={handlerName:r,originalEvent:i.originalEvent||a};void 0!==i.zoomDelta&&(t.zoom=n),void 0!==i.panDelta&&(t.drag=n),void 0!==i.rollDelta&&(t.roll=n),void 0!==i.pitchDelta&&(t.pitch=n),void 0!==i.bearingDelta&&(t.rotate=n)}_applyChanges(){let e={},t={},i={};for(let[r,a,n]of this._changes)r.panDelta&&(e.panDelta=(e.panDelta||new d(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),void 0!==r.around&&(e.around=r.around),void 0!==r.pinchAround&&(e.pinchAround=r.pinchAround),r.noInertia&&(e.noInertia=r.noInertia),Me(t,a),Me(i,n);this._updateMapTransform(e,t,i),this._changes=[]}_updateMapTransform(e,t,i){let r=this._map,a=this._camera.getTransformForUpdate(),n=r.terrain;if(!(Vw(e)||n&&this._terrainMovement))return void this._fireEvents(t,i,!0);this._camera.stop(!0);let{panDelta:o,zoomDelta:s,bearingDelta:l,pitchDelta:h,rollDelta:u,around:c,pinchAround:p}=e;void 0!==p&&(c=p),c||=this._camera.transform.centerPoint,n&&!a.isPointOnMapSurface(c)&&(c=a.centerPoint);let d={panDelta:o,zoomDelta:s,rollDelta:u,pitchDelta:h,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:n,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:n}){let o=this._camera.cameraHelper;if(o.handleMapControlsRollPitchBearingZoom(i,t),e)return o.useGlobeControls?(!this._terrainMovement&&(a.drag||a.zoom)&&(this._terrainMovement=!0,this._camera.elevationFreeze=!0),void o.handleMapControlsPan(i,t,r)):this._terrainMovement||!a.drag&&!a.zoom?void(a.drag&&this._terrainMovement&&n?t.setCenter(t.screenPointToLocation(t.centerPoint.sub(n))):o.handleMapControlsPan(i,t,r)):(this._terrainMovement=!0,this._camera.elevationFreeze=!0,void o.handleMapControlsPan(i,t,r));o.handleMapControlsPan(i,t,r)}_fireEvents(e,t,i){let r=Bw(this._eventsInProgress),a=Bw(e),n={};for(let t in e){let{originalEvent:i}=e[t];this._eventsInProgress[t]||(n[`${t}start`]=i),this._eventsInProgress[t]=e[t]}!r&&a&&this._fireEvent("movestart",a.originalEvent);for(let e in n)this._fireEvent(e,n[e]);a&&this._fireEvent("move",a.originalEvent);for(let t in e){let{originalEvent:i}=e[t];this._fireEvent(t,i)}let o,s={};for(let e in this._eventsInProgress){let{handlerName:i,originalEvent:r}=this._eventsInProgress[e];this._handlersById[i].isActive()||(delete this._eventsInProgress[e],o=t[i]||r,s[`${e}end`]=o)}for(let e in s)this._fireEvent(e,s[e]);
vendor: 7,948 bytes, line 2
2let l=Bw(this._eventsInProgress),h=(r||a)&&!l;if(h&&this._terrainMovement){this._camera.elevationFreeze=!1,this._terrainMovement=!1;let e=this._camera.getTransformForUpdate();this._map.getCenterClampedToGround()&&e.recalculateZoomAndCenter(this._map.terrain),this._camera.applyUpdatedTransform(e)}if(i&&h){this._updatingCamera=!0;let e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),t=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;!e||!e.essential&&Im.prefersReducedMotion?(this._map.fire(new Fm("moveend",{originalEvent:o})),t(this._map.getBearing())&&this._map.resetNorth()):(t(e.bearing||this._map.getBearing())&&(e.bearing=0),e.freezeElevation=!0,this._map.easeTo(e,{originalEvent:o})),this._updatingCamera=!1}}_fireEvent(e,t){this._map.fire(new Fm(e,t?{originalEvent:t}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((e=>{delete this._frameId,this.handleEvent(new Ow("renderFrame",{timeStamp:e})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}},Nw=class extends bt{constructor(e){super(),this._renderFrameCallback=()=>{let e=Math.min((zm()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this.transform=new Vy,this.cameraHelper=new $y,void 0!==e.minZoom&&this.transform.setMinZoom(e.minZoom),void 0!==e.maxZoom&&this.transform.setMaxZoom(e.maxZoom),void 0!==e.minPitch&&this.transform.setMinPitch(e.minPitch),void 0!==e.maxPitch&&this.transform.setMaxPitch(e.maxPitch),void 0!==e.renderWorldCopies&&this.transform.setRenderWorldCopies(e.renderWorldCopies),null!==e.transformConstrain&&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 wp(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=d.convert(e).mult(-1),this.panTo(this.transform.center,Me({offset:e},t),i)}panTo(e,t,i){return this.easeTo(Me({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(Me({zoom:e},t),i)}zoomIn(e,t){return this.zoomTo(Re(this.getZoom()+1,this._zoomSnap),e,t),this}zoomOut(e,t){return this.zoomTo(Re(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 Fm("movestart",t)).fire(new Fm("move",t)).fire(new Fm("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(Me({bearing:e},t),i)}resetNorth(e,t){return this.rotateTo(0,Me({duration:1e3},e),t),this}resetNorthPitch(e,t){return this.easeTo(Me({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=Cg.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("number"==typeof(r=Me({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},r)).padding){let e=r.padding;r.padding={top:e,bottom:e,right:e,left:e}}let n=Me(a,r.padding);r.padding=n;let o=this.transform,s=new Cg(e,t),l=this.cameraHelper.cameraForBoxAndBearing(r,n,s,i,o);return l&&this._zoomSnap&&(l.zoom=Re(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(d.convert(e)),this.transform.screenPointToLocation(d.convert(t)),i,r),r,a)}_fitInternal(e,t,i){return e?(delete(t=Me(e,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=Re(e.zoom,this._zoomSnap));let i=this.getTransformForUpdate(),r=!1,a=!1,n=!1,o=i.zoom;this.terrain&&i.setElevation(this.terrain.getElevationForLngLatZoom(e.center?wp.convert(e.center):i.center,e.zoom||i.tileZoom)),this.cameraHelper.handleJumpToCenterZoom(i,e);let s=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&&(n=!0,i.setRoll(+e.roll)),null!=e.padding&&!i.isPaddingEqual(e.padding)&&i.setPadding(e.padding),this.applyUpdatedTransform(i),this.fire(new Fm("movestart",t)).fire(new Fm("move",t)),s&&this.fire(new Fm("zoomstart",t)).fire(new Fm("zoom",t)).fire(new Fm("zoomend",t)),r&&this.fire(new Fm("rotatestart",t)).fire(new Fm("rotate",t)).fire(new Fm("rotateend",t)),a&&this.fire(new Fm("pitchstart",t)).fire(new Fm("pitch",t)).fire(new Fm("pitchend",t)),n&&this.fire(new Fm("rollstart",t)).fire(new Fm("roll",t)).fire(new Fm("rollend",t)),this.fire(new Fm("moveend",t))}calculateCameraOptionsFromTo(e,t,i,r=0){let a=zp.fromLngLat(e,t),n=zp.fromLngLat(i,r),o=n.x-a.x,s=n.y-a.y,l=n.z-a.z,h=Math.hypot(o,s,l);if(0===h)throw Error("Can't calculate camera options with same From and To");let u=Math.hypot(o,s),c=De(this.transform.cameraToCenterDistance/h/this.transform.tileSize),p=180*Math.atan2(o,-s)/Math.PI,d=180*Math.acos(u/h)/Math.PI;return d=l<0?90-d:90+d,{center:n.toLngLat(),elevation:r,zoom:c,pitch:d,bearing:p}}calculateCameraOptionsFromCameraLngLatAltRotation(e,t,i,r,a){let n=this.transform.calculateCenterFromCameraLngLatAlt(e,t,i,r);return{center:n.center,elevation:n.elevation,zoom:n.zoom,bearing:i,pitch:r,roll:a}}easeTo(e,t){this._stop(!1,e.easeId),"zoom"in(e=Me({offset:[0,0],duration:500,easing:Pe},e))&&this._zoomSnap&&(e.zoom=Re(e.zoom,this._zoomSnap)),(!1===e.animate||!e.essential&&Im.prefersReducedMotion)&&(e.duration=0);let i,r,a=this.getTransformForUpdate(),n=this.getBearing(),o=a.pitch,s=a.roll,l="bearing"in e?this._normalizeBearing(e.bearing,n):n,h="pitch"in e?+e.pitch:o,u="roll"in e?this._normalizeBearing(e.roll,s):s,c="padding"in e?e.padding:a.padding,p=d.convert(e.offset);e.around&&(i=wp.convert(e.around),r=a.locationToScreenPoint(i));let f={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},m=this.cameraHelper.handleEaseTo(a,{bearing:l,pitch:h,roll:u,padding:c,around:i,aroundPoint:r,offsetAsPoint:p,offset:e.offset,zoom:e.zoom,center:e.center});return this._rotating||=n!==l,this._pitching||=h!==o,this._rolling||=u!==s,this._padding=!a.isPaddingEqual(c),this._zooming||=m.isZooming,this._easeId=e.easeId,this._prepareEase(t,e.noMoveStart,f),this.terrain&&this._prepareElevation(m.elevationCenter),this._ease((i=>
2{m.easeFunc(i),this.terrain&&!e.freezeElevation&&this._updateElevation(i),this.applyUpdatedTransform(a),this._fireMoveEvents(t)}),(i=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(t,i)}),e),this}_prepareEase(e,t,i={}){this._moving=!0,!t&&!i.moving&&this.fire(new Fm("movestart",e)),this._zooming&&!i.zooming&&this.fire(new Fm("zoomstart",e)),this._rotating&&!i.rotating&&this.fire(new Fm("rotatestart",e)),this._pitching&&!i.pitching&&this.fire(new Fm("pitchstart",e)),this._rolling&&!i.rolling&&this.fire(new Fm("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){(void 0===this._elevationStart||void 0===this._elevationCenter)&&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(hr.number(this._elevationStart,this._elevationTarget,e))}_finalizeElevation(){this.elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||=this.transform.clone(),this._requestedCameraState):this.transform}_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 i=this.calculateCameraOptionsFromTo(t,r,e.center,e.elevation);return{pitch:i.pitch,zoom:i.zoom}}return{}}applyUpdatedTransform(e){let t=[];if(t.push((e=>this._elevateCameraIfInsideTerrain(e))),this.transformCameraUpdate&&t.push((e=>this.transformCameraUpdate(e))),!t.length)return;let i=e.clone();for(let e of t){let t=i.clone(),{center:r,zoom:a,roll:n,pitch:o,bearing:s,elevation:l}=e(t);r&&t.setCenter(r),void 0!==l&&t.setElevation(l),void 0!==a&&t.setZoom(a),void 0!==n&&t.setRoll(n),void 0!==o&&t.setPitch(o),void 0!==s&&t.setBearing(s),i.apply(t,!1)}this.transform.apply(i,!1)}_fireMoveEvents(e){this.fire(new Fm("move",e)),this._zooming&&this.fire(new Fm("zoom",e)),this._rotating&&this.fire(new Fm("rotate",e)),this._pitching&&this.fire(new Fm("pitch",e)),this._rolling&&this.fire(new Fm("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,n=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,i&&this.fire(new Fm("zoomend",e)),r&&this.fire(new Fm("rotateend",e)),a&&this.fire(new Fm("pitchend",e)),n&&this.fire(new Fm("rollend",e)),this.fire(new Fm("moveend",e))}flyTo(e,t){if(!e.essential&&Im.prefersReducedMotion){let i=Ie(e,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(i,t)}this.stop(),"zoom"in(e=Me({offset:[0,0],speed:1.2,curve:1.42,easing:Pe},e))&&this._zoomSnap&&(e.zoom=Re(e.zoom,this._zoomSnap));let i=this.getTransformForUpdate(),r=i.bearing,a=i.pitch,n=i.roll,o=i.padding,s="bearing"in e?this._normalizeBearing(e.bearing,r):r,l="pitch"in e?+e.pitch:a,h="roll"in e?this._normalizeBearing(e.roll,n):n,u="padding"in e?e.padding:i.padding,c=d.convert(e.offset),p=i.centerPoint.add(c),f=i.screenPointToLocation(p),m=this.cameraHelper.handleFlyTo(i,{bearing:s,pitch:l,roll:h,padding:u,locationAtOffset:f,offsetAsPoint:c,center:e.center,minZoom:e.minZoom,zoom:e.zoom}),g=e.curve,_=Math.max(i.width,i.height),y=_/m.scaleOfZoom,v=m.pixelPathLength,x=_/m.scaleOfMinZoom;g=Math.min(g,Math.sqrt(x/v*2));let b=g*g;function w(e){let t=(y*y-_*_+(e?-1:1)*b*b*v*v)/(2*(e?y:_)*b*v);return Math.log(Math.sqrt(t*t+1)-t)}function T(e){return(Math.exp(e)-Math.exp(-e))/2}function S(e){return(Math.exp(e)+Math.exp(-e))/2}
vendor: 9,918 bytes, line 2
2let P=w(!1),E=function(e){return S(P)/S(P+g*e)},C=function(e){return _*((S(P)*function(e){return T(e)/S(e)}(P+g*e)-T(P))/b)/v},M=(w(!0)-P)/g;if(Math.abs(v)<2e-6||!isFinite(M)){if(Math.abs(_-y)<1e-6)return this.easeTo(e,t);let i=y<_?-1:1;M=Math.abs(Math.log(y/_))/g,C=()=>0,E=e=>Math.exp(i*g*e)}if("duration"in e)e.duration=+e.duration;else{let t="screenSpeed"in e?+e.screenSpeed/g:+e.speed;e.duration=1e3*M/t}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=r!==s,this._pitching=l!==a,this._rolling=h!==n,this._padding=!i.isPaddingEqual(u),this._prepareEase(t,!1),this.terrain&&this._prepareElevation(m.targetCenter),this._ease((d=>{let f=d*M,g=1/E(f),_=C(f);this._rotating&&i.setBearing(hr.number(r,s,d)),this._pitching&&i.setPitch(hr.number(a,l,d)),this._rolling&&i.setRoll(hr.number(n,h,d)),this._padding&&(i.interpolatePadding(o,u,d),p=i.centerPoint.add(c)),m.easeFunc(d,g,_,p),this.terrain&&!e.freezeElevation&&this._updateElevation(d),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 e=this._onEaseEnd;delete this._onEaseEnd,e.call(this,t)}return e||this._stopHandlers(),this}_ease(e,t,i){!1===i.animate||0===i.duration?(e(1),t()):(this._easeStart=zm(),this._easeOptions=i,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,t){e=Ce(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 qw={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};var $w=class{constructor(e=qw){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=e=>{e&&("terrain"===e.type||"style"===e.dataType||"source"===e.dataType&&("metadata"===e.sourceDataType||"visibility"===e.sourceDataType))&&this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?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=km.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=km.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=km.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((e=>"string"==typeof e?e:""))):"string"==typeof this.options.customAttribution&&e.push(this.options.customAttribution)),this._map.style.stylesheet){let e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}let t=this._map.style.tileManagers;for(let i in t){let r=t[i];if(r.used||r.usedForTerrain){let t=r.getSource();t.attribution&&!e.includes(t.attribution)&&e.push(t.attribution)}}e=e.filter((e=>String(e).trim())),e.sort(((e,t)=>e.length-t.length)),e=e.filter(((t,i)=>{for(let r=i+1;r<e.length;r++)if(e[r].includes(t))return!1;return!0}));let i=e.join(" | ");i!==this._attribHTML&&(this._attribHTML=i,e.length?(this._innerContainer.innerHTML=km.sanitize(i),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}},Uw=class{constructor(e={}){this._updateCompact=()=>{let e=this._container.children;if(e.length){let t=e[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&t.classList.add("maplibregl-compact"):t.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options?.compact,this._container=km.create("div","maplibregl-ctrl");let t=km.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}},Gw=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 t of i)if(t.id===e)return void(t.cancelled=!0)}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 Zw=as([{name:"a_pos3d",type:"Int16",components:3}]);var Ww=class extends bt{constructor(e){super(),this._lastTilesetChange=zm(),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 c_(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),z(r.terrainRttPosMatrix32f,0,ne,ne,0,0,1),this._tiles[r.key]=new Yg(r,this.tileSize),this._lastTilesetChange=zm());for(let e in this._tiles)i[e]||(this._tiles[e].releaseRTT(this.tileManager.map.painter),delete this._tiles[e])}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(),n=ue();if(r.canonical.equals(e.canonical))z(n,0,ne,ne,0,0,1);else if(r.canonical.isChildOf(e.canonical)){let t=r.canonical.z-e.canonical.z,i=r.canonical.x-(r.canonical.x>>t<<t),a=r.canonical.y-(r.canonical.y>>t<<t),o=ne>>t;z(n,0,o,o,0,0,1),P(n,n,[-i*o,-a*o,0])}else{if(!e.canonical.isChildOf(r.canonical))continue;{let t=e.canonical.z-r.canonical.z,i=e.canonical.x-(e.canonical.x>>t<<t),a=e.canonical.y-(e.canonical.y>>t<<t),o=ne>>t;z(n,0,ne,ne,0,0,1),P(n,n,[i*o,a*o,0]),E(n,n,[1/2**t,1/2**t,0])}}a.terrainRttPosMatrix32f=new Float32Array(n),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 n=e.clone(),o=ue();if(a.canonical.z===e.canonical.z){let t=e.canonical.x-a.canonical.x+e.wrap*(1<<e.canonical.z),i=e.canonical.y-a.canonical.y;z(o,0,ne,ne,0,0,1),P(o,o,[t*ne,i*ne,0])}else if(a.canonical.z>e.canonical.z){let t=a.canonical.z-e.canonical.z,i=a.canonical.x-(a.canonical.x>>
2t<<t)+e.wrap*(1<<a.canonical.z),r=a.canonical.y-(a.canonical.y>>t<<t),n=e.canonical.x-(a.canonical.x>>t),s=e.canonical.y-(a.canonical.y>>t),l=ne>>t;z(o,0,l,l,0,0,1),P(o,o,[-i*l+n*ne,-r*l+s*ne,0])}else{let t=e.canonical.z-a.canonical.z,i=e.canonical.x-(e.canonical.x>>t<<t)+e.wrap*(1<<e.canonical.z),r=e.canonical.y-(e.canonical.y>>t<<t),n=(e.canonical.x>>t)-a.canonical.x,s=(e.canonical.y>>t)-a.canonical.y,l=ne<<t;z(o,0,l,l,0,0,1),P(o,o,[i*ne+n*l,r*ne+s*l,0])}n.terrainRttPosMatrix32f=new Float32Array(o),i[r]=n}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=zm()){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)}},Hw=class{constructor(e,t,i,r="auto"){this._meshCache={},this.painter=e,this.tileManager=new Ww(t),this.options=i,this.exaggeration="number"==typeof i.exaggeration?i.exaggeration:1,this._terrainSkirtLength=r,this.qualityFactor=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=ne){let a=e.normalizeCoordinates(t,i,r);if(!a)return 0;let n=this.getTerrainData(a.tileID),o=n.tile?.dem;if(!o)return 0;let s=function(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}([],[a.x/r*ne,a.y/r*ne],n.u_terrain_matrix),l=[s[0]*o.dim,s[1]*o.dim];return o.sampleBilinear(l[0],l[1])}getElevationForLngLatZoom(e,t){if(!kp(t,e.wrap()))return 0;let{tileID:i,mercatorX:r,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(e,t);return this.getElevation(i,r%ne,a%ne,ne)}getElevationForLngLat(e,t){let i=c_(t,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this}),r=0;for(let e of i)e.canonical.z>r&&(r=Math.min(e.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(e,r)}getElevation(e,t,i,r=ne){return this.getDEMElevation(e,t,i,r)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){let e=this.painter.context,t=new Ih({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new jh(e,t,e.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new jh(e,new Ih({width:1,height:1}),e.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=w([])}let t=this.tileManager.getSourceTile(e,!0);if(t?.dem&&(!t.demTexture||t.needsTerrainPrepare)){let e=this.painter.context;t.demTexture||=this.painter.getTileTexture(t.dem.stride),t.demTexture?t.demTexture.update(t.dem.getPixels(),{premultiply:!1}):t.demTexture=new jh(e,t.dem.getPixels(),e.gl.RGBA,{premultiply:!1}),t.demTexture.bind(e.gl.NEAREST,e.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:je("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let n=e.canonical.x-(e.canonical.x>>a<<a),o=e.canonical.y-(e.canonical.y>>a<<a),s=function(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
2]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}(new Float64Array(16),[1/(ne<<a),1/(ne<<a),0]);P(s,s,[n*ne,o*ne,0]),this._demMatrixCache[i]={matrix:s,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 jh(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 jh(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("coords"===e?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 e=0,i=0;e<this._coordsTextureSize;e++)for(let r=0;r<this._coordsTextureSize;r++,i+=4)t[i+0]=255&r,t[i+1]=255&e,t[i+2]=r>>8<<4|e>>8,t[i+3]=0;let i=new jh(e,new Ih({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),n=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-n-1,1,1,r.RGBA,r.UNSIGNED_BYTE,t),i.bindFramebuffer.set(null);let s=t[0]+(t[2]>>4<<8),l=t[1]+((15&t[2])<<8),h=this.coordsIndex[255-t[3]],u=h&&this.tileManager.getTileByID(h);if(!u)return null;let c=this._coordsTextureSize,p=(1<<u.tileID.canonical.z)*c;return new zp((u.tileID.canonical.x*c+s)/p+u.tileID.wrap,(u.tileID.canonical.y*c+l)/p,this.getElevation(u.tileID,s,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]/16777216+t[1]/65536+t[2]/256+t[3])/256}getTerrainMesh(e){let t=this.painter.style.projection?.transitionState>0,i=t&&0===e.canonical.y,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 n=this.painter.context,o=new $s,s=new nl,l=this.meshSize,h=ne/l,u=l*l;for(let e=0;e<=l;e++)for(let t=0;t<=l;t++)o.emplaceBack(t*h,e*h,0);for(let e=0;e<u;e+=l+1)for(let t=0;t<l;t++)s.emplaceBack(t+e,l+t+e+1,l+t+e+2),s.emplaceBack(t+e,l+t+e+2,t+e+1);"none"!==this._terrainSkirtLength&&this._buildSkirts(o,s,l,h,i,r);let c=new Cy(n.createVertexBuffer(o,Zw.members),n.createIndexBuffer(s),ul.simpleSegment(0,0,o.length,s.length));return this._meshCache[a]=c,c}getSkirtLength(e){return 2*Math.PI*bp/2**Math.max(e,0)/5}getMinTileElevationForLngLatZoom(e,t){if(!kp(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=zp.fromLngLat(e.wrap()),r=(1<<t)*ne,a=i.x*r,n=i.y*r;return{tileID:new Lp(t,0,t,Math.floor(a/ne),Math.floor(n/ne)),mercatorX:a,mercatorY:n}}_buildSkirts(e,t,i,r,a,n){let o=e.length,s=o+(i+1),l=(i+1)*i,h=a?Fu:0,u=+!a,c=n?Bu:ne,p=+!n;for(let t=0;t<=i;t++)e.emplaceBack(t*r,h,u);for(let t=0;t<=i;t++)e.emplaceBack(t*r,c,p);for(let e=0;e<i;e++)t.emplaceBack(l+e,s+e,s+e+1),t.emplaceBack(l+e,s+e+1,l+e+1),t.emplaceBack(0+e,o+e+1,o+e),t.emplaceBack(0+e,0+e+1,o+e+1);let d=e.length,f=d+2*(i+1);for(let t of[0,1])for(let a=0;a<=i;a++)for(let i of[0,1])e.emplaceBack(t*ne,a*r,i);for(let e=0;e<2*i;e+=2)t.emplaceBack(d+e,d+e+1,d+e+3),t.emplaceBack(d+e,d+e+3,d+e+2),t.emplaceBack(f+e,f+e+3,f+e+1),t.emplaceBack(f+e,f+e+2,f+e+3)}};const Xw={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};var Yw=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}
2prepareForRender(e,t){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=e._order.filter((i=>!e._layers[i].isHidden(t)));let i=new Set;for(let t of this._renderableLayerIds){let r=e._layers[t],a=r.source;a&&Xw[r.type]&&i.add(a)}this._coordsAscending={},this._rttFingerprints={};for(let t of i){let i=e.tileManagers[t];if(!i)continue;this._coordsAscending[t]={};let r=this._coordsAscending[t],a=i.getSource(),n=a instanceof Ng?a.terrainTileRanges:null;for(let e of i.getVisibleCoordinates()){let t=this.terrain.tileManager.getTerrainCoords(e,n);for(let e in t)r[e]||=[],r[e].push(t[e])}this._rttFingerprints[t]={};let o=this._rttFingerprints[t],s=i.getState().revision;for(let e in r)o[e]=`${r[e].map((e=>e.key)).sort().join()}#${s}`}for(let e of this._renderableTiles)for(let t in this._rttFingerprints){let i=this._rttFingerprints[t][e.tileID.key];i&&i!==e.rttFingerprint[t]&&e.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,n=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(Xw[r]&&((!this._prevType||!Xw[this._prevType])&&this._stacks.push([]),this._prevType=r,this._stacks[this._stacks.length-1].push(e.id),!n))return!0;if(Xw[this._prevType]||Xw[r]&&n){this._prevType=r;let e=this._stacks.length-1,t=this._stacks[e]||[];for(let r of this._renderableTiles){if(this._rttTiles.push(r),r.getRTT(e))continue;let n=r.acquireRTT(a,e,this.rttSize);a.bindRTT(n),a.context.clear({color:ki.transparent,stencil:0}),a.currentStencilSource=void 0;for(let e of t){let t=a.style._layers[e],n=t.source?this._coordsAscending[t.source][r.tileID.key]:[r.tileID];a.context.viewport.set([0,0,this.rttSize,this.rttSize]),a.renderTileClippingMasks(t,n,!0),a.renderLayer(a,a.style.tileManagers[t.source],t,n,i),t.source&&(r.rttFingerprint[t.source]=this._rttFingerprints[t.source][r.tileID.key])}}return function(e,t,i,r){let{isRenderingGlobe:a}=r,n=e.context,o=n.gl,s=e.transform,l=e.colorModeForRenderPass(),h=e.getDepthModeFor3D(),u=e.useProgram("terrain");n.bindFramebuffer.set(null),n.viewport.set([0,0,e.width,e.height]);for(let r of i){let i=t.getTerrainMesh(r.tileID),c=e.renderToTexture.getTexture(r),p=t.getTerrainData(r.tileID);n.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,c.texture);let d=vv(t.getSkirtLength(s.zoom),s.calculateFogMatrix(r.tileID.toUnwrapped()),e.style.sky,s.pitch,a),f=s.getProjectionData({overscaledTileID:r.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});u.draw(n,o.TRIANGLES,h,Xx.disabled,l,Kx.backCCW,d,p,f,"terrain",i.vertexBuffer,i.indexBuffer,i.segments)}}(this.painter,this.terrain,this._rttTiles,i),this._rttTiles=[],Xw[r]}return!1}};const Kw={"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"},Jw=Sm,Qw={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:qw,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,maxTileC
2acheSize:null,maxTileCacheZoomLevels:ht.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,centerClampedToGround:!0,terrainSkirtLength:"auto",zoomLevelsToOverscale:4,anisotropicFilterPitch:20};var eT=class extends bt{get _ownerWindow(){return this._container?.ownerDocument?.defaultView||window}constructor(e){super(),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Gw,this._controls=[],this._mapId=ze(),this._missingStyleImageResolver=null,this._lostContextStyle={style:null,images:null},this._contextLost=e=>{if(e.preventDefault(),this._frameRequest&&=(this._frameRequest.abort(),null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),this.style){for(let e of Object.values(this.style._layers))if("custom"===e.type&&console.warn(`Custom layer with id '${e.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),e._listeners)for(let[t]of Object.entries(e._listeners))console.warn(`Custom layer with id '${e.id}' had event listeners for event '${t}' 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 Zm("webglcontextlost",{originalEvent:e}))}else this.fire(new Zm("webglcontextlost",{originalEvent:e}))},this._contextRestored=e=>{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 Zm("webglcontextrestored",{originalEvent:e})))},this._onMapScroll=e=>{if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()};let t={...Qw,...e,canvasContextAttributes:{...Qw.canvasContextAttributes,...e.canvasContextAttributes}};if(null!=t.minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>180)throw Error("maxPitch must be less than or equal to 180");if(this._camera=new Nw({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:e=>this._requestRenderFrame(e),cancelRenderFrame:e=>this._cancelRenderFrame(e),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=!0===t.trackResize,this._terrainSkirtLength=t.terrainSkirtLength,this._refreshExpiredTiles=!0===t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=!0===t.crossSourceCollisions,this._collectResourceTiming=!0===t.collectResourceTiming,this._locale={...Kw,...t.locale},this._clickTolerance=t.clickTolerance,this._overridePixelRatio=t.pixelRatio,this._maxCanvasSize=t.maxCanvasSize,this._zoomLevelsToOverscale=t.zoomLevelsToOverscale,this.cancelPendingTileRequestsWhileZooming=!0===t.cancelPendingTileRequestsWhileZooming,this.setAnisotropicFilterPitch(t.anisotropicFilterPitch),void 0!==t.reduceMotion&&(Im.prefersReducedMotion=t.reduceMotion),this._imageQueueHandle=Dm.addThrottleControl((()=>this.isMoving())),this._requestManager=new Rm(t.transformRequest),this._container=this._resolveContainer(t.container),t.max
vendor: 5,042 bytes, line 2
2Bounds&&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 jw(this,this._camera,t),typeof window<"u"&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver());let i="string"==typeof t.hash&&t.hash||void 0;this._hash=t.hash?new Zb(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,Me({},t.fitBoundsOptions,{duration:0}))));let r="string"==typeof t.style||"globe"!==t.style?.projection?.type;this.resize(null,r),this._localIdeographFontFamily=t.localIdeographFontFamily,this._validateStyle=t.validateStyle,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new $w("boolean"==typeof t.attributionControl?void 0:t.attributionControl)),t.maplibreLogo&&this.addControl(new Uw,t.logoPosition),this.on("style.load",(()=>{if(r||this._resizeTransform(),this._camera.transform.unmodified){let e=Ie(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(e)}})),this.on("data",(e=>{this._update("style"===e.dataType),this.fire("style"===e.dataType?new Om("styledata",e):new Vm("sourcedata",e))})),this.on("dataloading",(e=>{this.fire("style"===e.dataType?new Om("styledataloading",e):new Vm("sourcedataloading",e))})),this.on("dataabort",(e=>{this.fire(new Vm("sourcedataabort",e))}))}_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(void 0===t&&(t=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e?.onAdd)return this.fire(new xt(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 xt(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 c_(this._camera.transform,e)}setTransformCameraUpdate(e){this._camera.transformCameraUpdate=e}getCenter(){return new wp(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(wp.convert(e),this._camera.transform):null}
vendor: 4,751 bytes, line 2
2getCenterClampedToGround(){return this._camera.getCenterClampedToGround()}calculateCameraOptionsFromTo(e,t,i,r){return null==r&&this.terrain&&(r=this.terrain.getElevationForLngLat(i,this._camera.transform)),this._camera.calculateCameraOptionsFromTo(e,t,i,r)}resize(e,t=!0){if(null!==this._lostContextStyle.style)return this;this._resizeInternal(t);let i=!this._camera._moving;return i&&(this.stop(),this.fire(new Fm("movestart",e)).fire(new Fm("move",e))),this.fire(new Lm("resize",e)),i&&this.fire(new Fm("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 e=this.painter.context.gl;this._maxCanvasSize=[e.drawingBufferWidth,e.drawingBufferHeight];let r=this._getClampedPixelRatio(t,i);this._resizeCanvas(t,i,r),this.painter.resize(t,i,r)}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(),n=e*a,o=t*a,s=n>i?i/n:1,l=o>r?r/o:1;return Math.min(s,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(Cg.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 Fm("zoomstart")).fire(new Fm("zoom")).fire(new Fm("zoomend")).fire(new Fm("movestart")).fire(new Fm("move")).fire(new Fm("moveend")),this}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 Fm("zoomstart")).fire(new Fm("zoom")).fire(new Fm("zoomend")).fire(new Fm("movestart")).fire(new Fm("move")).fire(new Fm("moveend")),this}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 Fm("pitchstart")).fire(new Fm("pitch")).fire(new Fm("pitchend")).fire(new Fm("movestart")).fire(new Fm("move")).fire(new Fm("moveend")),this}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 Fm("pitchstart")).fire(new Fm("pitch")).fire(new Fm("pitchend")).fire(new Fm("movestart")).fire(new Fm("move")).fire(new Fm("moveend")),this}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(wp.convert(e),this.style&&this.terrain)}unproject(e){return this._camera.transform.screenPointToLocation(d.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}
vendor: 12,716 bytes, line 2
2_createDelegatedListener(e,t,i){if("mouseenter"===e||"mouseover"===e){let r=!1;return{layers:t,listener:i,delegates:{mousemove:a=>{let n=t.filter((e=>this.getLayer(e))),o=0===n.length?[]:this.queryRenderedFeatures(a.point,{layers:n});o.length?r||(r=!0,i.call(this,new jm(e,this,a.originalEvent,{features:o}))):r=!1},mouseout:()=>{r=!1}}}}if("mouseleave"===e||"mouseout"===e){let r=!1;return{layers:t,listener:i,delegates:{mousemove:a=>{let n=t.filter((e=>this.getLayer(e)));(0===n.length?[]:this.queryRenderedFeatures(a.point,{layers:n})).length?r=!0:r&&(r=!1,i.call(this,new jm(e,this,a.originalEvent)))},mouseout:t=>{r&&(r=!1,i.call(this,new jm(e,this,t.originalEvent)))}}}}{let r=e=>{let r=t.filter((e=>this.getLayer(e))),a=0===r.length?[]:this.queryRenderedFeatures(e.point,{layers:r});a.length&&(e.features=a,i.call(this,e),delete e.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 e=0;e<r.length;e++){let a=r[e];if(a.listener===i&&a.layers.length===t.length&&a.layers.every((e=>t.includes(e)))){for(let e in a.delegates)this.off(e,a.delegates[e]);return void r.splice(e,1)}}}on(e,t,i){if(void 0===i)return super.on(e,t);let r="string"==typeof t?[t]:t,a=this._createDelegatedListener(e,r,i);this._saveDelegatedListener(e,a);for(let e in a.delegates)this.on(e,a.delegates[e]);return{unsubscribe:()=>{this._removeDelegatedListener(e,r,i)}}}once(e,t,i){if(void 0===i)return super.once(e,t);let r="string"==typeof t?[t]:t,a=this._createDelegatedListener(e,r,i);for(let t in a.delegates){let n=a.delegates[t];a.delegates[t]=(...t)=>{this._removeDelegatedListener(e,r,i),n(...t)}}this._saveDelegatedListener(e,a);for(let e in a.delegates)this.once(e,a.delegates[e]);return this}off(e,t,i){if(void 0===i)return super.off(e,t);let r="string"==typeof t?[t]:t;return this._removeDelegatedListener(e,r,i),this}queryRenderedFeatures(e,t){if(!this.style)return[];let i,r=e instanceof d||Array.isArray(e),a=r?e:[[0,0],[this._camera.transform.width,this._camera.transform.height]];if(t||=(r?{}:e)||{},a instanceof d||"number"==typeof a[0])i=[d.convert(a)];else{let e=d.convert(a[0]),t=d.convert(a[1]);i=[e,new d(t.x,e.y),t,new d(e.x,t.y),e]}return this.style.queryRenderedFeatures(i,t,this._camera.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(e,t){return!1!==(t=Me({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},t)).diff&&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(null==t)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)return void this.style.once("style.load",(()=>this._updateStyle(e,t)));let i=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!e)),e?(this.style=new gv(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e,t,i):this.style.loadJSON(e,t,i),this):(this._frameRequest&&=(this._frameRequest.abort(),null),this.style?.projection?.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new gv(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}async _diffStyle(e,t){if(this._diffStyleRequest?.abort(),"string"==typeof e){let i=e;this._diffStyleRequest=new AbortController;let r=this._diffStyleRequest;try{let e=await this._requestManager.transformRequest(i,"Style");if(r.signal.aborted)return void(this._diffStyleRequest=null);let a=await mt(e,r);this._diffStyleRequest=null,this._updateDiff(a.data,t)}catch(e){this._diffStyleRequest=null,st(e)||this.fire(new xt(se(e)))}}else"object"==typeof e&&(this._diffStyleRequest=null,this._updateDiff(e,t))}_updateDiff(e,t){try{this.style.setState(e,t)&&this._update(!0)}catch(i){je(`Unable to perform style diff: ${se(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)return this.style.loaded();je("There is no style added to the map.")}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){let t=this.style?.tileManagers[e];if(void 0!==t)return t.loaded();this.fire(new xt(Error(`There is no tile manager with ID '${e}'`)))}setTerrain(e,t={}){if(this.style._checkLoaded(),e&&uo(this,oo.terrain,{value:e},t))return this;if(this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),e){let t=this.style.tileManagers[e.source];if(!t)throw Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);null===this.terrain&&t.reload();for(let t in this.style._layers){let i=this.style._layers[t];"hillshade"===i.type&&i.source===e.source&&je("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),"color-relief"===i.type&&i.source===e.source&&je("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 Hw(this.painter,t,e,this._terrainSkirtLength),this.painter.renderToTexture=new Yw(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=t=>{"style"===t.dataType?this.terrain.tileManager.releaseAllRTT():"source"===t.dataType&&t.tile&&(t.sourceId===e.source&&!this._camera.elevationFreeze&&(this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom))),"image"===t.source?.type?this.terrain.tileManager.releaseAllRTT():this.terrain.tileManager.releaseRTT(t.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else 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);return this.fire(new Um({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=l_(Math.max(1,e),Math.max(1,t))}else for(let i in this.style.tileManagers)this.style.tileManagers[i].getSource().calculateTileZoom=l_(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`);void 0===t?i.reload(!0):i.refreshTiles(t.map((e=>new Dp(e.z,e.x,e.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:n,content:o,textFitWidth:s,textFitHeight:l}=t;if(e instanceof HTMLImageElement||Ue(e)){let{width:t,height:h,data:u}=Im.getImageData(e);return{data:new Ih({width:t,height:h},u),pixelRatio:i,stretchX:a,stretchY:n,content:o,textFitWidth:s,textFitHeight:l,sdf:r,version:0}}if(void 0===e.width||void 0===e.height)return this.fire(new xt(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:t,height:h,data:u}=e,c=e;return{data:new Ih({width:t,height:h},new Uint8Array(u)),pixelRatio:i,stretchX:a,stretchY:n,content:o,textFitWidth:s,textFitHeight:l,sdf:r,version:0,userImage:c}}}updateImage(e,t){let i=this.style.getImage(e);if(!i)return this.fire(new xt(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:n}=t instanceof HTMLImageElement||Ue(t)?Im.getImageData(t):t;if(void 0===r||void 0===a)return this.fire(new xt(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 xt(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||Ue(t));return i.data.replace(n,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 xt(Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}async loadImage(e){return Dm.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,(e=>{e||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,(e=>{e||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=Gb((e=>{this._trackResize&&!this._removed&&(this.resize(e),this.redraw())}),50),i=this._ownerWindow.ResizeObserver??ResizeObserver;this._resizeObserver=new i((i=>{e?t(i):e=!0})),this._resizeObserver.observe(this._container)}
vendor: 7,863 bytes, line 2
2_resolveContainer(e){if("string"==typeof e){let t=document.getElementById(e);if(!t)throw Error(`Container '${e}' not found.`);return t}if(e instanceof HTMLElement||e&&"object"==typeof e&&1===e.nodeType)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=km.create("div","maplibregl-canvas-container",e);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=km.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=km.create("div","maplibregl-control-container",e),n=this._controlPositions={};for(let e of["top-left","top-right","bottom-left","bottom-right"])n[e]=km.create("div",`maplibregl-ctrl-${e} `,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",(e=>{t=e}),{once:!0});let i=this._canvas.getContext("webgl2",e);i?this.painter=new $b(i,this._camera.transform):this.fire(new xt(new Ub(e,t)))}migrateProjection(e,t){this._camera.migrateProjection(e,t),this.painter.transform=e,this.fire(new Gm({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 e=this._camera.transform.zoom,i=zm();this.style.zoomHistory.update(e,i);let a=new Io(e,{now:i,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),n=a.crossFadingFactor();(1!==n||n!==this._crossFadingFactor)&&(r=!0,this._crossFadingFactor=n),this.style.update(a)}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 Lm("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new Lm("load"))),this.style&&(this.style.hasTransitions()||r)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let n=this._sourcesDirty||this._styleDirty||this._placementDirty;return n||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new Lm("idle")),this._loaded&&!this._fullyLoaded&&!n&&(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 e of this._controls)e.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),Dm.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 Lm("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,Im.frame(this._frameRequest,(e=>{this._frameRequest=null;try{this._render(e)}catch(e){if(!st(e))throw e}}),(()=>{}),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 Jw}getCameraTargetElevation(){return this._camera.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(e){return this._lazyInitEmptyStyle(),this.style.setProjection(e),this._update(!0)}};const tT={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};var iT=class{constructor(e){this._updateZoomButtons=()=>{let e=this._map.getZoom(),t=e===this._map.getMaxZoom(),i=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},this._rotateCompassArrow=()=>{let e=this._map.getPitch(),t=this._map.getRoll(),i=this._map.getBearing(),r=1/Math.cos(He(e))**.5;this.options.visualizePitch&&this.options.visualizeRoll?this._compassIcon.style.transform=`scale(${r}) rotateZ(${-t}deg) rotateX(${e}deg) rotateZ(${-i}deg)`:this.options.visualizePitch?this._compassIcon.style.transform=`scale(${r}) rotateX(${e}deg) rotateZ(${-i}deg)`:this.options.visualizeRoll?this._compassIcon.style.transform=`rotate(${-i-t}deg)`:this._compassIcon.style.transform=`rotate(${-i}deg)`},this._setButtonTitle=(e,t)=>
vendor: 5,033 bytes, line 2
2{let i=this._map._getUIString(`NavigationControl.${t}`);e.title=i,e.setAttribute("aria-label",i)},this.options=Me({},tT,e),this._container=km.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(e=>this._map.zoomIn({},{originalEvent:e}))),km.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(e=>this._map.zoomOut({},{originalEvent:e}))),km.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})})),this._compassIcon=km.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 rT(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=km.create("button",e,this._container);return i.type="button",i.addEventListener("click",t),i}},rT=class{constructor(e,t,i=!1){this.mousedown=e=>{this.startMove(e,km.mousePos(this.element,e)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)},this.mousemove=e=>{this.move(e,km.mousePos(this.element,e))},this.mouseup=e=>{this._rotatePitchHandler.dragEnd(e),this.offTemp()},this.touchstart=e=>{1===e.targetTouches.length?(this._startPos=this._lastPos=km.touchPos(this.element,e.targetTouches)[0],this.startMove(e,this._startPos),window.addEventListener("touchmove",this.touchmove,{passive:!1}),window.addEventListener("touchend",this.touchend)):this.reset()},this.touchmove=e=>{1===e.targetTouches.length?(this._lastPos=km.touchPos(this.element,e.targetTouches)[0],this.move(e,this._lastPos)):this.reset()},this.touchend=e=>{0===e.targetTouches.length&&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 dw;this._rotatePitchHandler=new hw({clickTolerance:3,move:(e,r)=>{let a=t.getBoundingClientRect(),n=new d((a.bottom-a.top)/2,(a.right-a.left)/2);return{bearingDelta:Ke(new d(e.x,r.y),r,n),pitchDelta:i?-.5*(r.y-e.y):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),km.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(){km.enableDrag(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend)}};function aT(e,t,i,r=!1){if(r||!i.getCoveringTilesDetailsProvider().allowWorldCopies())return e?.wrap();let a=new wp(e.lng,e.lat);if(e=new wp(e.lng,e.lat),t){let r=new wp(e.lng-360,e.lat),a=new wp(e.lng+360,e.lat),n=i.locationToScreenPoint(e).distSqr(t);i.locationToScreenPoint(r).distSqr(t)<n?e=r:i.locationToScreenPoint(a).distSqr(t)<n&&(e=a)}for(;Math.abs(e.lng-i.center.lng)>180;){let t=i.locationToScreenPoint(e);if(t.x>=0&&t.y>=0&&t.x<=i.width&&t.y<=i.height)break;e.lng>i.center.lng?e.lng-=360:e.lng+=360}
2return e.lng!==a.lng&&i.isPointOnMapSurface(i.locationToScreenPoint(e))?e:a}const nT={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 oT(e,t,i){let r=e.classList;for(let e in nT)r.remove(`maplibregl-${i}-anchor-${e}`);r.add(`maplibregl-${i}-anchor-${t}`)}var sT=class extends vt{},lT=class extends vt{},hT=class extends bt{constructor(e){if(super(),this._onClick=e=>{this.fire(new lT("click",{originalEvent:e}))},this._onKeyPress=e=>{("Space"===e.code||"Enter"===e.code)&&this.togglePopup()},this._onMapClick=e=>{let t=e.originalEvent.target,i=this._element;this._popup&&(t===i||i.contains(t))&&this.togglePopup()},this._update=e=>{if(!this._map)return;let t=this._map.loaded()&&!this._map.isMoving();("terrain"===e?.type||"render"===e?.type&&!t)&&this._map.once("render",this._update),this._lngLat=aT(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 i="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?i=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(i=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let r="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r=`rotateX(${this._map.getPitch()}deg)`),!this._subpixelPositioning&&(!e||"moveend"===e.type)&&(this._pos=this._pos.round()),this._element.style.transform=`${nT[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${r} ${i}`,Im.frameAsync(new AbortController,this._map._ownerWindow).then((()=>{this._updateOpacity("moveend"===e?.type)})).catch((()=>{}))},this._onMove=e=>{if(!this._isDragging){let t=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=t}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new sT("dragstart"))),this.fire(new sT("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),"active"===this._state&&this.fire(new sT("dragend")),this._state="inactive"},this._addDragHandler=e=>{this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.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&&"auto"!==e.pitchAlignment?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e?.opacity,e?.opacityWhenCovered),e?.element)this._element=e.element,this._offset=d.convert(e?.offset||[0,0]);else{this._defaultMarker=!0,this._element=km.create("div");let t=km.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=km.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=km.createNS("http://www.w3.org/2000/svg","g");r.setAttributeNS(null,"fill-rule","nonzero");let a=km.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"transform","translate(3.0, 29.0)"),a.setAttributeNS(null,"fill","#000000");for(let e 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 t=km.createNS("http://www.w3.org/2000/svg","ellipse");t.setAttributeNS(null,"opacity","0.04"),t.setAttributeNS(null,"cx","10.5"),t.setAttributeNS(null,"cy","5.80029008"),t.setAttributeNS(null,"rx",e.rx),t.setAttributeNS(null,"ry",e.ry),a.appendChild(t)}let n=km.createNS("http://www.w3.org/2000/svg","g");n.setAttributeNS(null,"fill",this._color);let o=km.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"),n.appendChild(o);let s=km.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"opacity","0.25"),s.setAttributeNS(null,"fill","#000000");let l=km.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"),s.appendChild(l);let h=km.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"transform","translate(6.0, 7.0)"),h.setAttributeNS(null,"fill","#FFFFFF");let u=km.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"transform","translate(8.0, 8.0)");let c=km.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=km.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"),u.appendChild(c),u.appendChild(p),r.appendChild(a),r.appendChild(n),r.appendChild(s),r.appendChild(h),r.appendChild(u),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=d.convert(e?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(e=>{e.preventDefault()})),this._element.addEventListener("mousedown",(e=>{e.preventDefault()})),oT(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=wp.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: 10,771 bytes, line 2
20,-38.1],"bottom-left":[r,-1*(t-i+r)],"bottom-right":[-r,-1*(t-i+r)],left:[i,-1*(t-i)],right:[-13.5,-1*(t-i)]}: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;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(e=!1){let t=this._map?.terrain,i=this._map._camera.transform.isLocationOccluded(this._lngLat);if(!t||i){let e=i?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==e&&(this._element.style.opacity=e,this._element.classList.toggle("maplibregl-marker-covered",i)))}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),n=r.terrain.getElevationForLngLat(this._lngLat,r._camera.transform);if(r._camera.transform.lngLatToCameraDepth(this._lngLat,n)-a<.006)return this._element.style.opacity=this._opacity,void this._element.classList.remove("maplibregl-marker-covered");let o=-this._offset.y/r._camera.transform.pixelsPerMeter,s=Math.sin(r.getPitch()*Math.PI/180)*o,l=r.terrain.depthAtPoint(new d(this._pos.x,this._pos.y-this._offset.y)),h=r._camera.transform.lngLatToCameraDepth(this._lngLat,n+s)-l>.006;this._popup?.isOpen()&&h&&this._popup.remove(),this._element.style.opacity=h?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",h)}getOffset(){return this._offset}setOffset(e){return this._offset=d.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&&"auto"!==e?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,t){return(void 0===this._opacity||void 0===e&&void 0===t)&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==e&&(this._opacity=String(e)),void 0!==t&&(this._opacityWhenCovered=String(t)),this._map&&this._updateOpacity(!0),this}};const uT={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0},cT=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");var pT=class extends vt{},dT=class extends bt{constructor(e){super(),this._updateOpacity=()=>{void 0!==this.options.locationOccludedOpacity&&(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 pT("close"))),this),this._update=e=>{let t,i=this._lngLat||this._trackPointer;if(!this._map||!i||!this._content)return;if(!this._container){if(this._container=km.create("div","maplibregl-popup",this._map.getContainer()),this._tip=km.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let e of this.options.className.split(" "))this._container.classList.add(e);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=aT(this._lngLat,this._flatPos,this._map._camera.transform,this._trackPointer),e&&"point"in e&&e.point&&(t=e.point),this._trackPointer&&!t)return;let r=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map._camera.transform.locationToScreenPoint(this._lngLat));let a=this.options.anchor,n=fT(this.options.offset);if(!a){let e,t=this._container.offsetWidth,i=this._container.offsetHeight,o=function(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}}(this.options.padding);e=r.y+n.bottom.y<i+o.top?["top"]:r.y>this._map._camera.transform.height-i-o.bottom?["bottom"]:[],r.x<t/2+o.left?e.push("left"):r.x>this._map._camera.transform.width-t/2-o.right&&e.push("right"),a=0===e.length?"bottom":e.join("-")}let o=r.add(n[a]);this.options.subpixelPositioning||(o=o.round()),this._container.style.transform=`${nT[a]} translate(${o.x}px,${o.y}px)`,oT(this._container,a,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=Me(Object.create(uT),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 pT("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=wp.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,i=document.createDocumentFragment(),r=document.createElement("body");for(r.innerHTML=e;t=r.firstChild,t;)i.appendChild(t);return this.setDOMContent(i)}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=km.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=km.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(cT);e&&e.focus()}};function fT(e){if(!e)return fT(new d(0,0));if("number"==typeof e){let t=Math.round(Math.abs(e)/Math.SQRT2);return{center:new d(0,0),top:new d(0,e),"top-left":new d(t,t),"top-right":new d(-t,t),bottom:new d(0,-e),"bottom-left":new d(t,-t),"bottom-right":new d(-t,-t),left:new d(e,0),right:new d(-e,0)}}if(e instanceof d||Array.isArray(e)){let t=d.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}}return{center:d.convert(e.center||[0,0]),top:d.convert(e.top||[0,0]),"top-left":d.convert(e["top-left"]||[0,0]),"top-right":d.convert(e["top-right"]||[0,0]),bottom:d.convert(e.bottom||[0,0]),"bottom-left":d.convert(e["bottom-left"]||[0,0]),"bottom-right":d.convert(e["bottom-right"]||[0,0]),left:d.convert(e.left||[0,0]),right:d.convert(e.right||[0,0])}}var mT,gT=i(5072),_T=i.n(gT),yT=i(6073),vT={insert:"head",singleton:!1},xT=(_T()(yT.A,vT),yT.A.locals,i(1957)),bT=i(2490);function wT(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var r,a,n,o,s=[],l=!0,h=!1;try{if(n=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(r=n.call(i)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){h=!0,a=e}
2finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw a}}return s}}(e,t)||ST(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function TT(e){return function(e){if(Array.isArray(e))return PT(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ST(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ST(e,t){if(e){if("string"==typeof e)return PT(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?PT(e,t):void 0}}function PT(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}function ET(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function CT(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ET(Object(i),!0).forEach((function(t){IT(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ET(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function MT(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function IT(e,t,i){return(t=LT(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function AT(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}function zT(e){return zT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zT(e)}function kT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DT(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,LT(r.key),r)}}function RT(e,t,i){return t&&DT(e.prototype,t),i&&DT(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function LT(e){var t=function(e,t){if("object"!=zT(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=zT(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==zT(t)?t:t+""}!function(e){ht.WORKER_URL=e}("/views/site/js/dist/maplibre/maplibre-gl-worker.mjs");var FT=function(){return RT((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Reset map view";kT(this,e),this.onReset=t,this.label=i}),[{key:"onAdd",value:function(e){var t=this;return this.map=e,this.container=document.createElement("div"),this.container.className="maplibregl-ctrl maplibregl-ctrl-group",this.button=document.createElement("button"),this.button.type="button",this.button.className="map-ctrl-reset",this.button.title=this.label,this.button.setAttribute("aria-label",this.label),this.button.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29 29" fill="#333" aria-hidden="true" focusable="false">\n <path d="M10.26 10.26 A6 6 0 1 0 18.74 10.26 L16.97 12.03 A3.5 3.5 0 1 1 12.03 12.03 Z"/>\n <path d="M20.02 8.98 15.35 13.65 14.43 8.07 Z"/>\n </svg>',this.button.addEventListener("click",(function(){return t.onReset(t.map)})),this.map.getContainer().querySelector(".maplibregl-ctrl-top-right .maplibregl-ctrl-group").appendChild(this.button),this.container}}
2,{key:"onRemove",value:function(){this.container.remove(),delete this.map}},{key:"getDefaultPosition",value:function(){return"top-right"}}])}(),BT=new WeakSet,OT=function(){function e(t){var i=this;kT(this,e),MT(this,BT),this.options=t,this.tileSource=t.tileSource,this.home=t.home,this.points=t.points||[],this.entries=[],this.activeCategory=t.defaultCategory,this.defaultCategory=t.defaultCategory,this.defaultZoom=t.defaultZoom||13,this.maxFitZoom=t.maxFitZoom||16,this.fitPadding=t.fitPadding||60,this.palette=t.palette||e.PALETTE,this.eventer=new xT.A(["reset"]),this.map=new eT({container:t.containerID,style:this.tileSource||"https://tiles.openfreemap.org/styles/positron",center:AT(BT,this,qT).call(this,this.home),zoom:this.defaultZoom,attributionControl:{compact:!0},cooperativeGestures:!0}),this.map.addControl(new iT({showCompass:!1}),"top-right"),this.map.addControl(new FT((function(){AT(BT,i,VT).call(i,!0),i.eventer.fire("reset")})),"top-right"),AT(BT,this,$T).call(this),AT(BT,this,GT).call(this),this.map.getContainer().addEventListener("keydown",(function(e){"Escape"===e.key&&(e.stopPropagation(),i.closePOIPopups({restoreFocus:Boolean(i.returnFocusTo)}))})),this.map.once("load",(function(){AT(BT,i,UT).call(i),AT(BT,i,ZT).call(i),AT(BT,i,VT).call(i);var e=i.map.getContainer().querySelector(".maplibregl-ctrl-attrib");null==e||e.classList.remove("maplibregl-compact-show"),null==e||e.removeAttribute("open")}))}return RT(e,[{key:"filter",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this.activeCategory=null===t||"all"===t?null:String(t),this.entries.forEach((function(t){var i=AT(BT,e,NT).call(e,t.poi);t.el.style.display=i?"":"none",i||t.popup.remove()})),r){var a=this.visibleEntries().length;bT.A.announce("".concat(a," ").concat(1===a?"place":"places"," shown on the map."))}return i&&this.fitToVisible(),this}},{key:"fitToHome",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])||e.REDUCE_MOTION;return this.map.easeTo({center:AT(BT,this,qT).call(this,this.home),zoom:this.defaultZoom,animate:!t}),this}},{key:"fitToVisible",value:function(){var t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i.animate,a=void 0===r||r,n=i.includeHome,o=void 0===n||n,s=this.visibleEntries(),l=!a||e.REDUCE_MOTION;if(!s.length)return this.map.easeTo({center:AT(BT,this,qT).call(this,this.home),zoom:this.defaultZoom,animate:!l}),this;var h=new Cg;return o&&h.extend(AT(BT,this,qT).call(this,this.home)),s.forEach((function(e){return h.extend(AT(BT,t,qT).call(t,e.poi))})),this.map.fitBounds(h,{padding:this.fitPadding,maxZoom:this.maxFitZoom,animate:!l}),this}},{key:"visibleEntries",value:function(){var e=this;return this.entries.filter((function(t){return AT(BT,e,NT).call(e,t.poi)}))}},{key:"focusPOI",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];AT(BT,this,jT).call(this),this.entries.forEach((function(e){return e.popup.remove()})),null!==this.activeCategory&&this.activeCategory!==String(t.poi.category)&&this.filter(t.poi.category,!1,!1);var a={center:AT(BT,this,qT).call(this,t.poi),zoom:16.4},n=e.REDUCE_MOTION||r;if(n?this.map.jumpTo(a):this.map.flyTo(CT(CT({},a),{},{speed:.9})),t.marker.togglePopup(),bT.A.announce("Showing ".concat(t.poi.name," on the map.")),i){var o,s=t.popup.getElement();if(this.returnFocusTo=i,n)null==s||null===(o=s.querySelector("a, button"))||void 0===o||o.focus();else this.map.once("moveend",(function(){var e;null==s||null===(e=s.querySelector("a, button"))||void 0===e||e.focus()}))}}},{key:"focusPOIId",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.entries.find((function(t){return String(t.poi.id)===String(e)}));return r&&this.focusPOI(r,t,i),this}},{key:"closePOIPopups",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).restoreFocus,t=void 0!==e&&e;
2return!1===t&&(this.returnFocusTo=null),this.entries.forEach((function(e){return e.popup.remove()})),t&&this.returnFocusTo&&this.returnFocusTo.focus(),this.returnFocusTo=null,this}}])}();function VT(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.fitToHome(),this.closePOIPopups(),this.homeMarker&&(this.homeMarker.getPopup().isOpen()||this.homeMarker.togglePopup(),this.home.persist_pinpoint&&this.homePopup.removeClassName("map__popup--home-pinpoint-only")),this.defaultCategory&&this.filter(this.defaultCategory,!1,e)}function jT(){if(this.homePopup)return this.home.persist_pinpoint?this.homePopup.addClassName("map__popup--home-pinpoint-only"):this.homePopup.remove(),this}function NT(e){return null===this.activeCategory||String(e.category)===this.activeCategory}function qT(e){return[Number(e.lng),Number(e.lat)]}function $T(){var e=this,t=document.createElement("button");t.type="button",t.className="map__marker map__marker--home map__marker--home-"+this.home.size,t.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 21V9l8-6 8 6v12h-6v-6h-4v6H4z"/></svg>',t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true"),this.home.color&&(t.style.backgroundColor="#".concat(this.home.color)),this.homeMarker=new hT({element:t}).setLngLat(AT(BT,this,qT).call(this,this.home)).addTo(this.map),this.homePopup=new dT({anchor:"bottom",offset:24,closeButton:!1,closeOnClick:!this.home.persist_pinpoint,focusAfterOpen:!1,className:"map__popup map__popup--home"}).setHTML(this.home.popup_html),this.homeMarker.setPopup(this.homePopup),this.homeMarker.togglePopup(),this.home.persist_pinpoint&&(this.homeMarker.togglePopup=function(){return e.homeMarker},this.homePopup.addTo(this.map),this.homeMarker.on("click",(function(){e.homePopup.removeClassName("map__popup--home-pinpoint-only")})),this.map.on("click",(function(t){var i=e.homeMarker.getElement();i===t.originalEvent.target||i.contains(t.originalEvent.target)||e.homePopup.addClassName("map__popup--home-pinpoint-only")})))}function UT(){var e,t=this.options.areaHighlight;if(t&&t.coordinates&&!(t.coordinates.length<3)&&t.color){var i="#"===t.color.charAt(0)?t.color:"#".concat(t.color),r=Number(t.opacity)||.5,a=t.coordinates.map((function(e){return[Number(e.lng),Number(e.lat)]}));a[0][0]===a[a.length-1][0]&&a[0][1]===a[a.length-1][1]||a.push(TT(a[0])),this.map.addSource("area-highlight",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[a]}}});var n=null===(e=this.map.getStyle().layers.find((function(e){return"symbol"===e.type})))||void 0===e?void 0:e.id;this.map.addLayer({id:"area-highlight-fill",type:"fill",source:"area-highlight",paint:{"fill-color":i,"fill-opacity":r}},n),this.map.addLayer({id:"area-highlight-line",type:"line",source:"area-highlight",paint:{"line-color":i,"line-width":2,"line-opacity":Math.min(1,1.2*r)}},n)}}function GT(){var e=this;this.points.forEach((function(t){var i=document.createElement("button");i.type="button",i.className="map__marker map__marker--poi",i.dataset.cat=t.category,i.innerHTML=t.icon_svg,i.style.display="none",i.setAttribute("tabindex","-1"),i.setAttribute("aria-hidden","true"),i.addEventListener("click",(function(){return i.focus()})),t.icon_color&&(i.style.backgroundColor="#".concat(t.icon_color));var r='<div class="map__popup-title">'.concat(t.name,'</div>\n <div class="map__popup-address">').concat(t.address,"</div>");(t.map_url||t.website)&&(r+='<div class="map__popup-links">',t.map_url&&(r+='<a href="'.concat(t.map_url,'" target="_blank" rel="nofollow" aria-label="Get Directions (opens in a new tab)">Get Directions</a>')),t.website&&(r+='<a href="'.concat(t.website,'" target="_blank" rel="nofollow" aria-label="View Website (opens in a new tab)">View Website</a>')),r+="</div>");var a=!1,n=new hT({element:i}),o=new dT({offset:16,className:"map__popup map__popup--poi",focusAfterOpen:!1,maxWidth:"300px"}).setHTML(r);try{n.setLngLat(AT(BT,e,qT).call(e,t))}catch(e){a=!0,console.warn("Failed to add POI marker. Invalid lat/lng.",t)}if(!a){o.on("open",(function(){var e=o.getElement();e.setAttribute("role","dialog"),e.setAttribute("aria-label",s.poi.name);var t=e.querySelector(".maplibregl-popup-content"),i=e.querySelector(".maplibregl-popup-close-button");i&&t.insertBefore(i,t.firstChild)})),o.on("close",(function(){e.returnFocusTo&&(e.returnFocusTo.focus(),e.returnFocusTo=null)}
2)),n.setPopup(o).addTo(e.map);var s={poi:t,marker:n,el:i,popup:o};e.entries.push(s)}}))}function ZT(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.palette;Object.entries(mT.LAYER_GROUPS).forEach((function(i){var r=wT(i,2),a=r[0],n=r[1],o=t[a];o&&n.forEach((function(i){var r=e.map.getLayer(i);if(r){var a=mT.COLOR_PROP[r.type];a&&e.map.setPaintProperty(i,a,o),"fill"===r.type&&t.buildingOutline&&e.map.setPaintProperty(i,"fill-outline-color",t.buildingOutline)}}))}));if(Object.entries({label_state:["interpolate",["exponential",1.2],["zoom"],4,13,7,15,11,20,15,26],label_city:["interpolate",["exponential",1.2],["zoom"],4,11,7,13,11,18,15,24],label_town:["interpolate",["exponential",1.2],["zoom"],7,12,11,13,15,16],label_village:["interpolate",["exponential",1.2],["zoom"],7,10,11,13,15,16],label_other:["interpolate",["linear"],["zoom"],8,9,12,13,15,16]}).forEach((function(t){var i=wT(t,2),r=i[0],a=i[1];e.map.getLayer(r)&&(e.map.setLayoutProperty(r,"text-size",a),e.map.setLayoutProperty(r,"text-font",["Noto Sans Bold"]),e.map.setLayoutProperty(r,"text-transform","none"),e.map.setLayoutProperty(r,"text-letter-spacing",0))})),this.map.getLayer("label_other")&&this.map.setFilter("label_other",["all",this.map.getFilter("label_other"),["match",["get","class"],["suburb","quarter","neighbourhood"],!1,!0],["<=",["coalesce",["get","rank"],99],15]]),t.labelHalo&&[].concat(TT(mT.LAYER_GROUPS.label),TT(mT.LAYER_GROUPS.roadLabel),TT(mT.LAYER_GROUPS.highwayLabel),TT(mT.LAYER_GROUPS.waterLabel)).forEach((function(i){e.map.getLayer(i)&&e.map.setPaintProperty(i,"text-halo-color",t.labelHalo)})),t.park){var i=this.map.getLayer("water")?"water":void 0;this.map.getLayer("park")&&this.map.setFilter("park",["all",["match",["geometry-type"],["MultiPolygon","Polygon"],!0,!1],["!=",["get","class"],"nature_reserve"]]),this.map.addLayer({id:"jd-green-landcover",type:"fill",source:"openmaptiles","source-layer":"landcover",filter:["match",["get","subclass"],["park","garden","recreation_ground"],!0,!1],paint:{"fill-color":t.park}},i),this.map.addLayer({id:"jd-green-landuse",type:"fill",source:"openmaptiles","source-layer":"landuse",filter:["match",["get","class"],["playground","pitch","theme_park","stadium"],!0,!1],paint:{"fill-color":t.park}},i)}return this}function WT(e){return WT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},WT(e)}function HT(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,XT(r.key),r)}}function XT(e){var t=function(e,t){if("object"!=WT(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=WT(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==WT(t)?t:t+""}function YT(e,t,i){return t=JT(t),function(e,t){if(t&&("object"==WT(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,KT()?Reflect.construct(t,i||[],JT(e).constructor):t.apply(e,i))}function KT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(KT=function(){return!!e})()}function JT(e){return JT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},JT(e)}function QT(e,t){return QT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},QT(e,t)}function eS(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function tS(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}mT=OT,IT(OT,"REDUCE_MOTION",window.matchMedia("(prefers-reduced-motion: reduce)").matches),IT(OT,"LAYER_GROUPS",{background:["background"],land:["landcover_wood","landcover_glacier","landcover_ice_shelf","landuse_residential"],park:["park"],water:["water","waterway"],building:["building"],highwayCasing:["highway_motorway_casing","highway_motorway_bridge_casing","tunnel_motorway_casing"],roadCasing:["highway_major_casing"],highway:["highway_motorway_
2inner","highway_motorway_subtle","highway_motorway_bridge_inner","tunnel_motorway_inner","highway_major_inner","highway_major_subtle"],road:["highway_minor","highway_path","road_pier"],rail:["railway","railway_dashline","railway_transit","railway_transit_dashline","railway_service","railway_service_dashline"],boundary:["boundary_2","boundary_3","boundary_disputed"],label:["label_other","label_village","label_town","label_state","label_city","label_city_capital","label_country_1","label_country_2","label_country_3","airport"],roadLabel:["highway-name-minor","highway-name-path"],highwayLabel:["highway-name-major"],waterLabel:["water_name_point_label","water_name_line_label","waterway_line_label"]}),IT(OT,"COLOR_PROP",{background:"background-color",fill:"fill-color",line:"line-color",symbol:"text-color"}),IT(OT,"PALETTE",{background:"#f2f0f0",land:"#f2f0f0",park:"#bcd1bb",water:"#bbcad2",building:"#f2f0f0",highwayCasing:"#c2bebc",highway:"#dfdcdb",road:"#dfdcdb",roadCasing:"#cccccc",rail:"#e3ded4",boundary:"#d8d3c8",label:"#a5a19e",roadLabel:"#afaba8",highwayLabel:"#787471",waterLabel:"#a5a19e",labelHalo:"#ffffff"});var iS=new WeakSet,rS=function(e){function t(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),eS(i=YT(this,t,[e,r]),iS),i.$poiCategoryExpand=i.$el("poi-category-expand"),i.$categoryButton=i.$el("poi-category-button"),i.$categoryList=i.$el("poi-category-list"),i.$poiButton=i.$el("poi-button"),i.$poiCategorySelect=i.$el("poi-category-select"),i.$poiCategorySelectOptions=i.$el("poi-category-select-options"),i.$mapCanvas=i.$el("map-canvas"),i.$enhancedPOI=i.$el("enhanced-poi"),i.settings=i.argObj("settings")||{},i.legacyEnhanced=i.args.legacyEnhanced,i.loadAll="all"===i.settings.defaultCategory,i.classes={categoryActive:i.$categoryButton.first().data("active-class"),categoryExpandActive:"neighborhood__poi-category-header--active",showingAllPOIS:"showing-all-pois"},tS(iS,i,nS).call(i),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&QT(e,t)}(t,e),function(e,t,i){return t&&HT(e.prototype,t),i&&HT(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}(t)}(r.A);function aS(e){var t=this.$categoryList.filter('[data-category="'+e+'"]'),i=this.$categoryButton.filter('[data-category="'+e+'"]');if(this.$categoryButton.removeClass(i.data("active-class")),this.$categoryList.hide().removeClass(t.data("active-class")),t.show().addClass(t.data("active-class")),i.addClass(i.data("active-class")),this.$categoryButton.removeAttr("aria-current"),i.attr("aria-current","true"),this.$poiCategorySelectOptions.length&&this.$poiCategorySelectOptions.data("open")){var r,a=this.$poiCategorySelectOptions.get(0);if(a&&a.contains(document.activeElement))null===(r=this.$poiCategorySelect.get(0))||void 0===r||r.focus();this.$poiCategorySelectOptions.data("open",!1).slideUp(100),this.$poiCategorySelect.attr("aria-expanded","false")}this.$enhancedPOI.length&&(this.$enhancedPOI.hide(),this.$enhancedPOI.filter('[data-category="'+e+'"]').show()),this.$poiCategorySelect.length&&this.$poiCategorySelect.html(i.html())}function nS(){var e=this;window.testMap=this.poiMap=new OT({tileSource:this.settings.tileSource,containerID:"map_canvas",home:{lat:this.settings.home.lat,lng:this.settings.home.lng,size:this.settings.home.size,color:this.settings.home.color,popup_html:this.arg("home-popup-template"),persist_pinpoint:this.settings.persistPinpoint},points:this.settings.pois,areaHighlight:this.settings.areaHighlight,defaultCategory:this.settings.defaultCategory,defaultZoom:this.settings.defaultZoom}),this.poiMap.eventer.on("reset",(function(){e.loadAll?(e.$categoryButton.removeClass(e.classes.categoryActive),e.$categoryList.show().removeClass(e.$categoryList.first().data("active-class")),e.$poiCategorySelect.length&&e.$poiCategorySelect.html(e.poiCategorySelectOriginalHTML),e.legacyEnhanced&&e.$enhancedPOI.show()):tS(iS,e,aS).call(e,e.settings.defaultCategory)})),this.loadAll||this.legacyEnhanced?this.$categoryButton.first().addClass(this.classes.categoryActive):(this.$poiCategorySelect.html(this.$categoryButton.first().html()),tS(iS,this,aS).call(this,this.settings.defaultCategory)),this.$poiCategorySelect.length&&(this.poiCategorySelectOriginalHTML=this.$poiCategorySelect.html()),this.$poiCategoryExpand.on("expand",(function(t){var i=$(t.currentTarget),r=i.data("category"),a=e.$categoryList.filter('[data-category="'+r+'"]');
2i.data("open")||(e.$poiCategoryExpand.not(i).trigger("collapse"),i.data("open",!0),i.attr("aria-expanded","true"),i.addClass(e.classes.categoryExpandActive),a.stop().slideDown(200))})).on("collapse",(function(t){var i=$(t.currentTarget),r=i.data("category"),a=e.$categoryList.filter('[data-category="'+r+'"]');i.data("open")&&(i.data("open",!1),i.attr("aria-expanded","false"),i.removeClass(e.classes.categoryExpandActive),a.stop().slideUp(200))})).clickPrevent((function(e){var t=$(e);t.data("open")?t.trigger("collapse"):t.trigger("expand")})),this.$poiCategorySelect.clickPrevent((function(){var t=Boolean(e.$poiCategorySelectOptions.data("open"));t?e.$poiCategorySelectOptions.stop().slideUp(200):e.$poiCategorySelectOptions.stop().slideDown(200),e.$poiCategorySelectOptions.data("open",!t),e.$poiCategorySelect.attr("aria-expanded",String(!t))})),this.$poiButton.click((function(t){var i;e.poiMap.focusPOIId($(t.currentTarget).data("poi"),t.currentTarget,0===(null===(i=t.originalEvent)||void 0===i?void 0:i.detail)),e.$mapCanvas.get(0).getBoundingClientRect().top<0&&a.A.scrollToElementTop(e.$root)})),this.$categoryButton.clickPrevent((function(t){var i=$(t).data("category");"all"===i?(e.$categoryList.show(),e.poiMap.filter(null)):(e.$root.removeClass(e.classes.showingAllPOIS),tS(iS,e,aS).call(e,i),e.poiMap.filter(i))}))}},761:function(e,t,i){i.d(t,{A:function(){return u}});var r=i(3464);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function n(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function o(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}function s(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function l(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var h=new WeakSet,u=function(){return e=function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),s(this,h),this.$root=(0,r.A)(t),this.root=this.$root.get(0),this.args=i,this.__proto__.els={},l(h,this,c).call(this),l(h,this,p).call(this)},t=[{key:"el",value:function(e){return l(h,this,d).call(this,e)}},{key:"$el",value:function(e){var t=l(h,this,d).call(this,e);return t&&"object"===a(t)&&void 0===t.nodeName&&(t=Object.values(t)),(0,r.A)(t)}},{key:"arg",value:function(e){return this.args[e]}},{key:"argObj",value:function(e){var t=this.arg(e);if(t){if("string"!=typeof t)return null;try{return JSON.parse(t)}catch(e){return null}}return null}},{key:"argBool",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return"boolean"==typeof this.args[e]?this.args[e]:t}}],t&&n(e.prototype,t),i&&n(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,i}();function c(){var e=this,t=this.$root.find("[data-el]");t.length&&t.each((function(t,i){var r=i.getAttribute("data-el"),a=r.match(/^(.*)\[(.*?)\]/);if(a){var n=a[1],o=a[2];""===o?(e.__proto__.els[n]||(e.__proto__.els[n]=[]),e.__proto__.els[n].push(i)):(e.__proto__.els[n]||(e.__proto__.els[n]={}),e.__proto__.els[n][o]=i)}else e.__proto__.els[r]=i}))}function p(){var e=this,t=this.$root.find("script[data-arg]");t.length&&t.each((function(t,i){var r=i.getAttribute("data-arg");e.args[r]=i.innerText}))}function d(e){var t=e.match(/^(.*)\.(.*)$/),i=null;if(t&&(e=t[1],i=t[2]),this.__proto__.els[e]){return i?this.__proto__.els[e][i]:this.__proto__.els[e]}return null}},1957:function(e,t,i){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function a(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,n(r.key),r)}}function n(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var a=i.call(e,t||"default");if("object"!=r(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function o(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function s(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}i.d(t,{A:function(){return h}});var l=new WeakSet,h=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,l),this.events={},this.flashEvents={},this.doneEvents={}
2,this.propagable={},this.fired={},this.actions={},this.add(t)},t=[{key:"add",value:function(e){var t=this;return(e=Array.isArray(e)?e:[e]).forEach((function(e){t.events[e]||(t.events[e]=[],t.flashEvents[e]=[],t.doneEvents[e]=[])})),this}},{key:"inherit",value:function(e){this.events=e.events}},{key:"exists",value:function(e){return Boolean(this.events[e])}},{key:"has",value:function(e){return!!this.exists(e)&&this.events[e].length>0}},{key:"clearEvent",value:function(e){var t=this;return(e=Array.isArray(e)?e:[e]).forEach((function(e){t.events[e]&&(t.events[e]=[])})),this}},{key:"fire",value:function(e,t){var i=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[];e=Array.isArray(e)?e:[e];for(var n=function(){var n=e[o];if(r&&(i.propagable[n]||(i.propagable[n]=[]),i.propagable[n].push(t)),i.fired[n]||(i.fired[n]=0),++i.fired[n],i.events[n]){var s=0,l=i.events[n].length;i.events[n].forEach((function(e){++s;var r=e.apply(i,t);"boolean"==typeof r&&a.push(r?1:0),s===l&&i.doneEvents[n]&&i.doneEvents[n].length&&i.doneEvents[n].forEac
2h((function(e){e.apply(i,t)}))}))}i.flashEvents[n]&&i.flashEvents[n].forEach((function(e,r){var o=e.apply(i,t);"boolean"==typeof o&&a.push(o?1:0),delete i.flashEvents[n][r]}))},o=0;o<e.length;o++)n();return!(a.length&&a.indexOf(0)>=0)}},{key:"fireAndPropagate",value:function(e,t){this.fire(e,t,!0)}},{key:"touched",value:function(e){return!!(this.fired[e]&&this.fired[e]>0)&&this.fired[e]}},{key:"on",value:function(e,t){var i=this;return(e=Array.isArray(e)?e:[e]).forEach((function(e){i.events[e]&&(s(l,i,u).call(i,e,t),i.events[e].push(t))})),this}},{key:"onNext",value:function(e,t){var i=this;return(e=Array.isArray(e)?e:[e]).forEach((function(e){i.flashEvents[e]&&(s(l,i,u).call(i,e,t),i.flashEvents[e].push(t))})),this}},{key:"done",value:function(e,t){var i=this;return(e=Array.isArray(e)?e:[e]).forEach((function(e){i.doneEvents[e]&&i.doneEvents[e].push(t)})),this}},{key:"act",value:function(e,t,i){var r=this,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return this.onNext(e,i),this.actions[e]||(this.actions[e]=new Promise((function(e){t(e)}))),this.actions[e].then((function(t){r.fire(e,t,a)})),this.actions[e]}}],t&&a(e.prototype,t),i&&a(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,i}();function u(e,t){var i=this;this.propagable[e]&&this.touched(e)&&this.propagable[e].forEach((function(e){t.apply(i,e)}))}},6073:function(e,t,i){var r=i(6314),a=i.n(r)()((function(e){return e[1]}));a.push([e.id,".maplibregl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}@media (hover:hover){.maplibregl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}}.maplibregl-ctrl button:not(:disabled):active{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E\")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E\")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E\")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E\")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E\")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E\")}}.maplibregl-ctrl button.maplibregl-ctrl-globe .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' stroke='%23333'%3E%3Ccircle cx='11' cy='11' r='8.5'/%3E%3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E%3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E%3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.
208-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138q.07-.058.224-.138c.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138 1.3 1.3 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.3 1.3 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5 1.5 0 0 1-.39-.272.3.3 0 0 1-.047-.064.3.3 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.3.3 0 0 1 .047.064.3.3 0 0 1-.048.064 1.4 1.4 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0 .018v.002zm17.002.002v-.002zm0-.018v-.002z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-globe-enabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' stroke='%2333b5e5'%3E%3Ccircle cx='11' cy='11' r='8.5'/%3E%3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E%3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E%3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138q.07-.058.224-.138c.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138 1.3 1.3 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.3 1.3 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5 1.5 0 0 1-.39-.272.3.3 0 0 1-.047-.064.3.3 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.3.3 0 0 1 .047.064.3.3 0 0 1-.048.064 1.4 1.4 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0 .018v.002zm17.002.002v-.002zm0-.018v-.002z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3
2E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3
2E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3
2E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3
2E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3
2E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E\")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url(\
vendor: 11,722 bytes, line 2
2"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)
2 scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85) scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85) scale(.88807)'/%3E%3C/g%3E%3C/svg%3E\");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url(\
vendor: 11,722 bytes, line 2
2"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)
2 scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85) scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85) scale(.88807)'/%3E%3C/g%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url(\
vendor: 11,722 bytes, line 2
2"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)
2 scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85) scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85) scale(.88807)'/%3E%3C/g%3E%3C/svg%3E\")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}[dir=rtl] .maplibregl-popup-anchor-left{flex-direction:row-reverse}[dir=rtl] .maplibregl-popup-anchor-right{flex-direction:row}[dir=rtl] .maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-start}[dir=rtl] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-start}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}
2.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-marker-draggable{cursor:grab}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:\"\";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@media (prefers-reduced-motion:reduce){.maplibregl-user-location-dot:before{animation:none}}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(pointer:coarse){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}",""]),t.A=a},6314:function(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i=e(t);return t[2]?"@media ".concat(t[2]," {").concat(i,"}"):i})).join("")},t.i=function(e,i,r){"string"==typeof e&&(e=[[null,e,""]]);var a={};if(r)for(var n=0;n<this.length;n++){var o=this[n][0];null!=o&&(a[o]=!0)}for(var s=0;s<e.length;s++){var l=[].concat(e[s]);r&&a[l[0]]||(i&&(l[2]?l[2]="".concat(i," and ").concat(l[2]):l[2]=i),t.push(l))}},t}},5072:function(e,t,i){var r,a=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},n=function(){var e={};return function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}e[t]=i}return e[t]}}(),o=[];function s(e){for(var t=-1,i=0;i<o.length;i++)if(o[i].identifier===e){t=i;break}return t}function l(e,t){for(var i={},r=[],a=0;a<e.length;a++){var n=e[a],l=t.base?n[0]+t.base:n[0],h=i[l]||0,u="".concat(l," ").concat(h);i[l]=h+1;var c=s(u),p={css:n[1],media:n[2],sourceMap:n[3]};-1!==c?(o[c].references++,o[c].updater(p)):o.push({identifier:u,updater:g(p,t),references:1}),r.push(u)}return r}function h(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var a=i.nc;a&&(r.nonce=a)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var o=n(e.insert||"head");if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(t)}return t}var u,c=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function p(e,t,i,r){var a=i?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=c(t,a);else{var n=document.createTextNode(a),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(n,o[t]):e.appendChild(n)}}function d(e,t,i){var r=i.css,a=i.media,n=i.sourceMap;if(a?e.setAttribute("media",a):e.removeAttribute("media"),n&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(n))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var f=null,m=0;function g(e,t){var i,r,a;if(t.singleton){var n=m++;i=f||(f=h(t)),r=p.bind(null,i,n,!1),a=p.bind(null,i,n,!0)}else i=h(t),r=d.bind(null,i,t),a=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(i)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else a()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=a());var i=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<i.length;r++){var a=s(i[r]);o[a].references--}for(var n=l(e,t),h=0;h<i.length;h++){var u=s(i[h]);0===o[u].references&&(o[u].updater(),o.splice(u,1))}i=n}}}}}]);
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.