| 2704 | `)),F.push({type:"Feature",geometry:{type:"Point",coordinates:B.lonlat},properties:{symbol:R(N),angle:L(N),text:U}})}}return{type:"FeatureCollection",features:F}}function T(M,g){return x.isArrayOrTypedArray(M)?g?function(b){return p(M[b])?+M[b]:0}:function(b){return M[b]}:M?function(){return M}:l}function l(){return""}function _(M){return M[0]===S}function w(M,g){var b;if(x.isArrayOrTypedArray(M)&&x.isArrayOrTypedArray(g)){b=["step",["get","point_count"],M[0]];for(var v=1;v<M.length;v++)b.push(g[v-1],M[v])}else b=M;return b}function A(M){var g=M.textfont,b=g.family,v=g.style,u=g.weight,y=b.split(" "),f=y[y.length-1]==="Italic";f&&y.pop(),f=f||v==="italic";var R=y.join(" ");u==="bold"&&y.indexOf("Bold")===-1?R+=" Bold":u<=1e3&&(y[0]==="Metropolis"?(R="Metropolis",u>850?R+=" Black":u>750?R+=" Extra Bold":u>650?R+=" Bold":u>550?R+=" Semi Bold":u>450?R+=" Medium":u>350?R+=" Regular":u>250?R+=" Light":u>150?R+=" Extra Light":R+=" Thin"):y.slice(0,2).join(" ")==="Open Sans"?(R="Open Sans",u>750?R+=" Extrabold":u>650?R+=" Bold":u>550?R+=" Semibold":u>350?R+=" Regular":R+=" Light"):y.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(R="Klokantech Noto Sans",y[3]==="CJK"&&(R+=" CJK"),R+=u>500?" Bold":" Regular")),f&&(R+=" Italic"),R==="Open Sans Regular Italic"?R="Open Sans Italic":R==="Open Sans Regular Bold"?R="Open Sans Bold":R==="Open Sans Regular Bold Italic"?R="Open Sans Bold Italic":R==="Klokantech Noto Sans Regular Italic"&&(R="Klokantech Noto Sans Italic"),i(R)||(R=b);var L=R.split(", ");return L}}}),NR=De({"src/traces/scattermapbox/plot.js"(Y,H){"use strict";var p=ui(),x=OR(),S=_p().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,i,n){this.type="scattermapbox",this.subplot=r,this.uid=o,this.clusterEnabled=i,this.isHidden=n,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:S+o+"-fill",line:S+o+"-line",circle:S+o+"-circle",symbol:S+o+"-symbol",cluster:S+o+"-cluster",clusterCount:S+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,i){var n={type:"geojson",data:o.geojson};i&&i.enabled&&p.extendFlat(n,{cluster:!0,clusterMaxZoom:i.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[r]);a?a.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],n)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,i){var n={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(n.filter=o.filter);for(var a=this.layerIds[r],s,h=this.subplot.getMapLayers(),c=0;c<h.length;c++)if(h[c].id===a){s=!0;break}s?(this.subplot.setOptions(a,"setLayoutProperty",n.layout),n.layout.visibility==="visible"&&this.subplot.setOptions(a,"setPaintProperty",n.paint)):this.subplot.addLayer(n,i)},t.update=function(o){var i=o[0].trace,n=this.subplot,a=n.map,s=x(n.gd,o),h=n.belowLookup["trace-"+this.uid],c=!!(i.cluster&&i.cluster.enabled),m=!!this.clusterEnabled,d=this;function T(u){u||d.addSource("circle",s.circle,i.cluster);for(var y=E.cluster,f=0;f<y.length;f++){var R=y[f],L=s[R];d.addLayer(R,L,h)}}function l(u){for(var y=E.cluster,f=y.length-1;f>=0;f--){var R=y[f];a.removeLayer(d.layerIds[R])}u||a.removeSource(d.sourceIds.circle)}function _(u){for(var y=E.nonCluster,f=0;f<y.length;f++){var R=y[f],L=s[R];u||d.addSource(R,L),d.addLayer(R,L,h)}}function w(u){for(var y=E.nonCluster,f=y.length-1;f>=0;f--){var R=y[f];a.removeLayer(d.layerIds[R]),u||a.removeSource(d.sourceIds[R])}}function A(u){m?l(u):w(u)}function M(u){c?T(u):_(u)}function g(){for(var u=c?E.cluster:E.nonCluster,y=0;y<u.length;y++){var f=u[y],R=s[f];R&&(n.setOptions(d.layerIds[f],"setLayoutProperty",R.layout),R.layout.visibility==="visible"&&(f!=="cluster"&&d.setSourceData(f,R),n.setOptions(d.layerIds[f],"setPaintProperty",R.paint)))}}var b=this.isHidden,v=i.visible!==!0;v?b||A():b?v||M():m!==c?(A(),M()):(this.below!==h&&(A(!0),M(!0)),g()),this.clusterEnabled=c,this.isHidden=v,this.below=h,o[0].trace._glTrace=this},t.dispose=function(){for(var o=this.subplot.map,i=this.clusterEnabled?E.cluster:E.nonCluster,n=i.length-1;n>=0;n--){var a=i[n];o.removeLayer(this.layerIds[a]),o.removeSource(this.sourceIds[a])}},H.exports=function(o,i){var n=i[0].trace,a=n.cluster&&n.cluster.enabled,s=n.visible!==!0,h=new e(o,n.uid,a,s),c=x(o.gd,i),m=h.below=o.belowLookup["trace-"+n.uid],d,T,l;if(a)for(h.addSource("circle",c.circle,n.cluster),d=0;d<E.cluster.length;d++)T=E.cluster[d],l=c[T],h.addLayer(T,l,m);else for(d=0;d<E.nonCluster.length;d++)T=E.nonCluster[d],l=c[T],h.addSource(T,l,n.cluster),h.addLayer(T,l,m);return i[0].trace._glTrace=h,h}}}),Eb=De({"src/traces/scattermapbox/hover.js"(Y,H){"use strict";var p=sf(),x=ui(),S=rg(),E=x.fillText,e=zn().BADNUM,t=_p().traceLayerPrefix;function r(i,n,a){var s=i.cd,h=s[0].trace,c=i.xa,m=i.ya,d=i.subplot,T=[],l=t+h.uid+"-circle",_=h.cluster&&h.cluster.enabled;if(_){var w=d.map.queryRenderedFeatures(null,{layers:[l]});T=w.map(function(N){return N.id})}var A=n>=0?Math.floor((n+180)/360):Math.ceil((n-180)/360),M=A*360,g=n-M;function b(N){var B=N.lonlat;if(B[0]===e||_&&T.indexOf(N.i+1)===-1)return 1/0;var I=x.modHalf(B[0],360),U=B[1],O=d.project([I,U]),X=O.x-c.c2p([g,U]),J=O.y-m.c2p([I,a]),se=Math.max(3,N.mrc||0);return Math.max(Math.sqrt(X*X+J*J)-se,1-3/se)}if(p.getClosest(s,b,i),i.index!==!1){var v=s[i.index],u=v.lonlat,y=[x.modHalf(u[0],360)+M,u[1]],f=c.c2p(y),R=m.c2p(y),L=v.mrc||1;i.x0=f-L,i.x1=f+L,i.y0=R-L,i.y1=R+L;var z={};z[h.subplot]={_subplot:d};var F=h._module.formatLabels(v,h,z);return i.lonLabel=F.lonLabel,i.latLabel=F.latLabel,i.color=S(h,v),i.extraText=o(h,v,s[0].t.labels),i.hovertemplate=h.hovertemplate,[i]}}function o(i,n,a){if(i.hovertemplate)return;var s=n.hi||i.hoverinfo,h=s.split("+"),c=h.indexOf("all")!==-1,m=h.indexOf("lon")!==-1,d=h.indexOf("lat")!==-1,T=n.lonlat,l=[];function _(w){return w+"\xB0"}return c||m&&d?l.push("("+_(T[1])+", "+_(T[0])+")"):m?l.push(a.lon+_(T[0])):d&&l.push(a.lat+_(T[1])),(c||h.indexOf("text")!==-1)&&E(n,i,l),l.join("<br>")}H.exports={hoverPoints:r,getExtraText:o}}}),UR=De({"src/traces/scattermapbox/event_data.js"(Y,H){"use strict";H.exports=function(x,S){return x.lon=S.lon,x.lat=S.lat,x}}}),jR=De({"src/traces/scattermapbox/select.js"(Y,H){"use strict";var p=ui(),x=Hu(),S=zn().BADNUM;H.exports=function(e,t){var r=e.cd,o=e.xaxis,i=e.yaxis,n=[],a=r[0].trace,s;if(!x.hasMarkers(a))return[];if(t===!1)for(s=0;s<r.length;s++)r[s].selected=0;else for(s=0;s<r.length;s++){var h=r[s],c=h.lonlat;if(c[0]!==S){var m=[p.modHalf(c[0],360),c[1]],d=[o.c2p(m),i.c2p(m)];t.contains(d,null,s,e)?(n.push({pointNumber:s,lon:c[0],lat:c[1]}),h.selected=1):h.selected=0}}return n}}}),uA=De({"node_modules/@plotly/mapbox-gl/dist/mapbox-gl-unminified.js"(Y,H){(function(p,x){typeof Y=="object"&&typeof H<"u"?H.exports=x():(p=p||self,p.mapboxgl=x())})(Y,function(){"use strict";var p,x,S;function E(e,t){if(!p)p=t;else if(!x)x=t;else{var r="var sharedChunk = {}; ("+p+")(sharedChunk); ("+x+")(sharedChunk);",o={};p(o),S=t(o),typeof window<"u"&&(S.workerUrl=window.URL.createObjectURL(new Blob([r],{type:"text/javascript"})))}}return E(["exports"],function(e){"use strict";function t(k,C){return C={exports:{}},k(C,C.exports),C.exports}var r="1.13.4",o=i;function i(k,C,G,ne){this.cx=3*k,this.bx=3*(G-k)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*C,this.by=3*(ne-C)-this.cy,this.ay=1-this.cy-this.by,this.p1x=k,this.p1y=ne,this.p2x=G,this.p2y=ne}i.prototype.sampleCurveX=function(k){return((this.ax*k+this.bx)*k+this.cx)*k},i.prototype.sampleCurveY=function(k){return((this.ay*k+this.by)*k+this.cy)*k},i.prototype.sampleCurveDerivativeX=function(k){return(3*this.ax*k+2*this.bx)*k+this.cx},i.prototype.solveCurveX=function(k,C){typeof C>"u"&&(C=1e-6);var G,ne,ye,Pe,Ve;for(ye=k,Ve=0;Ve<8;Ve++){if(Pe=this.sampleCurveX(ye)-k,Math.abs(Pe)<C)return ye;var ft=this.sampleCurveDerivativeX(ye);if(Math.abs(ft)<1e-6)break;ye=ye-Pe/ft}if(G=0,ne=1,ye=k,ye<G)return G;if(ye>ne)return ne;for(;G<ne;){if(Pe=this.sampleCurveX(ye),Math.abs(Pe-k)<C)return ye;k>Pe?G=ye:ne=ye,ye=(ne-G)*.5+G}return ye},i.prototype.solve=function(k,C){return this.sampleCurveY(this.solveCurveX(k,C))};var n=a;function a(k,C){this.x=k,this.y=C}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(k){return this.clone()._add(k)},sub:function(k){return this.clone()._sub(k)},multByPoint:function(k){return this.clone()._multByPoint(k)},divByPoint:function(k){return this.clone()._divByPoint(k)},mult:function(k){return this.clone()._mult(k)},div:function(k){return this.clone()._div(k)},rotate:function(k){return this.clone()._rotate(k)},rotateAround:function(k,C){return this.clone()._rotateAround(k,C)},matMult:function(k){return this.clone()._matMult(k)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(k){return this.x===k.x&&this.y===k.y},dist:function(k){return Math.sqrt(this.distSqr(k))},distSqr:function(k){var C=k.x-this.x,G=k.y-this.y;return C*C+G*G},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(k){return Math.atan2(this.y-k.y,this.x-k.x)},angleWith:function(k){return this.angleWithSep(k.x,k.y)},angleWithSep:function(k,C){return Math.atan2(this.x*C-this.y*k,this.x*k+this.y*C)},_matMult:function(k){var C=k[0]*this.x+k[1]*this.y,G=k[2]*this.x+k[3]*this.y;return this.x=C,this.y=G,this},_add:function(k){return this.x+=k.x,this.y+=k.y,this},_sub:function(k){return this.x-=k.x,this.y-=k.y,this},_mult:function(k){return this.x*=k,this.y*=k,this},_div:function(k){return this.x/=k,this.y/=k,this},_multByPoint:function(k){return this.x*=k.x,this.y*=k.y,this},_divByPoint:function(k){return this.x/=k.x,this.y/=k.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var k=this.y;return this.y=this.x,this.x=-k,this},_rotate:function(k){var C=Math.cos(k),G=Math.sin(k),ne=C*this.x-G*this.y,ye=G*this.x+C*this.y;return this.x=ne,this.y=ye,this},_rotateAround:function(k,C){var G=Math.cos(k),ne=Math.sin(k),ye=C.x+G*(this.x-C.x)-ne*(this.y-C.y),Pe=C.y+ne*(this.x-C.x)+G*(this.y-C.y);return this.x=ye,this.y=Pe,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(k){return k instanceof a?k:Array.isArray(k)?new a(k[0],k[1]):k};var s=typeof self<"u"?self:{};function h(k,C){if(Array.isArray(k)){if(!Array.isArray(C)||k.length!==C.length)return!1;for(var G=0;G<k.length;G++)if(!h(k[G],C[G]))return!1;return!0}if(typeof k=="object"&&k!==null&&C!==null){if(typeof C!="object")return!1;var ne=Object.keys(k);if(ne.length!==Object.keys(C).length)return!1;for(var ye in k)if(!h(k[ye],C[ye]))return!1;return!0}return k===C}var c=Math.pow(2,53)-1;function m(k){if(k<=0)return 0;if(k>=1)return 1;var C=k*k,G=C*k;return 4*(k<.5?G:3*(k-C)+G-.75)}function d(k,C,G,ne){var ye=new o(k,C,G,ne);return function(Pe){return ye.solve(Pe)}}var T=d(.25,.1,.25,1);function l(k,C,G){return Math.min(G,Math.max(C,k))}function _(k,C,G){var ne=G-C,ye=((k-C)%ne+ne)%ne+C;return ye===C?G:ye}function w(k,C,G){if(!k.length)return G(null,[]);var ne=k.length,ye=new Array(k.length),Pe=null;k.forEach(function(Ve,ft){C(Ve,function(Rt,Ht){Rt&&(Pe=Rt),ye[ft]=Ht,--ne===0&&G(Pe,ye)})})}function A(k){var C=[];for(var G in k)C.push(k[G]);return C}function M(k,C){var G=[];for(var ne in k)ne in C||G.push(ne);return G}function g(k){for(var C=[],G=arguments.length-1;G-- >0;)C[G]=arguments[G+1];for(var ne=0,ye=C;ne<ye.length;ne+=1){var Pe=ye[ne];for(var Ve in Pe)k[Ve]=Pe[Ve]}return k}function b(k,C){for(var G={},ne=0;ne<C.length;ne++){var ye=C[ne];ye in k&&(G[ye]=k[ye])}return G}var v=1;function u(){return v++}function y(){function k(C){return C?(C^Math.random()*16>>C/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,k)}return k()}function f(k){return k<=1?1:Math.pow(2,Math.ceil(Math.log(k)/Math.LN2))}function R(k){return k?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(k):!1}function L(k,C){k.forEach(function(G){C[G]&&(C[G]=C[G].bind(C))})}function z(k,C){return k.indexOf(C,k.length-C.length)!==-1}function F(k,C,G){var ne={};for(var ye in k)ne[ye]=C.call(G||this,k[ye],ye,k);return ne}function N(k,C,G){var ne={};for(var ye in k)C.call(G||this,k[ye],ye,k)&&(ne[ye]=k[ye]);return ne}function B(k){return Array.isArray(k)?k.map(B):typeof k=="object"&&k?F(k,B):k}function I(k,C){for(var G=0;G<k.length;G++)if(C.indexOf(k[G])>=0)return!0;return!1}var U={};function O(k){U[k]||(typeof console<"u"&&console.warn(k),U[k]=!0)}function X(k,C,G){return(G.y-k.y)*(C.x-k.x)>(C.y-k.y)*(G.x-k.x)}function J(k){for(var C=0,G=0,ne=k.length,ye=ne-1,Pe=void 0,Ve=void 0;G<ne;ye=G++)Pe=k[G],Ve=k[ye],C+=(Ve.x-Pe.x)*(Pe.y+Ve.y);return C}function se(k){var C=k[0],G=k[1],ne=k[2];return G+=90,G*=Math.PI/180,ne*=Math.PI/180,{x:C*Math.cos(G)*Math.sin(ne),y:C*Math.sin(G)*Math.sin(ne),z:C*Math.cos(ne)}}function le(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function ce(k){var C=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,G={};if(k.replace(C,function(ye,Pe,Ve,ft){var Rt=Ve||ft;return G[Pe]=Rt?Rt.toLowerCase():!0,""}),G["max-age"]){var ne=parseInt(G["max-age"],10);isNaN(ne)?delete G["max-age"]:G["max-age"]=ne}return G}var q=null;function Z(k){if(q==null){var C=k.navigator?k.navigator.userAgent:null;q=!!k.safari||!!(C&&(/\b(iPad|iPhone|iPod)\b/.test(C)||C.match("Safari")&&!C.match("Chrome")))}return q}function ee(k){try{var C=s[k];return C.setItem("_mapbox_test_",1),C.removeItem("_mapbox_test_"),!0}catch{return!1}}function V(k){return s.btoa(encodeURIComponent(k).replace(/%([0-9A-F]{2})/g,function(C,G){return String.fromCharCode(+("0x"+G))}))}function oe(k){return decodeURIComponent(s.atob(k).split("").map(function(C){return"%"+("00"+C.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var ie=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),j=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,Q=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,re,ue,_e={now:ie,frame:function(C){var G=j(C);return{cancel:function(){return Q(G)}}},getImageData:function(C,G){G===void 0&&(G=0);var ne=s.document.createElement("canvas"),ye=ne.getContext("2d");if(!ye)throw new Error("failed to create canvas 2d context");return ne.width=C.width,ne.height=C.height,ye.drawImage(C,0,0,C.width,C.height),ye.getImageData(-G,-G,C.width+2*G,C.height+2*G)},resolveURL:function(C){return re||(re=s.document.createElement("a")),re.href=C,re.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return s.matchMedia?(ue==null&&(ue=s.matchMedia("(prefers-reduced-motion: reduce)")),ue.matches):!1}},we={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Re={supported:!1,testSupport:et},ze,Xe=!1,tt,it=!1;s.document&&(tt=s.document.createElement("img"),tt.onload=function(){ze&&nt(ze),ze=null,it=!0},tt.onerror=function(){Xe=!0,ze=null},tt.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function et(k){Xe||!tt||(it?nt(k):ze=k)}function nt(k){var C=k.createTexture();k.bindTexture(k.TEXTURE_2D,C);try{if(k.texImage2D(k.TEXTURE_2D,0,k.RGBA,k.RGBA,k.UNSIGNED_BYTE,tt),k.isContextLost())return;Re.supported=!0}catch{}k.deleteTexture(C),Xe=!0}var Ae="01";function me(){for(var k="1",C="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",G="",ne=0;ne<10;ne++)G+=C[Math.floor(Math.random()*62)];var ye=12*60*60*1e3,Pe=[k,Ae,G].join(""),Ve=Date.now()+ye;return{token:Pe,tokenExpiresAt:Ve}}var fe=function(C,G){this._transformRequestFn=C,this._customAccessToken=G,this._createSkuToken()};fe.prototype._createSkuToken=function(){var C=me();this._skuToken=C.token,this._skuTokenExpiresAt=C.tokenExpiresAt},fe.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},fe.prototype.transformRequest=function(C,G){return this._transformRequestFn?this._transformRequestFn(C,G)||{url:C}:{url:C}},fe.prototype.normalizeStyleURL=function(C,G){if(!Be(C))return C;var ne=Vt(C);return ne.path="/styles/v1"+ne.path,this._makeAPIURL(ne,this._customAccessToken||G)},fe.prototype.normalizeGlyphsURL=function(C,G){if(!Be(C))return C;var ne=Vt(C);return ne.path="/fonts/v1"+ne.path,this._makeAPIURL(ne,this._customAccessToken||G)},fe.prototype.normalizeSourceURL=function(C,G){if(!Be(C))return C;var ne=Vt(C);return ne.path="/v4/"+ne.authority+".json",ne.params.push("secure"),this._makeAPIURL(ne,this._customAccessToken||G)},fe.prototype.normalizeSpriteURL=function(C,G,ne,ye){var Pe=Vt(C);return Be(C)?(Pe.path="/styles/v1"+Pe.path+"/sprite"+G+ne,this._makeAPIURL(Pe,this._customAccessToken||ye)):(Pe.path+=""+G+ne,Wt(Pe))},fe.prototype.normalizeTileURL=function(C,G){if(this._isSkuTokenExpired()&&this._createSkuToken(),C&&!Be(C))return C;var ne=Vt(C),ye=/(\.(png|jpg)\d*)(?=$)/,Pe=/^.+\/v4\//,Ve=_e.devicePixelRatio>=2||G===512?"@2x":"",ft=Re.supported?".webp":"$1";ne.path=ne.path.replace(ye,""+Ve+ft),ne.path=ne.path.replace(Pe,"/"),ne.path="/v4"+ne.path;var Rt=this._customAccessToken||It(ne.params)||we.ACCESS_TOKEN;return we.REQUIRE_ACCESS_TOKEN&&Rt&&this._skuToken&&ne.params.push("sku="+this._skuToken),this._makeAPIURL(ne,Rt)},fe.prototype.canonicalizeTileURL=function(C,G){var ne="/v4/",ye=/\.[\w]+$/,Pe=Vt(C);if(!Pe.path.match(/(^\/v4\/)/)||!Pe.path.match(ye))return C;var Ve="mapbox://tiles/";Ve+=Pe.path.replace(ne,"");var ft=Pe.params;return G&&(ft=ft.filter(function(Rt){return!Rt.match(/^access_token=/)})),ft.length&&(Ve+="?"+ft.join("&")),Ve},fe.prototype.canonicalizeTileset=function(C,G){for(var ne=G?Be(G):!1,ye=[],Pe=0,Ve=C.tiles||[];Pe<Ve.length;Pe+=1){var ft=Ve[Pe];at(ft)?ye.push(this.canonicalizeTileURL(ft,ne)):ye.push(ft)}return ye},fe.prototype._makeAPIURL=function(C,G){var ne="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",ye=Vt(we.API_URL);if(C.protocol=ye.protocol,C.authority=ye.authority,C.protocol==="http"){var Pe=C.params.indexOf("secure");Pe>=0&&C.params.splice(Pe,1)}if(ye.path!=="/"&&(C.path=""+ye.path+C.path),!we.REQUIRE_ACCESS_TOKEN)return Wt(C);if(G=G||we.ACCESS_TOKEN,!G)throw new Error("An API access token is required to use Mapbox GL. "+ne);if(G[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+ne);return C.params=C.params.filter(function(Ve){return Ve.indexOf("access_token")===-1}),C.params.push("access_token="+G),Wt(C)};function Be(k){return k.indexOf("mapbox:")===0}var Qe=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function at(k){return Qe.test(k)}function $e(k){return k.indexOf("sku=")>0&&at(k)}function It(k){for(var C=0,G=k;C<G.length;C+=1){var ne=G[C],ye=ne.match(/^access_token=(.*)$/);if(ye)return ye[1]}return null}var Pt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Vt(k){var C=k.match(Pt);if(!C)throw new Error("Unable to parse URL object");return{protocol:C[1],authority:C[2],path:C[3]||"/",params:C[4]?C[4].split("&"):[]}}function Wt(k){var C=k.params.length?"?"+k.params.join("&"):"";return k.protocol+"://"+k.authority+k.path+C}var Cr="mapbox.eventData";function yr(k){if(!k)return null;var C=k.split(".");if(!C||C.length!==3)return null;try{var G=JSON.parse(oe(C[1]));return G}catch{return null}}var qr=function(C){this.type=C,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};qr.prototype.getStorageKey=function(C){var G=yr(we.ACCESS_TOKEN),ne="";return G&&G.u?ne=V(G.u):ne=we.ACCESS_TOKEN||"",C?Cr+"."+C+":"+ne:Cr+":"+ne},qr.prototype.fetchEventData=function(){var C=ee("localStorage"),G=this.getStorageKey(),ne=this.getStorageKey("uuid");if(C)try{var ye=s.localStorage.getItem(G);ye&&(this.eventData=JSON.parse(ye));var Pe=s.localStorage.getItem(ne);Pe&&(this.anonId=Pe)}catch{O("Unable to read from LocalStorage")}},qr.prototype.saveEventData=function(){var C=ee("localStorage"),G=this.getStorageKey(),ne=this.getStorageKey("uuid");if(C)try{s.localStorage.setItem(ne,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(G,JSON.stringify(this.eventData))}catch{O("Unable to write to LocalStorage")}},qr.prototype.processRequests=function(C){},qr.prototype.postEvent=function(C,G,ne,ye){var Pe=this;if(we.EVENTS_URL){var Ve=Vt(we.EVENTS_URL);Ve.params.push("access_token="+(ye||we.ACCESS_TOKEN||""));var ft={event:this.type,created:new Date(C).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:Ae,userId:this.anonId},Rt=G?g(ft,G):ft,Ht={url:Wt(Ve),headers:{"Content-Type":"text/plain"},body:JSON.stringify([Rt])};this.pendingRequest=di(Ht,function(rr){Pe.pendingRequest=null,ne(rr),Pe.saveEventData(),Pe.processRequests(ye)})}},qr.prototype.queueRequest=function(C,G){this.queue.push(C),this.processRequests(G)};var Mr=function(k){function C(){k.call(this,"map.load"),this.success={},this.skuToken=""}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postMapLoadEvent=function(ne,ye,Pe,Ve){this.skuToken=Pe,(we.EVENTS_URL&&Ve||we.ACCESS_TOKEN&&Array.isArray(ne)&&ne.some(function(ft){return Be(ft)||at(ft)}))&&this.queueRequest({id:ye,timestamp:Date.now()},Ve)},C.prototype.processRequests=function(ne){var ye=this;if(!(this.pendingRequest||this.queue.length===0)){var Pe=this.queue.shift(),Ve=Pe.id,ft=Pe.timestamp;Ve&&this.success[Ve]||(this.anonId||this.fetchEventData(),R(this.anonId)||(this.anonId=y()),this.postEvent(ft,{skuToken:this.skuToken},function(Rt){Rt||Ve&&(ye.success[Ve]=!0)},ne))}},C}(qr),Dr=function(k){function C(G){k.call(this,"appUserTurnstile"),this._customAccessToken=G}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postTurnstileEvent=function(ne,ye){we.EVENTS_URL&&we.ACCESS_TOKEN&&Array.isArray(ne)&&ne.some(function(Pe){return Be(Pe)||at(Pe)})&&this.queueRequest(Date.now(),ye)},C.prototype.processRequests=function(ne){var ye=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var Pe=yr(we.ACCESS_TOKEN),Ve=Pe?Pe.u:we.ACCESS_TOKEN,ft=Ve!==this.eventData.tokenU;R(this.anonId)||(this.anonId=y(),ft=!0);var Rt=this.queue.shift();if(this.eventData.lastSuccess){var Ht=new Date(this.eventData.lastSuccess),rr=new Date(Rt),Pr=(Rt-this.eventData.lastSuccess)/(24*60*60*1e3);ft=ft||Pr>=1||Pr<-1||Ht.getDate()!==rr.getDate()}else ft=!0;if(!ft)return this.processRequests();this.postEvent(Rt,{"enabled.telemetry":!1},function(Zr){Zr||(ye.eventData.lastSuccess=Rt,ye.eventData.tokenU=Ve)},ne)}},C}(qr),xt=new Dr,Ne=xt.postTurnstileEvent.bind(xt),Ye=new Mr,be=Ye.postMapLoadEvent.bind(Ye),Ie="mapbox-tiles",qe=500,ke=50,Me=1e3*60*7,Le;function ut(){s.caches&&!Le&&(Le=s.caches.open(Ie))}var lt;function gt(k,C){if(lt===void 0)try{new Response(new ReadableStream),lt=!0}catch{lt=!1}lt?C(k.body):k.blob().then(C)}function kt(k,C,G){if(ut(),!!Le){var ne={status:C.status,statusText:C.statusText,headers:new s.Headers};C.headers.forEach(function(Ve,ft){return ne.headers.set(ft,Ve)});var ye=ce(C.headers.get("Cache-Control")||"");if(!ye["no-store"]){ye["max-age"]&&ne.headers.set("Expires",new Date(G+ye["max-age"]*1e3).toUTCString());var Pe=new Date(ne.headers.get("Expires")).getTime()-G;Pe<Me||gt(C,function(Ve){var ft=new s.Response(Ve,ne);ut(),Le&&Le.then(function(Rt){return Rt.put(nr(k.url),ft)}).catch(function(Rt){return O(Rt.message)})})}}}function nr(k){var C=k.indexOf("?");return C<0?k:k.slice(0,C)}function ir(k,C){if(ut(),!Le)return C(null);var G=nr(k.url);Le.then(function(ne){ne.match(G).then(function(ye){var Pe=tr(ye);ne.delete(G),Pe&&ne.put(G,ye.clone()),C(null,ye,Pe)}).catch(C)}).catch(C)}function tr(k){if(!k)return!1;var C=new Date(k.headers.get("Expires")||0),G=ce(k.headers.get("Cache-Control")||"");return C>Date.now()&&!G["no-cache"]}var Ir=1/0;function vi(k){Ir++,Ir>ke&&(k.getActor().send("enforceCacheSizeLimit",qe),Ir=0)}function Vi(k){ut(),Le&&Le.then(function(C){C.keys().then(function(G){for(var ne=0;ne<G.length-k;ne++)C.delete(G[ne])})})}function Ui(k){var C=s.caches.delete(Ie);k&&C.catch(k).then(function(){return k()})}function Ki(k,C){qe=k,ke=C}var ea;function Bi(){return ea==null&&(ea=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&typeof s.createImageBitmap=="function"),ea}var _a={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(_a);var Ca=function(k){function C(G,ne,ye){ne===401&&at(ye)&&(G+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),k.call(this,G),this.status=ne,this.url=ye,this.name=this.constructor.name,this.message=G}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},C}(Error),Kt=le()?function(){return self.worker&&self.worker.referrer}:function(){return(s.location.protocol==="blob:"?s.parent:s).location.href},zt=function(k){return/^file:/.test(k)||/^file:/.test(Kt())&&!/^\w+:/.test(k)};function Zt(k,C){var G=new s.AbortController,ne=new s.Request(k.url,{method:k.method||"GET",body:k.body,credentials:k.credentials,headers:k.headers,referrer:Kt(),signal:G.signal}),ye=!1,Pe=!1,Ve=$e(ne.url);k.type==="json"&&ne.headers.set("Accept","application/json");var ft=function(Ht,rr,Pr){if(!Pe){if(Ht&&Ht.message!=="SecurityError"&&O(Ht),rr&&Pr)return Rt(rr);var Zr=Date.now();s.fetch(ne).then(function(Hr){if(Hr.ok){var hi=Ve?Hr.clone():null;return Rt(Hr,hi,Zr)}else return C(new Ca(Hr.statusText,Hr.status,k.url))}).catch(function(Hr){Hr.code!==20&&C(new Error(Hr.message))})}},Rt=function(Ht,rr,Pr){(k.type==="arrayBuffer"?Ht.arrayBuffer():k.type==="json"?Ht.json():Ht.text()).then(function(Zr){Pe||(rr&&Pr&&kt(ne,rr,Pr),ye=!0,C(null,Zr,Ht.headers.get("Cache-Control"),Ht.headers.get("Expires")))}).catch(function(Zr){Pe||C(new Error(Zr.message))})};return Ve?ir(ne,ft):ft(null,null),{cancel:function(){Pe=!0,ye||G.abort()}}}function Jt(k,C){var G=new s.XMLHttpRequest;G.open(k.method||"GET",k.url,!0),k.type==="arrayBuffer"&&(G.responseType="arraybuffer");for(var ne in k.headers)G.setRequestHeader(ne,k.headers[ne]);return k.type==="json"&&(G.responseType="text",G.setRequestHeader("Accept","application/json")),G.withCredentials=k.credentials==="include",G.onerror=function(){C(new Error(G.statusText))},G.onload=function(){if((G.status>=200&&G.status<300||G.status===0)&&G.response!==null){var ye=G.response;if(k.type==="json")try{ye=JSON.parse(G.response)}catch(Pe){return C(Pe)}C(null,ye,G.getResponseHeader("Cache-Control"),G.getResponseHeader("Expires"))}else C(new Ca(G.statusText,G.status,k.url))},G.send(k.body),{cancel:function(){return G.abort()}}}var Br=function(k,C){if(!zt(k.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return Zt(k,C);if(le()&&self.worker&&self.worker.actor){var G=!0;return self.worker.actor.send("getResource",k,C,void 0,G)}}return Jt(k,C)},ri=function(k,C){return Br(g(k,{type:"json"}),C)},ii=function(k,C){return Br(g(k,{type:"arrayBuffer"}),C)},di=function(k,C){return Br(g(k,{method:"POST"}),C)};function Wi(k){var C=s.document.createElement("a");return C.href=k,C.protocol===s.document.location.protocol&&C.host===s.document.location.host}var oa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function ra(k,C,G,ne){var ye=new s.Image,Pe=s.URL;ye.onload=function(){C(null,ye),Pe.revokeObjectURL(ye.src),ye.onload=null,s.requestAnimationFrame(function(){ye.src=oa})},ye.onerror=function(){return C(new 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."))};var Ve=new s.Blob([new Uint8Array(k)],{type:"image/png"});ye.cacheControl=G,ye.expires=ne,ye.src=k.byteLength?Pe.createObjectURL(Ve):oa}function ca(k,C){var G=new s.Blob([new Uint8Array(k)],{type:"image/png"});s.createImageBitmap(G).then(function(ne){C(null,ne)}).catch(function(ne){C(new Error("Could not load image because of "+ne.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var xa,ji,pn=function(){xa=[],ji=0};pn();var _n=function(k,C){if(Re.supported&&(k.headers||(k.headers={}),k.headers.accept="image/webp,*/*"),ji>=we.MAX_PARALLEL_IMAGE_REQUESTS){var G={requestParameters:k,callback:C,cancelled:!1,cancel:function(){this.cancelled=!0}};return xa.push(G),G}ji++;var ne=!1,ye=function(){if(!ne)for(ne=!0,ji--;xa.length&&ji<we.MAX_PARALLEL_IMAGE_REQUESTS;){var Ve=xa.shift(),ft=Ve.requestParameters,Rt=Ve.callback,Ht=Ve.cancelled;Ht||(Ve.cancel=_n(ft,Rt).cancel)}},Pe=ii(k,function(Ve,ft,Rt,Ht){ye(),Ve?C(Ve):ft&&(Bi()?ca(ft,C):ra(ft,C,Rt,Ht))});return{cancel:function(){Pe.cancel(),ye()}}},En=function(k,C){var G=s.document.createElement("video");G.muted=!0,G.onloadstart=function(){C(null,G)};for(var ne=0;ne<k.length;ne++){var ye=s.document.createElement("source");Wi(k[ne])||(G.crossOrigin="Anonymous"),ye.src=k[ne],G.appendChild(ye)}return{cancel:function(){}}};function bt(k,C,G){var ne=G[k]&&G[k].indexOf(C)!==-1;ne||(G[k]=G[k]||[],G[k].push(C))}function st(k,C,G){if(G&&G[k]){var ne=G[k].indexOf(C);ne!==-1&&G[k].splice(ne,1)}}var Nr=function(C,G){G===void 0&&(G={}),g(this,G),this.type=C},Lr=function(k){function C(G,ne){ne===void 0&&(ne={}),k.call(this,"error",g({error:G},ne))}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C}(Nr),br=function(){};br.prototype.on=function(C,G){return this._listeners=this._listeners||{},bt(C,G,this._listeners),this},br.prototype.off=function(C,G){return st(C,G,this._listeners),st(C,G,this._oneTimeListeners),this},br.prototype.once=function(C,G){return this._oneTimeListeners=this._oneTimeListeners||{},bt(C,G,this._oneTimeListeners),this},br.prototype.fire=function(C,G){typeof C=="string"&&(C=new Nr(C,G||{}));var ne=C.type;if(this.listens(ne)){C.target=this;for(var ye=this._listeners&&this._listeners[ne]?this._listeners[ne].slice():[],Pe=0,Ve=ye;Pe<Ve.length;Pe+=1){var ft=Ve[Pe];ft.call(this,C)}for(var Rt=this._oneTimeListeners&&this._oneTimeListeners[ne]?this._oneTimeListeners[ne].slice():[],Ht=0,rr=Rt;Ht<rr.length;Ht+=1){var Pr=rr[Ht];st(ne,Pr,this._oneTimeListeners),Pr.call(this,C)}var Zr=this._eventedParent;Zr&&(g(C,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),Zr.fire(C))}else C instanceof Lr&&console.error(C.error);return this},br.prototype.listens=function(C){return this._listeners&&this._listeners[C]&&this._listeners[C].length>0||this._oneTimeListeners&&this._oneTimeListeners[C]&&this._oneTimeListeners[C].length>0||this._eventedParent&&this._eventedParent.listens(C)},br.prototype.setEventedParent=function(C,G){return this._eventedParent=C,this._eventedParentData=G,this};var Rr=8,jr={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},Wr={"*":{type:"source"}},yt=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Xt={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},"*":{type:"*"}},mr={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:"*"}},Or={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:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},ki={type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},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"}},Ni={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"}}},Si={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"}}},fi={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},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"}},Li=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],Ia={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Fa={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},un={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Bn={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Kn={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"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"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Gn={"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"],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:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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:{},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-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"],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"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},eo={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ao={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},An={type:"array",value:"*"},Eo={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},fs={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},Ls={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},ns={type:"array",value:"*",minimum:1},uo={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}},ss=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],xs={"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-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],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"}},el={"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-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"]},"property-type":"cross-faded"},"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"}},Ss={"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"}},Co={"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"}},ao={"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"}},co={"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"},"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"}},Ms={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,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:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",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"}},Gs={"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"}},ul={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},hs={"*":{type:"string"}},rn={$version:Rr,$root:jr,sources:Wr,source:yt,source_vector:Xt,source_raster:mr,source_raster_dem:Or,source_geojson:ki,source_video:Ni,source_image:Si,layer:fi,layout:Li,layout_background:Ia,layout_fill:Fa,layout_circle:un,layout_heatmap:Bn,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Kn,layout_symbol:Gn,layout_raster:eo,layout_hillshade:Ao,filter:An,filter_operator:Eo,geometry_type:fs,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:Ls,expression:ns,light:uo,paint:ss,paint_fill:xs,"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:el,paint_circle:Ss,paint_heatmap:Co,paint_symbol:ao,paint_raster:co,paint_hillshade:Ms,paint_background:Gs,transition:ul,"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:hs},Xn=function(C,G,ne,ye){this.message=(C?C+": ":"")+ne,ye&&(this.identifier=ye),G!=null&&G.__line__&&(this.line=G.__line__)};function tl(k){var C=k.key,G=k.value;return G?[new Xn(C,G,"constants have been deprecated as of v8")]:[]}function zs(k){for(var C=[],G=arguments.length-1;G-- >0;)C[G]=arguments[G+1];for(var ne=0,ye=C;ne<ye.length;ne+=1){var Pe=ye[ne];for(var Ve in Pe)k[Ve]=Pe[Ve]}return k}function so(k){return k instanceof Number||k instanceof String||k instanceof Boolean?k.valueOf():k}function $s(k){if(Array.isArray(k))return k.map($s);if(k instanceof Object&&!(k instanceof Number||k instanceof String||k instanceof Boolean)){var C={};for(var G in k)C[G]=$s(k[G]);return C}return so(k)}var Ps=function(k){function C(G,ne){k.call(this,ne),this.message=ne,this.key=G}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C}(Error),nl=function(C,G){G===void 0&&(G=[]),this.parent=C,this.bindings={};for(var ne=0,ye=G;ne<ye.length;ne+=1){var Pe=ye[ne],Ve=Pe[0],ft=Pe[1];this.bindings[Ve]=ft}};nl.prototype.concat=function(C){return new nl(this,C)},nl.prototype.get=function(C){if(this.bindings[C])return this.bindings[C];if(this.parent)return this.parent.get(C);throw new Error(C+" not found in scope.")},nl.prototype.has=function(C){return this.bindings[C]?!0:this.parent?this.parent.has(C):!1};var yl={kind:"null"},On={kind:"number"},Ko={kind:"string"},jo={kind:"boolean"},Ys={kind:"color"},Tu={kind:"object"},Lo={kind:"value"},al={kind:"error"},kl={kind:"collator"},Ns={kind:"formatted"},rl={kind:"resolvedImage"};function Es(k,C){return{kind:"array",itemType:k,N:C}}function Us(k){if(k.kind==="array"){var C=Us(k.itemType);return typeof k.N=="number"?"array<"+C+", "+k.N+">":k.itemType.kind==="value"?"array":"array<"+C+">"}else return k.kind}var Zl=[yl,On,Ko,jo,Ys,Ns,Tu,Es(Lo),rl];function pu(k,C){if(C.kind==="error")return null;if(k.kind==="array"){if(C.kind==="array"&&(C.N===0&&C.itemType.kind==="value"||!pu(k.itemType,C.itemType))&&(typeof k.N!="number"||k.N===C.N))return null}else{if(k.kind===C.kind)return null;if(k.kind==="value")for(var G=0,ne=Zl;G<ne.length;G+=1){var ye=ne[G];if(!pu(ye,C))return null}}return"Expected "+Us(k)+" but found "+Us(C)+" instead."}function kc(k,C){return C.some(function(G){return G.kind===k.kind})}function Au(k,C){return C.some(function(G){return G==="null"?k===null:G==="array"?Array.isArray(k):G==="object"?k&&!Array.isArray(k)&&typeof k=="object":G===typeof k})}var Sf=t(function(k,C){var G={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function ne(Ht){return Ht=Math.round(Ht),Ht<0?0:Ht>255?255:Ht}function ye(Ht){return Ht<0?0:Ht>1?1:Ht}function Pe(Ht){return Ht[Ht.length-1]==="%"?ne(parseFloat(Ht)/100*255):ne(parseInt(Ht))}function Ve(Ht){return Ht[Ht.length-1]==="%"?ye(parseFloat(Ht)/100):ye(parseFloat(Ht))}function ft(Ht,rr,Pr){return Pr<0?Pr+=1:Pr>1&&(Pr-=1),Pr*6<1?Ht+(rr-Ht)*Pr*6:Pr*2<1?rr:Pr*3<2?Ht+(rr-Ht)*(2/3-Pr)*6:Ht}function Rt(Ht){var rr=Ht.replace(/ /g,"").toLowerCase();if(rr in G)return G[rr].slice();if(rr[0]==="#"){if(rr.length===4){var Pr=parseInt(rr.substr(1),16);return Pr>=0&&Pr<=4095?[(Pr&3840)>>4|(Pr&3840)>>8,Pr&240|(Pr&240)>>4,Pr&15|(Pr&15)<<4,1]:null}else if(rr.length===7){var Pr=parseInt(rr.substr(1),16);return Pr>=0&&Pr<=16777215?[(Pr&16711680)>>16,(Pr&65280)>>8,Pr&255,1]:null}return null}var Zr=rr.indexOf("("),Hr=rr.indexOf(")");if(Zr!==-1&&Hr+1===rr.length){var hi=rr.substr(0,Zr),Gi=rr.substr(Zr+1,Hr-(Zr+1)).split(","),Ra=1;switch(hi){case"rgba":if(Gi.length!==4)return null;Ra=Ve(Gi.pop());case"rgb":return Gi.length!==3?null:[Pe(Gi[0]),Pe(Gi[1]),Pe(Gi[2]),Ra];case"hsla":if(Gi.length!==4)return null;Ra=Ve(Gi.pop());case"hsl":if(Gi.length!==3)return null;var ha=(parseFloat(Gi[0])%360+360)%360/360,fn=Ve(Gi[1]),Wa=Ve(Gi[2]),cn=Wa<=.5?Wa*(fn+1):Wa+fn-Wa*fn,bn=Wa*2-cn;return[ne(ft(bn,cn,ha+1/3)*255),ne(ft(bn,cn,ha)*255),ne(ft(bn,cn,ha-1/3)*255),Ra];default:return null}}return null}try{C.parseCSSColor=Rt}catch{}}),Gc=Sf.parseCSSColor,Js=function(C,G,ne,ye){ye===void 0&&(ye=1),this.r=C,this.g=G,this.b=ne,this.a=ye};Js.parse=function(C){if(C){if(C instanceof Js)return C;if(typeof C=="string"){var G=Gc(C);if(G)return new Js(G[0]/255*G[3],G[1]/255*G[3],G[2]/255*G[3],G[3])}}},Js.prototype.toString=function(){var C=this.toArray(),G=C[0],ne=C[1],ye=C[2],Pe=C[3];return"rgba("+Math.round(G)+","+Math.round(ne)+","+Math.round(ye)+","+Pe+")"},Js.prototype.toArray=function(){var C=this,G=C.r,ne=C.g,ye=C.b,Pe=C.a;return Pe===0?[0,0,0,0]:[G*255/Pe,ne*255/Pe,ye*255/Pe,Pe]},Js.black=new Js(0,0,0,1),Js.white=new Js(1,1,1,1),Js.transparent=new Js(0,0,0,0),Js.red=new Js(1,0,0,1);var yc=function(C,G,ne){C?this.sensitivity=G?"variant":"case":this.sensitivity=G?"accent":"base",this.locale=ne,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};yc.prototype.compare=function(C,G){return this.collator.compare(C,G)},yc.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Zc=function(C,G,ne,ye,Pe){this.text=C,this.image=G,this.scale=ne,this.fontStack=ye,this.textColor=Pe},mu=function(C){this.sections=C};mu.fromString=function(C){return new mu([new Zc(C,null,null,null,null)])},mu.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(C){return C.text.length!==0||C.image&&C.image.name.length!==0})},mu.factory=function(C){return C instanceof mu?C:mu.fromString(C)},mu.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(C){return C.text}).join("")},mu.prototype.serialize=function(){for(var C=["format"],G=0,ne=this.sections;G<ne.length;G+=1){var ye=ne[G];if(ye.image){C.push(["image",ye.image.name]);continue}C.push(ye.text);var Pe={};ye.fontStack&&(Pe["text-font"]=["literal",ye.fontStack.split(",")]),ye.scale&&(Pe["font-scale"]=ye.scale),ye.textColor&&(Pe["text-color"]=["rgba"].concat(ye.textColor.toArray())),C.push(Pe)}return C};var Vl=function(C){this.name=C.name,this.available=C.available};Vl.prototype.toString=function(){return this.name},Vl.fromString=function(C){return C?new Vl({name:C,available:!1}):null},Vl.prototype.serialize=function(){return["image",this.name]};function lc(k,C,G,ne){if(!(typeof k=="number"&&k>=0&&k<=255&&typeof C=="number"&&C>=0&&C<=255&&typeof G=="number"&&G>=0&&G<=255)){var ye=typeof ne=="number"?[k,C,G,ne]:[k,C,G];return"Invalid rgba value ["+ye.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof ne>"u"||typeof ne=="number"&&ne>=0&&ne<=1?null:"Invalid rgba value ["+[k,C,G,ne].join(", ")+"]: 'a' must be between 0 and 1."}function Gu(k){if(k===null)return!0;if(typeof k=="string")return!0;if(typeof k=="boolean")return!0;if(typeof k=="number")return!0;if(k instanceof Js)return!0;if(k instanceof yc)return!0;if(k instanceof mu)return!0;if(k instanceof Vl)return!0;if(Array.isArray(k)){for(var C=0,G=k;C<G.length;C+=1){var ne=G[C];if(!Gu(ne))return!1}return!0}else if(typeof k=="object"){for(var ye in k)if(!Gu(k[ye]))return!1;return!0}else return!1}function _l(k){if(k===null)return yl;if(typeof k=="string")return Ko;if(typeof k=="boolean")return jo;if(typeof k=="number")return On;if(k instanceof Js)return Ys;if(k instanceof yc)return kl;if(k instanceof mu)return Ns;if(k instanceof Vl)return rl;if(Array.isArray(k)){for(var C=k.length,G,ne=0,ye=k;ne<ye.length;ne+=1){var Pe=ye[ne],Ve=_l(Pe);if(!G)G=Ve;else{if(G===Ve)continue;G=Lo;break}}return Es(G||Lo,C)}else return Tu}function Cl(k){var C=typeof k;return k===null?"":C==="string"||C==="number"||C==="boolean"?String(k):k instanceof Js||k instanceof mu||k instanceof Vl?k.toString():JSON.stringify(k)}var Fs=function(C,G){this.type=C,this.value=G};Fs.parse=function(C,G){if(C.length!==2)return G.error("'literal' expression requires exactly one argument, but found "+(C.length-1)+" instead.");if(!Gu(C[1]))return G.error("invalid value");var ne=C[1],ye=_l(ne),Pe=G.expectedType;return ye.kind==="array"&&ye.N===0&&Pe&&Pe.kind==="array"&&(typeof Pe.N!="number"||Pe.N===0)&&(ye=Pe),new Fs(ye,ne)},Fs.prototype.evaluate=function(){return this.value},Fs.prototype.eachChild=function(){},Fs.prototype.outputDefined=function(){return!0},Fs.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Js?["rgba"].concat(this.value.toArray()):this.value instanceof mu?this.value.serialize():this.value};var ol=function(C){this.name="ExpressionEvaluationError",this.message=C};ol.prototype.toJSON=function(){return this.message};var uc={string:Ko,number:On,boolean:jo,object:Tu},Kl=function(C,G){this.type=C,this.args=G};Kl.parse=function(C,G){if(C.length<2)return G.error("Expected at least one argument.");var ne=1,ye,Pe=C[0];if(Pe==="array"){var Ve;if(C.length>2){var ft=C[1];if(typeof ft!="string"||!(ft in uc)||ft==="object")return G.error('The item type argument of "array" must be one of string, number, boolean',1);Ve=uc[ft],ne++}else Ve=Lo;var Rt;if(C.length>3){if(C[2]!==null&&(typeof C[2]!="number"||C[2]<0||C[2]!==Math.floor(C[2])))return G.error('The length argument to "array" must be a positive integer literal',2);Rt=C[2],ne++}ye=Es(Ve,Rt)}else ye=uc[Pe];for(var Ht=[];ne<C.length;ne++){var rr=G.parse(C[ne],ne,Lo);if(!rr)return null;Ht.push(rr)}return new Kl(ye,Ht)},Kl.prototype.evaluate=function(C){for(var G=0;G<this.args.length;G++){var ne=this.args[G].evaluate(C),ye=pu(this.type,_l(ne));if(ye){if(G===this.args.length-1)throw new ol("Expected value to be of type "+Us(this.type)+", but found "+Us(_l(ne))+" instead.")}else return ne}return null},Kl.prototype.eachChild=function(C){this.args.forEach(C)},Kl.prototype.outputDefined=function(){return this.args.every(function(C){return C.outputDefined()})},Kl.prototype.serialize=function(){var C=this.type,G=[C.kind];if(C.kind==="array"){var ne=C.itemType;if(ne.kind==="string"||ne.kind==="number"||ne.kind==="boolean"){G.push(ne.kind);var ye=C.N;(typeof ye=="number"||this.args.length>1)&&G.push(ye)}}return G.concat(this.args.map(function(Pe){return Pe.serialize()}))};var Zu=function(C){this.type=Ns,this.sections=C};Zu.parse=function(C,G){if(C.length<2)return G.error("Expected at least one argument.");var ne=C[1];if(!Array.isArray(ne)&&typeof ne=="object")return G.error("First argument must be an image or text section.");for(var ye=[],Pe=!1,Ve=1;Ve<=C.length-1;++Ve){var ft=C[Ve];if(Pe&&typeof ft=="object"&&!Array.isArray(ft)){Pe=!1;var Rt=null;if(ft["font-scale"]&&(Rt=G.parse(ft["font-scale"],1,On),!Rt))return null;var Ht=null;if(ft["text-font"]&&(Ht=G.parse(ft["text-font"],1,Es(Ko)),!Ht))return null;var rr=null;if(ft["text-color"]&&(rr=G.parse(ft["text-color"],1,Ys),!rr))return null;var Pr=ye[ye.length-1];Pr.scale=Rt,Pr.font=Ht,Pr.textColor=rr}else{var Zr=G.parse(C[Ve],1,Lo);if(!Zr)return null;var Hr=Zr.type.kind;if(Hr!=="string"&&Hr!=="value"&&Hr!=="null"&&Hr!=="resolvedImage")return G.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Pe=!0,ye.push({content:Zr,scale:null,font:null,textColor:null})}}return new Zu(ye)},Zu.prototype.evaluate=function(C){var G=function(ne){var ye=ne.content.evaluate(C);return _l(ye)===rl?new Zc("",ye,null,null,null):new Zc(Cl(ye),null,ne.scale?ne.scale.evaluate(C):null,ne.font?ne.font.evaluate(C).join(","):null,ne.textColor?ne.textColor.evaluate(C):null)};return new mu(this.sections.map(G))},Zu.prototype.eachChild=function(C){for(var G=0,ne=this.sections;G<ne.length;G+=1){var ye=ne[G];C(ye.content),ye.scale&&C(ye.scale),ye.font&&C(ye.font),ye.textColor&&C(ye.textColor)}},Zu.prototype.outputDefined=function(){return!1},Zu.prototype.serialize=function(){for(var C=["format"],G=0,ne=this.sections;G<ne.length;G+=1){var ye=ne[G];C.push(ye.content.serialize());var Pe={};ye.scale&&(Pe["font-scale"]=ye.scale.serialize()),ye.font&&(Pe["text-font"]=ye.font.serialize()),ye.textColor&&(Pe["text-color"]=ye.textColor.serialize()),C.push(Pe)}return C};var Sl=function(C){this.type=rl,this.input=C};Sl.parse=function(C,G){if(C.length!==2)return G.error("Expected two arguments.");var ne=G.parse(C[1],1,Ko);return ne?new Sl(ne):G.error("No image name provided.")},Sl.prototype.evaluate=function(C){var G=this.input.evaluate(C),ne=Vl.fromString(G);return ne&&C.availableImages&&(ne.available=C.availableImages.indexOf(G)>-1),ne},Sl.prototype.eachChild=function(C){C(this.input)},Sl.prototype.outputDefined=function(){return!1},Sl.prototype.serialize=function(){return["image",this.input.serialize()]};var vh={"to-boolean":jo,"to-color":Ys,"to-number":On,"to-string":Ko},ws=function(C,G){this.type=C,this.args=G};ws.parse=function(C,G){if(C.length<2)return G.error("Expected at least one argument.");var ne=C[0];if((ne==="to-boolean"||ne==="to-string")&&C.length!==2)return G.error("Expected one argument.");for(var ye=vh[ne],Pe=[],Ve=1;Ve<C.length;Ve++){var ft=G.parse(C[Ve],Ve,Lo);if(!ft)return null;Pe.push(ft)}return new ws(ye,Pe)},ws.prototype.evaluate=function(C){if(this.type.kind==="boolean")return!!this.args[0].evaluate(C);if(this.type.kind==="color"){for(var G,ne,ye=0,Pe=this.args;ye<Pe.length;ye+=1){var Ve=Pe[ye];if(G=Ve.evaluate(C),ne=null,G instanceof Js)return G;if(typeof G=="string"){var ft=C.parseColor(G);if(ft)return ft}else if(Array.isArray(G)&&(G.length<3||G.length>4?ne="Invalid rbga value "+JSON.stringify(G)+": expected an array containing either three or four numeric values.":ne=lc(G[0],G[1],G[2],G[3]),!ne))return new Js(G[0]/255,G[1]/255,G[2]/255,G[3])}throw new ol(ne||"Could not parse color from value '"+(typeof G=="string"?G:String(JSON.stringify(G)))+"'")}else if(this.type.kind==="number"){for(var Rt=null,Ht=0,rr=this.args;Ht<rr.length;Ht+=1){var Pr=rr[Ht];if(Rt=Pr.evaluate(C),Rt===null)return 0;var Zr=Number(Rt);if(!isNaN(Zr))return Zr}throw new ol("Could not convert "+JSON.stringify(Rt)+" to number.")}else return this.type.kind==="formatted"?mu.fromString(Cl(this.args[0].evaluate(C))):this.type.kind==="resolvedImage"?Vl.fromString(Cl(this.args[0].evaluate(C))):Cl(this.args[0].evaluate(C))},ws.prototype.eachChild=function(C){this.args.forEach(C)},ws.prototype.outputDefined=function(){return this.args.every(function(C){return C.outputDefined()})},ws.prototype.serialize=function(){if(this.type.kind==="formatted")return new Zu([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Sl(this.args[0]).serialize();var C=["to-"+this.type.kind];return this.eachChild(function(G){C.push(G.serialize())}),C};var ph=["Unknown","Point","LineString","Polygon"],qs=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};qs.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},qs.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?ph[this.feature.type]:this.feature.type:null},qs.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},qs.prototype.canonicalID=function(){return this.canonical},qs.prototype.properties=function(){return this.feature&&this.feature.properties||{}},qs.prototype.parseColor=function(C){var G=this._parseColorCache[C];return G||(G=this._parseColorCache[C]=Js.parse(C)),G};var xo=function(C,G,ne,ye){this.name=C,this.type=G,this._evaluate=ne,this.args=ye};xo.prototype.evaluate=function(C){return this._evaluate(C,this.args)},xo.prototype.eachChild=function(C){this.args.forEach(C)},xo.prototype.outputDefined=function(){return!1},xo.prototype.serialize=function(){return[this.name].concat(this.args.map(function(C){return C.serialize()}))},xo.parse=function(C,G){var ne,ye=C[0],Pe=xo.definitions[ye];if(!Pe)return G.error('Unknown expression "'+ye+'". If you wanted a literal array, use ["literal", [...]].',0);for(var Ve=Array.isArray(Pe)?Pe[0]:Pe.type,ft=Array.isArray(Pe)?[[Pe[1],Pe[2]]]:Pe.overloads,Rt=ft.filter(function(Wo){var Qo=Wo[0];return!Array.isArray(Qo)||Qo.length===C.length-1}),Ht=null,rr=0,Pr=Rt;rr<Pr.length;rr+=1){var Zr=Pr[rr],Hr=Zr[0],hi=Zr[1];Ht=new xl(G.registry,G.path,null,G.scope);for(var Gi=[],Ra=!1,ha=1;ha<C.length;ha++){var fn=C[ha],Wa=Array.isArray(Hr)?Hr[ha-1]:Hr.type,cn=Ht.parse(fn,1+Gi.length,Wa);if(!cn){Ra=!0;break}Gi.push(cn)}if(!Ra){if(Array.isArray(Hr)&&Hr.length!==Gi.length){Ht.error("Expected "+Hr.length+" arguments, but found "+Gi.length+" instead.");continue}for(var bn=0;bn<Gi.length;bn++){var Un=Array.isArray(Hr)?Hr[bn]:Hr.type,oo=Gi[bn];Ht.concat(bn+1).checkSubtype(Un,oo.type)}if(Ht.errors.length===0)return new xo(ye,Ve,hi,Gi)}}if(Rt.length===1)(ne=G.errors).push.apply(ne,Ht.errors);else{for(var ro=Rt.length?Rt:ft,Go=ro.map(function(Wo){var Qo=Wo[0];return Kc(Qo)}).join(" | "),So=[],Bo=1;Bo<C.length;Bo++){var Hs=G.parse(C[Bo],1+So.length);if(!Hs)return null;So.push(Us(Hs.type))}G.error("Expected arguments of type "+Go+", but found ("+So.join(", ")+") instead.")}return null},xo.register=function(C,G){xo.definitions=G;for(var ne in G)C[ne]=xo};function Kc(k){return Array.isArray(k)?"("+k.map(Us).join(", ")+")":"("+Us(k.type)+"...)"}var Ku=function(C,G,ne){this.type=kl,this.locale=ne,this.caseSensitive=C,this.diacriticSensitive=G};Ku.parse=function(C,G){if(C.length!==2)return G.error("Expected one argument.");var ne=C[1];if(typeof ne!="object"||Array.isArray(ne))return G.error("Collator options argument must be an object.");var ye=G.parse(ne["case-sensitive"]===void 0?!1:ne["case-sensitive"],1,jo);if(!ye)return null;var Pe=G.parse(ne["diacritic-sensitive"]===void 0?!1:ne["diacritic-sensitive"],1,jo);if(!Pe)return null;var Ve=null;return ne.locale&&(Ve=G.parse(ne.locale,1,Ko),!Ve)?null:new Ku(ye,Pe,Ve)},Ku.prototype.evaluate=function(C){return new yc(this.caseSensitive.evaluate(C),this.diacriticSensitive.evaluate(C),this.locale?this.locale.evaluate(C):null)},Ku.prototype.eachChild=function(C){C(this.caseSensitive),C(this.diacriticSensitive),this.locale&&C(this.locale)},Ku.prototype.outputDefined=function(){return!1},Ku.prototype.serialize=function(){var C={};return C["case-sensitive"]=this.caseSensitive.serialize(),C["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(C.locale=this.locale.serialize()),["collator",C]};var $l=8192;function Mf(k,C){k[0]=Math.min(k[0],C[0]),k[1]=Math.min(k[1],C[1]),k[2]=Math.max(k[2],C[0]),k[3]=Math.max(k[3],C[1])}function Cc(k){return(180+k)/360}function uf(k){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+k*Math.PI/360)))/360}function su(k,C){return!(k[0]<=C[0]||k[2]>=C[2]||k[1]<=C[1]||k[3]>=C[3])}function Wf(k,C){var G=Cc(k[0]),ne=uf(k[1]),ye=Math.pow(2,C.z);return[Math.round(G*ye*$l),Math.round(ne*ye*$l)]}function Rf(k,C,G){var ne=k[0]-C[0],ye=k[1]-C[1],Pe=k[0]-G[0],Ve=k[1]-G[1];return ne*Ve-Pe*ye===0&&ne*Pe<=0&&ye*Ve<=0}function cf(k,C,G){return C[1]>k[1]!=G[1]>k[1]&&k[0]<(G[0]-C[0])*(k[1]-C[1])/(G[1]-C[1])+C[0]}function Wc(k,C){for(var G=!1,ne=0,ye=C.length;ne<ye;ne++)for(var Pe=C[ne],Ve=0,ft=Pe.length;Ve<ft-1;Ve++){if(Rf(k,Pe[Ve],Pe[Ve+1]))return!1;cf(k,Pe[Ve],Pe[Ve+1])&&(G=!G)}return G}function Df(k,C){for(var G=0;G<C.length;G++)if(Wc(k,C[G]))return!0;return!1}function zf(k,C){return k[0]*C[1]-k[1]*C[0]}function $u(k,C,G,ne){var ye=k[0]-G[0],Pe=k[1]-G[1],Ve=C[0]-G[0],ft=C[1]-G[1],Rt=ne[0]-G[0],Ht=ne[1]-G[1],rr=ye*Ht-Rt*Pe,Pr=Ve*Ht-Rt*ft;return rr>0&&Pr<0||rr<0&&Pr>0}function Ef(k,C,G,ne){var ye=[C[0]-k[0],C[1]-k[1]],Pe=[ne[0]-G[0],ne[1]-G[1]];return zf(Pe,ye)===0?!1:!!($u(k,C,G,ne)&&$u(G,ne,k,C))}function cc(k,C,G){for(var ne=0,ye=G;ne<ye.length;ne+=1)for(var Pe=ye[ne],Ve=0;Ve<Pe.length-1;++Ve)if(Ef(k,C,Pe[Ve],Pe[Ve+1]))return!0;return!1}function $c(k,C){for(var G=0;G<k.length;++G)if(!Wc(k[G],C))return!1;for(var ne=0;ne<k.length-1;++ne)if(cc(k[ne],k[ne+1],C))return!1;return!0}function lu(k,C){for(var G=0;G<C.length;G++)if($c(k,C[G]))return!0;return!1}function Xc(k,C,G){for(var ne=[],ye=0;ye<k.length;ye++){for(var Pe=[],Ve=0;Ve<k[ye].length;Ve++){var ft=Wf(k[ye][Ve],G);Mf(C,ft),Pe.push(ft)}ne.push(Pe)}return ne}function Lc(k,C,G){for(var ne=[],ye=0;ye<k.length;ye++){var Pe=Xc(k[ye],C,G);ne.push(Pe)}return ne}function sl(k,C,G,ne){if(k[0]<G[0]||k[0]>G[2]){var ye=ne*.5,Pe=k[0]-G[0]>ye?-ne:G[0]-k[0]>ye?ne:0;Pe===0&&(Pe=k[0]-G[2]>ye?-ne:G[2]-k[0]>ye?ne:0),k[0]+=Pe}Mf(C,k)}function kf(k){k[0]=k[1]=1/0,k[2]=k[3]=-1/0}function ah(k,C,G,ne){for(var ye=Math.pow(2,ne.z)*$l,Pe=[ne.x*$l,ne.y*$l],Ve=[],ft=0,Rt=k;ft<Rt.length;ft+=1)for(var Ht=Rt[ft],rr=0,Pr=Ht;rr<Pr.length;rr+=1){var Zr=Pr[rr],Hr=[Zr.x+Pe[0],Zr.y+Pe[1]];sl(Hr,C,G,ye),Ve.push(Hr)}return Ve}function Ff(k,C,G,ne){for(var ye=Math.pow(2,ne.z)*$l,Pe=[ne.x*$l,ne.y*$l],Ve=[],ft=0,Rt=k;ft<Rt.length;ft+=1){for(var Ht=Rt[ft],rr=[],Pr=0,Zr=Ht;Pr<Zr.length;Pr+=1){var Hr=Zr[Pr],hi=[Hr.x+Pe[0],Hr.y+Pe[1]];Mf(C,hi),rr.push(hi)}Ve.push(rr)}if(C[2]-C[0]<=ye/2){kf(C);for(var Gi=0,Ra=Ve;Gi<Ra.length;Gi+=1)for(var ha=Ra[Gi],fn=0,Wa=ha;fn<Wa.length;fn+=1){var cn=Wa[fn];sl(cn,C,G,ye)}}return Ve}function Jc(k,C){var G=[1/0,1/0,-1/0,-1/0],ne=[1/0,1/0,-1/0,-1/0],ye=k.canonicalID();if(C.type==="Polygon"){var Pe=Xc(C.coordinates,ne,ye),Ve=ah(k.geometry(),G,ne,ye);if(!su(G,ne))return!1;for(var ft=0,Rt=Ve;ft<Rt.length;ft+=1){var Ht=Rt[ft];if(!Wc(Ht,Pe))return!1}}if(C.type==="MultiPolygon"){var rr=Lc(C.coordinates,ne,ye),Pr=ah(k.geometry(),G,ne,ye);if(!su(G,ne))return!1;for(var Zr=0,Hr=Pr;Zr<Hr.length;Zr+=1){var hi=Hr[Zr];if(!Df(hi,rr))return!1}}return!0}function Xf(k,C){var G=[1/0,1/0,-1/0,-1/0],ne=[1/0,1/0,-1/0,-1/0],ye=k.canonicalID();if(C.type==="Polygon"){var Pe=Xc(C.coordinates,ne,ye),Ve=Ff(k.geometry(),G,ne,ye);if(!su(G,ne))return!1;for(var ft=0,Rt=Ve;ft<Rt.length;ft+=1){var Ht=Rt[ft];if(!$c(Ht,Pe))return!1}}if(C.type==="MultiPolygon"){var rr=Lc(C.coordinates,ne,ye),Pr=Ff(k.geometry(),G,ne,ye);if(!su(G,ne))return!1;for(var Zr=0,Hr=Pr;Zr<Hr.length;Zr+=1){var hi=Hr[Zr];if(!lu(hi,rr))return!1}}return!0}var Fu=function(C,G){this.type=jo,this.geojson=C,this.geometries=G};Fu.parse=function(C,G){if(C.length!==2)return G.error("'within' expression requires exactly one argument, but found "+(C.length-1)+" instead.");if(Gu(C[1])){var ne=C[1];if(ne.type==="FeatureCollection")for(var ye=0;ye<ne.features.length;++ye){var Pe=ne.features[ye].geometry.type;if(Pe==="Polygon"||Pe==="MultiPolygon")return new Fu(ne,ne.features[ye].geometry)}else if(ne.type==="Feature"){var Ve=ne.geometry.type;if(Ve==="Polygon"||Ve==="MultiPolygon")return new Fu(ne,ne.geometry)}else if(ne.type==="Polygon"||ne.type==="MultiPolygon")return new Fu(ne,ne)}return G.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Fu.prototype.evaluate=function(C){if(C.geometry()!=null&&C.canonicalID()!=null){if(C.geometryType()==="Point")return Jc(C,this.geometries);if(C.geometryType()==="LineString")return Xf(C,this.geometries)}return!1},Fu.prototype.eachChild=function(){},Fu.prototype.outputDefined=function(){return!0},Fu.prototype.serialize=function(){return["within",this.geojson]};function Bf(k){if(k instanceof xo){if(k.name==="get"&&k.args.length===1)return!1;if(k.name==="feature-state")return!1;if(k.name==="has"&&k.args.length===1)return!1;if(k.name==="properties"||k.name==="geometry-type"||k.name==="id")return!1;if(/^filter-/.test(k.name))return!1}if(k instanceof Fu)return!1;var C=!0;return k.eachChild(function(G){C&&!Bf(G)&&(C=!1)}),C}function Ll(k){if(k instanceof xo&&k.name==="feature-state")return!1;var C=!0;return k.eachChild(function(G){C&&!Ll(G)&&(C=!1)}),C}function Bu(k,C){if(k instanceof xo&&C.indexOf(k.name)>=0)return!1;var G=!0;return k.eachChild(function(ne){G&&!Bu(ne,C)&&(G=!1)}),G}var Ic=function(C,G){this.type=G.type,this.name=C,this.boundExpression=G};Ic.parse=function(C,G){if(C.length!==2||typeof C[1]!="string")return G.error("'var' expression requires exactly one string literal argument.");var ne=C[1];return G.scope.has(ne)?new Ic(ne,G.scope.get(ne)):G.error('Unknown variable "'+ne+'". Make sure "'+ne+'" has been bound in an enclosing "let" expression before using it.',1)},Ic.prototype.evaluate=function(C){return this.boundExpression.evaluate(C)},Ic.prototype.eachChild=function(){},Ic.prototype.outputDefined=function(){return!1},Ic.prototype.serialize=function(){return["var",this.name]};var xl=function(C,G,ne,ye,Pe){G===void 0&&(G=[]),ye===void 0&&(ye=new nl),Pe===void 0&&(Pe=[]),this.registry=C,this.path=G,this.key=G.map(function(Ve){return"["+Ve+"]"}).join(""),this.scope=ye,this.errors=Pe,this.expectedType=ne};xl.prototype.parse=function(C,G,ne,ye,Pe){return Pe===void 0&&(Pe={}),G?this.concat(G,ne,ye)._parse(C,Pe):this._parse(C,Pe)},xl.prototype._parse=function(C,G){(C===null||typeof C=="string"||typeof C=="boolean"||typeof C=="number")&&(C=["literal",C]);function ne(rr,Pr,Zr){return Zr==="assert"?new Kl(Pr,[rr]):Zr==="coerce"?new ws(Pr,[rr]):rr}if(Array.isArray(C)){if(C.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var ye=C[0];if(typeof ye!="string")return this.error("Expression name must be a string, but found "+typeof ye+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var Pe=this.registry[ye];if(Pe){var Ve=Pe.parse(C,this);if(!Ve)return null;if(this.expectedType){var ft=this.expectedType,Rt=Ve.type;if((ft.kind==="string"||ft.kind==="number"||ft.kind==="boolean"||ft.kind==="object"||ft.kind==="array")&&Rt.kind==="value")Ve=ne(Ve,ft,G.typeAnnotation||"assert");else if((ft.kind==="color"||ft.kind==="formatted"||ft.kind==="resolvedImage")&&(Rt.kind==="value"||Rt.kind==="string"))Ve=ne(Ve,ft,G.typeAnnotation||"coerce");else if(this.checkSubtype(ft,Rt))return null}if(!(Ve instanceof Fs)&&Ve.type.kind!=="resolvedImage"&&_c(Ve)){var Ht=new qs;try{Ve=new Fs(Ve.type,Ve.evaluate(Ht))}catch(rr){return this.error(rr.message),null}}return Ve}return this.error('Unknown expression "'+ye+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof C>"u"?this.error("'undefined' value invalid. Use null instead."):typeof C=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof C+" instead.")},xl.prototype.concat=function(C,G,ne){var ye=typeof C=="number"?this.path.concat(C):this.path,Pe=ne?this.scope.concat(ne):this.scope;return new xl(this.registry,ye,G||null,Pe,this.errors)},xl.prototype.error=function(C){for(var G=[],ne=arguments.length-1;ne-- >0;)G[ne]=arguments[ne+1];var ye=""+this.key+G.map(function(Pe){return"["+Pe+"]"}).join("");this.errors.push(new Ps(ye,C))},xl.prototype.checkSubtype=function(C,G){var ne=pu(C,G);return ne&&this.error(ne),ne};function _c(k){if(k instanceof Ic)return _c(k.boundExpression);if(k instanceof xo&&k.name==="error")return!1;if(k instanceof Ku)return!1;if(k instanceof Fu)return!1;var C=k instanceof ws||k instanceof Kl,G=!0;return k.eachChild(function(ne){C?G=G&&_c(ne):G=G&&ne instanceof Fs}),G?Bf(k)&&Bu(k,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function Eu(k,C){for(var G=k.length-1,ne=0,ye=G,Pe=0,Ve,ft;ne<=ye;)if(Pe=Math.floor((ne+ye)/2),Ve=k[Pe],ft=k[Pe+1],Ve<=C){if(Pe===G||C<ft)return Pe;ne=Pe+1}else if(Ve>C)ye=Pe-1;else throw new ol("Input is not a number.");return 0}var Iu=function(C,G,ne){this.type=C,this.input=G,this.labels=[],this.outputs=[];for(var ye=0,Pe=ne;ye<Pe.length;ye+=1){var Ve=Pe[ye],ft=Ve[0],Rt=Ve[1];this.labels.push(ft),this.outputs.push(Rt)}};Iu.parse=function(C,G){if(C.length-1<4)return G.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if((C.length-1)%2!==0)return G.error("Expected an even number of arguments.");var ne=G.parse(C[1],1,On);if(!ne)return null;var ye=[],Pe=null;G.expectedType&&G.expectedType.kind!=="value"&&(Pe=G.expectedType);for(var Ve=1;Ve<C.length;Ve+=2){var ft=Ve===1?-1/0:C[Ve],Rt=C[Ve+1],Ht=Ve,rr=Ve+1;if(typeof ft!="number")return G.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Ht);if(ye.length&&ye[ye.length-1][0]>=ft)return G.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Ht);var Pr=G.parse(Rt,rr,Pe);if(!Pr)return null;Pe=Pe||Pr.type,ye.push([ft,Pr])}return new Iu(Pe,ne,ye)},Iu.prototype.evaluate=function(C){var G=this.labels,ne=this.outputs;if(G.length===1)return ne[0].evaluate(C);var ye=this.input.evaluate(C);if(ye<=G[0])return ne[0].evaluate(C);var Pe=G.length;if(ye>=G[Pe-1])return ne[Pe-1].evaluate(C);var Ve=Eu(G,ye);return ne[Ve].evaluate(C)},Iu.prototype.eachChild=function(C){C(this.input);for(var G=0,ne=this.outputs;G<ne.length;G+=1){var ye=ne[G];C(ye)}},Iu.prototype.outputDefined=function(){return this.outputs.every(function(C){return C.outputDefined()})},Iu.prototype.serialize=function(){for(var C=["step",this.input.serialize()],G=0;G<this.labels.length;G++)G>0&&C.push(this.labels[G]),C.push(this.outputs[G].serialize());return C};function Nl(k,C,G){return k*(1-G)+C*G}function Of(k,C,G){return new Js(Nl(k.r,C.r,G),Nl(k.g,C.g,G),Nl(k.b,C.b,G),Nl(k.a,C.a,G))}function Yf(k,C,G){return k.map(function(ne,ye){return Nl(ne,C[ye],G)})}var Wu=Object.freeze({__proto__:null,number:Nl,color:Of,array:Yf}),Pc=.95047,xc=1,_h=1.08883,ff=4/29,yf=6/29,Xu=3*yf*yf,hf=yf*yf*yf,hu=Math.PI/180,Qc=180/Math.PI;function nh(k){return k>hf?Math.pow(k,1/3):k/Xu+ff}function _f(k){return k>yf?k*k*k:Xu*(k-ff)}function bl(k){return 255*(k<=.0031308?12.92*k:1.055*Math.pow(k,1/2.4)-.055)}function ku(k){return k/=255,k<=.04045?k/12.92:Math.pow((k+.055)/1.055,2.4)}function Ou(k){var C=ku(k.r),G=ku(k.g),ne=ku(k.b),ye=nh((.4124564*C+.3575761*G+.1804375*ne)/Pc),Pe=nh((.2126729*C+.7151522*G+.072175*ne)/xc),Ve=nh((.0193339*C+.119192*G+.9503041*ne)/_h);return{l:116*Pe-16,a:500*(ye-Pe),b:200*(Pe-Ve),alpha:k.a}}function Cf(k){var C=(k.l+16)/116,G=isNaN(k.a)?C:C+k.a/500,ne=isNaN(k.b)?C:C-k.b/200;return C=xc*_f(C),G=Pc*_f(G),ne=_h*_f(ne),new Js(bl(3.2404542*G-1.5371385*C-.4985314*ne),bl(-.969266*G+1.8760108*C+.041556*ne),bl(.0556434*G-.2040259*C+1.0572252*ne),k.alpha)}function Ml(k,C,G){return{l:Nl(k.l,C.l,G),a:Nl(k.a,C.a,G),b:Nl(k.b,C.b,G),alpha:Nl(k.alpha,C.alpha,G)}}function df(k){var C=Ou(k),G=C.l,ne=C.a,ye=C.b,Pe=Math.atan2(ye,ne)*Qc;return{h:Pe<0?Pe+360:Pe,c:Math.sqrt(ne*ne+ye*ye),l:G,alpha:k.a}}function Rc(k){var C=k.h*hu,G=k.c,ne=k.l;return Cf({l:ne,a:Math.cos(C)*G,b:Math.sin(C)*G,alpha:k.alpha})}function Ju(k,C,G){var ne=C-k;return k+G*(ne>180||ne<-180?ne-360*Math.round(ne/360):ne)}function xf(k,C,G){return{h:Ju(k.h,C.h,G),c:Nl(k.c,C.c,G),l:Nl(k.l,C.l,G),alpha:Nl(k.alpha,C.alpha,G)}}var Qu={forward:Ou,reverse:Cf,interpolate:Ml},ef={forward:df,reverse:Rc,interpolate:xf},Lf=Object.freeze({__proto__:null,lab:Qu,hcl:ef}),du=function(C,G,ne,ye,Pe){this.type=C,this.operator=G,this.interpolation=ne,this.input=ye,this.labels=[],this.outputs=[];for(var Ve=0,ft=Pe;Ve<ft.length;Ve+=1){var Rt=ft[Ve],Ht=Rt[0],rr=Rt[1];this.labels.push(Ht),this.outputs.push(rr)}};du.interpolationFactor=function(C,G,ne,ye){var Pe=0;if(C.name==="exponential")Pe=Nf(G,C.base,ne,ye);else if(C.name==="linear")Pe=Nf(G,1,ne,ye);else if(C.name==="cubic-bezier"){var Ve=C.controlPoints,ft=new o(Ve[0],Ve[1],Ve[2],Ve[3]);Pe=ft.solve(Nf(G,1,ne,ye))}return Pe},du.parse=function(C,G){var ne=C[0],ye=C[1],Pe=C[2],Ve=C.slice(3);if(!Array.isArray(ye)||ye.length===0)return G.error("Expected an interpolation type expression.",1);if(ye[0]==="linear")ye={name:"linear"};else if(ye[0]==="exponential"){var ft=ye[1];if(typeof ft!="number")return G.error("Exponential interpolation requires a numeric base.",1,1);ye={name:"exponential",base:ft}}else if(ye[0]==="cubic-bezier"){var Rt=ye.slice(1);if(Rt.length!==4||Rt.some(function(ha){return typeof ha!="number"||ha<0||ha>1}))return G.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);ye={name:"cubic-bezier",controlPoints:Rt}}else return G.error("Unknown interpolation type "+String(ye[0]),1,0);if(C.length-1<4)return G.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if((C.length-1)%2!==0)return G.error("Expected an even number of arguments.");if(Pe=G.parse(Pe,2,On),!Pe)return null;var Ht=[],rr=null;ne==="interpolate-hcl"||ne==="interpolate-lab"?rr=Ys:G.expectedType&&G.expectedType.kind!=="value"&&(rr=G.expectedType);for(var Pr=0;Pr<Ve.length;Pr+=2){var Zr=Ve[Pr],Hr=Ve[Pr+1],hi=Pr+3,Gi=Pr+4;if(typeof Zr!="number")return G.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',hi);if(Ht.length&&Ht[Ht.length-1][0]>=Zr)return G.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',hi);var Ra=G.parse(Hr,Gi,rr);if(!Ra)return null;rr=rr||Ra.type,Ht.push([Zr,Ra])}return rr.kind!=="number"&&rr.kind!=="color"&&!(rr.kind==="array"&&rr.itemType.kind==="number"&&typeof rr.N=="number")?G.error("Type "+Us(rr)+" is not interpolatable."):new du(rr,ne,ye,Pe,Ht)},du.prototype.evaluate=function(C){var G=this.labels,ne=this.outputs;if(G.length===1)return ne[0].evaluate(C);var ye=this.input.evaluate(C);if(ye<=G[0])return ne[0].evaluate(C);var Pe=G.length;if(ye>=G[Pe-1])return ne[Pe-1].evaluate(C);var Ve=Eu(G,ye),ft=G[Ve],Rt=G[Ve+1],Ht=du.interpolationFactor(this.interpolation,ye,ft,Rt),rr=ne[Ve].evaluate(C),Pr=ne[Ve+1].evaluate(C);return this.operator==="interpolate"?Wu[this.type.kind.toLowerCase()](rr,Pr,Ht):this.operator==="interpolate-hcl"?ef.reverse(ef.interpolate(ef.forward(rr),ef.forward(Pr),Ht)):Qu.reverse(Qu.interpolate(Qu.forward(rr),Qu.forward(Pr),Ht))},du.prototype.eachChild=function(C){C(this.input);for(var G=0,ne=this.outputs;G<ne.length;G+=1){var ye=ne[G];C(ye)}},du.prototype.outputDefined=function(){return this.outputs.every(function(C){return C.outputDefined()})},du.prototype.serialize=function(){var C;this.interpolation.name==="linear"?C=["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?C=["linear"]:C=["exponential",this.interpolation.base]:C=["cubic-bezier"].concat(this.interpolation.controlPoints);for(var G=[this.operator,C,this.input.serialize()],ne=0;ne<this.labels.length;ne++)G.push(this.labels[ne],this.outputs[ne].serialize());return G};function Nf(k,C,G,ne){var ye=ne-G,Pe=k-G;return ye===0?0:C===1?Pe/ye:(Math.pow(C,Pe)-1)/(Math.pow(C,ye)-1)}var ec=function(C,G){this.type=C,this.args=G};ec.parse=function(C,G){if(C.length<2)return G.error("Expectected at least one argument.");var ne=null,ye=G.expectedType;ye&&ye.kind!=="value"&&(ne=ye);for(var Pe=[],Ve=0,ft=C.slice(1);Ve<ft.length;Ve+=1){var Rt=ft[Ve],Ht=G.parse(Rt,1+Pe.length,ne,void 0,{typeAnnotation:"omit"});if(!Ht)return null;ne=ne||Ht.type,Pe.push(Ht)}var rr=ye&&Pe.some(function(Pr){return pu(ye,Pr.type)});return rr?new ec(Lo,Pe):new ec(ne,Pe)},ec.prototype.evaluate=function(C){for(var G=null,ne=0,ye,Pe=0,Ve=this.args;Pe<Ve.length;Pe+=1){var ft=Ve[Pe];if(ne++,G=ft.evaluate(C),G&&G instanceof Vl&&!G.available&&(ye||(ye=G.name),G=null,ne===this.args.length&&(G=ye)),G!==null)break}return G},ec.prototype.eachChild=function(C){this.args.forEach(C)},ec.prototype.outputDefined=function(){return this.args.every(function(C){return C.outputDefined()})},ec.prototype.serialize=function(){var C=["coalesce"];return this.eachChild(function(G){C.push(G.serialize())}),C};var Dc=function(C,G){this.type=G.type,this.bindings=[].concat(C),this.result=G};Dc.prototype.evaluate=function(C){return this.result.evaluate(C)},Dc.prototype.eachChild=function(C){for(var G=0,ne=this.bindings;G<ne.length;G+=1){var ye=ne[G];C(ye[1])}C(this.result)},Dc.parse=function(C,G){if(C.length<4)return G.error("Expected at least 3 arguments, but found "+(C.length-1)+" instead.");for(var ne=[],ye=1;ye<C.length-1;ye+=2){var Pe=C[ye];if(typeof Pe!="string")return G.error("Expected string, but found "+typeof Pe+" instead.",ye);if(/[^a-zA-Z0-9_]/.test(Pe))return G.error("Variable names must contain only alphanumeric characters or '_'.",ye);var Ve=G.parse(C[ye+1],ye+1);if(!Ve)return null;ne.push([Pe,Ve])}var ft=G.parse(C[C.length-1],C.length-1,G.expectedType,ne);return ft?new Dc(ne,ft):null},Dc.prototype.outputDefined=function(){return this.result.outputDefined()},Dc.prototype.serialize=function(){for(var C=["let"],G=0,ne=this.bindings;G<ne.length;G+=1){var ye=ne[G],Pe=ye[0],Ve=ye[1];C.push(Pe,Ve.serialize())}return C.push(this.result.serialize()),C};var bc=function(C,G,ne){this.type=C,this.index=G,this.input=ne};bc.parse=function(C,G){if(C.length!==3)return G.error("Expected 2 arguments, but found "+(C.length-1)+" instead.");var ne=G.parse(C[1],1,On),ye=G.parse(C[2],2,Es(G.expectedType||Lo));if(!ne||!ye)return null;var Pe=ye.type;return new bc(Pe.itemType,ne,ye)},bc.prototype.evaluate=function(C){var G=this.index.evaluate(C),ne=this.input.evaluate(C);if(G<0)throw new ol("Array index out of bounds: "+G+" < 0.");if(G>=ne.length)throw new ol("Array index out of bounds: "+G+" > "+(ne.length-1)+".");if(G!==Math.floor(G))throw new ol("Array index must be an integer, but found "+G+" instead.");return ne[G]},bc.prototype.eachChild=function(C){C(this.index),C(this.input)},bc.prototype.outputDefined=function(){return!1},bc.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Jl=function(C,G){this.type=jo,this.needle=C,this.haystack=G};Jl.parse=function(C,G){if(C.length!==3)return G.error("Expected 2 arguments, but found "+(C.length-1)+" instead.");var ne=G.parse(C[1],1,Lo),ye=G.parse(C[2],2,Lo);return!ne||!ye?null:kc(ne.type,[jo,Ko,On,yl,Lo])?new Jl(ne,ye):G.error("Expected first argument to be of type boolean, string, number or null, but found "+Us(ne.type)+" instead")},Jl.prototype.evaluate=function(C){var G=this.needle.evaluate(C),ne=this.haystack.evaluate(C);if(!ne)return!1;if(!Au(G,["boolean","string","number","null"]))throw new ol("Expected first argument to be of type boolean, string, number or null, but found "+Us(_l(G))+" instead.");if(!Au(ne,["string","array"]))throw new ol("Expected second argument to be of type array or string, but found "+Us(_l(ne))+" instead.");return ne.indexOf(G)>=0},Jl.prototype.eachChild=function(C){C(this.needle),C(this.haystack)},Jl.prototype.outputDefined=function(){return!0},Jl.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Cu=function(C,G,ne){this.type=On,this.needle=C,this.haystack=G,this.fromIndex=ne};Cu.parse=function(C,G){if(C.length<=2||C.length>=5)return G.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var ne=G.parse(C[1],1,Lo),ye=G.parse(C[2],2,Lo);if(!ne||!ye)return null;if(!kc(ne.type,[jo,Ko,On,yl,Lo]))return G.error("Expected first argument to be of type boolean, string, number or null, but found "+Us(ne.type)+" instead");if(C.length===4){var Pe=G.parse(C[3],3,On);return Pe?new Cu(ne,ye,Pe):null}else return new Cu(ne,ye)},Cu.prototype.evaluate=function(C){var G=this.needle.evaluate(C),ne=this.haystack.evaluate(C);if(!Au(G,["boolean","string","number","null"]))throw new ol("Expected first argument to be of type boolean, string, number or null, but found "+Us(_l(G))+" instead.");if(!Au(ne,["string","array"]))throw new ol("Expected second argument to be of type array or string, but found "+Us(_l(ne))+" instead.");if(this.fromIndex){var ye=this.fromIndex.evaluate(C);return ne.indexOf(G,ye)}return ne.indexOf(G)},Cu.prototype.eachChild=function(C){C(this.needle),C(this.haystack),this.fromIndex&&C(this.fromIndex)},Cu.prototype.outputDefined=function(){return!1},Cu.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var C=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),C]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var zc=function(C,G,ne,ye,Pe,Ve){this.inputType=C,this.type=G,this.input=ne,this.cases=ye,this.outputs=Pe,this.otherwise=Ve};zc.parse=function(C,G){if(C.length<5)return G.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if(C.length%2!==1)return G.error("Expected an even number of arguments.");var ne,ye;G.expectedType&&G.expectedType.kind!=="value"&&(ye=G.expectedType);for(var Pe={},Ve=[],ft=2;ft<C.length-1;ft+=2){var Rt=C[ft],Ht=C[ft+1];Array.isArray(Rt)||(Rt=[Rt]);var rr=G.concat(ft);if(Rt.length===0)return rr.error("Expected at least one branch label.");for(var Pr=0,Zr=Rt;Pr<Zr.length;Pr+=1){var Hr=Zr[Pr];if(typeof Hr!="number"&&typeof Hr!="string")return rr.error("Branch labels must be numbers or strings.");if(typeof Hr=="number"&&Math.abs(Hr)>Number.MAX_SAFE_INTEGER)return rr.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof Hr=="number"&&Math.floor(Hr)!==Hr)return rr.error("Numeric branch labels must be integer values.");if(!ne)ne=_l(Hr);else if(rr.checkSubtype(ne,_l(Hr)))return null;if(typeof Pe[String(Hr)]<"u")return rr.error("Branch labels must be unique.");Pe[String(Hr)]=Ve.length}var hi=G.parse(Ht,ft,ye);if(!hi)return null;ye=ye||hi.type,Ve.push(hi)}var Gi=G.parse(C[1],1,Lo);if(!Gi)return null;var Ra=G.parse(C[C.length-1],C.length-1,ye);return!Ra||Gi.type.kind!=="value"&&G.concat(1).checkSubtype(ne,Gi.type)?null:new zc(ne,ye,Gi,Pe,Ve,Ra)},zc.prototype.evaluate=function(C){var G=this.input.evaluate(C),ne=_l(G)===this.inputType&&this.outputs[this.cases[G]]||this.otherwise;return ne.evaluate(C)},zc.prototype.eachChild=function(C){C(this.input),this.outputs.forEach(C),C(this.otherwise)},zc.prototype.outputDefined=function(){return this.outputs.every(function(C){return C.outputDefined()})&&this.otherwise.outputDefined()},zc.prototype.serialize=function(){for(var C=this,G=["match",this.input.serialize()],ne=Object.keys(this.cases).sort(),ye=[],Pe={},Ve=0,ft=ne;Ve<ft.length;Ve+=1){var Rt=ft[Ve],Ht=Pe[this.cases[Rt]];Ht===void 0?(Pe[this.cases[Rt]]=ye.length,ye.push([this.cases[Rt],[Rt]])):ye[Ht][1].push(Rt)}for(var rr=function(Gi){return C.inputType.kind==="number"?Number(Gi):Gi},Pr=0,Zr=ye;Pr<Zr.length;Pr+=1){var Hr=Zr[Pr],Ht=Hr[0],hi=Hr[1];hi.length===1?G.push(rr(hi[0])):G.push(hi.map(rr)),G.push(this.outputs[outputIndex$1].serialize())}return G.push(this.otherwise.serialize()),G};var tf=function(C,G,ne){this.type=C,this.branches=G,this.otherwise=ne};tf.parse=function(C,G){if(C.length<4)return G.error("Expected at least 3 arguments, but found only "+(C.length-1)+".");if(C.length%2!==0)return G.error("Expected an odd number of arguments.");var ne;G.expectedType&&G.expectedType.kind!=="value"&&(ne=G.expectedType);for(var ye=[],Pe=1;Pe<C.length-1;Pe+=2){var Ve=G.parse(C[Pe],Pe,jo);if(!Ve)return null;var ft=G.parse(C[Pe+1],Pe+1,ne);if(!ft)return null;ye.push([Ve,ft]),ne=ne||ft.type}var Rt=G.parse(C[C.length-1],C.length-1,ne);return Rt?new tf(ne,ye,Rt):null},tf.prototype.evaluate=function(C){for(var G=0,ne=this.branches;G<ne.length;G+=1){var ye=ne[G],Pe=ye[0],Ve=ye[1];if(Pe.evaluate(C))return Ve.evaluate(C)}return this.otherwise.evaluate(C)},tf.prototype.eachChild=function(C){for(var G=0,ne=this.branches;G<ne.length;G+=1){var ye=ne[G],Pe=ye[0],Ve=ye[1];C(Pe),C(Ve)}C(this.otherwise)},tf.prototype.outputDefined=function(){return this.branches.every(function(C){var G=C[0],ne=C[1];return ne.outputDefined()})&&this.otherwise.outputDefined()},tf.prototype.serialize=function(){var C=["case"];return this.eachChild(function(G){C.push(G.serialize())}),C};var fc=function(C,G,ne,ye){this.type=C,this.input=G,this.beginIndex=ne,this.endIndex=ye};fc.parse=function(C,G){if(C.length<=2||C.length>=5)return G.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var ne=G.parse(C[1],1,Lo),ye=G.parse(C[2],2,On);if(!ne||!ye)return null;if(!kc(ne.type,[Es(Lo),Ko,Lo]))return G.error("Expected first argument to be of type array or string, but found "+Us(ne.type)+" instead");if(C.length===4){var Pe=G.parse(C[3],3,On);return Pe?new fc(ne.type,ne,ye,Pe):null}else return new fc(ne.type,ne,ye)},fc.prototype.evaluate=function(C){var G=this.input.evaluate(C),ne=this.beginIndex.evaluate(C);if(!Au(G,["string","array"]))throw new ol("Expected first argument to be of type array or string, but found "+Us(_l(G))+" instead.");if(this.endIndex){var ye=this.endIndex.evaluate(C);return G.slice(ne,ye)}return G.slice(ne)},fc.prototype.eachChild=function(C){C(this.input),C(this.beginIndex),this.endIndex&&C(this.endIndex)},fc.prototype.outputDefined=function(){return!1},fc.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var C=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),C]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function Fc(k,C){return k==="=="||k==="!="?C.kind==="boolean"||C.kind==="string"||C.kind==="number"||C.kind==="null"||C.kind==="value":C.kind==="string"||C.kind==="number"||C.kind==="value"}function er(k,C,G){return C===G}function wr(k,C,G){return C!==G}function ai(k,C,G){return C<G}function Jr(k,C,G){return C>G}function Fi(k,C,G){return C<=G}function pa(k,C,G){return C>=G}function Ba(k,C,G,ne){return ne.compare(C,G)===0}function an(k,C,G,ne){return!Ba(k,C,G,ne)}function hn(k,C,G,ne){return ne.compare(C,G)<0}function Ln(k,C,G,ne){return ne.compare(C,G)>0}function Na(k,C,G,ne){return ne.compare(C,G)<=0}function qa(k,C,G,ne){return ne.compare(C,G)>=0}function Za(k,C,G){var ne=k!=="=="&&k!=="!=";return function(){function ye(Pe,Ve,ft){this.type=jo,this.lhs=Pe,this.rhs=Ve,this.collator=ft,this.hasUntypedArgument=Pe.type.kind==="value"||Ve.type.kind==="value"}return ye.parse=function(Ve,ft){if(Ve.length!==3&&Ve.length!==4)return ft.error("Expected two or three arguments.");var Rt=Ve[0],Ht=ft.parse(Ve[1],1,Lo);if(!Ht)return null;if(!Fc(Rt,Ht.type))return ft.concat(1).error('"'+Rt+`" comparisons are not supported for type '`+Us(Ht.type)+"'.");var rr=ft.parse(Ve[2],2,Lo);if(!rr)return null;if(!Fc(Rt,rr.type))return ft.concat(2).error('"'+Rt+`" comparisons are not supported for type '`+Us(rr.type)+"'.");if(Ht.type.kind!==rr.type.kind&&Ht.type.kind!=="value"&&rr.type.kind!=="value")return ft.error("Cannot compare types '"+Us(Ht.type)+"' and '"+Us(rr.type)+"'.");ne&&(Ht.type.kind==="value"&&rr.type.kind!=="value"?Ht=new Kl(rr.type,[Ht]):Ht.type.kind!=="value"&&rr.type.kind==="value"&&(rr=new Kl(Ht.type,[rr])));var Pr=null;if(Ve.length===4){if(Ht.type.kind!=="string"&&rr.type.kind!=="string"&&Ht.type.kind!=="value"&&rr.type.kind!=="value")return ft.error("Cannot use collator to compare non-string types.");if(Pr=ft.parse(Ve[3],3,kl),!Pr)return null}return new ye(Ht,rr,Pr)},ye.prototype.evaluate=function(Ve){var ft=this.lhs.evaluate(Ve),Rt=this.rhs.evaluate(Ve);if(ne&&this.hasUntypedArgument){var Ht=_l(ft),rr=_l(Rt);if(Ht.kind!==rr.kind||!(Ht.kind==="string"||Ht.kind==="number"))throw new ol('Expected arguments for "'+k+'" to be (string, string) or (number, number), but found ('+Ht.kind+", "+rr.kind+") instead.")}if(this.collator&&!ne&&this.hasUntypedArgument){var Pr=_l(ft),Zr=_l(Rt);if(Pr.kind!=="string"||Zr.kind!=="string")return C(Ve,ft,Rt)}return this.collator?G(Ve,ft,Rt,this.collator.evaluate(Ve)):C(Ve,ft,Rt)},ye.prototype.eachChild=function(Ve){Ve(this.lhs),Ve(this.rhs),this.collator&&Ve(this.collator)},ye.prototype.outputDefined=function(){return!0},ye.prototype.serialize=function(){var Ve=[k];return this.eachChild(function(ft){Ve.push(ft.serialize())}),Ve},ye}()}var Ta=Za("==",er,Ba),Hn=Za("!=",wr,an),go=Za("<",ai,hn),wo=Za(">",Jr,Ln),yo=Za("<=",Fi,Na),Io=Za(">=",pa,qa),Vn=function(C,G,ne,ye,Pe){this.type=Ko,this.number=C,this.locale=G,this.currency=ne,this.minFractionDigits=ye,this.maxFractionDigits=Pe};Vn.parse=function(C,G){if(C.length!==3)return G.error("Expected two arguments.");var ne=G.parse(C[1],1,On);if(!ne)return null;var ye=C[2];if(typeof ye!="object"||Array.isArray(ye))return G.error("NumberFormat options argument must be an object.");var Pe=null;if(ye.locale&&(Pe=G.parse(ye.locale,1,Ko),!Pe))return null;var Ve=null;if(ye.currency&&(Ve=G.parse(ye.currency,1,Ko),!Ve))return null;var ft=null;if(ye["min-fraction-digits"]&&(ft=G.parse(ye["min-fraction-digits"],1,On),!ft))return null;var Rt=null;return ye["max-fraction-digits"]&&(Rt=G.parse(ye["max-fraction-digits"],1,On),!Rt)?null:new Vn(ne,Pe,Ve,ft,Rt)},Vn.prototype.evaluate=function(C){return new Intl.NumberFormat(this.locale?this.locale.evaluate(C):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(C):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(C):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(C):void 0}).format(this.number.evaluate(C))},Vn.prototype.eachChild=function(C){C(this.number),this.locale&&C(this.locale),this.currency&&C(this.currency),this.minFractionDigits&&C(this.minFractionDigits),this.maxFractionDigits&&C(this.maxFractionDigits)},Vn.prototype.outputDefined=function(){return!1},Vn.prototype.serialize=function(){var C={};return this.locale&&(C.locale=this.locale.serialize()),this.currency&&(C.currency=this.currency.serialize()),this.minFractionDigits&&(C["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(C["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),C]};var wn=function(C){this.type=On,this.input=C};wn.parse=function(C,G){if(C.length!==2)return G.error("Expected 1 argument, but found "+(C.length-1)+" instead.");var ne=G.parse(C[1],1);return ne?ne.type.kind!=="array"&&ne.type.kind!=="string"&&ne.type.kind!=="value"?G.error("Expected argument of type string or array, but found "+Us(ne.type)+" instead."):new wn(ne):null},wn.prototype.evaluate=function(C){var G=this.input.evaluate(C);if(typeof G=="string")return G.length;if(Array.isArray(G))return G.length;throw new ol("Expected value to be of type string or array, but found "+Us(_l(G))+" instead.")},wn.prototype.eachChild=function(C){C(this.input)},wn.prototype.outputDefined=function(){return!1},wn.prototype.serialize=function(){var C=["length"];return this.eachChild(function(G){C.push(G.serialize())}),C};var Oo={"==":Ta,"!=":Hn,">":wo,"<":go,">=":Io,"<=":yo,array:Kl,at:bc,boolean:Kl,case:tf,coalesce:ec,collator:Ku,format:Zu,image:Sl,in:Jl,"index-of":Cu,interpolate:du,"interpolate-hcl":du,"interpolate-lab":du,length:wn,let:Dc,literal:Fs,match:zc,number:Kl,"number-format":Vn,object:Kl,slice:fc,step:Iu,string:Kl,"to-boolean":ws,"to-color":ws,"to-number":ws,"to-string":ws,var:Ic,within:Fu};function ps(k,C){var G=C[0],ne=C[1],ye=C[2],Pe=C[3];G=G.evaluate(k),ne=ne.evaluate(k),ye=ye.evaluate(k);var Ve=Pe?Pe.evaluate(k):1,ft=lc(G,ne,ye,Ve);if(ft)throw new ol(ft);return new Js(G/255*Ve,ne/255*Ve,ye/255*Ve,Ve)}function js(k,C){return k in C}function pl(k,C){var G=C[k];return typeof G>"u"?null:G}function Qs(k,C,G,ne){for(;G<=ne;){var ye=G+ne>>1;if(C[ye]===k)return!0;C[ye]>k?ne=ye-1:G=ye+1}return!1}function hl(k){return{type:k}}xo.register(Oo,{error:[al,[Ko],function(k,C){var G=C[0];throw new ol(G.evaluate(k))}],typeof:[Ko,[Lo],function(k,C){var G=C[0];return Us(_l(G.evaluate(k)))}],"to-rgba":[Es(On,4),[Ys],function(k,C){var G=C[0];return G.evaluate(k).toArray()}],rgb:[Ys,[On,On,On],ps],rgba:[Ys,[On,On,On,On],ps],has:{type:jo,overloads:[[[Ko],function(k,C){var G=C[0];return js(G.evaluate(k),k.properties())}],[[Ko,Tu],function(k,C){var G=C[0],ne=C[1];return js(G.evaluate(k),ne.evaluate(k))}]]},get:{type:Lo,overloads:[[[Ko],function(k,C){var G=C[0];return pl(G.evaluate(k),k.properties())}],[[Ko,Tu],function(k,C){var G=C[0],ne=C[1];return pl(G.evaluate(k),ne.evaluate(k))}]]},"feature-state":[Lo,[Ko],function(k,C){var G=C[0];return pl(G.evaluate(k),k.featureState||{})}],properties:[Tu,[],function(k){return k.properties()}],"geometry-type":[Ko,[],function(k){return k.geometryType()}],id:[Lo,[],function(k){return k.id()}],zoom:[On,[],function(k){return k.globals.zoom}],"heatmap-density":[On,[],function(k){return k.globals.heatmapDensity||0}],"line-progress":[On,[],function(k){return k.globals.lineProgress||0}],accumulated:[Lo,[],function(k){return k.globals.accumulated===void 0?null:k.globals.accumulated}],"+":[On,hl(On),function(k,C){for(var G=0,ne=0,ye=C;ne<ye.length;ne+=1){var Pe=ye[ne];G+=Pe.evaluate(k)}return G}],"*":[On,hl(On),function(k,C){for(var G=1,ne=0,ye=C;ne<ye.length;ne+=1){var Pe=ye[ne];G*=Pe.evaluate(k)}return G}],"-":{type:On,overloads:[[[On,On],function(k,C){var G=C[0],ne=C[1];return G.evaluate(k)-ne.evaluate(k)}],[[On],function(k,C){var G=C[0];return-G.evaluate(k)}]]},"/":[On,[On,On],function(k,C){var G=C[0],ne=C[1];return G.evaluate(k)/ne.evaluate(k)}],"%":[On,[On,On],function(k,C){var G=C[0],ne=C[1];return G.evaluate(k)%ne.evaluate(k)}],ln2:[On,[],function(){return Math.LN2}],pi:[On,[],function(){return Math.PI}],e:[On,[],function(){return Math.E}],"^":[On,[On,On],function(k,C){var G=C[0],ne=C[1];return Math.pow(G.evaluate(k),ne.evaluate(k))}],sqrt:[On,[On],function(k,C){var G=C[0];return Math.sqrt(G.evaluate(k))}],log10:[On,[On],function(k,C){var G=C[0];return Math.log(G.evaluate(k))/Math.LN10}],ln:[On,[On],function(k,C){var G=C[0];return Math.log(G.evaluate(k))}],log2:[On,[On],function(k,C){var G=C[0];return Math.log(G.evaluate(k))/Math.LN2}],sin:[On,[On],function(k,C){var G=C[0];return Math.sin(G.evaluate(k))}],cos:[On,[On],function(k,C){var G=C[0];return Math.cos(G.evaluate(k))}],tan:[On,[On],function(k,C){var G=C[0];return Math.tan(G.evaluate(k))}],asin:[On,[On],function(k,C){var G=C[0];return Math.asin(G.evaluate(k))}],acos:[On,[On],function(k,C){var G=C[0];return Math.acos(G.evaluate(k))}],atan:[On,[On],function(k,C){var G=C[0];return Math.atan(G.evaluate(k))}],min:[On,hl(On),function(k,C){return Math.min.apply(Math,C.map(function(G){return G.evaluate(k)}))}],max:[On,hl(On),function(k,C){return Math.max.apply(Math,C.map(function(G){return G.evaluate(k)}))}],abs:[On,[On],function(k,C){var G=C[0];return Math.abs(G.evaluate(k))}],round:[On,[On],function(k,C){var G=C[0],ne=G.evaluate(k);return ne<0?-Math.round(-ne):Math.round(ne)}],floor:[On,[On],function(k,C){var G=C[0];return Math.floor(G.evaluate(k))}],ceil:[On,[On],function(k,C){var G=C[0];return Math.ceil(G.evaluate(k))}],"filter-==":[jo,[Ko,Lo],function(k,C){var G=C[0],ne=C[1];return k.properties()[G.value]===ne.value}],"filter-id-==":[jo,[Lo],function(k,C){var G=C[0];return k.id()===G.value}],"filter-type-==":[jo,[Ko],function(k,C){var G=C[0];return k.geometryType()===G.value}],"filter-<":[jo,[Ko,Lo],function(k,C){var G=C[0],ne=C[1],ye=k.properties()[G.value],Pe=ne.value;return typeof ye==typeof Pe&&ye<Pe}],"filter-id-<":[jo,[Lo],function(k,C){var G=C[0],ne=k.id(),ye=G.value;return typeof ne==typeof ye&&ne<ye}],"filter->":[jo,[Ko,Lo],function(k,C){var G=C[0],ne=C[1],ye=k.properties()[G.value],Pe=ne.value;return typeof ye==typeof Pe&&ye>Pe}],"filter-id->":[jo,[Lo],function(k,C){var G=C[0],ne=k.id(),ye=G.value;return typeof ne==typeof ye&&ne>ye}],"filter-<=":[jo,[Ko,Lo],function(k,C){var G=C[0],ne=C[1],ye=k.properties()[G.value],Pe=ne.value;return typeof ye==typeof Pe&&ye<=Pe}],"filter-id-<=":[jo,[Lo],function(k,C){var G=C[0],ne=k.id(),ye=G.value;return typeof ne==typeof ye&&ne<=ye}],"filter->=":[jo,[Ko,Lo],function(k,C){var G=C[0],ne=C[1],ye=k.properties()[G.value],Pe=ne.value;return typeof ye==typeof Pe&&ye>=Pe}],"filter-id->=":[jo,[Lo],function(k,C){var G=C[0],ne=k.id(),ye=G.value;return typeof ne==typeof ye&&ne>=ye}],"filter-has":[jo,[Lo],function(k,C){var G=C[0];return G.value in k.properties()}],"filter-has-id":[jo,[],function(k){return k.id()!==null&&k.id()!==void 0}],"filter-type-in":[jo,[Es(Ko)],function(k,C){var G=C[0];return G.value.indexOf(k.geometryType())>=0}],"filter-id-in":[jo,[Es(Lo)],function(k,C){var G=C[0];return G.value.indexOf(k.id())>=0}],"filter-in-small":[jo,[Ko,Es(Lo)],function(k,C){var G=C[0],ne=C[1];return ne.value.indexOf(k.properties()[G.value])>=0}],"filter-in-large":[jo,[Ko,Es(Lo)],function(k,C){var G=C[0],ne=C[1];return Qs(k.properties()[G.value],ne.value,0,ne.value.length-1)}],all:{type:jo,overloads:[[[jo,jo],function(k,C){var G=C[0],ne=C[1];return G.evaluate(k)&&ne.evaluate(k)}],[hl(jo),function(k,C){for(var G=0,ne=C;G<ne.length;G+=1){var ye=ne[G];if(!ye.evaluate(k))return!1}return!0}]]},any:{type:jo,overloads:[[[jo,jo],function(k,C){var G=C[0],ne=C[1];return G.evaluate(k)||ne.evaluate(k)}],[hl(jo),function(k,C){for(var G=0,ne=C;G<ne.length;G+=1){var ye=ne[G];if(ye.evaluate(k))return!0}return!1}]]},"!":[jo,[jo],function(k,C){var G=C[0];return!G.evaluate(k)}],"is-supported-script":[jo,[Ko],function(k,C){var G=C[0],ne=k.globals&&k.globals.isSupportedScript;return ne?ne(G.evaluate(k)):!0}],upcase:[Ko,[Ko],function(k,C){var G=C[0];return G.evaluate(k).toUpperCase()}],downcase:[Ko,[Ko],function(k,C){var G=C[0];return G.evaluate(k).toLowerCase()}],concat:[Ko,hl(Lo),function(k,C){return C.map(function(G){return Cl(G.evaluate(k))}).join("")}],"resolved-locale":[Ko,[kl],function(k,C){var G=C[0];return G.evaluate(k).resolvedLocale()}]});function Bs(k){return{result:"success",value:k}}function Wl(k){return{result:"error",value:k}}function Il(k){return k["property-type"]==="data-driven"||k["property-type"]==="cross-faded-data-driven"}function wl(k){return!!k.expression&&k.expression.parameters.indexOf("zoom")>-1}function io(k){return!!k.expression&&k.expression.interpolated}function Jo(k){return k instanceof Number?"number":k instanceof String?"string":k instanceof Boolean?"boolean":Array.isArray(k)?"array":k===null?"null":typeof k}function cl(k){return typeof k=="object"&&k!==null&&!Array.isArray(k)}function Zs(k){return k}function gu(k,C){var G=C.type==="color",ne=k.stops&&typeof k.stops[0][0]=="object",ye=ne||k.property!==void 0,Pe=ne||!ye,Ve=k.type||(io(C)?"exponential":"interval");if(G&&(k=zs({},k),k.stops&&(k.stops=k.stops.map(function(ro){return[ro[0],Js.parse(ro[1])]})),k.default?k.default=Js.parse(k.default):k.default=Js.parse(C.default)),k.colorSpace&&k.colorSpace!=="rgb"&&!Lf[k.colorSpace])throw new Error("Unknown color space: "+k.colorSpace);var ft,Rt,Ht;if(Ve==="exponential")ft=Lu;else if(Ve==="interval")ft=Bc;else if(Ve==="categorical"){ft=tc,Rt=Object.create(null);for(var rr=0,Pr=k.stops;rr<Pr.length;rr+=1){var Zr=Pr[rr];Rt[Zr[0]]=Zr[1]}Ht=typeof k.stops[0][0]}else if(Ve==="identity")ft=Oc;else throw new Error('Unknown function type "'+Ve+'"');if(ne){for(var Hr={},hi=[],Gi=0;Gi<k.stops.length;Gi++){var Ra=k.stops[Gi],ha=Ra[0].zoom;Hr[ha]===void 0&&(Hr[ha]={zoom:ha,type:k.type,property:k.property,default:k.default,stops:[]},hi.push(ha)),Hr[ha].stops.push([Ra[0].value,Ra[1]])}for(var fn=[],Wa=0,cn=hi;Wa<cn.length;Wa+=1){var bn=cn[Wa];fn.push([Hr[bn].zoom,gu(Hr[bn],C)])}var Un={name:"linear"};return{kind:"composite",interpolationType:Un,interpolationFactor:du.interpolationFactor.bind(void 0,Un),zoomStops:fn.map(function(ro){return ro[0]}),evaluate:function(Go,So){var Bo=Go.zoom;return Lu({stops:fn,base:k.base},C,Bo).evaluate(Bo,So)}}}else if(Pe){var oo=Ve==="exponential"?{name:"exponential",base:k.base!==void 0?k.base:1}:null;return{kind:"camera",interpolationType:oo,interpolationFactor:du.interpolationFactor.bind(void 0,oo),zoomStops:k.stops.map(function(ro){return ro[0]}),evaluate:function(ro){var Go=ro.zoom;return ft(k,C,Go,Rt,Ht)}}}else return{kind:"source",evaluate:function(Go,So){var Bo=So&&So.properties?So.properties[k.property]:void 0;return Bo===void 0?Nu(k.default,C.default):ft(k,C,Bo,Rt,Ht)}}}function Nu(k,C,G){if(k!==void 0)return k;if(C!==void 0)return C;if(G!==void 0)return G}function tc(k,C,G,ne,ye){var Pe=typeof G===ye?ne[G]:void 0;return Nu(Pe,k.default,C.default)}function Bc(k,C,G){if(Jo(G)!=="number")return Nu(k.default,C.default);var ne=k.stops.length;if(ne===1||G<=k.stops[0][0])return k.stops[0][1];if(G>=k.stops[ne-1][0])return k.stops[ne-1][1];var ye=Eu(k.stops.map(function(Pe){return Pe[0]}),G);return k.stops[ye][1]}function Lu(k,C,G){var ne=k.base!==void 0?k.base:1;if(Jo(G)!=="number")return Nu(k.default,C.default);var ye=k.stops.length;if(ye===1||G<=k.stops[0][0])return k.stops[0][1];if(G>=k.stops[ye-1][0])return k.stops[ye-1][1];var Pe=Eu(k.stops.map(function(Pr){return Pr[0]}),G),Ve=Pu(G,ne,k.stops[Pe][0],k.stops[Pe+1][0]),ft=k.stops[Pe][1],Rt=k.stops[Pe+1][1],Ht=Wu[C.type]||Zs;if(k.colorSpace&&k.colorSpace!=="rgb"){var rr=Lf[k.colorSpace];Ht=function(Pr,Zr){return rr.reverse(rr.interpolate(rr.forward(Pr),rr.forward(Zr),Ve))}}return typeof ft.evaluate=="function"?{evaluate:function(){for(var Zr=[],Hr=arguments.length;Hr--;)Zr[Hr]=arguments[Hr];var hi=ft.evaluate.apply(void 0,Zr),Gi=Rt.evaluate.apply(void 0,Zr);if(!(hi===void 0||Gi===void 0))return Ht(hi,Gi,Ve)}}:Ht(ft,Rt,Ve)}function Oc(k,C,G){return C.type==="color"?G=Js.parse(G):C.type==="formatted"?G=mu.fromString(G.toString()):C.type==="resolvedImage"?G=Vl.fromString(G.toString()):Jo(G)!==C.type&&(C.type!=="enum"||!C.values[G])&&(G=void 0),Nu(G,k.default,C.default)}function Pu(k,C,G,ne){var ye=ne-G,Pe=k-G;return ye===0?0:C===1?Pe/ye:(Math.pow(C,Pe)-1)/(Math.pow(C,ye)-1)}var wc=function(C,G){this.expression=C,this._warningHistory={},this._evaluator=new qs,this._defaultValue=G?Te(G):null,this._enumValues=G&&G.type==="enum"?G.values:null};wc.prototype.evaluateWithoutErrorHandling=function(C,G,ne,ye,Pe,Ve){return this._evaluator.globals=C,this._evaluator.feature=G,this._evaluator.featureState=ne,this._evaluator.canonical=ye,this._evaluator.availableImages=Pe||null,this._evaluator.formattedSection=Ve,this.expression.evaluate(this._evaluator)},wc.prototype.evaluate=function(C,G,ne,ye,Pe,Ve){this._evaluator.globals=C,this._evaluator.feature=G||null,this._evaluator.featureState=ne||null,this._evaluator.canonical=ye,this._evaluator.availableImages=Pe||null,this._evaluator.formattedSection=Ve||null;try{var ft=this.expression.evaluate(this._evaluator);if(ft==null||typeof ft=="number"&&ft!==ft)return this._defaultValue;if(this._enumValues&&!(ft in this._enumValues))throw new ol("Expected value to be one of "+Object.keys(this._enumValues).map(function(Rt){return JSON.stringify(Rt)}).join(", ")+", but found "+JSON.stringify(ft)+" instead.");return ft}catch(Rt){return this._warningHistory[Rt.message]||(this._warningHistory[Rt.message]=!0,typeof console<"u"&&console.warn(Rt.message)),this._defaultValue}};function Po(k){return Array.isArray(k)&&k.length>0&&typeof k[0]=="string"&&k[0]in Oo}function es(k,C){var G=new xl(Oo,[],C?xe(C):void 0),ne=G.parse(k,void 0,void 0,void 0,C&&C.type==="string"?{typeAnnotation:"coerce"}:void 0);return ne?Bs(new wc(ne,C)):Wl(G.errors)}var Nc=function(C,G){this.kind=C,this._styleExpression=G,this.isStateDependent=C!=="constant"&&!Ll(G.expression)};Nc.prototype.evaluateWithoutErrorHandling=function(C,G,ne,ye,Pe,Ve){return this._styleExpression.evaluateWithoutErrorHandling(C,G,ne,ye,Pe,Ve)},Nc.prototype.evaluate=function(C,G,ne,ye,Pe,Ve){return this._styleExpression.evaluate(C,G,ne,ye,Pe,Ve)};var hc=function(C,G,ne,ye){this.kind=C,this.zoomStops=ne,this._styleExpression=G,this.isStateDependent=C!=="camera"&&!Ll(G.expression),this.interpolationType=ye};hc.prototype.evaluateWithoutErrorHandling=function(C,G,ne,ye,Pe,Ve){return this._styleExpression.evaluateWithoutErrorHandling(C,G,ne,ye,Pe,Ve)},hc.prototype.evaluate=function(C,G,ne,ye,Pe,Ve){return this._styleExpression.evaluate(C,G,ne,ye,Pe,Ve)},hc.prototype.interpolationFactor=function(C,G,ne){return this.interpolationType?du.interpolationFactor(this.interpolationType,C,G,ne):0};function rc(k,C){if(k=es(k,C),k.result==="error")return k;var G=k.value.expression,ne=Bf(G);if(!ne&&!Il(C))return Wl([new Ps("","data expressions not supported")]);var ye=Bu(G,["zoom"]);if(!ye&&!wl(C))return Wl([new Ps("","zoom expressions not supported")]);var Pe=ae(G);if(!Pe&&!ye)return Wl([new Ps("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(Pe instanceof Ps)return Wl([Pe]);if(Pe instanceof du&&!io(C))return Wl([new Ps("",'"interpolate" expressions cannot be used with this property')]);if(!Pe)return Bs(ne?new Nc("constant",k.value):new Nc("source",k.value));var Ve=Pe instanceof du?Pe.interpolation:void 0;return Bs(ne?new hc("camera",k.value,Pe.labels,Ve):new hc("composite",k.value,Pe.labels,Ve))}var Ue=function(C,G){this._parameters=C,this._specification=G,zs(this,gu(this._parameters,this._specification))};Ue.deserialize=function(C){return new Ue(C._parameters,C._specification)},Ue.serialize=function(C){return{_parameters:C._parameters,_specification:C._specification}};function P(k,C){if(cl(k))return new Ue(k,C);if(Po(k)){var G=rc(k,C);if(G.result==="error")throw new Error(G.value.map(function(ye){return ye.key+": "+ye.message}).join(", "));return G.value}else{var ne=k;return typeof k=="string"&&C.type==="color"&&(ne=Js.parse(k)),{kind:"constant",evaluate:function(){return ne}}}}function ae(k){var C=null;if(k instanceof Dc)C=ae(k.result);else if(k instanceof ec)for(var G=0,ne=k.args;G<ne.length;G+=1){var ye=ne[G];if(C=ae(ye),C)break}else(k instanceof Iu||k instanceof du)&&k.input instanceof xo&&k.input.name==="zoom"&&(C=k);return C instanceof Ps||k.eachChild(function(Pe){var Ve=ae(Pe);Ve instanceof Ps?C=Ve:!C&&Ve?C=new Ps("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):C&&Ve&&C!==Ve&&(C=new Ps("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),C}function xe(k){var C={color:Ys,string:Ko,number:On,enum:Ko,boolean:jo,formatted:Ns,resolvedImage:rl};return k.type==="array"?Es(C[k.value]||Lo,k.length):C[k.type]}function Te(k){return k.type==="color"&&cl(k.default)?new Js(0,0,0,0):k.type==="color"?Js.parse(k.default)||null:k.default===void 0?null:k.default}function Oe(k){var C=k.key,G=k.value,ne=k.valueSpec||{},ye=k.objectElementValidators||{},Pe=k.style,Ve=k.styleSpec,ft=[],Rt=Jo(G);if(Rt!=="object")return[new Xn(C,G,"object expected, "+Rt+" found")];for(var Ht in G){var rr=Ht.split(".")[0],Pr=ne[rr]||ne["*"],Zr=void 0;if(ye[rr])Zr=ye[rr];else if(ne[rr])Zr=Ho;else if(ye["*"])Zr=ye["*"];else if(ne["*"])Zr=Ho;else{ft.push(new Xn(C,G[Ht],'unknown property "'+Ht+'"'));continue}ft=ft.concat(Zr({key:(C&&C+".")+Ht,value:G[Ht],valueSpec:Pr,style:Pe,styleSpec:Ve,object:G,objectKey:Ht},G))}for(var Hr in ne)ye[Hr]||ne[Hr].required&&ne[Hr].default===void 0&&G[Hr]===void 0&&ft.push(new Xn(C,G,'missing required property "'+Hr+'"'));return ft}function ht(k){var C=k.value,G=k.valueSpec,ne=k.style,ye=k.styleSpec,Pe=k.key,Ve=k.arrayElementValidator||Ho;if(Jo(C)!=="array")return[new Xn(Pe,C,"array expected, "+Jo(C)+" found")];if(G.length&&C.length!==G.length)return[new Xn(Pe,C,"array length "+G.length+" expected, length "+C.length+" found")];if(G["min-length"]&&C.length<G["min-length"])return[new Xn(Pe,C,"array length at least "+G["min-length"]+" expected, length "+C.length+" found")];var ft={type:G.value,values:G.values};ye.$version<7&&(ft.function=G.function),Jo(G.value)==="object"&&(ft=G.value);for(var Rt=[],Ht=0;Ht<C.length;Ht++)Rt=Rt.concat(Ve({array:C,arrayIndex:Ht,value:C[Ht],valueSpec:ft,style:ne,styleSpec:ye,key:Pe+"["+Ht+"]"}));return Rt}function Tt(k){var C=k.key,G=k.value,ne=k.valueSpec,ye=Jo(G);return ye==="number"&&G!==G&&(ye="NaN"),ye!=="number"?[new Xn(C,G,"number expected, "+ye+" found")]:"minimum"in ne&&G<ne.minimum?[new Xn(C,G,G+" is less than the minimum value "+ne.minimum)]:"maximum"in ne&&G>ne.maximum?[new Xn(C,G,G+" is greater than the maximum value "+ne.maximum)]:[]}function Ot(k){var C=k.valueSpec,G=so(k.value.type),ne,ye={},Pe,Ve,ft=G!=="categorical"&&k.value.property===void 0,Rt=!ft,Ht=Jo(k.value.stops)==="array"&&Jo(k.value.stops[0])==="array"&&Jo(k.value.stops[0][0])==="object",rr=Oe({key:k.key,value:k.value,valueSpec:k.styleSpec.function,style:k.style,styleSpec:k.styleSpec,objectElementValidators:{stops:Pr,default:hi}});return G==="identity"&&ft&&rr.push(new Xn(k.key,k.value,'missing required property "property"')),G!=="identity"&&!k.value.stops&&rr.push(new Xn(k.key,k.value,'missing required property "stops"')),G==="exponential"&&k.valueSpec.expression&&!io(k.valueSpec)&&rr.push(new Xn(k.key,k.value,"exponential functions not supported")),k.styleSpec.$version>=8&&(Rt&&!Il(k.valueSpec)?rr.push(new Xn(k.key,k.value,"property functions not supported")):ft&&!wl(k.valueSpec)&&rr.push(new Xn(k.key,k.value,"zoom functions not supported"))),(G==="categorical"||Ht)&&k.value.property===void 0&&rr.push(new Xn(k.key,k.value,'"property" property is required')),rr;function Pr(Gi){if(G==="identity")return[new Xn(Gi.key,Gi.value,'identity function may not have a "stops" property')];var Ra=[],ha=Gi.value;return Ra=Ra.concat(ht({key:Gi.key,value:ha,valueSpec:Gi.valueSpec,style:Gi.style,styleSpec:Gi.styleSpec,arrayElementValidator:Zr})),Jo(ha)==="array"&&ha.length===0&&Ra.push(new Xn(Gi.key,ha,"array must have at least one stop")),Ra}function Zr(Gi){var Ra=[],ha=Gi.value,fn=Gi.key;if(Jo(ha)!=="array")return[new Xn(fn,ha,"array expected, "+Jo(ha)+" found")];if(ha.length!==2)return[new Xn(fn,ha,"array length 2 expected, length "+ha.length+" found")];if(Ht){if(Jo(ha[0])!=="object")return[new Xn(fn,ha,"object expected, "+Jo(ha[0])+" found")];if(ha[0].zoom===void 0)return[new Xn(fn,ha,"object stop key must have zoom")];if(ha[0].value===void 0)return[new Xn(fn,ha,"object stop key must have value")];if(Ve&&Ve>so(ha[0].zoom))return[new Xn(fn,ha[0].zoom,"stop zoom values must appear in ascending order")];so(ha[0].zoom)!==Ve&&(Ve=so(ha[0].zoom),Pe=void 0,ye={}),Ra=Ra.concat(Oe({key:fn+"[0]",value:ha[0],valueSpec:{zoom:{}},style:Gi.style,styleSpec:Gi.styleSpec,objectElementValidators:{zoom:Tt,value:Hr}}))}else Ra=Ra.concat(Hr({key:fn+"[0]",value:ha[0],valueSpec:{},style:Gi.style,styleSpec:Gi.styleSpec},ha));return Po($s(ha[1]))?Ra.concat([new Xn(fn+"[1]",ha[1],"expressions are not allowed in function stops.")]):Ra.concat(Ho({key:fn+"[1]",value:ha[1],valueSpec:C,style:Gi.style,styleSpec:Gi.styleSpec}))}function Hr(Gi,Ra){var ha=Jo(Gi.value),fn=so(Gi.value),Wa=Gi.value!==null?Gi.value:Ra;if(!ne)ne=ha;else if(ha!==ne)return[new Xn(Gi.key,Wa,ha+" stop domain type must match previous stop domain type "+ne)];if(ha!=="number"&&ha!=="string"&&ha!=="boolean")return[new Xn(Gi.key,Wa,"stop domain value must be a number, string, or boolean")];if(ha!=="number"&&G!=="categorical"){var cn="number expected, "+ha+" found";return Il(C)&&G===void 0&&(cn+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Xn(Gi.key,Wa,cn)]}return G==="categorical"&&ha==="number"&&(!isFinite(fn)||Math.floor(fn)!==fn)?[new Xn(Gi.key,Wa,"integer expected, found "+fn)]:G!=="categorical"&&ha==="number"&&Pe!==void 0&&fn<Pe?[new Xn(Gi.key,Wa,"stop domain values must appear in ascending order")]:(Pe=fn,G==="categorical"&&fn in ye?[new Xn(Gi.key,Wa,"stop domain values must be unique")]:(ye[fn]=!0,[]))}function hi(Gi){return Ho({key:Gi.key,value:Gi.value,valueSpec:C,style:Gi.style,styleSpec:Gi.styleSpec})}}function Qt(k){var C=(k.expressionContext==="property"?rc:es)($s(k.value),k.valueSpec);if(C.result==="error")return C.value.map(function(ne){return new Xn(""+k.key+ne.key,k.value,ne.message)});var G=C.value.expression||C.value._styleExpression.expression;if(k.expressionContext==="property"&&k.propertyKey==="text-font"&&!G.outputDefined())return[new Xn(k.key,k.value,'Invalid data expression for "'+k.propertyKey+'". Output values must be contained as literals within the expression.')];if(k.expressionContext==="property"&&k.propertyType==="layout"&&!Ll(G))return[new Xn(k.key,k.value,'"feature-state" data expressions are not supported with layout properties.')];if(k.expressionContext==="filter"&&!Ll(G))return[new Xn(k.key,k.value,'"feature-state" data expressions are not supported with filters.')];if(k.expressionContext&&k.expressionContext.indexOf("cluster")===0){if(!Bu(G,["zoom","feature-state"]))return[new Xn(k.key,k.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(k.expressionContext==="cluster-initial"&&!Bf(G))return[new Xn(k.key,k.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ar(k){var C=k.value,G=k.key,ne=Jo(C);return ne!=="boolean"?[new Xn(G,C,"boolean expected, "+ne+" found")]:[]}function Sr(k){var C=k.key,G=k.value,ne=Jo(G);return ne!=="string"?[new Xn(C,G,"color expected, "+ne+" found")]:Gc(G)===null?[new Xn(C,G,'color expected, "'+G+'" found')]:[]}function Kr(k){var C=k.key,G=k.value,ne=k.valueSpec,ye=[];return Array.isArray(ne.values)?ne.values.indexOf(so(G))===-1&&ye.push(new Xn(C,G,"expected one of ["+ne.values.join(", ")+"], "+JSON.stringify(G)+" found")):Object.keys(ne.values).indexOf(so(G))===-1&&ye.push(new Xn(C,G,"expected one of ["+Object.keys(ne.values).join(", ")+"], "+JSON.stringify(G)+" found")),ye}function oi(k){if(k===!0||k===!1)return!0;if(!Array.isArray(k)||k.length===0)return!1;switch(k[0]){case"has":return k.length>=2&&k[1]!=="$id"&&k[1]!=="$type";case"in":return k.length>=3&&(typeof k[1]!="string"||Array.isArray(k[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return k.length!==3||Array.isArray(k[1])||Array.isArray(k[2]);case"any":case"all":for(var C=0,G=k.slice(1);C<G.length;C+=1){var ne=G[C];if(!oi(ne)&&typeof ne!="boolean")return!1}return!0;default:return!0}}var Ge={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ze(k){if(k==null)return{filter:function(){return!0},needGeometry:!1};oi(k)||(k=Ct(k));var C=es(k,Ge);if(C.result==="error")throw new Error(C.value.map(function(ne){return ne.key+": "+ne.message}).join(", "));var G=dt(k);return{filter:function(ne,ye,Pe){return C.value.evaluate(ne,ye,{},Pe)},needGeometry:G}}function ot(k,C){return k<C?-1:k>C?1:0}function dt(k){if(!Array.isArray(k))return!1;if(k[0]==="within")return!0;for(var C=1;C<k.length;C++)if(dt(k[C]))return!0;return!1}function Ct(k){if(!k)return!0;var C=k[0];if(k.length<=1)return C!=="any";var G=C==="=="?wt(k[1],k[2],"=="):C==="!="?kr(wt(k[1],k[2],"==")):C==="<"||C===">"||C==="<="||C===">="?wt(k[1],k[2],C):C==="any"?Dt(k.slice(1)):C==="all"?["all"].concat(k.slice(1).map(Ct)):C==="none"?["all"].concat(k.slice(1).map(Ct).map(kr)):C==="in"?fr(k[1],k.slice(2)):C==="!in"?kr(fr(k[1],k.slice(2))):C==="has"?_r(k[1]):C==="!has"?kr(_r(k[1])):C==="within"?k:!0;return G}function wt(k,C,G){switch(k){case"$type":return["filter-type-"+G,C];case"$id":return["filter-id-"+G,C];default:return["filter-"+G,k,C]}}function Dt(k){return["any"].concat(k.map(Ct))}function fr(k,C){if(C.length===0)return!1;switch(k){case"$type":return["filter-type-in",["literal",C]];case"$id":return["filter-id-in",["literal",C]];default:return C.length>200&&!C.some(function(G){return typeof G!=typeof C[0]})?["filter-in-large",k,["literal",C.sort(ot)]]:["filter-in-small",k,["literal",C]]}}function _r(k){switch(k){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",k]}}function kr(k){return["!",k]}function Vr(k){return oi($s(k.value))?Qt(zs({},k,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Qr(k)}function Qr(k){var C=k.value,G=k.key;if(Jo(C)!=="array")return[new Xn(G,C,"array expected, "+Jo(C)+" found")];var ne=k.styleSpec,ye,Pe=[];if(C.length<1)return[new Xn(G,C,"filter array must have at least 1 element")];switch(Pe=Pe.concat(Kr({key:G+"[0]",value:C[0],valueSpec:ne.filter_operator,style:k.style,styleSpec:k.styleSpec})),so(C[0])){case"<":case"<=":case">":case">=":C.length>=2&&so(C[1])==="$type"&&Pe.push(new Xn(G,C,'"$type" cannot be use with operator "'+C[0]+'"'));case"==":case"!=":C.length!==3&&Pe.push(new Xn(G,C,'filter array for operator "'+C[0]+'" must have 3 elements'));case"in":case"!in":C.length>=2&&(ye=Jo(C[1]),ye!=="string"&&Pe.push(new Xn(G+"[1]",C[1],"string expected, "+ye+" found")));for(var Ve=2;Ve<C.length;Ve++)ye=Jo(C[Ve]),so(C[1])==="$type"?Pe=Pe.concat(Kr({key:G+"["+Ve+"]",value:C[Ve],valueSpec:ne.geometry_type,style:k.style,styleSpec:k.styleSpec})):ye!=="string"&&ye!=="number"&&ye!=="boolean"&&Pe.push(new Xn(G+"["+Ve+"]",C[Ve],"string, number, or boolean expected, "+ye+" found"));break;case"any":case"all":case"none":for(var ft=1;ft<C.length;ft++)Pe=Pe.concat(Qr({key:G+"["+ft+"]",value:C[ft],style:k.style,styleSpec:k.styleSpec}));break;case"has":case"!has":ye=Jo(C[1]),C.length!==2?Pe.push(new Xn(G,C,'filter array for "'+C[0]+'" operator must have 2 elements')):ye!=="string"&&Pe.push(new Xn(G+"[1]",C[1],"string expected, "+ye+" found"));break;case"within":ye=Jo(C[1]),C.length!==2?Pe.push(new Xn(G,C,'filter array for "'+C[0]+'" operator must have 2 elements')):ye!=="object"&&Pe.push(new Xn(G+"[1]",C[1],"object expected, "+ye+" found"));break}return Pe}function _i(k,C){var G=k.key,ne=k.style,ye=k.styleSpec,Pe=k.value,Ve=k.objectKey,ft=ye[C+"_"+k.layerType];if(!ft)return[];var Rt=Ve.match(/^(.*)-transition$/);if(C==="paint"&&Rt&&ft[Rt[1]]&&ft[Rt[1]].transition)return Ho({key:G,value:Pe,valueSpec:ye.transition,style:ne,styleSpec:ye});var Ht=k.valueSpec||ft[Ve];if(!Ht)return[new Xn(G,Pe,'unknown property "'+Ve+'"')];var rr;if(Jo(Pe)==="string"&&Il(Ht)&&!Ht.tokens&&(rr=/^{([^}]+)}$/.exec(Pe)))return[new Xn(G,Pe,'"'+Ve+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(rr[1])+" }`.")];var Pr=[];return k.layerType==="symbol"&&(Ve==="text-field"&&ne&&!ne.glyphs&&Pr.push(new Xn(G,Pe,'use of "text-field" requires a style "glyphs" property')),Ve==="text-font"&&cl($s(Pe))&&so(Pe.type)==="identity"&&Pr.push(new Xn(G,Pe,'"text-font" does not support identity functions'))),Pr.concat(Ho({key:k.key,value:Pe,valueSpec:Ht,style:ne,styleSpec:ye,expressionContext:"property",propertyType:C,propertyKey:Ve}))}function Pi(k){return _i(k,"paint")}function qi(k){return _i(k,"layout")}function ga(k){var C=[],G=k.value,ne=k.key,ye=k.style,Pe=k.styleSpec;!G.type&&!G.ref&&C.push(new Xn(ne,G,'either "type" or "ref" is required'));var Ve=so(G.type),ft=so(G.ref);if(G.id)for(var Rt=so(G.id),Ht=0;Ht<k.arrayIndex;Ht++){var rr=ye.layers[Ht];so(rr.id)===Rt&&C.push(new Xn(ne,G.id,'duplicate layer id "'+G.id+'", previously used at line '+rr.id.__line__))}if("ref"in G){["type","source","source-layer","filter","layout"].forEach(function(hi){hi in G&&C.push(new Xn(ne,G[hi],'"'+hi+'" is prohibited for ref layers'))});var Pr;ye.layers.forEach(function(hi){so(hi.id)===ft&&(Pr=hi)}),Pr?Pr.ref?C.push(new Xn(ne,G.ref,"ref cannot reference another ref layer")):Ve=so(Pr.type):C.push(new Xn(ne,G.ref,'ref layer "'+ft+'" not found'))}else if(Ve!=="background")if(!G.source)C.push(new Xn(ne,G,'missing required property "source"'));else{var Zr=ye.sources&&ye.sources[G.source],Hr=Zr&&so(Zr.type);Zr?Hr==="vector"&&Ve==="raster"?C.push(new Xn(ne,G.source,'layer "'+G.id+'" requires a raster source')):Hr==="raster"&&Ve!=="raster"?C.push(new Xn(ne,G.source,'layer "'+G.id+'" requires a vector source')):Hr==="vector"&&!G["source-layer"]?C.push(new Xn(ne,G,'layer "'+G.id+'" must specify a "source-layer"')):Hr==="raster-dem"&&Ve!=="hillshade"?C.push(new Xn(ne,G.source,"raster-dem source can only be used with layer type 'hillshade'.")):Ve==="line"&&G.paint&&G.paint["line-gradient"]&&(Hr!=="geojson"||!Zr.lineMetrics)&&C.push(new Xn(ne,G,'layer "'+G.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):C.push(new Xn(ne,G.source,'source "'+G.source+'" not found'))}return C=C.concat(Oe({key:ne,value:G,valueSpec:Pe.layer,style:k.style,styleSpec:k.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Ho({key:ne+".type",value:G.type,valueSpec:Pe.layer.type,style:k.style,styleSpec:k.styleSpec,object:G,objectKey:"type"})},filter:Vr,layout:function(Gi){return Oe({layer:G,key:Gi.key,value:Gi.value,style:Gi.style,styleSpec:Gi.styleSpec,objectElementValidators:{"*":function(ha){return qi(zs({layerType:Ve},ha))}}})},paint:function(Gi){return Oe({layer:G,key:Gi.key,value:Gi.value,style:Gi.style,styleSpec:Gi.styleSpec,objectElementValidators:{"*":function(ha){return Pi(zs({layerType:Ve},ha))}}})}}})),C}function Qa(k){var C=k.value,G=k.key,ne=Jo(C);return ne!=="string"?[new Xn(G,C,"string expected, "+ne+" found")]:[]}var $a={promoteId:qn};function yn(k){var C=k.value,G=k.key,ne=k.styleSpec,ye=k.style;if(!C.type)return[new Xn(G,C,'"type" is required')];var Pe=so(C.type),Ve;switch(Pe){case"vector":case"raster":case"raster-dem":return Ve=Oe({key:G,value:C,valueSpec:ne["source_"+Pe.replace("-","_")],style:k.style,styleSpec:ne,objectElementValidators:$a}),Ve;case"geojson":if(Ve=Oe({key:G,value:C,valueSpec:ne.source_geojson,style:ye,styleSpec:ne,objectElementValidators:$a}),C.cluster)for(var ft in C.clusterProperties){var Rt=C.clusterProperties[ft],Ht=Rt[0],rr=Rt[1],Pr=typeof Ht=="string"?[Ht,["accumulated"],["get",ft]]:Ht;Ve.push.apply(Ve,Qt({key:G+"."+ft+".map",value:rr,expressionContext:"cluster-map"})),Ve.push.apply(Ve,Qt({key:G+"."+ft+".reduce",value:Pr,expressionContext:"cluster-reduce"}))}return Ve;case"video":return Oe({key:G,value:C,valueSpec:ne.source_video,style:ye,styleSpec:ne});case"image":return Oe({key:G,value:C,valueSpec:ne.source_image,style:ye,styleSpec:ne});case"canvas":return[new Xn(G,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Kr({key:G+".type",value:C.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:ye,styleSpec:ne})}}function qn(k){var C=k.key,G=k.value;if(Jo(G)==="string")return Qa({key:C,value:G});var ne=[];for(var ye in G)ne.push.apply(ne,Qa({key:C+"."+ye,value:G[ye]}));return ne}function po(k){var C=k.value,G=k.styleSpec,ne=G.light,ye=k.style,Pe=[],Ve=Jo(C);if(C===void 0)return Pe;if(Ve!=="object")return Pe=Pe.concat([new Xn("light",C,"object expected, "+Ve+" found")]),Pe;for(var ft in C){var Rt=ft.match(/^(.*)-transition$/);Rt&&ne[Rt[1]]&&ne[Rt[1]].transition?Pe=Pe.concat(Ho({key:ft,value:C[ft],valueSpec:G.transition,style:ye,styleSpec:G})):ne[ft]?Pe=Pe.concat(Ho({key:ft,value:C[ft],valueSpec:ne[ft],style:ye,styleSpec:G})):Pe=Pe.concat([new Xn(ft,C[ft],'unknown property "'+ft+'"')])}return Pe}function to(k){return Qa(k).length===0?[]:Qt(k)}function Vo(k){return Qa(k).length===0?[]:Qt(k)}var bs={"*":function(){return[]},array:ht,boolean:Ar,number:Tt,color:Sr,constants:tl,enum:Kr,filter:Vr,function:Ot,layer:ga,object:Oe,source:yn,light:po,string:Qa,formatted:to,resolvedImage:Vo};function Ho(k){var C=k.value,G=k.valueSpec,ne=k.styleSpec;if(G.expression&&cl(so(C)))return Ot(k);if(G.expression&&Po($s(C)))return Qt(k);if(G.type&&bs[G.type])return bs[G.type](k);var ye=Oe(zs({},k,{valueSpec:G.type?ne[G.type]:G}));return ye}function ds(k){var C=k.value,G=k.key,ne=Qa(k);return ne.length||(C.indexOf("{fontstack}")===-1&&ne.push(new Xn(G,C,'"glyphs" url must include a "{fontstack}" token')),C.indexOf("{range}")===-1&&ne.push(new Xn(G,C,'"glyphs" url must include a "{range}" token'))),ne}function Is(k,C){C===void 0&&(C=rn);var G=[];return G=G.concat(Ho({key:"",value:k,valueSpec:C.$root,styleSpec:C,style:k,objectElementValidators:{glyphs:ds,"*":function(){return[]}}})),k.constants&&(G=G.concat(tl({key:"constants",value:k.constants,style:k,styleSpec:C}))),Tl(G)}Is.source=dl(yn),Is.light=dl(po),Is.layer=dl(ga),Is.filter=dl(Vr),Is.paintProperty=dl(Pi),Is.layoutProperty=dl(qi);function Tl(k){return[].concat(k).sort(function(C,G){return C.line-G.line})}function dl(k){return function(){for(var C=[],G=arguments.length;G--;)C[G]=arguments[G];return Tl(k.apply(this,C))}}var ms=Is,gs=ms.light,ql=ms.paintProperty,uu=ms.layoutProperty;function Uu(k,C){var G=!1;if(C&&C.length)for(var ne=0,ye=C;ne<ye.length;ne+=1){var Pe=ye[ne];k.fire(new Lr(new Error(Pe.message))),G=!0}return G}var Su=yu,Fl=3;function yu(k,C,G){var ne=this.cells=[];if(k instanceof ArrayBuffer){this.arrayBuffer=k;var ye=new Int32Array(this.arrayBuffer);k=ye[0],C=ye[1],G=ye[2],this.d=C+2*G;for(var Pe=0;Pe<this.d*this.d;Pe++){var Ve=ye[Fl+Pe],ft=ye[Fl+Pe+1];ne.push(Ve===ft?null:ye.subarray(Ve,ft))}var Rt=ye[Fl+ne.length],Ht=ye[Fl+ne.length+1];this.keys=ye.subarray(Rt,Ht),this.bboxes=ye.subarray(Ht),this.insert=this._insertReadonly}else{this.d=C+2*G;for(var rr=0;rr<this.d*this.d;rr++)ne.push([]);this.keys=[],this.bboxes=[]}this.n=C,this.extent=k,this.padding=G,this.scale=C/k,this.uid=0;var Pr=G/C*k;this.min=-Pr,this.max=k+Pr}yu.prototype.insert=function(k,C,G,ne,ye){this._forEachCell(C,G,ne,ye,this._insertCell,this.uid++),this.keys.push(k),this.bboxes.push(C),this.bboxes.push(G),this.bboxes.push(ne),this.bboxes.push(ye)},yu.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},yu.prototype._insertCell=function(k,C,G,ne,ye,Pe){this.cells[ye].push(Pe)},yu.prototype.query=function(k,C,G,ne,ye){var Pe=this.min,Ve=this.max;if(k<=Pe&&C<=Pe&&Ve<=G&&Ve<=ne&&!ye)return Array.prototype.slice.call(this.keys);var ft=[],Rt={};return this._forEachCell(k,C,G,ne,this._queryCell,ft,Rt,ye),ft},yu.prototype._queryCell=function(k,C,G,ne,ye,Pe,Ve,ft){var Rt=this.cells[ye];if(Rt!==null)for(var Ht=this.keys,rr=this.bboxes,Pr=0;Pr<Rt.length;Pr++){var Zr=Rt[Pr];if(Ve[Zr]===void 0){var Hr=Zr*4;(ft?ft(rr[Hr+0],rr[Hr+1],rr[Hr+2],rr[Hr+3]):k<=rr[Hr+2]&&C<=rr[Hr+3]&&G>=rr[Hr+0]&&ne>=rr[Hr+1])?(Ve[Zr]=!0,Pe.push(Ht[Zr])):Ve[Zr]=!1}}},yu.prototype._forEachCell=function(k,C,G,ne,ye,Pe,Ve,ft){for(var Rt=this._convertToCellCoord(k),Ht=this._convertToCellCoord(C),rr=this._convertToCellCoord(G),Pr=this._convertToCellCoord(ne),Zr=Rt;Zr<=rr;Zr++)for(var Hr=Ht;Hr<=Pr;Hr++){var hi=this.d*Hr+Zr;if(!(ft&&!ft(this._convertFromCellCoord(Zr),this._convertFromCellCoord(Hr),this._convertFromCellCoord(Zr+1),this._convertFromCellCoord(Hr+1)))&&ye.call(this,k,C,G,ne,hi,Pe,Ve,ft))return}},yu.prototype._convertFromCellCoord=function(k){return(k-this.padding)/this.scale},yu.prototype._convertToCellCoord=function(k){return Math.max(0,Math.min(this.d-1,Math.floor(k*this.scale)+this.padding))},yu.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var k=this.cells,C=Fl+this.cells.length+1+1,G=0,ne=0;ne<this.cells.length;ne++)G+=this.cells[ne].length;var ye=new Int32Array(C+G+this.keys.length+this.bboxes.length);ye[0]=this.extent,ye[1]=this.n,ye[2]=this.padding;for(var Pe=C,Ve=0;Ve<k.length;Ve++){var ft=k[Ve];ye[Fl+Ve]=Pe,ye.set(ft,Pe),Pe+=ft.length}return ye[Fl+k.length]=Pe,ye.set(this.keys,Pe),Pe+=this.keys.length,ye[Fl+k.length+1]=Pe,ye.set(this.bboxes,Pe),Pe+=this.bboxes.length,ye.buffer};var dc=s.ImageData,Ql=s.ImageBitmap,eu={};function de(k,C,G){G===void 0&&(G={}),Object.defineProperty(C,"_classRegistryKey",{value:k,writeable:!1}),eu[k]={klass:C,omit:G.omit||[],shallow:G.shallow||[]}}de("Object",Object),Su.serialize=function(C,G){var ne=C.toArrayBuffer();return G&&G.push(ne),{buffer:ne}},Su.deserialize=function(C){return new Su(C.buffer)},de("Grid",Su),de("Color",Js),de("Error",Error),de("ResolvedImage",Vl),de("StylePropertyFunction",Ue),de("StyleExpression",wc,{omit:["_evaluator"]}),de("ZoomDependentExpression",hc),de("ZoomConstantExpression",Nc),de("CompoundExpression",xo,{omit:["_evaluate"]});for(var Fe in Oo)Oo[Fe]._classRegistryKey||de("Expression_"+Fe,Oo[Fe]);function Je(k){return k&&typeof ArrayBuffer<"u"&&(k instanceof ArrayBuffer||k.constructor&&k.constructor.name==="ArrayBuffer")}function vt(k){return Ql&&k instanceof Ql}function _t(k,C){if(k==null||typeof k=="boolean"||typeof k=="number"||typeof k=="string"||k instanceof Boolean||k instanceof Number||k instanceof String||k instanceof Date||k instanceof RegExp)return k;if(Je(k)||vt(k))return C&&C.push(k),k;if(ArrayBuffer.isView(k)){var G=k;return C&&C.push(G.buffer),G}if(k instanceof dc)return C&&C.push(k.data.buffer),k;if(Array.isArray(k)){for(var ne=[],ye=0,Pe=k;ye<Pe.length;ye+=1){var Ve=Pe[ye];ne.push(_t(Ve,C))}return ne}if(typeof k=="object"){var ft=k.constructor,Rt=ft._classRegistryKey;if(!Rt)throw new Error("can't serialize object of unregistered class");var Ht=ft.serialize?ft.serialize(k,C):{};if(!ft.serialize){for(var rr in k)if(k.hasOwnProperty(rr)&&!(eu[Rt].omit.indexOf(rr)>=0)){var Pr=k[rr];Ht[rr]=eu[Rt].shallow.indexOf(rr)>=0?Pr:_t(Pr,C)}k instanceof Error&&(Ht.message=k.message)}if(Ht.$name)throw new Error("$name property is reserved for worker serialization logic.");return Rt!=="Object"&&(Ht.$name=Rt),Ht}throw new Error("can't serialize object of type "+typeof k)}function At(k){if(k==null||typeof k=="boolean"||typeof k=="number"||typeof k=="string"||k instanceof Boolean||k instanceof Number||k instanceof String||k instanceof Date||k instanceof RegExp||Je(k)||vt(k)||ArrayBuffer.isView(k)||k instanceof dc)return k;if(Array.isArray(k))return k.map(At);if(typeof k=="object"){var C=k.$name||"Object",G=eu[C],ne=G.klass;if(!ne)throw new Error("can't deserialize unregistered class "+C);if(ne.deserialize)return ne.deserialize(k);for(var ye=Object.create(ne.prototype),Pe=0,Ve=Object.keys(k);Pe<Ve.length;Pe+=1){var ft=Ve[Pe];if(ft!=="$name"){var Rt=k[ft];ye[ft]=eu[C].shallow.indexOf(ft)>=0?Rt:At(Rt)}}return ye}throw new Error("can't deserialize object of type "+typeof k)}var ar=function(){this.first=!0};ar.prototype.update=function(C,G){var ne=Math.floor(C);return this.first?(this.first=!1,this.lastIntegerZoom=ne,this.lastIntegerZoomTime=0,this.lastZoom=C,this.lastFloorZoom=ne,!0):(this.lastFloorZoom>ne?(this.lastIntegerZoom=ne+1,this.lastIntegerZoomTime=G):this.lastFloorZoom<ne&&(this.lastIntegerZoom=ne,this.lastIntegerZoomTime=G),C!==this.lastZoom?(this.lastZoom=C,this.lastFloorZoom=ne,!0):!1)};var Ft={"Latin-1 Supplement":function(k){return k>=128&&k<=255},Arabic:function(k){return k>=1536&&k<=1791},"Arabic Supplement":function(k){return k>=1872&&k<=1919},"Arabic Extended-A":function(k){return k>=2208&&k<=2303},"Hangul Jamo":function(k){return k>=4352&&k<=4607},"Unified Canadian Aboriginal Syllabics":function(k){return k>=5120&&k<=5759},Khmer:function(k){return k>=6016&&k<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(k){return k>=6320&&k<=6399},"General Punctuation":function(k){return k>=8192&&k<=8303},"Letterlike Symbols":function(k){return k>=8448&&k<=8527},"Number Forms":function(k){return k>=8528&&k<=8591},"Miscellaneous Technical":function(k){return k>=8960&&k<=9215},"Control Pictures":function(k){return k>=9216&&k<=9279},"Optical Character Recognition":function(k){return k>=9280&&k<=9311},"Enclosed Alphanumerics":function(k){return k>=9312&&k<=9471},"Geometric Shapes":function(k){return k>=9632&&k<=9727},"Miscellaneous Symbols":function(k){return k>=9728&&k<=9983},"Miscellaneous Symbols and Arrows":function(k){return k>=11008&&k<=11263},"CJK Radicals Supplement":function(k){return k>=11904&&k<=12031},"Kangxi Radicals":function(k){return k>=12032&&k<=12255},"Ideographic Description Characters":function(k){return k>=12272&&k<=12287},"CJK Symbols and Punctuation":function(k){return k>=12288&&k<=12351},Hiragana:function(k){return k>=12352&&k<=12447},Katakana:function(k){return k>=12448&&k<=12543},Bopomofo:function(k){return k>=12544&&k<=12591},"Hangul Compatibility Jamo":function(k){return k>=12592&&k<=12687},Kanbun:function(k){return k>=12688&&k<=12703},"Bopomofo Extended":function(k){return k>=12704&&k<=12735},"CJK Strokes":function(k){return k>=12736&&k<=12783},"Katakana Phonetic Extensions":function(k){return k>=12784&&k<=12799},"Enclosed CJK Letters and Months":function(k){return k>=12800&&k<=13055},"CJK Compatibility":function(k){return k>=13056&&k<=13311},"CJK Unified Ideographs Extension A":function(k){return k>=13312&&k<=19903},"Yijing Hexagram Symbols":function(k){return k>=19904&&k<=19967},"CJK Unified Ideographs":function(k){return k>=19968&&k<=40959},"Yi Syllables":function(k){return k>=40960&&k<=42127},"Yi Radicals":function(k){return k>=42128&&k<=42191},"Hangul Jamo Extended-A":function(k){return k>=43360&&k<=43391},"Hangul Syllables":function(k){return k>=44032&&k<=55215},"Hangul Jamo Extended-B":function(k){return k>=55216&&k<=55295},"Private Use Area":function(k){return k>=57344&&k<=63743},"CJK Compatibility Ideographs":function(k){return k>=63744&&k<=64255},"Arabic Presentation Forms-A":function(k){return k>=64336&&k<=65023},"Vertical Forms":function(k){return k>=65040&&k<=65055},"CJK Compatibility Forms":function(k){return k>=65072&&k<=65103},"Small Form Variants":function(k){return k>=65104&&k<=65135},"Arabic Presentation Forms-B":function(k){return k>=65136&&k<=65279},"Halfwidth and Fullwidth Forms":function(k){return k>=65280&&k<=65519}};function xr(k){for(var C=0,G=k;C<G.length;C+=1){var ne=G[C];if(xi(ne.charCodeAt(0)))return!0}return!1}function Gr(k){for(var C=0,G=k;C<G.length;C+=1){var ne=G[C];if(!Yr(ne.charCodeAt(0)))return!1}return!0}function Yr(k){return!(Ft.Arabic(k)||Ft["Arabic Supplement"](k)||Ft["Arabic Extended-A"](k)||Ft["Arabic Presentation Forms-A"](k)||Ft["Arabic Presentation Forms-B"](k))}function Ei(k){return k<11904?!1:!!(Ft["Bopomofo Extended"](k)||Ft.Bopomofo(k)||Ft["CJK Compatibility Forms"](k)||Ft["CJK Compatibility Ideographs"](k)||Ft["CJK Compatibility"](k)||Ft["CJK Radicals Supplement"](k)||Ft["CJK Strokes"](k)||Ft["CJK Symbols and Punctuation"](k)||Ft["CJK Unified Ideographs Extension A"](k)||Ft["CJK Unified Ideographs"](k)||Ft["Enclosed CJK Letters and Months"](k)||Ft["Halfwidth and Fullwidth Forms"](k)||Ft.Hiragana(k)||Ft["Ideographic Description Characters"](k)||Ft["Kangxi Radicals"](k)||Ft["Katakana Phonetic Extensions"](k)||Ft.Katakana(k)||Ft["Vertical Forms"](k)||Ft["Yi Radicals"](k)||Ft["Yi Syllables"](k))}function xi(k){return k===746||k===747?!0:k<4352?!1:!!(Ft["Bopomofo Extended"](k)||Ft.Bopomofo(k)||Ft["CJK Compatibility Forms"](k)&&!(k>=65097&&k<=65103)||Ft["CJK Compatibility Ideographs"](k)||Ft["CJK Compatibility"](k)||Ft["CJK Radicals Supplement"](k)||Ft["CJK Strokes"](k)||Ft["CJK Symbols and Punctuation"](k)&&!(k>=12296&&k<=12305)&&!(k>=12308&&k<=12319)&&k!==12336||Ft["CJK Unified Ideographs Extension A"](k)||Ft["CJK Unified Ideographs"](k)||Ft["Enclosed CJK Letters and Months"](k)||Ft["Hangul Compatibility Jamo"](k)||Ft["Hangul Jamo Extended-A"](k)||Ft["Hangul Jamo Extended-B"](k)||Ft["Hangul Jamo"](k)||Ft["Hangul Syllables"](k)||Ft.Hiragana(k)||Ft["Ideographic Description Characters"](k)||Ft.Kanbun(k)||Ft["Kangxi Radicals"](k)||Ft["Katakana Phonetic Extensions"](k)||Ft.Katakana(k)&&k!==12540||Ft["Halfwidth and Fullwidth Forms"](k)&&k!==65288&&k!==65289&&k!==65293&&!(k>=65306&&k<=65310)&&k!==65339&&k!==65341&&k!==65343&&!(k>=65371&&k<=65503)&&k!==65507&&!(k>=65512&&k<=65519)||Ft["Small Form Variants"](k)&&!(k>=65112&&k<=65118)&&!(k>=65123&&k<=65126)||Ft["Unified Canadian Aboriginal Syllabics"](k)||Ft["Unified Canadian Aboriginal Syllabics Extended"](k)||Ft["Vertical Forms"](k)||Ft["Yijing Hexagram Symbols"](k)||Ft["Yi Syllables"](k)||Ft["Yi Radicals"](k))}function na(k){return!!(Ft["Latin-1 Supplement"](k)&&(k===167||k===169||k===174||k===177||k===188||k===189||k===190||k===215||k===247)||Ft["General Punctuation"](k)&&(k===8214||k===8224||k===8225||k===8240||k===8241||k===8251||k===8252||k===8258||k===8263||k===8264||k===8265||k===8273)||Ft["Letterlike Symbols"](k)||Ft["Number Forms"](k)||Ft["Miscellaneous Technical"](k)&&(k>=8960&&k<=8967||k>=8972&&k<=8991||k>=8996&&k<=9e3||k===9003||k>=9085&&k<=9114||k>=9150&&k<=9165||k===9167||k>=9169&&k<=9179||k>=9186&&k<=9215)||Ft["Control Pictures"](k)&&k!==9251||Ft["Optical Character Recognition"](k)||Ft["Enclosed Alphanumerics"](k)||Ft["Geometric Shapes"](k)||Ft["Miscellaneous Symbols"](k)&&!(k>=9754&&k<=9759)||Ft["Miscellaneous Symbols and Arrows"](k)&&(k>=11026&&k<=11055||k>=11088&&k<=11097||k>=11192&&k<=11243)||Ft["CJK Symbols and Punctuation"](k)||Ft.Katakana(k)||Ft["Private Use Area"](k)||Ft["CJK Compatibility Forms"](k)||Ft["Small Form Variants"](k)||Ft["Halfwidth and Fullwidth Forms"](k)||k===8734||k===8756||k===8757||k>=9984&&k<=10087||k>=10102&&k<=10131||k===65532||k===65533)}function ua(k){return!(xi(k)||na(k))}function Di(k){return Ft.Arabic(k)||Ft["Arabic Supplement"](k)||Ft["Arabic Extended-A"](k)||Ft["Arabic Presentation Forms-A"](k)||Ft["Arabic Presentation Forms-B"](k)}function Hi(k){return k>=1424&&k<=2303||Ft["Arabic Presentation Forms-A"](k)||Ft["Arabic Presentation Forms-B"](k)}function ta(k,C){return!(!C&&Hi(k)||k>=2304&&k<=3583||k>=3840&&k<=4255||Ft.Khmer(k))}function ya(k){for(var C=0,G=k;C<G.length;C+=1){var ne=G[C];if(Hi(ne.charCodeAt(0)))return!0}return!1}function da(k,C){for(var G=0,ne=k;G<ne.length;G+=1){var ye=ne[G];if(!ta(ye.charCodeAt(0),C))return!1}return!0}var Oi={unavailable:"unavailable",deferred:"deferred",loading:"loading",loaded:"loaded",error:"error"},xn=null,mn=Oi.unavailable,In=null,Yn=function(k){k&&typeof k=="string"&&k.indexOf("NetworkError")>-1&&(mn=Oi.error),xn&&xn(k)};function mo(){bo.fire(new Nr("pluginStateChange",{pluginStatus:mn,pluginURL:In}))}var bo=new br,vs=function(){return mn},To=function(k){return k({pluginStatus:mn,pluginURL:In}),bo.on("pluginStateChange",k),k},cs=function(k,C,G){if(G===void 0&&(G=!1),mn===Oi.deferred||mn===Oi.loading||mn===Oi.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");In=_e.resolveURL(k),mn=Oi.deferred,xn=C,mo(),G||Al()},Al=function(){if(mn!==Oi.deferred||!In)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");mn=Oi.loading,mo(),In&&ii({url:In},function(k){k?Yn(k):(mn=Oi.loaded,mo())})},ml={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return mn===Oi.loaded||ml.applyArabicShaping!=null},isLoading:function(){return mn===Oi.loading},setState:function(C){mn=C.pluginStatus,In=C.pluginURL},isParsed:function(){return ml.applyArabicShaping!=null&&ml.processBidirectionalText!=null&&ml.processStyledBidirectionalText!=null},getPluginURL:function(){return In}},Pl=function(){!ml.isLoading()&&!ml.isLoaded()&&vs()==="deferred"&&Al()},Dn=function(C,G){this.zoom=C,G?(this.now=G.now,this.fadeDuration=G.fadeDuration,this.zoomHistory=G.zoomHistory,this.transition=G.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ar,this.transition={})};Dn.prototype.isSupportedScript=function(C){return da(C,ml.isLoaded())},Dn.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Dn.prototype.getCrossfadeParameters=function(){var C=this.zoom,G=C-Math.floor(C),ne=this.crossFadingFactor();return C>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:G+(1-G)*ne}:{fromScale:.5,toScale:1,t:1-(1-ne)*G}};var zo=function(C,G){this.property=C,this.value=G,this.expression=P(G===void 0?C.specification.default:G,C.specification)};zo.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},zo.prototype.possiblyEvaluate=function(C,G,ne){return this.property.possiblyEvaluate(this,C,G,ne)};var ks=function(C){this.property=C,this.value=new zo(C,void 0)};ks.prototype.transitioned=function(C,G){return new Bl(this.property,this.value,G,g({},C.transition,this.transition),C.now)},ks.prototype.untransitioned=function(){return new Bl(this.property,this.value,null,{},0)};var Rs=function(C){this._properties=C,this._values=Object.create(C.defaultTransitionablePropertyValues)};Rs.prototype.getValue=function(C){return B(this._values[C].value.value)},Rs.prototype.setValue=function(C,G){this._values.hasOwnProperty(C)||(this._values[C]=new ks(this._values[C].property)),this._values[C].value=new zo(this._values[C].property,G===null?void 0:B(G))},Rs.prototype.getTransition=function(C){return B(this._values[C].transition)},Rs.prototype.setTransition=function(C,G){this._values.hasOwnProperty(C)||(this._values[C]=new ks(this._values[C].property)),this._values[C].transition=B(G)||void 0},Rs.prototype.serialize=function(){for(var C={},G=0,ne=Object.keys(this._values);G<ne.length;G+=1){var ye=ne[G],Pe=this.getValue(ye);Pe!==void 0&&(C[ye]=Pe);var Ve=this.getTransition(ye);Ve!==void 0&&(C[ye+"-transition"]=Ve)}return C},Rs.prototype.transitioned=function(C,G){for(var ne=new tu(this._properties),ye=0,Pe=Object.keys(this._values);ye<Pe.length;ye+=1){var Ve=Pe[ye];ne._values[Ve]=this._values[Ve].transitioned(C,G._values[Ve])}return ne},Rs.prototype.untransitioned=function(){for(var C=new tu(this._properties),G=0,ne=Object.keys(this._values);G<ne.length;G+=1){var ye=ne[G];C._values[ye]=this._values[ye].untransitioned()}return C};var Bl=function(C,G,ne,ye,Pe){this.property=C,this.value=G,this.begin=Pe+ye.delay||0,this.end=this.begin+ye.duration||0,C.specification.transition&&(ye.delay||ye.duration)&&(this.prior=ne)};Bl.prototype.possiblyEvaluate=function(C,G,ne){var ye=C.now||0,Pe=this.value.possiblyEvaluate(C,G,ne),Ve=this.prior;if(Ve){if(ye>this.end)return this.prior=null,Pe;if(this.value.isDataDriven())return this.prior=null,Pe;if(ye<this.begin)return Ve.possiblyEvaluate(C,G,ne);var ft=(ye-this.begin)/(this.end-this.begin);return this.property.interpolate(Ve.possiblyEvaluate(C,G,ne),Pe,m(ft))}else return Pe};var tu=function(C){this._properties=C,this._values=Object.create(C.defaultTransitioningPropertyValues)};tu.prototype.possiblyEvaluate=function(C,G,ne){for(var ye=new Tc(this._properties),Pe=0,Ve=Object.keys(this._values);Pe<Ve.length;Pe+=1){var ft=Ve[Pe];ye._values[ft]=this._values[ft].possiblyEvaluate(C,G,ne)}return ye},tu.prototype.hasTransition=function(){for(var C=0,G=Object.keys(this._values);C<G.length;C+=1){var ne=G[C];if(this._values[ne].prior)return!0}return!1};var Ru=function(C){this._properties=C,this._values=Object.create(C.defaultPropertyValues)};Ru.prototype.getValue=function(C){return B(this._values[C].value)},Ru.prototype.setValue=function(C,G){this._values[C]=new zo(this._values[C].property,G===null?void 0:B(G))},Ru.prototype.serialize=function(){for(var C={},G=0,ne=Object.keys(this._values);G<ne.length;G+=1){var ye=ne[G],Pe=this.getValue(ye);Pe!==void 0&&(C[ye]=Pe)}return C},Ru.prototype.possiblyEvaluate=function(C,G,ne){for(var ye=new Tc(this._properties),Pe=0,Ve=Object.keys(this._values);Pe<Ve.length;Pe+=1){var ft=Ve[Pe];ye._values[ft]=this._values[ft].possiblyEvaluate(C,G,ne)}return ye};var Hl=function(C,G,ne){this.property=C,this.value=G,this.parameters=ne};Hl.prototype.isConstant=function(){return this.value.kind==="constant"},Hl.prototype.constantOr=function(C){return this.value.kind==="constant"?this.value.value:C},Hl.prototype.evaluate=function(C,G,ne,ye){return this.property.evaluate(this.value,this.parameters,C,G,ne,ye)};var Tc=function(C){this._properties=C,this._values=Object.create(C.defaultPossiblyEvaluatedValues)};Tc.prototype.get=function(C){return this._values[C]};var rt=function(C){this.specification=C};rt.prototype.possiblyEvaluate=function(C,G){return C.expression.evaluate(G)},rt.prototype.interpolate=function(C,G,ne){var ye=Wu[this.specification.type];return ye?ye(C,G,ne):C};var Yt=function(C,G){this.specification=C,this.overrides=G};Yt.prototype.possiblyEvaluate=function(C,G,ne,ye){return C.expression.kind==="constant"||C.expression.kind==="camera"?new Hl(this,{kind:"constant",value:C.expression.evaluate(G,null,{},ne,ye)},G):new Hl(this,C.expression,G)},Yt.prototype.interpolate=function(C,G,ne){if(C.value.kind!=="constant"||G.value.kind!=="constant")return C;if(C.value.value===void 0||G.value.value===void 0)return new Hl(this,{kind:"constant",value:void 0},C.parameters);var ye=Wu[this.specification.type];return ye?new Hl(this,{kind:"constant",value:ye(C.value.value,G.value.value,ne)},C.parameters):C},Yt.prototype.evaluate=function(C,G,ne,ye,Pe,Ve){return C.kind==="constant"?C.value:C.evaluate(G,ne,ye,Pe,Ve)};var hr=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.possiblyEvaluate=function(ne,ye,Pe,Ve){if(ne.value===void 0)return new Hl(this,{kind:"constant",value:void 0},ye);if(ne.expression.kind==="constant"){var ft=ne.expression.evaluate(ye,null,{},Pe,Ve),Rt=ne.property.specification.type==="resolvedImage",Ht=Rt&&typeof ft!="string"?ft.name:ft,rr=this._calculate(Ht,Ht,Ht,ye);return new Hl(this,{kind:"constant",value:rr},ye)}else if(ne.expression.kind==="camera"){var Pr=this._calculate(ne.expression.evaluate({zoom:ye.zoom-1}),ne.expression.evaluate({zoom:ye.zoom}),ne.expression.evaluate({zoom:ye.zoom+1}),ye);return new Hl(this,{kind:"constant",value:Pr},ye)}else return new Hl(this,ne.expression,ye)},C.prototype.evaluate=function(ne,ye,Pe,Ve,ft,Rt){if(ne.kind==="source"){var Ht=ne.evaluate(ye,Pe,Ve,ft,Rt);return this._calculate(Ht,Ht,Ht,ye)}else return ne.kind==="composite"?this._calculate(ne.evaluate({zoom:Math.floor(ye.zoom)-1},Pe,Ve),ne.evaluate({zoom:Math.floor(ye.zoom)},Pe,Ve),ne.evaluate({zoom:Math.floor(ye.zoom)+1},Pe,Ve),ye):ne.value},C.prototype._calculate=function(ne,ye,Pe,Ve){var ft=Ve.zoom;return ft>Ve.zoomHistory.lastIntegerZoom?{from:ne,to:ye}:{from:Pe,to:ye}},C.prototype.interpolate=function(ne){return ne},C}(Yt),li=function(C){this.specification=C};li.prototype.possiblyEvaluate=function(C,G,ne,ye){if(C.value!==void 0)if(C.expression.kind==="constant"){var Pe=C.expression.evaluate(G,null,{},ne,ye);return this._calculate(Pe,Pe,Pe,G)}else return this._calculate(C.expression.evaluate(new Dn(Math.floor(G.zoom-1),G)),C.expression.evaluate(new Dn(Math.floor(G.zoom),G)),C.expression.evaluate(new Dn(Math.floor(G.zoom+1),G)),G)},li.prototype._calculate=function(C,G,ne,ye){var Pe=ye.zoom;return Pe>ye.zoomHistory.lastIntegerZoom?{from:C,to:G}:{from:ne,to:G}},li.prototype.interpolate=function(C){return C};var Ci=function(C){this.specification=C};Ci.prototype.possiblyEvaluate=function(C,G,ne,ye){return!!C.expression.evaluate(G,null,{},ne,ye)},Ci.prototype.interpolate=function(){return!1};var Ti=function(C){this.properties=C,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var G in C){var ne=C[G];ne.specification.overridable&&this.overridableProperties.push(G);var ye=this.defaultPropertyValues[G]=new zo(ne,void 0),Pe=this.defaultTransitionablePropertyValues[G]=new ks(ne);this.defaultTransitioningPropertyValues[G]=Pe.untransitioned(),this.defaultPossiblyEvaluatedValues[G]=ye.possiblyEvaluate({})}};de("DataDrivenProperty",Yt),de("DataConstantProperty",rt),de("CrossFadedDataDrivenProperty",hr),de("CrossFadedProperty",li),de("ColorRampProperty",Ci);var Mi="-transition",ia=function(k){function C(G,ne){if(k.call(this),this.id=G.id,this.type=G.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},G.type!=="custom"&&(G=G,this.metadata=G.metadata,this.minzoom=G.minzoom,this.maxzoom=G.maxzoom,G.type!=="background"&&(this.source=G.source,this.sourceLayer=G["source-layer"],this.filter=G.filter),ne.layout&&(this._unevaluatedLayout=new Ru(ne.layout)),ne.paint)){this._transitionablePaint=new Rs(ne.paint);for(var ye in G.paint)this.setPaintProperty(ye,G.paint[ye],{validate:!1});for(var Pe in G.layout)this.setLayoutProperty(Pe,G.layout[Pe],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Tc(ne.paint)}}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},C.prototype.getLayoutProperty=function(ne){return ne==="visibility"?this.visibility:this._unevaluatedLayout.getValue(ne)},C.prototype.setLayoutProperty=function(ne,ye,Pe){if(Pe===void 0&&(Pe={}),ye!=null){var Ve="layers."+this.id+".layout."+ne;if(this._validate(uu,Ve,ne,ye,Pe))return}if(ne==="visibility"){this.visibility=ye;return}this._unevaluatedLayout.setValue(ne,ye)},C.prototype.getPaintProperty=function(ne){return z(ne,Mi)?this._transitionablePaint.getTransition(ne.slice(0,-Mi.length)):this._transitionablePaint.getValue(ne)},C.prototype.setPaintProperty=function(ne,ye,Pe){if(Pe===void 0&&(Pe={}),ye!=null){var Ve="layers."+this.id+".paint."+ne;if(this._validate(ql,Ve,ne,ye,Pe))return!1}if(z(ne,Mi))return this._transitionablePaint.setTransition(ne.slice(0,-Mi.length),ye||void 0),!1;var ft=this._transitionablePaint._values[ne],Rt=ft.property.specification["property-type"]==="cross-faded-data-driven",Ht=ft.value.isDataDriven(),rr=ft.value;this._transitionablePaint.setValue(ne,ye),this._handleSpecialPaintPropertyUpdate(ne);var Pr=this._transitionablePaint._values[ne].value,Zr=Pr.isDataDriven();return Zr||Ht||Rt||this._handleOverridablePaintPropertyUpdate(ne,rr,Pr)},C.prototype._handleSpecialPaintPropertyUpdate=function(ne){},C.prototype._handleOverridablePaintPropertyUpdate=function(ne,ye,Pe){return!1},C.prototype.isHidden=function(ne){return this.minzoom&&ne<this.minzoom||this.maxzoom&&ne>=this.maxzoom?!0:this.visibility==="none"},C.prototype.updateTransitions=function(ne){this._transitioningPaint=this._transitionablePaint.transitioned(ne,this._transitioningPaint)},C.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},C.prototype.recalculate=function(ne,ye){ne.getCrossfadeParameters&&(this._crossfadeParameters=ne.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(ne,void 0,ye)),this.paint=this._transitioningPaint.possiblyEvaluate(ne,void 0,ye)},C.prototype.serialize=function(){var ne={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&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(ne.layout=ne.layout||{},ne.layout.visibility=this.visibility),N(ne,function(ye,Pe){return ye!==void 0&&!(Pe==="layout"&&!Object.keys(ye).length)&&!(Pe==="paint"&&!Object.keys(ye).length)})},C.prototype._validate=function(ne,ye,Pe,Ve,ft){return ft===void 0&&(ft={}),ft&&ft.validate===!1?!1:Uu(this,ne.call(ms,{key:ye,layerType:this.type,objectKey:Pe,value:Ve,styleSpec:rn,style:{glyphs:!0,sprite:!0}}))},C.prototype.is3D=function(){return!1},C.prototype.isTileClipped=function(){return!1},C.prototype.hasOffscreenPass=function(){return!1},C.prototype.resize=function(){},C.prototype.isStateDependent=function(){for(var ne in this.paint._values){var ye=this.paint.get(ne);if(!(!(ye instanceof Hl)||!Il(ye.property.specification))&&(ye.value.kind==="source"||ye.value.kind==="composite")&&ye.value.isStateDependent)return!0}return!1},C}(br),ka={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Sa=function(C,G){this._structArray=C,this._pos1=G*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},va=128,Fn=5,Ha=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};Ha.serialize=function(C,G){return C._trim(),G&&(C.isTransferred=!0,G.push(C.arrayBuffer)),{length:C.length,arrayBuffer:C.arrayBuffer}},Ha.deserialize=function(C){var G=Object.create(this.prototype);return G.arrayBuffer=C.arrayBuffer,G.length=C.length,G.capacity=C.arrayBuffer.byteLength/G.bytesPerElement,G._refreshViews(),G},Ha.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ha.prototype.clear=function(){this.length=0},Ha.prototype.resize=function(C){this.reserve(C),this.length=C},Ha.prototype.reserve=function(C){if(C>this.capacity){this.capacity=Math.max(C,Math.floor(this.capacity*Fn),va),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var G=this.uint8;this._refreshViews(),G&&this.uint8.set(G)}},Ha.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function Da(k,C){C===void 0&&(C=1);var G=0,ne=0,ye=k.map(function(Ve){var ft=Xi(Ve.type),Rt=G=ei(G,Math.max(C,ft)),Ht=Ve.components||1;return ne=Math.max(ne,ft),G+=ft*Ht,{name:Ve.name,type:Ve.type,components:Ht,offset:Rt}}),Pe=ei(G,Math.max(ne,C));return{members:ye,size:Pe,alignment:C}}function Xi(k){return ka[k].BYTES_PER_ELEMENT}function ei(k,C){return Math.ceil(k/C)*C}var zi=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,ye){var Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,ne,ye)},C.prototype.emplace=function(ne,ye,Pe){var Ve=ne*2;return this.int16[Ve+0]=ye,this.int16[Ve+1]=Pe,ne},C}(Ha);zi.prototype.bytesPerElement=4,de("StructArrayLayout2i4",zi);var la=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,ye,Pe,Ve){var ft=this.length;return this.resize(ft+1),this.emplace(ft,ne,ye,Pe,Ve)},C.prototype.emplace=function(ne,ye,Pe,Ve,ft){var Rt=ne*4;return this.int16[Rt+0]=ye,this.int16[Rt+1]=Pe,this.int16[Rt+2]=Ve,this.int16[Rt+3]=ft,ne},C}(Ha);la.prototype.bytesPerElement=8,de("StructArrayLayout4i8",la);var ba=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,ye,Pe,Ve,ft,Rt){var Ht=this.length;return this.resize(Ht+1),this.emplace(Ht,ne,ye,Pe,Ve,ft,Rt)},C.prototype.emplace=function(ne,ye,Pe,Ve,ft,Rt,Ht){var rr=ne*6;return this.int16[rr+0]=ye,this.int16[rr+1]=Pe,this.int16[rr+2]=Ve,this.int16[rr+3]=ft,this.int16[rr+4]=Rt,this.int16[rr+5]=Ht,ne},C}(Ha);ba.prototype.bytesPerElement=12,de("StructArrayLayout2i4i12",ba);var $i=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,ye,Pe,Ve,ft,Rt){var Ht=this.length;return this.resize(Ht+1),this.emplace(Ht,ne,ye,Pe,Ve,ft,Rt)},C.prototype.emplace=function(ne,ye,Pe,Ve,ft,Rt,Ht){var rr=ne*4,Pr=ne*8;return this.int16[rr+0]=ye,this.int16[rr+1]=Pe,this.uint8[Pr+4]=Ve,this.uint8[Pr+5]=ft,this.uint8[Pr+6]=Rt,this.uint8[Pr+7]=Ht,ne},C}(Ha);$i.prototype.bytesPerElement=8,de("StructArrayLayout2i4ub8",$i);var Xa=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,ye){var Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,ne,ye)},C.prototype.emplace=function(ne,ye,Pe){var Ve=ne*2;return this.float32[Ve+0]=ye,this.float32[Ve+1]=Pe,ne},C}(Ha);Xa.prototype.bytesPerElement=8,de("StructArrayLayout2f8",Xa);var Oa=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr){var Hr=this.length;return this.resize(Hr+1),this.emplace(Hr,ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr)},C.prototype.emplace=function(ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr,Hr){var hi=ne*10;return this.uint16[hi+0]=ye,this.uint16[hi+1]=Pe,this.uint16[hi+2]=Ve,this.uint16[hi+3]=ft,this.uint16[hi+4]=Rt,this.uint16[hi+5]=Ht,this.uint16[hi+6]=rr,this.uint16[hi+7]=Pr,this.uint16[hi+8]=Zr,this.uint16[hi+9]=Hr,ne},C}(Ha);Oa.prototype.bytesPerElement=20,de("StructArrayLayout10ui20",Oa);var kn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr,Hr,hi){var Gi=this.length;return this.resize(Gi+1),this.emplace(Gi,ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr,Hr,hi)},C.prototype.emplace=function(ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr,Hr,hi,Gi){var Ra=ne*12;return this.int16[Ra+0]=ye,this.int16[Ra+1]=Pe,this.int16[Ra+2]=Ve,this.int16[Ra+3]=ft,this.uint16[Ra+4]=Rt,this.uint16[Ra+5]=Ht,this.uint16[Ra+6]=rr,this.uint16[Ra+7]=Pr,this.int16[Ra+8]=Zr,this.int16[Ra+9]=Hr,this.int16[Ra+10]=hi,this.int16[Ra+11]=Gi,ne},C}(Ha);kn.prototype.bytesPerElement=24,de("StructArrayLayout4i4ui4i24",kn);var Qi=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,ye,Pe){var Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,ne,ye,Pe)},C.prototype.emplace=function(ne,ye,Pe,Ve){var ft=ne*3;return this.float32[ft+0]=ye,this.float32[ft+1]=Pe,this.float32[ft+2]=Ve,ne},C}(Ha);Qi.prototype.bytesPerElement=12,de("StructArrayLayout3f12",Qi);var Yi=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne){var ye=this.length;return this.resize(ye+1),this.emplace(ye,ne)},C.prototype.emplace=function(ne,ye){var Pe=ne*1;return this.uint32[Pe+0]=ye,ne},C}(Ha);Yi.prototype.bytesPerElement=4,de("StructArrayLayout1ul4",Yi);var ln=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr){var Zr=this.length;return this.resize(Zr+1),this.emplace(Zr,ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr)},C.prototype.emplace=function(ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr){var Hr=ne*10,hi=ne*5;return this.int16[Hr+0]=ye,this.int16[Hr+1]=Pe,this.int16[Hr+2]=Ve,this.int16[Hr+3]=ft,this.int16[Hr+4]=Rt,this.int16[Hr+5]=Ht,this.uint32[hi+3]=rr,this.uint16[Hr+8]=Pr,this.uint16[Hr+9]=Zr,ne},C}(Ha);ln.prototype.bytesPerElement=20,de("StructArrayLayout6i1ul2ui20",ln);var Va=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,ye,Pe,Ve,ft,Rt){var Ht=this.length;return this.resize(Ht+1),this.emplace(Ht,ne,ye,Pe,Ve,ft,Rt)},C.prototype.emplace=function(ne,ye,Pe,Ve,ft,Rt,Ht){var rr=ne*6;return this.int16[rr+0]=ye,this.int16[rr+1]=Pe,this.int16[rr+2]=Ve,this.int16[rr+3]=ft,this.int16[rr+4]=Rt,this.int16[rr+5]=Ht,ne},C}(Ha);Va.prototype.bytesPerElement=12,de("StructArrayLayout2i2i2i12",Va);var La=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,ye,Pe,Ve,ft){var Rt=this.length;return this.resize(Rt+1),this.emplace(Rt,ne,ye,Pe,Ve,ft)},C.prototype.emplace=function(ne,ye,Pe,Ve,ft,Rt){var Ht=ne*4,rr=ne*8;return this.float32[Ht+0]=ye,this.float32[Ht+1]=Pe,this.float32[Ht+2]=Ve,this.int16[rr+6]=ft,this.int16[rr+7]=Rt,ne},C}(Ha);La.prototype.bytesPerElement=16,de("StructArrayLayout2f1f2i16",La);var Ea=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,ye,Pe,Ve){var ft=this.length;return this.resize(ft+1),this.emplace(ft,ne,ye,Pe,Ve)},C.prototype.emplace=function(ne,ye,Pe,Ve,ft){var Rt=ne*12,Ht=ne*3;return this.uint8[Rt+0]=ye,this.uint8[Rt+1]=Pe,this.float32[Ht+1]=Ve,this.float32[Ht+2]=ft,ne},C}(Ha);Ea.prototype.bytesPerElement=12,de("StructArrayLayout2ub2f12",Ea);var on=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,ye,Pe){var Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,ne,ye,Pe)},C.prototype.emplace=function(ne,ye,Pe,Ve){var ft=ne*3;return this.uint16[ft+0]=ye,this.uint16[ft+1]=Pe,this.uint16[ft+2]=Ve,ne},C}(Ha);on.prototype.bytesPerElement=6,de("StructArrayLayout3ui6",on);var Pn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){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)},C.prototype.emplaceBack=function(ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr,Hr,hi,Gi,Ra,ha,fn,Wa){var cn=this.length;return this.resize(cn+1),this.emplace(cn,ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr,Hr,hi,Gi,Ra,ha,fn,Wa)},C.prototype.emplace=function(ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr,Hr,hi,Gi,Ra,ha,fn,Wa,cn){var bn=ne*24,Un=ne*12,oo=ne*48;return this.int16[bn+0]=ye,this.int16[bn+1]=Pe,this.uint16[bn+2]=Ve,this.uint16[bn+3]=ft,this.uint32[Un+2]=Rt,this.uint32[Un+3]=Ht,this.uint32[Un+4]=rr,this.uint16[bn+10]=Pr,this.uint16[bn+11]=Zr,this.uint16[bn+12]=Hr,this.float32[Un+7]=hi,this.float32[Un+8]=Gi,this.uint8[oo+36]=Ra,this.uint8[oo+37]=ha,this.uint8[oo+38]=fn,this.uint32[Un+10]=Wa,this.int16[bn+22]=cn,ne},C}(Ha);Pn.prototype.bytesPerElement=48,de("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Pn);var Zn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){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)},C.prototype.emplaceBack=function(ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr,Hr,hi,Gi,Ra,ha,fn,Wa,cn,bn,Un,oo,ro,Go,So,Bo,Hs,Wo,Qo){var fl=this.length;return this.resize(fl+1),this.emplace(fl,ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr,Hr,hi,Gi,Ra,ha,fn,Wa,cn,bn,Un,oo,ro,Go,So,Bo,Hs,Wo,Qo)},C.prototype.emplace=function(ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr,Hr,hi,Gi,Ra,ha,fn,Wa,cn,bn,Un,oo,ro,Go,So,Bo,Hs,Wo,Qo,fl){var Os=ne*34,iu=ne*17;return this.int16[Os+0]=ye,this.int16[Os+1]=Pe,this.int16[Os+2]=Ve,this.int16[Os+3]=ft,this.int16[Os+4]=Rt,this.int16[Os+5]=Ht,this.int16[Os+6]=rr,this.int16[Os+7]=Pr,this.uint16[Os+8]=Zr,this.uint16[Os+9]=Hr,this.uint16[Os+10]=hi,this.uint16[Os+11]=Gi,this.uint16[Os+12]=Ra,this.uint16[Os+13]=ha,this.uint16[Os+14]=fn,this.uint16[Os+15]=Wa,this.uint16[Os+16]=cn,this.uint16[Os+17]=bn,this.uint16[Os+18]=Un,this.uint16[Os+19]=oo,this.uint16[Os+20]=ro,this.uint16[Os+21]=Go,this.uint16[Os+22]=So,this.uint32[iu+12]=Bo,this.float32[iu+13]=Hs,this.float32[iu+14]=Wo,this.float32[iu+15]=Qo,this.float32[iu+16]=fl,ne},C}(Ha);Zn.prototype.bytesPerElement=68,de("StructArrayLayout8i15ui1ul4f68",Zn);var ja=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne){var ye=this.length;return this.resize(ye+1),this.emplace(ye,ne)},C.prototype.emplace=function(ne,ye){var Pe=ne*1;return this.float32[Pe+0]=ye,ne},C}(Ha);ja.prototype.bytesPerElement=4,de("StructArrayLayout1f4",ja);var gn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,ye,Pe){var Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,ne,ye,Pe)},C.prototype.emplace=function(ne,ye,Pe,Ve){var ft=ne*3;return this.int16[ft+0]=ye,this.int16[ft+1]=Pe,this.int16[ft+2]=Ve,ne},C}(Ha);gn.prototype.bytesPerElement=6,de("StructArrayLayout3i6",gn);var Wn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,ye,Pe){var Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,ne,ye,Pe)},C.prototype.emplace=function(ne,ye,Pe,Ve){var ft=ne*2,Rt=ne*4;return this.uint32[ft+0]=ye,this.uint16[Rt+2]=Pe,this.uint16[Rt+3]=Ve,ne},C}(Ha);Wn.prototype.bytesPerElement=8,de("StructArrayLayout1ul2ui8",Wn);var $n=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,ye){var Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,ne,ye)},C.prototype.emplace=function(ne,ye,Pe){var Ve=ne*2;return this.uint16[Ve+0]=ye,this.uint16[Ve+1]=Pe,ne},C}(Ha);$n.prototype.bytesPerElement=4,de("StructArrayLayout2ui4",$n);var fo=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne){var ye=this.length;return this.resize(ye+1),this.emplace(ye,ne)},C.prototype.emplace=function(ne,ye){var Pe=ne*1;return this.uint16[Pe+0]=ye,ne},C}(Ha);fo.prototype.bytesPerElement=2,de("StructArrayLayout1ui2",fo);var Ks=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,ye,Pe,Ve){var ft=this.length;return this.resize(ft+1),this.emplace(ft,ne,ye,Pe,Ve)},C.prototype.emplace=function(ne,ye,Pe,Ve,ft){var Rt=ne*4;return this.float32[Rt+0]=ye,this.float32[Rt+1]=Pe,this.float32[Rt+2]=Ve,this.float32[Rt+3]=ft,ne},C}(Ha);Ks.prototype.bytesPerElement=16,de("StructArrayLayout4f16",Ks);var Rl=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var G={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return G.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},G.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},G.x1.get=function(){return this._structArray.int16[this._pos2+2]},G.y1.get=function(){return this._structArray.int16[this._pos2+3]},G.x2.get=function(){return this._structArray.int16[this._pos2+4]},G.y2.get=function(){return this._structArray.int16[this._pos2+5]},G.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},G.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},G.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},G.anchorPoint.get=function(){return new n(this.anchorPointX,this.anchorPointY)},Object.defineProperties(C.prototype,G),C}(Sa);Rl.prototype.size=20;var Ro=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(ne){return new Rl(this,ne)},C}(ln);de("CollisionBoxArray",Ro);var ru=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var G={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return G.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},G.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},G.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},G.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},G.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},G.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},G.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},G.segment.get=function(){return this._structArray.uint16[this._pos2+10]},G.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},G.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},G.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},G.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},G.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},G.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},G.placedOrientation.set=function(ne){this._structArray.uint8[this._pos1+37]=ne},G.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},G.hidden.set=function(ne){this._structArray.uint8[this._pos1+38]=ne},G.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},G.crossTileID.set=function(ne){this._structArray.uint32[this._pos4+10]=ne},G.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(C.prototype,G),C}(Sa);ru.prototype.size=48;var Cs=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(ne){return new ru(this,ne)},C}(Pn);de("PlacedSymbolArray",Cs);var Ol=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var G={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return G.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},G.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},G.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},G.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},G.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},G.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},G.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},G.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},G.key.get=function(){return this._structArray.uint16[this._pos2+8]},G.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},G.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},G.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},G.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},G.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},G.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},G.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},G.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},G.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},G.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},G.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},G.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},G.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},G.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},G.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},G.crossTileID.set=function(ne){this._structArray.uint32[this._pos4+12]=ne},G.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},G.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},G.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},G.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(C.prototype,G),C}(Sa);Ol.prototype.size=68;var Ul=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(ne){return new Ol(this,ne)},C}(Zn);de("SymbolInstanceArray",Ul);var cu=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getoffsetX=function(ne){return this.float32[ne*1+0]},C}(ja);de("GlyphOffsetArray",cu);var il=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getx=function(ne){return this.int16[ne*3+0]},C.prototype.gety=function(ne){return this.int16[ne*3+1]},C.prototype.gettileUnitDistanceFromAnchor=function(ne){return this.int16[ne*3+2]},C}(gn);de("SymbolLineVertexArray",il);var El=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var G={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return G.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},G.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},G.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(C.prototype,G),C}(Sa);El.prototype.size=8;var Dl=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(ne){return new El(this,ne)},C}(Wn);de("FeatureIndexArray",Dl);var ho=Da([{name:"a_pos",components:2,type:"Int16"}],4),jl=ho.members,$o=function(C){C===void 0&&(C=[]),this.segments=C};$o.prototype.prepareSegment=function(C,G,ne,ye){var Pe=this.segments[this.segments.length-1];return C>$o.MAX_VERTEX_ARRAY_LENGTH&&O("Max vertices per segment is "+$o.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+C),(!Pe||Pe.vertexLength+C>$o.MAX_VERTEX_ARRAY_LENGTH||Pe.sortKey!==ye)&&(Pe={vertexOffset:G.length,primitiveOffset:ne.length,vertexLength:0,primitiveLength:0},ye!==void 0&&(Pe.sortKey=ye),this.segments.push(Pe)),Pe},$o.prototype.get=function(){return this.segments},$o.prototype.destroy=function(){for(var C=0,G=this.segments;C<G.length;C+=1){var ne=G[C];for(var ye in ne.vaos)ne.vaos[ye].destroy()}},$o.simpleSegment=function(C,G,ne,ye){return new $o([{vertexOffset:C,primitiveOffset:G,vertexLength:ne,primitiveLength:ye,vaos:{},sortKey:0}])},$o.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,de("SegmentVector",$o);function ve(k,C){return k=l(Math.floor(k),0,255),C=l(Math.floor(C),0,255),256*k+C}var K=Da([{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"}]),ge=t(function(k){function C(G,ne){var ye,Pe,Ve,ft,Rt,Ht,rr,Pr;for(ye=G.length&3,Pe=G.length-ye,Ve=ne,Rt=3432918353,Ht=461845907,Pr=0;Pr<Pe;)rr=G.charCodeAt(Pr)&255|(G.charCodeAt(++Pr)&255)<<8|(G.charCodeAt(++Pr)&255)<<16|(G.charCodeAt(++Pr)&255)<<24,++Pr,rr=(rr&65535)*Rt+(((rr>>>16)*Rt&65535)<<16)&4294967295,rr=rr<<15|rr>>>17,rr=(rr&65535)*Ht+(((rr>>>16)*Ht&65535)<<16)&4294967295,Ve^=rr,Ve=Ve<<13|Ve>>>19,ft=(Ve&65535)*5+(((Ve>>>16)*5&65535)<<16)&4294967295,Ve=(ft&65535)+27492+(((ft>>>16)+58964&65535)<<16);switch(rr=0,ye){case 3:rr^=(G.charCodeAt(Pr+2)&255)<<16;case 2:rr^=(G.charCodeAt(Pr+1)&255)<<8;case 1:rr^=G.charCodeAt(Pr)&255,rr=(rr&65535)*Rt+(((rr>>>16)*Rt&65535)<<16)&4294967295,rr=rr<<15|rr>>>17,rr=(rr&65535)*Ht+(((rr>>>16)*Ht&65535)<<16)&4294967295,Ve^=rr}return Ve^=G.length,Ve^=Ve>>>16,Ve=(Ve&65535)*2246822507+(((Ve>>>16)*2246822507&65535)<<16)&4294967295,Ve^=Ve>>>13,Ve=(Ve&65535)*3266489909+(((Ve>>>16)*3266489909&65535)<<16)&4294967295,Ve^=Ve>>>16,Ve>>>0}k.exports=C}),te=t(function(k){function C(G,ne){for(var ye=G.length,Pe=ne^ye,Ve=0,ft;ye>=4;)ft=G.charCodeAt(Ve)&255|(G.charCodeAt(++Ve)&255)<<8|(G.charCodeAt(++Ve)&255)<<16|(G.charCodeAt(++Ve)&255)<<24,ft=(ft&65535)*1540483477+(((ft>>>16)*1540483477&65535)<<16),ft^=ft>>>24,ft=(ft&65535)*1540483477+(((ft>>>16)*1540483477&65535)<<16),Pe=(Pe&65535)*1540483477+(((Pe>>>16)*1540483477&65535)<<16)^ft,ye-=4,++Ve;switch(ye){case 3:Pe^=(G.charCodeAt(Ve+2)&255)<<16;case 2:Pe^=(G.charCodeAt(Ve+1)&255)<<8;case 1:Pe^=G.charCodeAt(Ve)&255,Pe=(Pe&65535)*1540483477+(((Pe>>>16)*1540483477&65535)<<16)}return Pe^=Pe>>>13,Pe=(Pe&65535)*1540483477+(((Pe>>>16)*1540483477&65535)<<16),Pe^=Pe>>>15,Pe>>>0}k.exports=C}),pe=ge,He=ge,Ce=te;pe.murmur3=He,pe.murmur2=Ce;var Ke=function(){this.ids=[],this.positions=[],this.indexed=!1};Ke.prototype.add=function(C,G,ne,ye){this.ids.push(Ut(C)),this.positions.push(G,ne,ye)},Ke.prototype.getPositions=function(C){for(var G=Ut(C),ne=0,ye=this.ids.length-1;ne<ye;){var Pe=ne+ye>>1;this.ids[Pe]>=G?ye=Pe:ne=Pe+1}for(var Ve=[];this.ids[ne]===G;){var ft=this.positions[3*ne],Rt=this.positions[3*ne+1],Ht=this.positions[3*ne+2];Ve.push({index:ft,start:Rt,end:Ht}),ne++}return Ve},Ke.serialize=function(C,G){var ne=new Float64Array(C.ids),ye=new Uint32Array(C.positions);return Tr(ne,ye,0,ne.length-1),G&&G.push(ne.buffer,ye.buffer),{ids:ne,positions:ye}},Ke.deserialize=function(C){var G=new Ke;return G.ids=C.ids,G.positions=C.positions,G.indexed=!0,G};var pt=Math.pow(2,53)-1;function Ut(k){var C=+k;return!isNaN(C)&&C<=pt?C:pe(String(k))}function Tr(k,C,G,ne){for(;G<ne;){for(var ye=k[G+ne>>1],Pe=G-1,Ve=ne+1;;){do Pe++;while(k[Pe]<ye);do Ve--;while(k[Ve]>ye);if(Pe>=Ve)break;Ur(k,Pe,Ve),Ur(C,3*Pe,3*Ve),Ur(C,3*Pe+1,3*Ve+1),Ur(C,3*Pe+2,3*Ve+2)}Ve-G<ne-Ve?(Tr(k,C,G,Ve),G=Ve+1):(Tr(k,C,Ve+1,ne),ne=Ve)}}function Ur(k,C,G){var ne=k[C];k[C]=k[G],k[G]=ne}de("FeaturePositionMap",Ke);var vr=function(C,G){this.gl=C.gl,this.location=G},mt=function(k){function C(G,ne){k.call(this,G,ne),this.current=0}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.set=function(ne){this.current!==ne&&(this.current=ne,this.gl.uniform1i(this.location,ne))},C}(vr),Et=function(k){function C(G,ne){k.call(this,G,ne),this.current=0}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.set=function(ne){this.current!==ne&&(this.current=ne,this.gl.uniform1f(this.location,ne))},C}(vr),Bt=function(k){function C(G,ne){k.call(this,G,ne),this.current=[0,0]}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.set=function(ne){(ne[0]!==this.current[0]||ne[1]!==this.current[1])&&(this.current=ne,this.gl.uniform2f(this.location,ne[0],ne[1]))},C}(vr),or=function(k){function C(G,ne){k.call(this,G,ne),this.current=[0,0,0]}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.set=function(ne){(ne[0]!==this.current[0]||ne[1]!==this.current[1]||ne[2]!==this.current[2])&&(this.current=ne,this.gl.uniform3f(this.location,ne[0],ne[1],ne[2]))},C}(vr),dr=function(k){function C(G,ne){k.call(this,G,ne),this.current=[0,0,0,0]}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.set=function(ne){(ne[0]!==this.current[0]||ne[1]!==this.current[1]||ne[2]!==this.current[2]||ne[3]!==this.current[3])&&(this.current=ne,this.gl.uniform4f(this.location,ne[0],ne[1],ne[2],ne[3]))},C}(vr),ur=function(k){function C(G,ne){k.call(this,G,ne),this.current=Js.transparent}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.set=function(ne){(ne.r!==this.current.r||ne.g!==this.current.g||ne.b!==this.current.b||ne.a!==this.current.a)&&(this.current=ne,this.gl.uniform4f(this.location,ne.r,ne.g,ne.b,ne.a))},C}(vr),pr=new Float32Array(16),cr=function(k){function C(G,ne){k.call(this,G,ne),this.current=pr}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.set=function(ne){if(ne[12]!==this.current[12]||ne[0]!==this.current[0]){this.current=ne,this.gl.uniformMatrix4fv(this.location,!1,ne);return}for(var ye=1;ye<16;ye++)if(ne[ye]!==this.current[ye]){this.current=ne,this.gl.uniformMatrix4fv(this.location,!1,ne);break}},C}(vr);function Gt(k){return[ve(255*k.r,255*k.g),ve(255*k.b,255*k.a)]}var lr=function(C,G,ne){this.value=C,this.uniformNames=G.map(function(ye){return"u_"+ye}),this.type=ne};lr.prototype.setUniform=function(C,G,ne){C.set(ne.constantOr(this.value))},lr.prototype.getBinding=function(C,G,ne){return this.type==="color"?new ur(C,G):new Et(C,G)};var qt=function(C,G){this.uniformNames=G.map(function(ne){return"u_"+ne}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};qt.prototype.setConstantPatternPositions=function(C,G){this.pixelRatioFrom=G.pixelRatio,this.pixelRatioTo=C.pixelRatio,this.patternFrom=G.tlbr,this.patternTo=C.tlbr},qt.prototype.setUniform=function(C,G,ne,ye){var Pe=ye==="u_pattern_to"?this.patternTo:ye==="u_pattern_from"?this.patternFrom:ye==="u_pixel_ratio_to"?this.pixelRatioTo:ye==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Pe&&C.set(Pe)},qt.prototype.getBinding=function(C,G,ne){return ne.substr(0,9)==="u_pattern"?new dr(C,G):new Et(C,G)};var zr=function(C,G,ne,ye){this.expression=C,this.type=ne,this.maxValue=0,this.paintVertexAttributes=G.map(function(Pe){return{name:"a_"+Pe,type:"Float32",components:ne==="color"?2:1,offset:0}}),this.paintVertexArray=new ye};zr.prototype.populatePaintArray=function(C,G,ne,ye,Pe){var Ve=this.paintVertexArray.length,ft=this.expression.evaluate(new Dn(0),G,{},ye,[],Pe);this.paintVertexArray.resize(C),this._setPaintValue(Ve,C,ft)},zr.prototype.updatePaintArray=function(C,G,ne,ye){var Pe=this.expression.evaluate({zoom:0},ne,ye);this._setPaintValue(C,G,Pe)},zr.prototype._setPaintValue=function(C,G,ne){if(this.type==="color")for(var ye=Gt(ne),Pe=C;Pe<G;Pe++)this.paintVertexArray.emplace(Pe,ye[0],ye[1]);else{for(var Ve=C;Ve<G;Ve++)this.paintVertexArray.emplace(Ve,ne);this.maxValue=Math.max(this.maxValue,Math.abs(ne))}},zr.prototype.upload=function(C){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=C.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},zr.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var $r=function(C,G,ne,ye,Pe,Ve){this.expression=C,this.uniformNames=G.map(function(ft){return"u_"+ft+"_t"}),this.type=ne,this.useIntegerZoom=ye,this.zoom=Pe,this.maxValue=0,this.paintVertexAttributes=G.map(function(ft){return{name:"a_"+ft,type:"Float32",components:ne==="color"?4:2,offset:0}}),this.paintVertexArray=new Ve};$r.prototype.populatePaintArray=function(C,G,ne,ye,Pe){var Ve=this.expression.evaluate(new Dn(this.zoom),G,{},ye,[],Pe),ft=this.expression.evaluate(new Dn(this.zoom+1),G,{},ye,[],Pe),Rt=this.paintVertexArray.length;this.paintVertexArray.resize(C),this._setPaintValue(Rt,C,Ve,ft)},$r.prototype.updatePaintArray=function(C,G,ne,ye){var Pe=this.expression.evaluate({zoom:this.zoom},ne,ye),Ve=this.expression.evaluate({zoom:this.zoom+1},ne,ye);this._setPaintValue(C,G,Pe,Ve)},$r.prototype._setPaintValue=function(C,G,ne,ye){if(this.type==="color")for(var Pe=Gt(ne),Ve=Gt(ye),ft=C;ft<G;ft++)this.paintVertexArray.emplace(ft,Pe[0],Pe[1],Ve[0],Ve[1]);else{for(var Rt=C;Rt<G;Rt++)this.paintVertexArray.emplace(Rt,ne,ye);this.maxValue=Math.max(this.maxValue,Math.abs(ne),Math.abs(ye))}},$r.prototype.upload=function(C){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=C.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},$r.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},$r.prototype.setUniform=function(C,G){var ne=this.useIntegerZoom?Math.floor(G.zoom):G.zoom,ye=l(this.expression.interpolationFactor(ne,this.zoom,this.zoom+1),0,1);C.set(ye)},$r.prototype.getBinding=function(C,G,ne){return new Et(C,G)};var Ai=function(C,G,ne,ye,Pe,Ve){this.expression=C,this.type=G,this.useIntegerZoom=ne,this.zoom=ye,this.layerId=Ve,this.zoomInPaintVertexArray=new Pe,this.zoomOutPaintVertexArray=new Pe};Ai.prototype.populatePaintArray=function(C,G,ne){var ye=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(C),this.zoomOutPaintVertexArray.resize(C),this._setPaintValues(ye,C,G.patterns&&G.patterns[this.layerId],ne)},Ai.prototype.updatePaintArray=function(C,G,ne,ye,Pe){this._setPaintValues(C,G,ne.patterns&&ne.patterns[this.layerId],Pe)},Ai.prototype._setPaintValues=function(C,G,ne,ye){if(!(!ye||!ne)){var Pe=ne.min,Ve=ne.mid,ft=ne.max,Rt=ye[Pe],Ht=ye[Ve],rr=ye[ft];if(!(!Rt||!Ht||!rr))for(var Pr=C;Pr<G;Pr++)this.zoomInPaintVertexArray.emplace(Pr,Ht.tl[0],Ht.tl[1],Ht.br[0],Ht.br[1],Rt.tl[0],Rt.tl[1],Rt.br[0],Rt.br[1],Ht.pixelRatio,Rt.pixelRatio),this.zoomOutPaintVertexArray.emplace(Pr,Ht.tl[0],Ht.tl[1],Ht.br[0],Ht.br[1],rr.tl[0],rr.tl[1],rr.br[0],rr.br[1],Ht.pixelRatio,rr.pixelRatio)}},Ai.prototype.upload=function(C){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=C.createVertexBuffer(this.zoomInPaintVertexArray,K.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=C.createVertexBuffer(this.zoomOutPaintVertexArray,K.members,this.expression.isStateDependent))},Ai.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var wa=function(C,G,ne){this.binders={},this._buffers=[];var ye=[];for(var Pe in C.paint._values)if(ne(Pe)){var Ve=C.paint.get(Pe);if(!(!(Ve instanceof Hl)||!Il(Ve.property.specification))){var ft=fa(Pe,C.type),Rt=Ve.value,Ht=Ve.property.specification.type,rr=Ve.property.useIntegerZoom,Pr=Ve.property.specification["property-type"],Zr=Pr==="cross-faded"||Pr==="cross-faded-data-driven";if(Rt.kind==="constant")this.binders[Pe]=Zr?new qt(Rt.value,ft):new lr(Rt.value,ft,Ht),ye.push("/u_"+Pe);else if(Rt.kind==="source"||Zr){var Hr=Ga(Pe,Ht,"source");this.binders[Pe]=Zr?new Ai(Rt,Ht,rr,G,Hr,C.id):new zr(Rt,ft,Ht,Hr),ye.push("/a_"+Pe)}else{var hi=Ga(Pe,Ht,"composite");this.binders[Pe]=new $r(Rt,ft,Ht,rr,G,hi),ye.push("/z_"+Pe)}}}this.cacheKey=ye.sort().join("")};wa.prototype.getMaxValue=function(C){var G=this.binders[C];return G instanceof zr||G instanceof $r?G.maxValue:0},wa.prototype.populatePaintArrays=function(C,G,ne,ye,Pe){for(var Ve in this.binders){var ft=this.binders[Ve];(ft instanceof zr||ft instanceof $r||ft instanceof Ai)&&ft.populatePaintArray(C,G,ne,ye,Pe)}},wa.prototype.setConstantPatternPositions=function(C,G){for(var ne in this.binders){var ye=this.binders[ne];ye instanceof qt&&ye.setConstantPatternPositions(C,G)}},wa.prototype.updatePaintArrays=function(C,G,ne,ye,Pe){var Ve=!1;for(var ft in C)for(var Rt=G.getPositions(ft),Ht=0,rr=Rt;Ht<rr.length;Ht+=1){var Pr=rr[Ht],Zr=ne.feature(Pr.index);for(var Hr in this.binders){var hi=this.binders[Hr];if((hi instanceof zr||hi instanceof $r||hi instanceof Ai)&&hi.expression.isStateDependent===!0){var Gi=ye.paint.get(Hr);hi.expression=Gi.value,hi.updatePaintArray(Pr.start,Pr.end,Zr,C[ft],Pe),Ve=!0}}}return Ve},wa.prototype.defines=function(){var C=[];for(var G in this.binders){var ne=this.binders[G];(ne instanceof lr||ne instanceof qt)&&C.push.apply(C,ne.uniformNames.map(function(ye){return"#define HAS_UNIFORM_"+ye}))}return C},wa.prototype.getBinderAttributes=function(){var C=[];for(var G in this.binders){var ne=this.binders[G];if(ne instanceof zr||ne instanceof $r)for(var ye=0;ye<ne.paintVertexAttributes.length;ye++)C.push(ne.paintVertexAttributes[ye].name);else if(ne instanceof Ai)for(var Pe=0;Pe<K.members.length;Pe++)C.push(K.members[Pe].name)}return C},wa.prototype.getBinderUniforms=function(){var C=[];for(var G in this.binders){var ne=this.binders[G];if(ne instanceof lr||ne instanceof qt||ne instanceof $r)for(var ye=0,Pe=ne.uniformNames;ye<Pe.length;ye+=1){var Ve=Pe[ye];C.push(Ve)}}return C},wa.prototype.getPaintVertexBuffers=function(){return this._buffers},wa.prototype.getUniforms=function(C,G){var ne=[];for(var ye in this.binders){var Pe=this.binders[ye];if(Pe instanceof lr||Pe instanceof qt||Pe instanceof $r)for(var Ve=0,ft=Pe.uniformNames;Ve<ft.length;Ve+=1){var Rt=ft[Ve];if(G[Rt]){var Ht=Pe.getBinding(C,G[Rt],Rt);ne.push({name:Rt,property:ye,binding:Ht})}}}return ne},wa.prototype.setUniforms=function(C,G,ne,ye){for(var Pe=0,Ve=G;Pe<Ve.length;Pe+=1){var ft=Ve[Pe],Rt=ft.name,Ht=ft.property,rr=ft.binding;this.binders[Ht].setUniform(rr,ye,ne.get(Ht),Rt)}},wa.prototype.updatePaintBuffers=function(C){this._buffers=[];for(var G in this.binders){var ne=this.binders[G];if(C&&ne instanceof Ai){var ye=C.fromScale===2?ne.zoomInPaintVertexBuffer:ne.zoomOutPaintVertexBuffer;ye&&this._buffers.push(ye)}else(ne instanceof zr||ne instanceof $r)&&ne.paintVertexBuffer&&this._buffers.push(ne.paintVertexBuffer)}},wa.prototype.upload=function(C){for(var G in this.binders){var ne=this.binders[G];(ne instanceof zr||ne instanceof $r||ne instanceof Ai)&&ne.upload(C)}this.updatePaintBuffers()},wa.prototype.destroy=function(){for(var C in this.binders){var G=this.binders[C];(G instanceof zr||G instanceof $r||G instanceof Ai)&&G.destroy()}};var Ji=function(C,G,ne){ne===void 0&&(ne=function(){return!0}),this.programConfigurations={};for(var ye=0,Pe=C;ye<Pe.length;ye+=1){var Ve=Pe[ye];this.programConfigurations[Ve.id]=new wa(Ve,G,ne)}this.needsUpload=!1,this._featureMap=new Ke,this._bufferOffset=0};Ji.prototype.populatePaintArrays=function(C,G,ne,ye,Pe,Ve){for(var ft in this.programConfigurations)this.programConfigurations[ft].populatePaintArrays(C,G,ye,Pe,Ve);G.id!==void 0&&this._featureMap.add(G.id,ne,this._bufferOffset,C),this._bufferOffset=C,this.needsUpload=!0},Ji.prototype.updatePaintArrays=function(C,G,ne,ye){for(var Pe=0,Ve=ne;Pe<Ve.length;Pe+=1){var ft=Ve[Pe];this.needsUpload=this.programConfigurations[ft.id].updatePaintArrays(C,this._featureMap,G,ft,ye)||this.needsUpload}},Ji.prototype.get=function(C){return this.programConfigurations[C]},Ji.prototype.upload=function(C){if(this.needsUpload){for(var G in this.programConfigurations)this.programConfigurations[G].upload(C);this.needsUpload=!1}},Ji.prototype.destroy=function(){for(var C in this.programConfigurations)this.programConfigurations[C].destroy()};function fa(k,C){var G={"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-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"]};return G[k]||[k.replace(C+"-","").replace(/-/g,"_")]}function sn(k){var C={"line-pattern":{source:Oa,composite:Oa},"fill-pattern":{source:Oa,composite:Oa},"fill-extrusion-pattern":{source:Oa,composite:Oa}};return C[k]}function Ga(k,C,G){var ne={color:{source:Xa,composite:Ks},number:{source:ja,composite:Xa}},ye=sn(k);return ye&&ye[G]||ne[C][G]}de("ConstantBinder",lr),de("CrossFadedConstantBinder",qt),de("SourceExpressionBinder",zr),de("CrossFadedCompositeBinder",Ai),de("CompositeExpressionBinder",$r),de("ProgramConfiguration",wa,{omit:["_buffers"]}),de("ProgramConfigurationSet",Ji);var ma=8192,Ma=15,Pa=Math.pow(2,Ma-1)-1,Ka=-Pa-1;function Sn(k){for(var C=ma/k.extent,G=k.loadGeometry(),ne=0;ne<G.length;ne++)for(var ye=G[ne],Pe=0;Pe<ye.length;Pe++){var Ve=ye[Pe],ft=Math.round(Ve.x*C),Rt=Math.round(Ve.y*C);Ve.x=l(ft,Ka,Pa),Ve.y=l(Rt,Ka,Pa),(ft<Ve.x||ft>Ve.x+1||Rt<Ve.y||Rt>Ve.y+1)&&O("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return G}function No(k,C){return{type:k.type,id:k.id,properties:k.properties,geometry:C?Sn(k):[]}}function os(k,C,G,ne,ye){k.emplaceBack(C*2+(ne+1)/2,G*2+(ye+1)/2)}var Xs=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(G){return G.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new zi,this.indexArray=new on,this.segments=new $o,this.programConfigurations=new Ji(C.layers,C.zoom),this.stateDependentLayerIds=this.layers.filter(function(G){return G.isStateDependent()}).map(function(G){return G.id})};Xs.prototype.populate=function(C,G,ne){var ye=this.layers[0],Pe=[],Ve=null;ye.type==="circle"&&(Ve=ye.layout.get("circle-sort-key"));for(var ft=0,Rt=C;ft<Rt.length;ft+=1){var Ht=Rt[ft],rr=Ht.feature,Pr=Ht.id,Zr=Ht.index,Hr=Ht.sourceLayerIndex,hi=this.layers[0]._featureFilter.needGeometry,Gi=No(rr,hi);if(this.layers[0]._featureFilter.filter(new Dn(this.zoom),Gi,ne)){var Ra=Ve?Ve.evaluate(Gi,{},ne):void 0,ha={id:Pr,properties:rr.properties,type:rr.type,sourceLayerIndex:Hr,index:Zr,geometry:hi?Gi.geometry:Sn(rr),patterns:{},sortKey:Ra};Pe.push(ha)}}Ve&&Pe.sort(function(So,Bo){return So.sortKey-Bo.sortKey});for(var fn=0,Wa=Pe;fn<Wa.length;fn+=1){var cn=Wa[fn],bn=cn,Un=bn.geometry,oo=bn.index,ro=bn.sourceLayerIndex,Go=C[oo].feature;this.addFeature(cn,Un,oo,ne),G.featureIndex.insert(Go,Un,oo,ro,this.index)}},Xs.prototype.update=function(C,G,ne){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,G,this.stateDependentLayers,ne)},Xs.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Xs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Xs.prototype.upload=function(C){this.uploaded||(this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,jl),this.indexBuffer=C.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(C),this.uploaded=!0},Xs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Xs.prototype.addFeature=function(C,G,ne,ye){for(var Pe=0,Ve=G;Pe<Ve.length;Pe+=1)for(var ft=Ve[Pe],Rt=0,Ht=ft;Rt<Ht.length;Rt+=1){var rr=Ht[Rt],Pr=rr.x,Zr=rr.y;if(!(Pr<0||Pr>=ma||Zr<0||Zr>=ma)){var Hr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,C.sortKey),hi=Hr.vertexLength;os(this.layoutVertexArray,Pr,Zr,-1,-1),os(this.layoutVertexArray,Pr,Zr,1,-1),os(this.layoutVertexArray,Pr,Zr,1,1),os(this.layoutVertexArray,Pr,Zr,-1,1),this.indexArray.emplaceBack(hi,hi+1,hi+2),this.indexArray.emplaceBack(hi,hi+3,hi+2),Hr.vertexLength+=4,Hr.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ne,{},ye)},de("CircleBucket",Xs,{omit:["layers"]});function ts(k,C){for(var G=0;G<k.length;G++)if(bh(C,k[G]))return!0;for(var ne=0;ne<C.length;ne++)if(bh(k,C[ne]))return!0;return!!id(k,C)}function Vs(k,C,G){return!!(bh(k,C)||hd(C,k,G))}function ll(k,C){if(k.length===1)return Md(C,k[0]);for(var G=0;G<C.length;G++)for(var ne=C[G],ye=0;ye<ne.length;ye++)if(bh(k,ne[ye]))return!0;for(var Pe=0;Pe<k.length;Pe++)if(Md(C,k[Pe]))return!0;for(var Ve=0;Ve<C.length;Ve++)if(id(k,C[Ve]))return!0;return!1}function Mu(k,C,G){for(var ne=0;ne<C.length;ne++){var ye=C[ne];if(k.length>=3){for(var Pe=0;Pe<ye.length;Pe++)if(bh(k,ye[Pe]))return!0}if(rd(k,ye,G))return!0}return!1}function rd(k,C,G){if(k.length>1){if(id(k,C))return!0;for(var ne=0;ne<C.length;ne++)if(hd(C[ne],k,G))return!0}for(var ye=0;ye<k.length;ye++)if(hd(k[ye],C,G))return!0;return!1}function id(k,C){if(k.length===0||C.length===0)return!1;for(var G=0;G<k.length-1;G++)for(var ne=k[G],ye=k[G+1],Pe=0;Pe<C.length-1;Pe++){var Ve=C[Pe],ft=C[Pe+1];if(xh(ne,ye,Ve,ft))return!0}return!1}function xh(k,C,G,ne){return X(k,G,ne)!==X(C,G,ne)&&X(k,C,G)!==X(k,C,ne)}function hd(k,C,G){var ne=G*G;if(C.length===1)return k.distSqr(C[0])<ne;for(var ye=1;ye<C.length;ye++){var Pe=C[ye-1],Ve=C[ye];if(ev(k,Pe,Ve)<ne)return!0}return!1}function ev(k,C,G){var ne=C.distSqr(G);if(ne===0)return k.distSqr(C);var ye=((k.x-C.x)*(G.x-C.x)+(k.y-C.y)*(G.y-C.y))/ne;return ye<0?k.distSqr(C):ye>1?k.distSqr(G):k.distSqr(G.sub(C)._mult(ye)._add(C))}function Md(k,C){for(var G=!1,ne,ye,Pe,Ve=0;Ve<k.length;Ve++){ne=k[Ve];for(var ft=0,Rt=ne.length-1;ft<ne.length;Rt=ft++)ye=ne[ft],Pe=ne[Rt],ye.y>C.y!=Pe.y>C.y&&C.x<(Pe.x-ye.x)*(C.y-ye.y)/(Pe.y-ye.y)+ye.x&&(G=!G)}return G}function bh(k,C){for(var G=!1,ne=0,ye=k.length-1;ne<k.length;ye=ne++){var Pe=k[ne],Ve=k[ye];Pe.y>C.y!=Ve.y>C.y&&C.x<(Ve.x-Pe.x)*(C.y-Pe.y)/(Ve.y-Pe.y)+Pe.x&&(G=!G)}return G}function Ed(k,C,G,ne,ye){for(var Pe=0,Ve=k;Pe<Ve.length;Pe+=1){var ft=Ve[Pe];if(C<=ft.x&&G<=ft.y&&ne>=ft.x&&ye>=ft.y)return!0}var Rt=[new n(C,G),new n(C,ye),new n(ne,ye),new n(ne,G)];if(k.length>2)for(var Ht=0,rr=Rt;Ht<rr.length;Ht+=1){var Pr=rr[Ht];if(bh(k,Pr))return!0}for(var Zr=0;Zr<k.length-1;Zr++){var Hr=k[Zr],hi=k[Zr+1];if(zh(Hr,hi,Rt))return!0}return!1}function zh(k,C,G){var ne=G[0],ye=G[2];if(k.x<ne.x&&C.x<ne.x||k.x>ye.x&&C.x>ye.x||k.y<ne.y&&C.y<ne.y||k.y>ye.y&&C.y>ye.y)return!1;var Pe=X(k,C,G[0]);return Pe!==X(k,C,G[1])||Pe!==X(k,C,G[2])||Pe!==X(k,C,G[3])}function wh(k,C,G){var ne=C.paint.get(k).value;return ne.kind==="constant"?ne.value:G.programConfigurations.get(C.id).getMaxValue(k)}function ad(k){return Math.sqrt(k[0]*k[0]+k[1]*k[1])}function dd(k,C,G,ne,ye){if(!C[0]&&!C[1])return k;var Pe=n.convert(C)._mult(ye);G==="viewport"&&Pe._rotate(-ne);for(var Ve=[],ft=0;ft<k.length;ft++){var Rt=k[ft];Ve.push(Rt.sub(Pe))}return Ve}var nd=new Ti({"circle-sort-key":new Yt(rn.layout_circle["circle-sort-key"])}),jv=new Ti({"circle-radius":new Yt(rn.paint_circle["circle-radius"]),"circle-color":new Yt(rn.paint_circle["circle-color"]),"circle-blur":new Yt(rn.paint_circle["circle-blur"]),"circle-opacity":new Yt(rn.paint_circle["circle-opacity"]),"circle-translate":new rt(rn.paint_circle["circle-translate"]),"circle-translate-anchor":new rt(rn.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new rt(rn.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new rt(rn.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Yt(rn.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Yt(rn.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Yt(rn.paint_circle["circle-stroke-opacity"])}),tv={paint:jv,layout:nd},Uf=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var k=arguments,C=0,G=arguments.length;G--;)C+=k[G]*k[G];return Math.sqrt(C)});function rv(){var k=new Uf(4);return Uf!=Float32Array&&(k[1]=0,k[2]=0),k[0]=1,k[3]=1,k}function Vv(k,C,G){var ne=C[0],ye=C[1],Pe=C[2],Ve=C[3],ft=Math.sin(G),Rt=Math.cos(G);return k[0]=ne*Rt+Pe*ft,k[1]=ye*Rt+Ve*ft,k[2]=ne*-ft+Pe*Rt,k[3]=ye*-ft+Ve*Rt,k}function oh(){var k=new Uf(9);return Uf!=Float32Array&&(k[1]=0,k[2]=0,k[3]=0,k[5]=0,k[6]=0,k[7]=0),k[0]=1,k[4]=1,k[8]=1,k}function xv(k,C){var G=Math.sin(C),ne=Math.cos(C);return k[0]=ne,k[1]=G,k[2]=0,k[3]=-G,k[4]=ne,k[5]=0,k[6]=0,k[7]=0,k[8]=1,k}function xp(){var k=new Uf(16);return Uf!=Float32Array&&(k[1]=0,k[2]=0,k[3]=0,k[4]=0,k[6]=0,k[7]=0,k[8]=0,k[9]=0,k[11]=0,k[12]=0,k[13]=0,k[14]=0),k[0]=1,k[5]=1,k[10]=1,k[15]=1,k}function bp(k){var C=new Uf(16);return C[0]=k[0],C[1]=k[1],C[2]=k[2],C[3]=k[3],C[4]=k[4],C[5]=k[5],C[6]=k[6],C[7]=k[7],C[8]=k[8],C[9]=k[9],C[10]=k[10],C[11]=k[11],C[12]=k[12],C[13]=k[13],C[14]=k[14],C[15]=k[15],C}function qv(k){return k[0]=1,k[1]=0,k[2]=0,k[3]=0,k[4]=0,k[5]=1,k[6]=0,k[7]=0,k[8]=0,k[9]=0,k[10]=1,k[11]=0,k[12]=0,k[13]=0,k[14]=0,k[15]=1,k}function bv(k,C){var G=C[0],ne=C[1],ye=C[2],Pe=C[3],Ve=C[4],ft=C[5],Rt=C[6],Ht=C[7],rr=C[8],Pr=C[9],Zr=C[10],Hr=C[11],hi=C[12],Gi=C[13],Ra=C[14],ha=C[15],fn=G*ft-ne*Ve,Wa=G*Rt-ye*Ve,cn=G*Ht-Pe*Ve,bn=ne*Rt-ye*ft,Un=ne*Ht-Pe*ft,oo=ye*Ht-Pe*Rt,ro=rr*Gi-Pr*hi,Go=rr*Ra-Zr*hi,So=rr*ha-Hr*hi,Bo=Pr*Ra-Zr*Gi,Hs=Pr*ha-Hr*Gi,Wo=Zr*ha-Hr*Ra,Qo=fn*Wo-Wa*Hs+cn*Bo+bn*So-Un*Go+oo*ro;return Qo?(Qo=1/Qo,k[0]=(ft*Wo-Rt*Hs+Ht*Bo)*Qo,k[1]=(ye*Hs-ne*Wo-Pe*Bo)*Qo,k[2]=(Gi*oo-Ra*Un+ha*bn)*Qo,k[3]=(Zr*Un-Pr*oo-Hr*bn)*Qo,k[4]=(Rt*So-Ve*Wo-Ht*Go)*Qo,k[5]=(G*Wo-ye*So+Pe*Go)*Qo,k[6]=(Ra*cn-hi*oo-ha*Wa)*Qo,k[7]=(rr*oo-Zr*cn+Hr*Wa)*Qo,k[8]=(Ve*Hs-ft*So+Ht*ro)*Qo,k[9]=(ne*So-G*Hs-Pe*ro)*Qo,k[10]=(hi*Un-Gi*cn+ha*fn)*Qo,k[11]=(Pr*cn-rr*Un-Hr*fn)*Qo,k[12]=(ft*Go-Ve*Bo-Rt*ro)*Qo,k[13]=(G*Bo-ne*Go+ye*ro)*Qo,k[14]=(Gi*Wa-hi*bn-Ra*fn)*Qo,k[15]=(rr*bn-Pr*Wa+Zr*fn)*Qo,k):null}function wv(k,C,G){var ne=C[0],ye=C[1],Pe=C[2],Ve=C[3],ft=C[4],Rt=C[5],Ht=C[6],rr=C[7],Pr=C[8],Zr=C[9],Hr=C[10],hi=C[11],Gi=C[12],Ra=C[13],ha=C[14],fn=C[15],Wa=G[0],cn=G[1],bn=G[2],Un=G[3];return k[0]=Wa*ne+cn*ft+bn*Pr+Un*Gi,k[1]=Wa*ye+cn*Rt+bn*Zr+Un*Ra,k[2]=Wa*Pe+cn*Ht+bn*Hr+Un*ha,k[3]=Wa*Ve+cn*rr+bn*hi+Un*fn,Wa=G[4],cn=G[5],bn=G[6],Un=G[7],k[4]=Wa*ne+cn*ft+bn*Pr+Un*Gi,k[5]=Wa*ye+cn*Rt+bn*Zr+Un*Ra,k[6]=Wa*Pe+cn*Ht+bn*Hr+Un*ha,k[7]=Wa*Ve+cn*rr+bn*hi+Un*fn,Wa=G[8],cn=G[9],bn=G[10],Un=G[11],k[8]=Wa*ne+cn*ft+bn*Pr+Un*Gi,k[9]=Wa*ye+cn*Rt+bn*Zr+Un*Ra,k[10]=Wa*Pe+cn*Ht+bn*Hr+Un*ha,k[11]=Wa*Ve+cn*rr+bn*hi+Un*fn,Wa=G[12],cn=G[13],bn=G[14],Un=G[15],k[12]=Wa*ne+cn*ft+bn*Pr+Un*Gi,k[13]=Wa*ye+cn*Rt+bn*Zr+Un*Ra,k[14]=Wa*Pe+cn*Ht+bn*Hr+Un*ha,k[15]=Wa*Ve+cn*rr+bn*hi+Un*fn,k}function vc(k,C,G){var ne=G[0],ye=G[1],Pe=G[2],Ve,ft,Rt,Ht,rr,Pr,Zr,Hr,hi,Gi,Ra,ha;return C===k?(k[12]=C[0]*ne+C[4]*ye+C[8]*Pe+C[12],k[13]=C[1]*ne+C[5]*ye+C[9]*Pe+C[13],k[14]=C[2]*ne+C[6]*ye+C[10]*Pe+C[14],k[15]=C[3]*ne+C[7]*ye+C[11]*Pe+C[15]):(Ve=C[0],ft=C[1],Rt=C[2],Ht=C[3],rr=C[4],Pr=C[5],Zr=C[6],Hr=C[7],hi=C[8],Gi=C[9],Ra=C[10],ha=C[11],k[0]=Ve,k[1]=ft,k[2]=Rt,k[3]=Ht,k[4]=rr,k[5]=Pr,k[6]=Zr,k[7]=Hr,k[8]=hi,k[9]=Gi,k[10]=Ra,k[11]=ha,k[12]=Ve*ne+rr*ye+hi*Pe+C[12],k[13]=ft*ne+Pr*ye+Gi*Pe+C[13],k[14]=Rt*ne+Zr*ye+Ra*Pe+C[14],k[15]=Ht*ne+Hr*ye+ha*Pe+C[15]),k}function _u(k,C,G){var ne=G[0],ye=G[1],Pe=G[2];return k[0]=C[0]*ne,k[1]=C[1]*ne,k[2]=C[2]*ne,k[3]=C[3]*ne,k[4]=C[4]*ye,k[5]=C[5]*ye,k[6]=C[6]*ye,k[7]=C[7]*ye,k[8]=C[8]*Pe,k[9]=C[9]*Pe,k[10]=C[10]*Pe,k[11]=C[11]*Pe,k[12]=C[12],k[13]=C[13],k[14]=C[14],k[15]=C[15],k}function Th(k,C,G){var ne=Math.sin(G),ye=Math.cos(G),Pe=C[4],Ve=C[5],ft=C[6],Rt=C[7],Ht=C[8],rr=C[9],Pr=C[10],Zr=C[11];return C!==k&&(k[0]=C[0],k[1]=C[1],k[2]=C[2],k[3]=C[3],k[12]=C[12],k[13]=C[13],k[14]=C[14],k[15]=C[15]),k[4]=Pe*ye+Ht*ne,k[5]=Ve*ye+rr*ne,k[6]=ft*ye+Pr*ne,k[7]=Rt*ye+Zr*ne,k[8]=Ht*ye-Pe*ne,k[9]=rr*ye-Ve*ne,k[10]=Pr*ye-ft*ne,k[11]=Zr*ye-Rt*ne,k}function Hv(k,C,G){var ne=Math.sin(G),ye=Math.cos(G),Pe=C[0],Ve=C[1],ft=C[2],Rt=C[3],Ht=C[4],rr=C[5],Pr=C[6],Zr=C[7];return C!==k&&(k[8]=C[8],k[9]=C[9],k[10]=C[10],k[11]=C[11],k[12]=C[12],k[13]=C[13],k[14]=C[14],k[15]=C[15]),k[0]=Pe*ye+Ht*ne,k[1]=Ve*ye+rr*ne,k[2]=ft*ye+Pr*ne,k[3]=Rt*ye+Zr*ne,k[4]=Ht*ye-Pe*ne,k[5]=rr*ye-Ve*ne,k[6]=Pr*ye-ft*ne,k[7]=Zr*ye-Rt*ne,k}function wp(k,C,G,ne,ye){var Pe=1/Math.tan(C/2),Ve;return k[0]=Pe/G,k[1]=0,k[2]=0,k[3]=0,k[4]=0,k[5]=Pe,k[6]=0,k[7]=0,k[8]=0,k[9]=0,k[11]=-1,k[12]=0,k[13]=0,k[15]=0,ye!=null&&ye!==1/0?(Ve=1/(ne-ye),k[10]=(ye+ne)*Ve,k[14]=2*ye*ne*Ve):(k[10]=-1,k[14]=-2*ne),k}function Du(k,C,G,ne,ye,Pe,Ve){var ft=1/(C-G),Rt=1/(ne-ye),Ht=1/(Pe-Ve);return k[0]=-2*ft,k[1]=0,k[2]=0,k[3]=0,k[4]=0,k[5]=-2*Rt,k[6]=0,k[7]=0,k[8]=0,k[9]=0,k[10]=2*Ht,k[11]=0,k[12]=(C+G)*ft,k[13]=(ye+ne)*Rt,k[14]=(Ve+Pe)*Ht,k[15]=1,k}var h0=wv;function Tv(){var k=new Uf(3);return Uf!=Float32Array&&(k[0]=0,k[1]=0,k[2]=0),k}function fm(k){var C=new Uf(3);return C[0]=k[0],C[1]=k[1],C[2]=k[2],C}function od(k,C,G){return k[0]=C[0]+G[0],k[1]=C[1]+G[1],k[2]=C[2]+G[2],k}function Av(k,C,G){return k[0]=C[0]-G[0],k[1]=C[1]-G[1],k[2]=C[2]-G[2],k}function hm(k,C,G){return k[0]=C[0]*G,k[1]=C[1]*G,k[2]=C[2]*G,k}function d0(k,C){var G=C[0],ne=C[1],ye=C[2],Pe=G*G+ne*ne+ye*ye;return Pe>0&&(Pe=1/Math.sqrt(Pe)),k[0]=C[0]*Pe,k[1]=C[1]*Pe,k[2]=C[2]*Pe,k}function Vb(k,C){return k[0]*C[0]+k[1]*C[1]+k[2]*C[2]}function qb(k,C,G){var ne=C[0],ye=C[1],Pe=C[2],Ve=G[0],ft=G[1],Rt=G[2];return k[0]=ye*Rt-Pe*ft,k[1]=Pe*Ve-ne*Rt,k[2]=ne*ft-ye*Ve,k}function Hb(k,C,G){var ne=C[0],ye=C[1],Pe=C[2];return k[0]=ne*G[0]+ye*G[3]+Pe*G[6],k[1]=ne*G[1]+ye*G[4]+Pe*G[7],k[2]=ne*G[2]+ye*G[5]+Pe*G[8],k}var Gb=Av,KA=function(){var k=Tv();return function(C,G,ne,ye,Pe,Ve){var ft,Rt;for(G||(G=3),ne||(ne=0),ye?Rt=Math.min(ye*G+ne,C.length):Rt=C.length,ft=ne;ft<Rt;ft+=G)k[0]=C[ft],k[1]=C[ft+1],k[2]=C[ft+2],Pe(k,k,Ve),C[ft]=k[0],C[ft+1]=k[1],C[ft+2]=k[2];return C}}();function Wb(){var k=new Uf(4);return Uf!=Float32Array&&(k[0]=0,k[1]=0,k[2]=0,k[3]=0),k}function Xb(k,C,G){return k[0]=C[0]*G,k[1]=C[1]*G,k[2]=C[2]*G,k[3]=C[3]*G,k}function Yb(k,C){return k[0]*C[0]+k[1]*C[1]+k[2]*C[2]+k[3]*C[3]}function Gv(k,C,G){var ne=C[0],ye=C[1],Pe=C[2],Ve=C[3];return k[0]=G[0]*ne+G[4]*ye+G[8]*Pe+G[12]*Ve,k[1]=G[1]*ne+G[5]*ye+G[9]*Pe+G[13]*Ve,k[2]=G[2]*ne+G[6]*ye+G[10]*Pe+G[14]*Ve,k[3]=G[3]*ne+G[7]*ye+G[11]*Pe+G[15]*Ve,k}var v0=function(){var k=Wb();return function(C,G,ne,ye,Pe,Ve){var ft,Rt;for(G||(G=4),ne||(ne=0),ye?Rt=Math.min(ye*G+ne,C.length):Rt=C.length,ft=ne;ft<Rt;ft+=G)k[0]=C[ft],k[1]=C[ft+1],k[2]=C[ft+2],k[3]=C[ft+3],Pe(k,k,Ve),C[ft]=k[0],C[ft+1]=k[1],C[ft+2]=k[2],C[ft+3]=k[3];return C}}();function h1(){var k=new Uf(2);return Uf!=Float32Array&&(k[0]=0,k[1]=0),k}function Sg(k){var C=k[0],G=k[1];return C*C+G*G}var Mg=Sg,$A=function(){var k=h1();return function(C,G,ne,ye,Pe,Ve){var ft,Rt;for(G||(G=2),ne||(ne=0),ye?Rt=Math.min(ye*G+ne,C.length):Rt=C.length,ft=ne;ft<Rt;ft+=G)k[0]=C[ft],k[1]=C[ft+1],Pe(k,k,Ve),C[ft]=k[0],C[ft+1]=k[1];return C}}(),Zb=function(k){function C(G){k.call(this,G,tv)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.createBucket=function(ne){return new Xs(ne)},C.prototype.queryRadius=function(ne){var ye=ne;return wh("circle-radius",this,ye)+wh("circle-stroke-width",this,ye)+ad(this.paint.get("circle-translate"))},C.prototype.queryIntersectsFeature=function(ne,ye,Pe,Ve,ft,Rt,Ht,rr){for(var Pr=dd(ne,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),Rt.angle,Ht),Zr=this.paint.get("circle-radius").evaluate(ye,Pe),Hr=this.paint.get("circle-stroke-width").evaluate(ye,Pe),hi=Zr+Hr,Gi=this.paint.get("circle-pitch-alignment")==="map",Ra=Gi?Pr:v1(Pr,rr),ha=Gi?hi*Ht:hi,fn=0,Wa=Ve;fn<Wa.length;fn+=1)for(var cn=Wa[fn],bn=0,Un=cn;bn<Un.length;bn+=1){var oo=Un[bn],ro=Gi?oo:d1(oo,rr),Go=ha,So=Gv([],[oo.x,oo.y,0,1],rr);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Go*=So[3]/Rt.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Go*=Rt.cameraToCenterDistance/So[3]),Vs(Ra,ro,Go))return!0}return!1},C}(ia);function d1(k,C){var G=Gv([],[k.x,k.y,0,1],C);return new n(G[0]/G[3],G[1]/G[3])}function v1(k,C){return k.map(function(G){return d1(G,C)})}var Eg=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C}(Xs);de("HeatmapBucket",Eg,{omit:["layers"]});function Ah(k,C,G,ne){var ye=C.width,Pe=C.height;if(!ne)ne=new Uint8Array(ye*Pe*G);else if(ne instanceof Uint8ClampedArray)ne=new Uint8Array(ne.buffer);else if(ne.length!==ye*Pe*G)throw new RangeError("mismatched image size");return k.width=ye,k.height=Pe,k.data=ne,k}function dm(k,C,G){var ne=C.width,ye=C.height;if(!(ne===k.width&&ye===k.height)){var Pe=Ah({},{width:ne,height:ye},G);vm(k,Pe,{x:0,y:0},{x:0,y:0},{width:Math.min(k.width,ne),height:Math.min(k.height,ye)},G),k.width=ne,k.height=ye,k.data=Pe.data}}function vm(k,C,G,ne,ye,Pe){if(ye.width===0||ye.height===0)return C;if(ye.width>k.width||ye.height>k.height||G.x>k.width-ye.width||G.y>k.height-ye.height)throw new RangeError("out of range source coordinates for image copy");if(ye.width>C.width||ye.height>C.height||ne.x>C.width-ye.width||ne.y>C.height-ye.height)throw new RangeError("out of range destination coordinates for image copy");for(var Ve=k.data,ft=C.data,Rt=0;Rt<ye.height;Rt++)for(var Ht=((G.y+Rt)*k.width+G.x)*Pe,rr=((ne.y+Rt)*C.width+ne.x)*Pe,Pr=0;Pr<ye.width*Pe;Pr++)ft[rr+Pr]=Ve[Ht+Pr];return C}var sd=function(C,G){Ah(this,C,1,G)};sd.prototype.resize=function(C){dm(this,C,1)},sd.prototype.clone=function(){return new sd({width:this.width,height:this.height},new Uint8Array(this.data))},sd.copy=function(C,G,ne,ye,Pe){vm(C,G,ne,ye,Pe,1)};var Zf=function(C,G){Ah(this,C,4,G)};Zf.prototype.resize=function(C){dm(this,C,4)},Zf.prototype.replace=function(C,G){G?this.data.set(C):C instanceof Uint8ClampedArray?this.data=new Uint8Array(C.buffer):this.data=C},Zf.prototype.clone=function(){return new Zf({width:this.width,height:this.height},new Uint8Array(this.data))},Zf.copy=function(C,G,ne,ye,Pe){vm(C,G,ne,ye,Pe,4)},de("AlphaImage",sd),de("RGBAImage",Zf);var p0=new Ti({"heatmap-radius":new Yt(rn.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Yt(rn.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new rt(rn.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Ci(rn.paint_heatmap["heatmap-color"]),"heatmap-opacity":new rt(rn.paint_heatmap["heatmap-opacity"])}),Tp={paint:p0};function m0(k){var C={},G=k.resolution||256,ne=k.clips?k.clips.length:1,ye=k.image||new Zf({width:G,height:ne}),Pe=function(fn,Wa,cn){C[k.evaluationKey]=cn;var bn=k.expression.evaluate(C);ye.data[fn+Wa+0]=Math.floor(bn.r*255/bn.a),ye.data[fn+Wa+1]=Math.floor(bn.g*255/bn.a),ye.data[fn+Wa+2]=Math.floor(bn.b*255/bn.a),ye.data[fn+Wa+3]=Math.floor(bn.a*255)};if(k.clips)for(var Ht=0,rr=0;Ht<ne;++Ht,rr+=G*4)for(var Pr=0,Zr=0;Pr<G;Pr++,Zr+=4){var Hr=Pr/(G-1),hi=k.clips[Ht],Gi=hi.start,Ra=hi.end,ha=Gi*(1-Hr)+Ra*Hr;Pe(rr,Zr,ha)}else for(var Ve=0,ft=0;Ve<G;Ve++,ft+=4){var Rt=Ve/(G-1);Pe(0,ft,Rt)}return ye}var pm=function(k){function C(G){k.call(this,G,Tp),this._updateColorRamp()}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.createBucket=function(ne){return new Eg(ne)},C.prototype._handleSpecialPaintPropertyUpdate=function(ne){ne==="heatmap-color"&&this._updateColorRamp()},C.prototype._updateColorRamp=function(){var ne=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=m0({expression:ne,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},C.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},C.prototype.queryRadius=function(){return 0},C.prototype.queryIntersectsFeature=function(){return!1},C.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},C}(ia),Kb=new Ti({"hillshade-illumination-direction":new rt(rn.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new rt(rn.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new rt(rn.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new rt(rn.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new rt(rn.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new rt(rn.paint_hillshade["hillshade-accent-color"])}),$b={paint:Kb},p1=function(k){function C(G){k.call(this,G,$b)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},C}(ia),m1=Da([{name:"a_pos",components:2,type:"Int16"}],4),Jb=m1.members,mm=Ap,g1=Ap;function Ap(k,C,G){G=G||2;var ne=C&&C.length,ye=ne?C[0]*G:k.length,Pe=gm(k,0,ye,G,!0),Ve=[];if(!Pe||Pe.next===Pe.prev)return Ve;var ft,Rt,Ht,rr,Pr,Zr,Hr;if(ne&&(Pe=Mv(k,C,Pe,G)),k.length>80*G){ft=Ht=k[0],Rt=rr=k[1];for(var hi=G;hi<ye;hi+=G)Pr=k[hi],Zr=k[hi+1],Pr<ft&&(ft=Pr),Zr<Rt&&(Rt=Zr),Pr>Ht&&(Ht=Pr),Zr>rr&&(rr=Zr);Hr=Math.max(Ht-ft,rr-Rt),Hr=Hr!==0?1/Hr:0}return g0(Pe,Ve,G,ft,Rt,Hr),Ve}function gm(k,C,G,ne,ye){var Pe,Ve;if(ye===Dg(k,C,G,ne)>0)for(Pe=C;Pe<G;Pe+=ne)Ve=w1(Pe,k[Pe],k[Pe+1],Ve);else for(Pe=G-ne;Pe>=C;Pe-=ne)Ve=w1(Pe,k[Pe],k[Pe+1],Ve);return Ve&&_0(Ve,Ve.next)&&(w0(Ve),Ve=Ve.next),Ve}function Sv(k,C){if(!k)return k;C||(C=k);var G=k,ne;do if(ne=!1,!G.steiner&&(_0(G,G.next)||vf(G.prev,G,G.next)===0)){if(w0(G),G=C=G.prev,G===G.next)break;ne=!0}else G=G.next;while(ne||G!==C);return C}function g0(k,C,G,ne,ye,Pe,Ve){if(k){!Ve&&Pe&&ym(k,ne,ye,Pe);for(var ft=k,Rt,Ht;k.prev!==k.next;){if(Rt=k.prev,Ht=k.next,Pe?_1(k,ne,ye,Pe):y1(k)){C.push(Rt.i/G),C.push(k.i/G),C.push(Ht.i/G),w0(k),k=Ht.next,ft=Ht.next;continue}if(k=Ht,k===ft){Ve?Ve===1?(k=y0(Sv(k),C,G),g0(k,C,G,ne,ye,Pe,2)):Ve===2&&Ud(k,C,G,ne,ye,Pe):g0(Sv(k),C,G,ne,ye,Pe,1);break}}}}function y1(k){var C=k.prev,G=k,ne=k.next;if(vf(C,G,ne)>=0)return!1;for(var ye=k.next.next;ye!==k.prev;){if(Ev(C.x,C.y,G.x,G.y,ne.x,ne.y,ye.x,ye.y)&&vf(ye.prev,ye,ye.next)>=0)return!1;ye=ye.next}return!0}function _1(k,C,G,ne){var ye=k.prev,Pe=k,Ve=k.next;if(vf(ye,Pe,Ve)>=0)return!1;for(var ft=ye.x<Pe.x?ye.x<Ve.x?ye.x:Ve.x:Pe.x<Ve.x?Pe.x:Ve.x,Rt=ye.y<Pe.y?ye.y<Ve.y?ye.y:Ve.y:Pe.y<Ve.y?Pe.y:Ve.y,Ht=ye.x>Pe.x?ye.x>Ve.x?ye.x:Ve.x:Pe.x>Ve.x?Pe.x:Ve.x,rr=ye.y>Pe.y?ye.y>Ve.y?ye.y:Ve.y:Pe.y>Ve.y?Pe.y:Ve.y,Pr=Lg(ft,Rt,C,G,ne),Zr=Lg(Ht,rr,C,G,ne),Hr=k.prevZ,hi=k.nextZ;Hr&&Hr.z>=Pr&&hi&&hi.z<=Zr;){if(Hr!==k.prev&&Hr!==k.next&&Ev(ye.x,ye.y,Pe.x,Pe.y,Ve.x,Ve.y,Hr.x,Hr.y)&&vf(Hr.prev,Hr,Hr.next)>=0||(Hr=Hr.prevZ,hi!==k.prev&&hi!==k.next&&Ev(ye.x,ye.y,Pe.x,Pe.y,Ve.x,Ve.y,hi.x,hi.y)&&vf(hi.prev,hi,hi.next)>=0))return!1;hi=hi.nextZ}for(;Hr&&Hr.z>=Pr;){if(Hr!==k.prev&&Hr!==k.next&&Ev(ye.x,ye.y,Pe.x,Pe.y,Ve.x,Ve.y,Hr.x,Hr.y)&&vf(Hr.prev,Hr,Hr.next)>=0)return!1;Hr=Hr.prevZ}for(;hi&&hi.z<=Zr;){if(hi!==k.prev&&hi!==k.next&&Ev(ye.x,ye.y,Pe.x,Pe.y,Ve.x,Ve.y,hi.x,hi.y)&&vf(hi.prev,hi,hi.next)>=0)return!1;hi=hi.nextZ}return!0}function y0(k,C,G){var ne=k;do{var ye=ne.prev,Pe=ne.next.next;!_0(ye,Pe)&&_m(ye,ne,ne.next,Pe)&&b0(ye,Pe)&&b0(Pe,ye)&&(C.push(ye.i/G),C.push(ne.i/G),C.push(Pe.i/G),w0(ne),w0(ne.next),ne=k=Pe),ne=ne.next}while(ne!==k);return Sv(ne)}function Ud(k,C,G,ne,ye,Pe){var Ve=k;do{for(var ft=Ve.next.next;ft!==Ve.prev;){if(Ve.i!==ft.i&&Sp(Ve,ft)){var Rt=Pg(Ve,ft);Ve=Sv(Ve,Ve.next),Rt=Sv(Rt,Rt.next),g0(Ve,C,G,ne,ye,Pe),g0(Rt,C,G,ne,ye,Pe);return}ft=ft.next}Ve=Ve.next}while(Ve!==k)}function Mv(k,C,G,ne){var ye=[],Pe,Ve,ft,Rt,Ht;for(Pe=0,Ve=C.length;Pe<Ve;Pe++)ft=C[Pe]*ne,Rt=Pe<Ve-1?C[Pe+1]*ne:k.length,Ht=gm(k,ft,Rt,ne,!1),Ht===Ht.next&&(Ht.steiner=!0),ye.push(Ig(Ht));for(ye.sort(x1),Pe=0;Pe<ye.length;Pe++)kg(ye[Pe],G),G=Sv(G,G.next);return G}function x1(k,C){return k.x-C.x}function kg(k,C){if(C=Qb(k,C),C){var G=Pg(C,k);Sv(C,C.next),Sv(G,G.next)}}function Qb(k,C){var G=C,ne=k.x,ye=k.y,Pe=-1/0,Ve;do{if(ye<=G.y&&ye>=G.next.y&&G.next.y!==G.y){var ft=G.x+(ye-G.y)*(G.next.x-G.x)/(G.next.y-G.y);if(ft<=ne&&ft>Pe){if(Pe=ft,ft===ne){if(ye===G.y)return G;if(ye===G.next.y)return G.next}Ve=G.x<G.next.x?G:G.next}}G=G.next}while(G!==C);if(!Ve)return null;if(ne===Pe)return Ve;var Rt=Ve,Ht=Ve.x,rr=Ve.y,Pr=1/0,Zr;G=Ve;do ne>=G.x&&G.x>=Ht&&ne!==G.x&&Ev(ye<rr?ne:Pe,ye,Ht,rr,ye<rr?Pe:ne,ye,G.x,G.y)&&(Zr=Math.abs(ye-G.y)/(ne-G.x),b0(G,k)&&(Zr<Pr||Zr===Pr&&(G.x>Ve.x||G.x===Ve.x&&ew(Ve,G)))&&(Ve=G,Pr=Zr)),G=G.next;while(G!==Rt);return Ve}function ew(k,C){return vf(k.prev,k,C.prev)<0&&vf(C.next,k,k.next)<0}function ym(k,C,G,ne){var ye=k;do ye.z===null&&(ye.z=Lg(ye.x,ye.y,C,G,ne)),ye.prevZ=ye.prev,ye.nextZ=ye.next,ye=ye.next;while(ye!==k);ye.prevZ.nextZ=null,ye.prevZ=null,Cg(ye)}function Cg(k){var C,G,ne,ye,Pe,Ve,ft,Rt,Ht=1;do{for(G=k,k=null,Pe=null,Ve=0;G;){for(Ve++,ne=G,ft=0,C=0;C<Ht&&(ft++,ne=ne.nextZ,!!ne);C++);for(Rt=Ht;ft>0||Rt>0&≠)ft!==0&&(Rt===0||!ne||G.z<=ne.z)?(ye=G,G=G.nextZ,ft--):(ye=ne,ne=ne.nextZ,Rt--),Pe?Pe.nextZ=ye:k=ye,ye.prevZ=Pe,Pe=ye;G=ne}Pe.nextZ=null,Ht*=2}while(Ve>1);return k}function Lg(k,C,G,ne,ye){return k=32767*(k-G)*ye,C=32767*(C-ne)*ye,k=(k|k<<8)&16711935,k=(k|k<<4)&252645135,k=(k|k<<2)&858993459,k=(k|k<<1)&1431655765,C=(C|C<<8)&16711935,C=(C|C<<4)&252645135,C=(C|C<<2)&858993459,C=(C|C<<1)&1431655765,k|C<<1}function Ig(k){var C=k,G=k;do(C.x<G.x||C.x===G.x&&C.y<G.y)&&(G=C),C=C.next;while(C!==k);return G}function Ev(k,C,G,ne,ye,Pe,Ve,ft){return(ye-Ve)*(C-ft)-(k-Ve)*(Pe-ft)>=0&&(k-Ve)*(ne-ft)-(G-Ve)*(C-ft)>=0&&(G-Ve)*(Pe-ft)-(ye-Ve)*(ne-ft)>=0}function Sp(k,C){return k.next.i!==C.i&&k.prev.i!==C.i&&!b1(k,C)&&(b0(k,C)&&b0(C,k)&&tw(k,C)&&(vf(k.prev,k,C.prev)||vf(k,C.prev,C))||_0(k,C)&&vf(k.prev,k,k.next)>0&&vf(C.prev,C,C.next)>0)}function vf(k,C,G){return(C.y-k.y)*(G.x-C.x)-(C.x-k.x)*(G.y-C.y)}function _0(k,C){return k.x===C.x&&k.y===C.y}function _m(k,C,G,ne){var ye=Wv(vf(k,C,G)),Pe=Wv(vf(k,C,ne)),Ve=Wv(vf(G,ne,k)),ft=Wv(vf(G,ne,C));return!!(ye!==Pe&&Ve!==ft||ye===0&&x0(k,G,C)||Pe===0&&x0(k,ne,C)||Ve===0&&x0(G,k,ne)||ft===0&&x0(G,C,ne))}function x0(k,C,G){return C.x<=Math.max(k.x,G.x)&&C.x>=Math.min(k.x,G.x)&&C.y<=Math.max(k.y,G.y)&&C.y>=Math.min(k.y,G.y)}function Wv(k){return k>0?1:k<0?-1:0}function b1(k,C){var G=k;do{if(G.i!==k.i&&G.next.i!==k.i&&G.i!==C.i&&G.next.i!==C.i&&_m(G,G.next,k,C))return!0;G=G.next}while(G!==k);return!1}function b0(k,C){return vf(k.prev,k,k.next)<0?vf(k,C,k.next)>=0&&vf(k,k.prev,C)>=0:vf(k,C,k.prev)<0||vf(k,k.next,C)<0}function tw(k,C){var G=k,ne=!1,ye=(k.x+C.x)/2,Pe=(k.y+C.y)/2;do G.y>Pe!=G.next.y>Pe&&G.next.y!==G.y&&ye<(G.next.x-G.x)*(Pe-G.y)/(G.next.y-G.y)+G.x&&(ne=!ne),G=G.next;while(G!==k);return ne}function Pg(k,C){var G=new Rg(k.i,k.x,k.y),ne=new Rg(C.i,C.x,C.y),ye=k.next,Pe=C.prev;return k.next=C,C.prev=k,G.next=ye,ye.prev=G,ne.next=G,G.prev=ne,Pe.next=ne,ne.prev=Pe,ne}function w1(k,C,G,ne){var ye=new Rg(k,C,G);return ne?(ye.next=ne.next,ye.prev=ne,ne.next.prev=ye,ne.next=ye):(ye.prev=ye,ye.next=ye),ye}function w0(k){k.next.prev=k.prev,k.prev.next=k.next,k.prevZ&&(k.prevZ.nextZ=k.nextZ),k.nextZ&&(k.nextZ.prevZ=k.prevZ)}function Rg(k,C,G){this.i=k,this.x=C,this.y=G,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}Ap.deviation=function(k,C,G,ne){var ye=C&&C.length,Pe=ye?C[0]*G:k.length,Ve=Math.abs(Dg(k,0,Pe,G));if(ye)for(var ft=0,Rt=C.length;ft<Rt;ft++){var Ht=C[ft]*G,rr=ft<Rt-1?C[ft+1]*G:k.length;Ve-=Math.abs(Dg(k,Ht,rr,G))}var Pr=0;for(ft=0;ft<ne.length;ft+=3){var Zr=ne[ft]*G,Hr=ne[ft+1]*G,hi=ne[ft+2]*G;Pr+=Math.abs((k[Zr]-k[hi])*(k[Hr+1]-k[Zr+1])-(k[Zr]-k[Hr])*(k[hi+1]-k[Zr+1]))}return Ve===0&&Pr===0?0:Math.abs((Pr-Ve)/Ve)};function Dg(k,C,G,ne){for(var ye=0,Pe=C,Ve=G-ne;Pe<G;Pe+=ne)ye+=(k[Ve]-k[Pe])*(k[Pe+1]+k[Ve+1]),Ve=Pe;return ye}Ap.flatten=function(k){for(var C=k[0][0].length,G={vertices:[],holes:[],dimensions:C},ne=0,ye=0;ye<k.length;ye++){for(var Pe=0;Pe<k[ye].length;Pe++)for(var Ve=0;Ve<C;Ve++)G.vertices.push(k[ye][Pe][Ve]);ye>0&&(ne+=k[ye-1].length,G.holes.push(ne))}return G},mm.default=g1;function zg(k,C,G,ne,ye){iv(k,C,G||0,ne||k.length-1,ye||T1)}function iv(k,C,G,ne,ye){for(;ne>G;){if(ne-G>600){var Pe=ne-G+1,Ve=C-G+1,ft=Math.log(Pe),Rt=.5*Math.exp(2*ft/3),Ht=.5*Math.sqrt(ft*Rt*(Pe-Rt)/Pe)*(Ve-Pe/2<0?-1:1),rr=Math.max(G,Math.floor(C-Ve*Rt/Pe+Ht)),Pr=Math.min(ne,Math.floor(C+(Pe-Ve)*Rt/Pe+Ht));iv(k,C,rr,Pr,ye)}var Zr=k[C],Hr=G,hi=ne;for(Mp(k,G,C),ye(k[ne],Zr)>0&&Mp(k,G,ne);Hr<hi;){for(Mp(k,Hr,hi),Hr++,hi--;ye(k[Hr],Zr)<0;)Hr++;for(;ye(k[hi],Zr)>0;)hi--}ye(k[G],Zr)===0?Mp(k,G,hi):(hi++,Mp(k,hi,ne)),hi<=C&&(G=hi+1),C<=hi&&(ne=hi-1)}}function Mp(k,C,G){var ne=k[C];k[C]=k[G],k[G]=ne}function T1(k,C){return k<C?-1:k>C?1:0}function xm(k,C){var G=k.length;if(G<=1)return[k];for(var ne=[],ye,Pe,Ve=0;Ve<G;Ve++){var ft=J(k[Ve]);ft!==0&&(k[Ve].area=Math.abs(ft),Pe===void 0&&(Pe=ft<0),Pe===ft<0?(ye&&ne.push(ye),ye=[k[Ve]]):ye.push(k[Ve]))}if(ye&&ne.push(ye),C>1)for(var Rt=0;Rt<ne.length;Rt++)ne[Rt].length<=C||(zg(ne[Rt],C,1,ne[Rt].length-1,A1),ne[Rt]=ne[Rt].slice(0,C));return ne}function A1(k,C){return C.area-k.area}function bm(k,C,G){for(var ne=G.patternDependencies,ye=!1,Pe=0,Ve=C;Pe<Ve.length;Pe+=1){var ft=Ve[Pe],Rt=ft.paint.get(k+"-pattern");Rt.isConstant()||(ye=!0);var Ht=Rt.constantOr(null);Ht&&(ye=!0,ne[Ht.to]=!0,ne[Ht.from]=!0)}return ye}function T0(k,C,G,ne,ye){for(var Pe=ye.patternDependencies,Ve=0,ft=C;Ve<ft.length;Ve+=1){var Rt=ft[Ve],Ht=Rt.paint.get(k+"-pattern"),rr=Ht.value;if(rr.kind!=="constant"){var Pr=rr.evaluate({zoom:ne-1},G,{},ye.availableImages),Zr=rr.evaluate({zoom:ne},G,{},ye.availableImages),Hr=rr.evaluate({zoom:ne+1},G,{},ye.availableImages);Pr=Pr&&Pr.name?Pr.name:Pr,Zr=Zr&&Zr.name?Zr.name:Zr,Hr=Hr&&Hr.name?Hr.name:Hr,Pe[Pr]=!0,Pe[Zr]=!0,Pe[Hr]=!0,G.patterns[Rt.id]={min:Pr,mid:Zr,max:Hr}}}return G}var A0=500,kd=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(G){return G.id}),this.index=C.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new zi,this.indexArray=new on,this.indexArray2=new $n,this.programConfigurations=new Ji(C.layers,C.zoom),this.segments=new $o,this.segments2=new $o,this.stateDependentLayerIds=this.layers.filter(function(G){return G.isStateDependent()}).map(function(G){return G.id})};kd.prototype.populate=function(C,G,ne){this.hasPattern=bm("fill",this.layers,G);for(var ye=this.layers[0].layout.get("fill-sort-key"),Pe=[],Ve=0,ft=C;Ve<ft.length;Ve+=1){var Rt=ft[Ve],Ht=Rt.feature,rr=Rt.id,Pr=Rt.index,Zr=Rt.sourceLayerIndex,Hr=this.layers[0]._featureFilter.needGeometry,hi=No(Ht,Hr);if(this.layers[0]._featureFilter.filter(new Dn(this.zoom),hi,ne)){var Gi=ye?ye.evaluate(hi,{},ne,G.availableImages):void 0,Ra={id:rr,properties:Ht.properties,type:Ht.type,sourceLayerIndex:Zr,index:Pr,geometry:Hr?hi.geometry:Sn(Ht),patterns:{},sortKey:Gi};Pe.push(Ra)}}ye&&Pe.sort(function(So,Bo){return So.sortKey-Bo.sortKey});for(var ha=0,fn=Pe;ha<fn.length;ha+=1){var Wa=fn[ha],cn=Wa,bn=cn.geometry,Un=cn.index,oo=cn.sourceLayerIndex;if(this.hasPattern){var ro=T0("fill",this.layers,Wa,this.zoom,G);this.patternFeatures.push(ro)}else this.addFeature(Wa,bn,Un,ne,{});var Go=C[Un].feature;G.featureIndex.insert(Go,bn,Un,oo,this.index)}},kd.prototype.update=function(C,G,ne){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,G,this.stateDependentLayers,ne)},kd.prototype.addFeatures=function(C,G,ne){for(var ye=0,Pe=this.patternFeatures;ye<Pe.length;ye+=1){var Ve=Pe[ye];this.addFeature(Ve,Ve.geometry,Ve.index,G,ne)}},kd.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},kd.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},kd.prototype.upload=function(C){this.uploaded||(this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,Jb),this.indexBuffer=C.createIndexBuffer(this.indexArray),this.indexBuffer2=C.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(C),this.uploaded=!0},kd.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},kd.prototype.addFeature=function(C,G,ne,ye,Pe){for(var Ve=0,ft=xm(G,A0);Ve<ft.length;Ve+=1){for(var Rt=ft[Ve],Ht=0,rr=0,Pr=Rt;rr<Pr.length;rr+=1){var Zr=Pr[rr];Ht+=Zr.length}for(var Hr=this.segments.prepareSegment(Ht,this.layoutVertexArray,this.indexArray),hi=Hr.vertexLength,Gi=[],Ra=[],ha=0,fn=Rt;ha<fn.length;ha+=1){var Wa=fn[ha];if(Wa.length!==0){Wa!==Rt[0]&&Ra.push(Gi.length/2);var cn=this.segments2.prepareSegment(Wa.length,this.layoutVertexArray,this.indexArray2),bn=cn.vertexLength;this.layoutVertexArray.emplaceBack(Wa[0].x,Wa[0].y),this.indexArray2.emplaceBack(bn+Wa.length-1,bn),Gi.push(Wa[0].x),Gi.push(Wa[0].y);for(var Un=1;Un<Wa.length;Un++)this.layoutVertexArray.emplaceBack(Wa[Un].x,Wa[Un].y),this.indexArray2.emplaceBack(bn+Un-1,bn+Un),Gi.push(Wa[Un].x),Gi.push(Wa[Un].y);cn.vertexLength+=Wa.length,cn.primitiveLength+=Wa.length}}for(var oo=mm(Gi,Ra),ro=0;ro<oo.length;ro+=3)this.indexArray.emplaceBack(hi+oo[ro],hi+oo[ro+1],hi+oo[ro+2]);Hr.vertexLength+=Ht,Hr.primitiveLength+=oo.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ne,Pe,ye)},de("FillBucket",kd,{omit:["layers","patternFeatures"]});var Fg=new Ti({"fill-sort-key":new Yt(rn.layout_fill["fill-sort-key"])}),S1=new Ti({"fill-antialias":new rt(rn.paint_fill["fill-antialias"]),"fill-opacity":new Yt(rn.paint_fill["fill-opacity"]),"fill-color":new Yt(rn.paint_fill["fill-color"]),"fill-outline-color":new Yt(rn.paint_fill["fill-outline-color"]),"fill-translate":new rt(rn.paint_fill["fill-translate"]),"fill-translate-anchor":new rt(rn.paint_fill["fill-translate-anchor"]),"fill-pattern":new hr(rn.paint_fill["fill-pattern"])}),vd={paint:S1,layout:Fg},S0=function(k){function C(G){k.call(this,G,vd)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.recalculate=function(ne,ye){k.prototype.recalculate.call(this,ne,ye);var Pe=this.paint._values["fill-outline-color"];Pe.value.kind==="constant"&&Pe.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},C.prototype.createBucket=function(ne){return new kd(ne)},C.prototype.queryRadius=function(){return ad(this.paint.get("fill-translate"))},C.prototype.queryIntersectsFeature=function(ne,ye,Pe,Ve,ft,Rt,Ht){var rr=dd(ne,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),Rt.angle,Ht);return ll(rr,Ve)},C.prototype.isTileClipped=function(){return!0},C}(ia),M1=Da([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),E1=M1.members,Bg=Xv;function Xv(k,C,G,ne,ye){this.properties={},this.extent=G,this.type=0,this._pbf=k,this._geometry=-1,this._keys=ne,this._values=ye,k.readFields(k1,this,C)}function k1(k,C,G){k==1?C.id=G.readVarint():k==2?C1(G,C):k==3?C.type=G.readVarint():k==4&&(C._geometry=G.pos)}function C1(k,C){for(var G=k.readVarint()+k.pos;k.pos<G;){var ne=C._keys[k.readVarint()],ye=C._values[k.readVarint()];C.properties[ne]=ye}}Xv.types=["Unknown","Point","LineString","Polygon"],Xv.prototype.loadGeometry=function(){var k=this._pbf;k.pos=this._geometry;for(var C=k.readVarint()+k.pos,G=1,ne=0,ye=0,Pe=0,Ve=[],ft;k.pos<C;){if(ne<=0){var Rt=k.readVarint();G=Rt&7,ne=Rt>>3}if(ne--,G===1||G===2)ye+=k.readSVarint(),Pe+=k.readSVarint(),G===1&&(ft&&Ve.push(ft),ft=[]),ft.push(new n(ye,Pe));else if(G===7)ft&&ft.push(ft[0].clone());else throw new Error("unknown command "+G)}return ft&&Ve.push(ft),Ve},Xv.prototype.bbox=function(){var k=this._pbf;k.pos=this._geometry;for(var C=k.readVarint()+k.pos,G=1,ne=0,ye=0,Pe=0,Ve=1/0,ft=-1/0,Rt=1/0,Ht=-1/0;k.pos<C;){if(ne<=0){var rr=k.readVarint();G=rr&7,ne=rr>>3}if(ne--,G===1||G===2)ye+=k.readSVarint(),Pe+=k.readSVarint(),ye<Ve&&(Ve=ye),ye>ft&&(ft=ye),Pe<Rt&&(Rt=Pe),Pe>Ht&&(Ht=Pe);else if(G!==7)throw new Error("unknown command "+G)}return[Ve,Rt,ft,Ht]},Xv.prototype.toGeoJSON=function(k,C,G){var ne=this.extent*Math.pow(2,G),ye=this.extent*k,Pe=this.extent*C,Ve=this.loadGeometry(),ft=Xv.types[this.type],Rt,Ht;function rr(Hr){for(var hi=0;hi<Hr.length;hi++){var Gi=Hr[hi],Ra=180-(Gi.y+Pe)*360/ne;Hr[hi]=[(Gi.x+ye)*360/ne-180,360/Math.PI*Math.atan(Math.exp(Ra*Math.PI/180))-90]}}switch(this.type){case 1:var Pr=[];for(Rt=0;Rt<Ve.length;Rt++)Pr[Rt]=Ve[Rt][0];Ve=Pr,rr(Ve);break;case 2:for(Rt=0;Rt<Ve.length;Rt++)rr(Ve[Rt]);break;case 3:for(Ve=rw(Ve),Rt=0;Rt<Ve.length;Rt++)for(Ht=0;Ht<Ve[Rt].length;Ht++)rr(Ve[Rt][Ht]);break}Ve.length===1?Ve=Ve[0]:ft="Multi"+ft;var Zr={type:"Feature",geometry:{type:ft,coordinates:Ve},properties:this.properties};return"id"in this&&(Zr.id=this.id),Zr};function rw(k){var C=k.length;if(C<=1)return[k];for(var G=[],ne,ye,Pe=0;Pe<C;Pe++){var Ve=L1(k[Pe]);Ve!==0&&(ye===void 0&&(ye=Ve<0),ye===Ve<0?(ne&&G.push(ne),ne=[k[Pe]]):ne.push(k[Pe]))}return ne&&G.push(ne),G}function L1(k){for(var C=0,G=0,ne=k.length,ye=ne-1,Pe,Ve;G<ne;ye=G++)Pe=k[G],Ve=k[ye],C+=(Ve.x-Pe.x)*(Pe.y+Ve.y);return C}var av=Og;function Og(k,C){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=k,this._keys=[],this._values=[],this._features=[],k.readFields(I1,this,C),this.length=this._features.length}function I1(k,C,G){k===15?C.version=G.readVarint():k===1?C.name=G.readString():k===5?C.extent=G.readVarint():k===2?C._features.push(G.pos):k===3?C._keys.push(G.readString()):k===4&&C._values.push(P1(G))}function P1(k){for(var C=null,G=k.readVarint()+k.pos;k.pos<G;){var ne=k.readVarint()>>3;C=ne===1?k.readString():ne===2?k.readFloat():ne===3?k.readDouble():ne===4?k.readVarint64():ne===5?k.readVarint():ne===6?k.readSVarint():ne===7?k.readBoolean():null}return C}Og.prototype.feature=function(k){if(k<0||k>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[k];var C=this._pbf.readVarint()+this._pbf.pos;return new Bg(this._pbf,C,this.extent,this._keys,this._values)};var R1=iw;function iw(k,C){this.layers=k.readFields(aw,{},C)}function aw(k,C,G){if(k===3){var ne=new av(G,G.readVarint()+G.pos);ne.length&&(C[ne.name]=ne)}}var D1=R1,Ep=Bg,z1=av,nv={VectorTile:D1,VectorTileFeature:Ep,VectorTileLayer:z1},F1=nv.VectorTileFeature.types,wm=500,kp=Math.pow(2,13);function kv(k,C,G,ne,ye,Pe,Ve,ft){k.emplaceBack(C,G,Math.floor(ne*kp)*2+Ve,ye*kp*2,Pe*kp*2,Math.round(ft))}var Pd=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(G){return G.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new ba,this.indexArray=new on,this.programConfigurations=new Ji(C.layers,C.zoom),this.segments=new $o,this.stateDependentLayerIds=this.layers.filter(function(G){return G.isStateDependent()}).map(function(G){return G.id})};Pd.prototype.populate=function(C,G,ne){this.features=[],this.hasPattern=bm("fill-extrusion",this.layers,G);for(var ye=0,Pe=C;ye<Pe.length;ye+=1){var Ve=Pe[ye],ft=Ve.feature,Rt=Ve.id,Ht=Ve.index,rr=Ve.sourceLayerIndex,Pr=this.layers[0]._featureFilter.needGeometry,Zr=No(ft,Pr);if(this.layers[0]._featureFilter.filter(new Dn(this.zoom),Zr,ne)){var Hr={id:Rt,sourceLayerIndex:rr,index:Ht,geometry:Pr?Zr.geometry:Sn(ft),properties:ft.properties,type:ft.type,patterns:{}};this.hasPattern?this.features.push(T0("fill-extrusion",this.layers,Hr,this.zoom,G)):this.addFeature(Hr,Hr.geometry,Ht,ne,{}),G.featureIndex.insert(ft,Hr.geometry,Ht,rr,this.index,!0)}}},Pd.prototype.addFeatures=function(C,G,ne){for(var ye=0,Pe=this.features;ye<Pe.length;ye+=1){var Ve=Pe[ye],ft=Ve.geometry;this.addFeature(Ve,ft,Ve.index,G,ne)}},Pd.prototype.update=function(C,G,ne){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,G,this.stateDependentLayers,ne)},Pd.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Pd.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Pd.prototype.upload=function(C){this.uploaded||(this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,E1),this.indexBuffer=C.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(C),this.uploaded=!0},Pd.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Pd.prototype.addFeature=function(C,G,ne,ye,Pe){for(var Ve=0,ft=xm(G,wm);Ve<ft.length;Ve+=1){for(var Rt=ft[Ve],Ht=0,rr=0,Pr=Rt;rr<Pr.length;rr+=1){var Zr=Pr[rr];Ht+=Zr.length}for(var Hr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),hi=0,Gi=Rt;hi<Gi.length;hi+=1){var Ra=Gi[hi];if(Ra.length!==0&&!ow(Ra))for(var ha=0,fn=0;fn<Ra.length;fn++){var Wa=Ra[fn];if(fn>=1){var cn=Ra[fn-1];if(!nw(Wa,cn)){Hr.vertexLength+4>$o.MAX_VERTEX_ARRAY_LENGTH&&(Hr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var bn=Wa.sub(cn)._perp()._unit(),Un=cn.dist(Wa);ha+Un>32768&&(ha=0),kv(this.layoutVertexArray,Wa.x,Wa.y,bn.x,bn.y,0,0,ha),kv(this.layoutVertexArray,Wa.x,Wa.y,bn.x,bn.y,0,1,ha),ha+=Un,kv(this.layoutVertexArray,cn.x,cn.y,bn.x,bn.y,0,0,ha),kv(this.layoutVertexArray,cn.x,cn.y,bn.x,bn.y,0,1,ha);var oo=Hr.vertexLength;this.indexArray.emplaceBack(oo,oo+2,oo+1),this.indexArray.emplaceBack(oo+1,oo+2,oo+3),Hr.vertexLength+=4,Hr.primitiveLength+=2}}}}if(Hr.vertexLength+Ht>$o.MAX_VERTEX_ARRAY_LENGTH&&(Hr=this.segments.prepareSegment(Ht,this.layoutVertexArray,this.indexArray)),F1[C.type]==="Polygon"){for(var ro=[],Go=[],So=Hr.vertexLength,Bo=0,Hs=Rt;Bo<Hs.length;Bo+=1){var Wo=Hs[Bo];if(Wo.length!==0){Wo!==Rt[0]&&Go.push(ro.length/2);for(var Qo=0;Qo<Wo.length;Qo++){var fl=Wo[Qo];kv(this.layoutVertexArray,fl.x,fl.y,0,0,1,1,0),ro.push(fl.x),ro.push(fl.y)}}}for(var Os=mm(ro,Go),iu=0;iu<Os.length;iu+=3)this.indexArray.emplaceBack(So+Os[iu],So+Os[iu+2],So+Os[iu+1]);Hr.primitiveLength+=Os.length/3,Hr.vertexLength+=Ht}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ne,Pe,ye)},de("FillExtrusionBucket",Pd,{omit:["layers","features"]});function nw(k,C){return k.x===C.x&&(k.x<0||k.x>ma)||k.y===C.y&&(k.y<0||k.y>ma)}function ow(k){return k.every(function(C){return C.x<0})||k.every(function(C){return C.x>ma})||k.every(function(C){return C.y<0})||k.every(function(C){return C.y>ma})}var Cp=new Ti({"fill-extrusion-opacity":new rt(rn["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Yt(rn["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new rt(rn["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new rt(rn["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new hr(rn["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Yt(rn["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Yt(rn["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new rt(rn["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),mh={paint:Cp},Cv=function(k){function C(G){k.call(this,G,mh)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.createBucket=function(ne){return new Pd(ne)},C.prototype.queryRadius=function(){return ad(this.paint.get("fill-extrusion-translate"))},C.prototype.is3D=function(){return!0},C.prototype.queryIntersectsFeature=function(ne,ye,Pe,Ve,ft,Rt,Ht,rr){var Pr=dd(ne,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Rt.angle,Ht),Zr=this.paint.get("fill-extrusion-height").evaluate(ye,Pe),Hr=this.paint.get("fill-extrusion-base").evaluate(ye,Pe),hi=sw(Pr,rr,Rt,0),Gi=Ug(Ve,Hr,Zr,rr),Ra=Gi[0],ha=Gi[1];return B1(Ra,ha,hi)},C}(ia);function Yv(k,C){return k.x*C.x+k.y*C.y}function Ng(k,C){if(k.length===1){for(var G=0,ne=C[G++],ye;!ye||ne.equals(ye);)if(ye=C[G++],!ye)return 1/0;for(;G<C.length;G++){var Pe=C[G],Ve=k[0],ft=ye.sub(ne),Rt=Pe.sub(ne),Ht=Ve.sub(ne),rr=Yv(ft,ft),Pr=Yv(ft,Rt),Zr=Yv(Rt,Rt),Hr=Yv(Ht,ft),hi=Yv(Ht,Rt),Gi=rr*Zr-Pr*Pr,Ra=(Zr*Hr-Pr*hi)/Gi,ha=(rr*hi-Pr*Hr)/Gi,fn=1-Ra-ha,Wa=ne.z*fn+ye.z*Ra+Pe.z*ha;if(isFinite(Wa))return Wa}return 1/0}else{for(var cn=1/0,bn=0,Un=C;bn<Un.length;bn+=1){var oo=Un[bn];cn=Math.min(cn,oo.z)}return cn}}function B1(k,C,G){var ne=1/0;ll(G,C)&&(ne=Ng(G,C[0]));for(var ye=0;ye<C.length;ye++)for(var Pe=C[ye],Ve=k[ye],ft=0;ft<Pe.length-1;ft++){var Rt=Pe[ft],Ht=Pe[ft+1],rr=Ve[ft],Pr=Ve[ft+1],Zr=[Rt,Ht,Pr,rr,Rt];ts(G,Zr)&&(ne=Math.min(ne,Ng(G,Zr)))}return ne===1/0?!1:ne}function Ug(k,C,G,ne){for(var ye=[],Pe=[],Ve=ne[8]*C,ft=ne[9]*C,Rt=ne[10]*C,Ht=ne[11]*C,rr=ne[8]*G,Pr=ne[9]*G,Zr=ne[10]*G,Hr=ne[11]*G,hi=0,Gi=k;hi<Gi.length;hi+=1){for(var Ra=Gi[hi],ha=[],fn=[],Wa=0,cn=Ra;Wa<cn.length;Wa+=1){var bn=cn[Wa],Un=bn.x,oo=bn.y,ro=ne[0]*Un+ne[4]*oo+ne[12],Go=ne[1]*Un+ne[5]*oo+ne[13],So=ne[2]*Un+ne[6]*oo+ne[14],Bo=ne[3]*Un+ne[7]*oo+ne[15],Hs=ro+Ve,Wo=Go+ft,Qo=So+Rt,fl=Bo+Ht,Os=ro+rr,iu=Go+Pr,Vu=So+Zr,au=Bo+Hr,nu=new n(Hs/fl,Wo/fl);nu.z=Qo/fl,ha.push(nu);var Xl=new n(Os/au,iu/au);Xl.z=Vu/au,fn.push(Xl)}ye.push(ha),Pe.push(fn)}return[ye,Pe]}function sw(k,C,G,ne){for(var ye=[],Pe=0,Ve=k;Pe<Ve.length;Pe+=1){var ft=Ve[Pe],Rt=[ft.x,ft.y,ne,1];Gv(Rt,Rt,C),ye.push(new n(Rt[0]/Rt[3],Rt[1]/Rt[3]))}return ye}var O1=Da([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),N1=O1.members,lw=Da([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),U1=lw.members,jg=nv.VectorTileFeature.types,Tm=63,j1=Math.cos(75/2*(Math.PI/180)),M0=15,Vg=20,V1=15,Am=1/2,E0=Math.pow(2,V1-1)/Am,jf=function(C){var G=this;this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(ne){return ne.id}),this.index=C.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(ne){G.gradients[ne.id]={}}),this.layoutVertexArray=new $i,this.layoutVertexArray2=new Xa,this.indexArray=new on,this.programConfigurations=new Ji(C.layers,C.zoom),this.segments=new $o,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(ne){return ne.isStateDependent()}).map(function(ne){return ne.id})};jf.prototype.populate=function(C,G,ne){this.hasPattern=bm("line",this.layers,G);for(var ye=this.layers[0].layout.get("line-sort-key"),Pe=[],Ve=0,ft=C;Ve<ft.length;Ve+=1){var Rt=ft[Ve],Ht=Rt.feature,rr=Rt.id,Pr=Rt.index,Zr=Rt.sourceLayerIndex,Hr=this.layers[0]._featureFilter.needGeometry,hi=No(Ht,Hr);if(this.layers[0]._featureFilter.filter(new Dn(this.zoom),hi,ne)){var Gi=ye?ye.evaluate(hi,{},ne):void 0,Ra={id:rr,properties:Ht.properties,type:Ht.type,sourceLayerIndex:Zr,index:Pr,geometry:Hr?hi.geometry:Sn(Ht),patterns:{},sortKey:Gi};Pe.push(Ra)}}ye&&Pe.sort(function(So,Bo){return So.sortKey-Bo.sortKey});for(var ha=0,fn=Pe;ha<fn.length;ha+=1){var Wa=fn[ha],cn=Wa,bn=cn.geometry,Un=cn.index,oo=cn.sourceLayerIndex;if(this.hasPattern){var ro=T0("line",this.layers,Wa,this.zoom,G);this.patternFeatures.push(ro)}else this.addFeature(Wa,bn,Un,ne,{});var Go=C[Un].feature;G.featureIndex.insert(Go,bn,Un,oo,this.index)}},jf.prototype.update=function(C,G,ne){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,G,this.stateDependentLayers,ne)},jf.prototype.addFeatures=function(C,G,ne){for(var ye=0,Pe=this.patternFeatures;ye<Pe.length;ye+=1){var Ve=Pe[ye];this.addFeature(Ve,Ve.geometry,Ve.index,G,ne)}},jf.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},jf.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},jf.prototype.upload=function(C){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=C.createVertexBuffer(this.layoutVertexArray2,U1)),this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,N1),this.indexBuffer=C.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(C),this.uploaded=!0},jf.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},jf.prototype.lineFeatureClips=function(C){if(C.properties&&C.properties.hasOwnProperty("mapbox_clip_start")&&C.properties.hasOwnProperty("mapbox_clip_end")){var G=+C.properties.mapbox_clip_start,ne=+C.properties.mapbox_clip_end;return{start:G,end:ne}}},jf.prototype.addFeature=function(C,G,ne,ye,Pe){var Ve=this.layers[0].layout,ft=Ve.get("line-join").evaluate(C,{}),Rt=Ve.get("line-cap"),Ht=Ve.get("line-miter-limit"),rr=Ve.get("line-round-limit");this.lineClips=this.lineFeatureClips(C);for(var Pr=0,Zr=G;Pr<Zr.length;Pr+=1){var Hr=Zr[Pr];this.addLine(Hr,C,ft,Rt,Ht,rr)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ne,Pe,ye)},jf.prototype.addLine=function(C,G,ne,ye,Pe,Ve){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var ft=0;ft<C.length-1;ft++)this.totalDistance+=C[ft].dist(C[ft+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var Rt=jg[G.type]==="Polygon",Ht=C.length;Ht>=2&&C[Ht-1].equals(C[Ht-2]);)Ht--;for(var rr=0;rr<Ht-1&&C[rr].equals(C[rr+1]);)rr++;if(!(Ht<(Rt?3:2))){ne==="bevel"&&(Pe=1.05);var Pr=this.overscaling<=16?M0*ma/(512*this.overscaling):0,Zr=this.segments.prepareSegment(Ht*10,this.layoutVertexArray,this.indexArray),Hr,hi=void 0,Gi=void 0,Ra=void 0,ha=void 0;this.e1=this.e2=-1,Rt&&(Hr=C[Ht-2],ha=C[rr].sub(Hr)._unit()._perp());for(var fn=rr;fn<Ht;fn++)if(Gi=fn===Ht-1?Rt?C[rr+1]:void 0:C[fn+1],!(Gi&&C[fn].equals(Gi))){ha&&(Ra=ha),Hr&&(hi=Hr),Hr=C[fn],ha=Gi?Gi.sub(Hr)._unit()._perp():Ra,Ra=Ra||ha;var Wa=Ra.add(ha);(Wa.x!==0||Wa.y!==0)&&Wa._unit();var cn=Ra.x*ha.x+Ra.y*ha.y,bn=Wa.x*ha.x+Wa.y*ha.y,Un=bn!==0?1/bn:1/0,oo=2*Math.sqrt(2-2*bn),ro=bn<j1&&hi&&Gi,Go=Ra.x*ha.y-Ra.y*ha.x>0;if(ro&&fn>rr){var So=Hr.dist(hi);if(So>2*Pr){var Bo=Hr.sub(Hr.sub(hi)._mult(Pr/So)._round());this.updateDistance(hi,Bo),this.addCurrentVertex(Bo,Ra,0,0,Zr),hi=Bo}}var Hs=hi&&Gi,Wo=Hs?ne:Rt?"butt":ye;if(Hs&&Wo==="round"&&(Un<Ve?Wo="miter":Un<=2&&(Wo="fakeround")),Wo==="miter"&&Un>Pe&&(Wo="bevel"),Wo==="bevel"&&(Un>2&&(Wo="flipbevel"),Un<Pe&&(Wo="miter")),hi&&this.updateDistance(hi,Hr),Wo==="miter")Wa._mult(Un),this.addCurrentVertex(Hr,Wa,0,0,Zr);else if(Wo==="flipbevel"){if(Un>100)Wa=ha.mult(-1);else{var Qo=Un*Ra.add(ha).mag()/Ra.sub(ha).mag();Wa._perp()._mult(Qo*(Go?-1:1))}this.addCurrentVertex(Hr,Wa,0,0,Zr),this.addCurrentVertex(Hr,Wa.mult(-1),0,0,Zr)}else if(Wo==="bevel"||Wo==="fakeround"){var fl=-Math.sqrt(Un*Un-1),Os=Go?fl:0,iu=Go?0:fl;if(hi&&this.addCurrentVertex(Hr,Ra,Os,iu,Zr),Wo==="fakeround")for(var Vu=Math.round(oo*180/Math.PI/Vg),au=1;au<Vu;au++){var nu=au/Vu;if(nu!==.5){var Xl=nu-.5,nc=1.0904+cn*(-3.2452+cn*(3.55645-cn*1.43519)),mc=.848013+cn*(-1.06021+cn*.215638);nu=nu+nu*Xl*(nu-1)*(nc*Xl*Xl+mc)}var mf=ha.sub(Ra)._mult(nu)._add(Ra)._unit()._mult(Go?-1:1);this.addHalfVertex(Hr,mf.x,mf.y,!1,Go,0,Zr)}Gi&&this.addCurrentVertex(Hr,ha,-Os,-iu,Zr)}else if(Wo==="butt")this.addCurrentVertex(Hr,Wa,0,0,Zr);else if(Wo==="square"){var wf=hi?1:-1;this.addCurrentVertex(Hr,Wa,wf,wf,Zr)}else Wo==="round"&&(hi&&(this.addCurrentVertex(Hr,Ra,0,0,Zr),this.addCurrentVertex(Hr,Ra,1,1,Zr,!0)),Gi&&(this.addCurrentVertex(Hr,ha,-1,-1,Zr,!0),this.addCurrentVertex(Hr,ha,0,0,Zr)));if(ro&&fn<Ht-1){var ch=Hr.dist(Gi);if(ch>2*Pr){var Hf=Hr.add(Gi.sub(Hr)._mult(Pr/ch)._round());this.updateDistance(Hr,Hf),this.addCurrentVertex(Hf,ha,0,0,Zr),Hr=Hf}}}}},jf.prototype.addCurrentVertex=function(C,G,ne,ye,Pe,Ve){Ve===void 0&&(Ve=!1);var ft=G.x+G.y*ne,Rt=G.y-G.x*ne,Ht=-G.x+G.y*ye,rr=-G.y-G.x*ye;this.addHalfVertex(C,ft,Rt,Ve,!1,ne,Pe),this.addHalfVertex(C,Ht,rr,Ve,!0,-ye,Pe),this.distance>E0/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(C,G,ne,ye,Pe,Ve))},jf.prototype.addHalfVertex=function(C,G,ne,ye,Pe,Ve,ft){var Rt=C.x,Ht=C.y,rr=this.lineClips?this.scaledDistance*(E0-1):this.scaledDistance,Pr=rr*Am;if(this.layoutVertexArray.emplaceBack((Rt<<1)+(ye?1:0),(Ht<<1)+(Pe?1:0),Math.round(Tm*G)+128,Math.round(Tm*ne)+128,(Ve===0?0:Ve<0?-1:1)+1|(Pr&63)<<2,Pr>>6),this.lineClips){var Zr=this.scaledDistance-this.lineClips.start,Hr=this.lineClips.end-this.lineClips.start,hi=Zr/Hr;this.layoutVertexArray2.emplaceBack(hi,this.lineClipsArray.length)}var Gi=ft.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Gi),ft.primitiveLength++),Pe?this.e2=Gi:this.e1=Gi},jf.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},jf.prototype.updateDistance=function(C,G){this.distance+=C.dist(G),this.updateScaledDistance()},de("LineBucket",jf,{omit:["layers","patternFeatures"]});var qg=new Ti({"line-cap":new rt(rn.layout_line["line-cap"]),"line-join":new Yt(rn.layout_line["line-join"]),"line-miter-limit":new rt(rn.layout_line["line-miter-limit"]),"line-round-limit":new rt(rn.layout_line["line-round-limit"]),"line-sort-key":new Yt(rn.layout_line["line-sort-key"])}),Hg=new Ti({"line-opacity":new Yt(rn.paint_line["line-opacity"]),"line-color":new Yt(rn.paint_line["line-color"]),"line-translate":new rt(rn.paint_line["line-translate"]),"line-translate-anchor":new rt(rn.paint_line["line-translate-anchor"]),"line-width":new Yt(rn.paint_line["line-width"]),"line-gap-width":new Yt(rn.paint_line["line-gap-width"]),"line-offset":new Yt(rn.paint_line["line-offset"]),"line-blur":new Yt(rn.paint_line["line-blur"]),"line-dasharray":new li(rn.paint_line["line-dasharray"]),"line-pattern":new hr(rn.paint_line["line-pattern"]),"line-gradient":new Ci(rn.paint_line["line-gradient"])}),Sm={paint:Hg,layout:qg},uw=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.possiblyEvaluate=function(ne,ye){return ye=new Dn(Math.floor(ye.zoom),{now:ye.now,fadeDuration:ye.fadeDuration,zoomHistory:ye.zoomHistory,transition:ye.transition}),k.prototype.possiblyEvaluate.call(this,ne,ye)},C.prototype.evaluate=function(ne,ye,Pe,Ve){return ye=g({},ye,{zoom:Math.floor(ye.zoom)}),k.prototype.evaluate.call(this,ne,ye,Pe,Ve)},C}(Yt),W=new uw(Sm.paint.properties["line-width"].specification);W.useIntegerZoom=!0;var D=function(k){function C(G){k.call(this,G,Sm),this.gradientVersion=0}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._handleSpecialPaintPropertyUpdate=function(ne){if(ne==="line-gradient"){var ye=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=ye._styleExpression.expression instanceof Iu,this.gradientVersion=(this.gradientVersion+1)%c}},C.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},C.prototype.recalculate=function(ne,ye){k.prototype.recalculate.call(this,ne,ye),this.paint._values["line-floorwidth"]=W.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,ne)},C.prototype.createBucket=function(ne){return new jf(ne)},C.prototype.queryRadius=function(ne){var ye=ne,Pe=$(wh("line-width",this,ye),wh("line-gap-width",this,ye)),Ve=wh("line-offset",this,ye);return Pe/2+Math.abs(Ve)+ad(this.paint.get("line-translate"))},C.prototype.queryIntersectsFeature=function(ne,ye,Pe,Ve,ft,Rt,Ht){var rr=dd(ne,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Rt.angle,Ht),Pr=Ht/2*$(this.paint.get("line-width").evaluate(ye,Pe),this.paint.get("line-gap-width").evaluate(ye,Pe)),Zr=this.paint.get("line-offset").evaluate(ye,Pe);return Zr&&(Ve=he(Ve,Zr*Ht)),Mu(rr,Ve,Pr)},C.prototype.isTileClipped=function(){return!0},C}(ia);function $(k,C){return C>0?C+2*k:k}function he(k,C){for(var G=[],ne=new n(0,0),ye=0;ye<k.length;ye++){for(var Pe=k[ye],Ve=[],ft=0;ft<Pe.length;ft++){var Rt=Pe[ft-1],Ht=Pe[ft],rr=Pe[ft+1],Pr=ft===0?ne:Ht.sub(Rt)._unit()._perp(),Zr=ft===Pe.length-1?ne:rr.sub(Ht)._unit()._perp(),Hr=Pr._add(Zr)._unit(),hi=Hr.x*Zr.x+Hr.y*Zr.y;Hr._mult(1/hi),Ve.push(Hr._mult(C)._add(Ht))}G.push(Ve)}return G}var Ee=Da([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),je=Da([{name:"a_projected_pos",components:3,type:"Float32"}],4),We=Da([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),ct=Da([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),St=Da([{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"}]),Nt=Da([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),sr=Da([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),Er=Da([{name:"triangle",components:3,type:"Uint16"}]),Fr=Da([{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"}]),Xr=Da([{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ni=Da([{type:"Float32",name:"offsetX"}]),gi=Da([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function Zi(k,C,G){var ne=C.layout.get("text-transform").evaluate(G,{});return ne==="uppercase"?k=k.toLocaleUpperCase():ne==="lowercase"&&(k=k.toLocaleLowerCase()),ml.applyArabicShaping&&(k=ml.applyArabicShaping(k)),k}function aa(k,C,G){return k.sections.forEach(function(ne){ne.text=Zi(ne.text,C,G)}),k}function nn(k){var C={},G={},ne=[],ye=0;function Pe(ha){ne.push(k[ha]),ye++}function Ve(ha,fn,Wa){var cn=G[ha];return delete G[ha],G[fn]=cn,ne[cn].geometry[0].pop(),ne[cn].geometry[0]=ne[cn].geometry[0].concat(Wa[0]),cn}function ft(ha,fn,Wa){var cn=C[fn];return delete C[fn],C[ha]=cn,ne[cn].geometry[0].shift(),ne[cn].geometry[0]=Wa[0].concat(ne[cn].geometry[0]),cn}function Rt(ha,fn,Wa){var cn=Wa?fn[0][fn[0].length-1]:fn[0][0];return ha+":"+cn.x+":"+cn.y}for(var Ht=0;Ht<k.length;Ht++){var rr=k[Ht],Pr=rr.geometry,Zr=rr.text?rr.text.toString():null;if(!Zr){Pe(Ht);continue}var Hr=Rt(Zr,Pr),hi=Rt(Zr,Pr,!0);if(Hr in G&&hi in C&&G[Hr]!==C[hi]){var Gi=ft(Hr,hi,Pr),Ra=Ve(Hr,hi,ne[Gi].geometry);delete C[Hr],delete G[hi],G[Rt(Zr,ne[Ra].geometry,!0)]=Ra,ne[Gi].geometry=null}else Hr in G?Ve(Hr,hi,Pr):hi in C?ft(Hr,hi,Pr):(Pe(Ht),C[Hr]=ye-1,G[hi]=ye-1)}return ne.filter(function(ha){return ha.geometry})}var Aa={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};function Ja(k){for(var C="",G=0;G<k.length;G++){var ne=k.charCodeAt(G+1)||null,ye=k.charCodeAt(G-1)||null,Pe=(!ne||!ua(ne)||Aa[k[G+1]])&&(!ye||!ua(ye)||Aa[k[G-1]]);Pe&&Aa[k[G]]?C+=Aa[k[G]]:C+=k[G]}return C}var dn=24,no=function(k,C,G,ne,ye){var Pe,Ve,ft=ye*8-ne-1,Rt=(1<<ft)-1,Ht=Rt>>1,rr=-7,Pr=G?ye-1:0,Zr=G?-1:1,Hr=k[C+Pr];for(Pr+=Zr,Pe=Hr&(1<<-rr)-1,Hr>>=-rr,rr+=ft;rr>0;Pe=Pe*256+k[C+Pr],Pr+=Zr,rr-=8);for(Ve=Pe&(1<<-rr)-1,Pe>>=-rr,rr+=ne;rr>0;Ve=Ve*256+k[C+Pr],Pr+=Zr,rr-=8);if(Pe===0)Pe=1-Ht;else{if(Pe===Rt)return Ve?NaN:(Hr?-1:1)*(1/0);Ve=Ve+Math.pow(2,ne),Pe=Pe-Ht}return(Hr?-1:1)*Ve*Math.pow(2,Pe-ne)},Zo=function(k,C,G,ne,ye,Pe){var Ve,ft,Rt,Ht=Pe*8-ye-1,rr=(1<<Ht)-1,Pr=rr>>1,Zr=ye===23?Math.pow(2,-24)-Math.pow(2,-77):0,Hr=ne?0:Pe-1,hi=ne?1:-1,Gi=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(ft=isNaN(C)?1:0,Ve=rr):(Ve=Math.floor(Math.log(C)/Math.LN2),C*(Rt=Math.pow(2,-Ve))<1&&(Ve--,Rt*=2),Ve+Pr>=1?C+=Zr/Rt:C+=Zr*Math.pow(2,1-Pr),C*Rt>=2&&(Ve++,Rt/=2),Ve+Pr>=rr?(ft=0,Ve=rr):Ve+Pr>=1?(ft=(C*Rt-1)*Math.pow(2,ye),Ve=Ve+Pr):(ft=C*Math.pow(2,Pr-1)*Math.pow(2,ye),Ve=0));ye>=8;k[G+Hr]=ft&255,Hr+=hi,ft/=256,ye-=8);for(Ve=Ve<<ye|ft,Ht+=ye;Ht>0;k[G+Hr]=Ve&255,Hr+=hi,Ve/=256,Ht-=8);k[G+Hr-hi]|=Gi*128},Ds={read:no,write:Zo},Fo=Jn;function Jn(k){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(k)?k:new Uint8Array(k||0),this.pos=0,this.type=0,this.length=this.buf.length}Jn.Varint=0,Jn.Fixed64=1,Jn.Bytes=2,Jn.Fixed32=5;var _s=65536*65536,ls=1/_s,is=12,Nn=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Jn.prototype={destroy:function(){this.buf=null},readFields:function(k,C,G){for(G=G||this.length;this.pos<G;){var ne=this.readVarint(),ye=ne>>3,Pe=this.pos;this.type=ne&7,k(ye,C,this),this.pos===Pe&&this.skip(ne)}return C},readMessage:function(k,C){return this.readFields(k,C,this.readVarint()+this.pos)},readFixed32:function(){var k=sh(this.buf,this.pos);return this.pos+=4,k},readSFixed32:function(){var k=ld(this.buf,this.pos);return this.pos+=4,k},readFixed64:function(){var k=sh(this.buf,this.pos)+sh(this.buf,this.pos+4)*_s;return this.pos+=8,k},readSFixed64:function(){var k=sh(this.buf,this.pos)+ld(this.buf,this.pos+4)*_s;return this.pos+=8,k},readFloat:function(){var k=Ds.read(this.buf,this.pos,!0,23,4);return this.pos+=4,k},readDouble:function(){var k=Ds.read(this.buf,this.pos,!0,52,8);return this.pos+=8,k},readVarint:function(k){var C=this.buf,G,ne;return ne=C[this.pos++],G=ne&127,ne<128||(ne=C[this.pos++],G|=(ne&127)<<7,ne<128)||(ne=C[this.pos++],G|=(ne&127)<<14,ne<128)||(ne=C[this.pos++],G|=(ne&127)<<21,ne<128)?G:(ne=C[this.pos],G|=(ne&15)<<28,Ts(G,k,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var k=this.readVarint();return k%2===1?(k+1)/-2:k/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var k=this.readVarint()+this.pos,C=this.pos;return this.pos=k,k-C>=is&&Nn?xu(this.buf,C,k):Hh(this.buf,C,k)},readBytes:function(){var k=this.readVarint()+this.pos,C=this.buf.subarray(this.pos,k);return this.pos=k,C},readPackedVarint:function(k,C){if(this.type!==Jn.Bytes)return k.push(this.readVarint(C));var G=as(this);for(k=k||[];this.pos<G;)k.push(this.readVarint(C));return k},readPackedSVarint:function(k){if(this.type!==Jn.Bytes)return k.push(this.readSVarint());var C=as(this);for(k=k||[];this.pos<C;)k.push(this.readSVarint());return k},readPackedBoolean:function(k){if(this.type!==Jn.Bytes)return k.push(this.readBoolean());var C=as(this);for(k=k||[];this.pos<C;)k.push(this.readBoolean());return k},readPackedFloat:function(k){if(this.type!==Jn.Bytes)return k.push(this.readFloat());var C=as(this);for(k=k||[];this.pos<C;)k.push(this.readFloat());return k},readPackedDouble:function(k){if(this.type!==Jn.Bytes)return k.push(this.readDouble());var C=as(this);for(k=k||[];this.pos<C;)k.push(this.readDouble());return k},readPackedFixed32:function(k){if(this.type!==Jn.Bytes)return k.push(this.readFixed32());var C=as(this);for(k=k||[];this.pos<C;)k.push(this.readFixed32());return k},readPackedSFixed32:function(k){if(this.type!==Jn.Bytes)return k.push(this.readSFixed32());var C=as(this);for(k=k||[];this.pos<C;)k.push(this.readSFixed32());return k},readPackedFixed64:function(k){if(this.type!==Jn.Bytes)return k.push(this.readFixed64());var C=as(this);for(k=k||[];this.pos<C;)k.push(this.readFixed64());return k},readPackedSFixed64:function(k){if(this.type!==Jn.Bytes)return k.push(this.readSFixed64());var C=as(this);for(k=k||[];this.pos<C;)k.push(this.readSFixed64());return k},skip:function(k){var C=k&7;if(C===Jn.Varint)for(;this.buf[this.pos++]>127;);else if(C===Jn.Bytes)this.pos=this.readVarint()+this.pos;else if(C===Jn.Fixed32)this.pos+=4;else if(C===Jn.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+C)},writeTag:function(k,C){this.writeVarint(k<<3|C)},realloc:function(k){for(var C=this.length||16;C<this.pos+k;)C*=2;if(C!==this.length){var G=new Uint8Array(C);G.set(this.buf),this.buf=G,this.length=C}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(k){this.realloc(4),bf(this.buf,k,this.pos),this.pos+=4},writeSFixed32:function(k){this.realloc(4),bf(this.buf,k,this.pos),this.pos+=4},writeFixed64:function(k){this.realloc(8),bf(this.buf,k&-1,this.pos),bf(this.buf,Math.floor(k*ls),this.pos+4),this.pos+=8},writeSFixed64:function(k){this.realloc(8),bf(this.buf,k&-1,this.pos),bf(this.buf,Math.floor(k*ls),this.pos+4),this.pos+=8},writeVarint:function(k){if(k=+k||0,k>268435455||k<0){ic(k,this);return}this.realloc(4),this.buf[this.pos++]=k&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=k>>>7&127)))},writeSVarint:function(k){this.writeVarint(k<0?-k*2-1:k*2)},writeBoolean:function(k){this.writeVarint(!!k)},writeString:function(k){k=String(k),this.realloc(k.length*4),this.pos++;var C=this.pos;this.pos=pc(this.buf,k,this.pos);var G=this.pos-C;G>=128&&pd(C,G,this),this.pos=C-1,this.writeVarint(G),this.pos+=G},writeFloat:function(k){this.realloc(4),Ds.write(this.buf,k,this.pos,!0,23,4),this.pos+=4},writeDouble:function(k){this.realloc(8),Ds.write(this.buf,k,this.pos,!0,52,8),this.pos+=8},writeBytes:function(k){var C=k.length;this.writeVarint(C),this.realloc(C);for(var G=0;G<C;G++)this.buf[this.pos++]=k[G]},writeRawMessage:function(k,C){this.pos++;var G=this.pos;k(C,this);var ne=this.pos-G;ne>=128&&pd(G,ne,this),this.pos=G-1,this.writeVarint(ne),this.pos+=ne},writeMessage:function(k,C,G){this.writeTag(k,Jn.Bytes),this.writeRawMessage(C,G)},writePackedVarint:function(k,C){C.length&&this.writeMessage(k,gh,C)},writePackedSVarint:function(k,C){C.length&&this.writeMessage(k,$f,C)},writePackedBoolean:function(k,C){C.length&&this.writeMessage(k,Oh,C)},writePackedFloat:function(k,C){C.length&&this.writeMessage(k,Fh,C)},writePackedDouble:function(k,C){C.length&&this.writeMessage(k,Bh,C)},writePackedFixed32:function(k,C){C.length&&this.writeMessage(k,pf,C)},writePackedSFixed32:function(k,C){C.length&&this.writeMessage(k,Jf,C)},writePackedFixed64:function(k,C){C.length&&this.writeMessage(k,Sh,C)},writePackedSFixed64:function(k,C){C.length&&this.writeMessage(k,yh,C)},writeBytesField:function(k,C){this.writeTag(k,Jn.Bytes),this.writeBytes(C)},writeFixed32Field:function(k,C){this.writeTag(k,Jn.Fixed32),this.writeFixed32(C)},writeSFixed32Field:function(k,C){this.writeTag(k,Jn.Fixed32),this.writeSFixed32(C)},writeFixed64Field:function(k,C){this.writeTag(k,Jn.Fixed64),this.writeFixed64(C)},writeSFixed64Field:function(k,C){this.writeTag(k,Jn.Fixed64),this.writeSFixed64(C)},writeVarintField:function(k,C){this.writeTag(k,Jn.Varint),this.writeVarint(C)},writeSVarintField:function(k,C){this.writeTag(k,Jn.Varint),this.writeSVarint(C)},writeStringField:function(k,C){this.writeTag(k,Jn.Bytes),this.writeString(C)},writeFloatField:function(k,C){this.writeTag(k,Jn.Fixed32),this.writeFloat(C)},writeDoubleField:function(k,C){this.writeTag(k,Jn.Fixed64),this.writeDouble(C)},writeBooleanField:function(k,C){this.writeVarintField(k,!!C)}};function Ts(k,C,G){var ne=G.buf,ye,Pe;if(Pe=ne[G.pos++],ye=(Pe&112)>>4,Pe<128||(Pe=ne[G.pos++],ye|=(Pe&127)<<3,Pe<128)||(Pe=ne[G.pos++],ye|=(Pe&127)<<10,Pe<128)||(Pe=ne[G.pos++],ye|=(Pe&127)<<17,Pe<128)||(Pe=ne[G.pos++],ye|=(Pe&127)<<24,Pe<128)||(Pe=ne[G.pos++],ye|=(Pe&1)<<31,Pe<128))return Ws(k,ye,C);throw new Error("Expected varint not more than 10 bytes")}function as(k){return k.type===Jn.Bytes?k.readVarint()+k.pos:k.pos+1}function Ws(k,C,G){return G?C*4294967296+(k>>>0):(C>>>0)*4294967296+(k>>>0)}function ic(k,C){var G,ne;if(k>=0?(G=k%4294967296|0,ne=k/4294967296|0):(G=~(-k%4294967296),ne=~(-k/4294967296),G^4294967295?G=G+1|0:(G=0,ne=ne+1|0)),k>=18446744073709552e3||k<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");C.realloc(10),Yu(G,ne,C),Kf(ne,C)}function Yu(k,C,G){G.buf[G.pos++]=k&127|128,k>>>=7,G.buf[G.pos++]=k&127|128,k>>>=7,G.buf[G.pos++]=k&127|128,k>>>=7,G.buf[G.pos++]=k&127|128,k>>>=7,G.buf[G.pos]=k&127}function Kf(k,C){var G=(k&7)<<4;C.buf[C.pos++]|=G|((k>>>=3)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127)))))}function pd(k,C,G){var ne=C<=16383?1:C<=2097151?2:C<=268435455?3:Math.floor(Math.log(C)/(Math.LN2*7));G.realloc(ne);for(var ye=G.pos-1;ye>=k;ye--)G.buf[ye+ne]=G.buf[ye]}function gh(k,C){for(var G=0;G<k.length;G++)C.writeVarint(k[G])}function $f(k,C){for(var G=0;G<k.length;G++)C.writeSVarint(k[G])}function Fh(k,C){for(var G=0;G<k.length;G++)C.writeFloat(k[G])}function Bh(k,C){for(var G=0;G<k.length;G++)C.writeDouble(k[G])}function Oh(k,C){for(var G=0;G<k.length;G++)C.writeBoolean(k[G])}function pf(k,C){for(var G=0;G<k.length;G++)C.writeFixed32(k[G])}function Jf(k,C){for(var G=0;G<k.length;G++)C.writeSFixed32(k[G])}function Sh(k,C){for(var G=0;G<k.length;G++)C.writeFixed64(k[G])}function yh(k,C){for(var G=0;G<k.length;G++)C.writeSFixed64(k[G])}function sh(k,C){return(k[C]|k[C+1]<<8|k[C+2]<<16)+k[C+3]*16777216}function bf(k,C,G){k[G]=C,k[G+1]=C>>>8,k[G+2]=C>>>16,k[G+3]=C>>>24}function ld(k,C){return(k[C]|k[C+1]<<8|k[C+2]<<16)+(k[C+3]<<24)}function Hh(k,C,G){for(var ne="",ye=C;ye<G;){var Pe=k[ye],Ve=null,ft=Pe>239?4:Pe>223?3:Pe>191?2:1;if(ye+ft>G)break;var Rt,Ht,rr;ft===1?Pe<128&&(Ve=Pe):ft===2?(Rt=k[ye+1],(Rt&192)===128&&(Ve=(Pe&31)<<6|Rt&63,Ve<=127&&(Ve=null))):ft===3?(Rt=k[ye+1],Ht=k[ye+2],(Rt&192)===128&&(Ht&192)===128&&(Ve=(Pe&15)<<12|(Rt&63)<<6|Ht&63,(Ve<=2047||Ve>=55296&&Ve<=57343)&&(Ve=null))):ft===4&&(Rt=k[ye+1],Ht=k[ye+2],rr=k[ye+3],(Rt&192)===128&&(Ht&192)===128&&(rr&192)===128&&(Ve=(Pe&15)<<18|(Rt&63)<<12|(Ht&63)<<6|rr&63,(Ve<=65535||Ve>=1114112)&&(Ve=null))),Ve===null?(Ve=65533,ft=1):Ve>65535&&(Ve-=65536,ne+=String.fromCharCode(Ve>>>10&1023|55296),Ve=56320|Ve&1023),ne+=String.fromCharCode(Ve),ye+=ft}return ne}function xu(k,C,G){return Nn.decode(k.subarray(C,G))}function pc(k,C,G){for(var ne=0,ye,Pe;ne<C.length;ne++){if(ye=C.charCodeAt(ne),ye>55295&&ye<57344)if(Pe)if(ye<56320){k[G++]=239,k[G++]=191,k[G++]=189,Pe=ye;continue}else ye=Pe-55296<<10|ye-56320|65536,Pe=null;else{ye>56319||ne+1===C.length?(k[G++]=239,k[G++]=191,k[G++]=189):Pe=ye;continue}else Pe&&(k[G++]=239,k[G++]=191,k[G++]=189,Pe=null);ye<128?k[G++]=ye:(ye<2048?k[G++]=ye>>6|192:(ye<65536?k[G++]=ye>>12|224:(k[G++]=ye>>18|240,k[G++]=ye>>12&63|128),k[G++]=ye>>6&63|128),k[G++]=ye&63|128)}return G}var ac=3;function ud(k,C,G){k===1&&G.readMessage(rf,C)}function rf(k,C,G){if(k===3){var ne=G.readMessage(Lp,{}),ye=ne.id,Pe=ne.bitmap,Ve=ne.width,ft=ne.height,Rt=ne.left,Ht=ne.top,rr=ne.advance;C.push({id:ye,bitmap:new sd({width:Ve+2*ac,height:ft+2*ac},Pe),metrics:{width:Ve,height:ft,left:Rt,top:Ht,advance:rr}})}}function Lp(k,C,G){k===1?C.id=G.readVarint():k===2?C.bitmap=G.readBytes():k===3?C.width=G.readVarint():k===4?C.height=G.readVarint():k===5?C.left=G.readSVarint():k===6?C.top=G.readSVarint():k===7&&(C.advance=G.readVarint())}function jd(k){return new Fo(k).readFields(ud,[])}var Rd=ac;function md(k){for(var C=0,G=0,ne=0,ye=k;ne<ye.length;ne+=1){var Pe=ye[ne];C+=Pe.w*Pe.h,G=Math.max(G,Pe.w)}k.sort(function(Ra,ha){return ha.h-Ra.h});for(var Ve=Math.max(Math.ceil(Math.sqrt(C/.95)),G),ft=[{x:0,y:0,w:Ve,h:1/0}],Rt=0,Ht=0,rr=0,Pr=k;rr<Pr.length;rr+=1)for(var Zr=Pr[rr],Hr=ft.length-1;Hr>=0;Hr--){var hi=ft[Hr];if(!(Zr.w>hi.w||Zr.h>hi.h)){if(Zr.x=hi.x,Zr.y=hi.y,Ht=Math.max(Ht,Zr.y+Zr.h),Rt=Math.max(Rt,Zr.x+Zr.w),Zr.w===hi.w&&Zr.h===hi.h){var Gi=ft.pop();Hr<ft.length&&(ft[Hr]=Gi)}else Zr.h===hi.h?(hi.x+=Zr.w,hi.w-=Zr.w):Zr.w===hi.w?(hi.y+=Zr.h,hi.h-=Zr.h):(ft.push({x:hi.x+Zr.w,y:hi.y,w:hi.w-Zr.w,h:Zr.h}),hi.y+=Zr.h,hi.h-=Zr.h);break}}return{w:Rt,h:Ht,fill:C/(Rt*Ht)||0}}var Uc=1,If=function(C,G){var ne=G.pixelRatio,ye=G.version,Pe=G.stretchX,Ve=G.stretchY,ft=G.content;this.paddedRect=C,this.pixelRatio=ne,this.stretchX=Pe,this.stretchY=Ve,this.content=ft,this.version=ye},gd={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};gd.tl.get=function(){return[this.paddedRect.x+Uc,this.paddedRect.y+Uc]},gd.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-Uc,this.paddedRect.y+this.paddedRect.h-Uc]},gd.tlbr.get=function(){return this.tl.concat(this.br)},gd.displaySize.get=function(){return[(this.paddedRect.w-Uc*2)/this.pixelRatio,(this.paddedRect.h-Uc*2)/this.pixelRatio]},Object.defineProperties(If.prototype,gd);var ov=function(C,G){var ne={},ye={};this.haveRenderCallbacks=[];var Pe=[];this.addImages(C,ne,Pe),this.addImages(G,ye,Pe);var Ve=md(Pe),ft=Ve.w,Rt=Ve.h,Ht=new Zf({width:ft||1,height:Rt||1});for(var rr in C){var Pr=C[rr],Zr=ne[rr].paddedRect;Zf.copy(Pr.data,Ht,{x:0,y:0},{x:Zr.x+Uc,y:Zr.y+Uc},Pr.data)}for(var Hr in G){var hi=G[Hr],Gi=ye[Hr].paddedRect,Ra=Gi.x+Uc,ha=Gi.y+Uc,fn=hi.data.width,Wa=hi.data.height;Zf.copy(hi.data,Ht,{x:0,y:0},{x:Ra,y:ha},hi.data),Zf.copy(hi.data,Ht,{x:0,y:Wa-1},{x:Ra,y:ha-1},{width:fn,height:1}),Zf.copy(hi.data,Ht,{x:0,y:0},{x:Ra,y:ha+Wa},{width:fn,height:1}),Zf.copy(hi.data,Ht,{x:fn-1,y:0},{x:Ra-1,y:ha},{width:1,height:Wa}),Zf.copy(hi.data,Ht,{x:0,y:0},{x:Ra+fn,y:ha},{width:1,height:Wa})}this.image=Ht,this.iconPositions=ne,this.patternPositions=ye};ov.prototype.addImages=function(C,G,ne){for(var ye in C){var Pe=C[ye],Ve={x:0,y:0,w:Pe.data.width+2*Uc,h:Pe.data.height+2*Uc};ne.push(Ve),G[ye]=new If(Ve,Pe),Pe.hasRenderCallback&&this.haveRenderCallbacks.push(ye)}},ov.prototype.patchUpdatedImages=function(C,G){C.dispatchRenderCallbacks(this.haveRenderCallbacks);for(var ne in C.updatedImages)this.patchUpdatedImage(this.iconPositions[ne],C.getImage(ne),G),this.patchUpdatedImage(this.patternPositions[ne],C.getImage(ne),G)},ov.prototype.patchUpdatedImage=function(C,G,ne){if(!(!C||!G)&&C.version!==G.version){C.version=G.version;var ye=C.tl,Pe=ye[0],Ve=ye[1];ne.update(G.data,void 0,{x:Pe,y:Ve})}},de("ImagePosition",If),de("ImageAtlas",ov);var Gh={horizontal:1,vertical:2,horizontalOnly:3},Ip=-17;function Gg(k){for(var C=0,G=k;C<G.length;C+=1){var ne=G[C];if(ne.positionedGlyphs.length!==0)return!1}return!0}var Mm=57344,Vd=63743,Zv=function(){this.scale=1,this.fontStack="",this.imageName=null};Zv.forText=function(C,G){var ne=new Zv;return ne.scale=C||1,ne.fontStack=G,ne},Zv.forImage=function(C){var G=new Zv;return G.imageName=C,G};var lh=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};lh.fromFeature=function(C,G){for(var ne=new lh,ye=0;ye<C.sections.length;ye++){var Pe=C.sections[ye];Pe.image?ne.addImageSection(Pe):ne.addTextSection(Pe,G)}return ne},lh.prototype.length=function(){return this.text.length},lh.prototype.getSection=function(C){return this.sections[this.sectionIndex[C]]},lh.prototype.getSectionIndex=function(C){return this.sectionIndex[C]},lh.prototype.getCharCode=function(C){return this.text.charCodeAt(C)},lh.prototype.verticalizePunctuation=function(){this.text=Ja(this.text)},lh.prototype.trim=function(){for(var C=0,G=0;G<this.text.length&&qd[this.text.charCodeAt(G)];G++)C++;for(var ne=this.text.length,ye=this.text.length-1;ye>=0&&ye>=C&&qd[this.text.charCodeAt(ye)];ye--)ne--;this.text=this.text.substring(C,ne),this.sectionIndex=this.sectionIndex.slice(C,ne)},lh.prototype.substring=function(C,G){var ne=new lh;return ne.text=this.text.substring(C,G),ne.sectionIndex=this.sectionIndex.slice(C,G),ne.sections=this.sections,ne},lh.prototype.toString=function(){return this.text},lh.prototype.getMaxScale=function(){var C=this;return this.sectionIndex.reduce(function(G,ne){return Math.max(G,C.sections[ne].scale)},0)},lh.prototype.addTextSection=function(C,G){this.text+=C.text,this.sections.push(Zv.forText(C.scale,C.fontStack||G));for(var ne=this.sections.length-1,ye=0;ye<C.text.length;++ye)this.sectionIndex.push(ne)},lh.prototype.addImageSection=function(C){var G=C.image?C.image.name:"";if(G.length===0){O("Can't add FormattedSection with an empty image.");return}var ne=this.getNextImageSectionCharCode();if(!ne){O("Reached maximum number of images "+(Vd-Mm+2));return}this.text+=String.fromCharCode(ne),this.sections.push(Zv.forImage(G)),this.sectionIndex.push(this.sections.length-1)},lh.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=Vd?null:++this.imageSectionID:(this.imageSectionID=Mm,this.imageSectionID)};function cw(k,C){for(var G=[],ne=k.text,ye=0,Pe=0,Ve=C;Pe<Ve.length;Pe+=1){var ft=Ve[Pe];G.push(k.substring(ye,ft)),ye=ft}return ye<ne.length&&G.push(k.substring(ye,ne.length)),G}function Em(k,C,G,ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr,Hr,hi,Gi){var Ra=lh.fromFeature(k,ye);Pr===Gh.vertical&&Ra.verticalizePunctuation();var ha,fn=ml.processBidirectionalText,Wa=ml.processStyledBidirectionalText;if(fn&&Ra.sections.length===1){ha=[];for(var cn=fn(Ra.toString(),km(Ra,Ht,Pe,C,ne,Hr,hi)),bn=0,Un=cn;bn<Un.length;bn+=1){var oo=Un[bn],ro=new lh;ro.text=oo,ro.sections=Ra.sections;for(var Go=0;Go<oo.length;Go++)ro.sectionIndex.push(0);ha.push(ro)}}else if(Wa){ha=[];for(var So=Wa(Ra.text,Ra.sectionIndex,km(Ra,Ht,Pe,C,ne,Hr,hi)),Bo=0,Hs=So;Bo<Hs.length;Bo+=1){var Wo=Hs[Bo],Qo=new lh;Qo.text=Wo[0],Qo.sectionIndex=Wo[1],Qo.sections=Ra.sections,ha.push(Qo)}}else ha=cw(Ra,km(Ra,Ht,Pe,C,ne,Hr,hi));var fl=[],Os={positionedLines:fl,text:Ra.toString(),top:rr[1],bottom:rr[1],left:rr[0],right:rr[0],writingMode:Pr,iconsInText:!1,verticalizable:!1};return dw(Os,C,G,ne,ha,Ve,ft,Rt,Pr,Ht,Zr,Gi),Gg(fl)?!1:Os}var qd={};qd[9]=!0,qd[10]=!0,qd[11]=!0,qd[12]=!0,qd[13]=!0,qd[32]=!0;var Wh={};Wh[10]=!0,Wh[32]=!0,Wh[38]=!0,Wh[40]=!0,Wh[41]=!0,Wh[43]=!0,Wh[45]=!0,Wh[47]=!0,Wh[173]=!0,Wh[183]=!0,Wh[8203]=!0,Wh[8208]=!0,Wh[8211]=!0,Wh[8231]=!0;function q1(k,C,G,ne,ye,Pe){if(C.imageName){var Rt=ne[C.imageName];return Rt?Rt.displaySize[0]*C.scale*dn/Pe+ye:0}else{var Ve=G[C.fontStack],ft=Ve&&Ve[k];return ft?ft.metrics.advance*C.scale+ye:0}}function fw(k,C,G,ne,ye,Pe){for(var Ve=0,ft=0;ft<k.length();ft++){var Rt=k.getSection(ft);Ve+=q1(k.getCharCode(ft),Rt,ne,ye,C,Pe)}var Ht=Math.max(1,Math.ceil(Ve/G));return Ve/Ht}function H1(k,C,G,ne){var ye=Math.pow(k-C,2);return ne?k<C?ye/2:ye*2:ye+Math.abs(G)*G}function hw(k,C,G){var ne=0;return k===10&&(ne-=1e4),G&&(ne+=150),(k===40||k===65288)&&(ne+=50),(C===41||C===65289)&&(ne+=50),ne}function Cd(k,C,G,ne,ye,Pe){for(var Ve=null,ft=H1(C,G,ye,Pe),Rt=0,Ht=ne;Rt<Ht.length;Rt+=1){var rr=Ht[Rt],Pr=C-rr.x,Zr=H1(Pr,G,ye,Pe)+rr.badness;Zr<=ft&&(Ve=rr,ft=Zr)}return{index:k,x:C,priorBreak:Ve,badness:ft}}function k0(k){return k?k0(k.priorBreak).concat(k.index):[]}function km(k,C,G,ne,ye,Pe,Ve){if(Pe!=="point")return[];if(!k)return[];for(var ft=[],Rt=fw(k,C,G,ne,ye,Ve),Ht=k.text.indexOf("\u200B")>=0,rr=0,Pr=0;Pr<k.length();Pr++){var Zr=k.getSection(Pr),Hr=k.getCharCode(Pr);if(qd[Hr]||(rr+=q1(Hr,Zr,ne,ye,C,Ve)),Pr<k.length()-1){var hi=Ei(Hr);(Wh[Hr]||hi||Zr.imageName)&&ft.push(Cd(Pr+1,rr,Rt,ft,hw(Hr,k.getCharCode(Pr+1),hi&&Ht),!1))}}return k0(Cd(k.length(),rr,Rt,ft,0,!0))}function Wg(k){var C=.5,G=.5;switch(k){case"right":case"top-right":case"bottom-right":C=1;break;case"left":case"top-left":case"bottom-left":C=0;break}switch(k){case"bottom":case"bottom-right":case"bottom-left":G=1;break;case"top":case"top-right":case"top-left":G=0;break}return{horizontalAlign:C,verticalAlign:G}}function dw(k,C,G,ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr){for(var Zr=0,Hr=Ip,hi=0,Gi=0,Ra=ft==="right"?1:ft==="left"?0:.5,ha=0,fn=0,Wa=ye;fn<Wa.length;fn+=1){var cn=Wa[fn];cn.trim();var bn=cn.getMaxScale(),Un=(bn-1)*dn,oo={positionedGlyphs:[],lineOffset:0};k.positionedLines[ha]=oo;var ro=oo.positionedGlyphs,Go=0;if(!cn.length()){Hr+=Pe,++ha;continue}for(var So=0;So<cn.length();So++){var Bo=cn.getSection(So),Hs=cn.getSectionIndex(So),Wo=cn.getCharCode(So),Qo=0,fl=null,Os=null,iu=null,Vu=dn,au=!(Rt===Gh.horizontal||!rr&&!xi(Wo)||rr&&(qd[Wo]||Di(Wo)));if(Bo.imageName){var mf=ne[Bo.imageName];if(!mf)continue;iu=Bo.imageName,k.iconsInText=k.iconsInText||!0,Os=mf.paddedRect;var wf=mf.displaySize;Bo.scale=Bo.scale*dn/Pr,fl={width:wf[0],height:wf[1],left:Uc,top:-Rd,advance:au?wf[1]:wf[0]};var ch=dn-wf[1]*Bo.scale;Qo=Un+ch,Vu=fl.advance;var Hf=au?wf[0]*Bo.scale-dn*bn:wf[1]*Bo.scale-dn*bn;Hf>0&&Hf>Go&&(Go=Hf)}else{var nu=G[Bo.fontStack],Xl=nu&&nu[Wo];if(Xl&&Xl.rect)Os=Xl.rect,fl=Xl.metrics;else{var nc=C[Bo.fontStack],mc=nc&&nc[Wo];if(!mc)continue;fl=mc.metrics}Qo=(bn-Bo.scale)*dn}au?(k.verticalizable=!0,ro.push({glyph:Wo,imageName:iu,x:Zr,y:Hr+Qo,vertical:au,scale:Bo.scale,fontStack:Bo.fontStack,sectionIndex:Hs,metrics:fl,rect:Os}),Zr+=Vu*Bo.scale+Ht):(ro.push({glyph:Wo,imageName:iu,x:Zr,y:Hr+Qo,vertical:au,scale:Bo.scale,fontStack:Bo.fontStack,sectionIndex:Hs,metrics:fl,rect:Os}),Zr+=fl.advance*Bo.scale+Ht)}if(ro.length!==0){var Uh=Zr-Ht;hi=Math.max(Uh,hi),vw(ro,0,ro.length-1,Ra,Go)}Zr=0;var jh=Pe*bn+Go;oo.lineOffset=Math.max(Go,Un),Hr+=jh,Gi=Math.max(jh,Gi),++ha}var fh=Hr-Ip,Xh=Wg(Ve),Yh=Xh.horizontalAlign,Qf=Xh.verticalAlign;Mh(k.positionedLines,Ra,Yh,Qf,hi,Gi,Pe,fh,ye.length),k.top+=-Qf*fh,k.bottom=k.top+fh,k.left+=-Yh*hi,k.right=k.left+hi}function vw(k,C,G,ne,ye){if(!(!ne&&!ye))for(var Pe=k[G],Ve=Pe.metrics.advance*Pe.scale,ft=(k[G].x+Ve)*ne,Rt=C;Rt<=G;Rt++)k[Rt].x-=ft,k[Rt].y+=ye}function Mh(k,C,G,ne,ye,Pe,Ve,ft,Rt){var Ht=(C-G)*ye,rr=0;Pe!==Ve?rr=-ft*ne-Ip:rr=(-ne*Rt+.5)*Ve;for(var Pr=0,Zr=k;Pr<Zr.length;Pr+=1)for(var Hr=Zr[Pr],hi=0,Gi=Hr.positionedGlyphs;hi<Gi.length;hi+=1){var Ra=Gi[hi];Ra.x+=Ht,Ra.y+=rr}}function yd(k,C,G){var ne=Wg(G),ye=ne.horizontalAlign,Pe=ne.verticalAlign,Ve=C[0],ft=C[1],Rt=Ve-k.displaySize[0]*ye,Ht=Rt+k.displaySize[0],rr=ft-k.displaySize[1]*Pe,Pr=rr+k.displaySize[1];return{image:k,top:rr,bottom:Pr,left:Rt,right:Ht}}function Lv(k,C,G,ne,ye,Pe){var Ve=k.image,ft;if(Ve.content){var Rt=Ve.content,Ht=Ve.pixelRatio||1;ft=[Rt[0]/Ht,Rt[1]/Ht,Ve.displaySize[0]-Rt[2]/Ht,Ve.displaySize[1]-Rt[3]/Ht]}var rr=C.left*Pe,Pr=C.right*Pe,Zr,Hr,hi,Gi;G==="width"||G==="both"?(Gi=ye[0]+rr-ne[3],Hr=ye[0]+Pr+ne[1]):(Gi=ye[0]+(rr+Pr-Ve.displaySize[0])/2,Hr=Gi+Ve.displaySize[0]);var Ra=C.top*Pe,ha=C.bottom*Pe;return G==="height"||G==="both"?(Zr=ye[1]+Ra-ne[0],hi=ye[1]+ha+ne[2]):(Zr=ye[1]+(Ra+ha-Ve.displaySize[1])/2,hi=Zr+Ve.displaySize[1]),{image:Ve,top:Zr,right:Hr,bottom:hi,left:Gi,collisionPadding:ft}}var Nh=function(k){function C(G,ne,ye,Pe){k.call(this,G,ne),this.angle=ye,Pe!==void 0&&(this.segment=Pe)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.clone=function(){return new C(this.x,this.y,this.angle,this.segment)},C}(n);de("Anchor",Nh);var Eh=128;function Ld(k,C){var G=C.expression;if(G.kind==="constant"){var ne=G.evaluate(new Dn(k+1));return{kind:"constant",layoutSize:ne}}else{if(G.kind==="source")return{kind:"source"};for(var ye=G.zoomStops,Pe=G.interpolationType,Ve=0;Ve<ye.length&&ye[Ve]<=k;)Ve++;Ve=Math.max(0,Ve-1);for(var ft=Ve;ft<ye.length&&ye[ft]<k+1;)ft++;ft=Math.min(ye.length-1,ft);var Rt=ye[Ve],Ht=ye[ft];if(G.kind==="composite")return{kind:"composite",minZoom:Rt,maxZoom:Ht,interpolationType:Pe};var rr=G.evaluate(new Dn(Rt)),Pr=G.evaluate(new Dn(Ht));return{kind:"camera",minZoom:Rt,maxZoom:Ht,minSize:rr,maxSize:Pr,interpolationType:Pe}}}function JA(k,C,G){var ne=C.uSize,ye=C.uSizeT,Pe=G.lowerSize,Ve=G.upperSize;return k.kind==="source"?Pe/Eh:k.kind==="composite"?Nl(Pe/Eh,Ve/Eh,ye):ne}function QA(k,C){var G=0,ne=0;if(k.kind==="constant")ne=k.layoutSize;else if(k.kind!=="source"){var ye=k.interpolationType,Pe=k.minZoom,Ve=k.maxZoom,ft=ye?l(du.interpolationFactor(ye,C,Pe,Ve),0,1):0;k.kind==="camera"?ne=Nl(k.minSize,k.maxSize,ft):G=ft}return{uSizeT:G,uSize:ne}}var Vz=Object.freeze({__proto__:null,getSizeData:Ld,evaluateSizeForFeature:JA,evaluateSizeForZoom:QA,SIZE_PACK_FACTOR:Eh});function eS(k,C,G,ne,ye){if(C.segment===void 0)return!0;for(var Pe=C,Ve=C.segment+1,ft=0;ft>-G/2;){if(Ve--,Ve<0)return!1;ft-=k[Ve].dist(Pe),Pe=k[Ve]}ft+=k[Ve].dist(k[Ve+1]),Ve++;for(var Rt=[],Ht=0;ft<G/2;){var rr=k[Ve-1],Pr=k[Ve],Zr=k[Ve+1];if(!Zr)return!1;var Hr=rr.angleTo(Pr)-Pr.angleTo(Zr);for(Hr=Math.abs((Hr+3*Math.PI)%(Math.PI*2)-Math.PI),Rt.push({distance:ft,angleDelta:Hr}),Ht+=Hr;ft-Rt[0].distance>ne;)Ht-=Rt.shift().angleDelta;if(Ht>ye)return!1;Ve++,ft+=Pr.dist(Zr)}return!0}function tS(k){for(var C=0,G=0;G<k.length-1;G++)C+=k[G].dist(k[G+1]);return C}function rS(k,C,G){return k?3/5*C*G:0}function iS(k,C){return Math.max(k?k.right-k.left:0,C?C.right-C.left:0)}function qz(k,C,G,ne,ye,Pe){for(var Ve=rS(G,ye,Pe),ft=iS(G,ne)*Pe,Rt=0,Ht=tS(k)/2,rr=0;rr<k.length-1;rr++){var Pr=k[rr],Zr=k[rr+1],Hr=Pr.dist(Zr);if(Rt+Hr>Ht){var hi=(Ht-Rt)/Hr,Gi=Nl(Pr.x,Zr.x,hi),Ra=Nl(Pr.y,Zr.y,hi),ha=new Nh(Gi,Ra,Zr.angleTo(Pr),rr);return ha._round(),!Ve||eS(k,ha,ft,Ve,C)?ha:void 0}Rt+=Hr}}function Hz(k,C,G,ne,ye,Pe,Ve,ft,Rt){var Ht=rS(ne,Pe,Ve),rr=iS(ne,ye),Pr=rr*Ve,Zr=k[0].x===0||k[0].x===Rt||k[0].y===0||k[0].y===Rt;C-Pr<C/4&&(C=Pr+C/4);var Hr=Pe*2,hi=Zr?C/2*ft%C:(rr/2+Hr)*Ve*ft%C;return aS(k,hi,C,Ht,G,Pr,Zr,!1,Rt)}function aS(k,C,G,ne,ye,Pe,Ve,ft,Rt){for(var Ht=Pe/2,rr=tS(k),Pr=0,Zr=C-G,Hr=[],hi=0;hi<k.length-1;hi++){for(var Gi=k[hi],Ra=k[hi+1],ha=Gi.dist(Ra),fn=Ra.angleTo(Gi);Zr+G<Pr+ha;){Zr+=G;var Wa=(Zr-Pr)/ha,cn=Nl(Gi.x,Ra.x,Wa),bn=Nl(Gi.y,Ra.y,Wa);if(cn>=0&&cn<Rt&&bn>=0&&bn<Rt&&Zr-Ht>=0&&Zr+Ht<=rr){var Un=new Nh(cn,bn,fn,hi);Un._round(),(!ne||eS(k,Un,Pe,ne,ye))&&Hr.push(Un)}}Pr+=ha}return!ft&&!Hr.length&&!Ve&&(Hr=aS(k,Pr/2,G,ne,ye,Pe,Ve,!0,Rt)),Hr}function nS(k,C,G,ne,ye){for(var Pe=[],Ve=0;Ve<k.length;Ve++)for(var ft=k[Ve],Rt=void 0,Ht=0;Ht<ft.length-1;Ht++){var rr=ft[Ht],Pr=ft[Ht+1];rr.x<C&&Pr.x<C||(rr.x<C?rr=new n(C,rr.y+(Pr.y-rr.y)*((C-rr.x)/(Pr.x-rr.x)))._round():Pr.x<C&&(Pr=new n(C,rr.y+(Pr.y-rr.y)*((C-rr.x)/(Pr.x-rr.x)))._round()),!(rr.y<G&&Pr.y<G)&&(rr.y<G?rr=new n(rr.x+(Pr.x-rr.x)*((G-rr.y)/(Pr.y-rr.y)),G)._round():Pr.y<G&&(Pr=new n(rr.x+(Pr.x-rr.x)*((G-rr.y)/(Pr.y-rr.y)),G)._round()),!(rr.x>=ne&&Pr.x>=ne)&&(rr.x>=ne?rr=new n(ne,rr.y+(Pr.y-rr.y)*((ne-rr.x)/(Pr.x-rr.x)))._round():Pr.x>=ne&&(Pr=new n(ne,rr.y+(Pr.y-rr.y)*((ne-rr.x)/(Pr.x-rr.x)))._round()),!(rr.y>=ye&&Pr.y>=ye)&&(rr.y>=ye?rr=new n(rr.x+(Pr.x-rr.x)*((ye-rr.y)/(Pr.y-rr.y)),ye)._round():Pr.y>=ye&&(Pr=new n(rr.x+(Pr.x-rr.x)*((ye-rr.y)/(Pr.y-rr.y)),ye)._round()),(!Rt||!rr.equals(Rt[Rt.length-1]))&&(Rt=[rr],Pe.push(Rt)),Rt.push(Pr)))))}return Pe}var Cm=Uc;function oS(k,C,G,ne){var ye=[],Pe=k.image,Ve=Pe.pixelRatio,ft=Pe.paddedRect.w-2*Cm,Rt=Pe.paddedRect.h-2*Cm,Ht=k.right-k.left,rr=k.bottom-k.top,Pr=Pe.stretchX||[[0,ft]],Zr=Pe.stretchY||[[0,Rt]],Hr=function(nu,Xl){return nu+Xl[1]-Xl[0]},hi=Pr.reduce(Hr,0),Gi=Zr.reduce(Hr,0),Ra=ft-hi,ha=Rt-Gi,fn=0,Wa=hi,cn=0,bn=Gi,Un=0,oo=Ra,ro=0,Go=ha;if(Pe.content&&ne){var So=Pe.content;fn=G1(Pr,0,So[0]),cn=G1(Zr,0,So[1]),Wa=G1(Pr,So[0],So[2]),bn=G1(Zr,So[1],So[3]),Un=So[0]-fn,ro=So[1]-cn,oo=So[2]-So[0]-Wa,Go=So[3]-So[1]-bn}var Bo=function(nu,Xl,nc,mc){var mf=W1(nu.stretch-fn,Wa,Ht,k.left),wf=X1(nu.fixed-Un,oo,nu.stretch,hi),ch=W1(Xl.stretch-cn,bn,rr,k.top),Hf=X1(Xl.fixed-ro,Go,Xl.stretch,Gi),Uh=W1(nc.stretch-fn,Wa,Ht,k.left),jh=X1(nc.fixed-Un,oo,nc.stretch,hi),fh=W1(mc.stretch-cn,bn,rr,k.top),Xh=X1(mc.fixed-ro,Go,mc.stretch,Gi),Yh=new n(mf,ch),Qf=new n(Uh,ch),Zh=new n(Uh,fh),Id=new n(mf,fh),Jv=new n(wf/Ve,Hf/Ve),Dp=new n(jh/Ve,Xh/Ve),zp=C*Math.PI/180;if(zp){var Fp=Math.sin(zp),Bm=Math.cos(zp),Hd=[Bm,-Fp,Fp,Bm];Yh._matMult(Hd),Qf._matMult(Hd),Id._matMult(Hd),Zh._matMult(Hd)}var Q1=nu.stretch+nu.fixed,ww=nc.stretch+nc.fixed,e_=Xl.stretch+Xl.fixed,Tw=mc.stretch+mc.fixed,Dd={x:Pe.paddedRect.x+Cm+Q1,y:Pe.paddedRect.y+Cm+e_,w:ww-Q1,h:Tw-e_},Om=oo/Ve/Ht,t_=Go/Ve/rr;return{tl:Yh,tr:Qf,bl:Id,br:Zh,tex:Dd,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Jv,pixelOffsetBR:Dp,minFontScaleX:Om,minFontScaleY:t_,isSDF:G}};if(!ne||!Pe.stretchX&&!Pe.stretchY)ye.push(Bo({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:ft+1},{fixed:0,stretch:Rt+1}));else for(var Hs=sS(Pr,Ra,hi),Wo=sS(Zr,ha,Gi),Qo=0;Qo<Hs.length-1;Qo++)for(var fl=Hs[Qo],Os=Hs[Qo+1],iu=0;iu<Wo.length-1;iu++){var Vu=Wo[iu],au=Wo[iu+1];ye.push(Bo(fl,Vu,Os,au))}return ye}function G1(k,C,G){for(var ne=0,ye=0,Pe=k;ye<Pe.length;ye+=1){var Ve=Pe[ye];ne+=Math.max(C,Math.min(G,Ve[1]))-Math.max(C,Math.min(G,Ve[0]))}return ne}function sS(k,C,G){for(var ne=[{fixed:-Cm,stretch:0}],ye=0,Pe=k;ye<Pe.length;ye+=1){var Ve=Pe[ye],ft=Ve[0],Rt=Ve[1],Ht=ne[ne.length-1];ne.push({fixed:ft-Ht.stretch,stretch:Ht.stretch}),ne.push({fixed:ft-Ht.stretch,stretch:Ht.stretch+(Rt-ft)})}return ne.push({fixed:C+Cm,stretch:G}),ne}function W1(k,C,G,ne){return k/C*G+ne}function X1(k,C,G,ne){return k-C*G/ne}function Gz(k,C,G,ne,ye,Pe,Ve,ft){for(var Rt=ne.layout.get("text-rotate").evaluate(Pe,{})*Math.PI/180,Ht=[],rr=0,Pr=C.positionedLines;rr<Pr.length;rr+=1)for(var Zr=Pr[rr],Hr=0,hi=Zr.positionedGlyphs;Hr<hi.length;Hr+=1){var Gi=hi[Hr];if(Gi.rect){var Ra=Gi.rect||{},ha=1,fn=Rd+ha,Wa=!0,cn=1,bn=0,Un=(ye||ft)&&Gi.vertical,oo=Gi.metrics.advance*Gi.scale/2;if(ft&&C.verticalizable){var ro=(Gi.scale-1)*dn,Go=(dn-Gi.metrics.width*Gi.scale)/2;bn=Zr.lineOffset/2-(Gi.imageName?-Go:ro)}if(Gi.imageName){var So=Ve[Gi.imageName];Wa=So.sdf,cn=So.pixelRatio,fn=Uc/cn}var Bo=ye?[Gi.x+oo,Gi.y]:[0,0],Hs=ye?[0,0]:[Gi.x+oo+G[0],Gi.y+G[1]-bn],Wo=[0,0];Un&&(Wo=Hs,Hs=[0,0]);var Qo=(Gi.metrics.left-fn)*Gi.scale-oo+Hs[0],fl=(-Gi.metrics.top-fn)*Gi.scale+Hs[1],Os=Qo+Ra.w*Gi.scale/cn,iu=fl+Ra.h*Gi.scale/cn,Vu=new n(Qo,fl),au=new n(Os,fl),nu=new n(Qo,iu),Xl=new n(Os,iu);if(Un){var nc=new n(-oo,oo-Ip),mc=-Math.PI/2,mf=dn/2-oo,wf=Gi.imageName?mf:0,ch=new n(5-Ip-mf,-wf),Hf=new(Function.prototype.bind.apply(n,[null].concat(Wo)));Vu._rotateAround(mc,nc)._add(ch)._add(Hf),au._rotateAround(mc,nc)._add(ch)._add(Hf),nu._rotateAround(mc,nc)._add(ch)._add(Hf),Xl._rotateAround(mc,nc)._add(ch)._add(Hf)}if(Rt){var Uh=Math.sin(Rt),jh=Math.cos(Rt),fh=[jh,-Uh,Uh,jh];Vu._matMult(fh),au._matMult(fh),nu._matMult(fh),Xl._matMult(fh)}var Xh=new n(0,0),Yh=new n(0,0),Qf=0,Zh=0;Ht.push({tl:Vu,tr:au,bl:nu,br:Xl,tex:Ra,writingMode:C.writingMode,glyphOffset:Bo,sectionIndex:Gi.sectionIndex,isSDF:Wa,pixelOffsetTL:Xh,pixelOffsetBR:Yh,minFontScaleX:Qf,minFontScaleY:Zh})}}return Ht}var Y1=function(C,G,ne,ye,Pe,Ve,ft,Rt,Ht,rr){if(this.boxStartIndex=C.length,Ht){var Pr=Ve.top,Zr=Ve.bottom,Hr=Ve.collisionPadding;Hr&&(Pr-=Hr[1],Zr+=Hr[3]);var hi=Zr-Pr;hi>0&&(hi=Math.max(10,hi),this.circleDiameter=hi)}else{var Gi=Ve.top*ft-Rt,Ra=Ve.bottom*ft+Rt,ha=Ve.left*ft-Rt,fn=Ve.right*ft+Rt,Wa=Ve.collisionPadding;if(Wa&&(ha-=Wa[0]*ft,Gi-=Wa[1]*ft,fn+=Wa[2]*ft,Ra+=Wa[3]*ft),rr){var cn=new n(ha,Gi),bn=new n(fn,Gi),Un=new n(ha,Ra),oo=new n(fn,Ra),ro=rr*Math.PI/180;cn._rotate(ro),bn._rotate(ro),Un._rotate(ro),oo._rotate(ro),ha=Math.min(cn.x,bn.x,Un.x,oo.x),fn=Math.max(cn.x,bn.x,Un.x,oo.x),Gi=Math.min(cn.y,bn.y,Un.y,oo.y),Ra=Math.max(cn.y,bn.y,Un.y,oo.y)}C.emplaceBack(G.x,G.y,ha,Gi,fn,Ra,ne,ye,Pe)}this.boxEndIndex=C.length},Lm=function(C,G){if(C===void 0&&(C=[]),G===void 0&&(G=Wz),this.data=C,this.length=this.data.length,this.compare=G,this.length>0)for(var ne=(this.length>>1)-1;ne>=0;ne--)this._down(ne)};Lm.prototype.push=function(C){this.data.push(C),this.length++,this._up(this.length-1)},Lm.prototype.pop=function(){if(this.length!==0){var C=this.data[0],G=this.data.pop();return this.length--,this.length>0&&(this.data[0]=G,this._down(0)),C}},Lm.prototype.peek=function(){return this.data[0]},Lm.prototype._up=function(C){for(var G=this,ne=G.data,ye=G.compare,Pe=ne[C];C>0;){var Ve=C-1>>1,ft=ne[Ve];if(ye(Pe,ft)>=0)break;ne[C]=ft,C=Ve}ne[C]=Pe},Lm.prototype._down=function(C){for(var G=this,ne=G.data,ye=G.compare,Pe=this.length>>1,Ve=ne[C];C<Pe;){var ft=(C<<1)+1,Rt=ne[ft],Ht=ft+1;if(Ht<this.length&&ye(ne[Ht],Rt)<0&&(ft=Ht,Rt=ne[Ht]),ye(Rt,Ve)>=0)break;ne[C]=Rt,C=ft}ne[C]=Ve};function Wz(k,C){return k<C?-1:k>C?1:0}function Xz(k,C,G){C===void 0&&(C=1),G===void 0&&(G=!1);for(var ne=1/0,ye=1/0,Pe=-1/0,Ve=-1/0,ft=k[0],Rt=0;Rt<ft.length;Rt++){var Ht=ft[Rt];(!Rt||Ht.x<ne)&&(ne=Ht.x),(!Rt||Ht.y<ye)&&(ye=Ht.y),(!Rt||Ht.x>Pe)&&(Pe=Ht.x),(!Rt||Ht.y>Ve)&&(Ve=Ht.y)}var rr=Pe-ne,Pr=Ve-ye,Zr=Math.min(rr,Pr),Hr=Zr/2,hi=new Lm([],Yz);if(Zr===0)return new n(ne,ye);for(var Gi=ne;Gi<Pe;Gi+=Zr)for(var Ra=ye;Ra<Ve;Ra+=Zr)hi.push(new Im(Gi+Hr,Ra+Hr,Hr,k));for(var ha=Kz(k),fn=hi.length;hi.length;){var Wa=hi.pop();(Wa.d>ha.d||!ha.d)&&(ha=Wa,G&&console.log("found best %d after %d probes",Math.round(1e4*Wa.d)/1e4,fn)),!(Wa.max-ha.d<=C)&&(Hr=Wa.h/2,hi.push(new Im(Wa.p.x-Hr,Wa.p.y-Hr,Hr,k)),hi.push(new Im(Wa.p.x+Hr,Wa.p.y-Hr,Hr,k)),hi.push(new Im(Wa.p.x-Hr,Wa.p.y+Hr,Hr,k)),hi.push(new Im(Wa.p.x+Hr,Wa.p.y+Hr,Hr,k)),fn+=4)}return G&&(console.log("num probes: "+fn),console.log("best distance: "+ha.d)),ha.p}function Yz(k,C){return C.max-k.max}function Im(k,C,G,ne){this.p=new n(k,C),this.h=G,this.d=Zz(this.p,ne),this.max=this.d+this.h*Math.SQRT2}function Zz(k,C){for(var G=!1,ne=1/0,ye=0;ye<C.length;ye++)for(var Pe=C[ye],Ve=0,ft=Pe.length,Rt=ft-1;Ve<ft;Rt=Ve++){var Ht=Pe[Ve],rr=Pe[Rt];Ht.y>k.y!=rr.y>k.y&&k.x<(rr.x-Ht.x)*(k.y-Ht.y)/(rr.y-Ht.y)+Ht.x&&(G=!G),ne=Math.min(ne,ev(k,Ht,rr))}return(G?1:-1)*Math.sqrt(ne)}function Kz(k){for(var C=0,G=0,ne=0,ye=k[0],Pe=0,Ve=ye.length,ft=Ve-1;Pe<Ve;ft=Pe++){var Rt=ye[Pe],Ht=ye[ft],rr=Rt.x*Ht.y-Ht.x*Rt.y;G+=(Rt.x+Ht.x)*rr,ne+=(Rt.y+Ht.y)*rr,C+=rr*3}return new Im(G/C,ne/C,0,k)}var Pm=7,pw=Number.POSITIVE_INFINITY;function lS(k,C){function G(ye,Pe){var Ve=0,ft=0;Pe<0&&(Pe=0);var Rt=Pe/Math.sqrt(2);switch(ye){case"top-right":case"top-left":ft=Rt-Pm;break;case"bottom-right":case"bottom-left":ft=-Rt+Pm;break;case"bottom":ft=-Pe+Pm;break;case"top":ft=Pe-Pm;break}switch(ye){case"top-right":case"bottom-right":Ve=-Rt;break;case"top-left":case"bottom-left":Ve=Rt;break;case"left":Ve=Pe;break;case"right":Ve=-Pe;break}return[Ve,ft]}function ne(ye,Pe,Ve){var ft=0,Rt=0;switch(Pe=Math.abs(Pe),Ve=Math.abs(Ve),ye){case"top-right":case"top-left":case"top":Rt=Ve-Pm;break;case"bottom-right":case"bottom-left":case"bottom":Rt=-Ve+Pm;break}switch(ye){case"top-right":case"bottom-right":case"right":ft=-Pe;break;case"top-left":case"bottom-left":case"left":ft=Pe;break}return[ft,Rt]}return C[1]!==pw?ne(k,C[0],C[1]):G(k,C[0])}function $z(k,C,G,ne,ye,Pe,Ve){k.createArrays();var ft=512*k.overscaling;k.tilePixelRatio=ma/ft,k.compareText={},k.iconsNeedLinear=!1;var Rt=k.layers[0].layout,Ht=k.layers[0]._unevaluatedLayout._values,rr={};if(k.textSizeData.kind==="composite"){var Pr=k.textSizeData,Zr=Pr.minZoom,Hr=Pr.maxZoom;rr.compositeTextSizes=[Ht["text-size"].possiblyEvaluate(new Dn(Zr),Ve),Ht["text-size"].possiblyEvaluate(new Dn(Hr),Ve)]}if(k.iconSizeData.kind==="composite"){var hi=k.iconSizeData,Gi=hi.minZoom,Ra=hi.maxZoom;rr.compositeIconSizes=[Ht["icon-size"].possiblyEvaluate(new Dn(Gi),Ve),Ht["icon-size"].possiblyEvaluate(new Dn(Ra),Ve)]}rr.layoutTextSize=Ht["text-size"].possiblyEvaluate(new Dn(k.zoom+1),Ve),rr.layoutIconSize=Ht["icon-size"].possiblyEvaluate(new Dn(k.zoom+1),Ve),rr.textMaxSize=Ht["text-size"].possiblyEvaluate(new Dn(18));for(var ha=Rt.get("text-line-height")*dn,fn=Rt.get("text-rotation-alignment")==="map"&&Rt.get("symbol-placement")!=="point",Wa=Rt.get("text-keep-upright"),cn=Rt.get("text-size"),bn=function(){var ro=oo[Un],Go=Rt.get("text-font").evaluate(ro,{},Ve).join(","),So=cn.evaluate(ro,{},Ve),Bo=rr.layoutTextSize.evaluate(ro,{},Ve),Hs=rr.layoutIconSize.evaluate(ro,{},Ve),Wo={horizontal:{},vertical:void 0},Qo=ro.text,fl=[0,0];if(Qo){var Os=Qo.toString(),iu=Rt.get("text-letter-spacing").evaluate(ro,{},Ve)*dn,Vu=Gr(Os)?iu:0,au=Rt.get("text-anchor").evaluate(ro,{},Ve),nu=Rt.get("text-variable-anchor");if(!nu){var Xl=Rt.get("text-radial-offset").evaluate(ro,{},Ve);Xl?fl=lS(au,[Xl*dn,pw]):fl=Rt.get("text-offset").evaluate(ro,{},Ve).map(function(Jv){return Jv*dn})}var nc=fn?"center":Rt.get("text-justify").evaluate(ro,{},Ve),mc=Rt.get("symbol-placement"),mf=mc==="point"?Rt.get("text-max-width").evaluate(ro,{},Ve)*dn:0,wf=function(){k.allowVerticalPlacement&&xr(Os)&&(Wo.vertical=Em(Qo,C,G,ye,Go,mf,ha,au,"left",Vu,fl,Gh.vertical,!0,mc,Bo,So))};if(!fn&&nu){for(var ch=nc==="auto"?nu.map(function(Jv){return mw(Jv)}):[nc],Hf=!1,Uh=0;Uh<ch.length;Uh++){var jh=ch[Uh];if(!Wo.horizontal[jh])if(Hf)Wo.horizontal[jh]=Wo.horizontal[0];else{var fh=Em(Qo,C,G,ye,Go,mf,ha,"center",jh,Vu,fl,Gh.horizontal,!1,mc,Bo,So);fh&&(Wo.horizontal[jh]=fh,Hf=fh.positionedLines.length===1)}}wf()}else{nc==="auto"&&(nc=mw(au));var Xh=Em(Qo,C,G,ye,Go,mf,ha,au,nc,Vu,fl,Gh.horizontal,!1,mc,Bo,So);Xh&&(Wo.horizontal[nc]=Xh),wf(),xr(Os)&&fn&&Wa&&(Wo.vertical=Em(Qo,C,G,ye,Go,mf,ha,au,nc,Vu,fl,Gh.vertical,!1,mc,Bo,So))}}var Yh=void 0,Qf=!1;if(ro.icon&&ro.icon.name){var Zh=ne[ro.icon.name];Zh&&(Yh=yd(ye[ro.icon.name],Rt.get("icon-offset").evaluate(ro,{},Ve),Rt.get("icon-anchor").evaluate(ro,{},Ve)),Qf=Zh.sdf,k.sdfIcons===void 0?k.sdfIcons=Zh.sdf:k.sdfIcons!==Zh.sdf&&O("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Zh.pixelRatio!==k.pixelRatio||Rt.get("icon-rotate").constantOr(1)!==0)&&(k.iconsNeedLinear=!0))}var Id=cS(Wo.horizontal)||Wo.vertical;k.iconsInText=Id?Id.iconsInText:!1,(Id||Yh)&&Jz(k,ro,Wo,Yh,ne,rr,Bo,Hs,fl,Qf,Ve)},Un=0,oo=k.features;Un<oo.length;Un+=1)bn();Pe&&k.generateCollisionDebugBuffers()}function mw(k){switch(k){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Jz(k,C,G,ne,ye,Pe,Ve,ft,Rt,Ht,rr){var Pr=Pe.textMaxSize.evaluate(C,{});Pr===void 0&&(Pr=Ve);var Zr=k.layers[0].layout,Hr=Zr.get("icon-offset").evaluate(C,{},rr),hi=cS(G.horizontal),Gi=24,Ra=Ve/Gi,ha=k.tilePixelRatio*Ra,fn=k.tilePixelRatio*Pr/Gi,Wa=k.tilePixelRatio*ft,cn=k.tilePixelRatio*Zr.get("symbol-spacing"),bn=Zr.get("text-padding")*k.tilePixelRatio,Un=Zr.get("icon-padding")*k.tilePixelRatio,oo=Zr.get("text-max-angle")/180*Math.PI,ro=Zr.get("text-rotation-alignment")==="map"&&Zr.get("symbol-placement")!=="point",Go=Zr.get("icon-rotation-alignment")==="map"&&Zr.get("symbol-placement")!=="point",So=Zr.get("symbol-placement"),Bo=cn/2,Hs=Zr.get("icon-text-fit"),Wo;ne&&Hs!=="none"&&(k.allowVerticalPlacement&&G.vertical&&(Wo=Lv(ne,G.vertical,Hs,Zr.get("icon-text-fit-padding"),Hr,Ra)),hi&&(ne=Lv(ne,hi,Hs,Zr.get("icon-text-fit-padding"),Hr,Ra)));var Qo=function(Bm,Hd){Hd.x<0||Hd.x>=ma||Hd.y<0||Hd.y>=ma||Qz(k,Hd,Bm,G,ne,ye,Wo,k.layers[0],k.collisionBoxArray,C.index,C.sourceLayerIndex,k.index,ha,bn,ro,Rt,Wa,Un,Go,Hr,C,Pe,Ht,rr,Ve)};if(So==="line")for(var fl=0,Os=nS(C.geometry,0,0,ma,ma);fl<Os.length;fl+=1)for(var iu=Os[fl],Vu=Hz(iu,cn,oo,G.vertical||hi,ne,Gi,fn,k.overscaling,ma),au=0,nu=Vu;au<nu.length;au+=1){var Xl=nu[au],nc=hi;(!nc||!e7(k,nc.text,Bo,Xl))&&Qo(iu,Xl)}else if(So==="line-center")for(var mc=0,mf=C.geometry;mc<mf.length;mc+=1){var wf=mf[mc];if(wf.length>1){var ch=qz(wf,oo,G.vertical||hi,ne,Gi,fn);ch&&Qo(wf,ch)}}else if(C.type==="Polygon")for(var Hf=0,Uh=xm(C.geometry,0);Hf<Uh.length;Hf+=1){var jh=Uh[Hf],fh=Xz(jh,16);Qo(jh[0],new Nh(fh.x,fh.y,0))}else if(C.type==="LineString")for(var Xh=0,Yh=C.geometry;Xh<Yh.length;Xh+=1){var Qf=Yh[Xh];Qo(Qf,new Nh(Qf[0].x,Qf[0].y,0))}else if(C.type==="Point")for(var Zh=0,Id=C.geometry;Zh<Id.length;Zh+=1)for(var Jv=Id[Zh],Dp=0,zp=Jv;Dp<zp.length;Dp+=1){var Fp=zp[Dp];Qo([Fp],new Nh(Fp.x,Fp.y,0))}}var Xg=255,Pp=Xg*Eh;function uS(k,C,G,ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr,Hr,hi){var Gi=Gz(C,G,ft,ye,Pe,Ve,ne,k.allowVerticalPlacement),Ra=k.textSizeData,ha=null;Ra.kind==="source"?(ha=[Eh*ye.layout.get("text-size").evaluate(Ve,{})],ha[0]>Pp&&O(k.layerIds[0]+': Value for "text-size" is >= '+Xg+'. Reduce your "text-size".')):Ra.kind==="composite"&&(ha=[Eh*Hr.compositeTextSizes[0].evaluate(Ve,{},hi),Eh*Hr.compositeTextSizes[1].evaluate(Ve,{},hi)],(ha[0]>Pp||ha[1]>Pp)&&O(k.layerIds[0]+': Value for "text-size" is >= '+Xg+'. Reduce your "text-size".')),k.addSymbols(k.text,Gi,ha,ft,Pe,Ve,Ht,C,Rt.lineStartIndex,Rt.lineLength,Zr,hi);for(var fn=0,Wa=rr;fn<Wa.length;fn+=1){var cn=Wa[fn];Pr[cn]=k.text.placedSymbolArray.length-1}return Gi.length*4}function cS(k){for(var C in k)return k[C];return null}function Qz(k,C,G,ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr,Hr,hi,Gi,Ra,ha,fn,Wa,cn,bn,Un,oo,ro){var Go,So=k.addToLineVertexArray(C,G),Bo,Hs,Wo,Qo,fl=0,Os=0,iu=0,Vu=0,au=-1,nu=-1,Xl={},nc=pe(""),mc=0,mf=0;if(ft._unevaluatedLayout.getValue("text-radial-offset")===void 0?(Go=ft.layout.get("text-offset").evaluate(cn,{},oo).map(function(Kg){return Kg*dn}),mc=Go[0],mf=Go[1]):(mc=ft.layout.get("text-radial-offset").evaluate(cn,{},oo)*dn,mf=pw),k.allowVerticalPlacement&&ne.vertical){var wf=ft.layout.get("text-rotate").evaluate(cn,{},oo),ch=wf+90,Hf=ne.vertical;Wo=new Y1(Rt,C,Ht,rr,Pr,Hf,Zr,Hr,hi,ch),Ve&&(Qo=new Y1(Rt,C,Ht,rr,Pr,Ve,Ra,ha,hi,ch))}if(ye){var Uh=ft.layout.get("icon-rotate").evaluate(cn,{}),jh=ft.layout.get("icon-text-fit")!=="none",fh=oS(ye,Uh,Un,jh),Xh=Ve?oS(Ve,Uh,Un,jh):void 0;Hs=new Y1(Rt,C,Ht,rr,Pr,ye,Ra,ha,!1,Uh),fl=fh.length*4;var Yh=k.iconSizeData,Qf=null;Yh.kind==="source"?(Qf=[Eh*ft.layout.get("icon-size").evaluate(cn,{})],Qf[0]>Pp&&O(k.layerIds[0]+': Value for "icon-size" is >= '+Xg+'. Reduce your "icon-size".')):Yh.kind==="composite"&&(Qf=[Eh*bn.compositeIconSizes[0].evaluate(cn,{},oo),Eh*bn.compositeIconSizes[1].evaluate(cn,{},oo)],(Qf[0]>Pp||Qf[1]>Pp)&&O(k.layerIds[0]+': Value for "icon-size" is >= '+Xg+'. Reduce your "icon-size".')),k.addSymbols(k.icon,fh,Qf,Wa,fn,cn,!1,C,So.lineStartIndex,So.lineLength,-1,oo),au=k.icon.placedSymbolArray.length-1,Xh&&(Os=Xh.length*4,k.addSymbols(k.icon,Xh,Qf,Wa,fn,cn,Gh.vertical,C,So.lineStartIndex,So.lineLength,-1,oo),nu=k.icon.placedSymbolArray.length-1)}for(var Zh in ne.horizontal){var Id=ne.horizontal[Zh];if(!Bo){nc=pe(Id.text);var Jv=ft.layout.get("text-rotate").evaluate(cn,{},oo);Bo=new Y1(Rt,C,Ht,rr,Pr,Id,Zr,Hr,hi,Jv)}var Dp=Id.positionedLines.length===1;if(iu+=uS(k,C,Id,Pe,ft,hi,cn,Gi,So,ne.vertical?Gh.horizontal:Gh.horizontalOnly,Dp?Object.keys(ne.horizontal):[Zh],Xl,au,bn,oo),Dp)break}ne.vertical&&(Vu+=uS(k,C,ne.vertical,Pe,ft,hi,cn,Gi,So,Gh.vertical,["vertical"],Xl,nu,bn,oo));var zp=Bo?Bo.boxStartIndex:k.collisionBoxArray.length,Fp=Bo?Bo.boxEndIndex:k.collisionBoxArray.length,Bm=Wo?Wo.boxStartIndex:k.collisionBoxArray.length,Hd=Wo?Wo.boxEndIndex:k.collisionBoxArray.length,Q1=Hs?Hs.boxStartIndex:k.collisionBoxArray.length,ww=Hs?Hs.boxEndIndex:k.collisionBoxArray.length,e_=Qo?Qo.boxStartIndex:k.collisionBoxArray.length,Tw=Qo?Qo.boxEndIndex:k.collisionBoxArray.length,Dd=-1,Om=function(Kg,MS){return Kg&&Kg.circleDiameter?Math.max(Kg.circleDiameter,MS):MS};Dd=Om(Bo,Dd),Dd=Om(Wo,Dd),Dd=Om(Hs,Dd),Dd=Om(Qo,Dd);var t_=Dd>-1?1:0;t_&&(Dd*=ro/dn),k.glyphOffsetArray.length>=ju.MAX_GLYPHS&&O("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),cn.sortKey!==void 0&&k.addToSortKeyRanges(k.symbolInstances.length,cn.sortKey),k.symbolInstances.emplaceBack(C.x,C.y,Xl.right>=0?Xl.right:-1,Xl.center>=0?Xl.center:-1,Xl.left>=0?Xl.left:-1,Xl.vertical||-1,au,nu,nc,zp,Fp,Bm,Hd,Q1,ww,e_,Tw,Ht,iu,Vu,fl,Os,t_,0,Zr,mc,mf,Dd)}function e7(k,C,G,ne){var ye=k.compareText;if(!(C in ye))ye[C]=[];else for(var Pe=ye[C],Ve=Pe.length-1;Ve>=0;Ve--)if(ne.dist(Pe[Ve])<G)return!0;return ye[C].push(ne),!1}var t7=nv.VectorTileFeature.types,r7=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Z1(k,C,G,ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr){var Hr=ft?Math.min(Pp,Math.round(ft[0])):0,hi=ft?Math.min(Pp,Math.round(ft[1])):0;k.emplaceBack(C,G,Math.round(ne*32),Math.round(ye*32),Pe,Ve,(Hr<<1)+(Rt?1:0),hi,Ht*16,rr*16,Pr*256,Zr*256)}function gw(k,C,G){k.emplaceBack(C.x,C.y,G),k.emplaceBack(C.x,C.y,G),k.emplaceBack(C.x,C.y,G),k.emplaceBack(C.x,C.y,G)}function i7(k){for(var C=0,G=k.sections;C<G.length;C+=1){var ne=G[C];if(ya(ne.text))return!0}return!1}var Rm=function(C){this.layoutVertexArray=new kn,this.indexArray=new on,this.programConfigurations=C,this.segments=new $o,this.dynamicLayoutVertexArray=new Qi,this.opacityVertexArray=new Yi,this.placedSymbolArray=new Cs};Rm.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},Rm.prototype.upload=function(C,G,ne,ye){this.isEmpty()||(ne&&(this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,Ee.members),this.indexBuffer=C.createIndexBuffer(this.indexArray,G),this.dynamicLayoutVertexBuffer=C.createVertexBuffer(this.dynamicLayoutVertexArray,je.members,!0),this.opacityVertexBuffer=C.createVertexBuffer(this.opacityVertexArray,r7,!0),this.opacityVertexBuffer.itemSize=1),(ne||ye)&&this.programConfigurations.upload(C))},Rm.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},de("SymbolBuffers",Rm);var Yg=function(C,G,ne){this.layoutVertexArray=new C,this.layoutAttributes=G,this.indexArray=new ne,this.segments=new $o,this.collisionVertexArray=new Ea};Yg.prototype.upload=function(C){this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=C.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=C.createVertexBuffer(this.collisionVertexArray,ct.members,!0)},Yg.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},de("CollisionBuffers",Yg);var ju=function(C){this.collisionBoxArray=C.collisionBoxArray,this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(Rt){return Rt.id}),this.index=C.index,this.pixelRatio=C.pixelRatio,this.sourceLayerIndex=C.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=qv([]),this.placementViewportMatrix=qv([]);var G=this.layers[0],ne=G._unevaluatedLayout._values;this.textSizeData=Ld(this.zoom,ne["text-size"]),this.iconSizeData=Ld(this.zoom,ne["icon-size"]);var ye=this.layers[0].layout,Pe=ye.get("symbol-sort-key"),Ve=ye.get("symbol-z-order");this.canOverlap=ye.get("text-allow-overlap")||ye.get("icon-allow-overlap")||ye.get("text-ignore-placement")||ye.get("icon-ignore-placement"),this.sortFeaturesByKey=Ve!=="viewport-y"&&Pe.constantOr(1)!==void 0;var ft=Ve==="viewport-y"||Ve==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=ft&&this.canOverlap,ye.get("symbol-placement")==="point"&&(this.writingModes=ye.get("text-writing-mode").map(function(Rt){return Gh[Rt]})),this.stateDependentLayerIds=this.layers.filter(function(Rt){return Rt.isStateDependent()}).map(function(Rt){return Rt.id}),this.sourceID=C.sourceID};ju.prototype.createArrays=function(){this.text=new Rm(new Ji(this.layers,this.zoom,function(C){return/^text/.test(C)})),this.icon=new Rm(new Ji(this.layers,this.zoom,function(C){return/^icon/.test(C)})),this.glyphOffsetArray=new cu,this.lineVertexArray=new il,this.symbolInstances=new Ul},ju.prototype.calculateGlyphDependencies=function(C,G,ne,ye,Pe){for(var Ve=0;Ve<C.length;Ve++)if(G[C.charCodeAt(Ve)]=!0,(ne||ye)&&Pe){var ft=Aa[C.charAt(Ve)];ft&&(G[ft.charCodeAt(0)]=!0)}},ju.prototype.populate=function(C,G,ne){var ye=this.layers[0],Pe=ye.layout,Ve=Pe.get("text-font"),ft=Pe.get("text-field"),Rt=Pe.get("icon-image"),Ht=(ft.value.kind!=="constant"||ft.value.value instanceof mu&&!ft.value.value.isEmpty()||ft.value.value.toString().length>0)&&(Ve.value.kind!=="constant"||Ve.value.value.length>0),rr=Rt.value.kind!=="constant"||!!Rt.value.value||Object.keys(Rt.parameters).length>0,Pr=Pe.get("symbol-sort-key");if(this.features=[],!(!Ht&&!rr)){for(var Zr=G.iconDependencies,Hr=G.glyphDependencies,hi=G.availableImages,Gi=new Dn(this.zoom),Ra=0,ha=C;Ra<ha.length;Ra+=1){var fn=ha[Ra],Wa=fn.feature,cn=fn.id,bn=fn.index,Un=fn.sourceLayerIndex,oo=ye._featureFilter.needGeometry,ro=No(Wa,oo);if(ye._featureFilter.filter(Gi,ro,ne)){oo||(ro.geometry=Sn(Wa));var Go=void 0;if(Ht){var So=ye.getValueAndResolveTokens("text-field",ro,ne,hi),Bo=mu.factory(So);i7(Bo)&&(this.hasRTLText=!0),(!this.hasRTLText||vs()==="unavailable"||this.hasRTLText&&ml.isParsed())&&(Go=aa(Bo,ye,ro))}var Hs=void 0;if(rr){var Wo=ye.getValueAndResolveTokens("icon-image",ro,ne,hi);Wo instanceof Vl?Hs=Wo:Hs=Vl.fromString(Wo)}if(!(!Go&&!Hs)){var Qo=this.sortFeaturesByKey?Pr.evaluate(ro,{},ne):void 0,fl={id:cn,text:Go,icon:Hs,index:bn,sourceLayerIndex:Un,geometry:ro.geometry,properties:Wa.properties,type:t7[Wa.type],sortKey:Qo};if(this.features.push(fl),Hs&&(Zr[Hs.name]=!0),Go){var Os=Ve.evaluate(ro,{},ne).join(","),iu=Pe.get("text-rotation-alignment")==="map"&&Pe.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Gh.vertical)>=0;for(var Vu=0,au=Go.sections;Vu<au.length;Vu+=1){var nu=au[Vu];if(nu.image)Zr[nu.image.name]=!0;else{var Xl=xr(Go.toString()),nc=nu.fontStack||Os,mc=Hr[nc]=Hr[nc]||{};this.calculateGlyphDependencies(nu.text,mc,iu,this.allowVerticalPlacement,Xl)}}}}}}Pe.get("symbol-placement")==="line"&&(this.features=nn(this.features)),this.sortFeaturesByKey&&this.features.sort(function(mf,wf){return mf.sortKey-wf.sortKey})}},ju.prototype.update=function(C,G,ne){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(C,G,this.layers,ne),this.icon.programConfigurations.updatePaintArrays(C,G,this.layers,ne))},ju.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},ju.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},ju.prototype.upload=function(C){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(C),this.iconCollisionBox.upload(C)),this.text.upload(C,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(C,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},ju.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},ju.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},ju.prototype.addToLineVertexArray=function(C,G){var ne=this.lineVertexArray.length;if(C.segment!==void 0){for(var ye=C.dist(G[C.segment+1]),Pe=C.dist(G[C.segment]),Ve={},ft=C.segment+1;ft<G.length;ft++)Ve[ft]={x:G[ft].x,y:G[ft].y,tileUnitDistanceFromAnchor:ye},ft<G.length-1&&(ye+=G[ft+1].dist(G[ft]));for(var Rt=C.segment||0;Rt>=0;Rt--)Ve[Rt]={x:G[Rt].x,y:G[Rt].y,tileUnitDistanceFromAnchor:Pe},Rt>0&&(Pe+=G[Rt-1].dist(G[Rt]));for(var Ht=0;Ht<G.length;Ht++){var rr=Ve[Ht];this.lineVertexArray.emplaceBack(rr.x,rr.y,rr.tileUnitDistanceFromAnchor)}}return{lineStartIndex:ne,lineLength:this.lineVertexArray.length-ne}},ju.prototype.addSymbols=function(C,G,ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr,Zr){for(var Hr=C.indexArray,hi=C.layoutVertexArray,Gi=C.segments.prepareSegment(4*G.length,hi,Hr,this.canOverlap?Ve.sortKey:void 0),Ra=this.glyphOffsetArray.length,ha=Gi.vertexLength,fn=this.allowVerticalPlacement&&ft===Gh.vertical?Math.PI/2:0,Wa=Ve.text&&Ve.text.sections,cn=0;cn<G.length;cn++){var bn=G[cn],Un=bn.tl,oo=bn.tr,ro=bn.bl,Go=bn.br,So=bn.tex,Bo=bn.pixelOffsetTL,Hs=bn.pixelOffsetBR,Wo=bn.minFontScaleX,Qo=bn.minFontScaleY,fl=bn.glyphOffset,Os=bn.isSDF,iu=bn.sectionIndex,Vu=Gi.vertexLength,au=fl[1];Z1(hi,Rt.x,Rt.y,Un.x,au+Un.y,So.x,So.y,ne,Os,Bo.x,Bo.y,Wo,Qo),Z1(hi,Rt.x,Rt.y,oo.x,au+oo.y,So.x+So.w,So.y,ne,Os,Hs.x,Bo.y,Wo,Qo),Z1(hi,Rt.x,Rt.y,ro.x,au+ro.y,So.x,So.y+So.h,ne,Os,Bo.x,Hs.y,Wo,Qo),Z1(hi,Rt.x,Rt.y,Go.x,au+Go.y,So.x+So.w,So.y+So.h,ne,Os,Hs.x,Hs.y,Wo,Qo),gw(C.dynamicLayoutVertexArray,Rt,fn),Hr.emplaceBack(Vu,Vu+1,Vu+2),Hr.emplaceBack(Vu+1,Vu+2,Vu+3),Gi.vertexLength+=4,Gi.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(fl[0]),(cn===G.length-1||iu!==G[cn+1].sectionIndex)&&C.programConfigurations.populatePaintArrays(hi.length,Ve,Ve.index,{},Zr,Wa&&Wa[iu])}C.placedSymbolArray.emplaceBack(Rt.x,Rt.y,Ra,this.glyphOffsetArray.length-Ra,ha,Ht,rr,Rt.segment,ne?ne[0]:0,ne?ne[1]:0,ye[0],ye[1],ft,0,!1,0,Pr)},ju.prototype._addCollisionDebugVertex=function(C,G,ne,ye,Pe,Ve){return G.emplaceBack(0,0),C.emplaceBack(ne.x,ne.y,ye,Pe,Math.round(Ve.x),Math.round(Ve.y))},ju.prototype.addCollisionDebugVertices=function(C,G,ne,ye,Pe,Ve,ft){var Rt=Pe.segments.prepareSegment(4,Pe.layoutVertexArray,Pe.indexArray),Ht=Rt.vertexLength,rr=Pe.layoutVertexArray,Pr=Pe.collisionVertexArray,Zr=ft.anchorX,Hr=ft.anchorY;this._addCollisionDebugVertex(rr,Pr,Ve,Zr,Hr,new n(C,G)),this._addCollisionDebugVertex(rr,Pr,Ve,Zr,Hr,new n(ne,G)),this._addCollisionDebugVertex(rr,Pr,Ve,Zr,Hr,new n(ne,ye)),this._addCollisionDebugVertex(rr,Pr,Ve,Zr,Hr,new n(C,ye)),Rt.vertexLength+=4;var hi=Pe.indexArray;hi.emplaceBack(Ht,Ht+1),hi.emplaceBack(Ht+1,Ht+2),hi.emplaceBack(Ht+2,Ht+3),hi.emplaceBack(Ht+3,Ht),Rt.primitiveLength+=4},ju.prototype.addDebugCollisionBoxes=function(C,G,ne,ye){for(var Pe=C;Pe<G;Pe++){var Ve=this.collisionBoxArray.get(Pe),ft=Ve.x1,Rt=Ve.y1,Ht=Ve.x2,rr=Ve.y2;this.addCollisionDebugVertices(ft,Rt,Ht,rr,ye?this.textCollisionBox:this.iconCollisionBox,Ve.anchorPoint,ne)}},ju.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Yg(Va,Nt.members,$n),this.iconCollisionBox=new Yg(Va,Nt.members,$n);for(var C=0;C<this.symbolInstances.length;C++){var G=this.symbolInstances.get(C);this.addDebugCollisionBoxes(G.textBoxStartIndex,G.textBoxEndIndex,G,!0),this.addDebugCollisionBoxes(G.verticalTextBoxStartIndex,G.verticalTextBoxEndIndex,G,!0),this.addDebugCollisionBoxes(G.iconBoxStartIndex,G.iconBoxEndIndex,G,!1),this.addDebugCollisionBoxes(G.verticalIconBoxStartIndex,G.verticalIconBoxEndIndex,G,!1)}},ju.prototype._deserializeCollisionBoxesForSymbol=function(C,G,ne,ye,Pe,Ve,ft,Rt,Ht){for(var rr={},Pr=G;Pr<ne;Pr++){var Zr=C.get(Pr);rr.textBox={x1:Zr.x1,y1:Zr.y1,x2:Zr.x2,y2:Zr.y2,anchorPointX:Zr.anchorPointX,anchorPointY:Zr.anchorPointY},rr.textFeatureIndex=Zr.featureIndex;break}for(var Hr=ye;Hr<Pe;Hr++){var hi=C.get(Hr);rr.verticalTextBox={x1:hi.x1,y1:hi.y1,x2:hi.x2,y2:hi.y2,anchorPointX:hi.anchorPointX,anchorPointY:hi.anchorPointY},rr.verticalTextFeatureIndex=hi.featureIndex;break}for(var Gi=Ve;Gi<ft;Gi++){var Ra=C.get(Gi);rr.iconBox={x1:Ra.x1,y1:Ra.y1,x2:Ra.x2,y2:Ra.y2,anchorPointX:Ra.anchorPointX,anchorPointY:Ra.anchorPointY},rr.iconFeatureIndex=Ra.featureIndex;break}for(var ha=Rt;ha<Ht;ha++){var fn=C.get(ha);rr.verticalIconBox={x1:fn.x1,y1:fn.y1,x2:fn.x2,y2:fn.y2,anchorPointX:fn.anchorPointX,anchorPointY:fn.anchorPointY},rr.verticalIconFeatureIndex=fn.featureIndex;break}return rr},ju.prototype.deserializeCollisionBoxes=function(C){this.collisionArrays=[];for(var G=0;G<this.symbolInstances.length;G++){var ne=this.symbolInstances.get(G);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(C,ne.textBoxStartIndex,ne.textBoxEndIndex,ne.verticalTextBoxStartIndex,ne.verticalTextBoxEndIndex,ne.iconBoxStartIndex,ne.iconBoxEndIndex,ne.verticalIconBoxStartIndex,ne.verticalIconBoxEndIndex))}},ju.prototype.hasTextData=function(){return this.text.segments.get().length>0},ju.prototype.hasIconData=function(){return this.icon.segments.get().length>0},ju.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},ju.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},ju.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},ju.prototype.addIndicesForPlacedSymbol=function(C,G){for(var ne=C.placedSymbolArray.get(G),ye=ne.vertexStartIndex+ne.numGlyphs*4,Pe=ne.vertexStartIndex;Pe<ye;Pe+=4)C.indexArray.emplaceBack(Pe,Pe+1,Pe+2),C.indexArray.emplaceBack(Pe+1,Pe+2,Pe+3)},ju.prototype.getSortedSymbolIndexes=function(C){if(this.sortedAngle===C&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var G=Math.sin(C),ne=Math.cos(C),ye=[],Pe=[],Ve=[],ft=0;ft<this.symbolInstances.length;++ft){Ve.push(ft);var Rt=this.symbolInstances.get(ft);ye.push(Math.round(G*Rt.anchorX+ne*Rt.anchorY)|0),Pe.push(Rt.featureIndex)}return Ve.sort(function(Ht,rr){return ye[Ht]-ye[rr]||Pe[rr]-Pe[Ht]}),Ve},ju.prototype.addToSortKeyRanges=function(C,G){var ne=this.sortKeyRanges[this.sortKeyRanges.length-1];ne&&ne.sortKey===G?ne.symbolInstanceEnd=C+1:this.sortKeyRanges.push({sortKey:G,symbolInstanceStart:C,symbolInstanceEnd:C+1})},ju.prototype.sortFeatures=function(C){var G=this;if(this.sortFeaturesByY&&this.sortedAngle!==C&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(C),this.sortedAngle=C,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var ne=0,ye=this.symbolInstanceIndexes;ne<ye.length;ne+=1){var Pe=ye[ne],Ve=this.symbolInstances.get(Pe);this.featureSortOrder.push(Ve.featureIndex),[Ve.rightJustifiedTextSymbolIndex,Ve.centerJustifiedTextSymbolIndex,Ve.leftJustifiedTextSymbolIndex].forEach(function(ft,Rt,Ht){ft>=0&&Ht.indexOf(ft)===Rt&&G.addIndicesForPlacedSymbol(G.text,ft)}),Ve.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,Ve.verticalPlacedTextSymbolIndex),Ve.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ve.placedIconSymbolIndex),Ve.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ve.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},de("SymbolBucket",ju,{omit:["layers","collisionBoxArray","features","compareText"]}),ju.MAX_GLYPHS=65535,ju.addDynamicAttributes=gw;function a7(k,C){return C.replace(/{([^{}]+)}/g,function(G,ne){return ne in k?String(k[ne]):""})}var n7=new Ti({"symbol-placement":new rt(rn.layout_symbol["symbol-placement"]),"symbol-spacing":new rt(rn.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new rt(rn.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Yt(rn.layout_symbol["symbol-sort-key"]),"symbol-z-order":new rt(rn.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new rt(rn.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new rt(rn.layout_symbol["icon-ignore-placement"]),"icon-optional":new rt(rn.layout_symbol["icon-optional"]),"icon-rotation-alignment":new rt(rn.layout_symbol["icon-rotation-alignment"]),"icon-size":new Yt(rn.layout_symbol["icon-size"]),"icon-text-fit":new rt(rn.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new rt(rn.layout_symbol["icon-text-fit-padding"]),"icon-image":new Yt(rn.layout_symbol["icon-image"]),"icon-rotate":new Yt(rn.layout_symbol["icon-rotate"]),"icon-padding":new rt(rn.layout_symbol["icon-padding"]),"icon-keep-upright":new rt(rn.layout_symbol["icon-keep-upright"]),"icon-offset":new Yt(rn.layout_symbol["icon-offset"]),"icon-anchor":new Yt(rn.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new rt(rn.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new rt(rn.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new rt(rn.layout_symbol["text-rotation-alignment"]),"text-field":new Yt(rn.layout_symbol["text-field"]),"text-font":new Yt(rn.layout_symbol["text-font"]),"text-size":new Yt(rn.layout_symbol["text-size"]),"text-max-width":new Yt(rn.layout_symbol["text-max-width"]),"text-line-height":new rt(rn.layout_symbol["text-line-height"]),"text-letter-spacing":new Yt(rn.layout_symbol["text-letter-spacing"]),"text-justify":new Yt(rn.layout_symbol["text-justify"]),"text-radial-offset":new Yt(rn.layout_symbol["text-radial-offset"]),"text-variable-anchor":new rt(rn.layout_symbol["text-variable-anchor"]),"text-anchor":new Yt(rn.layout_symbol["text-anchor"]),"text-max-angle":new rt(rn.layout_symbol["text-max-angle"]),"text-writing-mode":new rt(rn.layout_symbol["text-writing-mode"]),"text-rotate":new Yt(rn.layout_symbol["text-rotate"]),"text-padding":new rt(rn.layout_symbol["text-padding"]),"text-keep-upright":new rt(rn.layout_symbol["text-keep-upright"]),"text-transform":new Yt(rn.layout_symbol["text-transform"]),"text-offset":new Yt(rn.layout_symbol["text-offset"]),"text-allow-overlap":new rt(rn.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new rt(rn.layout_symbol["text-ignore-placement"]),"text-optional":new rt(rn.layout_symbol["text-optional"])}),o7=new Ti({"icon-opacity":new Yt(rn.paint_symbol["icon-opacity"]),"icon-color":new Yt(rn.paint_symbol["icon-color"]),"icon-halo-color":new Yt(rn.paint_symbol["icon-halo-color"]),"icon-halo-width":new Yt(rn.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Yt(rn.paint_symbol["icon-halo-blur"]),"icon-translate":new rt(rn.paint_symbol["icon-translate"]),"icon-translate-anchor":new rt(rn.paint_symbol["icon-translate-anchor"]),"text-opacity":new Yt(rn.paint_symbol["text-opacity"]),"text-color":new Yt(rn.paint_symbol["text-color"],{runtimeType:Ys,getOverride:function(k){return k.textColor},hasOverride:function(k){return!!k.textColor}}),"text-halo-color":new Yt(rn.paint_symbol["text-halo-color"]),"text-halo-width":new Yt(rn.paint_symbol["text-halo-width"]),"text-halo-blur":new Yt(rn.paint_symbol["text-halo-blur"]),"text-translate":new rt(rn.paint_symbol["text-translate"]),"text-translate-anchor":new rt(rn.paint_symbol["text-translate-anchor"])}),yw={paint:o7,layout:n7},Dm=function(C){this.type=C.property.overrides?C.property.overrides.runtimeType:yl,this.defaultValue=C};Dm.prototype.evaluate=function(C){if(C.formattedSection){var G=this.defaultValue.property.overrides;if(G&&G.hasOverride(C.formattedSection))return G.getOverride(C.formattedSection)}return C.feature&&C.featureState?this.defaultValue.evaluate(C.feature,C.featureState):this.defaultValue.property.specification.default},Dm.prototype.eachChild=function(C){if(!this.defaultValue.isConstant()){var G=this.defaultValue.value;C(G._styleExpression.expression)}},Dm.prototype.outputDefined=function(){return!1},Dm.prototype.serialize=function(){return null},de("FormatSectionOverride",Dm,{omit:["defaultValue"]});var s7=function(k){function C(G){k.call(this,G,yw)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.recalculate=function(ne,ye){if(k.prototype.recalculate.call(this,ne,ye),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var Pe=this.layout.get("text-writing-mode");if(Pe){for(var Ve=[],ft=0,Rt=Pe;ft<Rt.length;ft+=1){var Ht=Rt[ft];Ve.indexOf(Ht)<0&&Ve.push(Ht)}this.layout._values["text-writing-mode"]=Ve}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},C.prototype.getValueAndResolveTokens=function(ne,ye,Pe,Ve){var ft=this.layout.get(ne).evaluate(ye,{},Pe,Ve),Rt=this._unevaluatedLayout._values[ne];return!Rt.isDataDriven()&&!Po(Rt.value)&&ft?a7(ye.properties,ft):ft},C.prototype.createBucket=function(ne){return new ju(ne)},C.prototype.queryRadius=function(){return 0},C.prototype.queryIntersectsFeature=function(){return!1},C.prototype._setPaintOverrides=function(){for(var ne=0,ye=yw.paint.overridableProperties;ne<ye.length;ne+=1){var Pe=ye[ne];if(C.hasPaintOverride(this.layout,Pe)){var Ve=this.paint.get(Pe),ft=new Dm(Ve),Rt=new wc(ft,Ve.property.specification),Ht=null;Ve.value.kind==="constant"||Ve.value.kind==="source"?Ht=new Nc("source",Rt):Ht=new hc("composite",Rt,Ve.value.zoomStops,Ve.value._interpolationType),this.paint._values[Pe]=new Hl(Ve.property,Ht,Ve.parameters)}}},C.prototype._handleOverridablePaintPropertyUpdate=function(ne,ye,Pe){return!this.layout||ye.isDataDriven()||Pe.isDataDriven()?!1:C.hasPaintOverride(this.layout,ne)},C.hasPaintOverride=function(ne,ye){var Pe=ne.get("text-field"),Ve=yw.paint.properties[ye],ft=!1,Rt=function(Pr){for(var Zr=0,Hr=Pr;Zr<Hr.length;Zr+=1){var hi=Hr[Zr];if(Ve.overrides&&Ve.overrides.hasOverride(hi)){ft=!0;return}}};if(Pe.value.kind==="constant"&&Pe.value.value instanceof mu)Rt(Pe.value.value.sections);else if(Pe.value.kind==="source"){var Ht=function(Pr){if(!ft)if(Pr instanceof Fs&&_l(Pr.value)===Ns){var Zr=Pr.value;Rt(Zr.sections)}else Pr instanceof Zu?Rt(Pr.sections):Pr.eachChild(Ht)},rr=Pe.value;rr._styleExpression&&Ht(rr._styleExpression.expression)}return ft},C}(ia),l7=new Ti({"background-color":new rt(rn.paint_background["background-color"]),"background-pattern":new li(rn.paint_background["background-pattern"]),"background-opacity":new rt(rn.paint_background["background-opacity"])}),u7={paint:l7},c7=function(k){function C(G){k.call(this,G,u7)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C}(ia),f7=new Ti({"raster-opacity":new rt(rn.paint_raster["raster-opacity"]),"raster-hue-rotate":new rt(rn.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new rt(rn.paint_raster["raster-brightness-min"]),"raster-brightness-max":new rt(rn.paint_raster["raster-brightness-max"]),"raster-saturation":new rt(rn.paint_raster["raster-saturation"]),"raster-contrast":new rt(rn.paint_raster["raster-contrast"]),"raster-resampling":new rt(rn.paint_raster["raster-resampling"]),"raster-fade-duration":new rt(rn.paint_raster["raster-fade-duration"])}),h7={paint:f7},d7=function(k){function C(G){k.call(this,G,h7)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C}(ia);function v7(k){var C=[],G=k.id;return G===void 0&&C.push({message:"layers."+G+': missing required property "id"'}),k.render===void 0&&C.push({message:"layers."+G+': missing required method "render"'}),k.renderingMode&&k.renderingMode!=="2d"&&k.renderingMode!=="3d"&&C.push({message:"layers."+G+': property "renderingMode" must be either "2d" or "3d"'}),C}var p7=function(k){function C(G){k.call(this,G,{}),this.implementation=G}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},C.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},C.prototype.recalculate=function(){},C.prototype.updateTransitions=function(){},C.prototype.hasTransition=function(){},C.prototype.serialize=function(){},C.prototype.onAdd=function(ne){this.implementation.onAdd&&this.implementation.onAdd(ne,ne.painter.context.gl)},C.prototype.onRemove=function(ne){this.implementation.onRemove&&this.implementation.onRemove(ne,ne.painter.context.gl)},C}(ia),m7={circle:Zb,heatmap:pm,hillshade:p1,fill:S0,"fill-extrusion":Cv,line:D,symbol:s7,background:c7,raster:d7};function g7(k){return k.type==="custom"?new p7(k):new m7[k.type](k)}var fS=s.HTMLImageElement,hS=s.HTMLCanvasElement,dS=s.HTMLVideoElement,vS=s.ImageData,K1=s.ImageBitmap,C0=function(C,G,ne,ye){this.context=C,this.format=ne,this.texture=C.gl.createTexture(),this.update(G,ye)};C0.prototype.update=function(C,G,ne){var ye=C.width,Pe=C.height,Ve=(!this.size||this.size[0]!==ye||this.size[1]!==Pe)&&!ne,ft=this,Rt=ft.context,Ht=Rt.gl;if(this.useMipmap=!!(G&&G.useMipmap),Ht.bindTexture(Ht.TEXTURE_2D,this.texture),Rt.pixelStoreUnpackFlipY.set(!1),Rt.pixelStoreUnpack.set(1),Rt.pixelStoreUnpackPremultiplyAlpha.set(this.format===Ht.RGBA&&(!G||G.premultiply!==!1)),Ve)this.size=[ye,Pe],C instanceof fS||C instanceof hS||C instanceof dS||C instanceof vS||K1&&C instanceof K1?Ht.texImage2D(Ht.TEXTURE_2D,0,this.format,this.format,Ht.UNSIGNED_BYTE,C):Ht.texImage2D(Ht.TEXTURE_2D,0,this.format,ye,Pe,0,this.format,Ht.UNSIGNED_BYTE,C.data);else{var rr=ne||{x:0,y:0},Pr=rr.x,Zr=rr.y;C instanceof fS||C instanceof hS||C instanceof dS||C instanceof vS||K1&&C instanceof K1?Ht.texSubImage2D(Ht.TEXTURE_2D,0,Pr,Zr,Ht.RGBA,Ht.UNSIGNED_BYTE,C):Ht.texSubImage2D(Ht.TEXTURE_2D,0,Pr,Zr,ye,Pe,Ht.RGBA,Ht.UNSIGNED_BYTE,C.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Ht.generateMipmap(Ht.TEXTURE_2D)},C0.prototype.bind=function(C,G,ne){var ye=this,Pe=ye.context,Ve=Pe.gl;Ve.bindTexture(Ve.TEXTURE_2D,this.texture),ne===Ve.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(ne=Ve.LINEAR),C!==this.filter&&(Ve.texParameteri(Ve.TEXTURE_2D,Ve.TEXTURE_MAG_FILTER,C),Ve.texParameteri(Ve.TEXTURE_2D,Ve.TEXTURE_MIN_FILTER,ne||C),this.filter=C),G!==this.wrap&&(Ve.texParameteri(Ve.TEXTURE_2D,Ve.TEXTURE_WRAP_S,G),Ve.texParameteri(Ve.TEXTURE_2D,Ve.TEXTURE_WRAP_T,G),this.wrap=G)},C0.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1===0},C0.prototype.destroy=function(){var C=this.context,G=C.gl;G.deleteTexture(this.texture),this.texture=null};var _w=function(C){var G=this;this._callback=C,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){G._triggered=!1,G._callback()})};_w.prototype.trigger=function(){var C=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){C._triggered=!1,C._callback()},0))},_w.prototype.remove=function(){delete this._channel,this._callback=function(){}};var zm=function(C,G,ne){this.target=C,this.parent=G,this.mapId=ne,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},L(["receive","process"],this),this.invoker=new _w(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=le()?C:s};zm.prototype.send=function(C,G,ne,ye,Pe){var Ve=this;Pe===void 0&&(Pe=!1);var ft=Math.round(Math.random()*1e18).toString(36).substring(0,10);ne&&(this.callbacks[ft]=ne);var Rt=Z(this.globalScope)?void 0:[];return this.target.postMessage({id:ft,type:C,hasCallback:!!ne,targetMapId:ye,mustQueue:Pe,sourceMapId:this.mapId,data:_t(G,Rt)},Rt),{cancel:function(){ne&&delete Ve.callbacks[ft],Ve.target.postMessage({id:ft,type:"<cancel>",targetMapId:ye,sourceMapId:Ve.mapId})}}},zm.prototype.receive=function(C){var G=C.data,ne=G.id;if(ne&&!(G.targetMapId&&this.mapId!==G.targetMapId))if(G.type==="<cancel>"){delete this.tasks[ne];var ye=this.cancelCallbacks[ne];delete this.cancelCallbacks[ne],ye&&ye()}else le()||G.mustQueue?(this.tasks[ne]=G,this.taskQueue.push(ne),this.invoker.trigger()):this.processTask(ne,G)},zm.prototype.process=function(){if(this.taskQueue.length){var C=this.taskQueue.shift(),G=this.tasks[C];delete this.tasks[C],this.taskQueue.length&&this.invoker.trigger(),G&&this.processTask(C,G)}},zm.prototype.processTask=function(C,G){var ne=this;if(G.type==="<response>"){var ye=this.callbacks[C];delete this.callbacks[C],ye&&(G.error?ye(At(G.error)):ye(null,At(G.data)))}else{var Pe=!1,Ve=Z(this.globalScope)?void 0:[],ft=G.hasCallback?function(Zr,Hr){Pe=!0,delete ne.cancelCallbacks[C],ne.target.postMessage({id:C,type:"<response>",sourceMapId:ne.mapId,error:Zr?_t(Zr):null,data:_t(Hr,Ve)},Ve)}:function(Zr){Pe=!0},Rt=null,Ht=At(G.data);if(this.parent[G.type])Rt=this.parent[G.type](G.sourceMapId,Ht,ft);else if(this.parent.getWorkerSource){var rr=G.type.split("."),Pr=this.parent.getWorkerSource(G.sourceMapId,rr[0],Ht.source);Rt=Pr[rr[1]](Ht,ft)}else ft(new Error("Could not find function "+G.type));!Pe&&Rt&&Rt.cancel&&(this.cancelCallbacks[C]=Rt.cancel)}},zm.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function y7(k,C,G){C=Math.pow(2,G)-C-1;var ne=pS(k*256,C*256,G),ye=pS((k+1)*256,(C+1)*256,G);return ne[0]+","+ne[1]+","+ye[0]+","+ye[1]}function pS(k,C,G){var ne=2*Math.PI*6378137/256/Math.pow(2,G),ye=k*ne-2*Math.PI*6378137/2,Pe=C*ne-2*Math.PI*6378137/2;return[ye,Pe]}var Vf=function(C,G){C&&(G?this.setSouthWest(C).setNorthEast(G):C.length===4?this.setSouthWest([C[0],C[1]]).setNorthEast([C[2],C[3]]):this.setSouthWest(C[0]).setNorthEast(C[1]))};Vf.prototype.setNorthEast=function(C){return this._ne=C instanceof jc?new jc(C.lng,C.lat):jc.convert(C),this},Vf.prototype.setSouthWest=function(C){return this._sw=C instanceof jc?new jc(C.lng,C.lat):jc.convert(C),this},Vf.prototype.extend=function(C){var G=this._sw,ne=this._ne,ye,Pe;if(C instanceof jc)ye=C,Pe=C;else if(C instanceof Vf){if(ye=C._sw,Pe=C._ne,!ye||!Pe)return this}else{if(Array.isArray(C))if(C.length===4||C.every(Array.isArray)){var Ve=C;return this.extend(Vf.convert(Ve))}else{var ft=C;return this.extend(jc.convert(ft))}return this}return!G&&!ne?(this._sw=new jc(ye.lng,ye.lat),this._ne=new jc(Pe.lng,Pe.lat)):(G.lng=Math.min(ye.lng,G.lng),G.lat=Math.min(ye.lat,G.lat),ne.lng=Math.max(Pe.lng,ne.lng),ne.lat=Math.max(Pe.lat,ne.lat)),this},Vf.prototype.getCenter=function(){return new jc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Vf.prototype.getSouthWest=function(){return this._sw},Vf.prototype.getNorthEast=function(){return this._ne},Vf.prototype.getNorthWest=function(){return new jc(this.getWest(),this.getNorth())},Vf.prototype.getSouthEast=function(){return new jc(this.getEast(),this.getSouth())},Vf.prototype.getWest=function(){return this._sw.lng},Vf.prototype.getSouth=function(){return this._sw.lat},Vf.prototype.getEast=function(){return this._ne.lng},Vf.prototype.getNorth=function(){return this._ne.lat},Vf.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Vf.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Vf.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Vf.prototype.contains=function(C){var G=jc.convert(C),ne=G.lng,ye=G.lat,Pe=this._sw.lat<=ye&&ye<=this._ne.lat,Ve=this._sw.lng<=ne&&ne<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Ve=this._sw.lng>=ne&&ne>=this._ne.lng),Pe&&Ve},Vf.convert=function(C){return!C||C instanceof Vf?C:new Vf(C)};var mS=63710088e-1,jc=function(C,G){if(isNaN(C)||isNaN(G))throw new Error("Invalid LngLat object: ("+C+", "+G+")");if(this.lng=+C,this.lat=+G,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};jc.prototype.wrap=function(){return new jc(_(this.lng,-180,180),this.lat)},jc.prototype.toArray=function(){return[this.lng,this.lat]},jc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},jc.prototype.distanceTo=function(C){var G=Math.PI/180,ne=this.lat*G,ye=C.lat*G,Pe=Math.sin(ne)*Math.sin(ye)+Math.cos(ne)*Math.cos(ye)*Math.cos((C.lng-this.lng)*G),Ve=mS*Math.acos(Math.min(Pe,1));return Ve},jc.prototype.toBounds=function(C){C===void 0&&(C=0);var G=40075017,ne=360*C/G,ye=ne/Math.cos(Math.PI/180*this.lat);return new Vf(new jc(this.lng-ye,this.lat-ne),new jc(this.lng+ye,this.lat+ne))},jc.convert=function(C){if(C instanceof jc)return C;if(Array.isArray(C)&&(C.length===2||C.length===3))return new jc(Number(C[0]),Number(C[1]));if(!Array.isArray(C)&&typeof C=="object"&&C!==null)return new jc(Number("lng"in C?C.lng:C.lon),Number(C.lat));throw new 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>]")};var gS=2*Math.PI*mS;function yS(k){return gS*Math.cos(k*Math.PI/180)}function _S(k){return(180+k)/360}function xS(k){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+k*Math.PI/360)))/360}function bS(k,C){return k/yS(C)}function _7(k){return k*360-180}function xw(k){var C=180-k*360;return 360/Math.PI*Math.atan(Math.exp(C*Math.PI/180))-90}function x7(k,C){return k*yS(xw(C))}function b7(k){return 1/Math.cos(k*Math.PI/180)}var L0=function(C,G,ne){ne===void 0&&(ne=0),this.x=+C,this.y=+G,this.z=+ne};L0.fromLngLat=function(C,G){G===void 0&&(G=0);var ne=jc.convert(C);return new L0(_S(ne.lng),xS(ne.lat),bS(G,ne.lat))},L0.prototype.toLngLat=function(){return new jc(_7(this.x),xw(this.y))},L0.prototype.toAltitude=function(){return x7(this.z,this.y)},L0.prototype.meterInMercatorCoordinateUnits=function(){return 1/gS*b7(xw(this.y))};var I0=function(C,G,ne){this.z=C,this.x=G,this.y=ne,this.key=Zg(0,C,C,G,ne)};I0.prototype.equals=function(C){return this.z===C.z&&this.x===C.x&&this.y===C.y},I0.prototype.url=function(C,G){var ne=y7(this.x,this.y,this.z),ye=w7(this.z,this.x,this.y);return C[(this.x+this.y)%C.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(G==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",ye).replace("{bbox-epsg-3857}",ne)},I0.prototype.getTilePoint=function(C){var G=Math.pow(2,this.z);return new n((C.x*G-this.x)*ma,(C.y*G-this.y)*ma)},I0.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var wS=function(C,G){this.wrap=C,this.canonical=G,this.key=Zg(C,G.z,G.z,G.x,G.y)},qf=function(C,G,ne,ye,Pe){this.overscaledZ=C,this.wrap=G,this.canonical=new I0(ne,+ye,+Pe),this.key=Zg(G,C,ne,ye,Pe)};qf.prototype.equals=function(C){return this.overscaledZ===C.overscaledZ&&this.wrap===C.wrap&&this.canonical.equals(C.canonical)},qf.prototype.scaledTo=function(C){var G=this.canonical.z-C;return C>this.canonical.z?new qf(C,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new qf(C,this.wrap,C,this.canonical.x>>G,this.canonical.y>>G)},qf.prototype.calculateScaledKey=function(C,G){var ne=this.canonical.z-C;return C>this.canonical.z?Zg(this.wrap*+G,C,this.canonical.z,this.canonical.x,this.canonical.y):Zg(this.wrap*+G,C,C,this.canonical.x>>ne,this.canonical.y>>ne)},qf.prototype.isChildOf=function(C){if(C.wrap!==this.wrap)return!1;var G=this.canonical.z-C.canonical.z;return C.overscaledZ===0||C.overscaledZ<this.overscaledZ&&C.canonical.x===this.canonical.x>>G&&C.canonical.y===this.canonical.y>>G},qf.prototype.children=function(C){if(this.overscaledZ>=C)return[new qf(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var G=this.canonical.z+1,ne=this.canonical.x*2,ye=this.canonical.y*2;return[new qf(G,this.wrap,G,ne,ye),new qf(G,this.wrap,G,ne+1,ye),new qf(G,this.wrap,G,ne,ye+1),new qf(G,this.wrap,G,ne+1,ye+1)]},qf.prototype.isLessThan=function(C){return this.wrap<C.wrap?!0:this.wrap>C.wrap?!1:this.overscaledZ<C.overscaledZ?!0:this.overscaledZ>C.overscaledZ?!1:this.canonical.x<C.canonical.x?!0:this.canonical.x>C.canonical.x?!1:this.canonical.y<C.canonical.y},qf.prototype.wrapped=function(){return new qf(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},qf.prototype.unwrapTo=function(C){return new qf(this.overscaledZ,C,this.canonical.z,this.canonical.x,this.canonical.y)},qf.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},qf.prototype.toUnwrapped=function(){return new wS(this.wrap,this.canonical)},qf.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},qf.prototype.getTilePoint=function(C){return this.canonical.getTilePoint(new L0(C.x-this.wrap,C.y))};function Zg(k,C,G,ne,ye){k*=2,k<0&&(k=k*-1-1);var Pe=1<<G;return(Pe*Pe*k+Pe*ye+ne).toString(36)+G.toString(36)+C.toString(36)}function w7(k,C,G){for(var ne="",ye,Pe=k;Pe>0;Pe--)ye=1<<Pe-1,ne+=(C&ye?1:0)+(G&ye?2:0);return ne}de("CanonicalTileID",I0),de("OverscaledTileID",qf,{omit:["posMatrix"]});var Kv=function(C,G,ne){if(this.uid=C,G.height!==G.width)throw new RangeError("DEM tiles must be square");if(ne&&ne!=="mapbox"&&ne!=="terrarium")return O('"'+ne+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=G.height;var ye=this.dim=G.height-2;this.data=new Uint32Array(G.data.buffer),this.encoding=ne||"mapbox";for(var Pe=0;Pe<ye;Pe++)this.data[this._idx(-1,Pe)]=this.data[this._idx(0,Pe)],this.data[this._idx(ye,Pe)]=this.data[this._idx(ye-1,Pe)],this.data[this._idx(Pe,-1)]=this.data[this._idx(Pe,0)],this.data[this._idx(Pe,ye)]=this.data[this._idx(Pe,ye-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(ye,-1)]=this.data[this._idx(ye-1,0)],this.data[this._idx(-1,ye)]=this.data[this._idx(0,ye-1)],this.data[this._idx(ye,ye)]=this.data[this._idx(ye-1,ye-1)]};Kv.prototype.get=function(C,G){var ne=new Uint8Array(this.data.buffer),ye=this._idx(C,G)*4,Pe=this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox;return Pe(ne[ye],ne[ye+1],ne[ye+2])},Kv.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Kv.prototype._idx=function(C,G){if(C<-1||C>=this.dim+1||G<-1||G>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(G+1)*this.stride+(C+1)},Kv.prototype._unpackMapbox=function(C,G,ne){return(C*256*256+G*256+ne)/10-1e4},Kv.prototype._unpackTerrarium=function(C,G,ne){return C*256+G+ne/256-32768},Kv.prototype.getPixels=function(){return new Zf({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Kv.prototype.backfillBorder=function(C,G,ne){if(this.dim!==C.dim)throw new Error("dem dimension mismatch");var ye=G*this.dim,Pe=G*this.dim+this.dim,Ve=ne*this.dim,ft=ne*this.dim+this.dim;switch(G){case-1:ye=Pe-1;break;case 1:Pe=ye+1;break}switch(ne){case-1:Ve=ft-1;break;case 1:ft=Ve+1;break}for(var Rt=-G*this.dim,Ht=-ne*this.dim,rr=Ve;rr<ft;rr++)for(var Pr=ye;Pr<Pe;Pr++)this.data[this._idx(Pr,rr)]=C.data[this._idx(Pr+Rt,rr+Ht)]},de("DEMData",Kv);function T7(k,C){var G={};if(!C)return G;for(var ne=function(){var Ve=Pe[ye],ft=Ve.layerIds.map(function(Pr){return C.getLayer(Pr)}).filter(Boolean);if(ft.length!==0){Ve.layers=ft,Ve.stateDependentLayerIds&&(Ve.stateDependentLayers=Ve.stateDependentLayerIds.map(function(Pr){return ft.filter(function(Zr){return Zr.id===Pr})[0]}));for(var Rt=0,Ht=ft;Rt<Ht.length;Rt+=1){var rr=Ht[Rt];G[rr.id]=Ve}}},ye=0,Pe=k;ye<Pe.length;ye+=1)ne();return G}var $1=function(C){this._stringToNumber={},this._numberToString=[];for(var G=0;G<C.length;G++){var ne=C[G];this._stringToNumber[ne]=G,this._numberToString[G]=ne}};$1.prototype.encode=function(C){return this._stringToNumber[C]},$1.prototype.decode=function(C){return this._numberToString[C]};var J1=function(C,G,ne,ye,Pe){this.type="Feature",this._vectorTileFeature=C,C._z=G,C._x=ne,C._y=ye,this.properties=C.properties,this.id=Pe},bw={geometry:{configurable:!0}};bw.geometry.get=function(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},bw.geometry.set=function(k){this._geometry=k},J1.prototype.toJSON=function(){var C={geometry:this.geometry};for(var G in this)G==="_geometry"||G==="_vectorTileFeature"||(C[G]=this[G]);return C},Object.defineProperties(J1.prototype,bw);var Fm=function(){this.state={},this.stateChanges={},this.deletedStates={}};Fm.prototype.updateState=function(C,G,ne){var ye=String(G);if(this.stateChanges[C]=this.stateChanges[C]||{},this.stateChanges[C][ye]=this.stateChanges[C][ye]||{},g(this.stateChanges[C][ye],ne),this.deletedStates[C]===null){this.deletedStates[C]={};for(var Pe in this.state[C])Pe!==ye&&(this.deletedStates[C][Pe]=null)}else{var Ve=this.deletedStates[C]&&this.deletedStates[C][ye]===null;if(Ve){this.deletedStates[C][ye]={};for(var ft in this.state[C][ye])ne[ft]||(this.deletedStates[C][ye][ft]=null)}else for(var Rt in ne){var Ht=this.deletedStates[C]&&this.deletedStates[C][ye]&&this.deletedStates[C][ye][Rt]===null;Ht&&delete this.deletedStates[C][ye][Rt]}}},Fm.prototype.removeFeatureState=function(C,G,ne){var ye=this.deletedStates[C]===null;if(!ye){var Pe=String(G);if(this.deletedStates[C]=this.deletedStates[C]||{},ne&&G!==void 0)this.deletedStates[C][Pe]!==null&&(this.deletedStates[C][Pe]=this.deletedStates[C][Pe]||{},this.deletedStates[C][Pe][ne]=null);else if(G!==void 0){var Ve=this.stateChanges[C]&&this.stateChanges[C][Pe];if(Ve){this.deletedStates[C][Pe]={};for(ne in this.stateChanges[C][Pe])this.deletedStates[C][Pe][ne]=null}else this.deletedStates[C][Pe]=null}else this.deletedStates[C]=null}},Fm.prototype.getState=function(C,G){var ne=String(G),ye=this.state[C]||{},Pe=this.stateChanges[C]||{},Ve=g({},ye[ne],Pe[ne]);if(this.deletedStates[C]===null)return{};if(this.deletedStates[C]){var ft=this.deletedStates[C][G];if(ft===null)return{};for(var Rt in ft)delete Ve[Rt]}return Ve},Fm.prototype.initializeTileState=function(C,G){C.setFeatureState(this.state,G)},Fm.prototype.coalesceChanges=function(C,G){var ne={};for(var ye in this.stateChanges){this.state[ye]=this.state[ye]||{};var Pe={};for(var Ve in this.stateChanges[ye])this.state[ye][Ve]||(this.state[ye][Ve]={}),g(this.state[ye][Ve],this.stateChanges[ye][Ve]),Pe[Ve]=this.state[ye][Ve];ne[ye]=Pe}for(var ft in this.deletedStates){this.state[ft]=this.state[ft]||{};var Rt={};if(this.deletedStates[ft]===null)for(var Ht in this.state[ft])Rt[Ht]={},this.state[ft][Ht]={};else for(var rr in this.deletedStates[ft]){var Pr=this.deletedStates[ft][rr]===null;if(Pr)this.state[ft][rr]={};else for(var Zr=0,Hr=Object.keys(this.deletedStates[ft][rr]);Zr<Hr.length;Zr+=1){var hi=Hr[Zr];delete this.state[ft][rr][hi]}Rt[rr]=this.state[ft][rr]}ne[ft]=ne[ft]||{},g(ne[ft],Rt)}if(this.stateChanges={},this.deletedStates={},Object.keys(ne).length!==0)for(var Gi in C){var Ra=C[Gi];Ra.setFeatureState(ne,G)}};var $v=function(C,G){this.tileID=C,this.x=C.canonical.x,this.y=C.canonical.y,this.z=C.canonical.z,this.grid=new Su(ma,16,0),this.grid3D=new Su(ma,16,0),this.featureIndexArray=new Dl,this.promoteId=G};$v.prototype.insert=function(C,G,ne,ye,Pe,Ve){var ft=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(ne,ye,Pe);for(var Rt=Ve?this.grid3D:this.grid,Ht=0;Ht<G.length;Ht++){for(var rr=G[Ht],Pr=[1/0,1/0,-1/0,-1/0],Zr=0;Zr<rr.length;Zr++){var Hr=rr[Zr];Pr[0]=Math.min(Pr[0],Hr.x),Pr[1]=Math.min(Pr[1],Hr.y),Pr[2]=Math.max(Pr[2],Hr.x),Pr[3]=Math.max(Pr[3],Hr.y)}Pr[0]<ma&&Pr[1]<ma&&Pr[2]>=0&&Pr[3]>=0&&Rt.insert(ft,Pr[0],Pr[1],Pr[2],Pr[3])}},$v.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new nv.VectorTile(new Fo(this.rawTileData)).layers,this.sourceLayerCoder=new $1(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},$v.prototype.query=function(C,G,ne,ye){var Pe=this;this.loadVTLayers();for(var Ve=C.params||{},ft=ma/C.tileSize/C.scale,Rt=Ze(Ve.filter),Ht=C.queryGeometry,rr=C.queryPadding*ft,Pr=AS(Ht),Zr=this.grid.query(Pr.minX-rr,Pr.minY-rr,Pr.maxX+rr,Pr.maxY+rr),Hr=AS(C.cameraQueryGeometry),hi=this.grid3D.query(Hr.minX-rr,Hr.minY-rr,Hr.maxX+rr,Hr.maxY+rr,function(Un,oo,ro,Go){return Ed(C.cameraQueryGeometry,Un-rr,oo-rr,ro+rr,Go+rr)}),Gi=0,Ra=hi;Gi<Ra.length;Gi+=1){var ha=Ra[Gi];Zr.push(ha)}Zr.sort(A7);for(var fn={},Wa,cn=function(Un){var oo=Zr[Un];if(oo!==Wa){Wa=oo;var ro=Pe.featureIndexArray.get(oo),Go=null;Pe.loadMatchingFeature(fn,ro.bucketIndex,ro.sourceLayerIndex,ro.featureIndex,Rt,Ve.layers,Ve.availableImages,G,ne,ye,function(So,Bo,Hs){return Go||(Go=Sn(So)),Bo.queryIntersectsFeature(Ht,So,Hs,Go,Pe.z,C.transform,ft,C.pixelPosMatrix)})}},bn=0;bn<Zr.length;bn++)cn(bn);return fn},$v.prototype.loadMatchingFeature=function(C,G,ne,ye,Pe,Ve,ft,Rt,Ht,rr,Pr){var Zr=this.bucketLayerIDs[G];if(!(Ve&&!I(Ve,Zr))){var Hr=this.sourceLayerCoder.decode(ne),hi=this.vtLayers[Hr],Gi=hi.feature(ye);if(Pe.needGeometry){var Ra=No(Gi,!0);if(!Pe.filter(new Dn(this.tileID.overscaledZ),Ra,this.tileID.canonical))return}else if(!Pe.filter(new Dn(this.tileID.overscaledZ),Gi))return;for(var ha=this.getId(Gi,Hr),fn=0;fn<Zr.length;fn++){var Wa=Zr[fn];if(!(Ve&&Ve.indexOf(Wa)<0)){var cn=Rt[Wa];if(cn){var bn={};ha!==void 0&&rr&&(bn=rr.getState(cn.sourceLayer||"_geojsonTileLayer",ha));var Un=g({},Ht[Wa]);Un.paint=TS(Un.paint,cn.paint,Gi,bn,ft),Un.layout=TS(Un.layout,cn.layout,Gi,bn,ft);var oo=!Pr||Pr(Gi,cn,bn);if(oo){var ro=new J1(Gi,this.z,this.x,this.y,ha);ro.layer=Un;var Go=C[Wa];Go===void 0&&(Go=C[Wa]=[]),Go.push({featureIndex:ye,feature:ro,intersectionZ:oo})}}}}}},$v.prototype.lookupSymbolFeatures=function(C,G,ne,ye,Pe,Ve,ft,Rt){var Ht={};this.loadVTLayers();for(var rr=Ze(Pe),Pr=0,Zr=C;Pr<Zr.length;Pr+=1){var Hr=Zr[Pr];this.loadMatchingFeature(Ht,ne,ye,Hr,rr,Ve,ft,Rt,G)}return Ht},$v.prototype.hasLayer=function(C){for(var G=0,ne=this.bucketLayerIDs;G<ne.length;G+=1)for(var ye=ne[G],Pe=0,Ve=ye;Pe<Ve.length;Pe+=1){var ft=Ve[Pe];if(C===ft)return!0}return!1},$v.prototype.getId=function(C,G){var ne=C.id;if(this.promoteId){var ye=typeof this.promoteId=="string"?this.promoteId:this.promoteId[G];ne=C.properties[ye],typeof ne=="boolean"&&(ne=Number(ne))}return ne},de("FeatureIndex",$v,{omit:["rawTileData","sourceLayerCoder"]});function TS(k,C,G,ne,ye){return F(k,function(Pe,Ve){var ft=C instanceof Tc?C.get(Ve):null;return ft&&ft.evaluate?ft.evaluate(G,ne,ye):ft})}function AS(k){for(var C=1/0,G=1/0,ne=-1/0,ye=-1/0,Pe=0,Ve=k;Pe<Ve.length;Pe+=1){var ft=Ve[Pe];C=Math.min(C,ft.x),G=Math.min(G,ft.y),ne=Math.max(ne,ft.x),ye=Math.max(ye,ft.y)}return{minX:C,minY:G,maxX:ne,maxY:ye}}function A7(k,C){return C-k}var S7=3e4,uh=function(C,G){this.tileID=C,this.uid=u(),this.uses=0,this.tileSize=G,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};uh.prototype.registerFadeDuration=function(C){var G=C+this.timeAdded;G<_e.now()||this.fadeEndTime&&G<this.fadeEndTime||(this.fadeEndTime=G)},uh.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},uh.prototype.loadVectorData=function(C,G,ne){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!C){this.collisionBoxArray=new Ro;return}C.featureIndex&&(this.latestFeatureIndex=C.featureIndex,C.rawTileData?(this.latestRawTileData=C.rawTileData,this.latestFeatureIndex.rawTileData=C.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=C.collisionBoxArray,this.buckets=T7(C.buckets,G.style),this.hasSymbolBuckets=!1;for(var ye in this.buckets){var Pe=this.buckets[ye];if(Pe instanceof ju)if(this.hasSymbolBuckets=!0,ne)Pe.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var Ve in this.buckets){var ft=this.buckets[Ve];if(ft instanceof ju&&ft.hasRTLText){this.hasRTLText=!0,Pl();break}}this.queryPadding=0;for(var Rt in this.buckets){var Ht=this.buckets[Rt];this.queryPadding=Math.max(this.queryPadding,G.style.getLayer(Rt).queryRadius(Ht))}C.imageAtlas&&(this.imageAtlas=C.imageAtlas),C.glyphAtlasImage&&(this.glyphAtlasImage=C.glyphAtlasImage)},uh.prototype.unloadVectorData=function(){for(var C in this.buckets)this.buckets[C].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},uh.prototype.getBucket=function(C){return this.buckets[C.id]},uh.prototype.upload=function(C){for(var G in this.buckets){var ne=this.buckets[G];ne.uploadPending()&&ne.upload(C)}var ye=C.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new C0(C,this.imageAtlas.image,ye.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new C0(C,this.glyphAtlasImage,ye.ALPHA),this.glyphAtlasImage=null)},uh.prototype.prepare=function(C){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(C,this.imageAtlasTexture)},uh.prototype.queryRenderedFeatures=function(C,G,ne,ye,Pe,Ve,ft,Rt,Ht,rr){return!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData?{}:this.latestFeatureIndex.query({queryGeometry:ye,cameraQueryGeometry:Pe,scale:Ve,tileSize:this.tileSize,pixelPosMatrix:rr,transform:Rt,params:ft,queryPadding:this.queryPadding*Ht},C,G,ne)},uh.prototype.querySourceFeatures=function(C,G){var ne=this.latestFeatureIndex;if(!(!ne||!ne.rawTileData)){var ye=ne.loadVTLayers(),Pe=G?G.sourceLayer:"",Ve=ye._geojsonTileLayer||ye[Pe];if(Ve)for(var ft=Ze(G&&G.filter),Rt=this.tileID.canonical,Ht=Rt.z,rr=Rt.x,Pr=Rt.y,Zr={z:Ht,x:rr,y:Pr},Hr=0;Hr<Ve.length;Hr++){var hi=Ve.feature(Hr);if(ft.needGeometry){var Gi=No(hi,!0);if(!ft.filter(new Dn(this.tileID.overscaledZ),Gi,this.tileID.canonical))continue}else if(!ft.filter(new Dn(this.tileID.overscaledZ),hi))continue;var Ra=ne.getId(hi,Pe),ha=new J1(hi,Ht,rr,Pr,Ra);ha.tile=Zr,C.push(ha)}}},uh.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},uh.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},uh.prototype.setExpiryData=function(C){var G=this.expirationTime;if(C.cacheControl){var ne=ce(C.cacheControl);ne["max-age"]&&(this.expirationTime=Date.now()+ne["max-age"]*1e3)}else C.expires&&(this.expirationTime=new Date(C.expires).getTime());if(this.expirationTime){var ye=Date.now(),Pe=!1;if(this.expirationTime>ye)Pe=!1;else if(!G)Pe=!0;else if(this.expirationTime<G)Pe=!0;else{var Ve=this.expirationTime-G;Ve?this.expirationTime=ye+Math.max(Ve,S7):Pe=!0}Pe?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},uh.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)},uh.prototype.setFeatureState=function(C,G){if(!(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(C).length===0)){var ne=this.latestFeatureIndex.loadVTLayers();for(var ye in this.buckets)if(G.style.hasLayer(ye)){var Pe=this.buckets[ye],Ve=Pe.layers[0].sourceLayer||"_geojsonTileLayer",ft=ne[Ve],Rt=C[Ve];if(!(!ft||!Rt||Object.keys(Rt).length===0)){Pe.update(Rt,ft,this.imageAtlas&&this.imageAtlas.patternPositions||{});var Ht=G&&G.style&&G.style.getLayer(ye);Ht&&(this.queryPadding=Math.max(this.queryPadding,Ht.queryRadius(Pe)))}}}},uh.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},uh.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<_e.now()},uh.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},uh.prototype.setHoldDuration=function(C){this.symbolFadeHoldUntil=_e.now()+C},uh.prototype.setDependencies=function(C,G){for(var ne={},ye=0,Pe=G;ye<Pe.length;ye+=1){var Ve=Pe[ye];ne[Ve]=!0}this.dependencies[C]=ne},uh.prototype.hasDependency=function(C,G){for(var ne=0,ye=C;ne<ye.length;ne+=1){var Pe=ye[ne],Ve=this.dependencies[Pe];if(Ve)for(var ft=0,Rt=G;ft<Rt.length;ft+=1){var Ht=Rt[ft];if(Ve[Ht])return!0}}return!1};var M7=["type","source","source-layer","minzoom","maxzoom","filter","layout"],Rp=s.performance,SS=function(C){this._marks={start:[C.url,"start"].join("#"),end:[C.url,"end"].join("#"),measure:C.url.toString()},Rp.mark(this._marks.start)};SS.prototype.finish=function(){Rp.mark(this._marks.end);var C=Rp.getEntriesByName(this._marks.measure);return C.length===0&&(Rp.measure(this._marks.measure,this._marks.start,this._marks.end),C=Rp.getEntriesByName(this._marks.measure),Rp.clearMarks(this._marks.start),Rp.clearMarks(this._marks.end),Rp.clearMeasures(this._marks.measure)),C},e.Actor=zm,e.AlphaImage=sd,e.CanonicalTileID=I0,e.CollisionBoxArray=Ro,e.Color=Js,e.DEMData=Kv,e.DataConstantProperty=rt,e.DictionaryCoder=$1,e.EXTENT=ma,e.ErrorEvent=Lr,e.EvaluationParameters=Dn,e.Event=Nr,e.Evented=br,e.FeatureIndex=$v,e.FillBucket=kd,e.FillExtrusionBucket=Pd,e.ImageAtlas=ov,e.ImagePosition=If,e.LineBucket=jf,e.LngLat=jc,e.LngLatBounds=Vf,e.MercatorCoordinate=L0,e.ONE_EM=dn,e.OverscaledTileID=qf,e.Point=n,e.Point$1=n,e.Properties=Ti,e.Protobuf=Fo,e.RGBAImage=Zf,e.RequestManager=fe,e.RequestPerformance=SS,e.ResourceType=_a,e.SegmentVector=$o,e.SourceFeatureState=Fm,e.StructArrayLayout1ui2=fo,e.StructArrayLayout2f1f2i16=La,e.StructArrayLayout2i4=zi,e.StructArrayLayout3ui6=on,e.StructArrayLayout4i8=la,e.SymbolBucket=ju,e.Texture=C0,e.Tile=uh,e.Transitionable=Rs,e.Uniform1f=Et,e.Uniform1i=mt,e.Uniform2f=Bt,e.Uniform3f=or,e.Uniform4f=dr,e.UniformColor=ur,e.UniformMatrix4f=cr,e.UnwrappedTileID=wS,e.ValidationError=Xn,e.WritingMode=Gh,e.ZoomHistory=ar,e.add=od,e.addDynamicAttributes=gw,e.asyncAll=w,e.bezier=d,e.bindAll=L,e.browser=_e,e.cacheEntryPossiblyAdded=vi,e.clamp=l,e.clearTileCache=Ui,e.clipLine=nS,e.clone=bp,e.clone$1=B,e.clone$2=fm,e.collisionCircleLayout=sr,e.config=we,e.create=xp,e.create$1=oh,e.create$2=rv,e.createCommonjsModule=t,e.createExpression=es,e.createLayout=Da,e.createStyleLayer=g7,e.cross=qb,e.deepEqual=h,e.dot=Vb,e.dot$1=Yb,e.ease=T,e.emitValidationErrors=Uu,e.endsWith=z,e.enforceCacheSizeLimit=Vi,e.evaluateSizeForFeature=JA,e.evaluateSizeForZoom=QA,e.evaluateVariableOffset=lS,e.evented=bo,e.extend=g,e.featureFilter=Ze,e.filterObject=N,e.fromRotation=xv,e.getAnchorAlignment=Wg,e.getAnchorJustification=mw,e.getArrayBuffer=ii,e.getImage=_n,e.getJSON=ri,e.getRTLTextPluginStatus=vs,e.getReferrer=Kt,e.getVideo=En,e.identity=qv,e.invert=bv,e.isChar=Ft,e.isMapboxURL=Be,e.keysDifference=M,e.makeRequest=Br,e.mapObject=F,e.mercatorXfromLng=_S,e.mercatorYfromLat=xS,e.mercatorZfromAltitude=bS,e.mul=h0,e.multiply=wv,e.mvt=nv,e.nextPowerOfTwo=f,e.normalize=d0,e.number=Nl,e.offscreenCanvasSupported=Bi,e.ortho=Du,e.parseGlyphPBF=jd,e.pbf=Fo,e.performSymbolLayout=$z,e.perspective=wp,e.pick=b,e.plugin=ml,e.polygonIntersectsPolygon=ts,e.postMapLoadEvent=be,e.postTurnstileEvent=Ne,e.potpack=md,e.refProperties=M7,e.register=de,e.registerForPluginStateChange=To,e.renderColorRamp=m0,e.rotate=Vv,e.rotateX=Th,e.rotateZ=Hv,e.scale=_u,e.scale$1=Xb,e.scale$2=hm,e.setCacheLimits=Ki,e.setRTLTextPlugin=cs,e.sphericalToCartesian=se,e.sqrLen=Mg,e.styleSpec=rn,e.sub=Gb,e.symbolSize=Vz,e.transformMat3=Hb,e.transformMat4=Gv,e.translate=vc,e.triggerPluginCompletionEvent=Yn,e.uniqueId=u,e.validateCustomStyleLayer=v7,e.validateLight=gs,e.validateStyle=ms,e.values=A,e.vectorTile=nv,e.version=r,e.warnOnce=O,e.webpSupported=Re,e.window=s,e.wrap=_}),E(["./shared"],function(e){"use strict";function t(Kt){var zt=typeof Kt;if(zt==="number"||zt==="boolean"||zt==="string"||Kt===void 0||Kt===null)return JSON.stringify(Kt);if(Array.isArray(Kt)){for(var Zt="[",Jt=0,Br=Kt;Jt<Br.length;Jt+=1){var ri=Br[Jt];Zt+=t(ri)+","}return Zt+"]"}for(var ii=Object.keys(Kt).sort(),di="{",Wi=0;Wi<ii.length;Wi++)di+=JSON.stringify(ii[Wi])+":"+t(Kt[ii[Wi]])+",";return di+"}"}function r(Kt){for(var zt="",Zt=0,Jt=e.refProperties;Zt<Jt.length;Zt+=1){var Br=Jt[Zt];zt+="/"+t(Kt[Br])}return zt}function o(Kt,zt){for(var Zt={},Jt=0;Jt<Kt.length;Jt++){var Br=zt&&zt[Kt[Jt].id]||r(Kt[Jt]);zt&&(zt[Kt[Jt].id]=Br);var ri=Zt[Br];ri||(ri=Zt[Br]=[]),ri.push(Kt[Jt])}var ii=[];for(var di in Zt)ii.push(Zt[di]);return ii}var i=function(zt){this.keyCache={},zt&&this.replace(zt)};i.prototype.replace=function(zt){this._layerConfigs={},this._layers={},this.update(zt,[])},i.prototype.update=function(zt,Zt){for(var Jt=this,Br=0,ri=zt;Br<ri.length;Br+=1){var ii=ri[Br];this._layerConfigs[ii.id]=ii;var di=this._layers[ii.id]=e.createStyleLayer(ii);di._featureFilter=e.featureFilter(di.filter),this.keyCache[ii.id]&&delete this.keyCache[ii.id]}for(var Wi=0,oa=Zt;Wi<oa.length;Wi+=1){var ra=oa[Wi];delete this.keyCache[ra],delete this._layerConfigs[ra],delete this._layers[ra]}this.familiesBySource={};for(var ca=o(e.values(this._layerConfigs),this.keyCache),xa=0,ji=ca;xa<ji.length;xa+=1){var pn=ji[xa],_n=pn.map(function(br){return Jt._layers[br.id]}),En=_n[0];if(En.visibility!=="none"){var bt=En.source||"",st=this.familiesBySource[bt];st||(st=this.familiesBySource[bt]={});var Nr=En.sourceLayer||"_geojsonTileLayer",Lr=st[Nr];Lr||(Lr=st[Nr]=[]),Lr.push(_n)}}};var n=1,a=function(zt){var Zt={},Jt=[];for(var Br in zt){var ri=zt[Br],ii=Zt[Br]={};for(var di in ri){var Wi=ri[+di];if(!(!Wi||Wi.bitmap.width===0||Wi.bitmap.height===0)){var oa={x:0,y:0,w:Wi.bitmap.width+2*n,h:Wi.bitmap.height+2*n};Jt.push(oa),ii[di]={rect:oa,metrics:Wi.metrics}}}}var ra=e.potpack(Jt),ca=ra.w,xa=ra.h,ji=new e.AlphaImage({width:ca||1,height:xa||1});for(var pn in zt){var _n=zt[pn];for(var En in _n){var bt=_n[+En];if(!(!bt||bt.bitmap.width===0||bt.bitmap.height===0)){var st=Zt[pn][En].rect;e.AlphaImage.copy(bt.bitmap,ji,{x:0,y:0},{x:st.x+n,y:st.y+n},bt.bitmap)}}}this.image=ji,this.positions=Zt};e.register("GlyphAtlas",a);var s=function(zt){this.tileID=new e.OverscaledTileID(zt.tileID.overscaledZ,zt.tileID.wrap,zt.tileID.canonical.z,zt.tileID.canonical.x,zt.tileID.canonical.y),this.uid=zt.uid,this.zoom=zt.zoom,this.pixelRatio=zt.pixelRatio,this.tileSize=zt.tileSize,this.source=zt.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=zt.showCollisionBoxes,this.collectResourceTiming=!!zt.collectResourceTiming,this.returnDependencies=!!zt.returnDependencies,this.promoteId=zt.promoteId};s.prototype.parse=function(zt,Zt,Jt,Br,ri){var ii=this;this.status="parsing",this.data=zt,this.collisionBoxArray=new e.CollisionBoxArray;var di=new e.DictionaryCoder(Object.keys(zt.layers).sort()),Wi=new e.FeatureIndex(this.tileID,this.promoteId);Wi.bucketLayerIDs=[];var oa={},ra={featureIndex:Wi,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Jt},ca=Zt.familiesBySource[this.source];for(var xa in ca){var ji=zt.layers[xa];if(ji){ji.version===1&&e.warnOnce('Vector tile source "'+this.source+'" layer "'+xa+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var pn=di.encode(xa),_n=[],En=0;En<ji.length;En++){var bt=ji.feature(En),st=Wi.getId(bt,xa);_n.push({feature:bt,id:st,index:En,sourceLayerIndex:pn})}for(var Nr=0,Lr=ca[xa];Nr<Lr.length;Nr+=1){var br=Lr[Nr],Rr=br[0];if(!(Rr.minzoom&&this.zoom<Math.floor(Rr.minzoom))&&!(Rr.maxzoom&&this.zoom>=Rr.maxzoom)&&Rr.visibility!=="none"){h(br,this.zoom,Jt);var jr=oa[Rr.id]=Rr.createBucket({index:Wi.bucketLayerIDs.length,layers:br,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:pn,sourceID:this.source});jr.populate(_n,ra,this.tileID.canonical),Wi.bucketLayerIDs.push(br.map(function(fi){return fi.id}))}}}}var Wr,yt,Xt,mr,Or=e.mapObject(ra.glyphDependencies,function(fi){return Object.keys(fi).map(Number)});Object.keys(Or).length?Br.send("getGlyphs",{uid:this.uid,stacks:Or},function(fi,Li){Wr||(Wr=fi,yt=Li,Si.call(ii))}):yt={};var ki=Object.keys(ra.iconDependencies);ki.length?Br.send("getImages",{icons:ki,source:this.source,tileID:this.tileID,type:"icons"},function(fi,Li){Wr||(Wr=fi,Xt=Li,Si.call(ii))}):Xt={};var Ni=Object.keys(ra.patternDependencies);Ni.length?Br.send("getImages",{icons:Ni,source:this.source,tileID:this.tileID,type:"patterns"},function(fi,Li){Wr||(Wr=fi,mr=Li,Si.call(ii))}):mr={},Si.call(this);function Si(){if(Wr)return ri(Wr);if(yt&&Xt&&mr){var fi=new a(yt),Li=new e.ImageAtlas(Xt,mr);for(var Ia in oa){var Fa=oa[Ia];Fa instanceof e.SymbolBucket?(h(Fa.layers,this.zoom,Jt),e.performSymbolLayout(Fa,yt,fi.positions,Xt,Li.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Fa.hasPattern&&(Fa instanceof e.LineBucket||Fa instanceof e.FillBucket||Fa instanceof e.FillExtrusionBucket)&&(h(Fa.layers,this.zoom,Jt),Fa.addFeatures(ra,this.tileID.canonical,Li.patternPositions))}this.status="done",ri(null,{buckets:e.values(oa).filter(function(un){return!un.isEmpty()}),featureIndex:Wi,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:fi.image,imageAtlas:Li,glyphMap:this.returnDependencies?yt:null,iconMap:this.returnDependencies?Xt:null,glyphPositions:this.returnDependencies?fi.positions:null})}}};function h(Kt,zt,Zt){for(var Jt=new e.EvaluationParameters(zt),Br=0,ri=Kt;Br<ri.length;Br+=1){var ii=ri[Br];ii.recalculate(Jt,Zt)}}function c(Kt,zt){var Zt=e.getArrayBuffer(Kt.request,function(Jt,Br,ri,ii){Jt?zt(Jt):Br&&zt(null,{vectorTile:new e.vectorTile.VectorTile(new e.pbf(Br)),rawData:Br,cacheControl:ri,expires:ii})});return function(){Zt.cancel(),zt()}}var m=function(zt,Zt,Jt,Br){this.actor=zt,this.layerIndex=Zt,this.availableImages=Jt,this.loadVectorData=Br||c,this.loading={},this.loaded={}};m.prototype.loadTile=function(zt,Zt){var Jt=this,Br=zt.uid;this.loading||(this.loading={});var ri=zt&&zt.request&&zt.request.collectResourceTiming?new e.RequestPerformance(zt.request):!1,ii=this.loading[Br]=new s(zt);ii.abort=this.loadVectorData(zt,function(di,Wi){if(delete Jt.loading[Br],di||!Wi)return ii.status="done",Jt.loaded[Br]=ii,Zt(di);var oa=Wi.rawData,ra={};Wi.expires&&(ra.expires=Wi.expires),Wi.cacheControl&&(ra.cacheControl=Wi.cacheControl);var ca={};if(ri){var xa=ri.finish();xa&&(ca.resourceTiming=JSON.parse(JSON.stringify(xa)))}ii.vectorTile=Wi.vectorTile,ii.parse(Wi.vectorTile,Jt.layerIndex,Jt.availableImages,Jt.actor,function(ji,pn){if(ji||!pn)return Zt(ji);Zt(null,e.extend({rawTileData:oa.slice(0)},pn,ra,ca))}),Jt.loaded=Jt.loaded||{},Jt.loaded[Br]=ii})},m.prototype.reloadTile=function(zt,Zt){var Jt=this,Br=this.loaded,ri=zt.uid,ii=this;if(Br&&Br[ri]){var di=Br[ri];di.showCollisionBoxes=zt.showCollisionBoxes;var Wi=function(oa,ra){var ca=di.reloadCallback;ca&&(delete di.reloadCallback,di.parse(di.vectorTile,ii.layerIndex,Jt.availableImages,ii.actor,ca)),Zt(oa,ra)};di.status==="parsing"?di.reloadCallback=Wi:di.status==="done"&&(di.vectorTile?di.parse(di.vectorTile,this.layerIndex,this.availableImages,this.actor,Wi):Wi())}},m.prototype.abortTile=function(zt,Zt){var Jt=this.loading,Br=zt.uid;Jt&&Jt[Br]&&Jt[Br].abort&&(Jt[Br].abort(),delete Jt[Br]),Zt()},m.prototype.removeTile=function(zt,Zt){var Jt=this.loaded,Br=zt.uid;Jt&&Jt[Br]&&delete Jt[Br],Zt()};var d=e.window.ImageBitmap,T=function(){this.loaded={}};T.prototype.loadTile=function(zt,Zt){var Jt=zt.uid,Br=zt.encoding,ri=zt.rawImageData,ii=d&&ri instanceof d?this.getImageData(ri):ri,di=new e.DEMData(Jt,ii,Br);this.loaded=this.loaded||{},this.loaded[Jt]=di,Zt(null,di)},T.prototype.getImageData=function(zt){(!this.offscreenCanvas||!this.offscreenCanvasContext)&&(this.offscreenCanvas=new OffscreenCanvas(zt.width,zt.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=zt.width,this.offscreenCanvas.height=zt.height,this.offscreenCanvasContext.drawImage(zt,0,0,zt.width,zt.height);var Zt=this.offscreenCanvasContext.getImageData(-1,-1,zt.width+2,zt.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:Zt.width,height:Zt.height},Zt.data)},T.prototype.removeTile=function(zt){var Zt=this.loaded,Jt=zt.uid;Zt&&Zt[Jt]&&delete Zt[Jt]};var l=_;function _(Kt,zt){var Zt=Kt&&Kt.type,Jt;if(Zt==="FeatureCollection")for(Jt=0;Jt<Kt.features.length;Jt++)_(Kt.features[Jt],zt);else if(Zt==="GeometryCollection")for(Jt=0;Jt<Kt.geometries.length;Jt++)_(Kt.geometries[Jt],zt);else if(Zt==="Feature")_(Kt.geometry,zt);else if(Zt==="Polygon")w(Kt.coordinates,zt);else if(Zt==="MultiPolygon")for(Jt=0;Jt<Kt.coordinates.length;Jt++)w(Kt.coordinates[Jt],zt);return Kt}function w(Kt,zt){if(Kt.length!==0){A(Kt[0],zt);for(var Zt=1;Zt<Kt.length;Zt++)A(Kt[Zt],!zt)}}function A(Kt,zt){for(var Zt=0,Jt=0,Br=Kt.length,ri=Br-1;Jt<Br;ri=Jt++)Zt+=(Kt[Jt][0]-Kt[ri][0])*(Kt[ri][1]+Kt[Jt][1]);Zt>=0!=!!zt&&Kt.reverse()}var M=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,g=function(zt){this._feature=zt,this.extent=e.EXTENT,this.type=zt.type,this.properties=zt.tags,"id"in zt&&!isNaN(zt.id)&&(this.id=parseInt(zt.id,10))};g.prototype.loadGeometry=function(){if(this._feature.type===1){for(var zt=[],Zt=0,Jt=this._feature.geometry;Zt<Jt.length;Zt+=1){var Br=Jt[Zt];zt.push([new e.Point$1(Br[0],Br[1])])}return zt}else{for(var ri=[],ii=0,di=this._feature.geometry;ii<di.length;ii+=1){for(var Wi=di[ii],oa=[],ra=0,ca=Wi;ra<ca.length;ra+=1){var xa=ca[ra];oa.push(new e.Point$1(xa[0],xa[1]))}ri.push(oa)}return ri}},g.prototype.toGeoJSON=function(zt,Zt,Jt){return M.call(this,zt,Zt,Jt)};var b=function(zt){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.EXTENT,this.length=zt.length,this._features=zt};b.prototype.feature=function(zt){return new g(this._features[zt])};var v=e.vectorTile.VectorTileFeature,u=y;function y(Kt,zt){this.options=zt||{},this.features=Kt,this.length=Kt.length}y.prototype.feature=function(Kt){return new f(this.features[Kt],this.options.extent)};function f(Kt,zt){this.id=typeof Kt.id=="number"?Kt.id:void 0,this.type=Kt.type,this.rawGeometry=Kt.type===1?[Kt.geometry]:Kt.geometry,this.properties=Kt.tags,this.extent=zt||4096}f.prototype.loadGeometry=function(){var Kt=this.rawGeometry;this.geometry=[];for(var zt=0;zt<Kt.length;zt++){for(var Zt=Kt[zt],Jt=[],Br=0;Br<Zt.length;Br++)Jt.push(new e.Point$1(Zt[Br][0],Zt[Br][1]));this.geometry.push(Jt)}return this.geometry},f.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var Kt=this.geometry,zt=1/0,Zt=-1/0,Jt=1/0,Br=-1/0,ri=0;ri<Kt.length;ri++)for(var ii=Kt[ri],di=0;di<ii.length;di++){var Wi=ii[di];zt=Math.min(zt,Wi.x),Zt=Math.max(Zt,Wi.x),Jt=Math.min(Jt,Wi.y),Br=Math.max(Br,Wi.y)}return[zt,Jt,Zt,Br]},f.prototype.toGeoJSON=v.prototype.toGeoJSON;var R=N,L=N,z=B,F=u;function N(Kt){var zt=new e.pbf;return I(Kt,zt),zt.finish()}function B(Kt,zt){zt=zt||{};var Zt={};for(var Jt in Kt)Zt[Jt]=new u(Kt[Jt].features,zt),Zt[Jt].name=Jt,Zt[Jt].version=zt.version,Zt[Jt].extent=zt.extent;return N({layers:Zt})}function I(Kt,zt){for(var Zt in Kt.layers)zt.writeMessage(3,U,Kt.layers[Zt])}function U(Kt,zt){zt.writeVarintField(15,Kt.version||1),zt.writeStringField(1,Kt.name||""),zt.writeVarintField(5,Kt.extent||4096);var Zt,Jt={keys:[],values:[],keycache:{},valuecache:{}};for(Zt=0;Zt<Kt.length;Zt++)Jt.feature=Kt.feature(Zt),zt.writeMessage(2,O,Jt);var Br=Jt.keys;for(Zt=0;Zt<Br.length;Zt++)zt.writeStringField(3,Br[Zt]);var ri=Jt.values;for(Zt=0;Zt<ri.length;Zt++)zt.writeMessage(4,ce,ri[Zt])}function O(Kt,zt){var Zt=Kt.feature;Zt.id!==void 0&&zt.writeVarintField(1,Zt.id),zt.writeMessage(2,X,Kt),zt.writeVarintField(3,Zt.type),zt.writeMessage(4,le,Zt)}function X(Kt,zt){var Zt=Kt.feature,Jt=Kt.keys,Br=Kt.values,ri=Kt.keycache,ii=Kt.valuecache;for(var di in Zt.properties){var Wi=ri[di];typeof Wi>"u"&&(Jt.push(di),Wi=Jt.length-1,ri[di]=Wi),zt.writeVarint(Wi);var oa=Zt.properties[di],ra=typeof oa;ra!=="string"&&ra!=="boolean"&&ra!=="number"&&(oa=JSON.stringify(oa));var ca=ra+":"+oa,xa=ii[ca];typeof xa>"u"&&(Br.push(oa),xa=Br.length-1,ii[ca]=xa),zt.writeVarint(xa)}}function J(Kt,zt){return(zt<<3)+(Kt&7)}function se(Kt){return Kt<<1^Kt>>31}function le(Kt,zt){for(var Zt=Kt.loadGeometry(),Jt=Kt.type,Br=0,ri=0,ii=Zt.length,di=0;di<ii;di++){var Wi=Zt[di],oa=1;Jt===1&&(oa=Wi.length),zt.writeVarint(J(1,oa));for(var ra=Jt===3?Wi.length-1:Wi.length,ca=0;ca<ra;ca++){ca===1&&Jt!==1&&zt.writeVarint(J(2,ra-1));var xa=Wi[ca].x-Br,ji=Wi[ca].y-ri;zt.writeVarint(se(xa)),zt.writeVarint(se(ji)),Br+=xa,ri+=ji}Jt===3&&zt.writeVarint(J(7,1))}}function ce(Kt,zt){var Zt=typeof Kt;Zt==="string"?zt.writeStringField(1,Kt):Zt==="boolean"?zt.writeBooleanField(7,Kt):Zt==="number"&&(Kt%1!==0?zt.writeDoubleField(3,Kt):Kt<0?zt.writeSVarintField(6,Kt):zt.writeVarintField(5,Kt))}R.fromVectorTileJs=L,R.fromGeojsonVt=z,R.GeoJSONWrapper=F;function q(Kt,zt,Zt,Jt,Br,ri){if(!(Br-Jt<=Zt)){var ii=Jt+Br>>1;Z(Kt,zt,ii,Jt,Br,ri%2),q(Kt,zt,Zt,Jt,ii-1,ri+1),q(Kt,zt,Zt,ii+1,Br,ri+1)}}function Z(Kt,zt,Zt,Jt,Br,ri){for(;Br>Jt;){if(Br-Jt>600){var ii=Br-Jt+1,di=Zt-Jt+1,Wi=Math.log(ii),oa=.5*Math.exp(2*Wi/3),ra=.5*Math.sqrt(Wi*oa*(ii-oa)/ii)*(di-ii/2<0?-1:1),ca=Math.max(Jt,Math.floor(Zt-di*oa/ii+ra)),xa=Math.min(Br,Math.floor(Zt+(ii-di)*oa/ii+ra));Z(Kt,zt,Zt,ca,xa,ri)}var ji=zt[2*Zt+ri],pn=Jt,_n=Br;for(ee(Kt,zt,Jt,Zt),zt[2*Br+ri]>ji&&ee(Kt,zt,Jt,Br);pn<_n;){for(ee(Kt,zt,pn,_n),pn++,_n--;zt[2*pn+ri]<ji;)pn++;for(;zt[2*_n+ri]>ji;)_n--}zt[2*Jt+ri]===ji?ee(Kt,zt,Jt,_n):(_n++,ee(Kt,zt,_n,Br)),_n<=Zt&&(Jt=_n+1),Zt<=_n&&(Br=_n-1)}}function ee(Kt,zt,Zt,Jt){V(Kt,Zt,Jt),V(zt,2*Zt,2*Jt),V(zt,2*Zt+1,2*Jt+1)}function V(Kt,zt,Zt){var Jt=Kt[zt];Kt[zt]=Kt[Zt],Kt[Zt]=Jt}function oe(Kt,zt,Zt,Jt,Br,ri,ii){for(var di=[0,Kt.length-1,0],Wi=[],oa,ra;di.length;){var ca=di.pop(),xa=di.pop(),ji=di.pop();if(xa-ji<=ii){for(var pn=ji;pn<=xa;pn++)oa=zt[2*pn],ra=zt[2*pn+1],oa>=Zt&&oa<=Br&&ra>=Jt&&ra<=ri&&Wi.push(Kt[pn]);continue}var _n=Math.floor((ji+xa)/2);oa=zt[2*_n],ra=zt[2*_n+1],oa>=Zt&&oa<=Br&&ra>=Jt&&ra<=ri&&Wi.push(Kt[_n]);var En=(ca+1)%2;(ca===0?Zt<=oa:Jt<=ra)&&(di.push(ji),di.push(_n-1),di.push(En)),(ca===0?Br>=oa:ri>=ra)&&(di.push(_n+1),di.push(xa),di.push(En))}return Wi}function ie(Kt,zt,Zt,Jt,Br,ri){for(var ii=[0,Kt.length-1,0],di=[],Wi=Br*Br;ii.length;){var oa=ii.pop(),ra=ii.pop(),ca=ii.pop();if(ra-ca<=ri){for(var xa=ca;xa<=ra;xa++)j(zt[2*xa],zt[2*xa+1],Zt,Jt)<=Wi&&di.push(Kt[xa]);continue}var ji=Math.floor((ca+ra)/2),pn=zt[2*ji],_n=zt[2*ji+1];j(pn,_n,Zt,Jt)<=Wi&&di.push(Kt[ji]);var En=(oa+1)%2;(oa===0?Zt-Br<=pn:Jt-Br<=_n)&&(ii.push(ca),ii.push(ji-1),ii.push(En)),(oa===0?Zt+Br>=pn:Jt+Br>=_n)&&(ii.push(ji+1),ii.push(ra),ii.push(En))}return di}function j(Kt,zt,Zt,Jt){var Br=Kt-Zt,ri=zt-Jt;return Br*Br+ri*ri}var Q=function(Kt){return Kt[0]},re=function(Kt){return Kt[1]},ue=function(zt,Zt,Jt,Br,ri){Zt===void 0&&(Zt=Q),Jt===void 0&&(Jt=re),Br===void 0&&(Br=64),ri===void 0&&(ri=Float64Array),this.nodeSize=Br,this.points=zt;for(var ii=zt.length<65536?Uint16Array:Uint32Array,di=this.ids=new ii(zt.length),Wi=this.coords=new ri(zt.length*2),oa=0;oa<zt.length;oa++)di[oa]=oa,Wi[2*oa]=Zt(zt[oa]),Wi[2*oa+1]=Jt(zt[oa]);q(di,Wi,Br,0,di.length-1,0)};ue.prototype.range=function(zt,Zt,Jt,Br){return oe(this.ids,this.coords,zt,Zt,Jt,Br,this.nodeSize)},ue.prototype.within=function(zt,Zt,Jt){return ie(this.ids,this.coords,zt,Zt,Jt,this.nodeSize)};var _e={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(Kt){return Kt}},we=function(zt){this.options=me(Object.create(_e),zt),this.trees=new Array(this.options.maxZoom+1)};we.prototype.load=function(zt){var Zt=this.options,Jt=Zt.log,Br=Zt.minZoom,ri=Zt.maxZoom,ii=Zt.nodeSize;Jt&&console.time("total time");var di="prepare "+zt.length+" points";Jt&&console.time(di),this.points=zt;for(var Wi=[],oa=0;oa<zt.length;oa++)zt[oa].geometry&&Wi.push(ze(zt[oa],oa));this.trees[ri+1]=new ue(Wi,fe,Be,ii,Float32Array),Jt&&console.timeEnd(di);for(var ra=ri;ra>=Br;ra--){var ca=+Date.now();Wi=this._cluster(Wi,ra),this.trees[ra]=new ue(Wi,fe,Be,ii,Float32Array),Jt&&console.log("z%d: %d clusters in %dms",ra,Wi.length,+Date.now()-ca)}return Jt&&console.timeEnd("total time"),this},we.prototype.getClusters=function(zt,Zt){var Jt=((zt[0]+180)%360+360)%360-180,Br=Math.max(-90,Math.min(90,zt[1])),ri=zt[2]===180?180:((zt[2]+180)%360+360)%360-180,ii=Math.max(-90,Math.min(90,zt[3]));if(zt[2]-zt[0]>=360)Jt=-180,ri=180;else if(Jt>ri){var di=this.getClusters([Jt,Br,180,ii],Zt),Wi=this.getClusters([-180,Br,ri,ii],Zt);return di.concat(Wi)}for(var oa=this.trees[this._limitZoom(Zt)],ra=oa.range(it(Jt),et(ii),it(ri),et(Br)),ca=[],xa=0,ji=ra;xa<ji.length;xa+=1){var pn=ji[xa],_n=oa.points[pn];ca.push(_n.numPoints?Xe(_n):this.points[_n.index])}return ca},we.prototype.getChildren=function(zt){var Zt=this._getOriginId(zt),Jt=this._getOriginZoom(zt),Br="No cluster with the specified id.",ri=this.trees[Jt];if(!ri)throw new Error(Br);var ii=ri.points[Zt];if(!ii)throw new Error(Br);for(var di=this.options.radius/(this.options.extent*Math.pow(2,Jt-1)),Wi=ri.within(ii.x,ii.y,di),oa=[],ra=0,ca=Wi;ra<ca.length;ra+=1){var xa=ca[ra],ji=ri.points[xa];ji.parentId===zt&&oa.push(ji.numPoints?Xe(ji):this.points[ji.index])}if(oa.length===0)throw new Error(Br);return oa},we.prototype.getLeaves=function(zt,Zt,Jt){Zt=Zt||10,Jt=Jt||0;var Br=[];return this._appendLeaves(Br,zt,Zt,Jt,0),Br},we.prototype.getTile=function(zt,Zt,Jt){var Br=this.trees[this._limitZoom(zt)],ri=Math.pow(2,zt),ii=this.options,di=ii.extent,Wi=ii.radius,oa=Wi/di,ra=(Jt-oa)/ri,ca=(Jt+1+oa)/ri,xa={features:[]};return this._addTileFeatures(Br.range((Zt-oa)/ri,ra,(Zt+1+oa)/ri,ca),Br.points,Zt,Jt,ri,xa),Zt===0&&this._addTileFeatures(Br.range(1-oa/ri,ra,1,ca),Br.points,ri,Jt,ri,xa),Zt===ri-1&&this._addTileFeatures(Br.range(0,ra,oa/ri,ca),Br.points,-1,Jt,ri,xa),xa.features.length?xa:null},we.prototype.getClusterExpansionZoom=function(zt){for(var Zt=this._getOriginZoom(zt)-1;Zt<=this.options.maxZoom;){var Jt=this.getChildren(zt);if(Zt++,Jt.length!==1)break;zt=Jt[0].properties.cluster_id}return Zt},we.prototype._appendLeaves=function(zt,Zt,Jt,Br,ri){for(var ii=this.getChildren(Zt),di=0,Wi=ii;di<Wi.length;di+=1){var oa=Wi[di],ra=oa.properties;if(ra&&ra.cluster?ri+ra.point_count<=Br?ri+=ra.point_count:ri=this._appendLeaves(zt,ra.cluster_id,Jt,Br,ri):ri<Br?ri++:zt.push(oa),zt.length===Jt)break}return ri},we.prototype._addTileFeatures=function(zt,Zt,Jt,Br,ri,ii){for(var di=0,Wi=zt;di<Wi.length;di+=1){var oa=Wi[di],ra=Zt[oa],ca=ra.numPoints,xa={type:1,geometry:[[Math.round(this.options.extent*(ra.x*ri-Jt)),Math.round(this.options.extent*(ra.y*ri-Br))]],tags:ca?tt(ra):this.points[ra.index].properties},ji=void 0;ca?ji=ra.id:this.options.generateId?ji=ra.index:this.points[ra.index].id&&(ji=this.points[ra.index].id),ji!==void 0&&(xa.id=ji),ii.features.push(xa)}},we.prototype._limitZoom=function(zt){return Math.max(this.options.minZoom,Math.min(+zt,this.options.maxZoom+1))},we.prototype._cluster=function(zt,Zt){for(var Jt=[],Br=this.options,ri=Br.radius,ii=Br.extent,di=Br.reduce,Wi=Br.minPoints,oa=ri/(ii*Math.pow(2,Zt)),ra=0;ra<zt.length;ra++){var ca=zt[ra];if(!(ca.zoom<=Zt)){ca.zoom=Zt;for(var xa=this.trees[Zt+1],ji=xa.within(ca.x,ca.y,oa),pn=ca.numPoints||1,_n=pn,En=0,bt=ji;En<bt.length;En+=1){var st=bt[En],Nr=xa.points[st];Nr.zoom>Zt&&(_n+=Nr.numPoints||1)}if(_n>=Wi){for(var Lr=ca.x*pn,br=ca.y*pn,Rr=di&&pn>1?this._map(ca,!0):null,jr=(ra<<5)+(Zt+1)+this.points.length,Wr=0,yt=ji;Wr<yt.length;Wr+=1){var Xt=yt[Wr],mr=xa.points[Xt];if(!(mr.zoom<=Zt)){mr.zoom=Zt;var Or=mr.numPoints||1;Lr+=mr.x*Or,br+=mr.y*Or,mr.parentId=jr,di&&(Rr||(Rr=this._map(ca,!0)),di(Rr,this._map(mr)))}}ca.parentId=jr,Jt.push(Re(Lr/_n,br/_n,jr,_n,Rr))}else if(Jt.push(ca),_n>1)for(var ki=0,Ni=ji;ki<Ni.length;ki+=1){var Si=Ni[ki],fi=xa.points[Si];fi.zoom<=Zt||(fi.zoom=Zt,Jt.push(fi))}}}return Jt},we.prototype._getOriginId=function(zt){return zt-this.points.length>>5},we.prototype._getOriginZoom=function(zt){return(zt-this.points.length)%32},we.prototype._map=function(zt,Zt){if(zt.numPoints)return Zt?me({},zt.properties):zt.properties;var Jt=this.points[zt.index].properties,Br=this.options.map(Jt);return Zt&&Br===Jt?me({},Br):Br};function Re(Kt,zt,Zt,Jt,Br){return{x:Kt,y:zt,zoom:1/0,id:Zt,parentId:-1,numPoints:Jt,properties:Br}}function ze(Kt,zt){var Zt=Kt.geometry.coordinates,Jt=Zt[0],Br=Zt[1];return{x:it(Jt),y:et(Br),zoom:1/0,index:zt,parentId:-1}}function Xe(Kt){return{type:"Feature",id:Kt.id,properties:tt(Kt),geometry:{type:"Point",coordinates:[nt(Kt.x),Ae(Kt.y)]}}}function tt(Kt){var zt=Kt.numPoints,Zt=zt>=1e4?Math.round(zt/1e3)+"k":zt>=1e3?Math.round(zt/100)/10+"k":zt;return me(me({},Kt.properties),{cluster:!0,cluster_id:Kt.id,point_count:zt,point_count_abbreviated:Zt})}function it(Kt){return Kt/360+.5}function et(Kt){var zt=Math.sin(Kt*Math.PI/180),Zt=.5-.25*Math.log((1+zt)/(1-zt))/Math.PI;return Zt<0?0:Zt>1?1:Zt}function nt(Kt){return(Kt-.5)*360}function Ae(Kt){var zt=(180-Kt*360)*Math.PI/180;return 360*Math.atan(Math.exp(zt))/Math.PI-90}function me(Kt,zt){for(var Zt in zt)Kt[Zt]=zt[Zt];return Kt}function fe(Kt){return Kt.x}function Be(Kt){return Kt.y}function Qe(Kt,zt,Zt,Jt){for(var Br=Jt,ri=Zt-zt>>1,ii=Zt-zt,di,Wi=Kt[zt],oa=Kt[zt+1],ra=Kt[Zt],ca=Kt[Zt+1],xa=zt+3;xa<Zt;xa+=3){var ji=at(Kt[xa],Kt[xa+1],Wi,oa,ra,ca);if(ji>Br)di=xa,Br=ji;else if(ji===Br){var pn=Math.abs(xa-ri);pn<ii&&(di=xa,ii=pn)}}Br>Jt&&(di-zt>3&&Qe(Kt,zt,di,Jt),Kt[di+2]=Br,Zt-di>3&&Qe(Kt,di,Zt,Jt))}function at(Kt,zt,Zt,Jt,Br,ri){var ii=Br-Zt,di=ri-Jt;if(ii!==0||di!==0){var Wi=((Kt-Zt)*ii+(zt-Jt)*di)/(ii*ii+di*di);Wi>1?(Zt=Br,Jt=ri):Wi>0&&(Zt+=ii*Wi,Jt+=di*Wi)}return ii=Kt-Zt,di=zt-Jt,ii*ii+di*di}function $e(Kt,zt,Zt,Jt){var Br={id:typeof Kt>"u"?null:Kt,type:zt,geometry:Zt,tags:Jt,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return It(Br),Br}function It(Kt){var zt=Kt.geometry,Zt=Kt.type;if(Zt==="Point"||Zt==="MultiPoint"||Zt==="LineString")Pt(Kt,zt);else if(Zt==="Polygon"||Zt==="MultiLineString")for(var Jt=0;Jt<zt.length;Jt++)Pt(Kt,zt[Jt]);else if(Zt==="MultiPolygon")for(Jt=0;Jt<zt.length;Jt++)for(var Br=0;Br<zt[Jt].length;Br++)Pt(Kt,zt[Jt][Br])}function Pt(Kt,zt){for(var Zt=0;Zt<zt.length;Zt+=3)Kt.minX=Math.min(Kt.minX,zt[Zt]),Kt.minY=Math.min(Kt.minY,zt[Zt+1]),Kt.maxX=Math.max(Kt.maxX,zt[Zt]),Kt.maxY=Math.max(Kt.maxY,zt[Zt+1])}function Vt(Kt,zt){var Zt=[];if(Kt.type==="FeatureCollection")for(var Jt=0;Jt<Kt.features.length;Jt++)Wt(Zt,Kt.features[Jt],zt,Jt);else Kt.type==="Feature"?Wt(Zt,Kt,zt):Wt(Zt,{geometry:Kt},zt);return Zt}function Wt(Kt,zt,Zt,Jt){if(zt.geometry){var Br=zt.geometry.coordinates,ri=zt.geometry.type,ii=Math.pow(Zt.tolerance/((1<<Zt.maxZoom)*Zt.extent),2),di=[],Wi=zt.id;if(Zt.promoteId?Wi=zt.properties[Zt.promoteId]:Zt.generateId&&(Wi=Jt||0),ri==="Point")Cr(Br,di);else if(ri==="MultiPoint")for(var oa=0;oa<Br.length;oa++)Cr(Br[oa],di);else if(ri==="LineString")yr(Br,di,ii,!1);else if(ri==="MultiLineString")if(Zt.lineMetrics){for(oa=0;oa<Br.length;oa++)di=[],yr(Br[oa],di,ii,!1),Kt.push($e(Wi,"LineString",di,zt.properties));return}else qr(Br,di,ii,!1);else if(ri==="Polygon")qr(Br,di,ii,!0);else if(ri==="MultiPolygon")for(oa=0;oa<Br.length;oa++){var ra=[];qr(Br[oa],ra,ii,!0),di.push(ra)}else if(ri==="GeometryCollection"){for(oa=0;oa<zt.geometry.geometries.length;oa++)Wt(Kt,{id:Wi,geometry:zt.geometry.geometries[oa],properties:zt.properties},Zt,Jt);return}else throw new Error("Input data is not a valid GeoJSON object.");Kt.push($e(Wi,ri,di,zt.properties))}}function Cr(Kt,zt){zt.push(Mr(Kt[0])),zt.push(Dr(Kt[1])),zt.push(0)}function yr(Kt,zt,Zt,Jt){for(var Br,ri,ii=0,di=0;di<Kt.length;di++){var Wi=Mr(Kt[di][0]),oa=Dr(Kt[di][1]);zt.push(Wi),zt.push(oa),zt.push(0),di>0&&(Jt?ii+=(Br*oa-Wi*ri)/2:ii+=Math.sqrt(Math.pow(Wi-Br,2)+Math.pow(oa-ri,2))),Br=Wi,ri=oa}var ra=zt.length-3;zt[2]=1,Qe(zt,0,ra,Zt),zt[ra+2]=1,zt.size=Math.abs(ii),zt.start=0,zt.end=zt.size}function qr(Kt,zt,Zt,Jt){for(var Br=0;Br<Kt.length;Br++){var ri=[];yr(Kt[Br],ri,Zt,Jt),zt.push(ri)}}function Mr(Kt){return Kt/360+.5}function Dr(Kt){var zt=Math.sin(Kt*Math.PI/180),Zt=.5-.25*Math.log((1+zt)/(1-zt))/Math.PI;return Zt<0?0:Zt>1?1:Zt}function xt(Kt,zt,Zt,Jt,Br,ri,ii,di){if(Zt/=zt,Jt/=zt,ri>=Zt&&ii<Jt)return Kt;if(ii<Zt||ri>=Jt)return null;for(var Wi=[],oa=0;oa<Kt.length;oa++){var ra=Kt[oa],ca=ra.geometry,xa=ra.type,ji=Br===0?ra.minX:ra.minY,pn=Br===0?ra.maxX:ra.maxY;if(ji>=Zt&&pn<Jt){Wi.push(ra);continue}else if(pn<Zt||ji>=Jt)continue;var _n=[];if(xa==="Point"||xa==="MultiPoint")Ne(ca,_n,Zt,Jt,Br);else if(xa==="LineString")Ye(ca,_n,Zt,Jt,Br,!1,di.lineMetrics);else if(xa==="MultiLineString")Ie(ca,_n,Zt,Jt,Br,!1);else if(xa==="Polygon")Ie(ca,_n,Zt,Jt,Br,!0);else if(xa==="MultiPolygon")for(var En=0;En<ca.length;En++){var bt=[];Ie(ca[En],bt,Zt,Jt,Br,!0),bt.length&&_n.push(bt)}if(_n.length){if(di.lineMetrics&&xa==="LineString"){for(En=0;En<_n.length;En++)Wi.push($e(ra.id,xa,_n[En],ra.tags));continue}(xa==="LineString"||xa==="MultiLineString")&&(_n.length===1?(xa="LineString",_n=_n[0]):xa="MultiLineString"),(xa==="Point"||xa==="MultiPoint")&&(xa=_n.length===3?"Point":"MultiPoint"),Wi.push($e(ra.id,xa,_n,ra.tags))}}return Wi.length?Wi:null}function Ne(Kt,zt,Zt,Jt,Br){for(var ri=0;ri<Kt.length;ri+=3){var ii=Kt[ri+Br];ii>=Zt&&ii<=Jt&&(zt.push(Kt[ri]),zt.push(Kt[ri+1]),zt.push(Kt[ri+2]))}}function Ye(Kt,zt,Zt,Jt,Br,ri,ii){for(var di=be(Kt),Wi=Br===0?ke:Me,oa=Kt.start,ra,ca,xa=0;xa<Kt.length-3;xa+=3){var ji=Kt[xa],pn=Kt[xa+1],_n=Kt[xa+2],En=Kt[xa+3],bt=Kt[xa+4],st=Br===0?ji:pn,Nr=Br===0?En:bt,Lr=!1;ii&&(ra=Math.sqrt(Math.pow(ji-En,2)+Math.pow(pn-bt,2))),st<Zt?Nr>Zt&&(ca=Wi(di,ji,pn,En,bt,Zt),ii&&(di.start=oa+ra*ca)):st>Jt?Nr<Jt&&(ca=Wi(di,ji,pn,En,bt,Jt),ii&&(di.start=oa+ra*ca)):qe(di,ji,pn,_n),Nr<Zt&&st>=Zt&&(ca=Wi(di,ji,pn,En,bt,Zt),Lr=!0),Nr>Jt&&st<=Jt&&(ca=Wi(di,ji,pn,En,bt,Jt),Lr=!0),!ri&&Lr&&(ii&&(di.end=oa+ra*ca),zt.push(di),di=be(Kt)),ii&&(oa+=ra)}var br=Kt.length-3;ji=Kt[br],pn=Kt[br+1],_n=Kt[br+2],st=Br===0?ji:pn,st>=Zt&&st<=Jt&&qe(di,ji,pn,_n),br=di.length-3,ri&&br>=3&&(di[br]!==di[0]||di[br+1]!==di[1])&&qe(di,di[0],di[1],di[2]),di.length&&zt.push(di)}function be(Kt){var zt=[];return zt.size=Kt.size,zt.start=Kt.start,zt.end=Kt.end,zt}function Ie(Kt,zt,Zt,Jt,Br,ri){for(var ii=0;ii<Kt.length;ii++)Ye(Kt[ii],zt,Zt,Jt,Br,ri,!1)}function qe(Kt,zt,Zt,Jt){Kt.push(zt),Kt.push(Zt),Kt.push(Jt)}function ke(Kt,zt,Zt,Jt,Br,ri){var ii=(ri-zt)/(Jt-zt);return Kt.push(ri),Kt.push(Zt+(Br-Zt)*ii),Kt.push(1),ii}function Me(Kt,zt,Zt,Jt,Br,ri){var ii=(ri-Zt)/(Br-Zt);return Kt.push(zt+(Jt-zt)*ii),Kt.push(ri),Kt.push(1),ii}function Le(Kt,zt){var Zt=zt.buffer/zt.extent,Jt=Kt,Br=xt(Kt,1,-1-Zt,Zt,0,-1,2,zt),ri=xt(Kt,1,1-Zt,2+Zt,0,-1,2,zt);return(Br||ri)&&(Jt=xt(Kt,1,-Zt,1+Zt,0,-1,2,zt)||[],Br&&(Jt=ut(Br,1).concat(Jt)),ri&&(Jt=Jt.concat(ut(ri,-1)))),Jt}function ut(Kt,zt){for(var Zt=[],Jt=0;Jt<Kt.length;Jt++){var Br=Kt[Jt],ri=Br.type,ii;if(ri==="Point"||ri==="MultiPoint"||ri==="LineString")ii=lt(Br.geometry,zt);else if(ri==="MultiLineString"||ri==="Polygon"){ii=[];for(var di=0;di<Br.geometry.length;di++)ii.push(lt(Br.geometry[di],zt))}else if(ri==="MultiPolygon")for(ii=[],di=0;di<Br.geometry.length;di++){for(var Wi=[],oa=0;oa<Br.geometry[di].length;oa++)Wi.push(lt(Br.geometry[di][oa],zt));ii.push(Wi)}Zt.push($e(Br.id,ri,ii,Br.tags))}return Zt}function lt(Kt,zt){var Zt=[];Zt.size=Kt.size,Kt.start!==void 0&&(Zt.start=Kt.start,Zt.end=Kt.end);for(var Jt=0;Jt<Kt.length;Jt+=3)Zt.push(Kt[Jt]+zt,Kt[Jt+1],Kt[Jt+2]);return Zt}function gt(Kt,zt){if(Kt.transformed)return Kt;var Zt=1<<Kt.z,Jt=Kt.x,Br=Kt.y,ri,ii,di;for(ri=0;ri<Kt.features.length;ri++){var Wi=Kt.features[ri],oa=Wi.geometry,ra=Wi.type;if(Wi.geometry=[],ra===1)for(ii=0;ii<oa.length;ii+=2)Wi.geometry.push(kt(oa[ii],oa[ii+1],zt,Zt,Jt,Br));else for(ii=0;ii<oa.length;ii++){var ca=[];for(di=0;di<oa[ii].length;di+=2)ca.push(kt(oa[ii][di],oa[ii][di+1],zt,Zt,Jt,Br));Wi.geometry.push(ca)}}return Kt.transformed=!0,Kt}function kt(Kt,zt,Zt,Jt,Br,ri){return[Math.round(Zt*(Kt*Jt-Br)),Math.round(Zt*(zt*Jt-ri))]}function nr(Kt,zt,Zt,Jt,Br){for(var ri=zt===Br.maxZoom?0:Br.tolerance/((1<<zt)*Br.extent),ii={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:Zt,y:Jt,z:zt,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},di=0;di<Kt.length;di++){ii.numFeatures++,ir(ii,Kt[di],ri,Br);var Wi=Kt[di].minX,oa=Kt[di].minY,ra=Kt[di].maxX,ca=Kt[di].maxY;Wi<ii.minX&&(ii.minX=Wi),oa<ii.minY&&(ii.minY=oa),ra>ii.maxX&&(ii.maxX=ra),ca>ii.maxY&&(ii.maxY=ca)}return ii}function ir(Kt,zt,Zt,Jt){var Br=zt.geometry,ri=zt.type,ii=[];if(ri==="Point"||ri==="MultiPoint")for(var di=0;di<Br.length;di+=3)ii.push(Br[di]),ii.push(Br[di+1]),Kt.numPoints++,Kt.numSimplified++;else if(ri==="LineString")tr(ii,Br,Kt,Zt,!1,!1);else if(ri==="MultiLineString"||ri==="Polygon")for(di=0;di<Br.length;di++)tr(ii,Br[di],Kt,Zt,ri==="Polygon",di===0);else if(ri==="MultiPolygon")for(var Wi=0;Wi<Br.length;Wi++){var oa=Br[Wi];for(di=0;di<oa.length;di++)tr(ii,oa[di],Kt,Zt,!0,di===0)}if(ii.length){var ra=zt.tags||null;if(ri==="LineString"&&Jt.lineMetrics){ra={};for(var ca in zt.tags)ra[ca]=zt.tags[ca];ra.mapbox_clip_start=Br.start/Br.size,ra.mapbox_clip_end=Br.end/Br.size}var xa={geometry:ii,type:ri==="Polygon"||ri==="MultiPolygon"?3:ri==="LineString"||ri==="MultiLineString"?2:1,tags:ra};zt.id!==null&&(xa.id=zt.id),Kt.features.push(xa)}}function tr(Kt,zt,Zt,Jt,Br,ri){var ii=Jt*Jt;if(Jt>0&&zt.size<(Br?ii:Jt)){Zt.numPoints+=zt.length/3;return}for(var di=[],Wi=0;Wi<zt.length;Wi+=3)(Jt===0||zt[Wi+2]>ii)&&(Zt.numSimplified++,di.push(zt[Wi]),di.push(zt[Wi+1])),Zt.numPoints++;Br&&Ir(di,ri),Kt.push(di)}function Ir(Kt,zt){for(var Zt=0,Jt=0,Br=Kt.length,ri=Br-2;Jt<Br;ri=Jt,Jt+=2)Zt+=(Kt[Jt]-Kt[ri])*(Kt[Jt+1]+Kt[ri+1]);if(Zt>0===zt)for(Jt=0,Br=Kt.length;Jt<Br/2;Jt+=2){var ii=Kt[Jt],di=Kt[Jt+1];Kt[Jt]=Kt[Br-2-Jt],Kt[Jt+1]=Kt[Br-1-Jt],Kt[Br-2-Jt]=ii,Kt[Br-1-Jt]=di}}function vi(Kt,zt){return new Vi(Kt,zt)}function Vi(Kt,zt){zt=this.options=Ki(Object.create(this.options),zt);var Zt=zt.debug;if(Zt&&console.time("preprocess data"),zt.maxZoom<0||zt.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(zt.promoteId&&zt.generateId)throw new Error("promoteId and generateId cannot be used together.");var Jt=Vt(Kt,zt);this.tiles={},this.tileCoords=[],Zt&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",zt.indexMaxZoom,zt.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Jt=Le(Jt,zt),Jt.length&&this.splitTile(Jt,0,0,0),Zt&&(Jt.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}Vi.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Vi.prototype.splitTile=function(Kt,zt,Zt,Jt,Br,ri,ii){for(var di=[Kt,zt,Zt,Jt],Wi=this.options,oa=Wi.debug;di.length;){Jt=di.pop(),Zt=di.pop(),zt=di.pop(),Kt=di.pop();var ra=1<<zt,ca=Ui(zt,Zt,Jt),xa=this.tiles[ca];if(!xa&&(oa>1&&console.time("creation"),xa=this.tiles[ca]=nr(Kt,zt,Zt,Jt,Wi),this.tileCoords.push({z:zt,x:Zt,y:Jt}),oa)){oa>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",zt,Zt,Jt,xa.numFeatures,xa.numPoints,xa.numSimplified),console.timeEnd("creation"));var ji="z"+zt;this.stats[ji]=(this.stats[ji]||0)+1,this.total++}if(xa.source=Kt,Br){if(zt===Wi.maxZoom||zt===Br)continue;var pn=1<<Br-zt;if(Zt!==Math.floor(ri/pn)||Jt!==Math.floor(ii/pn))continue}else if(zt===Wi.indexMaxZoom||xa.numPoints<=Wi.indexMaxPoints)continue;if(xa.source=null,Kt.length!==0){oa>1&&console.time("clipping");var _n=.5*Wi.buffer/Wi.extent,En=.5-_n,bt=.5+_n,st=1+_n,Nr,Lr,br,Rr,jr,Wr;Nr=Lr=br=Rr=null,jr=xt(Kt,ra,Zt-_n,Zt+bt,0,xa.minX,xa.maxX,Wi),Wr=xt(Kt,ra,Zt+En,Zt+st,0,xa.minX,xa.maxX,Wi),Kt=null,jr&&(Nr=xt(jr,ra,Jt-_n,Jt+bt,1,xa.minY,xa.maxY,Wi),Lr=xt(jr,ra,Jt+En,Jt+st,1,xa.minY,xa.maxY,Wi),jr=null),Wr&&(br=xt(Wr,ra,Jt-_n,Jt+bt,1,xa.minY,xa.maxY,Wi),Rr=xt(Wr,ra,Jt+En,Jt+st,1,xa.minY,xa.maxY,Wi),Wr=null),oa>1&&console.timeEnd("clipping"),di.push(Nr||[],zt+1,Zt*2,Jt*2),di.push(Lr||[],zt+1,Zt*2,Jt*2+1),di.push(br||[],zt+1,Zt*2+1,Jt*2),di.push(Rr||[],zt+1,Zt*2+1,Jt*2+1)}}},Vi.prototype.getTile=function(Kt,zt,Zt){var Jt=this.options,Br=Jt.extent,ri=Jt.debug;if(Kt<0||Kt>24)return null;var ii=1<<Kt;zt=(zt%ii+ii)%ii;var di=Ui(Kt,zt,Zt);if(this.tiles[di])return gt(this.tiles[di],Br);ri>1&&console.log("drilling down to z%d-%d-%d",Kt,zt,Zt);for(var Wi=Kt,oa=zt,ra=Zt,ca;!ca&&Wi>0;)Wi--,oa=Math.floor(oa/2),ra=Math.floor(ra/2),ca=this.tiles[Ui(Wi,oa,ra)];return!ca||!ca.source?null:(ri>1&&console.log("found parent tile z%d-%d-%d",Wi,oa,ra),ri>1&&console.time("drilling down"),this.splitTile(ca.source,Wi,oa,ra,Kt,zt,Zt),ri>1&&console.timeEnd("drilling down"),this.tiles[di]?gt(this.tiles[di],Br):null)};function Ui(Kt,zt,Zt){return((1<<Kt)*Zt+zt)*32+Kt}function Ki(Kt,zt){for(var Zt in zt)Kt[Zt]=zt[Zt];return Kt}function ea(Kt,zt){var Zt=Kt.tileID.canonical;if(!this._geoJSONIndex)return zt(null,null);var Jt=this._geoJSONIndex.getTile(Zt.z,Zt.x,Zt.y);if(!Jt)return zt(null,null);var Br=new b(Jt.features),ri=R(Br);(ri.byteOffset!==0||ri.byteLength!==ri.buffer.byteLength)&&(ri=new Uint8Array(ri)),zt(null,{vectorTile:Br,rawData:ri.buffer})}var Bi=function(Kt){function zt(Zt,Jt,Br,ri){Kt.call(this,Zt,Jt,Br,ea),ri&&(this.loadGeoJSON=ri)}return Kt&&(zt.__proto__=Kt),zt.prototype=Object.create(Kt&&Kt.prototype),zt.prototype.constructor=zt,zt.prototype.loadData=function(Jt,Br){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=Br,this._pendingLoadDataParams=Jt,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},zt.prototype._loadData=function(){var Jt=this;if(!(!this._pendingCallback||!this._pendingLoadDataParams)){var Br=this._pendingCallback,ri=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var ii=ri&&ri.request&&ri.request.collectResourceTiming?new e.RequestPerformance(ri.request):!1;this.loadGeoJSON(ri,function(di,Wi){if(di||!Wi)return Br(di);if(typeof Wi!="object")return Br(new Error("Input data given to '"+ri.source+"' is not a valid GeoJSON object."));l(Wi,!0);try{if(ri.filter){var oa=e.createExpression(ri.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(oa.result==="error")throw new Error(oa.value.map(function(ji){return ji.key+": "+ji.message}).join(", "));var ra=Wi.features.filter(function(ji){return oa.value.evaluate({zoom:0},ji)});Wi={type:"FeatureCollection",features:ra}}Jt._geoJSONIndex=ri.cluster?new we(_a(ri)).load(Wi.features):vi(Wi,ri.geojsonVtOptions)}catch(ji){return Br(ji)}Jt.loaded={};var ca={};if(ii){var xa=ii.finish();xa&&(ca.resourceTiming={},ca.resourceTiming[ri.source]=JSON.parse(JSON.stringify(xa)))}Br(null,ca)})}},zt.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},zt.prototype.reloadTile=function(Jt,Br){var ri=this.loaded,ii=Jt.uid;return ri&&ri[ii]?Kt.prototype.reloadTile.call(this,Jt,Br):this.loadTile(Jt,Br)},zt.prototype.loadGeoJSON=function(Jt,Br){if(Jt.request)e.getJSON(Jt.request,Br);else if(typeof Jt.data=="string")try{return Br(null,JSON.parse(Jt.data))}catch{return Br(new Error("Input data given to '"+Jt.source+"' is not a valid GeoJSON object."))}else return Br(new Error("Input data given to '"+Jt.source+"' is not a valid GeoJSON object."))},zt.prototype.removeSource=function(Jt,Br){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),Br()},zt.prototype.getClusterExpansionZoom=function(Jt,Br){try{Br(null,this._geoJSONIndex.getClusterExpansionZoom(Jt.clusterId))}catch(ri){Br(ri)}},zt.prototype.getClusterChildren=function(Jt,Br){try{Br(null,this._geoJSONIndex.getChildren(Jt.clusterId))}catch(ri){Br(ri)}},zt.prototype.getClusterLeaves=function(Jt,Br){try{Br(null,this._geoJSONIndex.getLeaves(Jt.clusterId,Jt.limit,Jt.offset))}catch(ri){Br(ri)}},zt}(m);function _a(Kt){var zt=Kt.superclusterOptions,Zt=Kt.clusterProperties;if(!Zt||!zt)return zt;for(var Jt={},Br={},ri={accumulated:null,zoom:0},ii={properties:null},di=Object.keys(Zt),Wi=0,oa=di;Wi<oa.length;Wi+=1){var ra=oa[Wi],ca=Zt[ra],xa=ca[0],ji=ca[1],pn=e.createExpression(ji),_n=e.createExpression(typeof xa=="string"?[xa,["accumulated"],["get",ra]]:xa);Jt[ra]=pn.value,Br[ra]=_n.value}return zt.map=function(En){ii.properties=En;for(var bt={},st=0,Nr=di;st<Nr.length;st+=1){var Lr=Nr[st];bt[Lr]=Jt[Lr].evaluate(ri,ii)}return bt},zt.reduce=function(En,bt){ii.properties=bt;for(var st=0,Nr=di;st<Nr.length;st+=1){var Lr=Nr[st];ri.accumulated=En[Lr],En[Lr]=Br[Lr].evaluate(ri,ii)}},zt}var Ca=function(zt){var Zt=this;this.self=zt,this.actor=new e.Actor(zt,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:m,geojson:Bi},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(Jt,Br){if(Zt.workerSourceTypes[Jt])throw new Error('Worker source with name "'+Jt+'" already registered.');Zt.workerSourceTypes[Jt]=Br},this.self.registerRTLTextPlugin=function(Jt){if(e.plugin.isParsed())throw new Error("RTL text plugin already registered.");e.plugin.applyArabicShaping=Jt.applyArabicShaping,e.plugin.processBidirectionalText=Jt.processBidirectionalText,e.plugin.processStyledBidirectionalText=Jt.processStyledBidirectionalText}};return Ca.prototype.setReferrer=function(zt,Zt){this.referrer=Zt},Ca.prototype.setImages=function(zt,Zt,Jt){this.availableImages[zt]=Zt;for(var Br in this.workerSources[zt]){var ri=this.workerSources[zt][Br];for(var ii in ri)ri[ii].availableImages=Zt}Jt()},Ca.prototype.setLayers=function(zt,Zt,Jt){this.getLayerIndex(zt).replace(Zt),Jt()},Ca.prototype.updateLayers=function(zt,Zt,Jt){this.getLayerIndex(zt).update(Zt.layers,Zt.removedIds),Jt()},Ca.prototype.loadTile=function(zt,Zt,Jt){this.getWorkerSource(zt,Zt.type,Zt.source).loadTile(Zt,Jt)},Ca.prototype.loadDEMTile=function(zt,Zt,Jt){this.getDEMWorkerSource(zt,Zt.source).loadTile(Zt,Jt)},Ca.prototype.reloadTile=function(zt,Zt,Jt){this.getWorkerSource(zt,Zt.type,Zt.source).reloadTile(Zt,Jt)},Ca.prototype.abortTile=function(zt,Zt,Jt){this.getWorkerSource(zt,Zt.type,Zt.source).abortTile(Zt,Jt)},Ca.prototype.removeTile=function(zt,Zt,Jt){this.getWorkerSource(zt,Zt.type,Zt.source).removeTile(Zt,Jt)},Ca.prototype.removeDEMTile=function(zt,Zt){this.getDEMWorkerSource(zt,Zt.source).removeTile(Zt)},Ca.prototype.removeSource=function(zt,Zt,Jt){if(!(!this.workerSources[zt]||!this.workerSources[zt][Zt.type]||!this.workerSources[zt][Zt.type][Zt.source])){var Br=this.workerSources[zt][Zt.type][Zt.source];delete this.workerSources[zt][Zt.type][Zt.source],Br.removeSource!==void 0?Br.removeSource(Zt,Jt):Jt()}},Ca.prototype.loadWorkerSource=function(zt,Zt,Jt){try{this.self.importScripts(Zt.url),Jt()}catch(Br){Jt(Br.toString())}},Ca.prototype.syncRTLPluginState=function(zt,Zt,Jt){try{e.plugin.setState(Zt);var Br=e.plugin.getPluginURL();if(e.plugin.isLoaded()&&!e.plugin.isParsed()&&Br!=null){this.self.importScripts(Br);var ri=e.plugin.isParsed(),ii=ri?void 0:new Error("RTL Text Plugin failed to import scripts from "+Br);Jt(ii,ri)}}catch(di){Jt(di.toString())}},Ca.prototype.getAvailableImages=function(zt){var Zt=this.availableImages[zt];return Zt||(Zt=[]),Zt},Ca.prototype.getLayerIndex=function(zt){var Zt=this.layerIndexes[zt];return Zt||(Zt=this.layerIndexes[zt]=new i),Zt},Ca.prototype.getWorkerSource=function(zt,Zt,Jt){var Br=this;if(this.workerSources[zt]||(this.workerSources[zt]={}),this.workerSources[zt][Zt]||(this.workerSources[zt][Zt]={}),!this.workerSources[zt][Zt][Jt]){var ri={send:function(ii,di,Wi){Br.actor.send(ii,di,Wi,zt)}};this.workerSources[zt][Zt][Jt]=new this.workerSourceTypes[Zt](ri,this.getLayerIndex(zt),this.getAvailableImages(zt))}return this.workerSources[zt][Zt][Jt]},Ca.prototype.getDEMWorkerSource=function(zt,Zt){return this.demWorkerSources[zt]||(this.demWorkerSources[zt]={}),this.demWorkerSources[zt][Zt]||(this.demWorkerSources[zt][Zt]=new T),this.demWorkerSources[zt][Zt]},Ca.prototype.enforceCacheSizeLimit=function(zt,Zt){e.enforceCacheSizeLimit(Zt)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Ca(self)),Ca}),E(["./shared"],function(e){"use strict";var t=e.createCommonjsModule(function(ve){ve.exports?ve.exports=K:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=K,window.mapboxgl.notSupportedReason=ge);function K(or){return!ge(or)}function ge(or){if(!te())return"not a browser";if(!pe())return"insufficent Array support";if(!He())return"insufficient Function support";if(!Ce())return"insufficient Object support";if(!Ke())return"insufficient JSON support";if(!pt())return"insufficient worker support";if(!Ut())return"insufficient Uint8ClampedArray support";if(!Tr())return"insufficient ArrayBuffer support";if(!Ur())return"insufficient Canvas/getImageData support";if(!mt(or&&or.failIfMajorPerformanceCaveat))return"insufficient WebGL support"}function te(){return typeof window<"u"&&typeof document<"u"}function pe(){return Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray}function He(){return Function.prototype&&Function.prototype.bind}function Ce(){return Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions}function Ke(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function pt(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var or=new Blob([""],{type:"text/javascript"}),dr=URL.createObjectURL(or),ur,pr;try{pr=new Worker(dr),ur=!0}catch{ur=!1}return pr&&pr.terminate(),URL.revokeObjectURL(dr),ur}function Ut(){return"Uint8ClampedArray"in window}function Tr(){return ArrayBuffer.isView}function Ur(){var or=document.createElement("canvas");or.width=or.height=1;var dr=or.getContext("2d");if(!dr)return!1;var ur=dr.getImageData(0,0,1,1);return ur&&ur.width===or.width}var vr={};function mt(or){return vr[or]===void 0&&(vr[or]=Bt(or)),vr[or]}K.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};function Et(or){var dr=document.createElement("canvas"),ur=Object.create(K.webGLContextAttributes);return ur.failIfMajorPerformanceCaveat=or,dr.probablySupportsContext?dr.probablySupportsContext("webgl",ur)||dr.probablySupportsContext("experimental-webgl",ur):dr.supportsContext?dr.supportsContext("webgl",ur)||dr.supportsContext("experimental-webgl",ur):dr.getContext("webgl",ur)||dr.getContext("experimental-webgl",ur)}function Bt(or){var dr=Et(or);if(!dr)return!1;var ur=dr.createShader(dr.VERTEX_SHADER);return!ur||dr.isContextLost()?!1:(dr.shaderSource(ur,"void main() {}"),dr.compileShader(ur),dr.getShaderParameter(ur,dr.COMPILE_STATUS)===!0)}}),r={};r.create=function(ve,K,ge){var te=e.window.document.createElement(ve);return K!==void 0&&(te.className=K),ge&&ge.appendChild(te),te},r.createNS=function(ve,K){var ge=e.window.document.createElementNS(ve,K);return ge};var o=e.window.document&&e.window.document.documentElement.style;function i(ve){if(!o)return ve[0];for(var K=0;K<ve.length;K++)if(ve[K]in o)return ve[K];return ve[0]}var n=i(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),a;r.disableDrag=function(){o&&n&&(a=o[n],o[n]="none")},r.enableDrag=function(){o&&n&&(o[n]=a)};var s=i(["transform","WebkitTransform"]);r.setTransform=function(ve,K){ve.style[s]=K};var h=!1;try{var c=Object.defineProperty({},"passive",{get:function(){h=!0}});e.window.addEventListener("test",c,c),e.window.removeEventListener("test",c,c)}catch{h=!1}r.addEventListener=function(ve,K,ge,te){te===void 0&&(te={}),"passive"in te&&h?ve.addEventListener(K,ge,te):ve.addEventListener(K,ge,te.capture)},r.removeEventListener=function(ve,K,ge,te){te===void 0&&(te={}),"passive"in te&&h?ve.removeEventListener(K,ge,te):ve.removeEventListener(K,ge,te.capture)};var m=function(ve){ve.preventDefault(),ve.stopPropagation(),e.window.removeEventListener("click",m,!0)};r.suppressClick=function(){e.window.addEventListener("click",m,!0),e.window.setTimeout(function(){e.window.removeEventListener("click",m,!0)},0)},r.mousePos=function(ve,K){var ge=ve.getBoundingClientRect();return new e.Point(K.clientX-ge.left-ve.clientLeft,K.clientY-ge.top-ve.clientTop)},r.touchPos=function(ve,K){for(var ge=ve.getBoundingClientRect(),te=[],pe=0;pe<K.length;pe++)te.push(new e.Point(K[pe].clientX-ge.left-ve.clientLeft,K[pe].clientY-ge.top-ve.clientTop));return te},r.mouseButton=function(ve){return typeof e.window.InstallTrigger<"u"&&ve.button===2&&ve.ctrlKey&&e.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:ve.button},r.remove=function(ve){ve.parentNode&&ve.parentNode.removeChild(ve)};function d(ve,K,ge){var te,pe,He,Ce=e.browser.devicePixelRatio>1?"@2x":"",Ke=e.getJSON(K.transformRequest(K.normalizeSpriteURL(ve,Ce,".json"),e.ResourceType.SpriteJSON),function(Tr,Ur){Ke=null,He||(He=Tr,te=Ur,Ut())}),pt=e.getImage(K.transformRequest(K.normalizeSpriteURL(ve,Ce,".png"),e.ResourceType.SpriteImage),function(Tr,Ur){pt=null,He||(He=Tr,pe=Ur,Ut())});function Ut(){if(He)ge(He);else if(te&&pe){var Tr=e.browser.getImageData(pe),Ur={};for(var vr in te){var mt=te[vr],Et=mt.width,Bt=mt.height,or=mt.x,dr=mt.y,ur=mt.sdf,pr=mt.pixelRatio,cr=mt.stretchX,Gt=mt.stretchY,lr=mt.content,qt=new e.RGBAImage({width:Et,height:Bt});e.RGBAImage.copy(Tr,qt,{x:or,y:dr},{x:0,y:0},{width:Et,height:Bt}),Ur[vr]={data:qt,pixelRatio:pr,sdf:ur,stretchX:cr,stretchY:Gt,content:lr}}ge(null,Ur)}}return{cancel:function(){Ke&&(Ke.cancel(),Ke=null),pt&&(pt.cancel(),pt=null)}}}function T(ve){var K=ve.userImage;if(K&&K.render){var ge=K.render();if(ge)return ve.data.replace(new Uint8Array(K.data.buffer)),!0}return!1}var l=1,_=function(ve){function K(){ve.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.isLoaded=function(){return this.loaded},K.prototype.setLoaded=function(te){if(this.loaded!==te&&(this.loaded=te,te)){for(var pe=0,He=this.requestors;pe<He.length;pe+=1){var Ce=He[pe],Ke=Ce.ids,pt=Ce.callback;this._notify(Ke,pt)}this.requestors=[]}},K.prototype.getImage=function(te){return this.images[te]},K.prototype.addImage=function(te,pe){this._validate(te,pe)&&(this.images[te]=pe)},K.prototype._validate=function(te,pe){var He=!0;return this._validateStretch(pe.stretchX,pe.data&&pe.data.width)||(this.fire(new e.ErrorEvent(new Error('Image "'+te+'" has invalid "stretchX" value'))),He=!1),this._validateStretch(pe.stretchY,pe.data&&pe.data.height)||(this.fire(new e.ErrorEvent(new Error('Image "'+te+'" has invalid "stretchY" value'))),He=!1),this._validateContent(pe.content,pe)||(this.fire(new e.ErrorEvent(new Error('Image "'+te+'" has invalid "content" value'))),He=!1),He},K.prototype._validateStretch=function(te,pe){if(!te)return!0;for(var He=0,Ce=0,Ke=te;Ce<Ke.length;Ce+=1){var pt=Ke[Ce];if(pt[0]<He||pt[1]<pt[0]||pe<pt[1])return!1;He=pt[1]}return!0},K.prototype._validateContent=function(te,pe){return te?!(te.length!==4||te[0]<0||pe.data.width<te[0]||te[1]<0||pe.data.height<te[1]||te[2]<0||pe.data.width<te[2]||te[3]<0||pe.data.height<te[3]||te[2]<te[0]||te[3]<te[1]):!0},K.prototype.updateImage=function(te,pe){var He=this.images[te];pe.version=He.version+1,this.images[te]=pe,this.updatedImages[te]=!0},K.prototype.removeImage=function(te){var pe=this.images[te];delete this.images[te],delete this.patterns[te],pe.userImage&&pe.userImage.onRemove&&pe.userImage.onRemove()},K.prototype.listImages=function(){return Object.keys(this.images)},K.prototype.getImages=function(te,pe){var He=!0;if(!this.isLoaded())for(var Ce=0,Ke=te;Ce<Ke.length;Ce+=1){var pt=Ke[Ce];this.images[pt]||(He=!1)}this.isLoaded()||He?this._notify(te,pe):this.requestors.push({ids:te,callback:pe})},K.prototype._notify=function(te,pe){for(var He={},Ce=0,Ke=te;Ce<Ke.length;Ce+=1){var pt=Ke[Ce];this.images[pt]||this.fire(new e.Event("styleimagemissing",{id:pt}));var Ut=this.images[pt];Ut?He[pt]={data:Ut.data.clone(),pixelRatio:Ut.pixelRatio,sdf:Ut.sdf,version:Ut.version,stretchX:Ut.stretchX,stretchY:Ut.stretchY,content:Ut.content,hasRenderCallback:!!(Ut.userImage&&Ut.userImage.render)}:e.warnOnce('Image "'+pt+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}pe(null,He)},K.prototype.getPixelSize=function(){var te=this.atlasImage,pe=te.width,He=te.height;return{width:pe,height:He}},K.prototype.getPattern=function(te){var pe=this.patterns[te],He=this.getImage(te);if(!He)return null;if(pe&&pe.position.version===He.version)return pe.position;if(pe)pe.position.version=He.version;else{var Ce=He.data.width+l*2,Ke=He.data.height+l*2,pt={w:Ce,h:Ke,x:0,y:0},Ut=new e.ImagePosition(pt,He);this.patterns[te]={bin:pt,position:Ut}}return this._updatePatternAtlas(),this.patterns[te].position},K.prototype.bind=function(te){var pe=te.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new e.Texture(te,this.atlasImage,pe.RGBA),this.atlasTexture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE)},K.prototype._updatePatternAtlas=function(){var te=[];for(var pe in this.patterns)te.push(this.patterns[pe].bin);var He=e.potpack(te),Ce=He.w,Ke=He.h,pt=this.atlasImage;pt.resize({width:Ce||1,height:Ke||1});for(var Ut in this.patterns){var Tr=this.patterns[Ut],Ur=Tr.bin,vr=Ur.x+l,mt=Ur.y+l,Et=this.images[Ut].data,Bt=Et.width,or=Et.height;e.RGBAImage.copy(Et,pt,{x:0,y:0},{x:vr,y:mt},{width:Bt,height:or}),e.RGBAImage.copy(Et,pt,{x:0,y:or-1},{x:vr,y:mt-1},{width:Bt,height:1}),e.RGBAImage.copy(Et,pt,{x:0,y:0},{x:vr,y:mt+or},{width:Bt,height:1}),e.RGBAImage.copy(Et,pt,{x:Bt-1,y:0},{x:vr-1,y:mt},{width:1,height:or}),e.RGBAImage.copy(Et,pt,{x:0,y:0},{x:vr+Bt,y:mt},{width:1,height:or})}this.dirty=!0},K.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},K.prototype.dispatchRenderCallbacks=function(te){for(var pe=0,He=te;pe<He.length;pe+=1){var Ce=He[pe];if(!this.callbackDispatchedThisFrame[Ce]){this.callbackDispatchedThisFrame[Ce]=!0;var Ke=this.images[Ce],pt=T(Ke);pt&&this.updateImage(Ce,Ke)}}},K}(e.Evented);function w(ve,K,ge,te,pe){var He=K*256,Ce=He+255,Ke=te.transformRequest(te.normalizeGlyphsURL(ge).replace("{fontstack}",ve).replace("{range}",He+"-"+Ce),e.ResourceType.Glyphs);e.getArrayBuffer(Ke,function(pt,Ut){if(pt)pe(pt);else if(Ut){for(var Tr={},Ur=0,vr=e.parseGlyphPBF(Ut);Ur<vr.length;Ur+=1){var mt=vr[Ur];Tr[mt.id]=mt}pe(null,Tr)}})}var A=b,M=b,g=1e20;function b(ve,K,ge,te,pe,He){this.fontSize=ve||24,this.buffer=K===void 0?3:K,this.cutoff=te||.25,this.fontFamily=pe||"sans-serif",this.fontWeight=He||"normal",this.radius=ge||8;var Ce=this.size=this.fontSize+this.buffer*2;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=Ce,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(Ce*Ce),this.gridInner=new Float64Array(Ce*Ce),this.f=new Float64Array(Ce),this.d=new Float64Array(Ce),this.z=new Float64Array(Ce+1),this.v=new Int16Array(Ce),this.middle=Math.round(Ce/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}b.prototype.draw=function(ve){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(ve,this.buffer,this.middle);for(var K=this.ctx.getImageData(0,0,this.size,this.size),ge=new Uint8ClampedArray(this.size*this.size),te=0;te<this.size*this.size;te++){var pe=K.data[te*4+3]/255;this.gridOuter[te]=pe===1?0:pe===0?g:Math.pow(Math.max(0,.5-pe),2),this.gridInner[te]=pe===1?g:pe===0?0:Math.pow(Math.max(0,pe-.5),2)}for(v(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),v(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),te=0;te<this.size*this.size;te++){var He=this.gridOuter[te]-this.gridInner[te];ge[te]=Math.max(0,Math.min(255,Math.round(255-255*(He/this.radius+this.cutoff))))}return ge};function v(ve,K,ge,te,pe,He,Ce){for(var Ke=0;Ke<K;Ke++){for(var pt=0;pt<ge;pt++)te[pt]=ve[pt*K+Ke];for(u(te,pe,He,Ce,ge),pt=0;pt<ge;pt++)ve[pt*K+Ke]=pe[pt]}for(pt=0;pt<ge;pt++){for(Ke=0;Ke<K;Ke++)te[Ke]=ve[pt*K+Ke];for(u(te,pe,He,Ce,K),Ke=0;Ke<K;Ke++)ve[pt*K+Ke]=Math.sqrt(pe[Ke])}}function u(ve,K,ge,te,pe){ge[0]=0,te[0]=-g,te[1]=+g;for(var He=1,Ce=0;He<pe;He++){for(var Ke=(ve[He]+He*He-(ve[ge[Ce]]+ge[Ce]*ge[Ce]))/(2*He-2*ge[Ce]);Ke<=te[Ce];)Ce--,Ke=(ve[He]+He*He-(ve[ge[Ce]]+ge[Ce]*ge[Ce]))/(2*He-2*ge[Ce]);Ce++,ge[Ce]=He,te[Ce]=Ke,te[Ce+1]=+g}for(He=0,Ce=0;He<pe;He++){for(;te[Ce+1]<He;)Ce++;K[He]=(He-ge[Ce])*(He-ge[Ce])+ve[ge[Ce]]}}A.default=M;var y=function(K,ge){this.requestManager=K,this.localIdeographFontFamily=ge,this.entries={}};y.prototype.setURL=function(K){this.url=K},y.prototype.getGlyphs=function(K,ge){var te=this,pe=[];for(var He in K)for(var Ce=0,Ke=K[He];Ce<Ke.length;Ce+=1){var pt=Ke[Ce];pe.push({stack:He,id:pt})}e.asyncAll(pe,function(Ut,Tr){var Ur=Ut.stack,vr=Ut.id,mt=te.entries[Ur];mt||(mt=te.entries[Ur]={glyphs:{},requests:{},ranges:{}});var Et=mt.glyphs[vr];if(Et!==void 0){Tr(null,{stack:Ur,id:vr,glyph:Et});return}if(Et=te._tinySDF(mt,Ur,vr),Et){mt.glyphs[vr]=Et,Tr(null,{stack:Ur,id:vr,glyph:Et});return}var Bt=Math.floor(vr/256);if(Bt*256>65535){Tr(new Error("glyphs > 65535 not supported"));return}if(mt.ranges[Bt]){Tr(null,{stack:Ur,id:vr,glyph:Et});return}var or=mt.requests[Bt];or||(or=mt.requests[Bt]=[],y.loadGlyphRange(Ur,Bt,te.url,te.requestManager,function(dr,ur){if(ur){for(var pr in ur)te._doesCharSupportLocalGlyph(+pr)||(mt.glyphs[+pr]=ur[+pr]);mt.ranges[Bt]=!0}for(var cr=0,Gt=or;cr<Gt.length;cr+=1){var lr=Gt[cr];lr(dr,ur)}delete mt.requests[Bt]})),or.push(function(dr,ur){dr?Tr(dr):ur&&Tr(null,{stack:Ur,id:vr,glyph:ur[vr]||null})})},function(Ut,Tr){if(Ut)ge(Ut);else if(Tr){for(var Ur={},vr=0,mt=Tr;vr<mt.length;vr+=1){var Et=mt[vr],Bt=Et.stack,or=Et.id,dr=Et.glyph;(Ur[Bt]||(Ur[Bt]={}))[or]=dr&&{id:dr.id,bitmap:dr.bitmap.clone(),metrics:dr.metrics}}ge(null,Ur)}})},y.prototype._doesCharSupportLocalGlyph=function(K){return!!this.localIdeographFontFamily&&(e.isChar["CJK Unified Ideographs"](K)||e.isChar["Hangul Syllables"](K)||e.isChar.Hiragana(K)||e.isChar.Katakana(K))},y.prototype._tinySDF=function(K,ge,te){var pe=this.localIdeographFontFamily;if(pe&&this._doesCharSupportLocalGlyph(te)){var He=K.tinySDF;if(!He){var Ce="400";/bold/i.test(ge)?Ce="900":/medium/i.test(ge)?Ce="500":/light/i.test(ge)&&(Ce="200"),He=K.tinySDF=new y.TinySDF(24,3,8,.25,pe,Ce)}return{id:te,bitmap:new e.AlphaImage({width:30,height:30},He.draw(String.fromCharCode(te))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},y.loadGlyphRange=w,y.TinySDF=A;var f=function(){this.specification=e.styleSpec.light.position};f.prototype.possiblyEvaluate=function(K,ge){return e.sphericalToCartesian(K.expression.evaluate(ge))},f.prototype.interpolate=function(K,ge,te){return{x:e.number(K.x,ge.x,te),y:e.number(K.y,ge.y,te),z:e.number(K.z,ge.z,te)}};var R=new e.Properties({anchor:new e.DataConstantProperty(e.styleSpec.light.anchor),position:new f,color:new e.DataConstantProperty(e.styleSpec.light.color),intensity:new e.DataConstantProperty(e.styleSpec.light.intensity)}),L="-transition",z=function(ve){function K(ge){ve.call(this),this._transitionable=new e.Transitionable(R),this.setLight(ge),this._transitioning=this._transitionable.untransitioned()}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getLight=function(){return this._transitionable.serialize()},K.prototype.setLight=function(te,pe){if(pe===void 0&&(pe={}),!this._validate(e.validateLight,te,pe))for(var He in te){var Ce=te[He];e.endsWith(He,L)?this._transitionable.setTransition(He.slice(0,-L.length),Ce):this._transitionable.setValue(He,Ce)}},K.prototype.updateTransitions=function(te){this._transitioning=this._transitionable.transitioned(te,this._transitioning)},K.prototype.hasTransition=function(){return this._transitioning.hasTransition()},K.prototype.recalculate=function(te){this.properties=this._transitioning.possiblyEvaluate(te)},K.prototype._validate=function(te,pe,He){return He&&He.validate===!1?!1:e.emitValidationErrors(this,te.call(e.validateStyle,e.extend({value:pe,style:{glyphs:!0,sprite:!0},styleSpec:e.styleSpec})))},K}(e.Evented),F=function(K,ge){this.width=K,this.height=ge,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};F.prototype.getDash=function(K,ge){var te=K.join(",")+String(ge);return this.dashEntry[te]||(this.dashEntry[te]=this.addDash(K,ge)),this.dashEntry[te]},F.prototype.getDashRanges=function(K,ge,te){var pe=K.length%2===1,He=[],Ce=pe?-K[K.length-1]*te:0,Ke=K[0]*te,pt=!0;He.push({left:Ce,right:Ke,isDash:pt,zeroLength:K[0]===0});for(var Ut=K[0],Tr=1;Tr<K.length;Tr++){pt=!pt;var Ur=K[Tr];Ce=Ut*te,Ut+=Ur,Ke=Ut*te,He.push({left:Ce,right:Ke,isDash:pt,zeroLength:Ur===0})}return He},F.prototype.addRoundDash=function(K,ge,te){for(var pe=ge/2,He=-te;He<=te;He++)for(var Ce=this.nextRow+te+He,Ke=this.width*Ce,pt=0,Ut=K[pt],Tr=0;Tr<this.width;Tr++){Tr/Ut.right>1&&(Ut=K[++pt]);var Ur=Math.abs(Tr-Ut.left),vr=Math.abs(Tr-Ut.right),mt=Math.min(Ur,vr),Et=void 0,Bt=He/te*(pe+1);if(Ut.isDash){var or=pe-Math.abs(Bt);Et=Math.sqrt(mt*mt+or*or)}else Et=pe-Math.sqrt(mt*mt+Bt*Bt);this.data[Ke+Tr]=Math.max(0,Math.min(255,Et+128))}},F.prototype.addRegularDash=function(K){for(var ge=K.length-1;ge>=0;--ge){var te=K[ge],pe=K[ge+1];te.zeroLength?K.splice(ge,1):pe&&pe.isDash===te.isDash&&(pe.left=te.left,K.splice(ge,1))}var He=K[0],Ce=K[K.length-1];He.isDash===Ce.isDash&&(He.left=Ce.left-this.width,Ce.right=He.right+this.width);for(var Ke=this.width*this.nextRow,pt=0,Ut=K[pt],Tr=0;Tr<this.width;Tr++){Tr/Ut.right>1&&(Ut=K[++pt]);var Ur=Math.abs(Tr-Ut.left),vr=Math.abs(Tr-Ut.right),mt=Math.min(Ur,vr),Et=Ut.isDash?mt:-mt;this.data[Ke+Tr]=Math.max(0,Math.min(255,Et+128))}},F.prototype.addDash=function(K,ge){var te=ge?7:0,pe=2*te+1;if(this.nextRow+pe>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var He=0,Ce=0;Ce<K.length;Ce++)He+=K[Ce];if(He!==0){var Ke=this.width/He,pt=this.getDashRanges(K,this.width,Ke);ge?this.addRoundDash(pt,Ke,te):this.addRegularDash(pt)}var Ut={y:(this.nextRow+te+.5)/this.height,height:2*te/this.height,width:He};return this.nextRow+=pe,this.dirty=!0,Ut},F.prototype.bind=function(K){var ge=K.gl;this.texture?(ge.bindTexture(ge.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,ge.texSubImage2D(ge.TEXTURE_2D,0,0,0,this.width,this.height,ge.ALPHA,ge.UNSIGNED_BYTE,this.data))):(this.texture=ge.createTexture(),ge.bindTexture(ge.TEXTURE_2D,this.texture),ge.texParameteri(ge.TEXTURE_2D,ge.TEXTURE_WRAP_S,ge.REPEAT),ge.texParameteri(ge.TEXTURE_2D,ge.TEXTURE_WRAP_T,ge.REPEAT),ge.texParameteri(ge.TEXTURE_2D,ge.TEXTURE_MIN_FILTER,ge.LINEAR),ge.texParameteri(ge.TEXTURE_2D,ge.TEXTURE_MAG_FILTER,ge.LINEAR),ge.texImage2D(ge.TEXTURE_2D,0,ge.ALPHA,this.width,this.height,0,ge.ALPHA,ge.UNSIGNED_BYTE,this.data))};var N=function ve(K,ge){this.workerPool=K,this.actors=[],this.currentActor=0,this.id=e.uniqueId();for(var te=this.workerPool.acquire(this.id),pe=0;pe<te.length;pe++){var He=te[pe],Ce=new ve.Actor(He,ge,this.id);Ce.name="Worker "+pe,this.actors.push(Ce)}};N.prototype.broadcast=function(K,ge,te){te=te||function(){},e.asyncAll(this.actors,function(pe,He){pe.send(K,ge,He)},te)},N.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},N.prototype.remove=function(){this.actors.forEach(function(K){K.remove()}),this.actors=[],this.workerPool.release(this.id)},N.Actor=e.Actor;function B(ve,K,ge){var te=function(pe,He){if(pe)return ge(pe);if(He){var Ce=e.pick(e.extend(He,ve),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);He.vector_layers&&(Ce.vectorLayers=He.vector_layers,Ce.vectorLayerIds=Ce.vectorLayers.map(function(Ke){return Ke.id})),Ce.tiles=K.canonicalizeTileset(Ce,ve.url),ge(null,Ce)}};return ve.url?e.getJSON(K.transformRequest(K.normalizeSourceURL(ve.url),e.ResourceType.Source),te):e.browser.frame(function(){return te(null,ve)})}var I=function(K,ge,te){this.bounds=e.LngLatBounds.convert(this.validateBounds(K)),this.minzoom=ge||0,this.maxzoom=te||24};I.prototype.validateBounds=function(K){return!Array.isArray(K)||K.length!==4?[-180,-90,180,90]:[Math.max(-180,K[0]),Math.max(-90,K[1]),Math.min(180,K[2]),Math.min(90,K[3])]},I.prototype.contains=function(K){var ge=Math.pow(2,K.z),te={minX:Math.floor(e.mercatorXfromLng(this.bounds.getWest())*ge),minY:Math.floor(e.mercatorYfromLat(this.bounds.getNorth())*ge),maxX:Math.ceil(e.mercatorXfromLng(this.bounds.getEast())*ge),maxY:Math.ceil(e.mercatorYfromLat(this.bounds.getSouth())*ge)},pe=K.x>=te.minX&&K.x<te.maxX&&K.y>=te.minY&&K.y<te.maxY;return pe};var U=function(ve){function K(ge,te,pe,He){if(ve.call(this),this.id=ge,this.dispatcher=pe,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.extend(this,e.pick(te,["url","scheme","tileSize","promoteId"])),this._options=e.extend({type:"vector"},te),this._collectResourceTiming=te.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(He)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.load=function(){var te=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=B(this._options,this.map._requestManager,function(pe,He){te._tileJSONRequest=null,te._loaded=!0,pe?te.fire(new e.ErrorEvent(pe)):He&&(e.extend(te,He),He.bounds&&(te.tileBounds=new I(He.bounds,te.minzoom,te.maxzoom)),e.postTurnstileEvent(He.tiles,te.map._requestManager._customAccessToken),e.postMapLoadEvent(He.tiles,te.map._getMapId(),te.map._requestManager._skuToken,te.map._requestManager._customAccessToken),te.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),te.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})))})},K.prototype.loaded=function(){return this._loaded},K.prototype.hasTile=function(te){return!this.tileBounds||this.tileBounds.contains(te.canonical)},K.prototype.onAdd=function(te){this.map=te,this.load()},K.prototype.setSourceProperty=function(te){this._tileJSONRequest&&this._tileJSONRequest.cancel(),te();var pe=this.map.style.sourceCaches[this.id];pe.clearTiles(),this.load()},K.prototype.setTiles=function(te){var pe=this;return this.setSourceProperty(function(){pe._options.tiles=te}),this},K.prototype.setUrl=function(te){var pe=this;return this.setSourceProperty(function(){pe.url=te,pe._options.url=te}),this},K.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},K.prototype.serialize=function(){return e.extend({},this._options)},K.prototype.loadTile=function(te,pe){var He=this.map._requestManager.normalizeTileURL(te.tileID.canonical.url(this.tiles,this.scheme)),Ce={request:this.map._requestManager.transformRequest(He,e.ResourceType.Tile),uid:te.uid,tileID:te.tileID,zoom:te.tileID.overscaledZ,tileSize:this.tileSize*te.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Ce.request.collectResourceTiming=this._collectResourceTiming,!te.actor||te.state==="expired"?(te.actor=this.dispatcher.getActor(),te.request=te.actor.send("loadTile",Ce,Ke.bind(this))):te.state==="loading"?te.reloadCallback=pe:te.request=te.actor.send("reloadTile",Ce,Ke.bind(this));function Ke(pt,Ut){if(delete te.request,te.aborted)return pe(null);if(pt&&pt.status!==404)return pe(pt);Ut&&Ut.resourceTiming&&(te.resourceTiming=Ut.resourceTiming),this.map._refreshExpiredTiles&&Ut&&te.setExpiryData(Ut),te.loadVectorData(Ut,this.map.painter),e.cacheEntryPossiblyAdded(this.dispatcher),pe(null),te.reloadCallback&&(this.loadTile(te,te.reloadCallback),te.reloadCallback=null)}},K.prototype.abortTile=function(te){te.request&&(te.request.cancel(),delete te.request),te.actor&&te.actor.send("abortTile",{uid:te.uid,type:this.type,source:this.id},void 0)},K.prototype.unloadTile=function(te){te.unloadVectorData(),te.actor&&te.actor.send("removeTile",{uid:te.uid,type:this.type,source:this.id},void 0)},K.prototype.hasTransition=function(){return!1},K}(e.Evented),O=function(ve){function K(ge,te,pe,He){ve.call(this),this.id=ge,this.dispatcher=pe,this.setEventedParent(He),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.extend({type:"raster"},te),e.extend(this,e.pick(te,["url","scheme","tileSize"]))}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.load=function(){var te=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=B(this._options,this.map._requestManager,function(pe,He){te._tileJSONRequest=null,te._loaded=!0,pe?te.fire(new e.ErrorEvent(pe)):He&&(e.extend(te,He),He.bounds&&(te.tileBounds=new I(He.bounds,te.minzoom,te.maxzoom)),e.postTurnstileEvent(He.tiles),e.postMapLoadEvent(He.tiles,te.map._getMapId(),te.map._requestManager._skuToken),te.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),te.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})))})},K.prototype.loaded=function(){return this._loaded},K.prototype.onAdd=function(te){this.map=te,this.load()},K.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},K.prototype.serialize=function(){return e.extend({},this._options)},K.prototype.hasTile=function(te){return!this.tileBounds||this.tileBounds.contains(te.canonical)},K.prototype.loadTile=function(te,pe){var He=this,Ce=this.map._requestManager.normalizeTileURL(te.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);te.request=e.getImage(this.map._requestManager.transformRequest(Ce,e.ResourceType.Tile),function(Ke,pt){if(delete te.request,te.aborted)te.state="unloaded",pe(null);else if(Ke)te.state="errored",pe(Ke);else if(pt){He.map._refreshExpiredTiles&&te.setExpiryData(pt),delete pt.cacheControl,delete pt.expires;var Ut=He.map.painter.context,Tr=Ut.gl;te.texture=He.map.painter.getTileTexture(pt.width),te.texture?te.texture.update(pt,{useMipmap:!0}):(te.texture=new e.Texture(Ut,pt,Tr.RGBA,{useMipmap:!0}),te.texture.bind(Tr.LINEAR,Tr.CLAMP_TO_EDGE,Tr.LINEAR_MIPMAP_NEAREST),Ut.extTextureFilterAnisotropic&&Tr.texParameterf(Tr.TEXTURE_2D,Ut.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Ut.extTextureFilterAnisotropicMax)),te.state="loaded",e.cacheEntryPossiblyAdded(He.dispatcher),pe(null)}})},K.prototype.abortTile=function(te,pe){te.request&&(te.request.cancel(),delete te.request),pe()},K.prototype.unloadTile=function(te,pe){te.texture&&this.map.painter.saveTileTexture(te.texture),pe()},K.prototype.hasTransition=function(){return!1},K}(e.Evented),X=function(ve){function K(ge,te,pe,He){ve.call(this,ge,te,pe,He),this.type="raster-dem",this.maxzoom=22,this._options=e.extend({type:"raster-dem"},te),this.encoding=te.encoding||"mapbox"}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},K.prototype.loadTile=function(te,pe){var He=this.map._requestManager.normalizeTileURL(te.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);te.request=e.getImage(this.map._requestManager.transformRequest(He,e.ResourceType.Tile),Ce.bind(this)),te.neighboringTiles=this._getNeighboringTiles(te.tileID);function Ce(pt,Ut){if(delete te.request,te.aborted)te.state="unloaded",pe(null);else if(pt)te.state="errored",pe(pt);else if(Ut){this.map._refreshExpiredTiles&&te.setExpiryData(Ut),delete Ut.cacheControl,delete Ut.expires;var Tr=e.window.ImageBitmap&&Ut instanceof e.window.ImageBitmap&&e.offscreenCanvasSupported(),Ur=Tr?Ut:e.browser.getImageData(Ut,1),vr={uid:te.uid,coord:te.tileID,source:this.id,rawImageData:Ur,encoding:this.encoding};(!te.actor||te.state==="expired")&&(te.actor=this.dispatcher.getActor(),te.actor.send("loadDEMTile",vr,Ke.bind(this)))}}function Ke(pt,Ut){pt&&(te.state="errored",pe(pt)),Ut&&(te.dem=Ut,te.needsHillshadePrepare=!0,te.state="loaded",pe(null))}},K.prototype._getNeighboringTiles=function(te){var pe=te.canonical,He=Math.pow(2,pe.z),Ce=(pe.x-1+He)%He,Ke=pe.x===0?te.wrap-1:te.wrap,pt=(pe.x+1+He)%He,Ut=pe.x+1===He?te.wrap+1:te.wrap,Tr={};return Tr[new e.OverscaledTileID(te.overscaledZ,Ke,pe.z,Ce,pe.y).key]={backfilled:!1},Tr[new e.OverscaledTileID(te.overscaledZ,Ut,pe.z,pt,pe.y).key]={backfilled:!1},pe.y>0&&(Tr[new e.OverscaledTileID(te.overscaledZ,Ke,pe.z,Ce,pe.y-1).key]={backfilled:!1},Tr[new e.OverscaledTileID(te.overscaledZ,te.wrap,pe.z,pe.x,pe.y-1).key]={backfilled:!1},Tr[new e.OverscaledTileID(te.overscaledZ,Ut,pe.z,pt,pe.y-1).key]={backfilled:!1}),pe.y+1<He&&(Tr[new e.OverscaledTileID(te.overscaledZ,Ke,pe.z,Ce,pe.y+1).key]={backfilled:!1},Tr[new e.OverscaledTileID(te.overscaledZ,te.wrap,pe.z,pe.x,pe.y+1).key]={backfilled:!1},Tr[new e.OverscaledTileID(te.overscaledZ,Ut,pe.z,pt,pe.y+1).key]={backfilled:!1}),Tr},K.prototype.unloadTile=function(te){te.demTexture&&this.map.painter.saveTileTexture(te.demTexture),te.fbo&&(te.fbo.destroy(),delete te.fbo),te.dem&&delete te.dem,delete te.neighboringTiles,te.state="unloaded",te.actor&&te.actor.send("removeDEMTile",{uid:te.uid,source:this.id})},K}(O),J=function(ve){function K(ge,te,pe,He){ve.call(this),this.id=ge,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=pe.getActor(),this.setEventedParent(He),this._data=te.data,this._options=e.extend({},te),this._collectResourceTiming=te.collectResourceTiming,this._resourceTiming=[],te.maxzoom!==void 0&&(this.maxzoom=te.maxzoom),te.type&&(this.type=te.type),te.attribution&&(this.attribution=te.attribution),this.promoteId=te.promoteId;var Ce=e.EXTENT/this.tileSize;this.workerOptions=e.extend({source:this.id,cluster:te.cluster||!1,geojsonVtOptions:{buffer:(te.buffer!==void 0?te.buffer:128)*Ce,tolerance:(te.tolerance!==void 0?te.tolerance:.375)*Ce,extent:e.EXTENT,maxZoom:this.maxzoom,lineMetrics:te.lineMetrics||!1,generateId:te.generateId||!1},superclusterOptions:{maxZoom:te.clusterMaxZoom!==void 0?Math.min(te.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,te.clusterMinPoints||2),extent:e.EXTENT,radius:(te.clusterRadius||50)*Ce,log:!1,generateId:te.generateId||!1},clusterProperties:te.clusterProperties,filter:te.filter},te.workerOptions)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.load=function(){var te=this;this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(pe){if(pe){te.fire(new e.ErrorEvent(pe));return}var He={dataType:"source",sourceDataType:"metadata"};te._collectResourceTiming&&te._resourceTiming&&te._resourceTiming.length>0&&(He.resourceTiming=te._resourceTiming,te._resourceTiming=[]),te.fire(new e.Event("data",He))})},K.prototype.onAdd=function(te){this.map=te,this.load()},K.prototype.setData=function(te){var pe=this;return this._data=te,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(He){if(He){pe.fire(new e.ErrorEvent(He));return}var Ce={dataType:"source",sourceDataType:"content"};pe._collectResourceTiming&&pe._resourceTiming&&pe._resourceTiming.length>0&&(Ce.resourceTiming=pe._resourceTiming,pe._resourceTiming=[]),pe.fire(new e.Event("data",Ce))}),this},K.prototype.getClusterExpansionZoom=function(te,pe){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:te,source:this.id},pe),this},K.prototype.getClusterChildren=function(te,pe){return this.actor.send("geojson.getClusterChildren",{clusterId:te,source:this.id},pe),this},K.prototype.getClusterLeaves=function(te,pe,He,Ce){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:te,limit:pe,offset:He},Ce),this},K.prototype._updateWorkerData=function(te){var pe=this;this._loaded=!1;var He=e.extend({},this.workerOptions),Ce=this._data;typeof Ce=="string"?(He.request=this.map._requestManager.transformRequest(e.browser.resolveURL(Ce),e.ResourceType.Source),He.request.collectResourceTiming=this._collectResourceTiming):He.data=JSON.stringify(Ce),this.actor.send(this.type+".loadData",He,function(Ke,pt){pe._removed||pt&&pt.abandoned||(pe._loaded=!0,pt&&pt.resourceTiming&&pt.resourceTiming[pe.id]&&(pe._resourceTiming=pt.resourceTiming[pe.id].slice(0)),pe.actor.send(pe.type+".coalesce",{source:He.source},null),te(Ke))})},K.prototype.loaded=function(){return this._loaded},K.prototype.loadTile=function(te,pe){var He=this,Ce=te.actor?"reloadTile":"loadTile";te.actor=this.actor;var Ke={type:this.type,uid:te.uid,tileID:te.tileID,zoom:te.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};te.request=this.actor.send(Ce,Ke,function(pt,Ut){return delete te.request,te.unloadVectorData(),te.aborted?pe(null):pt?pe(pt):(te.loadVectorData(Ut,He.map.painter,Ce==="reloadTile"),pe(null))})},K.prototype.abortTile=function(te){te.request&&(te.request.cancel(),delete te.request),te.aborted=!0},K.prototype.unloadTile=function(te){te.unloadVectorData(),this.actor.send("removeTile",{uid:te.uid,type:this.type,source:this.id})},K.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},K.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},K.prototype.hasTransition=function(){return!1},K}(e.Evented),se=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),le=function(ve){function K(ge,te,pe,He){ve.call(this),this.id=ge,this.dispatcher=pe,this.coordinates=te.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(He),this.options=te}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.load=function(te,pe){var He=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),function(Ce,Ke){He._loaded=!0,Ce?He.fire(new e.ErrorEvent(Ce)):Ke&&(He.image=Ke,te&&(He.coordinates=te),pe&&pe(),He._finishLoading())})},K.prototype.loaded=function(){return this._loaded},K.prototype.updateImage=function(te){var pe=this;return!this.image||!te.url?this:(this.options.url=te.url,this.load(te.coordinates,function(){pe.texture=null}),this)},K.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},K.prototype.onAdd=function(te){this.map=te,this.load()},K.prototype.setCoordinates=function(te){var pe=this;this.coordinates=te;var He=te.map(e.MercatorCoordinate.fromLngLat);this.tileID=ce(He),this.minzoom=this.maxzoom=this.tileID.z;var Ce=He.map(function(Ke){return pe.tileID.getTilePoint(Ke)._round()});return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(Ce[0].x,Ce[0].y,0,0),this._boundsArray.emplaceBack(Ce[1].x,Ce[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(Ce[3].x,Ce[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(Ce[2].x,Ce[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this},K.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var te=this.map.painter.context,pe=te.gl;this.boundsBuffer||(this.boundsBuffer=te.createVertexBuffer(this._boundsArray,se.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(te,this.image,pe.RGBA),this.texture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE));for(var He in this.tiles){var Ce=this.tiles[He];Ce.state!=="loaded"&&(Ce.state="loaded",Ce.texture=this.texture)}}},K.prototype.loadTile=function(te,pe){this.tileID&&this.tileID.equals(te.tileID.canonical)?(this.tiles[String(te.tileID.wrap)]=te,te.buckets={},pe(null)):(te.state="errored",pe(null))},K.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},K.prototype.hasTransition=function(){return!1},K}(e.Evented);function ce(ve){for(var K=1/0,ge=1/0,te=-1/0,pe=-1/0,He=0,Ce=ve;He<Ce.length;He+=1){var Ke=Ce[He];K=Math.min(K,Ke.x),ge=Math.min(ge,Ke.y),te=Math.max(te,Ke.x),pe=Math.max(pe,Ke.y)}var pt=te-K,Ut=pe-ge,Tr=Math.max(pt,Ut),Ur=Math.max(0,Math.floor(-Math.log(Tr)/Math.LN2)),vr=Math.pow(2,Ur);return new e.CanonicalTileID(Ur,Math.floor((K+te)/2*vr),Math.floor((ge+pe)/2*vr))}var q=function(ve){function K(ge,te,pe,He){ve.call(this,ge,te,pe,He),this.roundZoom=!0,this.type="video",this.options=te}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.load=function(){var te=this;this._loaded=!1;var pe=this.options;this.urls=[];for(var He=0,Ce=pe.urls;He<Ce.length;He+=1){var Ke=Ce[He];this.urls.push(this.map._requestManager.transformRequest(Ke,e.ResourceType.Source).url)}e.getVideo(this.urls,function(pt,Ut){te._loaded=!0,pt?te.fire(new e.ErrorEvent(pt)):Ut&&(te.video=Ut,te.video.loop=!0,te.video.addEventListener("playing",function(){te.map.triggerRepaint()}),te.map&&te.video.play(),te._finishLoading())})},K.prototype.pause=function(){this.video&&this.video.pause()},K.prototype.play=function(){this.video&&this.video.play()},K.prototype.seek=function(te){if(this.video){var pe=this.video.seekable;te<pe.start(0)||te>pe.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+pe.start(0)+" and "+pe.end(0)+"-second mark."))):this.video.currentTime=te}},K.prototype.getVideo=function(){return this.video},K.prototype.onAdd=function(te){this.map||(this.map=te,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},K.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var te=this.map.painter.context,pe=te.gl;this.boundsBuffer||(this.boundsBuffer=te.createVertexBuffer(this._boundsArray,se.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE),pe.texSubImage2D(pe.TEXTURE_2D,0,0,0,pe.RGBA,pe.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(te,this.video,pe.RGBA),this.texture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE));for(var He in this.tiles){var Ce=this.tiles[He];Ce.state!=="loaded"&&(Ce.state="loaded",Ce.texture=this.texture)}}},K.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},K.prototype.hasTransition=function(){return this.video&&!this.video.paused},K}(le),Z=function(ve){function K(ge,te,pe,He){ve.call(this,ge,te,pe,He),te.coordinates?(!Array.isArray(te.coordinates)||te.coordinates.length!==4||te.coordinates.some(function(Ce){return!Array.isArray(Ce)||Ce.length!==2||Ce.some(function(Ke){return typeof Ke!="number"})}))&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+ge,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+ge,null,'missing required property "coordinates"'))),te.animate&&typeof te.animate!="boolean"&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+ge,null,'optional "animate" property must be a boolean value'))),te.canvas?typeof te.canvas!="string"&&!(te.canvas instanceof e.window.HTMLCanvasElement)&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+ge,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 e.ErrorEvent(new e.ValidationError("sources."+ge,null,'missing required property "canvas"'))),this.options=te,this.animate=te.animate!==void 0?te.animate:!0}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},K.prototype.getCanvas=function(){return this.canvas},K.prototype.onAdd=function(te){this.map=te,this.load(),this.canvas&&this.animate&&this.play()},K.prototype.onRemove=function(){this.pause()},K.prototype.prepare=function(){var te=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,te=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,te=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var pe=this.map.painter.context,He=pe.gl;this.boundsBuffer||(this.boundsBuffer=pe.createVertexBuffer(this._boundsArray,se.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(te||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(pe,this.canvas,He.RGBA,{premultiply:!0});for(var Ce in this.tiles){var Ke=this.tiles[Ce];Ke.state!=="loaded"&&(Ke.state="loaded",Ke.texture=this.texture)}}},K.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},K.prototype.hasTransition=function(){return this._playing},K.prototype._hasInvalidDimensions=function(){for(var te=0,pe=[this.canvas.width,this.canvas.height];te<pe.length;te+=1){var He=pe[te];if(isNaN(He)||He<=0)return!0}return!1},K}(le),ee={vector:U,raster:O,"raster-dem":X,geojson:J,video:q,image:le,canvas:Z},V=function(ve,K,ge,te){var pe=new ee[K.type](ve,K,ge,te);if(pe.id!==ve)throw new Error("Expected Source id to be "+ve+" instead of "+pe.id);return e.bindAll(["load","abort","unload","serialize","prepare"],pe),pe},oe=function(ve){return ee[ve]},ie=function(ve,K){ee[ve]=K};function j(ve,K){var ge=e.identity([]);return e.translate(ge,ge,[1,1,0]),e.scale(ge,ge,[ve.width*.5,ve.height*.5,1]),e.multiply(ge,ge,ve.calculatePosMatrix(K.toUnwrapped()))}function Q(ve,K,ge){if(ve)for(var te=0,pe=ve;te<pe.length;te+=1){var He=pe[te],Ce=K[He];if(Ce&&Ce.source===ge&&Ce.type==="fill-extrusion")return!0}else for(var Ke in K){var pt=K[Ke];if(pt.source===ge&&pt.type==="fill-extrusion")return!0}return!1}function re(ve,K,ge,te,pe,He){var Ce=Q(pe&&pe.layers,K,ve.id),Ke=He.maxPitchScaleFactor(),pt=ve.tilesIn(te,Ke,Ce);pt.sort(we);for(var Ut=[],Tr=0,Ur=pt;Tr<Ur.length;Tr+=1){var vr=Ur[Tr];Ut.push({wrappedTileID:vr.tileID.wrapped().key,queryResults:vr.tile.queryRenderedFeatures(K,ge,ve._state,vr.queryGeometry,vr.cameraQueryGeometry,vr.scale,pe,He,Ke,j(ve.transform,vr.tileID))})}var mt=Re(Ut);for(var Et in mt)mt[Et].forEach(function(Bt){var or=Bt.feature,dr=ve.getFeatureState(or.layer["source-layer"],or.id);or.source=or.layer.source,or.layer["source-layer"]&&(or.sourceLayer=or.layer["source-layer"]),or.state=dr});return mt}function ue(ve,K,ge,te,pe,He,Ce){for(var Ke={},pt=He.queryRenderedSymbols(te),Ut=[],Tr=0,Ur=Object.keys(pt).map(Number);Tr<Ur.length;Tr+=1){var vr=Ur[Tr];Ut.push(Ce[vr])}Ut.sort(we);for(var mt=function(){var ur=Bt[Et],pr=ur.featureIndex.lookupSymbolFeatures(pt[ur.bucketInstanceId],K,ur.bucketIndex,ur.sourceLayerIndex,pe.filter,pe.layers,pe.availableImages,ve);for(var cr in pr){var Gt=Ke[cr]=Ke[cr]||[],lr=pr[cr];lr.sort(function(Ai,wa){var Ji=ur.featureSortOrder;if(Ji){var fa=Ji.indexOf(Ai.featureIndex),sn=Ji.indexOf(wa.featureIndex);return sn-fa}else return wa.featureIndex-Ai.featureIndex});for(var qt=0,zr=lr;qt<zr.length;qt+=1){var $r=zr[qt];Gt.push($r)}}},Et=0,Bt=Ut;Et<Bt.length;Et+=1)mt();var or=function(ur){Ke[ur].forEach(function(pr){var cr=pr.feature,Gt=ve[ur],lr=ge[Gt.source],qt=lr.getFeatureState(cr.layer["source-layer"],cr.id);cr.source=cr.layer.source,cr.layer["source-layer"]&&(cr.sourceLayer=cr.layer["source-layer"]),cr.state=qt})};for(var dr in Ke)or(dr);return Ke}function _e(ve,K){for(var ge=ve.getRenderableIds().map(function(pt){return ve.getTileByID(pt)}),te=[],pe={},He=0;He<ge.length;He++){var Ce=ge[He],Ke=Ce.tileID.canonical.key;pe[Ke]||(pe[Ke]=!0,Ce.querySourceFeatures(te,K))}return te}function we(ve,K){var ge=ve.tileID,te=K.tileID;return ge.overscaledZ-te.overscaledZ||ge.canonical.y-te.canonical.y||ge.wrap-te.wrap||ge.canonical.x-te.canonical.x}function Re(ve){for(var K={},ge={},te=0,pe=ve;te<pe.length;te+=1){var He=pe[te],Ce=He.queryResults,Ke=He.wrappedTileID,pt=ge[Ke]=ge[Ke]||{};for(var Ut in Ce)for(var Tr=Ce[Ut],Ur=pt[Ut]=pt[Ut]||{},vr=K[Ut]=K[Ut]||[],mt=0,Et=Tr;mt<Et.length;mt+=1){var Bt=Et[mt];Ur[Bt.featureIndex]||(Ur[Bt.featureIndex]=!0,vr.push(Bt))}}return K}var ze=function(K,ge){this.max=K,this.onRemove=ge,this.reset()};ze.prototype.reset=function(){for(var K in this.data)for(var ge=0,te=this.data[K];ge<te.length;ge+=1){var pe=te[ge];pe.timeout&&clearTimeout(pe.timeout),this.onRemove(pe.value)}return this.data={},this.order=[],this},ze.prototype.add=function(K,ge,te){var pe=this,He=K.wrapped().key;this.data[He]===void 0&&(this.data[He]=[]);var Ce={value:ge,timeout:void 0};if(te!==void 0&&(Ce.timeout=setTimeout(function(){pe.remove(K,Ce)},te)),this.data[He].push(Ce),this.order.push(He),this.order.length>this.max){var Ke=this._getAndRemoveByKey(this.order[0]);Ke&&this.onRemove(Ke)}return this},ze.prototype.has=function(K){return K.wrapped().key in this.data},ze.prototype.getAndRemove=function(K){return this.has(K)?this._getAndRemoveByKey(K.wrapped().key):null},ze.prototype._getAndRemoveByKey=function(K){var ge=this.data[K].shift();return ge.timeout&&clearTimeout(ge.timeout),this.data[K].length===0&&delete this.data[K],this.order.splice(this.order.indexOf(K),1),ge.value},ze.prototype.getByKey=function(K){var ge=this.data[K];return ge?ge[0].value:null},ze.prototype.get=function(K){if(!this.has(K))return null;var ge=this.data[K.wrapped().key][0];return ge.value},ze.prototype.remove=function(K,ge){if(!this.has(K))return this;var te=K.wrapped().key,pe=ge===void 0?0:this.data[te].indexOf(ge),He=this.data[te][pe];return this.data[te].splice(pe,1),He.timeout&&clearTimeout(He.timeout),this.data[te].length===0&&delete this.data[te],this.onRemove(He.value),this.order.splice(this.order.indexOf(te),1),this},ze.prototype.setMaxSize=function(K){for(this.max=K;this.order.length>this.max;){var ge=this._getAndRemoveByKey(this.order[0]);ge&&this.onRemove(ge)}return this},ze.prototype.filter=function(K){var ge=[];for(var te in this.data)for(var pe=0,He=this.data[te];pe<He.length;pe+=1){var Ce=He[pe];K(Ce.value)||ge.push(Ce)}for(var Ke=0,pt=ge;Ke<pt.length;Ke+=1){var Ut=pt[Ke];this.remove(Ut.value.tileID,Ut)}};var Xe=function(K,ge,te){this.context=K;var pe=K.gl;this.buffer=pe.createBuffer(),this.dynamicDraw=!!te,this.context.unbindVAO(),K.bindElementBuffer.set(this.buffer),pe.bufferData(pe.ELEMENT_ARRAY_BUFFER,ge.arrayBuffer,this.dynamicDraw?pe.DYNAMIC_DRAW:pe.STATIC_DRAW),this.dynamicDraw||delete ge.arrayBuffer};Xe.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Xe.prototype.updateData=function(K){var ge=this.context.gl;this.context.unbindVAO(),this.bind(),ge.bufferSubData(ge.ELEMENT_ARRAY_BUFFER,0,K.arrayBuffer)},Xe.prototype.destroy=function(){var K=this.context.gl;this.buffer&&(K.deleteBuffer(this.buffer),delete this.buffer)};var tt={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},it=function(K,ge,te,pe){this.length=ge.length,this.attributes=te,this.itemSize=ge.bytesPerElement,this.dynamicDraw=pe,this.context=K;var He=K.gl;this.buffer=He.createBuffer(),K.bindVertexBuffer.set(this.buffer),He.bufferData(He.ARRAY_BUFFER,ge.arrayBuffer,this.dynamicDraw?He.DYNAMIC_DRAW:He.STATIC_DRAW),this.dynamicDraw||delete ge.arrayBuffer};it.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},it.prototype.updateData=function(K){var ge=this.context.gl;this.bind(),ge.bufferSubData(ge.ARRAY_BUFFER,0,K.arrayBuffer)},it.prototype.enableAttributes=function(K,ge){for(var te=0;te<this.attributes.length;te++){var pe=this.attributes[te],He=ge.attributes[pe.name];He!==void 0&&K.enableVertexAttribArray(He)}},it.prototype.setVertexAttribPointers=function(K,ge,te){for(var pe=0;pe<this.attributes.length;pe++){var He=this.attributes[pe],Ce=ge.attributes[He.name];Ce!==void 0&&K.vertexAttribPointer(Ce,He.components,K[tt[He.type]],!1,this.itemSize,He.offset+this.itemSize*(te||0))}},it.prototype.destroy=function(){var K=this.context.gl;this.buffer&&(K.deleteBuffer(this.buffer),delete this.buffer)};var et=function(K){this.gl=K.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};et.prototype.get=function(){return this.current},et.prototype.set=function(K){},et.prototype.getDefault=function(){return this.default},et.prototype.setDefault=function(){this.set(this.default)};var nt=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return e.Color.transparent},K.prototype.set=function(te){var pe=this.current;te.r===pe.r&&te.g===pe.g&&te.b===pe.b&&te.a===pe.a&&!this.dirty||(this.gl.clearColor(te.r,te.g,te.b,te.a),this.current=te,this.dirty=!1)},K}(et),Ae=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return 1},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.clearDepth(te),this.current=te,this.dirty=!1)},K}(et),me=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return 0},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.clearStencil(te),this.current=te,this.dirty=!1)},K}(et),fe=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return[!0,!0,!0,!0]},K.prototype.set=function(te){var pe=this.current;te[0]===pe[0]&&te[1]===pe[1]&&te[2]===pe[2]&&te[3]===pe[3]&&!this.dirty||(this.gl.colorMask(te[0],te[1],te[2],te[3]),this.current=te,this.dirty=!1)},K}(et),Be=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return!0},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.depthMask(te),this.current=te,this.dirty=!1)},K}(et),Qe=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return 255},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.stencilMask(te),this.current=te,this.dirty=!1)},K}(et),at=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},K.prototype.set=function(te){var pe=this.current;te.func===pe.func&&te.ref===pe.ref&&te.mask===pe.mask&&!this.dirty||(this.gl.stencilFunc(te.func,te.ref,te.mask),this.current=te,this.dirty=!1)},K}(et),$e=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){var te=this.gl;return[te.KEEP,te.KEEP,te.KEEP]},K.prototype.set=function(te){var pe=this.current;te[0]===pe[0]&&te[1]===pe[1]&&te[2]===pe[2]&&!this.dirty||(this.gl.stencilOp(te[0],te[1],te[2]),this.current=te,this.dirty=!1)},K}(et),It=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return!1},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var pe=this.gl;te?pe.enable(pe.STENCIL_TEST):pe.disable(pe.STENCIL_TEST),this.current=te,this.dirty=!1}},K}(et),Pt=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return[0,1]},K.prototype.set=function(te){var pe=this.current;te[0]===pe[0]&&te[1]===pe[1]&&!this.dirty||(this.gl.depthRange(te[0],te[1]),this.current=te,this.dirty=!1)},K}(et),Vt=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return!1},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var pe=this.gl;te?pe.enable(pe.DEPTH_TEST):pe.disable(pe.DEPTH_TEST),this.current=te,this.dirty=!1}},K}(et),Wt=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return this.gl.LESS},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.depthFunc(te),this.current=te,this.dirty=!1)},K}(et),Cr=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return!1},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var pe=this.gl;te?pe.enable(pe.BLEND):pe.disable(pe.BLEND),this.current=te,this.dirty=!1}},K}(et),yr=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){var te=this.gl;return[te.ONE,te.ZERO]},K.prototype.set=function(te){var pe=this.current;te[0]===pe[0]&&te[1]===pe[1]&&!this.dirty||(this.gl.blendFunc(te[0],te[1]),this.current=te,this.dirty=!1)},K}(et),qr=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return e.Color.transparent},K.prototype.set=function(te){var pe=this.current;te.r===pe.r&&te.g===pe.g&&te.b===pe.b&&te.a===pe.a&&!this.dirty||(this.gl.blendColor(te.r,te.g,te.b,te.a),this.current=te,this.dirty=!1)},K}(et),Mr=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return this.gl.FUNC_ADD},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.blendEquation(te),this.current=te,this.dirty=!1)},K}(et),Dr=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return!1},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var pe=this.gl;te?pe.enable(pe.CULL_FACE):pe.disable(pe.CULL_FACE),this.current=te,this.dirty=!1}},K}(et),xt=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return this.gl.BACK},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.cullFace(te),this.current=te,this.dirty=!1)},K}(et),Ne=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return this.gl.CCW},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.frontFace(te),this.current=te,this.dirty=!1)},K}(et),Ye=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return null},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.useProgram(te),this.current=te,this.dirty=!1)},K}(et),be=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return this.gl.TEXTURE0},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.activeTexture(te),this.current=te,this.dirty=!1)},K}(et),Ie=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){var te=this.gl;return[0,0,te.drawingBufferWidth,te.drawingBufferHeight]},K.prototype.set=function(te){var pe=this.current;te[0]===pe[0]&&te[1]===pe[1]&&te[2]===pe[2]&&te[3]===pe[3]&&!this.dirty||(this.gl.viewport(te[0],te[1],te[2],te[3]),this.current=te,this.dirty=!1)},K}(et),qe=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return null},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var pe=this.gl;pe.bindFramebuffer(pe.FRAMEBUFFER,te),this.current=te,this.dirty=!1}},K}(et),ke=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return null},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var pe=this.gl;pe.bindRenderbuffer(pe.RENDERBUFFER,te),this.current=te,this.dirty=!1}},K}(et),Me=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return null},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var pe=this.gl;pe.bindTexture(pe.TEXTURE_2D,te),this.current=te,this.dirty=!1}},K}(et),Le=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return null},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var pe=this.gl;pe.bindBuffer(pe.ARRAY_BUFFER,te),this.current=te,this.dirty=!1}},K}(et),ut=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return null},K.prototype.set=function(te){var pe=this.gl;pe.bindBuffer(pe.ELEMENT_ARRAY_BUFFER,te),this.current=te,this.dirty=!1},K}(et),lt=function(ve){function K(ge){ve.call(this,ge),this.vao=ge.extVertexArrayObject}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return null},K.prototype.set=function(te){!this.vao||te===this.current&&!this.dirty||(this.vao.bindVertexArrayOES(te),this.current=te,this.dirty=!1)},K}(et),gt=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return 4},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var pe=this.gl;pe.pixelStorei(pe.UNPACK_ALIGNMENT,te),this.current=te,this.dirty=!1}},K}(et),kt=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return!1},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var pe=this.gl;pe.pixelStorei(pe.UNPACK_PREMULTIPLY_ALPHA_WEBGL,te),this.current=te,this.dirty=!1}},K}(et),nr=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return!1},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var pe=this.gl;pe.pixelStorei(pe.UNPACK_FLIP_Y_WEBGL,te),this.current=te,this.dirty=!1}},K}(et),ir=function(ve){function K(ge,te){ve.call(this,ge),this.context=ge,this.parent=te}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return null},K}(et),tr=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.setDirty=function(){this.dirty=!0},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){this.context.bindFramebuffer.set(this.parent);var pe=this.gl;pe.framebufferTexture2D(pe.FRAMEBUFFER,pe.COLOR_ATTACHMENT0,pe.TEXTURE_2D,te,0),this.current=te,this.dirty=!1}},K}(ir),Ir=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){this.context.bindFramebuffer.set(this.parent);var pe=this.gl;pe.framebufferRenderbuffer(pe.FRAMEBUFFER,pe.DEPTH_ATTACHMENT,pe.RENDERBUFFER,te),this.current=te,this.dirty=!1}},K}(ir),vi=function(K,ge,te,pe){this.context=K,this.width=ge,this.height=te;var He=K.gl,Ce=this.framebuffer=He.createFramebuffer();this.colorAttachment=new tr(K,Ce),pe&&(this.depthAttachment=new Ir(K,Ce))};vi.prototype.destroy=function(){var K=this.context.gl,ge=this.colorAttachment.get();if(ge&&K.deleteTexture(ge),this.depthAttachment){var te=this.depthAttachment.get();te&&K.deleteRenderbuffer(te)}K.deleteFramebuffer(this.framebuffer)};var Vi=519,Ui=function(K,ge,te){this.func=K,this.mask=ge,this.range=te};Ui.ReadOnly=!1,Ui.ReadWrite=!0,Ui.disabled=new Ui(Vi,Ui.ReadOnly,[0,1]);var Ki=519,ea=7680,Bi=function(K,ge,te,pe,He,Ce){this.test=K,this.ref=ge,this.mask=te,this.fail=pe,this.depthFail=He,this.pass=Ce};Bi.disabled=new Bi({func:Ki,mask:0},0,0,ea,ea,ea);var _a=0,Ca=1,Kt=771,zt=function(K,ge,te){this.blendFunction=K,this.blendColor=ge,this.mask=te};zt.Replace=[Ca,_a],zt.disabled=new zt(zt.Replace,e.Color.transparent,[!1,!1,!1,!1]),zt.unblended=new zt(zt.Replace,e.Color.transparent,[!0,!0,!0,!0]),zt.alphaBlended=new zt([Ca,Kt],e.Color.transparent,[!0,!0,!0,!0]);var Zt=1029,Jt=2305,Br=function(K,ge,te){this.enable=K,this.mode=ge,this.frontFace=te};Br.disabled=new Br(!1,Zt,Jt),Br.backCCW=new Br(!0,Zt,Jt);var ri=function(K){this.gl=K,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new nt(this),this.clearDepth=new Ae(this),this.clearStencil=new me(this),this.colorMask=new fe(this),this.depthMask=new Be(this),this.stencilMask=new Qe(this),this.stencilFunc=new at(this),this.stencilOp=new $e(this),this.stencilTest=new It(this),this.depthRange=new Pt(this),this.depthTest=new Vt(this),this.depthFunc=new Wt(this),this.blend=new Cr(this),this.blendFunc=new yr(this),this.blendColor=new qr(this),this.blendEquation=new Mr(this),this.cullFace=new Dr(this),this.cullFaceSide=new xt(this),this.frontFace=new Ne(this),this.program=new Ye(this),this.activeTexture=new be(this),this.viewport=new Ie(this),this.bindFramebuffer=new qe(this),this.bindRenderbuffer=new ke(this),this.bindTexture=new Me(this),this.bindVertexBuffer=new Le(this),this.bindElementBuffer=new ut(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new lt(this),this.pixelStoreUnpack=new gt(this),this.pixelStoreUnpackPremultiplyAlpha=new kt(this),this.pixelStoreUnpackFlipY=new nr(this),this.extTextureFilterAnisotropic=K.getExtension("EXT_texture_filter_anisotropic")||K.getExtension("MOZ_EXT_texture_filter_anisotropic")||K.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=K.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=K.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(K.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=K.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=K.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=K.getParameter(K.MAX_TEXTURE_SIZE)};ri.prototype.setDefault=function(){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()},ri.prototype.setDirty=function(){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.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},ri.prototype.createIndexBuffer=function(K,ge){return new Xe(this,K,ge)},ri.prototype.createVertexBuffer=function(K,ge,te){return new it(this,K,ge,te)},ri.prototype.createRenderbuffer=function(K,ge,te){var pe=this.gl,He=pe.createRenderbuffer();return this.bindRenderbuffer.set(He),pe.renderbufferStorage(pe.RENDERBUFFER,K,ge,te),this.bindRenderbuffer.set(null),He},ri.prototype.createFramebuffer=function(K,ge,te){return new vi(this,K,ge,te)},ri.prototype.clear=function(K){var ge=K.color,te=K.depth,pe=this.gl,He=0;ge&&(He|=pe.COLOR_BUFFER_BIT,this.clearColor.set(ge),this.colorMask.set([!0,!0,!0,!0])),typeof te<"u"&&(He|=pe.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(te),this.depthMask.set(!0)),pe.clear(He)},ri.prototype.setCullFace=function(K){K.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(K.mode),this.frontFace.set(K.frontFace))},ri.prototype.setDepthMode=function(K){K.func===this.gl.ALWAYS&&!K.mask?this.depthTest.set(!1):(this.depthTest.set(!0),this.depthFunc.set(K.func),this.depthMask.set(K.mask),this.depthRange.set(K.range))},ri.prototype.setStencilMode=function(K){K.test.func===this.gl.ALWAYS&&!K.mask?this.stencilTest.set(!1):(this.stencilTest.set(!0),this.stencilMask.set(K.mask),this.stencilOp.set([K.fail,K.depthFail,K.pass]),this.stencilFunc.set({func:K.test.func,ref:K.ref,mask:K.test.mask}))},ri.prototype.setColorMode=function(K){e.deepEqual(K.blendFunction,zt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(K.blendFunction),this.blendColor.set(K.blendColor)),this.colorMask.set(K.mask)},ri.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var ii=function(ve){function K(ge,te,pe){var He=this;ve.call(this),this.id=ge,this.dispatcher=pe,this.on("data",function(Ce){Ce.dataType==="source"&&Ce.sourceDataType==="metadata"&&(He._sourceLoaded=!0),He._sourceLoaded&&!He._paused&&Ce.dataType==="source"&&Ce.sourceDataType==="content"&&(He.reload(),He.transform&&He.update(He.transform))}),this.on("error",function(){He._sourceErrored=!0}),this._source=V(ge,te,pe,this),this._tiles={},this._cache=new ze(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new e.SourceFeatureState}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.onAdd=function(te){this.map=te,this._maxTileCacheSize=te?te._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(te)},K.prototype.onRemove=function(te){this._source&&this._source.onRemove&&this._source.onRemove(te)},K.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var te in this._tiles){var pe=this._tiles[te];if(pe.state!=="loaded"&&pe.state!=="errored")return!1}return!0},K.prototype.getSource=function(){return this._source},K.prototype.pause=function(){this._paused=!0},K.prototype.resume=function(){if(this._paused){var te=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,te&&this.reload(),this.transform&&this.update(this.transform)}},K.prototype._loadTile=function(te,pe){return this._source.loadTile(te,pe)},K.prototype._unloadTile=function(te){if(this._source.unloadTile)return this._source.unloadTile(te,function(){})},K.prototype._abortTile=function(te){if(this._source.abortTile)return this._source.abortTile(te,function(){})},K.prototype.serialize=function(){return this._source.serialize()},K.prototype.prepare=function(te){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(var pe in this._tiles){var He=this._tiles[pe];He.upload(te),He.prepare(this.map.style.imageManager)}},K.prototype.getIds=function(){return e.values(this._tiles).map(function(te){return te.tileID}).sort(di).map(function(te){return te.key})},K.prototype.getRenderableIds=function(te){var pe=this,He=[];for(var Ce in this._tiles)this._isIdRenderable(Ce,te)&&He.push(this._tiles[Ce]);return te?He.sort(function(Ke,pt){var Ut=Ke.tileID,Tr=pt.tileID,Ur=new e.Point(Ut.canonical.x,Ut.canonical.y)._rotate(pe.transform.angle),vr=new e.Point(Tr.canonical.x,Tr.canonical.y)._rotate(pe.transform.angle);return Ut.overscaledZ-Tr.overscaledZ||vr.y-Ur.y||vr.x-Ur.x}).map(function(Ke){return Ke.tileID.key}):He.map(function(Ke){return Ke.tileID}).sort(di).map(function(Ke){return Ke.key})},K.prototype.hasRenderableParent=function(te){var pe=this.findLoadedParent(te,0);return pe?this._isIdRenderable(pe.tileID.key):!1},K.prototype._isIdRenderable=function(te,pe){return this._tiles[te]&&this._tiles[te].hasData()&&!this._coveredTiles[te]&&(pe||!this._tiles[te].holdingForFade())},K.prototype.reload=function(){if(this._paused){this._shouldReloadOnResume=!0;return}this._cache.reset();for(var te in this._tiles)this._tiles[te].state!=="errored"&&this._reloadTile(te,"reloading")},K.prototype._reloadTile=function(te,pe){var He=this._tiles[te];He&&(He.state!=="loading"&&(He.state=pe),this._loadTile(He,this._tileLoaded.bind(this,He,te,pe)))},K.prototype._tileLoaded=function(te,pe,He,Ce){if(Ce){te.state="errored",Ce.status!==404?this._source.fire(new e.ErrorEvent(Ce,{tile:te})):this.update(this.transform);return}te.timeAdded=e.browser.now(),He==="expired"&&(te.refreshedUponExpiration=!0),this._setTileReloadTimer(pe,te),this.getSource().type==="raster-dem"&&te.dem&&this._backfillDEM(te),this._state.initializeTileState(te,this.map?this.map.painter:null),this._source.fire(new e.Event("data",{dataType:"source",tile:te,coord:te.tileID}))},K.prototype._backfillDEM=function(te){for(var pe=this.getRenderableIds(),He=0;He<pe.length;He++){var Ce=pe[He];if(te.neighboringTiles&&te.neighboringTiles[Ce]){var Ke=this.getTileByID(Ce);pt(te,Ke),pt(Ke,te)}}function pt(Ut,Tr){Ut.needsHillshadePrepare=!0;var Ur=Tr.tileID.canonical.x-Ut.tileID.canonical.x,vr=Tr.tileID.canonical.y-Ut.tileID.canonical.y,mt=Math.pow(2,Ut.tileID.canonical.z),Et=Tr.tileID.key;Ur===0&&vr===0||Math.abs(vr)>1||(Math.abs(Ur)>1&&(Math.abs(Ur+mt)===1?Ur+=mt:Math.abs(Ur-mt)===1&&(Ur-=mt)),!(!Tr.dem||!Ut.dem)&&(Ut.dem.backfillBorder(Tr.dem,Ur,vr),Ut.neighboringTiles&&Ut.neighboringTiles[Et]&&(Ut.neighboringTiles[Et].backfilled=!0)))}},K.prototype.getTile=function(te){return this.getTileByID(te.key)},K.prototype.getTileByID=function(te){return this._tiles[te]},K.prototype._retainLoadedChildren=function(te,pe,He,Ce){for(var Ke in this._tiles){var pt=this._tiles[Ke];if(!(Ce[Ke]||!pt.hasData()||pt.tileID.overscaledZ<=pe||pt.tileID.overscaledZ>He)){for(var Ut=pt.tileID;pt&&pt.tileID.overscaledZ>pe+1;){var Tr=pt.tileID.scaledTo(pt.tileID.overscaledZ-1);pt=this._tiles[Tr.key],pt&&pt.hasData()&&(Ut=Tr)}for(var Ur=Ut;Ur.overscaledZ>pe;)if(Ur=Ur.scaledTo(Ur.overscaledZ-1),te[Ur.key]){Ce[Ut.key]=Ut;break}}}},K.prototype.findLoadedParent=function(te,pe){if(te.key in this._loadedParentTiles){var He=this._loadedParentTiles[te.key];return He&&He.tileID.overscaledZ>=pe?He:null}for(var Ce=te.overscaledZ-1;Ce>=pe;Ce--){var Ke=te.scaledTo(Ce),pt=this._getLoadedTile(Ke);if(pt)return pt}},K.prototype._getLoadedTile=function(te){var pe=this._tiles[te.key];if(pe&&pe.hasData())return pe;var He=this._cache.getByKey(te.wrapped().key);return He},K.prototype.updateCacheSize=function(te){var pe=Math.ceil(te.width/this._source.tileSize)+1,He=Math.ceil(te.height/this._source.tileSize)+1,Ce=pe*He,Ke=5,pt=Math.floor(Ce*Ke),Ut=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,pt):pt;this._cache.setMaxSize(Ut)},K.prototype.handleWrapJump=function(te){var pe=this._prevLng===void 0?te:this._prevLng,He=te-pe,Ce=He/360,Ke=Math.round(Ce);if(this._prevLng=te,Ke){var pt={};for(var Ut in this._tiles){var Tr=this._tiles[Ut];Tr.tileID=Tr.tileID.unwrapTo(Tr.tileID.wrap+Ke),pt[Tr.tileID.key]=Tr}this._tiles=pt;for(var Ur in this._timers)clearTimeout(this._timers[Ur]),delete this._timers[Ur];for(var vr in this._tiles){var mt=this._tiles[vr];this._setTileReloadTimer(vr,mt)}}},K.prototype.update=function(te){var pe=this;if(this.transform=te,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(te),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var He;this.used?this._source.tileID?He=te.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(Ai){return new e.OverscaledTileID(Ai.canonical.z,Ai.wrap,Ai.canonical.z,Ai.canonical.x,Ai.canonical.y)}):(He=te.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(He=He.filter(function(Ai){return pe._source.hasTile(Ai)}))):He=[];var Ce=te.coveringZoomLevel(this._source),Ke=Math.max(Ce-K.maxOverzooming,this._source.minzoom),pt=Math.max(Ce+K.maxUnderzooming,this._source.minzoom),Ut=this._updateRetainedTiles(He,Ce);if(Wi(this._source.type)){for(var Tr={},Ur={},vr=Object.keys(Ut),mt=0,Et=vr;mt<Et.length;mt+=1){var Bt=Et[mt],or=Ut[Bt],dr=this._tiles[Bt];if(!(!dr||dr.fadeEndTime&&dr.fadeEndTime<=e.browser.now())){var ur=this.findLoadedParent(or,Ke);ur&&(this._addTile(ur.tileID),Tr[ur.tileID.key]=ur.tileID),Ur[Bt]=or}}this._retainLoadedChildren(Ur,Ce,pt,Ut);for(var pr in Tr)Ut[pr]||(this._coveredTiles[pr]=!0,Ut[pr]=Tr[pr])}for(var cr in Ut)this._tiles[cr].clearFadeHold();for(var Gt=e.keysDifference(this._tiles,Ut),lr=0,qt=Gt;lr<qt.length;lr+=1){var zr=qt[lr],$r=this._tiles[zr];$r.hasSymbolBuckets&&!$r.holdingForFade()?$r.setHoldDuration(this.map._fadeDuration):(!$r.hasSymbolBuckets||$r.symbolFadeFinished())&&this._removeTile(zr)}this._updateLoadedParentTileCache()}},K.prototype.releaseSymbolFadeTiles=function(){for(var te in this._tiles)this._tiles[te].holdingForFade()&&this._removeTile(te)},K.prototype._updateRetainedTiles=function(te,pe){for(var He={},Ce={},Ke=Math.max(pe-K.maxOverzooming,this._source.minzoom),pt=Math.max(pe+K.maxUnderzooming,this._source.minzoom),Ut={},Tr=0,Ur=te;Tr<Ur.length;Tr+=1){var vr=Ur[Tr],mt=this._addTile(vr);He[vr.key]=vr,!mt.hasData()&&pe<this._source.maxzoom&&(Ut[vr.key]=vr)}this._retainLoadedChildren(Ut,pe,pt,He);for(var Et=0,Bt=te;Et<Bt.length;Et+=1){var or=Bt[Et],dr=this._tiles[or.key];if(!dr.hasData()){if(pe+1>this._source.maxzoom){var ur=or.children(this._source.maxzoom)[0],pr=this.getTile(ur);if(pr&&pr.hasData()){He[ur.key]=ur;continue}}else{var cr=or.children(this._source.maxzoom);if(He[cr[0].key]&&He[cr[1].key]&&He[cr[2].key]&&He[cr[3].key])continue}for(var Gt=dr.wasRequested(),lr=or.overscaledZ-1;lr>=Ke;--lr){var qt=or.scaledTo(lr);if(Ce[qt.key]||(Ce[qt.key]=!0,dr=this.getTile(qt),!dr&&Gt&&(dr=this._addTile(qt)),dr&&(He[qt.key]=qt,Gt=dr.wasRequested(),dr.hasData())))break}}}return He},K.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var te in this._tiles){for(var pe=[],He=void 0,Ce=this._tiles[te].tileID;Ce.overscaledZ>0;){if(Ce.key in this._loadedParentTiles){He=this._loadedParentTiles[Ce.key];break}pe.push(Ce.key);var Ke=Ce.scaledTo(Ce.overscaledZ-1);if(He=this._getLoadedTile(Ke),He)break;Ce=Ke}for(var pt=0,Ut=pe;pt<Ut.length;pt+=1){var Tr=Ut[pt];this._loadedParentTiles[Tr]=He}}},K.prototype._addTile=function(te){var pe=this._tiles[te.key];if(pe)return pe;pe=this._cache.getAndRemove(te),pe&&(this._setTileReloadTimer(te.key,pe),pe.tileID=te,this._state.initializeTileState(pe,this.map?this.map.painter:null),this._cacheTimers[te.key]&&(clearTimeout(this._cacheTimers[te.key]),delete this._cacheTimers[te.key],this._setTileReloadTimer(te.key,pe)));var He=!!pe;return He||(pe=new e.Tile(te,this._source.tileSize*te.overscaleFactor()),this._loadTile(pe,this._tileLoaded.bind(this,pe,te.key,pe.state))),pe?(pe.uses++,this._tiles[te.key]=pe,He||this._source.fire(new e.Event("dataloading",{tile:pe,coord:pe.tileID,dataType:"source"})),pe):null},K.prototype._setTileReloadTimer=function(te,pe){var He=this;te in this._timers&&(clearTimeout(this._timers[te]),delete this._timers[te]);var Ce=pe.getExpiryTimeout();Ce&&(this._timers[te]=setTimeout(function(){He._reloadTile(te,"expired"),delete He._timers[te]},Ce))},K.prototype._removeTile=function(te){var pe=this._tiles[te];pe&&(pe.uses--,delete this._tiles[te],this._timers[te]&&(clearTimeout(this._timers[te]),delete this._timers[te]),!(pe.uses>0)&&(pe.hasData()&&pe.state!=="reloading"?this._cache.add(pe.tileID,pe,pe.getExpiryTimeout()):(pe.aborted=!0,this._abortTile(pe),this._unloadTile(pe))))},K.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var te in this._tiles)this._removeTile(te);this._cache.reset()},K.prototype.tilesIn=function(te,pe,He){var Ce=this,Ke=[],pt=this.transform;if(!pt)return Ke;for(var Ut=He?pt.getCameraQueryGeometry(te):te,Tr=te.map(function(lr){return pt.pointCoordinate(lr)}),Ur=Ut.map(function(lr){return pt.pointCoordinate(lr)}),vr=this.getIds(),mt=1/0,Et=1/0,Bt=-1/0,or=-1/0,dr=0,ur=Ur;dr<ur.length;dr+=1){var pr=ur[dr];mt=Math.min(mt,pr.x),Et=Math.min(Et,pr.y),Bt=Math.max(Bt,pr.x),or=Math.max(or,pr.y)}for(var cr=function(lr){var qt=Ce._tiles[vr[lr]];if(!qt.holdingForFade()){var zr=qt.tileID,$r=Math.pow(2,pt.zoom-qt.tileID.overscaledZ),Ai=pe*qt.queryPadding*e.EXTENT/qt.tileSize/$r,wa=[zr.getTilePoint(new e.MercatorCoordinate(mt,Et)),zr.getTilePoint(new e.MercatorCoordinate(Bt,or))];if(wa[0].x-Ai<e.EXTENT&&wa[0].y-Ai<e.EXTENT&&wa[1].x+Ai>=0&&wa[1].y+Ai>=0){var Ji=Tr.map(function(sn){return zr.getTilePoint(sn)}),fa=Ur.map(function(sn){return zr.getTilePoint(sn)});Ke.push({tile:qt,tileID:zr,queryGeometry:Ji,cameraQueryGeometry:fa,scale:$r})}}},Gt=0;Gt<vr.length;Gt++)cr(Gt);return Ke},K.prototype.getVisibleCoordinates=function(te){for(var pe=this,He=this.getRenderableIds(te).map(function(Ut){return pe._tiles[Ut].tileID}),Ce=0,Ke=He;Ce<Ke.length;Ce+=1){var pt=Ke[Ce];pt.posMatrix=this.transform.calculatePosMatrix(pt.toUnwrapped())}return He},K.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Wi(this._source.type))for(var te in this._tiles){var pe=this._tiles[te];if(pe.fadeEndTime!==void 0&&pe.fadeEndTime>=e.browser.now())return!0}return!1},K.prototype.setFeatureState=function(te,pe,He){te=te||"_geojsonTileLayer",this._state.updateState(te,pe,He)},K.prototype.removeFeatureState=function(te,pe,He){te=te||"_geojsonTileLayer",this._state.removeFeatureState(te,pe,He)},K.prototype.getFeatureState=function(te,pe){return te=te||"_geojsonTileLayer",this._state.getState(te,pe)},K.prototype.setDependencies=function(te,pe,He){var Ce=this._tiles[te];Ce&&Ce.setDependencies(pe,He)},K.prototype.reloadTilesForDependencies=function(te,pe){for(var He in this._tiles){var Ce=this._tiles[He];Ce.hasDependency(te,pe)&&this._reloadTile(He,"reloading")}this._cache.filter(function(Ke){return!Ke.hasDependency(te,pe)})},K}(e.Evented);ii.maxOverzooming=10,ii.maxUnderzooming=3;function di(ve,K){var ge=Math.abs(ve.wrap*2)-+(ve.wrap<0),te=Math.abs(K.wrap*2)-+(K.wrap<0);return ve.overscaledZ-K.overscaledZ||te-ge||K.canonical.y-ve.canonical.y||K.canonical.x-ve.canonical.x}function Wi(ve){return ve==="raster"||ve==="image"||ve==="video"}function oa(){return new e.window.Worker($o.workerUrl)}var ra="mapboxgl_preloaded_worker_pool",ca=function(){this.active={}};ca.prototype.acquire=function(K){if(!this.workers)for(this.workers=[];this.workers.length<ca.workerCount;)this.workers.push(new oa);return this.active[K]=!0,this.workers.slice()},ca.prototype.release=function(K){delete this.active[K],this.numActive()===0&&(this.workers.forEach(function(ge){ge.terminate()}),this.workers=null)},ca.prototype.isPreloaded=function(){return!!this.active[ra]},ca.prototype.numActive=function(){return Object.keys(this.active).length};var xa=Math.floor(e.browser.hardwareConcurrency/2);ca.workerCount=Math.max(Math.min(xa,6),1);var ji;function pn(){return ji||(ji=new ca),ji}function _n(){var ve=pn();ve.acquire(ra)}function En(){var ve=ji;ve&&(ve.isPreloaded()&&ve.numActive()===1?(ve.release(ra),ji=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))}function bt(ve,K){var ge={};for(var te in ve)te!=="ref"&&(ge[te]=ve[te]);return e.refProperties.forEach(function(pe){pe in K&&(ge[pe]=K[pe])}),ge}function st(ve){ve=ve.slice();for(var K=Object.create(null),ge=0;ge<ve.length;ge++)K[ve[ge].id]=ve[ge];for(var te=0;te<ve.length;te++)"ref"in ve[te]&&(ve[te]=bt(ve[te],K[ve[te].ref]));return ve}function Nr(){var ve={},K=e.styleSpec.$version;for(var ge in e.styleSpec.$root){var te=e.styleSpec.$root[ge];if(te.required){var pe=null;ge==="version"?pe=K:te.type==="array"?pe=[]:pe={},pe!=null&&(ve[ge]=pe)}}return ve}var Lr={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function br(ve,K,ge){ge.push({command:Lr.addSource,args:[ve,K[ve]]})}function Rr(ve,K,ge){K.push({command:Lr.removeSource,args:[ve]}),ge[ve]=!0}function jr(ve,K,ge,te){Rr(ve,ge,te),br(ve,K,ge)}function Wr(ve,K,ge){var te;for(te in ve[ge])if(ve[ge].hasOwnProperty(te)&&te!=="data"&&!e.deepEqual(ve[ge][te],K[ge][te]))return!1;for(te in K[ge])if(K[ge].hasOwnProperty(te)&&te!=="data"&&!e.deepEqual(ve[ge][te],K[ge][te]))return!1;return!0}function yt(ve,K,ge,te){ve=ve||{},K=K||{};var pe;for(pe in ve)ve.hasOwnProperty(pe)&&(K.hasOwnProperty(pe)||Rr(pe,ge,te));for(pe in K)K.hasOwnProperty(pe)&&(ve.hasOwnProperty(pe)?e.deepEqual(ve[pe],K[pe])||(ve[pe].type==="geojson"&&K[pe].type==="geojson"&&Wr(ve,K,pe)?ge.push({command:Lr.setGeoJSONSourceData,args:[pe,K[pe].data]}):jr(pe,K,ge,te)):br(pe,K,ge))}function Xt(ve,K,ge,te,pe,He){ve=ve||{},K=K||{};var Ce;for(Ce in ve)ve.hasOwnProperty(Ce)&&(e.deepEqual(ve[Ce],K[Ce])||ge.push({command:He,args:[te,Ce,K[Ce],pe]}));for(Ce in K)!K.hasOwnProperty(Ce)||ve.hasOwnProperty(Ce)||e.deepEqual(ve[Ce],K[Ce])||ge.push({command:He,args:[te,Ce,K[Ce],pe]})}function mr(ve){return ve.id}function Or(ve,K){return ve[K.id]=K,ve}function ki(ve,K,ge){ve=ve||[],K=K||[];var te=ve.map(mr),pe=K.map(mr),He=ve.reduce(Or,{}),Ce=K.reduce(Or,{}),Ke=te.slice(),pt=Object.create(null),Ut,Tr,Ur,vr,mt,Et,Bt;for(Ut=0,Tr=0;Ut<te.length;Ut++)Ur=te[Ut],Ce.hasOwnProperty(Ur)?Tr++:(ge.push({command:Lr.removeLayer,args:[Ur]}),Ke.splice(Ke.indexOf(Ur,Tr),1));for(Ut=0,Tr=0;Ut<pe.length;Ut++)Ur=pe[pe.length-1-Ut],Ke[Ke.length-1-Ut]!==Ur&&(He.hasOwnProperty(Ur)?(ge.push({command:Lr.removeLayer,args:[Ur]}),Ke.splice(Ke.lastIndexOf(Ur,Ke.length-Tr),1)):Tr++,Et=Ke[Ke.length-Ut],ge.push({command:Lr.addLayer,args:[Ce[Ur],Et]}),Ke.splice(Ke.length-Ut,0,Ur),pt[Ur]=!0);for(Ut=0;Ut<pe.length;Ut++)if(Ur=pe[Ut],vr=He[Ur],mt=Ce[Ur],!(pt[Ur]||e.deepEqual(vr,mt))){if(!e.deepEqual(vr.source,mt.source)||!e.deepEqual(vr["source-layer"],mt["source-layer"])||!e.deepEqual(vr.type,mt.type)){ge.push({command:Lr.removeLayer,args:[Ur]}),Et=Ke[Ke.lastIndexOf(Ur)+1],ge.push({command:Lr.addLayer,args:[mt,Et]});continue}Xt(vr.layout,mt.layout,ge,Ur,null,Lr.setLayoutProperty),Xt(vr.paint,mt.paint,ge,Ur,null,Lr.setPaintProperty),e.deepEqual(vr.filter,mt.filter)||ge.push({command:Lr.setFilter,args:[Ur,mt.filter]}),(!e.deepEqual(vr.minzoom,mt.minzoom)||!e.deepEqual(vr.maxzoom,mt.maxzoom))&&ge.push({command:Lr.setLayerZoomRange,args:[Ur,mt.minzoom,mt.maxzoom]});for(Bt in vr)vr.hasOwnProperty(Bt)&&(Bt==="layout"||Bt==="paint"||Bt==="filter"||Bt==="metadata"||Bt==="minzoom"||Bt==="maxzoom"||(Bt.indexOf("paint.")===0?Xt(vr[Bt],mt[Bt],ge,Ur,Bt.slice(6),Lr.setPaintProperty):e.deepEqual(vr[Bt],mt[Bt])||ge.push({command:Lr.setLayerProperty,args:[Ur,Bt,mt[Bt]]})));for(Bt in mt)!mt.hasOwnProperty(Bt)||vr.hasOwnProperty(Bt)||Bt==="layout"||Bt==="paint"||Bt==="filter"||Bt==="metadata"||Bt==="minzoom"||Bt==="maxzoom"||(Bt.indexOf("paint.")===0?Xt(vr[Bt],mt[Bt],ge,Ur,Bt.slice(6),Lr.setPaintProperty):e.deepEqual(vr[Bt],mt[Bt])||ge.push({command:Lr.setLayerProperty,args:[Ur,Bt,mt[Bt]]}))}}function Ni(ve,K){if(!ve)return[{command:Lr.setStyle,args:[K]}];var ge=[];try{if(!e.deepEqual(ve.version,K.version))return[{command:Lr.setStyle,args:[K]}];e.deepEqual(ve.center,K.center)||ge.push({command:Lr.setCenter,args:[K.center]}),e.deepEqual(ve.zoom,K.zoom)||ge.push({command:Lr.setZoom,args:[K.zoom]}),e.deepEqual(ve.bearing,K.bearing)||ge.push({command:Lr.setBearing,args:[K.bearing]}),e.deepEqual(ve.pitch,K.pitch)||ge.push({command:Lr.setPitch,args:[K.pitch]}),e.deepEqual(ve.sprite,K.sprite)||ge.push({command:Lr.setSprite,args:[K.sprite]}),e.deepEqual(ve.glyphs,K.glyphs)||ge.push({command:Lr.setGlyphs,args:[K.glyphs]}),e.deepEqual(ve.transition,K.transition)||ge.push({command:Lr.setTransition,args:[K.transition]}),e.deepEqual(ve.light,K.light)||ge.push({command:Lr.setLight,args:[K.light]});var te={},pe=[];yt(ve.sources,K.sources,pe,te);var He=[];ve.layers&&ve.layers.forEach(function(Ce){te[Ce.source]?ge.push({command:Lr.removeLayer,args:[Ce.id]}):He.push(Ce)}),ge=ge.concat(pe),ki(He,K.layers,ge)}catch(Ce){console.warn("Unable to compute style diff:",Ce),ge=[{command:Lr.setStyle,args:[K]}]}return ge}var Si=function(K,ge){this.reset(K,ge)};Si.prototype.reset=function(K,ge){this.points=K||[],this._distances=[0];for(var te=1;te<this.points.length;te++)this._distances[te]=this._distances[te-1]+this.points[te].dist(this.points[te-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(ge||0,this.length*.5),this.paddedLength=this.length-this.padding*2},Si.prototype.lerp=function(K){if(this.points.length===1)return this.points[0];K=e.clamp(K,0,1);for(var ge=1,te=this._distances[ge],pe=K*this.paddedLength+this.padding;te<pe&&ge<this._distances.length;)te=this._distances[++ge];var He=ge-1,Ce=this._distances[He],Ke=te-Ce,pt=Ke>0?(pe-Ce)/Ke:0;return this.points[He].mult(1-pt).add(this.points[ge].mult(pt))};var fi=function(K,ge,te){var pe=this.boxCells=[],He=this.circleCells=[];this.xCellCount=Math.ceil(K/te),this.yCellCount=Math.ceil(ge/te);for(var Ce=0;Ce<this.xCellCount*this.yCellCount;Ce++)pe.push([]),He.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=K,this.height=ge,this.xScale=this.xCellCount/K,this.yScale=this.yCellCount/ge,this.boxUid=0,this.circleUid=0};fi.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},fi.prototype.insert=function(K,ge,te,pe,He){this._forEachCell(ge,te,pe,He,this._insertBoxCell,this.boxUid++),this.boxKeys.push(K),this.bboxes.push(ge),this.bboxes.push(te),this.bboxes.push(pe),this.bboxes.push(He)},fi.prototype.insertCircle=function(K,ge,te,pe){this._forEachCell(ge-pe,te-pe,ge+pe,te+pe,this._insertCircleCell,this.circleUid++),this.circleKeys.push(K),this.circles.push(ge),this.circles.push(te),this.circles.push(pe)},fi.prototype._insertBoxCell=function(K,ge,te,pe,He,Ce){this.boxCells[He].push(Ce)},fi.prototype._insertCircleCell=function(K,ge,te,pe,He,Ce){this.circleCells[He].push(Ce)},fi.prototype._query=function(K,ge,te,pe,He,Ce){if(te<0||K>this.width||pe<0||ge>this.height)return He?!1:[];var Ke=[];if(K<=0&&ge<=0&&this.width<=te&&this.height<=pe){if(He)return!0;for(var pt=0;pt<this.boxKeys.length;pt++)Ke.push({key:this.boxKeys[pt],x1:this.bboxes[pt*4],y1:this.bboxes[pt*4+1],x2:this.bboxes[pt*4+2],y2:this.bboxes[pt*4+3]});for(var Ut=0;Ut<this.circleKeys.length;Ut++){var Tr=this.circles[Ut*3],Ur=this.circles[Ut*3+1],vr=this.circles[Ut*3+2];Ke.push({key:this.circleKeys[Ut],x1:Tr-vr,y1:Ur-vr,x2:Tr+vr,y2:Ur+vr})}return Ce?Ke.filter(Ce):Ke}else{var mt={hitTest:He,seenUids:{box:{},circle:{}}};return this._forEachCell(K,ge,te,pe,this._queryCell,Ke,mt,Ce),He?Ke.length>0:Ke}},fi.prototype._queryCircle=function(K,ge,te,pe,He){var Ce=K-te,Ke=K+te,pt=ge-te,Ut=ge+te;if(Ke<0||Ce>this.width||Ut<0||pt>this.height)return pe?!1:[];var Tr=[],Ur={hitTest:pe,circle:{x:K,y:ge,radius:te},seenUids:{box:{},circle:{}}};return this._forEachCell(Ce,pt,Ke,Ut,this._queryCellCircle,Tr,Ur,He),pe?Tr.length>0:Tr},fi.prototype.query=function(K,ge,te,pe,He){return this._query(K,ge,te,pe,!1,He)},fi.prototype.hitTest=function(K,ge,te,pe,He){return this._query(K,ge,te,pe,!0,He)},fi.prototype.hitTestCircle=function(K,ge,te,pe){return this._queryCircle(K,ge,te,!0,pe)},fi.prototype._queryCell=function(K,ge,te,pe,He,Ce,Ke,pt){var Ut=Ke.seenUids,Tr=this.boxCells[He];if(Tr!==null)for(var Ur=this.bboxes,vr=0,mt=Tr;vr<mt.length;vr+=1){var Et=mt[vr];if(!Ut.box[Et]){Ut.box[Et]=!0;var Bt=Et*4;if(K<=Ur[Bt+2]&&ge<=Ur[Bt+3]&&te>=Ur[Bt+0]&&pe>=Ur[Bt+1]&&(!pt||pt(this.boxKeys[Et]))){if(Ke.hitTest)return Ce.push(!0),!0;Ce.push({key:this.boxKeys[Et],x1:Ur[Bt],y1:Ur[Bt+1],x2:Ur[Bt+2],y2:Ur[Bt+3]})}}}var or=this.circleCells[He];if(or!==null)for(var dr=this.circles,ur=0,pr=or;ur<pr.length;ur+=1){var cr=pr[ur];if(!Ut.circle[cr]){Ut.circle[cr]=!0;var Gt=cr*3;if(this._circleAndRectCollide(dr[Gt],dr[Gt+1],dr[Gt+2],K,ge,te,pe)&&(!pt||pt(this.circleKeys[cr]))){if(Ke.hitTest)return Ce.push(!0),!0;var lr=dr[Gt],qt=dr[Gt+1],zr=dr[Gt+2];Ce.push({key:this.circleKeys[cr],x1:lr-zr,y1:qt-zr,x2:lr+zr,y2:qt+zr})}}}},fi.prototype._queryCellCircle=function(K,ge,te,pe,He,Ce,Ke,pt){var Ut=Ke.circle,Tr=Ke.seenUids,Ur=this.boxCells[He];if(Ur!==null)for(var vr=this.bboxes,mt=0,Et=Ur;mt<Et.length;mt+=1){var Bt=Et[mt];if(!Tr.box[Bt]){Tr.box[Bt]=!0;var or=Bt*4;if(this._circleAndRectCollide(Ut.x,Ut.y,Ut.radius,vr[or+0],vr[or+1],vr[or+2],vr[or+3])&&(!pt||pt(this.boxKeys[Bt])))return Ce.push(!0),!0}}var dr=this.circleCells[He];if(dr!==null)for(var ur=this.circles,pr=0,cr=dr;pr<cr.length;pr+=1){var Gt=cr[pr];if(!Tr.circle[Gt]){Tr.circle[Gt]=!0;var lr=Gt*3;if(this._circlesCollide(ur[lr],ur[lr+1],ur[lr+2],Ut.x,Ut.y,Ut.radius)&&(!pt||pt(this.circleKeys[Gt])))return Ce.push(!0),!0}}},fi.prototype._forEachCell=function(K,ge,te,pe,He,Ce,Ke,pt){for(var Ut=this._convertToXCellCoord(K),Tr=this._convertToYCellCoord(ge),Ur=this._convertToXCellCoord(te),vr=this._convertToYCellCoord(pe),mt=Ut;mt<=Ur;mt++)for(var Et=Tr;Et<=vr;Et++){var Bt=this.xCellCount*Et+mt;if(He.call(this,K,ge,te,pe,Bt,Ce,Ke,pt))return}},fi.prototype._convertToXCellCoord=function(K){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(K*this.xScale)))},fi.prototype._convertToYCellCoord=function(K){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(K*this.yScale)))},fi.prototype._circlesCollide=function(K,ge,te,pe,He,Ce){var Ke=pe-K,pt=He-ge,Ut=te+Ce;return Ut*Ut>Ke*Ke+pt*pt},fi.prototype._circleAndRectCollide=function(K,ge,te,pe,He,Ce,Ke){var pt=(Ce-pe)/2,Ut=Math.abs(K-(pe+pt));if(Ut>pt+te)return!1;var Tr=(Ke-He)/2,Ur=Math.abs(ge-(He+Tr));if(Ur>Tr+te)return!1;if(Ut<=pt||Ur<=Tr)return!0;var vr=Ut-pt,mt=Ur-Tr;return vr*vr+mt*mt<=te*te};function Li(ve,K,ge,te,pe){var He=e.create();return K?(e.scale(He,He,[1/pe,1/pe,1]),ge||e.rotateZ(He,He,te.angle)):e.multiply(He,te.labelPlaneMatrix,ve),He}function Ia(ve,K,ge,te,pe){if(K){var He=e.clone(ve);return e.scale(He,He,[pe,pe,1]),ge||e.rotateZ(He,He,-te.angle),He}else return te.glCoordMatrix}function Fa(ve,K){var ge=[ve.x,ve.y,0,1];ns(ge,ge,K);var te=ge[3];return{point:new e.Point(ge[0]/te,ge[1]/te),signedDistanceFromCamera:te}}function un(ve,K){return .5+.5*(ve/K)}function Bn(ve,K){var ge=ve[0]/ve[3],te=ve[1]/ve[3],pe=ge>=-K[0]&&ge<=K[0]&&te>=-K[1]&&te<=K[1];return pe}function Kn(ve,K,ge,te,pe,He,Ce,Ke){var pt=te?ve.textSizeData:ve.iconSizeData,Ut=e.evaluateSizeForZoom(pt,ge.transform.zoom),Tr=[256/ge.width*2+1,256/ge.height*2+1],Ur=te?ve.text.dynamicLayoutVertexArray:ve.icon.dynamicLayoutVertexArray;Ur.clear();for(var vr=ve.lineVertexArray,mt=te?ve.text.placedSymbolArray:ve.icon.placedSymbolArray,Et=ge.transform.width/ge.transform.height,Bt=!1,or=0;or<mt.length;or++){var dr=mt.get(or);if(dr.hidden||dr.writingMode===e.WritingMode.vertical&&!Bt){Ls(dr.numGlyphs,Ur);continue}Bt=!1;var ur=[dr.anchorX,dr.anchorY,0,1];if(e.transformMat4(ur,ur,K),!Bn(ur,Tr)){Ls(dr.numGlyphs,Ur);continue}var pr=ur[3],cr=un(ge.transform.cameraToCenterDistance,pr),Gt=e.evaluateSizeForFeature(pt,Ut,dr),lr=Ce?Gt/cr:Gt*cr,qt=new e.Point(dr.anchorX,dr.anchorY),zr=Fa(qt,pe).point,$r={},Ai=Ao(dr,lr,!1,Ke,K,pe,He,ve.glyphOffsetArray,vr,Ur,zr,qt,$r,Et);Bt=Ai.useVertical,(Ai.notEnoughRoom||Bt||Ai.needsFlipping&&Ao(dr,lr,!0,Ke,K,pe,He,ve.glyphOffsetArray,vr,Ur,zr,qt,$r,Et).notEnoughRoom)&&Ls(dr.numGlyphs,Ur)}te?ve.text.dynamicLayoutVertexBuffer.updateData(Ur):ve.icon.dynamicLayoutVertexBuffer.updateData(Ur)}function Gn(ve,K,ge,te,pe,He,Ce,Ke,pt,Ut,Tr){var Ur=Ke.glyphStartIndex+Ke.numGlyphs,vr=Ke.lineStartIndex,mt=Ke.lineStartIndex+Ke.lineLength,Et=K.getoffsetX(Ke.glyphStartIndex),Bt=K.getoffsetX(Ur-1),or=Eo(ve*Et,ge,te,pe,He,Ce,Ke.segment,vr,mt,pt,Ut,Tr);if(!or)return null;var dr=Eo(ve*Bt,ge,te,pe,He,Ce,Ke.segment,vr,mt,pt,Ut,Tr);return dr?{first:or,last:dr}:null}function eo(ve,K,ge,te){if(ve===e.WritingMode.horizontal){var pe=Math.abs(ge.y-K.y),He=Math.abs(ge.x-K.x)*te;if(pe>He)return{useVertical:!0}}return(ve===e.WritingMode.vertical?K.y<ge.y:K.x>ge.x)?{needsFlipping:!0}:null}function Ao(ve,K,ge,te,pe,He,Ce,Ke,pt,Ut,Tr,Ur,vr,mt){var Et=K/24,Bt=ve.lineOffsetX*Et,or=ve.lineOffsetY*Et,dr;if(ve.numGlyphs>1){var ur=ve.glyphStartIndex+ve.numGlyphs,pr=ve.lineStartIndex,cr=ve.lineStartIndex+ve.lineLength,Gt=Gn(Et,Ke,Bt,or,ge,Tr,Ur,ve,pt,He,vr);if(!Gt)return{notEnoughRoom:!0};var lr=Fa(Gt.first.point,Ce).point,qt=Fa(Gt.last.point,Ce).point;if(te&&!ge){var zr=eo(ve.writingMode,lr,qt,mt);if(zr)return zr}dr=[Gt.first];for(var $r=ve.glyphStartIndex+1;$r<ur-1;$r++)dr.push(Eo(Et*Ke.getoffsetX($r),Bt,or,ge,Tr,Ur,ve.segment,pr,cr,pt,He,vr));dr.push(Gt.last)}else{if(te&&!ge){var Ai=Fa(Ur,pe).point,wa=ve.lineStartIndex+ve.segment+1,Ji=new e.Point(pt.getx(wa),pt.gety(wa)),fa=Fa(Ji,pe),sn=fa.signedDistanceFromCamera>0?fa.point:An(Ur,Ji,Ai,1,pe),Ga=eo(ve.writingMode,Ai,sn,mt);if(Ga)return Ga}var ma=Eo(Et*Ke.getoffsetX(ve.glyphStartIndex),Bt,or,ge,Tr,Ur,ve.segment,ve.lineStartIndex,ve.lineStartIndex+ve.lineLength,pt,He,vr);if(!ma)return{notEnoughRoom:!0};dr=[ma]}for(var Ma=0,Pa=dr;Ma<Pa.length;Ma+=1){var Ka=Pa[Ma];e.addDynamicAttributes(Ut,Ka.point,Ka.angle)}return{}}function An(ve,K,ge,te,pe){var He=Fa(ve.add(ve.sub(K)._unit()),pe).point,Ce=ge.sub(He);return ge.add(Ce._mult(te/Ce.mag()))}function Eo(ve,K,ge,te,pe,He,Ce,Ke,pt,Ut,Tr,Ur){var vr=te?ve-K:ve+K,mt=vr>0?1:-1,Et=0;te&&(mt*=-1,Et=Math.PI),mt<0&&(Et+=Math.PI);for(var Bt=mt>0?Ke+Ce:Ke+Ce+1,or=pe,dr=pe,ur=0,pr=0,cr=Math.abs(vr),Gt=[];ur+pr<=cr;){if(Bt+=mt,Bt<Ke||Bt>=pt)return null;if(dr=or,Gt.push(or),or=Ur[Bt],or===void 0){var lr=new e.Point(Ut.getx(Bt),Ut.gety(Bt)),qt=Fa(lr,Tr);if(qt.signedDistanceFromCamera>0)or=Ur[Bt]=qt.point;else{var zr=Bt-mt,$r=ur===0?He:new e.Point(Ut.getx(zr),Ut.gety(zr));or=An($r,lr,dr,cr-ur+1,Tr)}}ur+=pr,pr=dr.dist(or)}var Ai=(cr-ur)/pr,wa=or.sub(dr),Ji=wa.mult(Ai)._add(dr);Ji._add(wa._unit()._perp()._mult(ge*mt));var fa=Et+Math.atan2(or.y-dr.y,or.x-dr.x);return Gt.push(Ji),{point:Ji,angle:fa,path:Gt}}var fs=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ls(ve,K){for(var ge=0;ge<ve;ge++){var te=K.length;K.resize(te+4),K.float32.set(fs,te*3)}}function ns(ve,K,ge){var te=K[0],pe=K[1];return ve[0]=ge[0]*te+ge[4]*pe+ge[12],ve[1]=ge[1]*te+ge[5]*pe+ge[13],ve[3]=ge[3]*te+ge[7]*pe+ge[15],ve}var uo=100,ss=function(K,ge,te){ge===void 0&&(ge=new fi(K.width+2*uo,K.height+2*uo,25)),te===void 0&&(te=new fi(K.width+2*uo,K.height+2*uo,25)),this.transform=K,this.grid=ge,this.ignoredGrid=te,this.pitchfactor=Math.cos(K._pitch)*K.cameraToCenterDistance,this.screenRightBoundary=K.width+uo,this.screenBottomBoundary=K.height+uo,this.gridRightBoundary=K.width+2*uo,this.gridBottomBoundary=K.height+2*uo};ss.prototype.placeCollisionBox=function(K,ge,te,pe,He){var Ce=this.projectAndGetPerspectiveRatio(pe,K.anchorPointX,K.anchorPointY),Ke=te*Ce.perspectiveRatio,pt=K.x1*Ke+Ce.point.x,Ut=K.y1*Ke+Ce.point.y,Tr=K.x2*Ke+Ce.point.x,Ur=K.y2*Ke+Ce.point.y;return!this.isInsideGrid(pt,Ut,Tr,Ur)||!ge&&this.grid.hitTest(pt,Ut,Tr,Ur,He)?{box:[],offscreen:!1}:{box:[pt,Ut,Tr,Ur],offscreen:this.isOffscreen(pt,Ut,Tr,Ur)}},ss.prototype.placeCollisionCircles=function(K,ge,te,pe,He,Ce,Ke,pt,Ut,Tr,Ur,vr,mt){var Et=[],Bt=new e.Point(ge.anchorX,ge.anchorY),or=Fa(Bt,Ce),dr=un(this.transform.cameraToCenterDistance,or.signedDistanceFromCamera),ur=Tr?He/dr:He*dr,pr=ur/e.ONE_EM,cr=Fa(Bt,Ke).point,Gt={},lr=ge.lineOffsetX*pr,qt=ge.lineOffsetY*pr,zr=Gn(pr,pe,lr,qt,!1,cr,Bt,ge,te,Ke,Gt),$r=!1,Ai=!1,wa=!0;if(zr){for(var Ji=vr*.5*dr+mt,fa=new e.Point(-uo,-uo),sn=new e.Point(this.screenRightBoundary,this.screenBottomBoundary),Ga=new Si,ma=zr.first,Ma=zr.last,Pa=[],Ka=ma.path.length-1;Ka>=1;Ka--)Pa.push(ma.path[Ka]);for(var Sn=1;Sn<Ma.path.length;Sn++)Pa.push(Ma.path[Sn]);var No=Ji*2.5;if(pt){var os=Pa.map(function(nd){return Fa(nd,pt)});os.some(function(nd){return nd.signedDistanceFromCamera<=0})?Pa=[]:Pa=os.map(function(nd){return nd.point})}var Xs=[];if(Pa.length>0){for(var ts=Pa[0].clone(),Vs=Pa[0].clone(),ll=1;ll<Pa.length;ll++)ts.x=Math.min(ts.x,Pa[ll].x),ts.y=Math.min(ts.y,Pa[ll].y),Vs.x=Math.max(Vs.x,Pa[ll].x),Vs.y=Math.max(Vs.y,Pa[ll].y);ts.x>=fa.x&&Vs.x<=sn.x&&ts.y>=fa.y&&Vs.y<=sn.y?Xs=[Pa]:Vs.x<fa.x||ts.x>sn.x||Vs.y<fa.y||ts.y>sn.y?Xs=[]:Xs=e.clipLine([Pa],fa.x,fa.y,sn.x,sn.y)}for(var Mu=0,rd=Xs;Mu<rd.length;Mu+=1){var id=rd[Mu];Ga.reset(id,Ji*.25);var xh=0;Ga.length<=.5*Ji?xh=1:xh=Math.ceil(Ga.paddedLength/No)+1;for(var hd=0;hd<xh;hd++){var ev=hd/Math.max(xh-1,1),Md=Ga.lerp(ev),bh=Md.x+uo,Ed=Md.y+uo;Et.push(bh,Ed,Ji,0);var zh=bh-Ji,wh=Ed-Ji,ad=bh+Ji,dd=Ed+Ji;if(wa=wa&&this.isOffscreen(zh,wh,ad,dd),Ai=Ai||this.isInsideGrid(zh,wh,ad,dd),!K&&this.grid.hitTestCircle(bh,Ed,Ji,Ur)&&($r=!0,!Ut))return{circles:[],offscreen:!1,collisionDetected:$r}}}}return{circles:!Ut&&$r||!Ai?[]:Et,offscreen:wa,collisionDetected:$r}},ss.prototype.queryRenderedSymbols=function(K){if(K.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var ge=[],te=1/0,pe=1/0,He=-1/0,Ce=-1/0,Ke=0,pt=K;Ke<pt.length;Ke+=1){var Ut=pt[Ke],Tr=new e.Point(Ut.x+uo,Ut.y+uo);te=Math.min(te,Tr.x),pe=Math.min(pe,Tr.y),He=Math.max(He,Tr.x),Ce=Math.max(Ce,Tr.y),ge.push(Tr)}for(var Ur=this.grid.query(te,pe,He,Ce).concat(this.ignoredGrid.query(te,pe,He,Ce)),vr={},mt={},Et=0,Bt=Ur;Et<Bt.length;Et+=1){var or=Bt[Et],dr=or.key;if(vr[dr.bucketInstanceId]===void 0&&(vr[dr.bucketInstanceId]={}),!vr[dr.bucketInstanceId][dr.featureIndex]){var ur=[new e.Point(or.x1,or.y1),new e.Point(or.x2,or.y1),new e.Point(or.x2,or.y2),new e.Point(or.x1,or.y2)];e.polygonIntersectsPolygon(ge,ur)&&(vr[dr.bucketInstanceId][dr.featureIndex]=!0,mt[dr.bucketInstanceId]===void 0&&(mt[dr.bucketInstanceId]=[]),mt[dr.bucketInstanceId].push(dr.featureIndex))}}return mt},ss.prototype.insertCollisionBox=function(K,ge,te,pe,He){var Ce=ge?this.ignoredGrid:this.grid,Ke={bucketInstanceId:te,featureIndex:pe,collisionGroupID:He};Ce.insert(Ke,K[0],K[1],K[2],K[3])},ss.prototype.insertCollisionCircles=function(K,ge,te,pe,He){for(var Ce=ge?this.ignoredGrid:this.grid,Ke={bucketInstanceId:te,featureIndex:pe,collisionGroupID:He},pt=0;pt<K.length;pt+=4)Ce.insertCircle(Ke,K[pt],K[pt+1],K[pt+2])},ss.prototype.projectAndGetPerspectiveRatio=function(K,ge,te){var pe=[ge,te,0,1];ns(pe,pe,K);var He=new e.Point((pe[0]/pe[3]+1)/2*this.transform.width+uo,(-pe[1]/pe[3]+1)/2*this.transform.height+uo);return{point:He,perspectiveRatio:.5+.5*(this.transform.cameraToCenterDistance/pe[3])}},ss.prototype.isOffscreen=function(K,ge,te,pe){return te<uo||K>=this.screenRightBoundary||pe<uo||ge>this.screenBottomBoundary},ss.prototype.isInsideGrid=function(K,ge,te,pe){return te>=0&&K<this.gridRightBoundary&&pe>=0&&ge<this.gridBottomBoundary},ss.prototype.getViewportMatrix=function(){var K=e.identity([]);return e.translate(K,K,[-uo,-uo,0]),K};function xs(ve,K,ge){return K*(e.EXTENT/(ve.tileSize*Math.pow(2,ge-ve.tileID.overscaledZ)))}var el=function(K,ge,te,pe){K?this.opacity=Math.max(0,Math.min(1,K.opacity+(K.placed?ge:-ge))):this.opacity=pe&&te?1:0,this.placed=te};el.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var Ss=function(K,ge,te,pe,He){this.text=new el(K?K.text:null,ge,te,He),this.icon=new el(K?K.icon:null,ge,pe,He)};Ss.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Co=function(K,ge,te){this.text=K,this.icon=ge,this.skipFade=te},ao=function(){this.invProjMatrix=e.create(),this.viewportMatrix=e.create(),this.circles=[]},co=function(K,ge,te,pe,He){this.bucketInstanceId=K,this.featureIndex=ge,this.sourceLayerIndex=te,this.bucketIndex=pe,this.tileID=He},Ms=function(K){this.crossSourceCollisions=K,this.maxGroupID=0,this.collisionGroups={}};Ms.prototype.get=function(K){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[K]){var ge=++this.maxGroupID;this.collisionGroups[K]={ID:ge,predicate:function(te){return te.collisionGroupID===ge}}}return this.collisionGroups[K]};function Gs(ve,K,ge,te,pe){var He=e.getAnchorAlignment(ve),Ce=He.horizontalAlign,Ke=He.verticalAlign,pt=-(Ce-.5)*K,Ut=-(Ke-.5)*ge,Tr=e.evaluateVariableOffset(ve,te);return new e.Point(pt+Tr[0]*pe,Ut+Tr[1]*pe)}function ul(ve,K,ge,te,pe,He){var Ce=ve.x1,Ke=ve.x2,pt=ve.y1,Ut=ve.y2,Tr=ve.anchorPointX,Ur=ve.anchorPointY,vr=new e.Point(K,ge);return te&&vr._rotate(pe?He:-He),{x1:Ce+vr.x,y1:pt+vr.y,x2:Ke+vr.x,y2:Ut+vr.y,anchorPointX:Tr,anchorPointY:Ur}}var hs=function(K,ge,te,pe){this.transform=K.clone(),this.collisionIndex=new ss(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=ge,this.retainedQueryData={},this.collisionGroups=new Ms(te),this.collisionCircleArrays={},this.prevPlacement=pe,pe&&(pe.prevPlacement=void 0),this.placedOrientations={}};hs.prototype.getBucketParts=function(K,ge,te,pe){var He=te.getBucket(ge),Ce=te.latestFeatureIndex;if(!(!He||!Ce||ge.id!==He.layerIds[0])){var Ke=te.collisionBoxArray,pt=He.layers[0].layout,Ut=Math.pow(2,this.transform.zoom-te.tileID.overscaledZ),Tr=te.tileSize/e.EXTENT,Ur=this.transform.calculatePosMatrix(te.tileID.toUnwrapped()),vr=pt.get("text-pitch-alignment")==="map",mt=pt.get("text-rotation-alignment")==="map",Et=xs(te,1,this.transform.zoom),Bt=Li(Ur,vr,mt,this.transform,Et),or=null;if(vr){var dr=Ia(Ur,vr,mt,this.transform,Et);or=e.multiply([],this.transform.labelPlaneMatrix,dr)}this.retainedQueryData[He.bucketInstanceId]=new co(He.bucketInstanceId,Ce,He.sourceLayerIndex,He.index,te.tileID);var ur={bucket:He,layout:pt,posMatrix:Ur,textLabelPlaneMatrix:Bt,labelToScreenMatrix:or,scale:Ut,textPixelRatio:Tr,holdingForFade:te.holdingForFade(),collisionBoxArray:Ke,partiallyEvaluatedTextSize:e.evaluateSizeForZoom(He.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(He.sourceID)};if(pe)for(var pr=0,cr=He.sortKeyRanges;pr<cr.length;pr+=1){var Gt=cr[pr],lr=Gt.sortKey,qt=Gt.symbolInstanceStart,zr=Gt.symbolInstanceEnd;K.push({sortKey:lr,symbolInstanceStart:qt,symbolInstanceEnd:zr,parameters:ur})}else K.push({symbolInstanceStart:0,symbolInstanceEnd:He.symbolInstances.length,parameters:ur})}},hs.prototype.attemptAnchorPlacement=function(K,ge,te,pe,He,Ce,Ke,pt,Ut,Tr,Ur,vr,mt,Et,Bt){var or=[vr.textOffset0,vr.textOffset1],dr=Gs(K,te,pe,or,He),ur=this.collisionIndex.placeCollisionBox(ul(ge,dr.x,dr.y,Ce,Ke,this.transform.angle),Ur,pt,Ut,Tr.predicate);if(Bt){var pr=this.collisionIndex.placeCollisionBox(ul(Bt,dr.x,dr.y,Ce,Ke,this.transform.angle),Ur,pt,Ut,Tr.predicate);if(pr.box.length===0)return}if(ur.box.length>0){var cr;return this.prevPlacement&&this.prevPlacement.variableOffsets[vr.crossTileID]&&this.prevPlacement.placements[vr.crossTileID]&&this.prevPlacement.placements[vr.crossTileID].text&&(cr=this.prevPlacement.variableOffsets[vr.crossTileID].anchor),this.variableOffsets[vr.crossTileID]={textOffset:or,width:te,height:pe,anchor:K,textBoxScale:He,prevAnchor:cr},this.markUsedJustification(mt,K,vr,Et),mt.allowVerticalPlacement&&(this.markUsedOrientation(mt,Et,vr),this.placedOrientations[vr.crossTileID]=Et),{shift:dr,placedGlyphBoxes:ur}}},hs.prototype.placeLayerBucketPart=function(K,ge,te){var pe=this,He=K.parameters,Ce=He.bucket,Ke=He.layout,pt=He.posMatrix,Ut=He.textLabelPlaneMatrix,Tr=He.labelToScreenMatrix,Ur=He.textPixelRatio,vr=He.holdingForFade,mt=He.collisionBoxArray,Et=He.partiallyEvaluatedTextSize,Bt=He.collisionGroup,or=Ke.get("text-optional"),dr=Ke.get("icon-optional"),ur=Ke.get("text-allow-overlap"),pr=Ke.get("icon-allow-overlap"),cr=Ke.get("text-rotation-alignment")==="map",Gt=Ke.get("text-pitch-alignment")==="map",lr=Ke.get("icon-text-fit")!=="none",qt=Ke.get("symbol-z-order")==="viewport-y",zr=ur&&(pr||!Ce.hasIconData()||dr),$r=pr&&(ur||!Ce.hasTextData()||or);!Ce.collisionArrays&&mt&&Ce.deserializeCollisionBoxes(mt);var Ai=function(ma,Ma){if(!ge[ma.crossTileID]){if(vr){pe.placements[ma.crossTileID]=new Co(!1,!1,!1);return}var Pa=!1,Ka=!1,Sn=!0,No=null,os={box:null,offscreen:null},Xs={box:null,offscreen:null},ts=null,Vs=null,ll=null,Mu=0,rd=0,id=0;Ma.textFeatureIndex?Mu=Ma.textFeatureIndex:ma.useRuntimeCollisionCircles&&(Mu=ma.featureIndex),Ma.verticalTextFeatureIndex&&(rd=Ma.verticalTextFeatureIndex);var xh=Ma.textBox;if(xh){var hd=function(vc){var _u=e.WritingMode.horizontal;if(Ce.allowVerticalPlacement&&!vc&&pe.prevPlacement){var Th=pe.prevPlacement.placedOrientations[ma.crossTileID];Th&&(pe.placedOrientations[ma.crossTileID]=Th,_u=Th,pe.markUsedOrientation(Ce,_u,ma))}return _u},ev=function(vc,_u){if(Ce.allowVerticalPlacement&&ma.numVerticalGlyphVertices>0&&Ma.verticalTextBox)for(var Th=0,Hv=Ce.writingModes;Th<Hv.length;Th+=1){var wp=Hv[Th];if(wp===e.WritingMode.vertical?(os=_u(),Xs=os):os=vc(),os&&os.box&&os.box.length)break}else os=vc()};if(Ke.get("text-variable-anchor")){var zh=Ke.get("text-variable-anchor");if(pe.prevPlacement&&pe.prevPlacement.variableOffsets[ma.crossTileID]){var wh=pe.prevPlacement.variableOffsets[ma.crossTileID];zh.indexOf(wh.anchor)>0&&(zh=zh.filter(function(vc){return vc!==wh.anchor}),zh.unshift(wh.anchor))}var ad=function(vc,_u,Th){for(var Hv=vc.x2-vc.x1,wp=vc.y2-vc.y1,Du=ma.textBoxScale,h0=lr&&!pr?_u:null,Tv={box:[],offscreen:!1},fm=ur?zh.length*2:zh.length,od=0;od<fm;++od){var Av=zh[od%zh.length],hm=od>=zh.length,d0=pe.attemptAnchorPlacement(Av,vc,Hv,wp,Du,cr,Gt,Ur,pt,Bt,hm,ma,Ce,Th,h0);if(d0&&(Tv=d0.placedGlyphBoxes,Tv&&Tv.box&&Tv.box.length)){Pa=!0,No=d0.shift;break}}return Tv},dd=function(){return ad(xh,Ma.iconBox,e.WritingMode.horizontal)},nd=function(){var vc=Ma.verticalTextBox,_u=os&&os.box&&os.box.length;return Ce.allowVerticalPlacement&&!_u&&ma.numVerticalGlyphVertices>0&&vc?ad(vc,Ma.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}};ev(dd,nd),os&&(Pa=os.box,Sn=os.offscreen);var jv=hd(os&&os.box);if(!Pa&&pe.prevPlacement){var tv=pe.prevPlacement.variableOffsets[ma.crossTileID];tv&&(pe.variableOffsets[ma.crossTileID]=tv,pe.markUsedJustification(Ce,tv.anchor,ma,jv))}}else{var Md=function(vc,_u){var Th=pe.collisionIndex.placeCollisionBox(vc,ur,Ur,pt,Bt.predicate);return Th&&Th.box&&Th.box.length&&(pe.markUsedOrientation(Ce,_u,ma),pe.placedOrientations[ma.crossTileID]=_u),Th},bh=function(){return Md(xh,e.WritingMode.horizontal)},Ed=function(){var vc=Ma.verticalTextBox;return Ce.allowVerticalPlacement&&ma.numVerticalGlyphVertices>0&&vc?Md(vc,e.WritingMode.vertical):{box:null,offscreen:null}};ev(bh,Ed),hd(os&&os.box&&os.box.length)}}if(ts=os,Pa=ts&&ts.box&&ts.box.length>0,Sn=ts&&ts.offscreen,ma.useRuntimeCollisionCircles){var Uf=Ce.text.placedSymbolArray.get(ma.centerJustifiedTextSymbolIndex),rv=e.evaluateSizeForFeature(Ce.textSizeData,Et,Uf),Vv=Ke.get("text-padding"),oh=ma.collisionCircleDiameter;Vs=pe.collisionIndex.placeCollisionCircles(ur,Uf,Ce.lineVertexArray,Ce.glyphOffsetArray,rv,pt,Ut,Tr,te,Gt,Bt.predicate,oh,Vv),Pa=ur||Vs.circles.length>0&&!Vs.collisionDetected,Sn=Sn&&Vs.offscreen}if(Ma.iconFeatureIndex&&(id=Ma.iconFeatureIndex),Ma.iconBox){var xv=function(vc){var _u=lr&&No?ul(vc,No.x,No.y,cr,Gt,pe.transform.angle):vc;return pe.collisionIndex.placeCollisionBox(_u,pr,Ur,pt,Bt.predicate)};Xs&&Xs.box&&Xs.box.length&&Ma.verticalIconBox?(ll=xv(Ma.verticalIconBox),Ka=ll.box.length>0):(ll=xv(Ma.iconBox),Ka=ll.box.length>0),Sn=Sn&&ll.offscreen}var xp=or||ma.numHorizontalGlyphVertices===0&&ma.numVerticalGlyphVertices===0,bp=dr||ma.numIconVertices===0;if(!xp&&!bp?Ka=Pa=Ka&&Pa:bp?xp||(Ka=Ka&&Pa):Pa=Ka&&Pa,Pa&&ts&&ts.box&&(Xs&&Xs.box&&rd?pe.collisionIndex.insertCollisionBox(ts.box,Ke.get("text-ignore-placement"),Ce.bucketInstanceId,rd,Bt.ID):pe.collisionIndex.insertCollisionBox(ts.box,Ke.get("text-ignore-placement"),Ce.bucketInstanceId,Mu,Bt.ID)),Ka&&ll&&pe.collisionIndex.insertCollisionBox(ll.box,Ke.get("icon-ignore-placement"),Ce.bucketInstanceId,id,Bt.ID),Vs&&(Pa&&pe.collisionIndex.insertCollisionCircles(Vs.circles,Ke.get("text-ignore-placement"),Ce.bucketInstanceId,Mu,Bt.ID),te)){var qv=Ce.bucketInstanceId,bv=pe.collisionCircleArrays[qv];bv===void 0&&(bv=pe.collisionCircleArrays[qv]=new ao);for(var wv=0;wv<Vs.circles.length;wv+=4)bv.circles.push(Vs.circles[wv+0]),bv.circles.push(Vs.circles[wv+1]),bv.circles.push(Vs.circles[wv+2]),bv.circles.push(Vs.collisionDetected?1:0)}pe.placements[ma.crossTileID]=new Co(Pa||zr,Ka||$r,Sn||Ce.justReloaded),ge[ma.crossTileID]=!0}};if(qt)for(var wa=Ce.getSortedSymbolIndexes(this.transform.angle),Ji=wa.length-1;Ji>=0;--Ji){var fa=wa[Ji];Ai(Ce.symbolInstances.get(fa),Ce.collisionArrays[fa])}else for(var sn=K.symbolInstanceStart;sn<K.symbolInstanceEnd;sn++)Ai(Ce.symbolInstances.get(sn),Ce.collisionArrays[sn]);if(te&&Ce.bucketInstanceId in this.collisionCircleArrays){var Ga=this.collisionCircleArrays[Ce.bucketInstanceId];e.invert(Ga.invProjMatrix,pt),Ga.viewportMatrix=this.collisionIndex.getViewportMatrix()}Ce.justReloaded=!1},hs.prototype.markUsedJustification=function(K,ge,te,pe){var He={left:te.leftJustifiedTextSymbolIndex,center:te.centerJustifiedTextSymbolIndex,right:te.rightJustifiedTextSymbolIndex},Ce;pe===e.WritingMode.vertical?Ce=te.verticalPlacedTextSymbolIndex:Ce=He[e.getAnchorJustification(ge)];for(var Ke=[te.leftJustifiedTextSymbolIndex,te.centerJustifiedTextSymbolIndex,te.rightJustifiedTextSymbolIndex,te.verticalPlacedTextSymbolIndex],pt=0,Ut=Ke;pt<Ut.length;pt+=1){var Tr=Ut[pt];Tr>=0&&(Ce>=0&&Tr!==Ce?K.text.placedSymbolArray.get(Tr).crossTileID=0:K.text.placedSymbolArray.get(Tr).crossTileID=te.crossTileID)}},hs.prototype.markUsedOrientation=function(K,ge,te){for(var pe=ge===e.WritingMode.horizontal||ge===e.WritingMode.horizontalOnly?ge:0,He=ge===e.WritingMode.vertical?ge:0,Ce=[te.leftJustifiedTextSymbolIndex,te.centerJustifiedTextSymbolIndex,te.rightJustifiedTextSymbolIndex],Ke=0,pt=Ce;Ke<pt.length;Ke+=1){var Ut=pt[Ke];K.text.placedSymbolArray.get(Ut).placedOrientation=pe}te.verticalPlacedTextSymbolIndex&&(K.text.placedSymbolArray.get(te.verticalPlacedTextSymbolIndex).placedOrientation=He)},hs.prototype.commit=function(K){this.commitTime=K,this.zoomAtLastRecencyCheck=this.transform.zoom;var ge=this.prevPlacement,te=!1;this.prevZoomAdjustment=ge?ge.zoomAdjustment(this.transform.zoom):0;var pe=ge?ge.symbolFadeChange(K):1,He=ge?ge.opacities:{},Ce=ge?ge.variableOffsets:{},Ke=ge?ge.placedOrientations:{};for(var pt in this.placements){var Ut=this.placements[pt],Tr=He[pt];Tr?(this.opacities[pt]=new Ss(Tr,pe,Ut.text,Ut.icon),te=te||Ut.text!==Tr.text.placed||Ut.icon!==Tr.icon.placed):(this.opacities[pt]=new Ss(null,pe,Ut.text,Ut.icon,Ut.skipFade),te=te||Ut.text||Ut.icon)}for(var Ur in He){var vr=He[Ur];if(!this.opacities[Ur]){var mt=new Ss(vr,pe,!1,!1);mt.isHidden()||(this.opacities[Ur]=mt,te=te||vr.text.placed||vr.icon.placed)}}for(var Et in Ce)!this.variableOffsets[Et]&&this.opacities[Et]&&!this.opacities[Et].isHidden()&&(this.variableOffsets[Et]=Ce[Et]);for(var Bt in Ke)!this.placedOrientations[Bt]&&this.opacities[Bt]&&!this.opacities[Bt].isHidden()&&(this.placedOrientations[Bt]=Ke[Bt]);te?this.lastPlacementChangeTime=K:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=ge?ge.lastPlacementChangeTime:K)},hs.prototype.updateLayerOpacities=function(K,ge){for(var te={},pe=0,He=ge;pe<He.length;pe+=1){var Ce=He[pe],Ke=Ce.getBucket(K);Ke&&Ce.latestFeatureIndex&&K.id===Ke.layerIds[0]&&this.updateBucketOpacities(Ke,te,Ce.collisionBoxArray)}},hs.prototype.updateBucketOpacities=function(K,ge,te){var pe=this;K.hasTextData()&&K.text.opacityVertexArray.clear(),K.hasIconData()&&K.icon.opacityVertexArray.clear(),K.hasIconCollisionBoxData()&&K.iconCollisionBox.collisionVertexArray.clear(),K.hasTextCollisionBoxData()&&K.textCollisionBox.collisionVertexArray.clear();var He=K.layers[0].layout,Ce=new Ss(null,0,!1,!1,!0),Ke=He.get("text-allow-overlap"),pt=He.get("icon-allow-overlap"),Ut=He.get("text-variable-anchor"),Tr=He.get("text-rotation-alignment")==="map",Ur=He.get("text-pitch-alignment")==="map",vr=He.get("icon-text-fit")!=="none",mt=new Ss(null,0,Ke&&(pt||!K.hasIconData()||He.get("icon-optional")),pt&&(Ke||!K.hasTextData()||He.get("text-optional")),!0);!K.collisionArrays&&te&&(K.hasIconCollisionBoxData()||K.hasTextCollisionBoxData())&&K.deserializeCollisionBoxes(te);for(var Et=function(ur,pr,cr){for(var Gt=0;Gt<pr/4;Gt++)ur.opacityVertexArray.emplaceBack(cr)},Bt=function(ur){var pr=K.symbolInstances.get(ur),cr=pr.numHorizontalGlyphVertices,Gt=pr.numVerticalGlyphVertices,lr=pr.crossTileID,qt=ge[lr],zr=pe.opacities[lr];qt?zr=Ce:zr||(zr=mt,pe.opacities[lr]=zr),ge[lr]=!0;var $r=cr>0||Gt>0,Ai=pr.numIconVertices>0,wa=pe.placedOrientations[pr.crossTileID],Ji=wa===e.WritingMode.vertical,fa=wa===e.WritingMode.horizontal||wa===e.WritingMode.horizontalOnly;if($r){var sn=yl(zr.text),Ga=Ji?On:sn;Et(K.text,cr,Ga);var ma=fa?On:sn;Et(K.text,Gt,ma);var Ma=zr.text.isHidden();[pr.rightJustifiedTextSymbolIndex,pr.centerJustifiedTextSymbolIndex,pr.leftJustifiedTextSymbolIndex].forEach(function(id){id>=0&&(K.text.placedSymbolArray.get(id).hidden=Ma||Ji?1:0)}),pr.verticalPlacedTextSymbolIndex>=0&&(K.text.placedSymbolArray.get(pr.verticalPlacedTextSymbolIndex).hidden=Ma||fa?1:0);var Pa=pe.variableOffsets[pr.crossTileID];Pa&&pe.markUsedJustification(K,Pa.anchor,pr,wa);var Ka=pe.placedOrientations[pr.crossTileID];Ka&&(pe.markUsedJustification(K,"left",pr,Ka),pe.markUsedOrientation(K,Ka,pr))}if(Ai){var Sn=yl(zr.icon),No=!(vr&&pr.verticalPlacedIconSymbolIndex&&Ji);if(pr.placedIconSymbolIndex>=0){var os=No?Sn:On;Et(K.icon,pr.numIconVertices,os),K.icon.placedSymbolArray.get(pr.placedIconSymbolIndex).hidden=zr.icon.isHidden()}if(pr.verticalPlacedIconSymbolIndex>=0){var Xs=No?On:Sn;Et(K.icon,pr.numVerticalIconVertices,Xs),K.icon.placedSymbolArray.get(pr.verticalPlacedIconSymbolIndex).hidden=zr.icon.isHidden()}}if(K.hasIconCollisionBoxData()||K.hasTextCollisionBoxData()){var ts=K.collisionArrays[ur];if(ts){var Vs=new e.Point(0,0);if(ts.textBox||ts.verticalTextBox){var ll=!0;if(Ut){var Mu=pe.variableOffsets[lr];Mu?(Vs=Gs(Mu.anchor,Mu.width,Mu.height,Mu.textOffset,Mu.textBoxScale),Tr&&Vs._rotate(Ur?pe.transform.angle:-pe.transform.angle)):ll=!1}ts.textBox&&rn(K.textCollisionBox.collisionVertexArray,zr.text.placed,!ll||Ji,Vs.x,Vs.y),ts.verticalTextBox&&rn(K.textCollisionBox.collisionVertexArray,zr.text.placed,!ll||fa,Vs.x,Vs.y)}var rd=!!(!fa&&ts.verticalIconBox);ts.iconBox&&rn(K.iconCollisionBox.collisionVertexArray,zr.icon.placed,rd,vr?Vs.x:0,vr?Vs.y:0),ts.verticalIconBox&&rn(K.iconCollisionBox.collisionVertexArray,zr.icon.placed,!rd,vr?Vs.x:0,vr?Vs.y:0)}}},or=0;or<K.symbolInstances.length;or++)Bt(or);if(K.sortFeatures(this.transform.angle),this.retainedQueryData[K.bucketInstanceId]&&(this.retainedQueryData[K.bucketInstanceId].featureSortOrder=K.featureSortOrder),K.hasTextData()&&K.text.opacityVertexBuffer&&K.text.opacityVertexBuffer.updateData(K.text.opacityVertexArray),K.hasIconData()&&K.icon.opacityVertexBuffer&&K.icon.opacityVertexBuffer.updateData(K.icon.opacityVertexArray),K.hasIconCollisionBoxData()&&K.iconCollisionBox.collisionVertexBuffer&&K.iconCollisionBox.collisionVertexBuffer.updateData(K.iconCollisionBox.collisionVertexArray),K.hasTextCollisionBoxData()&&K.textCollisionBox.collisionVertexBuffer&&K.textCollisionBox.collisionVertexBuffer.updateData(K.textCollisionBox.collisionVertexArray),K.bucketInstanceId in this.collisionCircleArrays){var dr=this.collisionCircleArrays[K.bucketInstanceId];K.placementInvProjMatrix=dr.invProjMatrix,K.placementViewportMatrix=dr.viewportMatrix,K.collisionCircleArray=dr.circles,delete this.collisionCircleArrays[K.bucketInstanceId]}},hs.prototype.symbolFadeChange=function(K){return this.fadeDuration===0?1:(K-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},hs.prototype.zoomAdjustment=function(K){return Math.max(0,(this.transform.zoom-K)/1.5)},hs.prototype.hasTransitions=function(K){return this.stale||K-this.lastPlacementChangeTime<this.fadeDuration},hs.prototype.stillRecent=function(K,ge){var te=this.zoomAtLastRecencyCheck===ge?1-this.zoomAdjustment(ge):1;return this.zoomAtLastRecencyCheck=ge,this.commitTime+this.fadeDuration*te>K},hs.prototype.setStale=function(){this.stale=!0};function rn(ve,K,ge,te,pe){ve.emplaceBack(K?1:0,ge?1:0,te||0,pe||0),ve.emplaceBack(K?1:0,ge?1:0,te||0,pe||0),ve.emplaceBack(K?1:0,ge?1:0,te||0,pe||0),ve.emplaceBack(K?1:0,ge?1:0,te||0,pe||0)}var Xn=Math.pow(2,25),tl=Math.pow(2,24),zs=Math.pow(2,17),so=Math.pow(2,16),$s=Math.pow(2,9),Ps=Math.pow(2,8),nl=Math.pow(2,1);function yl(ve){if(ve.opacity===0&&!ve.placed)return 0;if(ve.opacity===1&&ve.placed)return 4294967295;var K=ve.placed?1:0,ge=Math.floor(ve.opacity*127);return ge*Xn+K*tl+ge*zs+K*so+ge*$s+K*Ps+ge*nl+K}var On=0,Ko=function(K){this._sortAcrossTiles=K.layout.get("symbol-z-order")!=="viewport-y"&&K.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Ko.prototype.continuePlacement=function(K,ge,te,pe,He){for(var Ce=this._bucketParts;this._currentTileIndex<K.length;){var Ke=K[this._currentTileIndex];if(ge.getBucketParts(Ce,pe,Ke,this._sortAcrossTiles),this._currentTileIndex++,He())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,Ce.sort(function(Ut,Tr){return Ut.sortKey-Tr.sortKey}));this._currentPartIndex<Ce.length;){var pt=Ce[this._currentPartIndex];if(ge.placeLayerBucketPart(pt,this._seenCrossTileIDs,te),this._currentPartIndex++,He())return!0}return!1};var jo=function(K,ge,te,pe,He,Ce,Ke){this.placement=new hs(K,He,Ce,Ke),this._currentPlacementIndex=ge.length-1,this._forceFullPlacement=te,this._showCollisionBoxes=pe,this._done=!1};jo.prototype.isDone=function(){return this._done},jo.prototype.continuePlacement=function(K,ge,te){for(var pe=this,He=e.browser.now(),Ce=function(){var Ur=e.browser.now()-He;return pe._forceFullPlacement?!1:Ur>2};this._currentPlacementIndex>=0;){var Ke=K[this._currentPlacementIndex],pt=ge[Ke],Ut=this.placement.collisionIndex.transform.zoom;if(pt.type==="symbol"&&(!pt.minzoom||pt.minzoom<=Ut)&&(!pt.maxzoom||pt.maxzoom>Ut)){this._inProgressLayer||(this._inProgressLayer=new Ko(pt));var Tr=this._inProgressLayer.continuePlacement(te[pt.source],this.placement,this._showCollisionBoxes,pt,Ce);if(Tr)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},jo.prototype.commit=function(K){return this.placement.commit(K),this.placement};var Ys=512/e.EXTENT/2,Tu=function(K,ge,te){this.tileID=K,this.indexedSymbolInstances={},this.bucketInstanceId=te;for(var pe=0;pe<ge.length;pe++){var He=ge.get(pe),Ce=He.key;this.indexedSymbolInstances[Ce]||(this.indexedSymbolInstances[Ce]=[]),this.indexedSymbolInstances[Ce].push({crossTileID:He.crossTileID,coord:this.getScaledCoordinates(He,K)})}};Tu.prototype.getScaledCoordinates=function(K,ge){var te=ge.canonical.z-this.tileID.canonical.z,pe=Ys/Math.pow(2,te);return{x:Math.floor((ge.canonical.x*e.EXTENT+K.anchorX)*pe),y:Math.floor((ge.canonical.y*e.EXTENT+K.anchorY)*pe)}},Tu.prototype.findMatches=function(K,ge,te){for(var pe=this.tileID.canonical.z<ge.canonical.z?1:Math.pow(2,this.tileID.canonical.z-ge.canonical.z),He=0;He<K.length;He++){var Ce=K.get(He);if(!Ce.crossTileID){var Ke=this.indexedSymbolInstances[Ce.key];if(Ke)for(var pt=this.getScaledCoordinates(Ce,ge),Ut=0,Tr=Ke;Ut<Tr.length;Ut+=1){var Ur=Tr[Ut];if(Math.abs(Ur.coord.x-pt.x)<=pe&&Math.abs(Ur.coord.y-pt.y)<=pe&&!te[Ur.crossTileID]){te[Ur.crossTileID]=!0,Ce.crossTileID=Ur.crossTileID;break}}}}};var Lo=function(){this.maxCrossTileID=0};Lo.prototype.generate=function(){return++this.maxCrossTileID};var al=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};al.prototype.handleWrapJump=function(K){var ge=Math.round((K-this.lng)/360);if(ge!==0)for(var te in this.indexes){var pe=this.indexes[te],He={};for(var Ce in pe){var Ke=pe[Ce];Ke.tileID=Ke.tileID.unwrapTo(Ke.tileID.wrap+ge),He[Ke.tileID.key]=Ke}this.indexes[te]=He}this.lng=K},al.prototype.addBucket=function(K,ge,te){if(this.indexes[K.overscaledZ]&&this.indexes[K.overscaledZ][K.key]){if(this.indexes[K.overscaledZ][K.key].bucketInstanceId===ge.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(K.overscaledZ,this.indexes[K.overscaledZ][K.key])}for(var pe=0;pe<ge.symbolInstances.length;pe++){var He=ge.symbolInstances.get(pe);He.crossTileID=0}this.usedCrossTileIDs[K.overscaledZ]||(this.usedCrossTileIDs[K.overscaledZ]={});var Ce=this.usedCrossTileIDs[K.overscaledZ];for(var Ke in this.indexes){var pt=this.indexes[Ke];if(Number(Ke)>K.overscaledZ)for(var Ut in pt){var Tr=pt[Ut];Tr.tileID.isChildOf(K)&&Tr.findMatches(ge.symbolInstances,K,Ce)}else{var Ur=K.scaledTo(Number(Ke)),vr=pt[Ur.key];vr&&vr.findMatches(ge.symbolInstances,K,Ce)}}for(var mt=0;mt<ge.symbolInstances.length;mt++){var Et=ge.symbolInstances.get(mt);Et.crossTileID||(Et.crossTileID=te.generate(),Ce[Et.crossTileID]=!0)}return this.indexes[K.overscaledZ]===void 0&&(this.indexes[K.overscaledZ]={}),this.indexes[K.overscaledZ][K.key]=new Tu(K,ge.symbolInstances,ge.bucketInstanceId),!0},al.prototype.removeBucketCrossTileIDs=function(K,ge){for(var te in ge.indexedSymbolInstances)for(var pe=0,He=ge.indexedSymbolInstances[te];pe<He.length;pe+=1){var Ce=He[pe];delete this.usedCrossTileIDs[K][Ce.crossTileID]}},al.prototype.removeStaleBuckets=function(K){var ge=!1;for(var te in this.indexes){var pe=this.indexes[te];for(var He in pe)K[pe[He].bucketInstanceId]||(this.removeBucketCrossTileIDs(te,pe[He]),delete pe[He],ge=!0)}return ge};var kl=function(){this.layerIndexes={},this.crossTileIDs=new Lo,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};kl.prototype.addLayer=function(K,ge,te){var pe=this.layerIndexes[K.id];pe===void 0&&(pe=this.layerIndexes[K.id]=new al);var He=!1,Ce={};pe.handleWrapJump(te);for(var Ke=0,pt=ge;Ke<pt.length;Ke+=1){var Ut=pt[Ke],Tr=Ut.getBucket(K);!Tr||K.id!==Tr.layerIds[0]||(Tr.bucketInstanceId||(Tr.bucketInstanceId=++this.maxBucketInstanceId),pe.addBucket(Ut.tileID,Tr,this.crossTileIDs)&&(He=!0),Ce[Tr.bucketInstanceId]=!0)}return pe.removeStaleBuckets(Ce)&&(He=!0),He},kl.prototype.pruneUnusedLayers=function(K){var ge={};K.forEach(function(pe){ge[pe]=!0});for(var te in this.layerIndexes)ge[te]||delete this.layerIndexes[te]};var Ns=function(ve,K){return e.emitValidationErrors(ve,K&&K.filter(function(ge){return ge.identifier!=="source.canvas"}))},rl=e.pick(Lr,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Es=e.pick(Lr,["setCenter","setZoom","setBearing","setPitch"]),Us=Nr(),Zl=function(ve){function K(ge,te){var pe=this;te===void 0&&(te={}),ve.call(this),this.map=ge,this.dispatcher=new N(pn(),this),this.imageManager=new _,this.imageManager.setEventedParent(this),this.glyphManager=new y(ge._requestManager,te.localIdeographFontFamily),this.lineAtlas=new F(256,512),this.crossTileSymbolIndex=new kl,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",e.getReferrer());var He=this;this._rtlTextPluginCallback=K.registerForPluginStateChange(function(Ce){var Ke={pluginStatus:Ce.pluginStatus,pluginURL:Ce.pluginURL};He.dispatcher.broadcast("syncRTLPluginState",Ke,function(pt,Ut){if(e.triggerPluginCompletionEvent(pt),Ut){var Tr=Ut.every(function(vr){return vr});if(Tr)for(var Ur in He.sourceCaches)He.sourceCaches[Ur].reload()}})}),this.on("data",function(Ce){if(!(Ce.dataType!=="source"||Ce.sourceDataType!=="metadata")){var Ke=pe.sourceCaches[Ce.sourceId];if(Ke){var pt=Ke.getSource();if(!(!pt||!pt.vectorLayerIds))for(var Ut in pe._layers){var Tr=pe._layers[Ut];Tr.source===pt.id&&pe._validateLayer(Tr)}}}})}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.loadURL=function(te,pe){var He=this;pe===void 0&&(pe={}),this.fire(new e.Event("dataloading",{dataType:"style"}));var Ce=typeof pe.validate=="boolean"?pe.validate:!e.isMapboxURL(te);te=this.map._requestManager.normalizeStyleURL(te,pe.accessToken);var Ke=this.map._requestManager.transformRequest(te,e.ResourceType.Style);this._request=e.getJSON(Ke,function(pt,Ut){He._request=null,pt?He.fire(new e.ErrorEvent(pt)):Ut&&He._load(Ut,Ce)})},K.prototype.loadJSON=function(te,pe){var He=this;pe===void 0&&(pe={}),this.fire(new e.Event("dataloading",{dataType:"style"})),this._request=e.browser.frame(function(){He._request=null,He._load(te,pe.validate!==!1)})},K.prototype.loadEmpty=function(){this.fire(new e.Event("dataloading",{dataType:"style"})),this._load(Us,!1)},K.prototype._load=function(te,pe){if(!(pe&&Ns(this,e.validateStyle(te)))){this._loaded=!0,this.stylesheet=te;for(var He in te.sources)this.addSource(He,te.sources[He],{validate:!1});te.sprite?this._loadSprite(te.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(te.glyphs);var Ce=st(this.stylesheet.layers);this._order=Ce.map(function(Tr){return Tr.id}),this._layers={},this._serializedLayers={};for(var Ke=0,pt=Ce;Ke<pt.length;Ke+=1){var Ut=pt[Ke];Ut=e.createStyleLayer(Ut),Ut.setEventedParent(this,{layer:{id:Ut.id}}),this._layers[Ut.id]=Ut,this._serializedLayers[Ut.id]=Ut.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new z(this.stylesheet.light),this.fire(new e.Event("data",{dataType:"style"})),this.fire(new e.Event("style.load"))}},K.prototype._loadSprite=function(te){var pe=this;this._spriteRequest=d(te,this.map._requestManager,function(He,Ce){if(pe._spriteRequest=null,He)pe.fire(new e.ErrorEvent(He));else if(Ce)for(var Ke in Ce)pe.imageManager.addImage(Ke,Ce[Ke]);pe.imageManager.setLoaded(!0),pe._availableImages=pe.imageManager.listImages(),pe.dispatcher.broadcast("setImages",pe._availableImages),pe.fire(new e.Event("data",{dataType:"style"}))})},K.prototype._validateLayer=function(te){var pe=this.sourceCaches[te.source];if(pe){var He=te.sourceLayer;if(He){var Ce=pe.getSource();(Ce.type==="geojson"||Ce.vectorLayerIds&&Ce.vectorLayerIds.indexOf(He)===-1)&&this.fire(new e.ErrorEvent(new Error('Source layer "'+He+'" does not exist on source "'+Ce.id+'" as specified by style layer "'+te.id+'"')))}}},K.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var te in this.sourceCaches)if(!this.sourceCaches[te].loaded())return!1;return!!this.imageManager.isLoaded()},K.prototype._serializeLayers=function(te){for(var pe=[],He=0,Ce=te;He<Ce.length;He+=1){var Ke=Ce[He],pt=this._layers[Ke];pt.type!=="custom"&&pe.push(pt.serialize())}return pe},K.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var te in this.sourceCaches)if(this.sourceCaches[te].hasTransition())return!0;for(var pe in this._layers)if(this._layers[pe].hasTransition())return!0;return!1},K.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},K.prototype.update=function(te){if(this._loaded){var pe=this._changed;if(this._changed){var He=Object.keys(this._updatedLayers),Ce=Object.keys(this._removedLayers);(He.length||Ce.length)&&this._updateWorkerLayers(He,Ce);for(var Ke in this._updatedSources){var pt=this._updatedSources[Ke];pt==="reload"?this._reloadSource(Ke):pt==="clear"&&this._clearSource(Ke)}this._updateTilesForChangedImages();for(var Ut in this._updatedPaintProps)this._layers[Ut].updateTransitions(te);this.light.updateTransitions(te),this._resetUpdates()}var Tr={};for(var Ur in this.sourceCaches){var vr=this.sourceCaches[Ur];Tr[Ur]=vr.used,vr.used=!1}for(var mt=0,Et=this._order;mt<Et.length;mt+=1){var Bt=Et[mt],or=this._layers[Bt];or.recalculate(te,this._availableImages),!or.isHidden(te.zoom)&&or.source&&(this.sourceCaches[or.source].used=!0)}for(var dr in Tr){var ur=this.sourceCaches[dr];Tr[dr]!==ur.used&&ur.fire(new e.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:dr}))}this.light.recalculate(te),this.z=te.zoom,pe&&this.fire(new e.Event("data",{dataType:"style"}))}},K.prototype._updateTilesForChangedImages=function(){var te=Object.keys(this._changedImages);if(te.length){for(var pe in this.sourceCaches)this.sourceCaches[pe].reloadTilesForDependencies(["icons","patterns"],te);this._changedImages={}}},K.prototype._updateWorkerLayers=function(te,pe){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(te),removedIds:pe})},K.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},K.prototype.setState=function(te){var pe=this;if(this._checkLoaded(),Ns(this,e.validateStyle(te)))return!1;te=e.clone$1(te),te.layers=st(te.layers);var He=Ni(this.serialize(),te).filter(function(Ke){return!(Ke.command in Es)});if(He.length===0)return!1;var Ce=He.filter(function(Ke){return!(Ke.command in rl)});if(Ce.length>0)throw new Error("Unimplemented: "+Ce.map(function(Ke){return Ke.command}).join(", ")+".");return He.forEach(function(Ke){Ke.command!=="setTransition"&&pe[Ke.command].apply(pe,Ke.args)}),this.stylesheet=te,!0},K.prototype.addImage=function(te,pe){if(this.getImage(te))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(te,pe),this._afterImageUpdated(te)},K.prototype.updateImage=function(te,pe){this.imageManager.updateImage(te,pe)},K.prototype.getImage=function(te){return this.imageManager.getImage(te)},K.prototype.removeImage=function(te){if(!this.getImage(te))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(te),this._afterImageUpdated(te)},K.prototype._afterImageUpdated=function(te){this._availableImages=this.imageManager.listImages(),this._changedImages[te]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))},K.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},K.prototype.addSource=function(te,pe,He){var Ce=this;if(He===void 0&&(He={}),this._checkLoaded(),this.sourceCaches[te]!==void 0)throw new Error("There is already a source with this ID");if(!pe.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(pe).join(", ")+".");var Ke=["vector","raster","geojson","video","image"],pt=Ke.indexOf(pe.type)>=0;if(!(pt&&this._validate(e.validateStyle.source,"sources."+te,pe,null,He))){this.map&&this.map._collectResourceTiming&&(pe.collectResourceTiming=!0);var Ut=this.sourceCaches[te]=new ii(te,pe,this.dispatcher);Ut.style=this,Ut.setEventedParent(this,function(){return{isSourceLoaded:Ce.loaded(),source:Ut.serialize(),sourceId:te}}),Ut.onAdd(this.map),this._changed=!0}},K.prototype.removeSource=function(te){if(this._checkLoaded(),this.sourceCaches[te]===void 0)throw new Error("There is no source with this ID");for(var pe in this._layers)if(this._layers[pe].source===te)return this.fire(new e.ErrorEvent(new Error('Source "'+te+'" cannot be removed while layer "'+pe+'" is using it.')));var He=this.sourceCaches[te];delete this.sourceCaches[te],delete this._updatedSources[te],He.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:te})),He.setEventedParent(null),He.clearTiles(),He.onRemove&&He.onRemove(this.map),this._changed=!0},K.prototype.setGeoJSONSourceData=function(te,pe){this._checkLoaded();var He=this.sourceCaches[te].getSource();He.setData(pe),this._changed=!0},K.prototype.getSource=function(te){return this.sourceCaches[te]&&this.sourceCaches[te].getSource()},K.prototype.addLayer=function(te,pe,He){He===void 0&&(He={}),this._checkLoaded();var Ce=te.id;if(this.getLayer(Ce)){this.fire(new e.ErrorEvent(new Error('Layer with id "'+Ce+'" already exists on this map')));return}var Ke;if(te.type==="custom"){if(Ns(this,e.validateCustomStyleLayer(te)))return;Ke=e.createStyleLayer(te)}else{if(typeof te.source=="object"&&(this.addSource(Ce,te.source),te=e.clone$1(te),te=e.extend(te,{source:Ce})),this._validate(e.validateStyle.layer,"layers."+Ce,te,{arrayIndex:-1},He))return;Ke=e.createStyleLayer(te),this._validateLayer(Ke),Ke.setEventedParent(this,{layer:{id:Ce}}),this._serializedLayers[Ke.id]=Ke.serialize()}var pt=pe?this._order.indexOf(pe):this._order.length;if(pe&&pt===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+pe+'" does not exist on this map.')));return}if(this._order.splice(pt,0,Ce),this._layerOrderChanged=!0,this._layers[Ce]=Ke,this._removedLayers[Ce]&&Ke.source&&Ke.type!=="custom"){var Ut=this._removedLayers[Ce];delete this._removedLayers[Ce],Ut.type!==Ke.type?this._updatedSources[Ke.source]="clear":(this._updatedSources[Ke.source]="reload",this.sourceCaches[Ke.source].pause())}this._updateLayer(Ke),Ke.onAdd&&Ke.onAdd(this.map)},K.prototype.moveLayer=function(te,pe){this._checkLoaded(),this._changed=!0;var He=this._layers[te];if(!He){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be moved.")));return}if(te!==pe){var Ce=this._order.indexOf(te);this._order.splice(Ce,1);var Ke=pe?this._order.indexOf(pe):this._order.length;if(pe&&Ke===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+pe+'" does not exist on this map.')));return}this._order.splice(Ke,0,te),this._layerOrderChanged=!0}},K.prototype.removeLayer=function(te){this._checkLoaded();var pe=this._layers[te];if(!pe){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be removed.")));return}pe.setEventedParent(null);var He=this._order.indexOf(te);this._order.splice(He,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[te]=pe,delete this._layers[te],delete this._serializedLayers[te],delete this._updatedLayers[te],delete this._updatedPaintProps[te],pe.onRemove&&pe.onRemove(this.map)},K.prototype.getLayer=function(te){return this._layers[te]},K.prototype.hasLayer=function(te){return te in this._layers},K.prototype.setLayerZoomRange=function(te,pe,He){this._checkLoaded();var Ce=this.getLayer(te);if(!Ce){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot have zoom extent.")));return}Ce.minzoom===pe&&Ce.maxzoom===He||(pe!=null&&(Ce.minzoom=pe),He!=null&&(Ce.maxzoom=He),this._updateLayer(Ce))},K.prototype.setFilter=function(te,pe,He){He===void 0&&(He={}),this._checkLoaded();var Ce=this.getLayer(te);if(!Ce){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be filtered.")));return}if(!e.deepEqual(Ce.filter,pe)){if(pe==null){Ce.filter=void 0,this._updateLayer(Ce);return}this._validate(e.validateStyle.filter,"layers."+Ce.id+".filter",pe,null,He)||(Ce.filter=e.clone$1(pe),this._updateLayer(Ce))}},K.prototype.getFilter=function(te){return e.clone$1(this.getLayer(te).filter)},K.prototype.setLayoutProperty=function(te,pe,He,Ce){Ce===void 0&&(Ce={}),this._checkLoaded();var Ke=this.getLayer(te);if(!Ke){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be styled.")));return}e.deepEqual(Ke.getLayoutProperty(pe),He)||(Ke.setLayoutProperty(pe,He,Ce),this._updateLayer(Ke))},K.prototype.getLayoutProperty=function(te,pe){var He=this.getLayer(te);if(!He){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style.")));return}return He.getLayoutProperty(pe)},K.prototype.setPaintProperty=function(te,pe,He,Ce){Ce===void 0&&(Ce={}),this._checkLoaded();var Ke=this.getLayer(te);if(!Ke){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be styled.")));return}if(!e.deepEqual(Ke.getPaintProperty(pe),He)){var pt=Ke.setPaintProperty(pe,He,Ce);pt&&this._updateLayer(Ke),this._changed=!0,this._updatedPaintProps[te]=!0}},K.prototype.getPaintProperty=function(te,pe){return this.getLayer(te).getPaintProperty(pe)},K.prototype.setFeatureState=function(te,pe){this._checkLoaded();var He=te.source,Ce=te.sourceLayer,Ke=this.sourceCaches[He];if(Ke===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+He+"' does not exist in the map's style.")));return}var pt=Ke.getSource().type;if(pt==="geojson"&&Ce){this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(pt==="vector"&&!Ce){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}te.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),Ke.setFeatureState(Ce,te.id,pe)},K.prototype.removeFeatureState=function(te,pe){this._checkLoaded();var He=te.source,Ce=this.sourceCaches[He];if(Ce===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+He+"' does not exist in the map's style.")));return}var Ke=Ce.getSource().type,pt=Ke==="vector"?te.sourceLayer:void 0;if(Ke==="vector"&&!pt){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(pe&&typeof te.id!="string"&&typeof te.id!="number"){this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}Ce.removeFeatureState(pt,te.id,pe)},K.prototype.getFeatureState=function(te){this._checkLoaded();var pe=te.source,He=te.sourceLayer,Ce=this.sourceCaches[pe];if(Ce===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+pe+"' does not exist in the map's style.")));return}var Ke=Ce.getSource().type;if(Ke==="vector"&&!He){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return te.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),Ce.getFeatureState(He,te.id)},K.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},K.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,function(te){return te.serialize()}),layers:this._serializeLayers(this._order)},function(te){return te!==void 0})},K.prototype._updateLayer=function(te){this._updatedLayers[te.id]=!0,te.source&&!this._updatedSources[te.source]&&this.sourceCaches[te.source].getSource().type!=="raster"&&(this._updatedSources[te.source]="reload",this.sourceCaches[te.source].pause()),this._changed=!0},K.prototype._flattenAndSortRenderedFeatures=function(te){for(var pe=this,He=function(fa){return pe._layers[fa].type==="fill-extrusion"},Ce={},Ke=[],pt=this._order.length-1;pt>=0;pt--){var Ut=this._order[pt];if(He(Ut)){Ce[Ut]=pt;for(var Tr=0,Ur=te;Tr<Ur.length;Tr+=1){var vr=Ur[Tr],mt=vr[Ut];if(mt)for(var Et=0,Bt=mt;Et<Bt.length;Et+=1){var or=Bt[Et];Ke.push(or)}}}}Ke.sort(function(fa,sn){return sn.intersectionZ-fa.intersectionZ});for(var dr=[],ur=this._order.length-1;ur>=0;ur--){var pr=this._order[ur];if(He(pr))for(var cr=Ke.length-1;cr>=0;cr--){var Gt=Ke[cr].feature;if(Ce[Gt.layer.id]<ur)break;dr.push(Gt),Ke.pop()}else for(var lr=0,qt=te;lr<qt.length;lr+=1){var zr=qt[lr],$r=zr[pr];if($r)for(var Ai=0,wa=$r;Ai<wa.length;Ai+=1){var Ji=wa[Ai];dr.push(Ji.feature)}}}return dr},K.prototype.queryRenderedFeatures=function(te,pe,He){pe&&pe.filter&&this._validate(e.validateStyle.filter,"queryRenderedFeatures.filter",pe.filter,null,pe);var Ce={};if(pe&&pe.layers){if(!Array.isArray(pe.layers))return this.fire(new e.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var Ke=0,pt=pe.layers;Ke<pt.length;Ke+=1){var Ut=pt[Ke],Tr=this._layers[Ut];if(!Tr)return this.fire(new e.ErrorEvent(new Error("The layer '"+Ut+"' does not exist in the map's style and cannot be queried for features."))),[];Ce[Tr.source]=!0}}var Ur=[];pe.availableImages=this._availableImages;for(var vr in this.sourceCaches)pe.layers&&!Ce[vr]||Ur.push(re(this.sourceCaches[vr],this._layers,this._serializedLayers,te,pe,He));return this.placement&&Ur.push(ue(this._layers,this._serializedLayers,this.sourceCaches,te,pe,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Ur)},K.prototype.querySourceFeatures=function(te,pe){pe&&pe.filter&&this._validate(e.validateStyle.filter,"querySourceFeatures.filter",pe.filter,null,pe);var He=this.sourceCaches[te];return He?_e(He,pe):[]},K.prototype.addSourceType=function(te,pe,He){if(K.getSourceType(te))return He(new Error('A source type called "'+te+'" already exists.'));if(K.setSourceType(te,pe),!pe.workerSourceURL)return He(null,null);this.dispatcher.broadcast("loadWorkerSource",{name:te,url:pe.workerSourceURL},He)},K.prototype.getLight=function(){return this.light.getLight()},K.prototype.setLight=function(te,pe){pe===void 0&&(pe={}),this._checkLoaded();var He=this.light.getLight(),Ce=!1;for(var Ke in te)if(!e.deepEqual(te[Ke],He[Ke])){Ce=!0;break}if(Ce){var pt={now:e.browser.now(),transition:e.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(te,pe),this.light.updateTransitions(pt)}},K.prototype._validate=function(te,pe,He,Ce,Ke){return Ke===void 0&&(Ke={}),Ke&&Ke.validate===!1?!1:Ns(this,te.call(e.validateStyle,e.extend({key:pe,style:this.serialize(),value:He,styleSpec:e.styleSpec},Ce)))},K.prototype._remove=function(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(var te in this._layers){var pe=this._layers[te];pe.setEventedParent(null)}for(var He in this.sourceCaches)this.sourceCaches[He].clearTiles(),this.sourceCaches[He].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},K.prototype._clearSource=function(te){this.sourceCaches[te].clearTiles()},K.prototype._reloadSource=function(te){this.sourceCaches[te].resume(),this.sourceCaches[te].reload()},K.prototype._updateSources=function(te){for(var pe in this.sourceCaches)this.sourceCaches[pe].update(te)},K.prototype._generateCollisionBoxes=function(){for(var te in this.sourceCaches)this._reloadSource(te)},K.prototype._updatePlacement=function(te,pe,He,Ce,Ke){Ke===void 0&&(Ke=!1);for(var pt=!1,Ut=!1,Tr={},Ur=0,vr=this._order;Ur<vr.length;Ur+=1){var mt=vr[Ur],Et=this._layers[mt];if(Et.type==="symbol"){if(!Tr[Et.source]){var Bt=this.sourceCaches[Et.source];Tr[Et.source]=Bt.getRenderableIds(!0).map(function(lr){return Bt.getTileByID(lr)}).sort(function(lr,qt){return qt.tileID.overscaledZ-lr.tileID.overscaledZ||(lr.tileID.isLessThan(qt.tileID)?-1:1)})}var or=this.crossTileSymbolIndex.addLayer(Et,Tr[Et.source],te.center.lng);pt=pt||or}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),Ke=Ke||this._layerOrderChanged||He===0,(Ke||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.browser.now(),te.zoom))&&(this.pauseablePlacement=new jo(te,this._order,Ke,pe,He,Ce,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Tr),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.browser.now()),Ut=!0),pt&&this.pauseablePlacement.placement.setStale()),Ut||pt)for(var dr=0,ur=this._order;dr<ur.length;dr+=1){var pr=ur[dr],cr=this._layers[pr];cr.type==="symbol"&&this.placement.updateLayerOpacities(cr,Tr[cr.source])}var Gt=!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.browser.now());return Gt},K.prototype._releaseSymbolFadeTiles=function(){for(var te in this.sourceCaches)this.sourceCaches[te].releaseSymbolFadeTiles()},K.prototype.getImages=function(te,pe,He){this.imageManager.getImages(pe.icons,He),this._updateTilesForChangedImages();var Ce=this.sourceCaches[pe.source];Ce&&Ce.setDependencies(pe.tileID.key,pe.type,pe.icons)},K.prototype.getGlyphs=function(te,pe,He){this.glyphManager.getGlyphs(pe.stacks,He)},K.prototype.getResource=function(te,pe,He){return e.makeRequest(pe,He)},K}(e.Evented);Zl.getSourceType=oe,Zl.setSourceType=ie,Zl.registerForPluginStateChange=e.registerForPluginStateChange;var pu=e.createLayout([{name:"a_pos",type:"Int16",components:2}]),kc=`#ifdef GL_ES |