@visitscotland/component-library 5.84.0 → 5.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/LoadingSpinner-AGGAD1A5.mjs +10812 -0
- package/dist/components/LoadingSpinner-BCH3FvFp.js +34 -0
- package/dist/components/components/product-search/components/GuestSelector.vue.d.ts +6 -0
- package/dist/components/components/product-search/components/GuestSelectorNumberGroup.vue.d.ts +23 -0
- package/dist/components/components/product-search/components/GuestSelectorRow.vue.d.ts +17 -0
- package/dist/components/style.css +1 -1
- package/dist/components/vs-component-library-maps.js +63 -66
- package/dist/components/vs-component-library-maps.mjs +7680 -11067
- package/dist/components/vs-component-library.js +7 -7
- package/dist/components/vs-component-library.mjs +1226 -1159
- package/package.json +23 -10
- package/dist/components/LoadingSpinner-B7A8ynvA.mjs +0 -10689
- package/dist/components/LoadingSpinner-MApHRR7X.js +0 -34
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const wt=require("./LoadingSpinner-MApHRR7X.js"),q=require("vue"),pa=require("pinia");let Wa=null;typeof window<"u"&&(Wa=document.currentScript);const Dy={options:{div:"map",logo:"os-logo-maps",statement:"Contains OS data © Crown copyright and database rights YYYY",prefix:"",suffix:""},init(y){if(typeof window<"u"){Wa&&(this.options.div=Wa.getAttribute("data-div")||this.options.div,this.options.logo=Wa.getAttribute("data-logo")||this.options.logo,this.options.statement=Wa.getAttribute("data-statement")||this.options.statement,this.options.prefix=Wa.getAttribute("data-prefix")||this.options.prefix,this.options.suffix=Wa.getAttribute("data-suffix")||this.options.suffix),y=typeof y<"u"?y:{},Object.assign(this.options,y);const _=document.getElementById(this.options.div);let x="os-api-branding logo";this.options.logo==="os-logo-maps-white"&&(x="os-api-branding logo white");let k=this.options.statement;k=k.replace("YYYY",new Date().getFullYear()),this.options.prefix!==""&&(k=`${this.options.prefix}<span>|</span>${k}`),this.options.suffix!==""&&(k=`${k}<span>|</span>${this.options.suffix}`),document.querySelectorAll(`#${this.options.div} .os-api-branding`).forEach(u=>u.remove());const E=document.createElement("div");E.className=x,_.appendChild(E);const D=document.createElement("div");D.className="os-api-branding copyright",D.innerHTML=k,_.appendChild(D)}}},Sn=pa.defineStore("map",()=>{const y=q.ref([]),_=q.ref([]),x=q.ref(null),k=q.ref(null),E=q.ref(null);function D(be){y.value.push({id:be.id,filters:be.filters,places:be.places,activePins:be.activePins,hovered:"",activePlace:null})}function u(be){y.value.forEach(De=>{De.id===be.mapId&&(De.hovered=be.hoveredFeature)})}function U(be){y.value.forEach(De=>{De.id===be.mapId&&(De.activePlace=be.activeFeature)})}function M(be){_.value=be}function Y(be){x.value=be}function X(be){k.value=be}function ae(be){return y.value.find(De=>De.id===be)}function J(be){return y.value.find(Ze=>Ze.id===be)?.hovered}function Se(be){return y.value.find(Ze=>Ze.id===be)?.activePlace}return{maps:y,activeSubcatFilters:_,selectedSubCategory:x,activeMarkerPos:k,activePlace:E,addMapInstance:D,setHoveredPlace:u,setActivePlace:U,setActiveSubcatFilters:M,setSelectedSubcat:Y,setActiveMarkerPos:X,getMapById:ae,getHoveredStop:J,getActivePlace:Se}});var wc={exports:{}},D0=wc.exports,Ry;function R0(){return Ry||(Ry=1,(function(y,_){(function(x,k){y.exports=k()})(D0,(function(){var x,k,E;function D(u,U){if(!x)x=U;else if(!k)k=U;else{var M="var sharedChunk = {}; ("+x+")(sharedChunk); ("+k+")(sharedChunk);",Y={};x(Y),E=U(Y),typeof window<"u"&&(E.workerUrl=window.URL.createObjectURL(new Blob([M],{type:"text/javascript"})))}}return D(["exports"],(function(u){function U(e,t){return e(t={exports:{}},t.exports),t.exports}var M=Y;function Y(e,t,r,a){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=a,this.p2x=r,this.p2y=a}Y.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},Y.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},Y.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},Y.prototype.solveCurveX=function(e,t){var r,a,l,c,h;for(t===void 0&&(t=1e-6),l=e,h=0;h<8;h++){if(c=this.sampleCurveX(l)-e,Math.abs(c)<t)return l;var m=this.sampleCurveDerivativeX(l);if(Math.abs(m)<1e-6)break;l-=c/m}if((l=e)<(r=0))return r;if(l>(a=1))return a;for(;r<a;){if(c=this.sampleCurveX(l),Math.abs(c-e)<t)return l;e>c?r=l:a=l,l=.5*(a-r)+r}return l},Y.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var X=ae;function ae(e,t){this.x=e,this.y=t}ae.prototype={clone:function(){return new ae(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},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(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),a=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=a,this},_rotateAround:function(e,t){var r=Math.cos(e),a=Math.sin(e),l=t.y+a*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-a*(this.y-t.y),this.y=l,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ae.convert=function(e){return e instanceof ae?e:Array.isArray(e)?new ae(e[0],e[1]):e};var J=typeof self<"u"?self:{},Se=Math.pow(2,53)-1;function be(e,t,r,a){var l=new M(e,t,r,a);return function(c){return l.solve(c)}}var De=be(.25,.1,.25,1);function Ze(e,t,r){return Math.min(r,Math.max(t,e))}function He(e,t,r){var a=r-t,l=((e-t)%a+a)%a+t;return l===t?r:l}function Ue(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,l=t;a<l.length;a+=1){var c=l[a];for(var h in c)e[h]=c[h]}return e}var fe=1;function Ke(){return fe++}function Ne(){return(function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)})()}function It(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function we(e,t){e.forEach((function(r){t[r]&&(t[r]=t[r].bind(t))}))}function je(e,t){return e.indexOf(t,e.length-t.length)!==-1}function Le(e,t,r){var a={};for(var l in e)a[l]=t.call(r||this,e[l],l,e);return a}function tt(e,t,r){var a={};for(var l in e)t.call(r||this,e[l],l,e)&&(a[l]=e[l]);return a}function Mt(e){return Array.isArray(e)?e.map(Mt):typeof e=="object"&&e?Le(e,Mt):e}var Wt={};function St(e){Wt[e]||(typeof console<"u"&&console.warn(e),Wt[e]=!0)}function Ut(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function Hr(e){for(var t=0,r=0,a=e.length,l=a-1,c=void 0,h=void 0;r<a;l=r++)t+=((h=e[l]).x-(c=e[r]).x)*(c.y+h.y);return t}function Pr(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function bi(e){var t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(a,l,c,h){var m=c||h;return t[l]=!m||m.toLowerCase(),""})),t["max-age"]){var r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t}var or=null;function Rr(e){if(or==null){var t=e.navigator?e.navigator.userAgent:null;or=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return or}function et(e){try{var t=J[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}var Lr,Xr,Et,Fr,Mi=J.performance&&J.performance.now?J.performance.now.bind(J.performance):Date.now.bind(Date),pi=J.requestAnimationFrame||J.mozRequestAnimationFrame||J.webkitRequestAnimationFrame||J.msRequestAnimationFrame,Or=J.cancelAnimationFrame||J.mozCancelAnimationFrame||J.webkitCancelAnimationFrame||J.msCancelAnimationFrame,Xi={now:Mi,frame:function(e){var t=pi(e);return{cancel:function(){return Or(t)}}},getImageData:function(e,t){t===void 0&&(t=0);var r=J.document.createElement("canvas"),a=r.getContext("2d");if(!a)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,a.drawImage(e,0,0,e.width,e.height),a.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return Lr||(Lr=J.document.createElement("a")),Lr.href=e,Lr.href},hardwareConcurrency:J.navigator&&J.navigator.hardwareConcurrency||4,get devicePixelRatio(){return J.devicePixelRatio},get prefersReducedMotion(){return!!J.matchMedia&&(Xr==null&&(Xr=J.matchMedia("(prefers-reduced-motion: reduce)")),Xr.matches)}},Nt={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},Nr={supported:!1,testSupport:function(e){!ar&&Fr&&(sr?lt(e):Et=e)}},ar=!1,sr=!1;function lt(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,Fr),e.isContextLost())return;Nr.supported=!0}catch{}e.deleteTexture(t),ar=!0}J.document&&((Fr=J.document.createElement("img")).onload=function(){Et&<(Et),Et=null,sr=!0},Fr.onerror=function(){ar=!0,Et=null},Fr.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var mr="01",hr=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function jr(e){return e.indexOf("mapbox:")===0}hr.prototype._createSkuToken=function(){var e=(function(){for(var t="",r=0;r<10;r++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",mr,t].join(""),tokenExpiresAt:Date.now()+432e5}})();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},hr.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},hr.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},hr.prototype.normalizeStyleURL=function(e,t){if(!jr(e))return e;var r=Kr(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},hr.prototype.normalizeGlyphsURL=function(e,t){if(!jr(e))return e;var r=Kr(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},hr.prototype.normalizeSourceURL=function(e,t){if(!jr(e))return e;var r=Kr(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},hr.prototype.normalizeSpriteURL=function(e,t,r,a){var l=Kr(e);return jr(e)?(l.path="/styles/v1"+l.path+"/sprite"+t+r,this._makeAPIURL(l,this._customAccessToken||a)):(l.path+=""+t+r,Bi(l))},hr.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!jr(e))return e;var r=Kr(e);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(Xi.devicePixelRatio>=2||t===512?"@2x":"")+(Nr.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||(function(l){for(var c=0,h=l;c<h.length;c+=1){var m=h[c].match(/^access_token=(.*)$/);if(m)return m[1]}return null})(r.params)||Nt.ACCESS_TOKEN;return Nt.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,a)},hr.prototype.canonicalizeTileURL=function(e,t){var r=Kr(e);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return e;var a="mapbox://tiles/";a+=r.path.replace("/v4/","");var l=r.params;return t&&(l=l.filter((function(c){return!c.match(/^access_token=/)}))),l.length&&(a+="?"+l.join("&")),a},hr.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&jr(t),a=[],l=0,c=e.tiles||[];l<c.length;l+=1){var h=c[l];br(h)?a.push(this.canonicalizeTileURL(h,r)):a.push(h)}return a},hr.prototype._makeAPIURL=function(e,t){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",a=Kr(Nt.API_URL);if(e.protocol=a.protocol,e.authority=a.authority,e.protocol==="http"){var l=e.params.indexOf("secure");l>=0&&e.params.splice(l,1)}if(a.path!=="/"&&(e.path=""+a.path+e.path),!Nt.REQUIRE_ACCESS_TOKEN)return Bi(e);if(!(t=t||Nt.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if(t[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return e.params=e.params.filter((function(c){return c.indexOf("access_token")===-1})),e.params.push("access_token="+t),Bi(e)};var fr=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function br(e){return fr.test(e)}var dn=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Kr(e){var t=e.match(dn);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Bi(e){var t=e.params.length?"?"+e.params.join("&"):"";return e.protocol+"://"+e.authority+e.path+t}function hi(e){if(!e)return null;var t=e.split(".");if(!t||t.length!==3)return null;try{return JSON.parse(decodeURIComponent(J.atob(t[1]).split("").map((function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch{return null}}var ti=function(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};ti.prototype.getStorageKey=function(e){var t,r=hi(Nt.ACCESS_TOKEN);return t=r&&r.u?J.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(a,l){return String.fromCharCode(+("0x"+l))}))):Nt.ACCESS_TOKEN||"",e?"mapbox.eventData."+e+":"+t:"mapbox.eventData:"+t},ti.prototype.fetchEventData=function(){var e=et("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{var a=J.localStorage.getItem(t);a&&(this.eventData=JSON.parse(a));var l=J.localStorage.getItem(r);l&&(this.anonId=l)}catch{St("Unable to read from LocalStorage")}},ti.prototype.saveEventData=function(){var e=et("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{J.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&J.localStorage.setItem(t,JSON.stringify(this.eventData))}catch{St("Unable to write to LocalStorage")}},ti.prototype.processRequests=function(e){},ti.prototype.postEvent=function(e,t,r,a){var l=this;if(Nt.EVENTS_URL){var c=Kr(Nt.EVENTS_URL);c.params.push("access_token="+(a||Nt.ACCESS_TOKEN||""));var h={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:mr,userId:this.anonId},m=t?Ue(h,t):h,g={url:Bi(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([m])};this.pendingRequest=Yt(g,(function(b){l.pendingRequest=null,r(b),l.saveEventData(),l.processRequests(a)}))}},ti.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var ri,Vi,Ki=(function(e){function t(){e.call(this,"map.load"),this.success={},this.skuToken=""}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postMapLoadEvent=function(r,a,l,c){this.skuToken=l;var h=!(!c&&!Nt.ACCESS_TOKEN),m=Array.isArray(r)&&r.some((function(g){return jr(g)||br(g)}));Nt.EVENTS_URL&&h&&m&&this.queueRequest({id:a,timestamp:Date.now()},c)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){var l=this.queue.shift(),c=l.id,h=l.timestamp;c&&this.success[c]||(this.anonId||this.fetchEventData(),It(this.anonId)||(this.anonId=Ne()),this.postEvent(h,{skuToken:this.skuToken},(function(m){m||c&&(a.success[c]=!0)}),r))}},t})(ti),yo=new((function(e){function t(r){e.call(this,"appUserTurnstile"),this._customAccessToken=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postTurnstileEvent=function(r,a){Nt.EVENTS_URL&&Nt.ACCESS_TOKEN&&Array.isArray(r)&&r.some((function(l){return jr(l)||br(l)}))&&this.queueRequest(Date.now(),a)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var l=hi(Nt.ACCESS_TOKEN),c=l?l.u:Nt.ACCESS_TOKEN,h=c!==this.eventData.tokenU;It(this.anonId)||(this.anonId=Ne(),h=!0);var m=this.queue.shift();if(this.eventData.lastSuccess){var g=new Date(this.eventData.lastSuccess),b=new Date(m),S=(m-this.eventData.lastSuccess)/864e5;h=h||S>=1||S<-1||g.getDate()!==b.getDate()}else h=!0;if(!h)return this.processRequests();this.postEvent(m,{"enabled.telemetry":!1},(function(I){I||(a.eventData.lastSuccess=m,a.eventData.tokenU=c)}),r)}},t})(ti)),$o=yo.postTurnstileEvent.bind(yo),mn=new Ki,Mn=mn.postMapLoadEvent.bind(mn),Bn=500,Zo=50;function jn(){J.caches&&!ri&&(ri=J.caches.open("mapbox-tiles"))}function zn(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}var rn,de=1/0;function _e(){return rn==null&&(rn=J.OffscreenCanvas&&new J.OffscreenCanvas(1,1).getContext("2d")&&typeof J.createImageBitmap=="function"),rn}var jt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(jt);var tr=(function(e){function t(r,a,l){a===401&&br(l)&&(r+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),e.call(this,r),this.status=a,this.url=l,this.name=this.constructor.name,this.message=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},t})(Error),Kt=Pr()?function(){return self.worker&&self.worker.referrer}:function(){return(J.location.protocol==="blob:"?J.parent:J).location.href},_t,fi,qi=function(e,t){if(!(/^file:/.test(r=e.url)||/^file:/.test(Kt())&&!/^\w+:/.test(r))){if(J.fetch&&J.Request&&J.AbortController&&J.Request.prototype.hasOwnProperty("signal"))return(function(a,l){var c,h=new J.AbortController,m=new J.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:Kt(),signal:h.signal}),g=!1,b=!1,S=(c=m.url).indexOf("sku=")>0&&br(c);a.type==="json"&&m.headers.set("Accept","application/json");var I=function(z,j,G){if(!b){if(z&&z.message!=="SecurityError"&&St(z),j&&G)return C(j);var te=Date.now();J.fetch(m).then((function(K){if(K.ok){var oe=S?K.clone():null;return C(K,oe,te)}return l(new tr(K.statusText,K.status,a.url))})).catch((function(K){K.code!==20&&l(new Error(K.message))}))}},C=function(z,j,G){(a.type==="arrayBuffer"?z.arrayBuffer():a.type==="json"?z.json():z.text()).then((function(te){b||(j&&G&&(function(K,oe,le){if(jn(),ri){var ce={status:oe.status,statusText:oe.statusText,headers:new J.Headers};oe.headers.forEach((function(xe,Pe){return ce.headers.set(Pe,xe)}));var he=bi(oe.headers.get("Cache-Control")||"");he["no-store"]||(he["max-age"]&&ce.headers.set("Expires",new Date(le+1e3*he["max-age"]).toUTCString()),new Date(ce.headers.get("Expires")).getTime()-le<42e4||(function(xe,Pe){if(Vi===void 0)try{new Response(new ReadableStream),Vi=!0}catch{Vi=!1}Vi?Pe(xe.body):xe.blob().then(Pe)})(oe,(function(xe){var Pe=new J.Response(xe,ce);jn(),ri&&ri.then((function(ze){return ze.put(zn(K.url),Pe)})).catch((function(ze){return St(ze.message)}))})))}})(m,j,G),g=!0,l(null,te,z.headers.get("Cache-Control"),z.headers.get("Expires")))})).catch((function(te){b||l(new Error(te.message))}))};return S?(function(z,j){if(jn(),!ri)return j(null);var G=zn(z.url);ri.then((function(te){te.match(G).then((function(K){var oe=(function(le){if(!le)return!1;var ce=new Date(le.headers.get("Expires")||0),he=bi(le.headers.get("Cache-Control")||"");return ce>Date.now()&&!he["no-cache"]})(K);te.delete(G),oe&&te.put(G,K.clone()),j(null,K,oe)})).catch(j)})).catch(j)})(m,I):I(null,null),{cancel:function(){b=!0,g||h.abort()}}})(e,t);if(Pr()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return(function(a,l){var c=new J.XMLHttpRequest;for(var h in c.open(a.method||"GET",a.url,!0),a.type==="arrayBuffer"&&(c.responseType="arraybuffer"),a.headers)c.setRequestHeader(h,a.headers[h]);return a.type==="json"&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials=a.credentials==="include",c.onerror=function(){l(new Error(c.statusText))},c.onload=function(){if((c.status>=200&&c.status<300||c.status===0)&&c.response!==null){var m=c.response;if(a.type==="json")try{m=JSON.parse(c.response)}catch(g){return l(g)}l(null,m,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else l(new tr(c.statusText,c.status,a.url))},c.send(a.body),{cancel:function(){return c.abort()}}})(e,t)},ii=function(e,t){return qi(Ue(e,{type:"arrayBuffer"}),t)},Yt=function(e,t){return qi(Ue(e,{method:"POST"}),t)},T="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";_t=[],fi=0;var P=function(e,t){if(Nr.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),fi>=Nt.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return _t.push(r),r}fi++;var a=!1,l=function(){if(!a)for(a=!0,fi--;_t.length&&fi<Nt.MAX_PARALLEL_IMAGE_REQUESTS;){var h=_t.shift();h.cancelled||(h.cancel=P(h.requestParameters,h.callback).cancel)}},c=ii(e,(function(h,m,g,b){l(),h?t(h):m&&(_e()?(function(S,I){var C=new J.Blob([new Uint8Array(S)],{type:"image/png"});J.createImageBitmap(C).then((function(z){I(null,z)})).catch((function(z){I(new Error("Could not load image because of "+z.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))})(m,t):(function(S,I,C,z){var j=new J.Image,G=J.URL;j.onload=function(){I(null,j),G.revokeObjectURL(j.src),j.onload=null,J.requestAnimationFrame((function(){j.src=T}))},j.onerror=function(){return I(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 te=new J.Blob([new Uint8Array(S)],{type:"image/png"});j.cacheControl=C,j.expires=z,j.src=S.byteLength?G.createObjectURL(te):T})(m,t,g,b))}));return{cancel:function(){c.cancel(),l()}}};function B(e,t,r){r[e]&&r[e].indexOf(t)!==-1||(r[e]=r[e]||[],r[e].push(t))}function V(e,t,r){if(r&&r[e]){var a=r[e].indexOf(t);a!==-1&&r[e].splice(a,1)}}var $=function(e,t){t===void 0&&(t={}),Ue(this,t),this.type=e},re=(function(e){function t(r,a){a===void 0&&(a={}),e.call(this,"error",Ue({error:r},a))}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})($),ie=function(){};ie.prototype.on=function(e,t){return this._listeners=this._listeners||{},B(e,t,this._listeners),this},ie.prototype.off=function(e,t){return V(e,t,this._listeners),V(e,t,this._oneTimeListeners),this},ie.prototype.once=function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},B(e,t,this._oneTimeListeners),this},ie.prototype.fire=function(e,t){typeof e=="string"&&(e=new $(e,t||{}));var r=e.type;if(this.listens(r)){e.target=this;for(var a=0,l=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];a<l.length;a+=1)l[a].call(this,e);for(var c=0,h=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];c<h.length;c+=1){var m=h[c];V(r,m,this._oneTimeListeners),m.call(this,e)}var g=this._eventedParent;g&&(Ue(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),g.fire(e))}else e instanceof re&&console.error(e.error);return this},ie.prototype.listens=function(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},ie.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var L={$version:8,$root:{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"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{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"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"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"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],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"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-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"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-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"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"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"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},H=function(e,t,r,a){this.message=(e?e+": ":"")+r,a&&(this.identifier=a),t!=null&&t.__line__&&(this.line=t.__line__)};function se(e){var t=e.value;return t?[new H(e.key,t,"constants have been deprecated as of v8")]:[]}function Ie(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,l=t;a<l.length;a+=1){var c=l[a];for(var h in c)e[h]=c[h]}return e}function Ee(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function ye(e){if(Array.isArray(e))return e.map(ye);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var r in e)t[r]=ye(e[r]);return t}return Ee(e)}var Ae=(function(e){function t(r,a){e.call(this,a),this.message=a,this.key=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(Error),Je=function(e,t){t===void 0&&(t=[]),this.parent=e,this.bindings={};for(var r=0,a=t;r<a.length;r+=1){var l=a[r];this.bindings[l[0]]=l[1]}};Je.prototype.concat=function(e){return new Je(this,e)},Je.prototype.get=function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(e+" not found in scope.")},Je.prototype.has=function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)};var Ge={kind:"null"},ge={kind:"number"},Ve={kind:"string"},Be={kind:"boolean"},Me={kind:"color"},yt={kind:"object"},Fe={kind:"value"},Pt={kind:"collator"},rr={kind:"formatted"},Ct={kind:"resolvedImage"};function Gt(e,t){return{kind:"array",itemType:e,N:t}}function Rt(e){if(e.kind==="array"){var t=Rt(e.itemType);return typeof e.N=="number"?"array<"+t+", "+e.N+">":e.itemType.kind==="value"?"array":"array<"+t+">"}return e.kind}var wi=[Ge,ge,Ve,Be,Me,rr,yt,Gt(Fe),Ct];function Ht(e,t){if(t.kind==="error")return null;if(e.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Ht(e.itemType,t.itemType))&&(typeof e.N!="number"||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind==="value"){for(var r=0,a=wi;r<a.length;r+=1)if(!Ht(a[r],t))return null}}return"Expected "+Rt(e)+" but found "+Rt(t)+" instead."}function Cr(e,t){return t.some((function(r){return r.kind===e.kind}))}function Qt(e,t){return t.some((function(r){return r==="null"?e===null:r==="array"?Array.isArray(e):r==="object"?e&&!Array.isArray(e)&&typeof e=="object":r===typeof e}))}var zt=U((function(e,t){var r={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 a(m){return(m=Math.round(m))<0?0:m>255?255:m}function l(m){return a(m[m.length-1]==="%"?parseFloat(m)/100*255:parseInt(m))}function c(m){return(g=m[m.length-1]==="%"?parseFloat(m)/100:parseFloat(m))<0?0:g>1?1:g;var g}function h(m,g,b){return b<0?b+=1:b>1&&(b-=1),6*b<1?m+(g-m)*b*6:2*b<1?g:3*b<2?m+(g-m)*(2/3-b)*6:m}try{t.parseCSSColor=function(m){var g,b=m.replace(/ /g,"").toLowerCase();if(b in r)return r[b].slice();if(b[0]==="#")return b.length===4?(g=parseInt(b.substr(1),16))>=0&&g<=4095?[(3840&g)>>4|(3840&g)>>8,240&g|(240&g)>>4,15&g|(15&g)<<4,1]:null:b.length===7&&(g=parseInt(b.substr(1),16))>=0&&g<=16777215?[(16711680&g)>>16,(65280&g)>>8,255&g,1]:null;var S=b.indexOf("("),I=b.indexOf(")");if(S!==-1&&I+1===b.length){var C=b.substr(0,S),z=b.substr(S+1,I-(S+1)).split(","),j=1;switch(C){case"rgba":if(z.length!==4)return null;j=c(z.pop());case"rgb":return z.length!==3?null:[l(z[0]),l(z[1]),l(z[2]),j];case"hsla":if(z.length!==4)return null;j=c(z.pop());case"hsl":if(z.length!==3)return null;var G=(parseFloat(z[0])%360+360)%360/360,te=c(z[1]),K=c(z[2]),oe=K<=.5?K*(te+1):K+te-K*te,le=2*K-oe;return[a(255*h(le,oe,G+1/3)),a(255*h(le,oe,G)),a(255*h(le,oe,G-1/3)),j];default:return null}}return null}}catch{}})).parseCSSColor,$t=function(e,t,r,a){a===void 0&&(a=1),this.r=e,this.g=t,this.b=r,this.a=a};$t.parse=function(e){if(e){if(e instanceof $t)return e;if(typeof e=="string"){var t=zt(e);if(t)return new $t(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},$t.prototype.toString=function(){var e=this.toArray(),t=e[1],r=e[2],a=e[3];return"rgba("+Math.round(e[0])+","+Math.round(t)+","+Math.round(r)+","+a+")"},$t.prototype.toArray=function(){var e=this.a;return e===0?[0,0,0,0]:[255*this.r/e,255*this.g/e,255*this.b/e,e]},$t.black=new $t(0,0,0,1),$t.white=new $t(1,1,1,1),$t.transparent=new $t(0,0,0,0),$t.red=new $t(1,0,0,1);var zi=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};zi.prototype.compare=function(e,t){return this.collator.compare(e,t)},zi.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ma=function(e,t,r,a,l){this.text=e,this.image=t,this.scale=r,this.fontStack=a,this.textColor=l},ni=function(e){this.sections=e};ni.fromString=function(e){return new ni([new ma(e,null,null,null,null)])},ni.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some((function(e){return e.text.length!==0||e.image&&e.image.name.length!==0}))},ni.factory=function(e){return e instanceof ni?e:ni.fromString(e)},ni.prototype.toString=function(){return this.sections.length===0?"":this.sections.map((function(e){return e.text})).join("")},ni.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];if(a.image)e.push(["image",a.image.name]);else{e.push(a.text);var l={};a.fontStack&&(l["text-font"]=["literal",a.fontStack.split(",")]),a.scale&&(l["font-scale"]=a.scale),a.textColor&&(l["text-color"]=["rgba"].concat(a.textColor.toArray())),e.push(l)}}return e};var Di=function(e){this.name=e.name,this.available=e.available};function ru(e,t,r,a){return typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:"Invalid rgba value ["+[e,t,r,a].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof a=="number"?[e,t,r,a]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ya(e){if(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||e instanceof $t||e instanceof zi||e instanceof ni||e instanceof Di)return!0;if(Array.isArray(e)){for(var t=0,r=e;t<r.length;t+=1)if(!ya(r[t]))return!1;return!0}if(typeof e=="object"){for(var a in e)if(!ya(e[a]))return!1;return!0}return!1}function kr(e){if(e===null)return Ge;if(typeof e=="string")return Ve;if(typeof e=="boolean")return Be;if(typeof e=="number")return ge;if(e instanceof $t)return Me;if(e instanceof zi)return Pt;if(e instanceof ni)return rr;if(e instanceof Di)return Ct;if(Array.isArray(e)){for(var t,r=e.length,a=0,l=e;a<l.length;a+=1){var c=kr(l[a]);if(t){if(t===c)continue;t=Fe;break}t=c}return Gt(t||Fe,r)}return yt}function va(e){var t=typeof e;return e===null?"":t==="string"||t==="number"||t==="boolean"?String(e):e instanceof $t||e instanceof ni||e instanceof Di?e.toString():JSON.stringify(e)}Di.prototype.toString=function(){return this.name},Di.fromString=function(e){return e?new Di({name:e,available:!1}):null},Di.prototype.serialize=function(){return["image",this.name]};var Si=function(e,t){this.type=e,this.value=t};Si.parse=function(e,t){if(e.length!==2)return t.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!ya(e[1]))return t.error("invalid value");var r=e[1],a=kr(r),l=t.expectedType;return a.kind!=="array"||a.N!==0||!l||l.kind!=="array"||typeof l.N=="number"&&l.N!==0||(a=l),new Si(a,r)},Si.prototype.evaluate=function(){return this.value},Si.prototype.eachChild=function(){},Si.prototype.outputDefined=function(){return!0},Si.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof $t?["rgba"].concat(this.value.toArray()):this.value instanceof ni?this.value.serialize():this.value};var oi=function(e){this.name="ExpressionEvaluationError",this.message=e};oi.prototype.toJSON=function(){return this.message};var nn={string:Ve,number:ge,boolean:Be,object:yt},yr=function(e,t){this.type=e,this.args=t};yr.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r,a=1,l=e[0];if(l==="array"){var c,h;if(e.length>2){var m=e[1];if(typeof m!="string"||!(m in nn)||m==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);c=nn[m],a++}else c=Fe;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);h=e[2],a++}r=Gt(c,h)}else r=nn[l];for(var g=[];a<e.length;a++){var b=t.parse(e[a],a,Fe);if(!b)return null;g.push(b)}return new yr(r,g)},yr.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var r=this.args[t].evaluate(e);if(!Ht(this.type,kr(r)))return r;if(t===this.args.length-1)throw new oi("Expected value to be of type "+Rt(this.type)+", but found "+Rt(kr(r))+" instead.")}return null},yr.prototype.eachChild=function(e){this.args.forEach(e)},yr.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},yr.prototype.serialize=function(){var e=this.type,t=[e.kind];if(e.kind==="array"){var r=e.itemType;if(r.kind==="string"||r.kind==="number"||r.kind==="boolean"){t.push(r.kind);var a=e.N;(typeof a=="number"||this.args.length>1)&&t.push(a)}}return t.concat(this.args.map((function(l){return l.serialize()})))};var yn=function(e){this.type=rr,this.sections=e};yn.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&typeof r=="object")return t.error("First argument must be an image or text section.");for(var a=[],l=!1,c=1;c<=e.length-1;++c){var h=e[c];if(l&&typeof h=="object"&&!Array.isArray(h)){l=!1;var m=null;if(h["font-scale"]&&!(m=t.parse(h["font-scale"],1,ge)))return null;var g=null;if(h["text-font"]&&!(g=t.parse(h["text-font"],1,Gt(Ve))))return null;var b=null;if(h["text-color"]&&!(b=t.parse(h["text-color"],1,Me)))return null;var S=a[a.length-1];S.scale=m,S.font=g,S.textColor=b}else{var I=t.parse(e[c],1,Fe);if(!I)return null;var C=I.type.kind;if(C!=="string"&&C!=="value"&&C!=="null"&&C!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");l=!0,a.push({content:I,scale:null,font:null,textColor:null})}}return new yn(a)},yn.prototype.evaluate=function(e){return new ni(this.sections.map((function(t){var r=t.content.evaluate(e);return kr(r)===Ct?new ma("",r,null,null,null):new ma(va(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))},yn.prototype.eachChild=function(e){for(var t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e(a.content),a.scale&&e(a.scale),a.font&&e(a.font),a.textColor&&e(a.textColor)}},yn.prototype.outputDefined=function(){return!1},yn.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e.push(a.content.serialize());var l={};a.scale&&(l["font-scale"]=a.scale.serialize()),a.font&&(l["text-font"]=a.font.serialize()),a.textColor&&(l["text-color"]=a.textColor.serialize()),e.push(l)}return e};var Ji=function(e){this.type=Ct,this.input=e};Ji.parse=function(e,t){if(e.length!==2)return t.error("Expected two arguments.");var r=t.parse(e[1],1,Ve);return r?new Ji(r):t.error("No image name provided.")},Ji.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=Di.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r},Ji.prototype.eachChild=function(e){e(this.input)},Ji.prototype.outputDefined=function(){return!1},Ji.prototype.serialize=function(){return["image",this.input.serialize()]};var al={"to-boolean":Be,"to-color":Me,"to-number":ge,"to-string":Ve},on=function(e,t){this.type=e,this.args=t};on.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if((r==="to-boolean"||r==="to-string")&&e.length!==2)return t.error("Expected one argument.");for(var a=al[r],l=[],c=1;c<e.length;c++){var h=t.parse(e[c],c,Fe);if(!h)return null;l.push(h)}return new on(a,l)},on.prototype.evaluate=function(e){if(this.type.kind==="boolean")return!!this.args[0].evaluate(e);if(this.type.kind==="color"){for(var t,r,a=0,l=this.args;a<l.length;a+=1){if(r=null,(t=l[a].evaluate(e))instanceof $t)return t;if(typeof t=="string"){var c=e.parseColor(t);if(c)return c}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":ru(t[0],t[1],t[2],t[3])))return new $t(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new oi(r||"Could not parse color from value '"+(typeof t=="string"?t:String(JSON.stringify(t)))+"'")}if(this.type.kind==="number"){for(var h=null,m=0,g=this.args;m<g.length;m+=1){if((h=g[m].evaluate(e))===null)return 0;var b=Number(h);if(!isNaN(b))return b}throw new oi("Could not convert "+JSON.stringify(h)+" to number.")}return this.type.kind==="formatted"?ni.fromString(va(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Di.fromString(va(this.args[0].evaluate(e))):va(this.args[0].evaluate(e))},on.prototype.eachChild=function(e){this.args.forEach(e)},on.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},on.prototype.serialize=function(){if(this.type.kind==="formatted")return new yn([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Ji(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild((function(t){e.push(t.serialize())})),e};var Pc=["Unknown","Point","LineString","Polygon"],Dn=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Dn.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Dn.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?Pc[this.feature.type]:this.feature.type:null},Dn.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Dn.prototype.canonicalID=function(){return this.canonical},Dn.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Dn.prototype.parseColor=function(e){var t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=$t.parse(e)),t};var di=function(e,t,r,a){this.name=e,this.type=t,this._evaluate=r,this.args=a};di.prototype.evaluate=function(e){return this._evaluate(e,this.args)},di.prototype.eachChild=function(e){this.args.forEach(e)},di.prototype.outputDefined=function(){return!1},di.prototype.serialize=function(){return[this.name].concat(this.args.map((function(e){return e.serialize()})))},di.parse=function(e,t){var r,a=e[0],l=di.definitions[a];if(!l)return t.error('Unknown expression "'+a+'". If you wanted a literal array, use ["literal", [...]].',0);for(var c=Array.isArray(l)?l[0]:l.type,h=Array.isArray(l)?[[l[1],l[2]]]:l.overloads,m=h.filter((function(ot){var qe=ot[0];return!Array.isArray(qe)||qe.length===e.length-1})),g=null,b=0,S=m;b<S.length;b+=1){var I=S[b],C=I[0],z=I[1];g=new Wn(t.registry,t.path,null,t.scope);for(var j=[],G=!1,te=1;te<e.length;te++){var K=e[te],oe=Array.isArray(C)?C[te-1]:C.type,le=g.parse(K,1+j.length,oe);if(!le){G=!0;break}j.push(le)}if(!G)if(Array.isArray(C)&&C.length!==j.length)g.error("Expected "+C.length+" arguments, but found "+j.length+" instead.");else{for(var ce=0;ce<j.length;ce++){var he=Array.isArray(C)?C[ce]:C.type,xe=j[ce];g.concat(ce+1).checkSubtype(he,xe.type)}if(g.errors.length===0)return new di(a,c,z,j)}}if(m.length===1)(r=t.errors).push.apply(r,g.errors);else{for(var Pe=(m.length?m:h).map((function(ot){var qe;return qe=ot[0],Array.isArray(qe)?"("+qe.map(Rt).join(", ")+")":"("+Rt(qe.type)+"...)"})).join(" | "),ze=[],rt=1;rt<e.length;rt++){var Oe=t.parse(e[rt],1+ze.length);if(!Oe)return null;ze.push(Rt(Oe.type))}t.error("Expected arguments of type "+Pe+", but found ("+ze.join(", ")+") instead.")}return null},di.register=function(e,t){for(var r in di.definitions=t,t)e[r]=di};var In=function(e,t,r){this.type=Pt,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t};function Ii(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function vo(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Cc(e,t){var r=(180+e[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,l=Math.pow(2,t.z);return[Math.round(r*l*8192),Math.round(a*l*8192)]}function kc(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function iu(e,t){for(var r,a,l,c,h,m,g,b=!1,S=0,I=t.length;S<I;S++)for(var C=t[S],z=0,j=C.length;z<j-1;z++){if((c=(r=e)[0]-(a=C[z])[0])*(g=r[1]-(l=C[z+1])[1])-(m=r[0]-l[0])*(h=r[1]-a[1])==0&&c*m<=0&&h*g<=0)return!1;kc(e,C[z],C[z+1])&&(b=!b)}return b}function Mc(e,t){for(var r=0;r<t.length;r++)if(iu(e,t[r]))return!0;return!1}function sl(e,t,r,a){var l=a[0]-r[0],c=a[1]-r[1],h=(e[0]-r[0])*c-l*(e[1]-r[1]),m=(t[0]-r[0])*c-l*(t[1]-r[1]);return h>0&&m<0||h<0&&m>0}function Bc(e,t,r){for(var a=0,l=r;a<l.length;a+=1)for(var c=l[a],h=0;h<c.length-1;++h)if((I=[(S=c[h+1])[0]-(b=c[h])[0],S[1]-b[1]])[0]*(C=[(g=t)[0]-(m=e)[0],g[1]-m[1]])[1]-I[1]*C[0]!=0&&sl(m,g,b,S)&&sl(b,S,m,g))return!0;var m,g,b,S,I,C;return!1}function ul(e,t){for(var r=0;r<e.length;++r)if(!iu(e[r],t))return!1;for(var a=0;a<e.length-1;++a)if(Bc(e[a],e[a+1],t))return!1;return!0}function ll(e,t){for(var r=0;r<t.length;r++)if(ul(e,t[r]))return!0;return!1}function Wo(e,t,r){for(var a=[],l=0;l<e.length;l++){for(var c=[],h=0;h<e[l].length;h++){var m=Cc(e[l][h],r);Ii(t,m),c.push(m)}a.push(c)}return a}function nu(e,t,r){for(var a=[],l=0;l<e.length;l++){var c=Wo(e[l],t,r);a.push(c)}return a}function ga(e,t,r,a){if(e[0]<r[0]||e[0]>r[2]){var l=.5*a,c=e[0]-r[0]>l?-a:r[0]-e[0]>l?a:0;c===0&&(c=e[0]-r[2]>l?-a:r[2]-e[0]>l?a:0),e[0]+=c}Ii(t,e)}function cl(e,t,r,a){for(var l=8192*Math.pow(2,a.z),c=[8192*a.x,8192*a.y],h=[],m=0,g=e;m<g.length;m+=1)for(var b=0,S=g[m];b<S.length;b+=1){var I=S[b],C=[I.x+c[0],I.y+c[1]];ga(C,t,r,l),h.push(C)}return h}function Qa(e,t,r,a){for(var l,c=8192*Math.pow(2,a.z),h=[8192*a.x,8192*a.y],m=[],g=0,b=e;g<b.length;g+=1){for(var S=[],I=0,C=b[g];I<C.length;I+=1){var z=C[I],j=[z.x+h[0],z.y+h[1]];Ii(t,j),S.push(j)}m.push(S)}if(t[2]-t[0]<=c/2){(l=t)[0]=l[1]=1/0,l[2]=l[3]=-1/0;for(var G=0,te=m;G<te.length;G+=1)for(var K=0,oe=te[G];K<oe.length;K+=1)ga(oe[K],t,r,c)}return m}In.parse=function(e,t){if(e.length!==2)return t.error("Expected one argument.");var r=e[1];if(typeof r!="object"||Array.isArray(r))return t.error("Collator options argument must be an object.");var a=t.parse(r["case-sensitive"]!==void 0&&r["case-sensitive"],1,Be);if(!a)return null;var l=t.parse(r["diacritic-sensitive"]!==void 0&&r["diacritic-sensitive"],1,Be);if(!l)return null;var c=null;return r.locale&&!(c=t.parse(r.locale,1,Ve))?null:new In(a,l,c)},In.prototype.evaluate=function(e){return new zi(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},In.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},In.prototype.outputDefined=function(){return!1},In.prototype.serialize=function(){var e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]};var an=function(e,t){this.type=Be,this.geojson=e,this.geometries=t};function Gn(e){if(e instanceof di&&(e.name==="get"&&e.args.length===1||e.name==="feature-state"||e.name==="has"&&e.args.length===1||e.name==="properties"||e.name==="geometry-type"||e.name==="id"||/^filter-/.test(e.name))||e instanceof an)return!1;var t=!0;return e.eachChild((function(r){t&&!Gn(r)&&(t=!1)})),t}function $n(e){if(e instanceof di&&e.name==="feature-state")return!1;var t=!0;return e.eachChild((function(r){t&&!$n(r)&&(t=!1)})),t}function go(e,t){if(e instanceof di&&t.indexOf(e.name)>=0)return!1;var r=!0;return e.eachChild((function(a){r&&!go(a,t)&&(r=!1)})),r}an.parse=function(e,t){if(e.length!==2)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(ya(e[1])){var r=e[1];if(r.type==="FeatureCollection")for(var a=0;a<r.features.length;++a){var l=r.features[a].geometry.type;if(l==="Polygon"||l==="MultiPolygon")return new an(r,r.features[a].geometry)}else if(r.type==="Feature"){var c=r.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new an(r,r.geometry)}else if(r.type==="Polygon"||r.type==="MultiPolygon")return new an(r,r)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")},an.prototype.evaluate=function(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(t,r){var a=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var h=Wo(r.coordinates,l,c),m=cl(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var g=0,b=m;g<b.length;g+=1)if(!iu(b[g],h))return!1}if(r.type==="MultiPolygon"){var S=nu(r.coordinates,l,c),I=cl(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var C=0,z=I;C<z.length;C+=1)if(!Mc(z[C],S))return!1}return!0})(e,this.geometries);if(e.geometryType()==="LineString")return(function(t,r){var a=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var h=Wo(r.coordinates,l,c),m=Qa(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var g=0,b=m;g<b.length;g+=1)if(!ul(b[g],h))return!1}if(r.type==="MultiPolygon"){var S=nu(r.coordinates,l,c),I=Qa(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var C=0,z=I;C<z.length;C+=1)if(!ll(z[C],S))return!1}return!0})(e,this.geometries)}return!1},an.prototype.eachChild=function(){},an.prototype.outputDefined=function(){return!0},an.prototype.serialize=function(){return["within",this.geojson]};var Zn=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};Zn.parse=function(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");var r=e[1];return t.scope.has(r)?new Zn(r,t.scope.get(r)):t.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Zn.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},Zn.prototype.eachChild=function(){},Zn.prototype.outputDefined=function(){return!1},Zn.prototype.serialize=function(){return["var",this.name]};var Wn=function(e,t,r,a,l){t===void 0&&(t=[]),a===void 0&&(a=new Je),l===void 0&&(l=[]),this.registry=e,this.path=t,this.key=t.map((function(c){return"["+c+"]"})).join(""),this.scope=a,this.errors=l,this.expectedType=r};function es(e,t){for(var r,a=e.length-1,l=0,c=a,h=0;l<=c;)if((r=e[h=Math.floor((l+c)/2)])<=t){if(h===a||t<e[h+1])return h;l=h+1}else{if(!(r>t))throw new oi("Input is not a number.");c=h-1}return 0}Wn.prototype.parse=function(e,t,r,a,l){return l===void 0&&(l={}),t?this.concat(t,r,a)._parse(e,l):this._parse(e,l)},Wn.prototype._parse=function(e,t){function r(b,S,I){return I==="assert"?new yr(S,[b]):I==="coerce"?new on(S,[b]):b}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var a=e[0];if(typeof a!="string")return this.error("Expression name must be a string, but found "+typeof a+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var l=this.registry[a];if(l){var c=l.parse(e,this);if(!c)return null;if(this.expectedType){var h=this.expectedType,m=c.type;if(h.kind!=="string"&&h.kind!=="number"&&h.kind!=="boolean"&&h.kind!=="object"&&h.kind!=="array"||m.kind!=="value")if(h.kind!=="color"&&h.kind!=="formatted"&&h.kind!=="resolvedImage"||m.kind!=="value"&&m.kind!=="string"){if(this.checkSubtype(h,m))return null}else c=r(c,h,t.typeAnnotation||"coerce");else c=r(c,h,t.typeAnnotation||"assert")}if(!(c instanceof Si)&&c.type.kind!=="resolvedImage"&&(function b(S){if(S instanceof Zn)return b(S.boundExpression);if(S instanceof di&&S.name==="error"||S instanceof In||S instanceof an)return!1;var I=S instanceof on||S instanceof yr,C=!0;return S.eachChild((function(z){C=I?C&&b(z):C&&z instanceof Si})),!!C&&Gn(S)&&go(S,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])})(c)){var g=new Dn;try{c=new Si(c.type,c.evaluate(g))}catch(b){return this.error(b.message),null}}return c}return this.error('Unknown expression "'+a+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof e+" instead.")},Wn.prototype.concat=function(e,t,r){var a=typeof e=="number"?this.path.concat(e):this.path,l=r?this.scope.concat(r):this.scope;return new Wn(this.registry,a,t||null,l,this.errors)},Wn.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var a=""+this.key+t.map((function(l){return"["+l+"]"})).join("");this.errors.push(new Ae(a,e))},Wn.prototype.checkSubtype=function(e,t){var r=Ht(e,t);return r&&this.error(r),r};var Ui=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var a=0,l=r;a<l.length;a+=1){var c=l[a],h=c[1];this.labels.push(c[0]),this.outputs.push(h)}};function Vr(e,t,r){return e*(1-r)+t*r}Ui.parse=function(e,t){if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");var r=t.parse(e[1],1,ge);if(!r)return null;var a=[],l=null;t.expectedType&&t.expectedType.kind!=="value"&&(l=t.expectedType);for(var c=1;c<e.length;c+=2){var h=c===1?-1/0:e[c],m=e[c+1],g=c,b=c+1;if(typeof h!="number")return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',g);if(a.length&&a[a.length-1][0]>=h)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',g);var S=t.parse(m,b,l);if(!S)return null;l=l||S.type,a.push([h,S])}return new Ui(l,r,a)},Ui.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var l=t.length;return a>=t[l-1]?r[l-1].evaluate(e):r[es(t,a)].evaluate(e)},Ui.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},Ui.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},Ui.prototype.serialize=function(){for(var e=["step",this.input.serialize()],t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var Ho=Object.freeze({__proto__:null,number:Vr,color:function(e,t,r){return new $t(Vr(e.r,t.r,r),Vr(e.g,t.g,r),Vr(e.b,t.b,r),Vr(e.a,t.a,r))},array:function(e,t,r){return e.map((function(a,l){return Vr(a,t[l],r)}))}}),pl=6/29*3*(6/29),zc=Math.PI/180,Dc=180/Math.PI;function ou(e){return e>.008856451679035631?Math.pow(e,1/3):e/pl+4/29}function au(e){return e>6/29?e*e*e:pl*(e-4/29)}function su(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function uu(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function hl(e){var t=uu(e.r),r=uu(e.g),a=uu(e.b),l=ou((.4124564*t+.3575761*r+.1804375*a)/.95047),c=ou((.2126729*t+.7151522*r+.072175*a)/1);return{l:116*c-16,a:500*(l-c),b:200*(c-ou((.0193339*t+.119192*r+.9503041*a)/1.08883)),alpha:e.a}}function fl(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,a=isNaN(e.b)?t:t-e.b/200;return t=1*au(t),r=.95047*au(r),a=1.08883*au(a),new $t(su(3.2404542*r-1.5371385*t-.4985314*a),su(-.969266*r+1.8760108*t+.041556*a),su(.0556434*r-.2040259*t+1.0572252*a),e.alpha)}function Rc(e,t,r){var a=t-e;return e+r*(a>180||a<-180?a-360*Math.round(a/360):a)}var _a={forward:hl,reverse:fl,interpolate:function(e,t,r){return{l:Vr(e.l,t.l,r),a:Vr(e.a,t.a,r),b:Vr(e.b,t.b,r),alpha:Vr(e.alpha,t.alpha,r)}}},xa={forward:function(e){var t=hl(e),r=t.l,a=t.a,l=t.b,c=Math.atan2(l,a)*Dc;return{h:c<0?c+360:c,c:Math.sqrt(a*a+l*l),l:r,alpha:e.a}},reverse:function(e){var t=e.h*zc,r=e.c;return fl({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:Rc(e.h,t.h,r),c:Vr(e.c,t.c,r),l:Vr(e.l,t.l,r),alpha:Vr(e.alpha,t.alpha,r)}}},dl=Object.freeze({__proto__:null,lab:_a,hcl:xa}),mi=function(e,t,r,a,l){this.type=e,this.operator=t,this.interpolation=r,this.input=a,this.labels=[],this.outputs=[];for(var c=0,h=l;c<h.length;c+=1){var m=h[c],g=m[1];this.labels.push(m[0]),this.outputs.push(g)}};function lu(e,t,r,a){var l=a-r,c=e-r;return l===0?0:t===1?c/l:(Math.pow(t,c)-1)/(Math.pow(t,l)-1)}mi.interpolationFactor=function(e,t,r,a){var l=0;if(e.name==="exponential")l=lu(t,e.base,r,a);else if(e.name==="linear")l=lu(t,1,r,a);else if(e.name==="cubic-bezier"){var c=e.controlPoints;l=new M(c[0],c[1],c[2],c[3]).solve(lu(t,1,r,a))}return l},mi.parse=function(e,t){var r=e[0],a=e[1],l=e[2],c=e.slice(3);if(!Array.isArray(a)||a.length===0)return t.error("Expected an interpolation type expression.",1);if(a[0]==="linear")a={name:"linear"};else if(a[0]==="exponential"){var h=a[1];if(typeof h!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:h}}else{if(a[0]!=="cubic-bezier")return t.error("Unknown interpolation type "+String(a[0]),1,0);var m=a.slice(1);if(m.length!==4||m.some((function(te){return typeof te!="number"||te<0||te>1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:m}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(l=t.parse(l,2,ge)))return null;var g=[],b=null;r==="interpolate-hcl"||r==="interpolate-lab"?b=Me:t.expectedType&&t.expectedType.kind!=="value"&&(b=t.expectedType);for(var S=0;S<c.length;S+=2){var I=c[S],C=c[S+1],z=S+3,j=S+4;if(typeof I!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',z);if(g.length&&g[g.length-1][0]>=I)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',z);var G=t.parse(C,j,b);if(!G)return null;b=b||G.type,g.push([I,G])}return b.kind==="number"||b.kind==="color"||b.kind==="array"&&b.itemType.kind==="number"&&typeof b.N=="number"?new mi(b,r,a,l,g):t.error("Type "+Rt(b)+" is not interpolatable.")},mi.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var l=t.length;if(a>=t[l-1])return r[l-1].evaluate(e);var c=es(t,a),h=mi.interpolationFactor(this.interpolation,a,t[c],t[c+1]),m=r[c].evaluate(e),g=r[c+1].evaluate(e);return this.operator==="interpolate"?Ho[this.type.kind.toLowerCase()](m,g,h):this.operator==="interpolate-hcl"?xa.reverse(xa.interpolate(xa.forward(m),xa.forward(g),h)):_a.reverse(_a.interpolate(_a.forward(m),_a.forward(g),h))},mi.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},mi.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},mi.prototype.serialize=function(){var e;e=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var t=[this.operator,e,this.input.serialize()],r=0;r<this.labels.length;r++)t.push(this.labels[r],this.outputs[r].serialize());return t};var Hn=function(e,t){this.type=e,this.args=t};Hn.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var r=null,a=t.expectedType;a&&a.kind!=="value"&&(r=a);for(var l=[],c=0,h=e.slice(1);c<h.length;c+=1){var m=t.parse(h[c],1+l.length,r,void 0,{typeAnnotation:"omit"});if(!m)return null;r=r||m.type,l.push(m)}var g=a&&l.some((function(b){return Ht(a,b.type)}));return new Hn(g?Fe:r,l)},Hn.prototype.evaluate=function(e){for(var t,r=null,a=0,l=0,c=this.args;l<c.length&&(a++,(r=c[l].evaluate(e))&&r instanceof Di&&!r.available&&(t||(t=r.name),r=null,a===this.args.length&&(r=t)),r===null);l+=1);return r},Hn.prototype.eachChild=function(e){this.args.forEach(e)},Hn.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},Hn.prototype.serialize=function(){var e=["coalesce"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Xn=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};Xn.prototype.evaluate=function(e){return this.result.evaluate(e)},Xn.prototype.eachChild=function(e){for(var t=0,r=this.bindings;t<r.length;t+=1)e(r[t][1]);e(this.result)},Xn.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found "+(e.length-1)+" instead.");for(var r=[],a=1;a<e.length-1;a+=2){var l=e[a];if(typeof l!="string")return t.error("Expected string, but found "+typeof l+" instead.",a);if(/[^a-zA-Z0-9_]/.test(l))return t.error("Variable names must contain only alphanumeric characters or '_'.",a);var c=t.parse(e[a+1],a+1);if(!c)return null;r.push([l,c])}var h=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return h?new Xn(r,h):null},Xn.prototype.outputDefined=function(){return this.result.outputDefined()},Xn.prototype.serialize=function(){for(var e=["let"],t=0,r=this.bindings;t<r.length;t+=1){var a=r[t];e.push(a[0],a[1].serialize())}return e.push(this.result.serialize()),e};var _o=function(e,t,r){this.type=e,this.index=t,this.input=r};_o.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,ge),a=t.parse(e[2],2,Gt(t.expectedType||Fe));return r&&a?new _o(a.type.itemType,r,a):null},_o.prototype.evaluate=function(e){var t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new oi("Array index out of bounds: "+t+" < 0.");if(t>=r.length)throw new oi("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new oi("Array index must be an integer, but found "+t+" instead.");return r[t]},_o.prototype.eachChild=function(e){e(this.index),e(this.input)},_o.prototype.outputDefined=function(){return!1},_o.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var xo=function(e,t){this.type=Be,this.needle=e,this.haystack=t};xo.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Fe),a=t.parse(e[2],2,Fe);return r&&a?Cr(r.type,[Be,Ve,ge,Ge,Fe])?new xo(r,a):t.error("Expected first argument to be of type boolean, string, number or null, but found "+Rt(r.type)+" instead"):null},xo.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Qt(t,["boolean","string","number","null"]))throw new oi("Expected first argument to be of type boolean, string, number or null, but found "+Rt(kr(t))+" instead.");if(!Qt(r,["string","array"]))throw new oi("Expected second argument to be of type array or string, but found "+Rt(kr(r))+" instead.");return r.indexOf(t)>=0},xo.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},xo.prototype.outputDefined=function(){return!0},xo.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Kn=function(e,t,r){this.type=ge,this.needle=e,this.haystack=t,this.fromIndex=r};Kn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Fe),a=t.parse(e[2],2,Fe);if(!r||!a)return null;if(!Cr(r.type,[Be,Ve,ge,Ge,Fe]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+Rt(r.type)+" instead");if(e.length===4){var l=t.parse(e[3],3,ge);return l?new Kn(r,a,l):null}return new Kn(r,a)},Kn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Qt(t,["boolean","string","number","null"]))throw new oi("Expected first argument to be of type boolean, string, number or null, but found "+Rt(kr(t))+" instead.");if(!Qt(r,["string","array"]))throw new oi("Expected second argument to be of type array or string, but found "+Rt(kr(r))+" instead.");if(this.fromIndex){var a=this.fromIndex.evaluate(e);return r.indexOf(t,a)}return r.indexOf(t)},Kn.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},Kn.prototype.outputDefined=function(){return!1},Kn.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var bo=function(e,t,r,a,l,c){this.inputType=e,this.type=t,this.input=r,this.cases=a,this.outputs=l,this.otherwise=c};bo.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var r,a;t.expectedType&&t.expectedType.kind!=="value"&&(a=t.expectedType);for(var l={},c=[],h=2;h<e.length-1;h+=2){var m=e[h],g=e[h+1];Array.isArray(m)||(m=[m]);var b=t.concat(h);if(m.length===0)return b.error("Expected at least one branch label.");for(var S=0,I=m;S<I.length;S+=1){var C=I[S];if(typeof C!="number"&&typeof C!="string")return b.error("Branch labels must be numbers or strings.");if(typeof C=="number"&&Math.abs(C)>Number.MAX_SAFE_INTEGER)return b.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof C=="number"&&Math.floor(C)!==C)return b.error("Numeric branch labels must be integer values.");if(r){if(b.checkSubtype(r,kr(C)))return null}else r=kr(C);if(l[String(C)]!==void 0)return b.error("Branch labels must be unique.");l[String(C)]=c.length}var z=t.parse(g,h,a);if(!z)return null;a=a||z.type,c.push(z)}var j=t.parse(e[1],1,Fe);if(!j)return null;var G=t.parse(e[e.length-1],e.length-1,a);return G?j.type.kind!=="value"&&t.concat(1).checkSubtype(r,j.type)?null:new bo(r,a,j,l,c,G):null},bo.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(kr(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},bo.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},bo.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},bo.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],a={},l=0,c=Object.keys(this.cases).sort();l<c.length;l+=1){var h=c[l];(I=a[this.cases[h]])===void 0?(a[this.cases[h]]=r.length,r.push([this.cases[h],[h]])):r[I][1].push(h)}for(var m=function(z){return e.inputType.kind==="number"?Number(z):z},g=0,b=r;g<b.length;g+=1){var S=b[g],I=S[0],C=S[1];t.push(C.length===1?m(C[0]):C.map(m)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var wo=function(e,t,r){this.type=e,this.branches=t,this.otherwise=r};wo.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only "+(e.length-1)+".");if(e.length%2!=0)return t.error("Expected an odd number of arguments.");var r;t.expectedType&&t.expectedType.kind!=="value"&&(r=t.expectedType);for(var a=[],l=1;l<e.length-1;l+=2){var c=t.parse(e[l],l,Be);if(!c)return null;var h=t.parse(e[l+1],l+1,r);if(!h)return null;a.push([c,h]),r=r||h.type}var m=t.parse(e[e.length-1],e.length-1,r);return m?new wo(r,a,m):null},wo.prototype.evaluate=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],l=a[1];if(a[0].evaluate(e))return l.evaluate(e)}return this.otherwise.evaluate(e)},wo.prototype.eachChild=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],l=a[1];e(a[0]),e(l)}e(this.otherwise)},wo.prototype.outputDefined=function(){return this.branches.every((function(e){return e[1].outputDefined()}))&&this.otherwise.outputDefined()},wo.prototype.serialize=function(){var e=["case"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Jn=function(e,t,r,a){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=a};function ml(e,t){return e==="=="||e==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function yl(e,t,r,a){return a.compare(t,r)===0}function ir(e,t,r){var a=e!=="=="&&e!=="!=";return(function(){function l(c,h,m){this.type=Be,this.lhs=c,this.rhs=h,this.collator=m,this.hasUntypedArgument=c.type.kind==="value"||h.type.kind==="value"}return l.parse=function(c,h){if(c.length!==3&&c.length!==4)return h.error("Expected two or three arguments.");var m=c[0],g=h.parse(c[1],1,Fe);if(!g)return null;if(!ml(m,g.type))return h.concat(1).error('"'+m+`" comparisons are not supported for type '`+Rt(g.type)+"'.");var b=h.parse(c[2],2,Fe);if(!b)return null;if(!ml(m,b.type))return h.concat(2).error('"'+m+`" comparisons are not supported for type '`+Rt(b.type)+"'.");if(g.type.kind!==b.type.kind&&g.type.kind!=="value"&&b.type.kind!=="value")return h.error("Cannot compare types '"+Rt(g.type)+"' and '"+Rt(b.type)+"'.");a&&(g.type.kind==="value"&&b.type.kind!=="value"?g=new yr(b.type,[g]):g.type.kind!=="value"&&b.type.kind==="value"&&(b=new yr(g.type,[b])));var S=null;if(c.length===4){if(g.type.kind!=="string"&&b.type.kind!=="string"&&g.type.kind!=="value"&&b.type.kind!=="value")return h.error("Cannot use collator to compare non-string types.");if(!(S=h.parse(c[3],3,Pt)))return null}return new l(g,b,S)},l.prototype.evaluate=function(c){var h=this.lhs.evaluate(c),m=this.rhs.evaluate(c);if(a&&this.hasUntypedArgument){var g=kr(h),b=kr(m);if(g.kind!==b.kind||g.kind!=="string"&&g.kind!=="number")throw new oi('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+g.kind+", "+b.kind+") instead.")}if(this.collator&&!a&&this.hasUntypedArgument){var S=kr(h),I=kr(m);if(S.kind!=="string"||I.kind!=="string")return t(c,h,m)}return this.collator?r(c,h,m,this.collator.evaluate(c)):t(c,h,m)},l.prototype.eachChild=function(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)},l.prototype.outputDefined=function(){return!0},l.prototype.serialize=function(){var c=[e];return this.eachChild((function(h){c.push(h.serialize())})),c},l})()}Jn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Fe),a=t.parse(e[2],2,ge);if(!r||!a)return null;if(!Cr(r.type,[Gt(Fe),Ve,Fe]))return t.error("Expected first argument to be of type array or string, but found "+Rt(r.type)+" instead");if(e.length===4){var l=t.parse(e[3],3,ge);return l?new Jn(r.type,r,a,l):null}return new Jn(r.type,r,a)},Jn.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Qt(t,["string","array"]))throw new oi("Expected first argument to be of type array or string, but found "+Rt(kr(t))+" instead.");if(this.endIndex){var a=this.endIndex.evaluate(e);return t.slice(r,a)}return t.slice(r)},Jn.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},Jn.prototype.outputDefined=function(){return!1},Jn.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Lc=ir("==",(function(e,t,r){return t===r}),yl),ts=ir("!=",(function(e,t,r){return t!==r}),(function(e,t,r,a){return!yl(0,t,r,a)})),vl=ir("<",(function(e,t,r){return t<r}),(function(e,t,r,a){return a.compare(t,r)<0})),gl=ir(">",(function(e,t,r){return t>r}),(function(e,t,r,a){return a.compare(t,r)>0})),_l=ir("<=",(function(e,t,r){return t<=r}),(function(e,t,r,a){return a.compare(t,r)<=0})),xl=ir(">=",(function(e,t,r){return t>=r}),(function(e,t,r,a){return a.compare(t,r)>=0})),So=function(e,t,r,a,l){this.type=Ve,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=a,this.maxFractionDigits=l};So.parse=function(e,t){if(e.length!==3)return t.error("Expected two arguments.");var r=t.parse(e[1],1,ge);if(!r)return null;var a=e[2];if(typeof a!="object"||Array.isArray(a))return t.error("NumberFormat options argument must be an object.");var l=null;if(a.locale&&!(l=t.parse(a.locale,1,Ve)))return null;var c=null;if(a.currency&&!(c=t.parse(a.currency,1,Ve)))return null;var h=null;if(a["min-fraction-digits"]&&!(h=t.parse(a["min-fraction-digits"],1,ge)))return null;var m=null;return a["max-fraction-digits"]&&!(m=t.parse(a["max-fraction-digits"],1,ge))?null:new So(r,l,c,h,m)},So.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},So.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},So.prototype.outputDefined=function(){return!1},So.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var Yn=function(e){this.type=ge,this.input=e};Yn.parse=function(e,t){if(e.length!==2)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?r.type.kind!=="array"&&r.type.kind!=="string"&&r.type.kind!=="value"?t.error("Expected argument of type string or array, but found "+Rt(r.type)+" instead."):new Yn(r):null},Yn.prototype.evaluate=function(e){var t=this.input.evaluate(e);if(typeof t=="string"||Array.isArray(t))return t.length;throw new oi("Expected value to be of type string or array, but found "+Rt(kr(t))+" instead.")},Yn.prototype.eachChild=function(e){e(this.input)},Yn.prototype.outputDefined=function(){return!1},Yn.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Io={"==":Lc,"!=":ts,">":gl,"<":vl,">=":xl,"<=":_l,array:yr,at:_o,boolean:yr,case:wo,coalesce:Hn,collator:In,format:yn,image:Ji,in:xo,"index-of":Kn,interpolate:mi,"interpolate-hcl":mi,"interpolate-lab":mi,length:Yn,let:Xn,literal:Si,match:bo,number:yr,"number-format":So,object:yr,slice:Jn,step:Ui,string:yr,"to-boolean":on,"to-color":on,"to-number":on,"to-string":on,var:Zn,within:an};function bl(e,t){var r=t[0],a=t[1],l=t[2],c=t[3];r=r.evaluate(e),a=a.evaluate(e),l=l.evaluate(e);var h=c?c.evaluate(e):1,m=ru(r,a,l,h);if(m)throw new oi(m);return new $t(r/255*h,a/255*h,l/255*h,h)}function wl(e,t){return e in t}function cu(e,t){var r=t[e];return r===void 0?null:r}function To(e){return{type:e}}function Sl(e){return{result:"success",value:e}}function Ao(e){return{result:"error",value:e}}function Eo(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function Il(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function ba(e){return!!e.expression&&e.expression.interpolated}function ur(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":e===null?"null":typeof e}function rs(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Fc(e){return e}function Xo(e,t,r){return e!==void 0?e:t!==void 0?t:r!==void 0?r:void 0}function Tl(e,t,r,a,l){return Xo(typeof r===l?a[r]:void 0,e.default,t.default)}function Oc(e,t,r){if(ur(r)!=="number")return Xo(e.default,t.default);var a=e.stops.length;if(a===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[a-1][0])return e.stops[a-1][1];var l=es(e.stops.map((function(c){return c[0]})),r);return e.stops[l][1]}function Al(e,t,r){var a=e.base!==void 0?e.base:1;if(ur(r)!=="number")return Xo(e.default,t.default);var l=e.stops.length;if(l===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[l-1][0])return e.stops[l-1][1];var c=es(e.stops.map((function(I){return I[0]})),r),h=(function(I,C,z,j){var G=j-z,te=I-z;return G===0?0:C===1?te/G:(Math.pow(C,te)-1)/(Math.pow(C,G)-1)})(r,a,e.stops[c][0],e.stops[c+1][0]),m=e.stops[c][1],g=e.stops[c+1][1],b=Ho[t.type]||Fc;if(e.colorSpace&&e.colorSpace!=="rgb"){var S=dl[e.colorSpace];b=function(I,C){return S.reverse(S.interpolate(S.forward(I),S.forward(C),h))}}return typeof m.evaluate=="function"?{evaluate:function(){for(var I=[],C=arguments.length;C--;)I[C]=arguments[C];var z=m.evaluate.apply(void 0,I),j=g.evaluate.apply(void 0,I);if(z!==void 0&&j!==void 0)return b(z,j,h)}}:b(m,g,h)}function is(e,t,r){return t.type==="color"?r=$t.parse(r):t.type==="formatted"?r=ni.fromString(r.toString()):t.type==="resolvedImage"?r=Di.fromString(r.toString()):ur(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0),Xo(r,e.default,t.default)}di.register(Io,{error:[{kind:"error"},[Ve],function(e,t){throw new oi(t[0].evaluate(e))}],typeof:[Ve,[Fe],function(e,t){return Rt(kr(t[0].evaluate(e)))}],"to-rgba":[Gt(ge,4),[Me],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[Me,[ge,ge,ge],bl],rgba:[Me,[ge,ge,ge,ge],bl],has:{type:Be,overloads:[[[Ve],function(e,t){return wl(t[0].evaluate(e),e.properties())}],[[Ve,yt],function(e,t){var r=t[1];return wl(t[0].evaluate(e),r.evaluate(e))}]]},get:{type:Fe,overloads:[[[Ve],function(e,t){return cu(t[0].evaluate(e),e.properties())}],[[Ve,yt],function(e,t){var r=t[1];return cu(t[0].evaluate(e),r.evaluate(e))}]]},"feature-state":[Fe,[Ve],function(e,t){return cu(t[0].evaluate(e),e.featureState||{})}],properties:[yt,[],function(e){return e.properties()}],"geometry-type":[Ve,[],function(e){return e.geometryType()}],id:[Fe,[],function(e){return e.id()}],zoom:[ge,[],function(e){return e.globals.zoom}],"heatmap-density":[ge,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[ge,[],function(e){return e.globals.lineProgress||0}],accumulated:[Fe,[],function(e){return e.globals.accumulated===void 0?null:e.globals.accumulated}],"+":[ge,To(ge),function(e,t){for(var r=0,a=0,l=t;a<l.length;a+=1)r+=l[a].evaluate(e);return r}],"*":[ge,To(ge),function(e,t){for(var r=1,a=0,l=t;a<l.length;a+=1)r*=l[a].evaluate(e);return r}],"-":{type:ge,overloads:[[[ge,ge],function(e,t){var r=t[1];return t[0].evaluate(e)-r.evaluate(e)}],[[ge],function(e,t){return-t[0].evaluate(e)}]]},"/":[ge,[ge,ge],function(e,t){var r=t[1];return t[0].evaluate(e)/r.evaluate(e)}],"%":[ge,[ge,ge],function(e,t){var r=t[1];return t[0].evaluate(e)%r.evaluate(e)}],ln2:[ge,[],function(){return Math.LN2}],pi:[ge,[],function(){return Math.PI}],e:[ge,[],function(){return Math.E}],"^":[ge,[ge,ge],function(e,t){var r=t[1];return Math.pow(t[0].evaluate(e),r.evaluate(e))}],sqrt:[ge,[ge],function(e,t){return Math.sqrt(t[0].evaluate(e))}],log10:[ge,[ge],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN10}],ln:[ge,[ge],function(e,t){return Math.log(t[0].evaluate(e))}],log2:[ge,[ge],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN2}],sin:[ge,[ge],function(e,t){return Math.sin(t[0].evaluate(e))}],cos:[ge,[ge],function(e,t){return Math.cos(t[0].evaluate(e))}],tan:[ge,[ge],function(e,t){return Math.tan(t[0].evaluate(e))}],asin:[ge,[ge],function(e,t){return Math.asin(t[0].evaluate(e))}],acos:[ge,[ge],function(e,t){return Math.acos(t[0].evaluate(e))}],atan:[ge,[ge],function(e,t){return Math.atan(t[0].evaluate(e))}],min:[ge,To(ge),function(e,t){return Math.min.apply(Math,t.map((function(r){return r.evaluate(e)})))}],max:[ge,To(ge),function(e,t){return Math.max.apply(Math,t.map((function(r){return r.evaluate(e)})))}],abs:[ge,[ge],function(e,t){return Math.abs(t[0].evaluate(e))}],round:[ge,[ge],function(e,t){var r=t[0].evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[ge,[ge],function(e,t){return Math.floor(t[0].evaluate(e))}],ceil:[ge,[ge],function(e,t){return Math.ceil(t[0].evaluate(e))}],"filter-==":[Be,[Ve,Fe],function(e,t){var r=t[0],a=t[1];return e.properties()[r.value]===a.value}],"filter-id-==":[Be,[Fe],function(e,t){var r=t[0];return e.id()===r.value}],"filter-type-==":[Be,[Ve],function(e,t){var r=t[0];return e.geometryType()===r.value}],"filter-<":[Be,[Ve,Fe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l<c}],"filter-id-<":[Be,[Fe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a<l}],"filter->":[Be,[Ve,Fe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l>c}],"filter-id->":[Be,[Fe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a>l}],"filter-<=":[Be,[Ve,Fe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l<=c}],"filter-id-<=":[Be,[Fe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a<=l}],"filter->=":[Be,[Ve,Fe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l>=c}],"filter-id->=":[Be,[Fe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a>=l}],"filter-has":[Be,[Fe],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[Be,[],function(e){return e.id()!==null&&e.id()!==void 0}],"filter-type-in":[Be,[Gt(Ve)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[Be,[Gt(Fe)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[Be,[Ve,Gt(Fe)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[Be,[Ve,Gt(Fe)],function(e,t){var r=t[0],a=t[1];return(function(l,c,h,m){for(;h<=m;){var g=h+m>>1;if(c[g]===l)return!0;c[g]>l?m=g-1:h=g+1}return!1})(e.properties()[r.value],a.value,0,a.value.length-1)}],all:{type:Be,overloads:[[[Be,Be],function(e,t){var r=t[1];return t[0].evaluate(e)&&r.evaluate(e)}],[To(Be),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(!a[r].evaluate(e))return!1;return!0}]]},any:{type:Be,overloads:[[[Be,Be],function(e,t){var r=t[1];return t[0].evaluate(e)||r.evaluate(e)}],[To(Be),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(a[r].evaluate(e))return!0;return!1}]]},"!":[Be,[Be],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[Be,[Ve],function(e,t){var r=e.globals&&e.globals.isSupportedScript;return!r||r(t[0].evaluate(e))}],upcase:[Ve,[Ve],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[Ve,[Ve],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[Ve,To(Fe),function(e,t){return t.map((function(r){return va(r.evaluate(e))})).join("")}],"resolved-locale":[Ve,[Pt],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});var Ko=function(e,t){this.expression=e,this._warningHistory={},this._evaluator=new Dn,this._defaultValue=t?(function(r){return r.type==="color"&&rs(r.default)?new $t(0,0,0,0):r.type==="color"?$t.parse(r.default)||null:r.default===void 0?null:r.default})(t):null,this._enumValues=t&&t.type==="enum"?t.values:null};function wa(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in Io}function ns(e,t){var r=new Wn(Io,[],t?(function(l){var c={color:Me,string:Ve,number:ge,enum:Ve,boolean:Be,formatted:rr,resolvedImage:Ct};return l.type==="array"?Gt(c[l.value]||Fe,l.length):c[l.type]})(t):void 0),a=r.parse(e,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?Sl(new Ko(a,t)):Ao(r.errors)}Ko.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=a,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=c,this.expression.evaluate(this._evaluator)},Ko.prototype.evaluate=function(e,t,r,a,l,c){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=a,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=c||null;try{var h=this.expression.evaluate(this._evaluator);if(h==null||typeof h=="number"&&h!=h)return this._defaultValue;if(this._enumValues&&!(h in this._enumValues))throw new oi("Expected value to be one of "+Object.keys(this._enumValues).map((function(m){return JSON.stringify(m)})).join(", ")+", but found "+JSON.stringify(h)+" instead.");return h}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console<"u"&&console.warn(m.message)),this._defaultValue}};var Sa=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!$n(t.expression)};Sa.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,l,c)},Sa.prototype.evaluate=function(e,t,r,a,l,c){return this._styleExpression.evaluate(e,t,r,a,l,c)};var Jo=function(e,t,r,a){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!$n(t.expression),this.interpolationType=a};function El(e,t){if((e=ns(e,t)).result==="error")return e;var r=e.value.expression,a=Gn(r);if(!a&&!Eo(t))return Ao([new Ae("","data expressions not supported")]);var l=go(r,["zoom"]);if(!l&&!Il(t))return Ao([new Ae("","zoom expressions not supported")]);var c=(function h(m){var g=null;if(m instanceof Xn)g=h(m.result);else if(m instanceof Hn)for(var b=0,S=m.args;b<S.length&&!(g=h(S[b]));b+=1);else(m instanceof Ui||m instanceof mi)&&m.input instanceof di&&m.input.name==="zoom"&&(g=m);return g instanceof Ae||m.eachChild((function(I){var C=h(I);C instanceof Ae?g=C:!g&&C?g=new Ae("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):g&&C&&g!==C&&(g=new Ae("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),g})(r);return c||l?c instanceof Ae?Ao([c]):c instanceof mi&&!ba(t)?Ao([new Ae("",'"interpolate" expressions cannot be used with this property')]):Sl(c?new Jo(a?"camera":"composite",e.value,c.labels,c instanceof mi?c.interpolation:void 0):new Sa(a?"constant":"source",e.value)):Ao([new Ae("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Jo.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,l,c)},Jo.prototype.evaluate=function(e,t,r,a,l,c){return this._styleExpression.evaluate(e,t,r,a,l,c)},Jo.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?mi.interpolationFactor(this.interpolationType,e,t,r):0};var Yo=function(e,t){this._parameters=e,this._specification=t,Ie(this,(function r(a,l){var c,h,m,g=l.type==="color",b=a.stops&&typeof a.stops[0][0]=="object",S=b||!(b||a.property!==void 0),I=a.type||(ba(l)?"exponential":"interval");if(g&&((a=Ie({},a)).stops&&(a.stops=a.stops.map((function(Oe){return[Oe[0],$t.parse(Oe[1])]}))),a.default=$t.parse(a.default?a.default:l.default)),a.colorSpace&&a.colorSpace!=="rgb"&&!dl[a.colorSpace])throw new Error("Unknown color space: "+a.colorSpace);if(I==="exponential")c=Al;else if(I==="interval")c=Oc;else if(I==="categorical"){c=Tl,h=Object.create(null);for(var C=0,z=a.stops;C<z.length;C+=1){var j=z[C];h[j[0]]=j[1]}m=typeof a.stops[0][0]}else{if(I!=="identity")throw new Error('Unknown function type "'+I+'"');c=is}if(b){for(var G={},te=[],K=0;K<a.stops.length;K++){var oe=a.stops[K],le=oe[0].zoom;G[le]===void 0&&(G[le]={zoom:le,type:a.type,property:a.property,default:a.default,stops:[]},te.push(le)),G[le].stops.push([oe[0].value,oe[1]])}for(var ce=[],he=0,xe=te;he<xe.length;he+=1){var Pe=xe[he];ce.push([G[Pe].zoom,r(G[Pe],l)])}var ze={name:"linear"};return{kind:"composite",interpolationType:ze,interpolationFactor:mi.interpolationFactor.bind(void 0,ze),zoomStops:ce.map((function(Oe){return Oe[0]})),evaluate:function(Oe,ot){var qe=Oe.zoom;return Al({stops:ce,base:a.base},l,qe).evaluate(qe,ot)}}}if(S){var rt=I==="exponential"?{name:"exponential",base:a.base!==void 0?a.base:1}:null;return{kind:"camera",interpolationType:rt,interpolationFactor:mi.interpolationFactor.bind(void 0,rt),zoomStops:a.stops.map((function(Oe){return Oe[0]})),evaluate:function(Oe){return c(a,l,Oe.zoom,h,m)}}}return{kind:"source",evaluate:function(Oe,ot){var qe=ot&&ot.properties?ot.properties[a.property]:void 0;return qe===void 0?Xo(a.default,l.default):c(a,l,qe,h,m)}}})(this._parameters,this._specification))};function vn(e){var t=e.key,r=e.value,a=e.valueSpec||{},l=e.objectElementValidators||{},c=e.style,h=e.styleSpec,m=[],g=ur(r);if(g!=="object")return[new H(t,r,"object expected, "+g+" found")];for(var b in r){var S=b.split(".")[0],I=a[S]||a["*"],C=void 0;if(l[S])C=l[S];else if(a[S])C=Dt;else if(l["*"])C=l["*"];else{if(!a["*"]){m.push(new H(t,r[b],'unknown property "'+b+'"'));continue}C=Dt}m=m.concat(C({key:(t&&t+".")+b,value:r[b],valueSpec:I,style:c,styleSpec:h,object:r,objectKey:b},r))}for(var z in a)l[z]||a[z].required&&a[z].default===void 0&&r[z]===void 0&&m.push(new H(t,r,'missing required property "'+z+'"'));return m}function Pl(e){var t=e.value,r=e.valueSpec,a=e.style,l=e.styleSpec,c=e.key,h=e.arrayElementValidator||Dt;if(ur(t)!=="array")return[new H(c,t,"array expected, "+ur(t)+" found")];if(r.length&&t.length!==r.length)return[new H(c,t,"array length "+r.length+" expected, length "+t.length+" found")];if(r["min-length"]&&t.length<r["min-length"])return[new H(c,t,"array length at least "+r["min-length"]+" expected, length "+t.length+" found")];var m={type:r.value,values:r.values};l.$version<7&&(m.function=r.function),ur(r.value)==="object"&&(m=r.value);for(var g=[],b=0;b<t.length;b++)g=g.concat(h({array:t,arrayIndex:b,value:t[b],valueSpec:m,style:a,styleSpec:l,key:c+"["+b+"]"}));return g}function Cl(e){var t=e.key,r=e.value,a=e.valueSpec,l=ur(r);return l==="number"&&r!=r&&(l="NaN"),l!=="number"?[new H(t,r,"number expected, "+l+" found")]:"minimum"in a&&r<a.minimum?[new H(t,r,r+" is less than the minimum value "+a.minimum)]:"maximum"in a&&r>a.maximum?[new H(t,r,r+" is greater than the maximum value "+a.maximum)]:[]}function kl(e){var t,r,a,l=e.valueSpec,c=Ee(e.value.type),h={},m=c!=="categorical"&&e.value.property===void 0,g=!m,b=ur(e.value.stops)==="array"&&ur(e.value.stops[0])==="array"&&ur(e.value.stops[0][0])==="object",S=vn({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(z){if(c==="identity")return[new H(z.key,z.value,'identity function may not have a "stops" property')];var j=[],G=z.value;return j=j.concat(Pl({key:z.key,value:G,valueSpec:z.valueSpec,style:z.style,styleSpec:z.styleSpec,arrayElementValidator:I})),ur(G)==="array"&&G.length===0&&j.push(new H(z.key,G,"array must have at least one stop")),j},default:function(z){return Dt({key:z.key,value:z.value,valueSpec:l,style:z.style,styleSpec:z.styleSpec})}}});return c==="identity"&&m&&S.push(new H(e.key,e.value,'missing required property "property"')),c==="identity"||e.value.stops||S.push(new H(e.key,e.value,'missing required property "stops"')),c==="exponential"&&e.valueSpec.expression&&!ba(e.valueSpec)&&S.push(new H(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(g&&!Eo(e.valueSpec)?S.push(new H(e.key,e.value,"property functions not supported")):m&&!Il(e.valueSpec)&&S.push(new H(e.key,e.value,"zoom functions not supported"))),c!=="categorical"&&!b||e.value.property!==void 0||S.push(new H(e.key,e.value,'"property" property is required')),S;function I(z){var j=[],G=z.value,te=z.key;if(ur(G)!=="array")return[new H(te,G,"array expected, "+ur(G)+" found")];if(G.length!==2)return[new H(te,G,"array length 2 expected, length "+G.length+" found")];if(b){if(ur(G[0])!=="object")return[new H(te,G,"object expected, "+ur(G[0])+" found")];if(G[0].zoom===void 0)return[new H(te,G,"object stop key must have zoom")];if(G[0].value===void 0)return[new H(te,G,"object stop key must have value")];if(a&&a>Ee(G[0].zoom))return[new H(te,G[0].zoom,"stop zoom values must appear in ascending order")];Ee(G[0].zoom)!==a&&(a=Ee(G[0].zoom),r=void 0,h={}),j=j.concat(vn({key:te+"[0]",value:G[0],valueSpec:{zoom:{}},style:z.style,styleSpec:z.styleSpec,objectElementValidators:{zoom:Cl,value:C}}))}else j=j.concat(C({key:te+"[0]",value:G[0],style:z.style,styleSpec:z.styleSpec},G));return wa(ye(G[1]))?j.concat([new H(te+"[1]",G[1],"expressions are not allowed in function stops.")]):j.concat(Dt({key:te+"[1]",value:G[1],valueSpec:l,style:z.style,styleSpec:z.styleSpec}))}function C(z,j){var G=ur(z.value),te=Ee(z.value),K=z.value!==null?z.value:j;if(t){if(G!==t)return[new H(z.key,K,G+" stop domain type must match previous stop domain type "+t)]}else t=G;if(G!=="number"&&G!=="string"&&G!=="boolean")return[new H(z.key,K,"stop domain value must be a number, string, or boolean")];if(G!=="number"&&c!=="categorical"){var oe="number expected, "+G+" found";return Eo(l)&&c===void 0&&(oe+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new H(z.key,K,oe)]}return c!=="categorical"||G!=="number"||isFinite(te)&&Math.floor(te)===te?c!=="categorical"&&G==="number"&&r!==void 0&&te<r?[new H(z.key,K,"stop domain values must appear in ascending order")]:(r=te,c==="categorical"&&te in h?[new H(z.key,K,"stop domain values must be unique")]:(h[te]=!0,[])):[new H(z.key,K,"integer expected, found "+te)]}}function Po(e){var t=(e.expressionContext==="property"?El:ns)(ye(e.value),e.valueSpec);if(t.result==="error")return t.value.map((function(a){return new H(""+e.key+a.key,e.value,a.message)}));var r=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext==="property"&&e.propertyKey==="text-font"&&!r.outputDefined())return[new H(e.key,e.value,'Invalid data expression for "'+e.propertyKey+'". Output values must be contained as literals within the expression.')];if(e.expressionContext==="property"&&e.propertyType==="layout"&&!$n(r))return[new H(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if(e.expressionContext==="filter"&&!$n(r))return[new H(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!go(r,["zoom","feature-state"]))return[new H(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(e.expressionContext==="cluster-initial"&&!Gn(r))return[new H(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ia(e){var t=e.key,r=e.value,a=e.valueSpec,l=[];return Array.isArray(a.values)?a.values.indexOf(Ee(r))===-1&&l.push(new H(t,r,"expected one of ["+a.values.join(", ")+"], "+JSON.stringify(r)+" found")):Object.keys(a.values).indexOf(Ee(r))===-1&&l.push(new H(t,r,"expected one of ["+Object.keys(a.values).join(", ")+"], "+JSON.stringify(r)+" found")),l}function os(e){if(e===!0||e===!1)return!0;if(!Array.isArray(e)||e.length===0)return!1;switch(e[0]){case"has":return e.length>=2&&e[1]!=="$id"&&e[1]!=="$type";case"in":return e.length>=3&&(typeof e[1]!="string"||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);t<r.length;t+=1){var a=r[t];if(!os(a)&&typeof a!="boolean")return!1}return!0;default:return!0}}Yo.deserialize=function(e){return new Yo(e._parameters,e._specification)},Yo.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}};var pu={type:"boolean",default:!1};function as(e){if(e==null)return{filter:function(){return!0},needGeometry:!1};os(e)||(e=ss(e));var t=ns(e,pu);if(t.result==="error")throw new Error(t.value.map((function(r){return r.key+": "+r.message})).join(", "));return{filter:function(r,a,l){return t.value.evaluate(r,a,{},l)},needGeometry:(function r(a){if(!Array.isArray(a))return!1;if(a[0]==="within")return!0;for(var l=1;l<a.length;l++)if(r(a[l]))return!0;return!1})(e)}}function Vc(e,t){return e<t?-1:e>t?1:0}function ss(e){if(!e)return!0;var t,r=e[0];return e.length<=1?r!=="any":r==="=="?hu(e[1],e[2],"=="):r==="!="?us(hu(e[1],e[2],"==")):r==="<"||r===">"||r==="<="||r===">="?hu(e[1],e[2],r):r==="any"?(t=e.slice(1),["any"].concat(t.map(ss))):r==="all"?["all"].concat(e.slice(1).map(ss)):r==="none"?["all"].concat(e.slice(1).map(ss).map(us)):r==="in"?Ml(e[1],e.slice(2)):r==="!in"?us(Ml(e[1],e.slice(2))):r==="has"?Bl(e[1]):r==="!has"?us(Bl(e[1])):r!=="within"||e}function hu(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function Ml(e,t){if(t.length===0)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(r){return typeof r!=typeof t[0]}))?["filter-in-large",e,["literal",t.sort(Vc)]]:["filter-in-small",e,["literal",t]]}}function Bl(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function us(e){return["!",e]}function fu(e){return os(ye(e.value))?Po(Ie({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):(function t(r){var a=r.value,l=r.key;if(ur(a)!=="array")return[new H(l,a,"array expected, "+ur(a)+" found")];var c,h=r.styleSpec,m=[];if(a.length<1)return[new H(l,a,"filter array must have at least 1 element")];switch(m=m.concat(Ia({key:l+"[0]",value:a[0],valueSpec:h.filter_operator,style:r.style,styleSpec:r.styleSpec})),Ee(a[0])){case"<":case"<=":case">":case">=":a.length>=2&&Ee(a[1])==="$type"&&m.push(new H(l,a,'"$type" cannot be use with operator "'+a[0]+'"'));case"==":case"!=":a.length!==3&&m.push(new H(l,a,'filter array for operator "'+a[0]+'" must have 3 elements'));case"in":case"!in":a.length>=2&&(c=ur(a[1]))!=="string"&&m.push(new H(l+"[1]",a[1],"string expected, "+c+" found"));for(var g=2;g<a.length;g++)c=ur(a[g]),Ee(a[1])==="$type"?m=m.concat(Ia({key:l+"["+g+"]",value:a[g],valueSpec:h.geometry_type,style:r.style,styleSpec:r.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&m.push(new H(l+"["+g+"]",a[g],"string, number, or boolean expected, "+c+" found"));break;case"any":case"all":case"none":for(var b=1;b<a.length;b++)m=m.concat(t({key:l+"["+b+"]",value:a[b],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":c=ur(a[1]),a.length!==2?m.push(new H(l,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="string"&&m.push(new H(l+"[1]",a[1],"string expected, "+c+" found"));break;case"within":c=ur(a[1]),a.length!==2?m.push(new H(l,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="object"&&m.push(new H(l+"[1]",a[1],"object expected, "+c+" found"))}return m})(e)}function du(e,t){var r=e.key,a=e.style,l=e.styleSpec,c=e.value,h=e.objectKey,m=l[t+"_"+e.layerType];if(!m)return[];var g=h.match(/^(.*)-transition$/);if(t==="paint"&&g&&m[g[1]]&&m[g[1]].transition)return Dt({key:r,value:c,valueSpec:l.transition,style:a,styleSpec:l});var b,S=e.valueSpec||m[h];if(!S)return[new H(r,c,'unknown property "'+h+'"')];if(ur(c)==="string"&&Eo(S)&&!S.tokens&&(b=/^{([^}]+)}$/.exec(c)))return[new H(r,c,'"'+h+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(b[1])+" }`.")];var I=[];return e.layerType==="symbol"&&(h==="text-field"&&a&&!a.glyphs&&I.push(new H(r,c,'use of "text-field" requires a style "glyphs" property')),h==="text-font"&&rs(ye(c))&&Ee(c.type)==="identity"&&I.push(new H(r,c,'"text-font" does not support identity functions'))),I.concat(Dt({key:e.key,value:c,valueSpec:S,style:a,styleSpec:l,expressionContext:"property",propertyType:t,propertyKey:h}))}function mu(e){return du(e,"paint")}function Ta(e){return du(e,"layout")}function zl(e){var t=[],r=e.value,a=e.key,l=e.style,c=e.styleSpec;r.type||r.ref||t.push(new H(a,r,'either "type" or "ref" is required'));var h,m=Ee(r.type),g=Ee(r.ref);if(r.id)for(var b=Ee(r.id),S=0;S<e.arrayIndex;S++){var I=l.layers[S];Ee(I.id)===b&&t.push(new H(a,r.id,'duplicate layer id "'+r.id+'", previously used at line '+I.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(j){j in r&&t.push(new H(a,r[j],'"'+j+'" is prohibited for ref layers'))})),l.layers.forEach((function(j){Ee(j.id)===g&&(h=j)})),h?h.ref?t.push(new H(a,r.ref,"ref cannot reference another ref layer")):m=Ee(h.type):t.push(new H(a,r.ref,'ref layer "'+g+'" not found'));else if(m!=="background")if(r.source){var C=l.sources&&l.sources[r.source],z=C&&Ee(C.type);C?z==="vector"&&m==="raster"?t.push(new H(a,r.source,'layer "'+r.id+'" requires a raster source')):z==="raster"&&m!=="raster"?t.push(new H(a,r.source,'layer "'+r.id+'" requires a vector source')):z!=="vector"||r["source-layer"]?z==="raster-dem"&&m!=="hillshade"?t.push(new H(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):m!=="line"||!r.paint||!r.paint["line-gradient"]||z==="geojson"&&C.lineMetrics||t.push(new H(a,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new H(a,r,'layer "'+r.id+'" must specify a "source-layer"')):t.push(new H(a,r.source,'source "'+r.source+'" not found'))}else t.push(new H(a,r,'missing required property "source"'));return t=t.concat(vn({key:a,value:r,valueSpec:c.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Dt({key:a+".type",value:r.type,valueSpec:c.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"})},filter:fu,layout:function(j){return vn({layer:r,key:j.key,value:j.value,style:j.style,styleSpec:j.styleSpec,objectElementValidators:{"*":function(G){return Ta(Ie({layerType:m},G))}}})},paint:function(j){return vn({layer:r,key:j.key,value:j.value,style:j.style,styleSpec:j.styleSpec,objectElementValidators:{"*":function(G){return mu(Ie({layerType:m},G))}}})}}}))}function Co(e){var t=e.value,r=e.key,a=ur(t);return a!=="string"?[new H(r,t,"string expected, "+a+" found")]:[]}var vr={promoteId:function(e){var t=e.key,r=e.value;if(ur(r)==="string")return Co({key:t,value:r});var a=[];for(var l in r)a.push.apply(a,Co({key:t+"."+l,value:r[l]}));return a}};function ls(e){var t=e.value,r=e.key,a=e.styleSpec,l=e.style;if(!t.type)return[new H(r,t,'"type" is required')];var c,h=Ee(t.type);switch(h){case"vector":case"raster":case"raster-dem":return vn({key:r,value:t,valueSpec:a["source_"+h.replace("-","_")],style:e.style,styleSpec:a,objectElementValidators:vr});case"geojson":if(c=vn({key:r,value:t,valueSpec:a.source_geojson,style:l,styleSpec:a,objectElementValidators:vr}),t.cluster)for(var m in t.clusterProperties){var g=t.clusterProperties[m],b=g[0],S=typeof b=="string"?[b,["accumulated"],["get",m]]:b;c.push.apply(c,Po({key:r+"."+m+".map",value:g[1],expressionContext:"cluster-map"})),c.push.apply(c,Po({key:r+"."+m+".reduce",value:S,expressionContext:"cluster-reduce"}))}return c;case"video":return vn({key:r,value:t,valueSpec:a.source_video,style:l,styleSpec:a});case"image":return vn({key:r,value:t,valueSpec:a.source_image,style:l,styleSpec:a});case"canvas":return[new H(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ia({key:r+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function ko(e){var t=e.value,r=e.styleSpec,a=r.light,l=e.style,c=[],h=ur(t);if(t===void 0)return c;if(h!=="object")return c.concat([new H("light",t,"object expected, "+h+" found")]);for(var m in t){var g=m.match(/^(.*)-transition$/);c=c.concat(g&&a[g[1]]&&a[g[1]].transition?Dt({key:m,value:t[m],valueSpec:r.transition,style:l,styleSpec:r}):a[m]?Dt({key:m,value:t[m],valueSpec:a[m],style:l,styleSpec:r}):[new H(m,t[m],'unknown property "'+m+'"')])}return c}var Qn={"*":function(){return[]},array:Pl,boolean:function(e){var t=e.value,r=e.key,a=ur(t);return a!=="boolean"?[new H(r,t,"boolean expected, "+a+" found")]:[]},number:Cl,color:function(e){var t=e.key,r=e.value,a=ur(r);return a!=="string"?[new H(t,r,"color expected, "+a+" found")]:zt(r)===null?[new H(t,r,'color expected, "'+r+'" found')]:[]},constants:se,enum:Ia,filter:fu,function:kl,layer:zl,object:vn,source:ls,light:ko,string:Co,formatted:function(e){return Co(e).length===0?[]:Po(e)},resolvedImage:function(e){return Co(e).length===0?[]:Po(e)}};function Dt(e){var t=e.value,r=e.valueSpec,a=e.styleSpec;return r.expression&&rs(Ee(t))?kl(e):r.expression&&wa(ye(t))?Po(e):r.type&&Qn[r.type]?Qn[r.type](e):vn(Ie({},e,{valueSpec:r.type?a[r.type]:r}))}function lr(e){var t=e.value,r=e.key,a=Co(e);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new H(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new H(r,t,'"glyphs" url must include a "{range}" token'))),a}function Yi(e,t){t===void 0&&(t=L);var r=[];return r=r.concat(Dt({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:lr,"*":function(){return[]}}})),e.constants&&(r=r.concat(se({key:"constants",value:e.constants}))),Aa(r)}function Aa(e){return[].concat(e).sort((function(t,r){return t.line-r.line}))}function Qo(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return Aa(e.apply(this,t))}}Yi.source=Qo(ls),Yi.light=Qo(ko),Yi.layer=Qo(zl),Yi.filter=Qo(fu),Yi.paintProperty=Qo(mu),Yi.layoutProperty=Qo(Ta);var Ea=Yi,qc=Ea.light,Uc=Ea.paintProperty,Pa=Ea.layoutProperty;function Ca(e,t){var r=!1;if(t&&t.length)for(var a=0,l=t;a<l.length;a+=1)e.fire(new re(new Error(l[a].message))),r=!0;return r}var Rn=Gr;function Gr(e,t,r){var a=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var l=new Int32Array(this.arrayBuffer);e=l[0],this.d=(t=l[1])+2*(r=l[2]);for(var c=0;c<this.d*this.d;c++){var h=l[3+c],m=l[3+c+1];a.push(h===m?null:l.subarray(h,m))}var g=l[3+a.length+1];this.keys=l.subarray(l[3+a.length],g),this.bboxes=l.subarray(g),this.insert=this._insertReadonly}else{this.d=t+2*r;for(var b=0;b<this.d*this.d;b++)a.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;var S=r/t*e;this.min=-S,this.max=e+S}Gr.prototype.insert=function(e,t,r,a,l){this._forEachCell(t,r,a,l,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(a),this.bboxes.push(l)},Gr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Gr.prototype._insertCell=function(e,t,r,a,l,c){this.cells[l].push(c)},Gr.prototype.query=function(e,t,r,a,l){var c=this.min,h=this.max;if(e<=c&&t<=c&&h<=r&&h<=a&&!l)return Array.prototype.slice.call(this.keys);var m=[];return this._forEachCell(e,t,r,a,this._queryCell,m,{},l),m},Gr.prototype._queryCell=function(e,t,r,a,l,c,h,m){var g=this.cells[l];if(g!==null)for(var b=this.keys,S=this.bboxes,I=0;I<g.length;I++){var C=g[I];if(h[C]===void 0){var z=4*C;(m?m(S[z+0],S[z+1],S[z+2],S[z+3]):e<=S[z+2]&&t<=S[z+3]&&r>=S[z+0]&&a>=S[z+1])?(h[C]=!0,c.push(b[C])):h[C]=!1}}},Gr.prototype._forEachCell=function(e,t,r,a,l,c,h,m){for(var g=this._convertToCellCoord(e),b=this._convertToCellCoord(t),S=this._convertToCellCoord(r),I=this._convertToCellCoord(a),C=g;C<=S;C++)for(var z=b;z<=I;z++){var j=this.d*z+C;if((!m||m(this._convertFromCellCoord(C),this._convertFromCellCoord(z),this._convertFromCellCoord(C+1),this._convertFromCellCoord(z+1)))&&l.call(this,e,t,r,a,j,c,h,m))return}},Gr.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},Gr.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},Gr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=3+this.cells.length+1+1,r=0,a=0;a<this.cells.length;a++)r+=this.cells[a].length;var l=new Int32Array(t+r+this.keys.length+this.bboxes.length);l[0]=this.extent,l[1]=this.n,l[2]=this.padding;for(var c=t,h=0;h<e.length;h++){var m=e[h];l[3+h]=c,l.set(m,c),c+=m.length}return l[3+e.length]=c,l.set(this.keys,c),l[3+e.length+1]=c+=this.keys.length,l.set(this.bboxes,c),c+=this.bboxes.length,l.buffer};var ka=J.ImageData,Dl=J.ImageBitmap,qr={};function Xe(e,t,r){r===void 0&&(r={}),Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),qr[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}for(var Ni in Xe("Object",Object),Rn.serialize=function(e,t){var r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}},Rn.deserialize=function(e){return new Rn(e.buffer)},Xe("Grid",Rn),Xe("Color",$t),Xe("Error",Error),Xe("ResolvedImage",Di),Xe("StylePropertyFunction",Yo),Xe("StyleExpression",Ko,{omit:["_evaluator"]}),Xe("ZoomDependentExpression",Jo),Xe("ZoomConstantExpression",Sa),Xe("CompoundExpression",di,{omit:["_evaluate"]}),Io)Io[Ni]._classRegistryKey||Xe("Expression_"+Ni,Io[Ni]);function cs(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}function ea(e){return Dl&&e instanceof Dl}function gn(e,t){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(cs(e)||ea(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var r=e;return t&&t.push(r.buffer),r}if(e instanceof ka)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){for(var a=[],l=0,c=e;l<c.length;l+=1)a.push(gn(c[l],t));return a}if(typeof e=="object"){var h=e.constructor,m=h._classRegistryKey;if(!m)throw new Error("can't serialize object of unregistered class");var g=h.serialize?h.serialize(e,t):{};if(!h.serialize){for(var b in e)if(e.hasOwnProperty(b)&&!(qr[m].omit.indexOf(b)>=0)){var S=e[b];g[b]=qr[m].shallow.indexOf(b)>=0?S:gn(S,t)}e instanceof Error&&(g.message=e.message)}if(g.$name)throw new Error("$name property is reserved for worker serialization logic.");return m!=="Object"&&(g.$name=m),g}throw new Error("can't serialize object of type "+typeof e)}function ji(e){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||cs(e)||ea(e)||ArrayBuffer.isView(e)||e instanceof ka)return e;if(Array.isArray(e))return e.map(ji);if(typeof e=="object"){var t=e.$name||"Object",r=qr[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var a=Object.create(r.prototype),l=0,c=Object.keys(e);l<c.length;l+=1){var h=c[l];if(h!=="$name"){var m=e[h];a[h]=qr[t].shallow.indexOf(h)>=0?m:ji(m)}}return a}throw new Error("can't deserialize object of type "+typeof e)}var yu=function(){this.first=!0};yu.prototype.update=function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))};var Re={"Latin-1 Supplement":function(e){return e>=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function vu(e){for(var t=0,r=e;t<r.length;t+=1)if(ps(r[t].charCodeAt(0)))return!0;return!1}function ps(e){return!(e!==746&&e!==747&&(e<4352||!(Re["Bopomofo Extended"](e)||Re.Bopomofo(e)||Re["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||Re["CJK Compatibility Ideographs"](e)||Re["CJK Compatibility"](e)||Re["CJK Radicals Supplement"](e)||Re["CJK Strokes"](e)||!(!Re["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||e===12336)||Re["CJK Unified Ideographs Extension A"](e)||Re["CJK Unified Ideographs"](e)||Re["Enclosed CJK Letters and Months"](e)||Re["Hangul Compatibility Jamo"](e)||Re["Hangul Jamo Extended-A"](e)||Re["Hangul Jamo Extended-B"](e)||Re["Hangul Jamo"](e)||Re["Hangul Syllables"](e)||Re.Hiragana(e)||Re["Ideographic Description Characters"](e)||Re.Kanbun(e)||Re["Kangxi Radicals"](e)||Re["Katakana Phonetic Extensions"](e)||Re.Katakana(e)&&e!==12540||!(!Re["Halfwidth and Fullwidth Forms"](e)||e===65288||e===65289||e===65293||e>=65306&&e<=65310||e===65339||e===65341||e===65343||e>=65371&&e<=65503||e===65507||e>=65512&&e<=65519)||!(!Re["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||Re["Unified Canadian Aboriginal Syllabics"](e)||Re["Unified Canadian Aboriginal Syllabics Extended"](e)||Re["Vertical Forms"](e)||Re["Yijing Hexagram Symbols"](e)||Re["Yi Syllables"](e)||Re["Yi Radicals"](e))))}function gu(e){return!(ps(e)||(function(t){return!!(Re["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||Re["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||Re["Letterlike Symbols"](t)||Re["Number Forms"](t)||Re["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||Re["Control Pictures"](t)&&t!==9251||Re["Optical Character Recognition"](t)||Re["Enclosed Alphanumerics"](t)||Re["Geometric Shapes"](t)||Re["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Re["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Re["CJK Symbols and Punctuation"](t)||Re.Katakana(t)||Re["Private Use Area"](t)||Re["CJK Compatibility Forms"](t)||Re["Small Form Variants"](t)||Re["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)})(e))}function sn(e){return e>=1424&&e<=2303||Re["Arabic Presentation Forms-A"](e)||Re["Arabic Presentation Forms-B"](e)}function Gi(e,t){return!(!t&&sn(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Re.Khmer(e))}function hs(e){for(var t=0,r=e;t<r.length;t+=1)if(sn(r[t].charCodeAt(0)))return!0;return!1}var fs=null,$i="unavailable",Ln=null,Rl=function(e){e&&typeof e=="string"&&e.indexOf("NetworkError")>-1&&($i="error"),fs&&fs(e)};function Ma(){_u.fire(new $("pluginStateChange",{pluginStatus:$i,pluginURL:Ln}))}var _u=new ie,xu=function(){return $i},_n=function(){if($i!=="deferred"||!Ln)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");$i="loading",Ma(),Ln&&ii({url:Ln},(function(e){e?Rl(e):($i="loaded",Ma())}))},Qi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return $i==="loaded"||Qi.applyArabicShaping!=null},isLoading:function(){return $i==="loading"},setState:function(e){$i=e.pluginStatus,Ln=e.pluginURL},isParsed:function(){return Qi.applyArabicShaping!=null&&Qi.processBidirectionalText!=null&&Qi.processStyledBidirectionalText!=null},getPluginURL:function(){return Ln}},kt=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new yu,this.transition={})};kt.prototype.isSupportedScript=function(e){return(function(t,r){for(var a=0,l=t;a<l.length;a+=1)if(!Gi(l[a].charCodeAt(0),r))return!1;return!0})(e,Qi.isLoaded())},kt.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},kt.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}};var Tn=function(e,t){this.property=e,this.value=t,this.expression=(function(r,a){if(rs(r))return new Yo(r,a);if(wa(r)){var l=El(r,a);if(l.result==="error")throw new Error(l.value.map((function(h){return h.key+": "+h.message})).join(", "));return l.value}var c=r;return typeof r=="string"&&a.type==="color"&&(c=$t.parse(r)),{kind:"constant",evaluate:function(){return c}}})(t===void 0?e.specification.default:t,e.specification)};Tn.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},Tn.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var un=function(e){this.property=e,this.value=new Tn(e,void 0)};un.prototype.transitioned=function(e,t){return new Mo(this.property,this.value,t,Ue({},e.transition,this.transition),e.now)},un.prototype.untransitioned=function(){return new Mo(this.property,this.value,null,{},0)};var yi=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};yi.prototype.getValue=function(e){return Mt(this._values[e].value.value)},yi.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new un(this._values[e].property)),this._values[e].value=new Tn(this._values[e].property,t===null?void 0:Mt(t))},yi.prototype.getTransition=function(e){return Mt(this._values[e].transition)},yi.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new un(this._values[e].property)),this._values[e].transition=Mt(t)||void 0},yi.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],l=this.getValue(a);l!==void 0&&(e[a]=l);var c=this.getTransition(a);c!==void 0&&(e[a+"-transition"]=c)}return e},yi.prototype.transitioned=function(e,t){for(var r=new eo(this._properties),a=0,l=Object.keys(this._values);a<l.length;a+=1){var c=l[a];r._values[c]=this._values[c].transitioned(e,t._values[c])}return r},yi.prototype.untransitioned=function(){for(var e=new eo(this._properties),t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t];e._values[a]=this._values[a].untransitioned()}return e};var Mo=function(e,t,r,a,l){this.property=e,this.value=t,this.begin=l+a.delay||0,this.end=this.begin+a.duration||0,e.specification.transition&&(a.delay||a.duration)&&(this.prior=r)};Mo.prototype.possiblyEvaluate=function(e,t,r){var a=e.now||0,l=this.value.possiblyEvaluate(e,t,r),c=this.prior;if(c){if(a>this.end)return this.prior=null,l;if(this.value.isDataDriven())return this.prior=null,l;if(a<this.begin)return c.possiblyEvaluate(e,t,r);var h=(a-this.begin)/(this.end-this.begin);return this.property.interpolate(c.possiblyEvaluate(e,t,r),l,(function(m){if(m<=0)return 0;if(m>=1)return 1;var g=m*m,b=g*m;return 4*(m<.5?b:3*(m-g)+b-.75)})(h))}return l};var eo=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};eo.prototype.possiblyEvaluate=function(e,t,r){for(var a=new Ba(this._properties),l=0,c=Object.keys(this._values);l<c.length;l+=1){var h=c[l];a._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return a},eo.prototype.hasTransition=function(){for(var e=0,t=Object.keys(this._values);e<t.length;e+=1)if(this._values[t[e]].prior)return!0;return!1};var xn=function(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)};xn.prototype.getValue=function(e){return Mt(this._values[e].value)},xn.prototype.setValue=function(e,t){this._values[e]=new Tn(this._values[e].property,t===null?void 0:Mt(t))},xn.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],l=this.getValue(a);l!==void 0&&(e[a]=l)}return e},xn.prototype.possiblyEvaluate=function(e,t,r){for(var a=new Ba(this._properties),l=0,c=Object.keys(this._values);l<c.length;l+=1){var h=c[l];a._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return a};var Ti=function(e,t,r){this.property=e,this.value=t,this.parameters=r};Ti.prototype.isConstant=function(){return this.value.kind==="constant"},Ti.prototype.constantOr=function(e){return this.value.kind==="constant"?this.value.value:e},Ti.prototype.evaluate=function(e,t,r,a){return this.property.evaluate(this.value,this.parameters,e,t,r,a)};var Ba=function(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)};Ba.prototype.get=function(e){return this._values[e]};var it=function(e){this.specification=e};it.prototype.possiblyEvaluate=function(e,t){return e.expression.evaluate(t)},it.prototype.interpolate=function(e,t,r){var a=Ho[this.specification.type];return a?a(e,t,r):e};var Ye=function(e,t){this.specification=e,this.overrides=t};Ye.prototype.possiblyEvaluate=function(e,t,r,a){return new Ti(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(t,null,{},r,a)}:e.expression,t)},Ye.prototype.interpolate=function(e,t,r){if(e.value.kind!=="constant"||t.value.kind!=="constant")return e;if(e.value.value===void 0||t.value.value===void 0)return new Ti(this,{kind:"constant",value:void 0},e.parameters);var a=Ho[this.specification.type];return a?new Ti(this,{kind:"constant",value:a(e.value.value,t.value.value,r)},e.parameters):e},Ye.prototype.evaluate=function(e,t,r,a,l,c){return e.kind==="constant"?e.value:e.evaluate(t,r,a,l,c)};var ds=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a,l,c){if(r.value===void 0)return new Ti(this,{kind:"constant",value:void 0},a);if(r.expression.kind==="constant"){var h=r.expression.evaluate(a,null,{},l,c),m=r.property.specification.type==="resolvedImage"&&typeof h!="string"?h.name:h,g=this._calculate(m,m,m,a);return new Ti(this,{kind:"constant",value:g},a)}if(r.expression.kind==="camera"){var b=this._calculate(r.expression.evaluate({zoom:a.zoom-1}),r.expression.evaluate({zoom:a.zoom}),r.expression.evaluate({zoom:a.zoom+1}),a);return new Ti(this,{kind:"constant",value:b},a)}return new Ti(this,r.expression,a)},t.prototype.evaluate=function(r,a,l,c,h,m){if(r.kind==="source"){var g=r.evaluate(a,l,c,h,m);return this._calculate(g,g,g,a)}return r.kind==="composite"?this._calculate(r.evaluate({zoom:Math.floor(a.zoom)-1},l,c),r.evaluate({zoom:Math.floor(a.zoom)},l,c),r.evaluate({zoom:Math.floor(a.zoom)+1},l,c),a):r.value},t.prototype._calculate=function(r,a,l,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:r,to:a}:{from:l,to:a}},t.prototype.interpolate=function(r){return r},t})(Ye),Ai=function(e){this.specification=e};Ai.prototype.possiblyEvaluate=function(e,t,r,a){if(e.value!==void 0){if(e.expression.kind==="constant"){var l=e.expression.evaluate(t,null,{},r,a);return this._calculate(l,l,l,t)}return this._calculate(e.expression.evaluate(new kt(Math.floor(t.zoom-1),t)),e.expression.evaluate(new kt(Math.floor(t.zoom),t)),e.expression.evaluate(new kt(Math.floor(t.zoom+1),t)),t)}},Ai.prototype._calculate=function(e,t,r,a){return a.zoom>a.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},Ai.prototype.interpolate=function(e){return e};var bn=function(e){this.specification=e};bn.prototype.possiblyEvaluate=function(e,t,r,a){return!!e.expression.evaluate(t,null,{},r,a)},bn.prototype.interpolate=function(){return!1};var vi=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var a=this.defaultPropertyValues[t]=new Tn(r,void 0),l=this.defaultTransitionablePropertyValues[t]=new un(r);this.defaultTransitioningPropertyValues[t]=l.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=a.possiblyEvaluate({})}};Xe("DataDrivenProperty",Ye),Xe("DataConstantProperty",it),Xe("CrossFadedDataDrivenProperty",ds),Xe("CrossFadedProperty",Ai),Xe("ColorRampProperty",bn);var An=(function(e){function t(r,a){if(e.call(this),this.id=r.id,this.type=r.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},r.type!=="custom"&&(this.metadata=(r=r).metadata,this.minzoom=r.minzoom,this.maxzoom=r.maxzoom,r.type!=="background"&&(this.source=r.source,this.sourceLayer=r["source-layer"],this.filter=r.filter),a.layout&&(this._unevaluatedLayout=new xn(a.layout)),a.paint)){for(var l in this._transitionablePaint=new yi(a.paint),r.paint)this.setPaintProperty(l,r.paint[l],{validate:!1});for(var c in r.layout)this.setLayoutProperty(c,r.layout[c],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ba(a.paint)}}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(r){return r==="visibility"?this.visibility:this._unevaluatedLayout.getValue(r)},t.prototype.setLayoutProperty=function(r,a,l){l===void 0&&(l={}),a!=null&&this._validate(Pa,"layers."+this.id+".layout."+r,r,a,l)||(r!=="visibility"?this._unevaluatedLayout.setValue(r,a):this.visibility=a)},t.prototype.getPaintProperty=function(r){return je(r,"-transition")?this._transitionablePaint.getTransition(r.slice(0,-11)):this._transitionablePaint.getValue(r)},t.prototype.setPaintProperty=function(r,a,l){if(l===void 0&&(l={}),a!=null&&this._validate(Uc,"layers."+this.id+".paint."+r,r,a,l))return!1;if(je(r,"-transition"))return this._transitionablePaint.setTransition(r.slice(0,-11),a||void 0),!1;var c=this._transitionablePaint._values[r],h=c.property.specification["property-type"]==="cross-faded-data-driven",m=c.value.isDataDriven(),g=c.value;this._transitionablePaint.setValue(r,a),this._handleSpecialPaintPropertyUpdate(r);var b=this._transitionablePaint._values[r].value;return b.isDataDriven()||m||h||this._handleOverridablePaintPropertyUpdate(r,g,b)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,l){return!1},t.prototype.isHidden=function(r){return!!(this.minzoom&&r<this.minzoom)||!!(this.maxzoom&&r>=this.maxzoom)||this.visibility==="none"},t.prototype.updateTransitions=function(r){this._transitioningPaint=this._transitionablePaint.transitioned(r,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(r,a){r.getCrossfadeParameters&&(this._crossfadeParameters=r.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(r,void 0,a)),this.paint=this._transitioningPaint.possiblyEvaluate(r,void 0,a)},t.prototype.serialize=function(){var r={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&&(r.layout=r.layout||{},r.layout.visibility=this.visibility),tt(r,(function(a,l){return!(a===void 0||l==="layout"&&!Object.keys(a).length||l==="paint"&&!Object.keys(a).length)}))},t.prototype._validate=function(r,a,l,c,h){return h===void 0&&(h={}),(!h||h.validate!==!1)&&Ca(this,r.call(Ea,{key:a,layerType:this.type,objectKey:l,value:c,styleSpec:L,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var r in this.paint._values){var a=this.paint.get(r);if(a instanceof Ti&&Eo(a.property.specification)&&(a.value.kind==="source"||a.value.kind==="composite")&&a.value.isStateDependent)return!0}return!1},t})(ie),bu={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},ms=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Xt=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function ai(e,t){t===void 0&&(t=1);var r=0,a=0;return{members:e.map((function(l){var c=bu[l.type].BYTES_PER_ELEMENT,h=r=Ll(r,Math.max(t,c)),m=l.components||1;return a=Math.max(a,c),r+=c*m,{name:l.name,type:l.type,components:m,offset:h}})),size:Ll(r,Math.max(a,t)),alignment:t}}function Ll(e,t){return Math.ceil(e/t)*t}Xt.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},Xt.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},Xt.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Xt.prototype.clear=function(){this.length=0},Xt.prototype.resize=function(e){this.reserve(e),this.length=e},Xt.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},Xt.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Bo=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.int16[c+0]=a,this.int16[c+1]=l,r},t})(Xt);Bo.prototype.bytesPerElement=4,Xe("StructArrayLayout2i4",Bo);var wu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=4*r;return this.int16[m+0]=a,this.int16[m+1]=l,this.int16[m+2]=c,this.int16[m+3]=h,r},t})(Xt);wu.prototype.bytesPerElement=8,Xe("StructArrayLayout4i8",wu);var Fn=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var b=6*r;return this.int16[b+0]=a,this.int16[b+1]=l,this.int16[b+2]=c,this.int16[b+3]=h,this.int16[b+4]=m,this.int16[b+5]=g,r},t})(Xt);Fn.prototype.bytesPerElement=12,Xe("StructArrayLayout2i4i12",Fn);var Zi=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var b=4*r,S=8*r;return this.int16[b+0]=a,this.int16[b+1]=l,this.uint8[S+4]=c,this.uint8[S+5]=h,this.uint8[S+6]=m,this.uint8[S+7]=g,r},t})(Xt);Zi.prototype.bytesPerElement=8,Xe("StructArrayLayout2i4ub8",Zi);var ta=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.float32[c+0]=a,this.float32[c+1]=l,r},t})(Xt);ta.prototype.bytesPerElement=8,Xe("StructArrayLayout2f8",ta);var En=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,b,S,I){var C=this.length;return this.resize(C+1),this.emplace(C,r,a,l,c,h,m,g,b,S,I)},t.prototype.emplace=function(r,a,l,c,h,m,g,b,S,I,C){var z=10*r;return this.uint16[z+0]=a,this.uint16[z+1]=l,this.uint16[z+2]=c,this.uint16[z+3]=h,this.uint16[z+4]=m,this.uint16[z+5]=g,this.uint16[z+6]=b,this.uint16[z+7]=S,this.uint16[z+8]=I,this.uint16[z+9]=C,r},t})(Xt);En.prototype.bytesPerElement=20,Xe("StructArrayLayout10ui20",En);var ys=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,b,S,I,C,z){var j=this.length;return this.resize(j+1),this.emplace(j,r,a,l,c,h,m,g,b,S,I,C,z)},t.prototype.emplace=function(r,a,l,c,h,m,g,b,S,I,C,z,j){var G=12*r;return this.int16[G+0]=a,this.int16[G+1]=l,this.int16[G+2]=c,this.int16[G+3]=h,this.uint16[G+4]=m,this.uint16[G+5]=g,this.uint16[G+6]=b,this.uint16[G+7]=S,this.int16[G+8]=I,this.int16[G+9]=C,this.int16[G+10]=z,this.int16[G+11]=j,r},t})(Xt);ys.prototype.bytesPerElement=24,Xe("StructArrayLayout4i4ui4i24",ys);var ra=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.float32[h+0]=a,this.float32[h+1]=l,this.float32[h+2]=c,r},t})(Xt);ra.prototype.bytesPerElement=12,Xe("StructArrayLayout3f12",ra);var za=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint32[1*r+0]=a,r},t})(Xt);za.prototype.bytesPerElement=4,Xe("StructArrayLayout1ul4",za);var Su=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.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)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,b,S){var I=this.length;return this.resize(I+1),this.emplace(I,r,a,l,c,h,m,g,b,S)},t.prototype.emplace=function(r,a,l,c,h,m,g,b,S,I){var C=10*r,z=5*r;return this.int16[C+0]=a,this.int16[C+1]=l,this.int16[C+2]=c,this.int16[C+3]=h,this.int16[C+4]=m,this.int16[C+5]=g,this.uint32[z+3]=b,this.uint16[C+8]=S,this.uint16[C+9]=I,r},t})(Xt);Su.prototype.bytesPerElement=20,Xe("StructArrayLayout6i1ul2ui20",Su);var ia=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var b=6*r;return this.int16[b+0]=a,this.int16[b+1]=l,this.int16[b+2]=c,this.int16[b+3]=h,this.int16[b+4]=m,this.int16[b+5]=g,r},t})(Xt);ia.prototype.bytesPerElement=12,Xe("StructArrayLayout2i2i2i12",ia);var zo=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h){var m=this.length;return this.resize(m+1),this.emplace(m,r,a,l,c,h)},t.prototype.emplace=function(r,a,l,c,h,m){var g=4*r,b=8*r;return this.float32[g+0]=a,this.float32[g+1]=l,this.float32[g+2]=c,this.int16[b+6]=h,this.int16[b+7]=m,r},t})(Xt);zo.prototype.bytesPerElement=16,Xe("StructArrayLayout2f1f2i16",zo);var Iu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=12*r,g=3*r;return this.uint8[m+0]=a,this.uint8[m+1]=l,this.float32[g+1]=c,this.float32[g+2]=h,r},t})(Xt);Iu.prototype.bytesPerElement=12,Xe("StructArrayLayout2ub2f12",Iu);var to=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.uint16[h+0]=a,this.uint16[h+1]=l,this.uint16[h+2]=c,r},t})(Xt);to.prototype.bytesPerElement=6,Xe("StructArrayLayout3ui6",to);var ro=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.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)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,b,S,I,C,z,j,G,te,K,oe){var le=this.length;return this.resize(le+1),this.emplace(le,r,a,l,c,h,m,g,b,S,I,C,z,j,G,te,K,oe)},t.prototype.emplace=function(r,a,l,c,h,m,g,b,S,I,C,z,j,G,te,K,oe,le){var ce=24*r,he=12*r,xe=48*r;return this.int16[ce+0]=a,this.int16[ce+1]=l,this.uint16[ce+2]=c,this.uint16[ce+3]=h,this.uint32[he+2]=m,this.uint32[he+3]=g,this.uint32[he+4]=b,this.uint16[ce+10]=S,this.uint16[ce+11]=I,this.uint16[ce+12]=C,this.float32[he+7]=z,this.float32[he+8]=j,this.uint8[xe+36]=G,this.uint8[xe+37]=te,this.uint8[xe+38]=K,this.uint32[he+10]=oe,this.int16[ce+22]=le,r},t})(Xt);ro.prototype.bytesPerElement=48,Xe("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ro);var vs=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.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)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,b,S,I,C,z,j,G,te,K,oe,le,ce,he,xe,Pe,ze,rt,Oe,ot,qe,bt){var pt=this.length;return this.resize(pt+1),this.emplace(pt,r,a,l,c,h,m,g,b,S,I,C,z,j,G,te,K,oe,le,ce,he,xe,Pe,ze,rt,Oe,ot,qe,bt)},t.prototype.emplace=function(r,a,l,c,h,m,g,b,S,I,C,z,j,G,te,K,oe,le,ce,he,xe,Pe,ze,rt,Oe,ot,qe,bt,pt){var Qe=34*r,Tt=17*r;return this.int16[Qe+0]=a,this.int16[Qe+1]=l,this.int16[Qe+2]=c,this.int16[Qe+3]=h,this.int16[Qe+4]=m,this.int16[Qe+5]=g,this.int16[Qe+6]=b,this.int16[Qe+7]=S,this.uint16[Qe+8]=I,this.uint16[Qe+9]=C,this.uint16[Qe+10]=z,this.uint16[Qe+11]=j,this.uint16[Qe+12]=G,this.uint16[Qe+13]=te,this.uint16[Qe+14]=K,this.uint16[Qe+15]=oe,this.uint16[Qe+16]=le,this.uint16[Qe+17]=ce,this.uint16[Qe+18]=he,this.uint16[Qe+19]=xe,this.uint16[Qe+20]=Pe,this.uint16[Qe+21]=ze,this.uint16[Qe+22]=rt,this.uint32[Tt+12]=Oe,this.float32[Tt+13]=ot,this.float32[Tt+14]=qe,this.float32[Tt+15]=bt,this.float32[Tt+16]=pt,r},t})(Xt);vs.prototype.bytesPerElement=68,Xe("StructArrayLayout8i15ui1ul4f68",vs);var io=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.float32[1*r+0]=a,r},t})(Xt);io.prototype.bytesPerElement=4,Xe("StructArrayLayout1f4",io);var ln=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.int16[h+0]=a,this.int16[h+1]=l,this.int16[h+2]=c,r},t})(Xt);ln.prototype.bytesPerElement=6,Xe("StructArrayLayout3i6",ln);var Tu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=4*r;return this.uint32[2*r+0]=a,this.uint16[h+2]=l,this.uint16[h+3]=c,r},t})(Xt);Tu.prototype.bytesPerElement=8,Xe("StructArrayLayout1ul2ui8",Tu);var Da=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.uint16[c+0]=a,this.uint16[c+1]=l,r},t})(Xt);Da.prototype.bytesPerElement=4,Xe("StructArrayLayout2ui4",Da);var Au=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint16[1*r+0]=a,r},t})(Xt);Au.prototype.bytesPerElement=2,Xe("StructArrayLayout1ui2",Au);var gs=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=4*r;return this.float32[m+0]=a,this.float32[m+1]=l,this.float32[m+2]=c,this.float32[m+3]=h,r},t})(Xt);gs.prototype.bytesPerElement=16,Xe("StructArrayLayout4f16",gs);var i=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={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 r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new X(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t})(ms);i.prototype.size=20;var o=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new i(this,r)},t})(Su);Xe("CollisionBoxArray",o);var n=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={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 r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(a){this._structArray.uint8[this._pos1+37]=a},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(a){this._structArray.uint8[this._pos1+38]=a},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+10]=a},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t})(ms);n.prototype.size=48;var s=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new n(this,r)},t})(ro);Xe("PlacedSymbolArray",s);var p=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={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 r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+12]=a},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t})(ms);p.prototype.size=68;var f=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new p(this,r)},t})(vs);Xe("SymbolInstanceArray",f);var d=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getoffsetX=function(r){return this.float32[1*r+0]},t})(io);Xe("GlyphOffsetArray",d);var v=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getx=function(r){return this.int16[3*r+0]},t.prototype.gety=function(r){return this.int16[3*r+1]},t.prototype.gettileUnitDistanceFromAnchor=function(r){return this.int16[3*r+2]},t})(ln);Xe("SymbolLineVertexArray",v);var w=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,r),t})(ms);w.prototype.size=8;var A=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new w(this,r)},t})(Tu);Xe("FeatureIndexArray",A);var R=ai([{name:"a_pos",components:2,type:"Int16"}],4).members,F=function(e){e===void 0&&(e=[]),this.segments=e};function O(e,t){return 256*(e=Ze(Math.floor(e),0,255))+Ze(Math.floor(t),0,255)}F.prototype.prepareSegment=function(e,t,r,a){var l=this.segments[this.segments.length-1];return e>F.MAX_VERTEX_ARRAY_LENGTH&&St("Max vertices per segment is "+F.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!l||l.vertexLength+e>F.MAX_VERTEX_ARRAY_LENGTH||l.sortKey!==a)&&(l={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},a!==void 0&&(l.sortKey=a),this.segments.push(l)),l},F.prototype.get=function(){return this.segments},F.prototype.destroy=function(){for(var e=0,t=this.segments;e<t.length;e+=1){var r=t[e];for(var a in r.vaos)r.vaos[a].destroy()}},F.simpleSegment=function(e,t,r,a){return new F([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:a,vaos:{},sortKey:0}])},F.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Xe("SegmentVector",F);var W=ai([{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"}]),Z=U((function(e){e.exports=function(t,r){var a,l,c,h,m,g,b,S;for(l=t.length-(a=3&t.length),c=r,m=3432918353,g=461845907,S=0;S<l;)b=255&t.charCodeAt(S)|(255&t.charCodeAt(++S))<<8|(255&t.charCodeAt(++S))<<16|(255&t.charCodeAt(++S))<<24,++S,c=27492+(65535&(h=5*(65535&(c=(c^=b=(65535&(b=(b=(65535&b)*m+(((b>>>16)*m&65535)<<16)&4294967295)<<15|b>>>17))*g+(((b>>>16)*g&65535)<<16)&4294967295)<<13|c>>>19))+((5*(c>>>16)&65535)<<16)&4294967295))+((58964+(h>>>16)&65535)<<16);switch(b=0,a){case 3:b^=(255&t.charCodeAt(S+2))<<16;case 2:b^=(255&t.charCodeAt(S+1))<<8;case 1:c^=b=(65535&(b=(b=(65535&(b^=255&t.charCodeAt(S)))*m+(((b>>>16)*m&65535)<<16)&4294967295)<<15|b>>>17))*g+(((b>>>16)*g&65535)<<16)&4294967295}return c^=t.length,c=2246822507*(65535&(c^=c>>>16))+((2246822507*(c>>>16)&65535)<<16)&4294967295,c=3266489909*(65535&(c^=c>>>13))+((3266489909*(c>>>16)&65535)<<16)&4294967295,(c^=c>>>16)>>>0}})),ee=U((function(e){e.exports=function(t,r){for(var a,l=t.length,c=r^l,h=0;l>=4;)a=1540483477*(65535&(a=255&t.charCodeAt(h)|(255&t.charCodeAt(++h))<<8|(255&t.charCodeAt(++h))<<16|(255&t.charCodeAt(++h))<<24))+((1540483477*(a>>>16)&65535)<<16),c=1540483477*(65535&c)+((1540483477*(c>>>16)&65535)<<16)^(a=1540483477*(65535&(a^=a>>>24))+((1540483477*(a>>>16)&65535)<<16)),l-=4,++h;switch(l){case 3:c^=(255&t.charCodeAt(h+2))<<16;case 2:c^=(255&t.charCodeAt(h+1))<<8;case 1:c=1540483477*(65535&(c^=255&t.charCodeAt(h)))+((1540483477*(c>>>16)&65535)<<16)}return c=1540483477*(65535&(c^=c>>>13))+((1540483477*(c>>>16)&65535)<<16),(c^=c>>>15)>>>0}})),N=Z,Q=ee;N.murmur3=Z,N.murmur2=Q;var ne=function(){this.ids=[],this.positions=[],this.indexed=!1};ne.prototype.add=function(e,t,r,a){this.ids.push(me(e)),this.positions.push(t,r,a)},ne.prototype.getPositions=function(e){for(var t=me(e),r=0,a=this.ids.length-1;r<a;){var l=r+a>>1;this.ids[l]>=t?a=l:r=l+1}for(var c=[];this.ids[r]===t;)c.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return c},ne.serialize=function(e,t){var r=new Float64Array(e.ids),a=new Uint32Array(e.positions);return(function l(c,h,m,g){for(;m<g;){for(var b=c[m+g>>1],S=m-1,I=g+1;;){do S++;while(c[S]<b);do I--;while(c[I]>b);if(S>=I)break;pe(c,S,I),pe(h,3*S,3*I),pe(h,3*S+1,3*I+1),pe(h,3*S+2,3*I+2)}I-m<g-I?(l(c,h,m,I),m=I+1):(l(c,h,I+1,g),g=I)}})(r,a,0,r.length-1),t&&t.push(r.buffer,a.buffer),{ids:r,positions:a}},ne.deserialize=function(e){var t=new ne;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var ue=Math.pow(2,53)-1;function me(e){var t=+e;return!isNaN(t)&&t<=ue?t:N(String(e))}function pe(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}Xe("FeaturePositionMap",ne);var ve=function(e,t){this.gl=e.gl,this.location=t},Te=(function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))},t})(ve),ke=(function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r))},t})(ve),Ce=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1]))},t})(ve),$e=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2]))},t})(ve),nt=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3]))},t})(ve),ut=(function(e){function t(r,a){e.call(this,r,a),this.current=$t.transparent}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a))},t})(ve),st=new Float32Array(16),Ft=(function(e){function t(r,a){e.call(this,r,a),this.current=st}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(var a=1;a<16;a++)if(r[a]!==this.current[a]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}},t})(ve);function We(e){return[O(255*e.r,255*e.g),O(255*e.b,255*e.a)]}var mt=function(e,t,r){this.value=e,this.uniformNames=t.map((function(a){return"u_"+a})),this.type=r};mt.prototype.setUniform=function(e,t,r){e.set(r.constantOr(this.value))},mt.prototype.getBinding=function(e,t,r){return this.type==="color"?new ut(e,t):new ke(e,t)};var xt=function(e,t){this.uniformNames=t.map((function(r){return"u_"+r})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};xt.prototype.setConstantPatternPositions=function(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr},xt.prototype.setUniform=function(e,t,r,a){var l=a==="u_pattern_to"?this.patternTo:a==="u_pattern_from"?this.patternFrom:a==="u_pixel_ratio_to"?this.pixelRatioTo:a==="u_pixel_ratio_from"?this.pixelRatioFrom:null;l&&e.set(l)},xt.prototype.getBinding=function(e,t,r){return r.substr(0,9)==="u_pattern"?new nt(e,t):new ke(e,t)};var dt=function(e,t,r,a){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((function(l){return{name:"a_"+l,type:"Float32",components:r==="color"?2:1,offset:0}})),this.paintVertexArray=new a};dt.prototype.populatePaintArray=function(e,t,r,a,l){var c=this.paintVertexArray.length,h=this.expression.evaluate(new kt(0),t,{},a,[],l);this.paintVertexArray.resize(e),this._setPaintValue(c,e,h)},dt.prototype.updatePaintArray=function(e,t,r,a){var l=this.expression.evaluate({zoom:0},r,a);this._setPaintValue(e,t,l)},dt.prototype._setPaintValue=function(e,t,r){if(this.type==="color")for(var a=We(r),l=e;l<t;l++)this.paintVertexArray.emplace(l,a[0],a[1]);else{for(var c=e;c<t;c++)this.paintVertexArray.emplace(c,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},dt.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},dt.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var ft=function(e,t,r,a,l,c){this.expression=e,this.uniformNames=t.map((function(h){return"u_"+h+"_t"})),this.type=r,this.useIntegerZoom=a,this.zoom=l,this.maxValue=0,this.paintVertexAttributes=t.map((function(h){return{name:"a_"+h,type:"Float32",components:r==="color"?4:2,offset:0}})),this.paintVertexArray=new c};ft.prototype.populatePaintArray=function(e,t,r,a,l){var c=this.expression.evaluate(new kt(this.zoom),t,{},a,[],l),h=this.expression.evaluate(new kt(this.zoom+1),t,{},a,[],l),m=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(m,e,c,h)},ft.prototype.updatePaintArray=function(e,t,r,a){var l=this.expression.evaluate({zoom:this.zoom},r,a),c=this.expression.evaluate({zoom:this.zoom+1},r,a);this._setPaintValue(e,t,l,c)},ft.prototype._setPaintValue=function(e,t,r,a){if(this.type==="color")for(var l=We(r),c=We(a),h=e;h<t;h++)this.paintVertexArray.emplace(h,l[0],l[1],c[0],c[1]);else{for(var m=e;m<t;m++)this.paintVertexArray.emplace(m,r,a);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(a))}},ft.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},ft.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},ft.prototype.setUniform=function(e,t){var r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,a=Ze(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(a)},ft.prototype.getBinding=function(e,t,r){return new ke(e,t)};var gt=function(e,t,r,a,l,c){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=a,this.layerId=c,this.zoomInPaintVertexArray=new l,this.zoomOutPaintVertexArray=new l};gt.prototype.populatePaintArray=function(e,t,r){var a=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(a,e,t.patterns&&t.patterns[this.layerId],r)},gt.prototype.updatePaintArray=function(e,t,r,a,l){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],l)},gt.prototype._setPaintValues=function(e,t,r,a){if(a&&r){var l=a[r.min],c=a[r.mid],h=a[r.max];if(l&&c&&h)for(var m=e;m<t;m++)this.zoomInPaintVertexArray.emplace(m,c.tl[0],c.tl[1],c.br[0],c.br[1],l.tl[0],l.tl[1],l.br[0],l.br[1],c.pixelRatio,l.pixelRatio),this.zoomOutPaintVertexArray.emplace(m,c.tl[0],c.tl[1],c.br[0],c.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1],c.pixelRatio,h.pixelRatio)}},gt.prototype.upload=function(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,W.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,W.members,this.expression.isStateDependent))},gt.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var ht=function(e,t,r){this.binders={},this._buffers=[];var a=[];for(var l in e.paint._values)if(r(l)){var c=e.paint.get(l);if(c instanceof Ti&&Eo(c.property.specification)){var h=Jr(l,e.type),m=c.value,g=c.property.specification.type,b=c.property.useIntegerZoom,S=c.property.specification["property-type"],I=S==="cross-faded"||S==="cross-faded-data-driven";if(m.kind==="constant")this.binders[l]=I?new xt(m.value,h):new mt(m.value,h,g),a.push("/u_"+l);else if(m.kind==="source"||I){var C=Ir(l,g,"source");this.binders[l]=I?new gt(m,g,b,t,C,e.id):new dt(m,h,g,C),a.push("/a_"+l)}else{var z=Ir(l,g,"composite");this.binders[l]=new ft(m,h,g,b,t,z),a.push("/z_"+l)}}}this.cacheKey=a.sort().join("")};ht.prototype.getMaxValue=function(e){var t=this.binders[e];return t instanceof dt||t instanceof ft?t.maxValue:0},ht.prototype.populatePaintArrays=function(e,t,r,a,l){for(var c in this.binders){var h=this.binders[c];(h instanceof dt||h instanceof ft||h instanceof gt)&&h.populatePaintArray(e,t,r,a,l)}},ht.prototype.setConstantPatternPositions=function(e,t){for(var r in this.binders){var a=this.binders[r];a instanceof xt&&a.setConstantPatternPositions(e,t)}},ht.prototype.updatePaintArrays=function(e,t,r,a,l){var c=!1;for(var h in e)for(var m=0,g=t.getPositions(h);m<g.length;m+=1){var b=g[m],S=r.feature(b.index);for(var I in this.binders){var C=this.binders[I];if((C instanceof dt||C instanceof ft||C instanceof gt)&&C.expression.isStateDependent===!0){var z=a.paint.get(I);C.expression=z.value,C.updatePaintArray(b.start,b.end,S,e[h],l),c=!0}}}return c},ht.prototype.defines=function(){var e=[];for(var t in this.binders){var r=this.binders[t];(r instanceof mt||r instanceof xt)&&e.push.apply(e,r.uniformNames.map((function(a){return"#define HAS_UNIFORM_"+a})))}return e},ht.prototype.getBinderAttributes=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof dt||r instanceof ft)for(var a=0;a<r.paintVertexAttributes.length;a++)e.push(r.paintVertexAttributes[a].name);else if(r instanceof gt)for(var l=0;l<W.members.length;l++)e.push(W.members[l].name)}return e},ht.prototype.getBinderUniforms=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof mt||r instanceof xt||r instanceof ft)for(var a=0,l=r.uniformNames;a<l.length;a+=1)e.push(l[a])}return e},ht.prototype.getPaintVertexBuffers=function(){return this._buffers},ht.prototype.getUniforms=function(e,t){var r=[];for(var a in this.binders){var l=this.binders[a];if(l instanceof mt||l instanceof xt||l instanceof ft)for(var c=0,h=l.uniformNames;c<h.length;c+=1){var m=h[c];if(t[m]){var g=l.getBinding(e,t[m],m);r.push({name:m,property:a,binding:g})}}}return r},ht.prototype.setUniforms=function(e,t,r,a){for(var l=0,c=t;l<c.length;l+=1){var h=c[l],m=h.name,g=h.property;this.binders[g].setUniform(h.binding,a,r.get(g),m)}},ht.prototype.updatePaintBuffers=function(e){for(var t in this._buffers=[],this.binders){var r=this.binders[t];if(e&&r instanceof gt){var a=e.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;a&&this._buffers.push(a)}else(r instanceof dt||r instanceof ft)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},ht.prototype.upload=function(e){for(var t in this.binders){var r=this.binders[t];(r instanceof dt||r instanceof ft||r instanceof gt)&&r.upload(e)}this.updatePaintBuffers()},ht.prototype.destroy=function(){for(var e in this.binders){var t=this.binders[e];(t instanceof dt||t instanceof ft||t instanceof gt)&&t.destroy()}};var ct=function(e,t,r){r===void 0&&(r=function(){return!0}),this.programConfigurations={};for(var a=0,l=e;a<l.length;a+=1){var c=l[a];this.programConfigurations[c.id]=new ht(c,t,r)}this.needsUpload=!1,this._featureMap=new ne,this._bufferOffset=0};function Jr(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace(t+"-","").replace(/-/g,"_")]}function Ir(e,t,r){var a={color:{source:ta,composite:gs},number:{source:io,composite:ta}},l=(function(c){return{"line-pattern":{source:En,composite:En},"fill-pattern":{source:En,composite:En},"fill-extrusion-pattern":{source:En,composite:En}}[c]})(e);return l&&l[r]||a[t][r]}ct.prototype.populatePaintArrays=function(e,t,r,a,l,c){for(var h in this.programConfigurations)this.programConfigurations[h].populatePaintArrays(e,t,a,l,c);t.id!==void 0&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0},ct.prototype.updatePaintArrays=function(e,t,r,a){for(var l=0,c=r;l<c.length;l+=1){var h=c[l];this.needsUpload=this.programConfigurations[h.id].updatePaintArrays(e,this._featureMap,t,h,a)||this.needsUpload}},ct.prototype.get=function(e){return this.programConfigurations[e]},ct.prototype.upload=function(e){if(this.needsUpload){for(var t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}},ct.prototype.destroy=function(){for(var e in this.programConfigurations)this.programConfigurations[e].destroy()},Xe("ConstantBinder",mt),Xe("CrossFadedConstantBinder",xt),Xe("SourceExpressionBinder",dt),Xe("CrossFadedCompositeBinder",gt),Xe("CompositeExpressionBinder",ft),Xe("ProgramConfiguration",ht,{omit:["_buffers"]}),Xe("ProgramConfigurationSet",ct);var gi=Math.pow(2,14)-1,si=-gi-1;function wr(e){for(var t=8192/e.extent,r=e.loadGeometry(),a=0;a<r.length;a++)for(var l=r[a],c=0;c<l.length;c++){var h=l[c],m=Math.round(h.x*t),g=Math.round(h.y*t);h.x=Ze(m,si,gi),h.y=Ze(g,si,gi),(m<h.x||m>h.x+1||g<h.y||g>h.y+1)&&St("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Mr(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?wr(e):[]}}function Wi(e,t,r,a,l){e.emplaceBack(2*t+(a+1)/2,2*r+(l+1)/2)}var Ei=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Bo,this.indexArray=new to,this.segments=new F,this.programConfigurations=new ct(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function no(e,t){for(var r=0;r<e.length;r++)if(Pn(t,e[r]))return!0;for(var a=0;a<t.length;a++)if(Pn(e,t[a]))return!0;return!!Ra(e,t)}function Ri(e,t,r){return!!Pn(e,t)||!!oo(t,e,r)}function wn(e,t){if(e.length===1)return La(t,e[0]);for(var r=0;r<t.length;r++)for(var a=t[r],l=0;l<a.length;l++)if(Pn(e,a[l]))return!0;for(var c=0;c<e.length;c++)if(La(t,e[c]))return!0;for(var h=0;h<t.length;h++)if(Ra(e,t[h]))return!0;return!1}function cn(e,t,r){if(e.length>1){if(Ra(e,t))return!0;for(var a=0;a<t.length;a++)if(oo(t[a],e,r))return!0}for(var l=0;l<e.length;l++)if(oo(e[l],t,r))return!0;return!1}function Ra(e,t){if(e.length===0||t.length===0)return!1;for(var r=0;r<e.length-1;r++)for(var a=e[r],l=e[r+1],c=0;c<t.length-1;c++)if(na(a,l,t[c],t[c+1]))return!0;return!1}function na(e,t,r,a){return Ut(e,r,a)!==Ut(t,r,a)&&Ut(e,t,r)!==Ut(e,t,a)}function oo(e,t,r){var a=r*r;if(t.length===1)return e.distSqr(t[0])<a;for(var l=1;l<t.length;l++)if(oa(e,t[l-1],t[l])<a)return!0;return!1}function oa(e,t,r){var a=t.distSqr(r);if(a===0)return e.distSqr(t);var l=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/a;return e.distSqr(l<0?t:l>1?r:r.sub(t)._mult(l)._add(t))}function La(e,t){for(var r,a,l,c=!1,h=0;h<e.length;h++)for(var m=0,g=(r=e[h]).length-1;m<r.length;g=m++)(a=r[m]).y>t.y!=(l=r[g]).y>t.y&&t.x<(l.x-a.x)*(t.y-a.y)/(l.y-a.y)+a.x&&(c=!c);return c}function Pn(e,t){for(var r=!1,a=0,l=e.length-1;a<e.length;l=a++){var c=e[a],h=e[l];c.y>t.y!=h.y>t.y&&t.x<(h.x-c.x)*(t.y-c.y)/(h.y-c.y)+c.x&&(r=!r)}return r}function Fa(e,t,r){var a=r[0],l=r[2];if(e.x<a.x&&t.x<a.x||e.x>l.x&&t.x>l.x||e.y<a.y&&t.y<a.y||e.y>l.y&&t.y>l.y)return!1;var c=Ut(e,t,r[0]);return c!==Ut(e,t,r[1])||c!==Ut(e,t,r[2])||c!==Ut(e,t,r[3])}function Cn(e,t,r){var a=t.paint.get(e).value;return a.kind==="constant"?a.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Yr(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function On(e,t,r,a,l){if(!t[0]&&!t[1])return e;var c=X.convert(t)._mult(l);r==="viewport"&&c._rotate(-a);for(var h=[],m=0;m<e.length;m++)h.push(e[m].sub(c));return h}Ei.prototype.populate=function(e,t,r){var a=this.layers[0],l=[],c=null;a.type==="circle"&&(c=a.layout.get("circle-sort-key"));for(var h=0,m=e;h<m.length;h+=1){var g=m[h],b=g.feature,S=g.id,I=g.index,C=g.sourceLayerIndex,z=this.layers[0]._featureFilter.needGeometry,j=Mr(b,z);if(this.layers[0]._featureFilter.filter(new kt(this.zoom),j,r)){var G=c?c.evaluate(j,{},r):void 0,te={id:S,properties:b.properties,type:b.type,sourceLayerIndex:C,index:I,geometry:z?j.geometry:wr(b),patterns:{},sortKey:G};l.push(te)}}c&&l.sort((function(ze,rt){return ze.sortKey-rt.sortKey}));for(var K=0,oe=l;K<oe.length;K+=1){var le=oe[K],ce=le.geometry,he=le.index,xe=le.sourceLayerIndex,Pe=e[he].feature;this.addFeature(le,ce,he,r),t.featureIndex.insert(Pe,ce,he,xe,this.index)}},Ei.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Ei.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Ei.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ei.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,R),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},Ei.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ei.prototype.addFeature=function(e,t,r,a){for(var l=0,c=t;l<c.length;l+=1)for(var h=0,m=c[l];h<m.length;h+=1){var g=m[h],b=g.x,S=g.y;if(!(b<0||b>=8192||S<0||S>=8192)){var I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),C=I.vertexLength;Wi(this.layoutVertexArray,b,S,-1,-1),Wi(this.layoutVertexArray,b,S,1,-1),Wi(this.layoutVertexArray,b,S,1,1),Wi(this.layoutVertexArray,b,S,-1,1),this.indexArray.emplaceBack(C,C+1,C+2),this.indexArray.emplaceBack(C,C+3,C+2),I.vertexLength+=4,I.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},a)},Xe("CircleBucket",Ei,{omit:["layers"]});var ao=new vi({"circle-sort-key":new Ye(L.layout_circle["circle-sort-key"])}),Do={paint:new vi({"circle-radius":new Ye(L.paint_circle["circle-radius"]),"circle-color":new Ye(L.paint_circle["circle-color"]),"circle-blur":new Ye(L.paint_circle["circle-blur"]),"circle-opacity":new Ye(L.paint_circle["circle-opacity"]),"circle-translate":new it(L.paint_circle["circle-translate"]),"circle-translate-anchor":new it(L.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new it(L.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new it(L.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ye(L.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ye(L.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ye(L.paint_circle["circle-stroke-opacity"])}),layout:ao},Zt=typeof Float32Array<"u"?Float32Array:Array;function en(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Li(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3],m=t[4],g=t[5],b=t[6],S=t[7],I=t[8],C=t[9],z=t[10],j=t[11],G=t[12],te=t[13],K=t[14],oe=t[15],le=r[0],ce=r[1],he=r[2],xe=r[3];return e[0]=le*a+ce*m+he*I+xe*G,e[1]=le*l+ce*g+he*C+xe*te,e[2]=le*c+ce*b+he*z+xe*K,e[3]=le*h+ce*S+he*j+xe*oe,e[4]=(le=r[4])*a+(ce=r[5])*m+(he=r[6])*I+(xe=r[7])*G,e[5]=le*l+ce*g+he*C+xe*te,e[6]=le*c+ce*b+he*z+xe*K,e[7]=le*h+ce*S+he*j+xe*oe,e[8]=(le=r[8])*a+(ce=r[9])*m+(he=r[10])*I+(xe=r[11])*G,e[9]=le*l+ce*g+he*C+xe*te,e[10]=le*c+ce*b+he*z+xe*K,e[11]=le*h+ce*S+he*j+xe*oe,e[12]=(le=r[12])*a+(ce=r[13])*m+(he=r[14])*I+(xe=r[15])*G,e[13]=le*l+ce*g+he*C+xe*te,e[14]=le*c+ce*b+he*z+xe*K,e[15]=le*h+ce*S+he*j+xe*oe,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var Ro,Nc=Li;function _s(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3];return e[0]=r[0]*a+r[4]*l+r[8]*c+r[12]*h,e[1]=r[1]*a+r[5]*l+r[9]*c+r[13]*h,e[2]=r[2]*a+r[6]*l+r[10]*c+r[14]*h,e[3]=r[3]*a+r[7]*l+r[11]*c+r[15]*h,e}Ro=new Zt(3),Zt!=Float32Array&&(Ro[0]=0,Ro[1]=0,Ro[2]=0),(function(){var e=new Zt(4);Zt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)})();var jc=((function(){var e=new Zt(2);Zt!=Float32Array&&(e[0]=0,e[1]=0)})(),(function(e){function t(r){e.call(this,r,Do)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new Ei(r)},t.prototype.queryRadius=function(r){var a=r;return Cn("circle-radius",this,a)+Cn("circle-stroke-width",this,a)+Yr(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g,b){for(var S=On(r,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),m.angle,g),I=this.paint.get("circle-radius").evaluate(a,l)+this.paint.get("circle-stroke-width").evaluate(a,l),C=this.paint.get("circle-pitch-alignment")==="map",z=C?S:(function(Pe,ze){return Pe.map((function(rt){return Oa(rt,ze)}))})(S,b),j=C?I*g:I,G=0,te=c;G<te.length;G+=1)for(var K=0,oe=te[G];K<oe.length;K+=1){var le=oe[K],ce=C?le:Oa(le,b),he=j,xe=_s([],[le.x,le.y,0,1],b);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?he*=xe[3]/m.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(he*=m.cameraToCenterDistance/xe[3]),Ri(z,ce,he))return!0}return!1},t})(An));function Oa(e,t){var r=_s([],[e.x,e.y,0,1],t);return new X(r[0]/r[3],r[1]/r[3])}var Fl=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(Ei);function aa(e,t,r,a){var l=t.width,c=t.height;if(a){if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==l*c*r)throw new RangeError("mismatched image size")}else a=new Uint8Array(l*c*r);return e.width=l,e.height=c,e.data=a,e}function xs(e,t,r){var a=t.width,l=t.height;if(a!==e.width||l!==e.height){var c=aa({},{width:a,height:l},r);Gc(e,c,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,a),height:Math.min(e.height,l)},r),e.width=a,e.height=l,e.data=c.data}}function Gc(e,t,r,a,l,c){if(l.width===0||l.height===0)return t;if(l.width>e.width||l.height>e.height||r.x>e.width-l.width||r.y>e.height-l.height)throw new RangeError("out of range source coordinates for image copy");if(l.width>t.width||l.height>t.height||a.x>t.width-l.width||a.y>t.height-l.height)throw new RangeError("out of range destination coordinates for image copy");for(var h=e.data,m=t.data,g=0;g<l.height;g++)for(var b=((r.y+g)*e.width+r.x)*c,S=((a.y+g)*t.width+a.x)*c,I=0;I<l.width*c;I++)m[S+I]=h[b+I];return t}Xe("HeatmapBucket",Fl,{omit:["layers"]});var Va=function(e,t){aa(this,e,1,t)};Va.prototype.resize=function(e){xs(this,e,1)},Va.prototype.clone=function(){return new Va({width:this.width,height:this.height},new Uint8Array(this.data))},Va.copy=function(e,t,r,a,l){Gc(e,t,r,a,l,1)};var Hi=function(e,t){aa(this,e,4,t)};Hi.prototype.resize=function(e){xs(this,e,4)},Hi.prototype.replace=function(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e},Hi.prototype.clone=function(){return new Hi({width:this.width,height:this.height},new Uint8Array(this.data))},Hi.copy=function(e,t,r,a,l){Gc(e,t,r,a,l,4)},Xe("AlphaImage",Va),Xe("RGBAImage",Hi);var rb={paint:new vi({"heatmap-radius":new Ye(L.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ye(L.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new it(L.paint_heatmap["heatmap-intensity"]),"heatmap-color":new bn(L.paint_heatmap["heatmap-color"]),"heatmap-opacity":new it(L.paint_heatmap["heatmap-opacity"])})};function dm(e){var t={},r=e.resolution||256,a=e.clips?e.clips.length:1,l=e.image||new Hi({width:r,height:a}),c=function(j,G,te){t[e.evaluationKey]=te;var K=e.expression.evaluate(t);l.data[j+G+0]=Math.floor(255*K.r/K.a),l.data[j+G+1]=Math.floor(255*K.g/K.a),l.data[j+G+2]=Math.floor(255*K.b/K.a),l.data[j+G+3]=Math.floor(255*K.a)};if(e.clips)for(var h=0,m=0;h<a;++h,m+=4*r)for(var g=0,b=0;g<r;g++,b+=4){var S=g/(r-1),I=e.clips[h];c(m,b,I.start*(1-S)+I.end*S)}else for(var C=0,z=0;C<r;C++,z+=4)c(0,z,C/(r-1));return l}var ib=(function(e){function t(r){e.call(this,r,rb),this._updateColorRamp()}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new Fl(r)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="heatmap-color"&&this._updateColorRamp()},t.prototype._updateColorRamp=function(){this.colorRamp=dm({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},t.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},t})(An),nb={paint:new vi({"hillshade-illumination-direction":new it(L.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new it(L.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new it(L.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new it(L.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new it(L.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new it(L.paint_hillshade["hillshade-accent-color"])})},ob=(function(e){function t(r){e.call(this,r,nb)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},t})(An),ab=ai([{name:"a_pos",components:2,type:"Int16"}],4).members,$c=Ol,sb=Ol;function Ol(e,t,r){r=r||2;var a,l,c,h,m,g,b,S=t&&t.length,I=S?t[0]*r:e.length,C=mm(e,0,I,r,!0),z=[];if(!C||C.next===C.prev)return z;if(S&&(C=(function(G,te,K,oe){var le,ce,he,xe=[];for(le=0,ce=te.length;le<ce;le++)(he=mm(G,te[le]*oe,le<ce-1?te[le+1]*oe:G.length,oe,!1))===he.next&&(he.steiner=!0),xe.push(mb(he));for(xe.sort(hb),le=0;le<xe.length;le++)fb(xe[le],K),K=sa(K,K.next);return K})(e,t,C,r)),e.length>80*r){a=c=e[0],l=h=e[1];for(var j=r;j<I;j+=r)(m=e[j])<a&&(a=m),(g=e[j+1])<l&&(l=g),m>c&&(c=m),g>h&&(h=g);b=(b=Math.max(c-a,h-l))!==0?1/b:0}return Eu(C,z,r,a,l,b),z}function mm(e,t,r,a,l){var c,h;if(l===Hc(e,t,r,a)>0)for(c=t;c<r;c+=a)h=gm(c,e[c],e[c+1],h);else for(c=r-a;c>=t;c-=a)h=gm(c,e[c],e[c+1],h);return h&&Vl(h,h.next)&&(Cu(h),h=h.next),h}function sa(e,t){if(!e)return e;t||(t=e);var r,a=e;do if(r=!1,a.steiner||!Vl(a,a.next)&&$r(a.prev,a,a.next)!==0)a=a.next;else{if(Cu(a),(a=t=a.prev)===a.next)break;r=!0}while(r||a!==t);return t}function Eu(e,t,r,a,l,c,h){if(e){!h&&c&&(function(S,I,C,z){var j=S;do j.z===null&&(j.z=Zc(j.x,j.y,I,C,z)),j.prevZ=j.prev,j.nextZ=j.next,j=j.next;while(j!==S);j.prevZ.nextZ=null,j.prevZ=null,(function(G){var te,K,oe,le,ce,he,xe,Pe,ze=1;do{for(K=G,G=null,ce=null,he=0;K;){for(he++,oe=K,xe=0,te=0;te<ze&&(xe++,oe=oe.nextZ);te++);for(Pe=ze;xe>0||Pe>0&&oe;)xe!==0&&(Pe===0||!oe||K.z<=oe.z)?(le=K,K=K.nextZ,xe--):(le=oe,oe=oe.nextZ,Pe--),ce?ce.nextZ=le:G=le,le.prevZ=ce,ce=le;K=oe}ce.nextZ=null,ze*=2}while(he>1)})(j)})(e,a,l,c);for(var m,g,b=e;e.prev!==e.next;)if(m=e.prev,g=e.next,c?lb(e,a,l,c):ub(e))t.push(m.i/r),t.push(e.i/r),t.push(g.i/r),Cu(e),e=g.next,b=g.next;else if((e=g)===b){h?h===1?Eu(e=cb(sa(e),t,r),t,r,a,l,c,2):h===2&&pb(e,t,r,a,l,c):Eu(sa(e),t,r,a,l,c,1);break}}}function ub(e){var t=e.prev,r=e,a=e.next;if($r(t,r,a)>=0)return!1;for(var l=e.next.next;l!==e.prev;){if(bs(t.x,t.y,r.x,r.y,a.x,a.y,l.x,l.y)&&$r(l.prev,l,l.next)>=0)return!1;l=l.next}return!0}function lb(e,t,r,a){var l=e.prev,c=e,h=e.next;if($r(l,c,h)>=0)return!1;for(var m=l.x>c.x?l.x>h.x?l.x:h.x:c.x>h.x?c.x:h.x,g=l.y>c.y?l.y>h.y?l.y:h.y:c.y>h.y?c.y:h.y,b=Zc(l.x<c.x?l.x<h.x?l.x:h.x:c.x<h.x?c.x:h.x,l.y<c.y?l.y<h.y?l.y:h.y:c.y<h.y?c.y:h.y,t,r,a),S=Zc(m,g,t,r,a),I=e.prevZ,C=e.nextZ;I&&I.z>=b&&C&&C.z<=S;){if(I!==e.prev&&I!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,I.x,I.y)&&$r(I.prev,I,I.next)>=0||(I=I.prevZ,C!==e.prev&&C!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,C.x,C.y)&&$r(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;I&&I.z>=b;){if(I!==e.prev&&I!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,I.x,I.y)&&$r(I.prev,I,I.next)>=0)return!1;I=I.prevZ}for(;C&&C.z<=S;){if(C!==e.prev&&C!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,C.x,C.y)&&$r(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function cb(e,t,r){var a=e;do{var l=a.prev,c=a.next.next;!Vl(l,c)&&ym(l,a,a.next,c)&&Pu(l,c)&&Pu(c,l)&&(t.push(l.i/r),t.push(a.i/r),t.push(c.i/r),Cu(a),Cu(a.next),a=e=c),a=a.next}while(a!==e);return sa(a)}function pb(e,t,r,a,l,c){var h=e;do{for(var m=h.next.next;m!==h.prev;){if(h.i!==m.i&&yb(h,m)){var g=vm(h,m);return h=sa(h,h.next),g=sa(g,g.next),Eu(h,t,r,a,l,c),void Eu(g,t,r,a,l,c)}m=m.next}h=h.next}while(h!==e)}function hb(e,t){return e.x-t.x}function fb(e,t){if(t=(function(a,l){var c,h=l,m=a.x,g=a.y,b=-1/0;do{if(g<=h.y&&g>=h.next.y&&h.next.y!==h.y){var S=h.x+(g-h.y)*(h.next.x-h.x)/(h.next.y-h.y);if(S<=m&&S>b){if(b=S,S===m){if(g===h.y)return h;if(g===h.next.y)return h.next}c=h.x<h.next.x?h:h.next}}h=h.next}while(h!==l);if(!c)return null;if(m===b)return c;var I,C=c,z=c.x,j=c.y,G=1/0;h=c;do m>=h.x&&h.x>=z&&m!==h.x&&bs(g<j?m:b,g,z,j,g<j?b:m,g,h.x,h.y)&&(I=Math.abs(g-h.y)/(m-h.x),Pu(h,a)&&(I<G||I===G&&(h.x>c.x||h.x===c.x&&db(c,h)))&&(c=h,G=I)),h=h.next;while(h!==C);return c})(e,t)){var r=vm(t,e);sa(t,t.next),sa(r,r.next)}}function db(e,t){return $r(e.prev,e,t.prev)<0&&$r(t.next,e,e.next)<0}function Zc(e,t,r,a,l){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*l)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-a)*l)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function mb(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function bs(e,t,r,a,l,c,h,m){return(l-h)*(t-m)-(e-h)*(c-m)>=0&&(e-h)*(a-m)-(r-h)*(t-m)>=0&&(r-h)*(c-m)-(l-h)*(a-m)>=0}function yb(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!(function(r,a){var l=r;do{if(l.i!==r.i&&l.next.i!==r.i&&l.i!==a.i&&l.next.i!==a.i&&ym(l,l.next,r,a))return!0;l=l.next}while(l!==r);return!1})(e,t)&&(Pu(e,t)&&Pu(t,e)&&(function(r,a){var l=r,c=!1,h=(r.x+a.x)/2,m=(r.y+a.y)/2;do l.y>m!=l.next.y>m&&l.next.y!==l.y&&h<(l.next.x-l.x)*(m-l.y)/(l.next.y-l.y)+l.x&&(c=!c),l=l.next;while(l!==r);return c})(e,t)&&($r(e.prev,e,t.prev)||$r(e,t.prev,t))||Vl(e,t)&&$r(e.prev,e,e.next)>0&&$r(t.prev,t,t.next)>0)}function $r(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Vl(e,t){return e.x===t.x&&e.y===t.y}function ym(e,t,r,a){var l=Ul($r(e,t,r)),c=Ul($r(e,t,a)),h=Ul($r(r,a,e)),m=Ul($r(r,a,t));return l!==c&&h!==m||!(l!==0||!ql(e,r,t))||!(c!==0||!ql(e,a,t))||!(h!==0||!ql(r,e,a))||!(m!==0||!ql(r,t,a))}function ql(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Ul(e){return e>0?1:e<0?-1:0}function Pu(e,t){return $r(e.prev,e,e.next)<0?$r(e,t,e.next)>=0&&$r(e,e.prev,t)>=0:$r(e,t,e.prev)<0||$r(e,e.next,t)<0}function vm(e,t){var r=new Wc(e.i,e.x,e.y),a=new Wc(t.i,t.x,t.y),l=e.next,c=t.prev;return e.next=t,t.prev=e,r.next=l,l.prev=r,a.next=r,r.prev=a,c.next=a,a.prev=c,a}function gm(e,t,r,a){var l=new Wc(e,t,r);return a?(l.next=a.next,l.prev=a,a.next.prev=l,a.next=l):(l.prev=l,l.next=l),l}function Cu(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Wc(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Hc(e,t,r,a){for(var l=0,c=t,h=r-a;c<r;c+=a)l+=(e[h]-e[c])*(e[c+1]+e[h+1]),h=c;return l}function vb(e,t,r,a,l){(function c(h,m,g,b,S){for(;b>g;){if(b-g>600){var I=b-g+1,C=m-g+1,z=Math.log(I),j=.5*Math.exp(2*z/3),G=.5*Math.sqrt(z*j*(I-j)/I)*(C-I/2<0?-1:1);c(h,m,Math.max(g,Math.floor(m-C*j/I+G)),Math.min(b,Math.floor(m+(I-C)*j/I+G)),S)}var te=h[m],K=g,oe=b;for(ku(h,g,m),S(h[b],te)>0&&ku(h,g,b);K<oe;){for(ku(h,K,oe),K++,oe--;S(h[K],te)<0;)K++;for(;S(h[oe],te)>0;)oe--}S(h[g],te)===0?ku(h,g,oe):ku(h,++oe,b),oe<=m&&(g=oe+1),m<=oe&&(b=oe-1)}})(e,t,r,a||e.length-1,l||gb)}function ku(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function gb(e,t){return e<t?-1:e>t?1:0}function Xc(e,t){var r=e.length;if(r<=1)return[e];for(var a,l,c=[],h=0;h<r;h++){var m=Hr(e[h]);m!==0&&(e[h].area=Math.abs(m),l===void 0&&(l=m<0),l===m<0?(a&&c.push(a),a=[e[h]]):a.push(e[h]))}if(a&&c.push(a),t>1)for(var g=0;g<c.length;g++)c[g].length<=t||(vb(c[g],t,1,c[g].length-1,_b),c[g]=c[g].slice(0,t));return c}function _b(e,t){return t.area-e.area}function Kc(e,t,r){for(var a=r.patternDependencies,l=!1,c=0,h=t;c<h.length;c+=1){var m=h[c].paint.get(e+"-pattern");m.isConstant()||(l=!0);var g=m.constantOr(null);g&&(l=!0,a[g.to]=!0,a[g.from]=!0)}return l}function Jc(e,t,r,a,l){for(var c=l.patternDependencies,h=0,m=t;h<m.length;h+=1){var g=m[h],b=g.paint.get(e+"-pattern").value;if(b.kind!=="constant"){var S=b.evaluate({zoom:a-1},r,{},l.availableImages),I=b.evaluate({zoom:a},r,{},l.availableImages),C=b.evaluate({zoom:a+1},r,{},l.availableImages);I=I&&I.name?I.name:I,C=C&&C.name?C.name:C,c[S=S&&S.name?S.name:S]=!0,c[I]=!0,c[C]=!0,r.patterns[g.id]={min:S,mid:I,max:C}}}return r}Ol.deviation=function(e,t,r,a){var l=t&&t.length,c=Math.abs(Hc(e,0,l?t[0]*r:e.length,r));if(l)for(var h=0,m=t.length;h<m;h++)c-=Math.abs(Hc(e,t[h]*r,h<m-1?t[h+1]*r:e.length,r));var g=0;for(h=0;h<a.length;h+=3){var b=a[h]*r,S=a[h+1]*r,I=a[h+2]*r;g+=Math.abs((e[b]-e[I])*(e[S+1]-e[b+1])-(e[b]-e[S])*(e[I+1]-e[b+1]))}return c===0&&g===0?0:Math.abs((g-c)/c)},Ol.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},a=0,l=0;l<e.length;l++){for(var c=0;c<e[l].length;c++)for(var h=0;h<t;h++)r.vertices.push(e[l][c][h]);l>0&&r.holes.push(a+=e[l-1].length)}return r},$c.default=sb;var Vn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Bo,this.indexArray=new to,this.indexArray2=new Da,this.programConfigurations=new ct(e.layers,e.zoom),this.segments=new F,this.segments2=new F,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Vn.prototype.populate=function(e,t,r){this.hasPattern=Kc("fill",this.layers,t);for(var a=this.layers[0].layout.get("fill-sort-key"),l=[],c=0,h=e;c<h.length;c+=1){var m=h[c],g=m.feature,b=m.id,S=m.index,I=m.sourceLayerIndex,C=this.layers[0]._featureFilter.needGeometry,z=Mr(g,C);if(this.layers[0]._featureFilter.filter(new kt(this.zoom),z,r)){var j=a?a.evaluate(z,{},r,t.availableImages):void 0,G={id:b,properties:g.properties,type:g.type,sourceLayerIndex:I,index:S,geometry:C?z.geometry:wr(g),patterns:{},sortKey:j};l.push(G)}}a&&l.sort((function(Pe,ze){return Pe.sortKey-ze.sortKey}));for(var te=0,K=l;te<K.length;te+=1){var oe=K[te],le=oe.geometry,ce=oe.index,he=oe.sourceLayerIndex;if(this.hasPattern){var xe=Jc("fill",this.layers,oe,this.zoom,t);this.patternFeatures.push(xe)}else this.addFeature(oe,le,ce,r,{});t.featureIndex.insert(e[ce].feature,le,ce,he,this.index)}},Vn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Vn.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.patternFeatures;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},Vn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Vn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Vn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ab),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0},Vn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Vn.prototype.addFeature=function(e,t,r,a,l){for(var c=0,h=Xc(t,500);c<h.length;c+=1){for(var m=h[c],g=0,b=0,S=m;b<S.length;b+=1)g+=S[b].length;for(var I=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray),C=I.vertexLength,z=[],j=[],G=0,te=m;G<te.length;G+=1){var K=te[G];if(K.length!==0){K!==m[0]&&j.push(z.length/2);var oe=this.segments2.prepareSegment(K.length,this.layoutVertexArray,this.indexArray2),le=oe.vertexLength;this.layoutVertexArray.emplaceBack(K[0].x,K[0].y),this.indexArray2.emplaceBack(le+K.length-1,le),z.push(K[0].x),z.push(K[0].y);for(var ce=1;ce<K.length;ce++)this.layoutVertexArray.emplaceBack(K[ce].x,K[ce].y),this.indexArray2.emplaceBack(le+ce-1,le+ce),z.push(K[ce].x),z.push(K[ce].y);oe.vertexLength+=K.length,oe.primitiveLength+=K.length}}for(var he=$c(z,j),xe=0;xe<he.length;xe+=3)this.indexArray.emplaceBack(C+he[xe],C+he[xe+1],C+he[xe+2]);I.vertexLength+=g,I.primitiveLength+=he.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},Xe("FillBucket",Vn,{omit:["layers","patternFeatures"]});var xb=new vi({"fill-sort-key":new Ye(L.layout_fill["fill-sort-key"])}),bb={paint:new vi({"fill-antialias":new it(L.paint_fill["fill-antialias"]),"fill-opacity":new Ye(L.paint_fill["fill-opacity"]),"fill-color":new Ye(L.paint_fill["fill-color"]),"fill-outline-color":new Ye(L.paint_fill["fill-outline-color"]),"fill-translate":new it(L.paint_fill["fill-translate"]),"fill-translate-anchor":new it(L.paint_fill["fill-translate-anchor"]),"fill-pattern":new ds(L.paint_fill["fill-pattern"])}),layout:xb},wb=(function(e){function t(r){e.call(this,r,bb)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a);var l=this.paint._values["fill-outline-color"];l.value.kind==="constant"&&l.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},t.prototype.createBucket=function(r){return new Vn(r)},t.prototype.queryRadius=function(){return Yr(this.paint.get("fill-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g){return wn(On(r,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),m.angle,g),c)},t.prototype.isTileClipped=function(){return!0},t})(An),Sb=ai([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,_m=ws;function ws(e,t,r,a,l){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=a,this._values=l,e.readFields(Ib,this,t)}function Ib(e,t,r){e==1?t.id=r.readVarint():e==2?(function(a,l){for(var c=a.readVarint()+a.pos;a.pos<c;){var h=l._keys[a.readVarint()],m=l._values[a.readVarint()];l.properties[h]=m}})(r,t):e==3?t.type=r.readVarint():e==4&&(t._geometry=r.pos)}function Tb(e){for(var t,r,a=0,l=0,c=e.length,h=c-1;l<c;h=l++)a+=((r=e[h]).x-(t=e[l]).x)*(t.y+r.y);return a}ws.types=["Unknown","Point","LineString","Polygon"],ws.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,a=1,l=0,c=0,h=0,m=[];e.pos<r;){if(l<=0){var g=e.readVarint();a=7&g,l=g>>3}if(l--,a===1||a===2)c+=e.readSVarint(),h+=e.readSVarint(),a===1&&(t&&m.push(t),t=[]),t.push(new X(c,h));else{if(a!==7)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&m.push(t),m},ws.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,a=0,l=0,c=0,h=1/0,m=-1/0,g=1/0,b=-1/0;e.pos<t;){if(a<=0){var S=e.readVarint();r=7&S,a=S>>3}if(a--,r===1||r===2)(l+=e.readSVarint())<h&&(h=l),l>m&&(m=l),(c+=e.readSVarint())<g&&(g=c),c>b&&(b=c);else if(r!==7)throw new Error("unknown command "+r)}return[h,g,m,b]},ws.prototype.toGeoJSON=function(e,t,r){var a,l,c=this.extent*Math.pow(2,r),h=this.extent*e,m=this.extent*t,g=this.loadGeometry(),b=ws.types[this.type];function S(z){for(var j=0;j<z.length;j++){var G=z[j];z[j]=[360*(G.x+h)/c-180,360/Math.PI*Math.atan(Math.exp((180-360*(G.y+m)/c)*Math.PI/180))-90]}}switch(this.type){case 1:var I=[];for(a=0;a<g.length;a++)I[a]=g[a][0];S(g=I);break;case 2:for(a=0;a<g.length;a++)S(g[a]);break;case 3:for(g=(function(z){var j=z.length;if(j<=1)return[z];for(var G,te,K=[],oe=0;oe<j;oe++){var le=Tb(z[oe]);le!==0&&(te===void 0&&(te=le<0),te===le<0?(G&&K.push(G),G=[z[oe]]):G.push(z[oe]))}return G&&K.push(G),K})(g),a=0;a<g.length;a++)for(l=0;l<g[a].length;l++)S(g[a][l])}g.length===1?g=g[0]:b="Multi"+b;var C={type:"Feature",geometry:{type:b,coordinates:g},properties:this.properties};return"id"in this&&(C.id=this.id),C};var xm=bm;function bm(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Ab,this,t),this.length=this._features.length}function Ab(e,t,r){e===15?t.version=r.readVarint():e===1?t.name=r.readString():e===5?t.extent=r.readVarint():e===2?t._features.push(r.pos):e===3?t._keys.push(r.readString()):e===4&&t._values.push((function(a){for(var l=null,c=a.readVarint()+a.pos;a.pos<c;){var h=a.readVarint()>>3;l=h===1?a.readString():h===2?a.readFloat():h===3?a.readDouble():h===4?a.readVarint64():h===5?a.readVarint():h===6?a.readSVarint():h===7?a.readBoolean():null}return l})(r))}function Eb(e,t,r){if(e===3){var a=new xm(r,r.readVarint()+r.pos);a.length&&(t[a.name]=a)}}bm.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new _m(this._pbf,t,this.extent,this._keys,this._values)};var Ss={VectorTile:function(e,t){this.layers=e.readFields(Eb,{},t)},VectorTileFeature:_m,VectorTileLayer:xm},Pb=Ss.VectorTileFeature.types,Yc=Math.pow(2,13);function Mu(e,t,r,a,l,c,h,m){e.emplaceBack(t,r,2*Math.floor(a*Yc)+h,l*Yc*2,c*Yc*2,Math.round(m))}var qn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Fn,this.indexArray=new to,this.programConfigurations=new ct(e.layers,e.zoom),this.segments=new F,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Cb(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}qn.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=Kc("fill-extrusion",this.layers,t);for(var a=0,l=e;a<l.length;a+=1){var c=l[a],h=c.feature,m=c.id,g=c.index,b=c.sourceLayerIndex,S=this.layers[0]._featureFilter.needGeometry,I=Mr(h,S);if(this.layers[0]._featureFilter.filter(new kt(this.zoom),I,r)){var C={id:m,sourceLayerIndex:b,index:g,geometry:S?I.geometry:wr(h),properties:h.properties,type:h.type,patterns:{}};this.hasPattern?this.features.push(Jc("fill-extrusion",this.layers,C,this.zoom,t)):this.addFeature(C,C.geometry,g,r,{}),t.featureIndex.insert(h,C.geometry,g,b,this.index,!0)}}},qn.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.features;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},qn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},qn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},qn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},qn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Sb),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},qn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},qn.prototype.addFeature=function(e,t,r,a,l){for(var c=0,h=Xc(t,500);c<h.length;c+=1){for(var m=h[c],g=0,b=0,S=m;b<S.length;b+=1)g+=S[b].length;for(var I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),C=0,z=m;C<z.length;C+=1){var j=z[C];if(j.length!==0&&!((Tt=j).every((function(vt){return vt.x<0}))||Tt.every((function(vt){return vt.x>8192}))||Tt.every((function(vt){return vt.y<0}))||Tt.every((function(vt){return vt.y>8192}))))for(var G=0,te=0;te<j.length;te++){var K=j[te];if(te>=1){var oe=j[te-1];if(!Cb(K,oe)){I.vertexLength+4>F.MAX_VERTEX_ARRAY_LENGTH&&(I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var le=K.sub(oe)._perp()._unit(),ce=oe.dist(K);G+ce>32768&&(G=0),Mu(this.layoutVertexArray,K.x,K.y,le.x,le.y,0,0,G),Mu(this.layoutVertexArray,K.x,K.y,le.x,le.y,0,1,G),Mu(this.layoutVertexArray,oe.x,oe.y,le.x,le.y,0,0,G+=ce),Mu(this.layoutVertexArray,oe.x,oe.y,le.x,le.y,0,1,G);var he=I.vertexLength;this.indexArray.emplaceBack(he,he+2,he+1),this.indexArray.emplaceBack(he+1,he+2,he+3),I.vertexLength+=4,I.primitiveLength+=2}}}}if(I.vertexLength+g>F.MAX_VERTEX_ARRAY_LENGTH&&(I=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray)),Pb[e.type]==="Polygon"){for(var xe=[],Pe=[],ze=I.vertexLength,rt=0,Oe=m;rt<Oe.length;rt+=1){var ot=Oe[rt];if(ot.length!==0){ot!==m[0]&&Pe.push(xe.length/2);for(var qe=0;qe<ot.length;qe++){var bt=ot[qe];Mu(this.layoutVertexArray,bt.x,bt.y,0,0,1,1,0),xe.push(bt.x),xe.push(bt.y)}}}for(var pt=$c(xe,Pe),Qe=0;Qe<pt.length;Qe+=3)this.indexArray.emplaceBack(ze+pt[Qe],ze+pt[Qe+2],ze+pt[Qe+1]);I.primitiveLength+=pt.length/3,I.vertexLength+=g}}var Tt;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},Xe("FillExtrusionBucket",qn,{omit:["layers","features"]});var kb={paint:new vi({"fill-extrusion-opacity":new it(L["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ye(L["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new it(L["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new it(L["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ds(L["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ye(L["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ye(L["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new it(L["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Mb=(function(e){function t(r){e.call(this,r,kb)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new qn(r)},t.prototype.queryRadius=function(){return Yr(this.paint.get("fill-extrusion-translate"))},t.prototype.is3D=function(){return!0},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g,b){var S=On(r,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),m.angle,g),I=this.paint.get("fill-extrusion-height").evaluate(a,l),C=this.paint.get("fill-extrusion-base").evaluate(a,l),z=(function(G,te,K,oe){for(var le=[],ce=0,he=G;ce<he.length;ce+=1){var xe=he[ce],Pe=[xe.x,xe.y,0,1];_s(Pe,Pe,te),le.push(new X(Pe[0]/Pe[3],Pe[1]/Pe[3]))}return le})(S,b),j=(function(G,te,K,oe){for(var le=[],ce=[],he=oe[8]*te,xe=oe[9]*te,Pe=oe[10]*te,ze=oe[11]*te,rt=oe[8]*K,Oe=oe[9]*K,ot=oe[10]*K,qe=oe[11]*K,bt=0,pt=G;bt<pt.length;bt+=1){for(var Qe=[],Tt=[],vt=0,Lt=pt[bt];vt<Lt.length;vt+=1){var at=Lt[vt],Vt=at.x,_r=at.y,Tr=oe[0]*Vt+oe[4]*_r+oe[12],Sr=oe[1]*Vt+oe[5]*_r+oe[13],xr=oe[2]*Vt+oe[6]*_r+oe[14],Ar=oe[3]*Vt+oe[7]*_r+oe[15],Qr=xr+Pe,ei=Ar+ze,Ci=Tr+rt,li=Sr+Oe,ki=xr+ot,Br=Ar+qe,ci=new X((Tr+he)/ei,(Sr+xe)/ei);ci.z=Qr/ei,Qe.push(ci);var Bt=new X(Ci/Br,li/Br);Bt.z=ki/Br,Tt.push(Bt)}le.push(Qe),ce.push(Tt)}return[le,ce]})(c,C,I,b);return(function(G,te,K){var oe=1/0;wn(K,te)&&(oe=wm(K,te[0]));for(var le=0;le<te.length;le++)for(var ce=te[le],he=G[le],xe=0;xe<ce.length-1;xe++){var Pe=ce[xe],ze=[Pe,ce[xe+1],he[xe+1],he[xe],Pe];no(K,ze)&&(oe=Math.min(oe,wm(K,ze)))}return oe!==1/0&&oe})(j[0],j[1],z)},t})(An);function Bu(e,t){return e.x*t.x+e.y*t.y}function wm(e,t){if(e.length===1){for(var r,a=0,l=t[a++];!r||l.equals(r);)if(!(r=t[a++]))return 1/0;for(;a<t.length;a++){var c=t[a],h=e[0],m=r.sub(l),g=c.sub(l),b=h.sub(l),S=Bu(m,m),I=Bu(m,g),C=Bu(g,g),z=Bu(b,m),j=Bu(b,g),G=S*C-I*I,te=(C*z-I*j)/G,K=(S*j-I*z)/G,oe=l.z*(1-te-K)+r.z*te+c.z*K;if(isFinite(oe))return oe}return 1/0}for(var le=1/0,ce=0,he=t;ce<he.length;ce+=1)le=Math.min(le,he[ce].z);return le}var Bb=ai([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,zb=ai([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,Db=Ss.VectorTileFeature.types,Rb=Math.cos(Math.PI/180*37.5),Sm=Math.pow(2,14)/.5,Fi=function(e){var t=this;this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(r){return r.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(r){t.gradients[r.id]={}})),this.layoutVertexArray=new Zi,this.layoutVertexArray2=new ta,this.indexArray=new to,this.programConfigurations=new ct(e.layers,e.zoom),this.segments=new F,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(r){return r.isStateDependent()})).map((function(r){return r.id}))};Fi.prototype.populate=function(e,t,r){this.hasPattern=Kc("line",this.layers,t);for(var a=this.layers[0].layout.get("line-sort-key"),l=[],c=0,h=e;c<h.length;c+=1){var m=h[c],g=m.feature,b=m.id,S=m.index,I=m.sourceLayerIndex,C=this.layers[0]._featureFilter.needGeometry,z=Mr(g,C);if(this.layers[0]._featureFilter.filter(new kt(this.zoom),z,r)){var j=a?a.evaluate(z,{},r):void 0,G={id:b,properties:g.properties,type:g.type,sourceLayerIndex:I,index:S,geometry:C?z.geometry:wr(g),patterns:{},sortKey:j};l.push(G)}}a&&l.sort((function(Pe,ze){return Pe.sortKey-ze.sortKey}));for(var te=0,K=l;te<K.length;te+=1){var oe=K[te],le=oe.geometry,ce=oe.index,he=oe.sourceLayerIndex;if(this.hasPattern){var xe=Jc("line",this.layers,oe,this.zoom,t);this.patternFeatures.push(xe)}else this.addFeature(oe,le,ce,r,{});t.featureIndex.insert(e[ce].feature,le,ce,he,this.index)}},Fi.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Fi.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.patternFeatures;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},Fi.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Fi.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Fi.prototype.upload=function(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,zb)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Bb),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},Fi.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Fi.prototype.lineFeatureClips=function(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}},Fi.prototype.addFeature=function(e,t,r,a,l){var c=this.layers[0].layout,h=c.get("line-join").evaluate(e,{}),m=c.get("line-cap"),g=c.get("line-miter-limit"),b=c.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(var S=0,I=t;S<I.length;S+=1)this.addLine(I[S],e,h,m,g,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},Fi.prototype.addLine=function(e,t,r,a,l,c){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var h=0;h<e.length-1;h++)this.totalDistance+=e[h].dist(e[h+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var m=Db[t.type]==="Polygon",g=e.length;g>=2&&e[g-1].equals(e[g-2]);)g--;for(var b=0;b<g-1&&e[b].equals(e[b+1]);)b++;if(!(g<(m?3:2))){r==="bevel"&&(l=1.05);var S,I=this.overscaling<=16?122880/(512*this.overscaling):0,C=this.segments.prepareSegment(10*g,this.layoutVertexArray,this.indexArray),z=void 0,j=void 0,G=void 0,te=void 0;this.e1=this.e2=-1,m&&(te=e[b].sub(S=e[g-2])._unit()._perp());for(var K=b;K<g;K++)if(!(j=K===g-1?m?e[b+1]:void 0:e[K+1])||!e[K].equals(j)){te&&(G=te),S&&(z=S),S=e[K],te=j?j.sub(S)._unit()._perp():G;var oe=(G=G||te).add(te);oe.x===0&&oe.y===0||oe._unit();var le=G.x*te.x+G.y*te.y,ce=oe.x*te.x+oe.y*te.y,he=ce!==0?1/ce:1/0,xe=2*Math.sqrt(2-2*ce),Pe=ce<Rb&&z&&j,ze=G.x*te.y-G.y*te.x>0;if(Pe&&K>b){var rt=S.dist(z);if(rt>2*I){var Oe=S.sub(S.sub(z)._mult(I/rt)._round());this.updateDistance(z,Oe),this.addCurrentVertex(Oe,G,0,0,C),z=Oe}}var ot=z&&j,qe=ot?r:m?"butt":a;if(ot&&qe==="round"&&(he<c?qe="miter":he<=2&&(qe="fakeround")),qe==="miter"&&he>l&&(qe="bevel"),qe==="bevel"&&(he>2&&(qe="flipbevel"),he<l&&(qe="miter")),z&&this.updateDistance(z,S),qe==="miter")oe._mult(he),this.addCurrentVertex(S,oe,0,0,C);else if(qe==="flipbevel"){if(he>100)oe=te.mult(-1);else{var bt=he*G.add(te).mag()/G.sub(te).mag();oe._perp()._mult(bt*(ze?-1:1))}this.addCurrentVertex(S,oe,0,0,C),this.addCurrentVertex(S,oe.mult(-1),0,0,C)}else if(qe==="bevel"||qe==="fakeround"){var pt=-Math.sqrt(he*he-1),Qe=ze?pt:0,Tt=ze?0:pt;if(z&&this.addCurrentVertex(S,G,Qe,Tt,C),qe==="fakeround")for(var vt=Math.round(180*xe/Math.PI/20),Lt=1;Lt<vt;Lt++){var at=Lt/vt;if(at!==.5){var Vt=at-.5;at+=at*Vt*(at-1)*((1.0904+le*(le*(3.55645-1.43519*le)-3.2452))*Vt*Vt+(.848013+le*(.215638*le-1.06021)))}var _r=te.sub(G)._mult(at)._add(G)._unit()._mult(ze?-1:1);this.addHalfVertex(S,_r.x,_r.y,!1,ze,0,C)}j&&this.addCurrentVertex(S,te,-Qe,-Tt,C)}else if(qe==="butt")this.addCurrentVertex(S,oe,0,0,C);else if(qe==="square"){var Tr=z?1:-1;this.addCurrentVertex(S,oe,Tr,Tr,C)}else qe==="round"&&(z&&(this.addCurrentVertex(S,G,0,0,C),this.addCurrentVertex(S,G,1,1,C,!0)),j&&(this.addCurrentVertex(S,te,-1,-1,C,!0),this.addCurrentVertex(S,te,0,0,C)));if(Pe&&K<g-1){var Sr=S.dist(j);if(Sr>2*I){var xr=S.add(j.sub(S)._mult(I/Sr)._round());this.updateDistance(S,xr),this.addCurrentVertex(xr,te,0,0,C),S=xr}}}}},Fi.prototype.addCurrentVertex=function(e,t,r,a,l,c){c===void 0&&(c=!1);var h=t.y*a-t.x,m=-t.y-t.x*a;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,c,!1,r,l),this.addHalfVertex(e,h,m,c,!0,-a,l),this.distance>Sm/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(e,t,r,a,l,c))},Fi.prototype.addHalfVertex=function(e,t,r,a,l,c,h){var m=.5*(this.lineClips?this.scaledDistance*(Sm-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e.x<<1)+(a?1:0),(e.y<<1)+(l?1:0),Math.round(63*t)+128,Math.round(63*r)+128,1+(c===0?0:c<0?-1:1)|(63&m)<<2,m>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var g=h.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,g),h.primitiveLength++),l?this.e2=g:this.e1=g},Fi.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Fi.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},Xe("LineBucket",Fi,{omit:["layers","patternFeatures"]});var Lb=new vi({"line-cap":new it(L.layout_line["line-cap"]),"line-join":new Ye(L.layout_line["line-join"]),"line-miter-limit":new it(L.layout_line["line-miter-limit"]),"line-round-limit":new it(L.layout_line["line-round-limit"]),"line-sort-key":new Ye(L.layout_line["line-sort-key"])}),Im={paint:new vi({"line-opacity":new Ye(L.paint_line["line-opacity"]),"line-color":new Ye(L.paint_line["line-color"]),"line-translate":new it(L.paint_line["line-translate"]),"line-translate-anchor":new it(L.paint_line["line-translate-anchor"]),"line-width":new Ye(L.paint_line["line-width"]),"line-gap-width":new Ye(L.paint_line["line-gap-width"]),"line-offset":new Ye(L.paint_line["line-offset"]),"line-blur":new Ye(L.paint_line["line-blur"]),"line-dasharray":new Ai(L.paint_line["line-dasharray"]),"line-pattern":new ds(L.paint_line["line-pattern"]),"line-gradient":new bn(L.paint_line["line-gradient"])}),layout:Lb},Tm=new((function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a){return a=new kt(Math.floor(a.zoom),{now:a.now,fadeDuration:a.fadeDuration,zoomHistory:a.zoomHistory,transition:a.transition}),e.prototype.possiblyEvaluate.call(this,r,a)},t.prototype.evaluate=function(r,a,l,c){return a=Ue({},a,{zoom:Math.floor(a.zoom)}),e.prototype.evaluate.call(this,r,a,l,c)},t})(Ye))(Im.paint.properties["line-width"].specification);Tm.useIntegerZoom=!0;var Fb=(function(e){function t(r){e.call(this,r,Im),this.gradientVersion=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Ui,this.gradientVersion=(this.gradientVersion+1)%Se)},t.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a),this.paint._values["line-floorwidth"]=Tm.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,r)},t.prototype.createBucket=function(r){return new Fi(r)},t.prototype.queryRadius=function(r){var a=r,l=Am(Cn("line-width",this,a),Cn("line-gap-width",this,a)),c=Cn("line-offset",this,a);return l/2+Math.abs(c)+Yr(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g){var b=On(r,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),m.angle,g),S=g/2*Am(this.paint.get("line-width").evaluate(a,l),this.paint.get("line-gap-width").evaluate(a,l)),I=this.paint.get("line-offset").evaluate(a,l);return I&&(c=(function(C,z){for(var j=[],G=new X(0,0),te=0;te<C.length;te++){for(var K=C[te],oe=[],le=0;le<K.length;le++){var ce=K[le],he=K[le+1],xe=le===0?G:ce.sub(K[le-1])._unit()._perp(),Pe=le===K.length-1?G:he.sub(ce)._unit()._perp(),ze=xe._add(Pe)._unit();ze._mult(1/(ze.x*Pe.x+ze.y*Pe.y)),oe.push(ze._mult(z)._add(ce))}j.push(oe)}return j})(c,I*g)),(function(C,z,j){for(var G=0;G<z.length;G++){var te=z[G];if(C.length>=3){for(var K=0;K<te.length;K++)if(Pn(C,te[K]))return!0}if(cn(C,te,j))return!0}return!1})(b,c,S)},t.prototype.isTileClipped=function(){return!0},t})(An);function Am(e,t){return t>0?t+2*e:e}var Ob=ai([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Vb=ai([{name:"a_projected_pos",components:3,type:"Float32"}],4),qb=(ai([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),ai([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Em=(ai([{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"}]),ai([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Ub=ai([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Nb(e,t,r){return e.sections.forEach((function(a){a.text=(function(l,c,h){var m=c.layout.get("text-transform").evaluate(h,{});return m==="uppercase"?l=l.toLocaleUpperCase():m==="lowercase"&&(l=l.toLocaleLowerCase()),Qi.applyArabicShaping&&(l=Qi.applyArabicShaping(l)),l})(a.text,t,r)})),e}ai([{name:"triangle",components:3,type:"Uint16"}]),ai([{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"}]),ai([{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"}]),ai([{type:"Float32",name:"offsetX"}]),ai([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var zu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Pm=function(e,t,r,a,l){var c,h,m=8*l-a-1,g=(1<<m)-1,b=g>>1,S=-7,I=l-1,C=-1,z=e[t+I];for(I+=C,c=z&(1<<-S)-1,z>>=-S,S+=m;S>0;c=256*c+e[t+I],I+=C,S-=8);for(h=c&(1<<-S)-1,c>>=-S,S+=a;S>0;h=256*h+e[t+I],I+=C,S-=8);if(c===0)c=1-b;else{if(c===g)return h?NaN:1/0*(z?-1:1);h+=Math.pow(2,a),c-=b}return(z?-1:1)*h*Math.pow(2,c-a)},Cm=function(e,t,r,a,l,c){var h,m,g,b=8*c-l-1,S=(1<<b)-1,I=S>>1,C=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=0,j=1,G=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,h=S):(h=Math.floor(Math.log(t)/Math.LN2),t*(g=Math.pow(2,-h))<1&&(h--,g*=2),(t+=h+I>=1?C/g:C*Math.pow(2,1-I))*g>=2&&(h++,g/=2),h+I>=S?(m=0,h=S):h+I>=1?(m=(t*g-1)*Math.pow(2,l),h+=I):(m=t*Math.pow(2,I-1)*Math.pow(2,l),h=0));l>=8;e[r+z]=255&m,z+=j,m/=256,l-=8);for(h=h<<l|m,b+=l;b>0;e[r+z]=255&h,z+=j,h/=256,b-=8);e[r+z-j]|=128*G},Nl=cr;function cr(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}cr.Varint=0,cr.Fixed64=1,cr.Bytes=2,cr.Fixed32=5;var km=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Lo(e){return e.type===cr.Bytes?e.readVarint()+e.pos:e.pos+1}function Is(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function Mm(e,t,r){var a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(a);for(var l=r.pos-1;l>=e;l--)r.buf[l+a]=r.buf[l]}function jb(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function Gb(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function $b(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function Zb(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function Wb(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Hb(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Xb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Kb(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function Jb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function jl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function Ts(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function Bm(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Yb(e,t,r){e===1&&r.readMessage(Qb,t)}function Qb(e,t,r){if(e===3){var a=r.readMessage(e0,{}),l=a.width,c=a.height,h=a.left,m=a.top,g=a.advance;t.push({id:a.id,bitmap:new Va({width:l+6,height:c+6},a.bitmap),metrics:{width:l,height:c,left:h,top:m,advance:g}})}}function e0(e,t,r){e===1?t.id=r.readVarint():e===2?t.bitmap=r.readBytes():e===3?t.width=r.readVarint():e===4?t.height=r.readVarint():e===5?t.left=r.readSVarint():e===6?t.top=r.readSVarint():e===7&&(t.advance=r.readVarint())}function zm(e){for(var t=0,r=0,a=0,l=e;a<l.length;a+=1){var c=l[a];t+=c.w*c.h,r=Math.max(r,c.w)}e.sort((function(G,te){return te.h-G.h}));for(var h=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],m=0,g=0,b=0,S=e;b<S.length;b+=1)for(var I=S[b],C=h.length-1;C>=0;C--){var z=h[C];if(!(I.w>z.w||I.h>z.h)){if(I.x=z.x,I.y=z.y,g=Math.max(g,I.y+I.h),m=Math.max(m,I.x+I.w),I.w===z.w&&I.h===z.h){var j=h.pop();C<h.length&&(h[C]=j)}else I.h===z.h?(z.x+=I.w,z.w-=I.w):I.w===z.w?(z.y+=I.h,z.h-=I.h):(h.push({x:z.x+I.w,y:z.y,w:z.w-I.w,h:I.h}),z.y+=I.h,z.h-=I.h);break}}return{w:m,h:g,fill:t/(m*g)||0}}cr.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var a=this.readVarint(),l=a>>3,c=this.pos;this.type=7&a,e(l,t,this),this.pos===c&&this.skip(a)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=jl(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Bm(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=jl(this.buf,this.pos)+4294967296*jl(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=jl(this.buf,this.pos)+4294967296*Bm(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=Pm(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Pm(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,a=this.buf;return t=127&(r=a[this.pos++]),r<128?t:(t|=(127&(r=a[this.pos++]))<<7,r<128?t:(t|=(127&(r=a[this.pos++]))<<14,r<128?t:(t|=(127&(r=a[this.pos++]))<<21,r<128?t:(function(l,c,h){var m,g,b=h.buf;if(m=(112&(g=b[h.pos++]))>>4,g<128||(m|=(127&(g=b[h.pos++]))<<3,g<128)||(m|=(127&(g=b[h.pos++]))<<10,g<128)||(m|=(127&(g=b[h.pos++]))<<17,g<128)||(m|=(127&(g=b[h.pos++]))<<24,g<128)||(m|=(1&(g=b[h.pos++]))<<31,g<128))return Is(l,m,c);throw new Error("Expected varint not more than 10 bytes")})(t|=(15&(r=a[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&km?(function(r,a,l){return km.decode(r.subarray(a,l))})(this.buf,t,e):(function(r,a,l){for(var c="",h=a;h<l;){var m,g,b,S=r[h],I=null,C=S>239?4:S>223?3:S>191?2:1;if(h+C>l)break;C===1?S<128&&(I=S):C===2?(192&(m=r[h+1]))==128&&(I=(31&S)<<6|63&m)<=127&&(I=null):C===3?(g=r[h+2],(192&(m=r[h+1]))==128&&(192&g)==128&&((I=(15&S)<<12|(63&m)<<6|63&g)<=2047||I>=55296&&I<=57343)&&(I=null)):C===4&&(g=r[h+2],b=r[h+3],(192&(m=r[h+1]))==128&&(192&g)==128&&(192&b)==128&&((I=(15&S)<<18|(63&m)<<12|(63&g)<<6|63&b)<=65535||I>=1114112)&&(I=null)),I===null?(I=65533,C=1):I>65535&&(I-=65536,c+=String.fromCharCode(I>>>10&1023|55296),I=56320|1023&I),c+=String.fromCharCode(I),h+=C}return c})(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==cr.Bytes)return e.push(this.readVarint(t));var r=Lo(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==cr.Bytes)return e.push(this.readSVarint());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==cr.Bytes)return e.push(this.readBoolean());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==cr.Bytes)return e.push(this.readFloat());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==cr.Bytes)return e.push(this.readDouble());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==cr.Bytes)return e.push(this.readFixed32());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==cr.Bytes)return e.push(this.readSFixed32());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==cr.Bytes)return e.push(this.readFixed64());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==cr.Bytes)return e.push(this.readSFixed64());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===cr.Varint)for(;this.buf[this.pos++]>127;);else if(t===cr.Bytes)this.pos=this.readVarint()+this.pos;else if(t===cr.Fixed32)this.pos+=4;else{if(t!==cr.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Ts(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Ts(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Ts(this.buf,-1&e,this.pos),Ts(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Ts(this.buf,-1&e,this.pos),Ts(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?(function(t,r){var a,l;if(t>=0?(a=t%4294967296|0,l=t/4294967296|0):(l=~(-t/4294967296),4294967295^(a=~(-t%4294967296))?a=a+1|0:(a=0,l=l+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),(function(c,h,m){m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,m.buf[m.pos]=127&(c>>>=7)})(a,0,r),(function(c,h){var m=(7&c)<<4;h.buf[h.pos++]|=m|((c>>>=3)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c)))))})(l,r)})(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(!!e)},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=(function(a,l,c){for(var h,m,g=0;g<l.length;g++){if((h=l.charCodeAt(g))>55295&&h<57344){if(!m){h>56319||g+1===l.length?(a[c++]=239,a[c++]=191,a[c++]=189):m=h;continue}if(h<56320){a[c++]=239,a[c++]=191,a[c++]=189,m=h;continue}h=m-55296<<10|h-56320|65536,m=null}else m&&(a[c++]=239,a[c++]=191,a[c++]=189,m=null);h<128?a[c++]=h:(h<2048?a[c++]=h>>6|192:(h<65536?a[c++]=h>>12|224:(a[c++]=h>>18|240,a[c++]=h>>12&63|128),a[c++]=h>>6&63|128),a[c++]=63&h|128)}return c})(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Mm(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Cm(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Cm(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var a=this.pos-r;a>=128&&Mm(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(e,t,r){this.writeTag(e,cr.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,jb,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Gb,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Wb,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,$b,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Zb,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Hb,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Xb,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Kb,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Jb,t)},writeBytesField:function(e,t){this.writeTag(e,cr.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,cr.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,cr.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,cr.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,cr.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,cr.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,cr.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,cr.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,cr.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,cr.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};var Gl=function(e,t){var r=t.pixelRatio,a=t.version,l=t.stretchX,c=t.stretchY,h=t.content;this.paddedRect=e,this.pixelRatio=r,this.stretchX=l,this.stretchY=c,this.content=h,this.version=a},Du={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Du.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Du.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Du.tlbr.get=function(){return this.tl.concat(this.br)},Du.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Gl.prototype,Du);var Ru=function(e,t){var r={},a={};this.haveRenderCallbacks=[];var l=[];this.addImages(e,r,l),this.addImages(t,a,l);var c=zm(l),h=new Hi({width:c.w||1,height:c.h||1});for(var m in e){var g=e[m],b=r[m].paddedRect;Hi.copy(g.data,h,{x:0,y:0},{x:b.x+1,y:b.y+1},g.data)}for(var S in t){var I=t[S],C=a[S].paddedRect,z=C.x+1,j=C.y+1,G=I.data.width,te=I.data.height;Hi.copy(I.data,h,{x:0,y:0},{x:z,y:j},I.data),Hi.copy(I.data,h,{x:0,y:te-1},{x:z,y:j-1},{width:G,height:1}),Hi.copy(I.data,h,{x:0,y:0},{x:z,y:j+te},{width:G,height:1}),Hi.copy(I.data,h,{x:G-1,y:0},{x:z-1,y:j},{width:1,height:te}),Hi.copy(I.data,h,{x:0,y:0},{x:z+G,y:j},{width:1,height:te})}this.image=h,this.iconPositions=r,this.patternPositions=a};Ru.prototype.addImages=function(e,t,r){for(var a in e){var l=e[a],c={x:0,y:0,w:l.data.width+2,h:l.data.height+2};r.push(c),t[a]=new Gl(c,l),l.hasRenderCallback&&this.haveRenderCallbacks.push(a)}},Ru.prototype.patchUpdatedImages=function(e,t){for(var r in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)},Ru.prototype.patchUpdatedImage=function(e,t,r){if(e&&t&&e.version!==t.version){e.version=t.version;var a=e.tl;r.update(t.data,void 0,{x:a[0],y:a[1]})}},Xe("ImagePosition",Gl),Xe("ImageAtlas",Ru);var pn={horizontal:1,vertical:2,horizontalOnly:3},As=function(){this.scale=1,this.fontStack="",this.imageName=null};As.forText=function(e,t){var r=new As;return r.scale=e||1,r.fontStack=t,r},As.forImage=function(e){var t=new As;return t.imageName=e,t};var Pi=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function $l(e,t,r,a,l,c,h,m,g,b,S,I,C,z,j,G){var te,K=Pi.fromFeature(e,l);I===pn.vertical&&K.verticalizePunctuation();var oe=Qi.processBidirectionalText,le=Qi.processStyledBidirectionalText;if(oe&&K.sections.length===1){te=[];for(var ce=0,he=oe(K.toString(),Qc(K,b,c,t,a,z,j));ce<he.length;ce+=1){var xe=he[ce],Pe=new Pi;Pe.text=xe,Pe.sections=K.sections;for(var ze=0;ze<xe.length;ze++)Pe.sectionIndex.push(0);te.push(Pe)}}else if(le){te=[];for(var rt=0,Oe=le(K.text,K.sectionIndex,Qc(K,b,c,t,a,z,j));rt<Oe.length;rt+=1){var ot=Oe[rt],qe=new Pi;qe.text=ot[0],qe.sectionIndex=ot[1],qe.sections=K.sections,te.push(qe)}}else te=(function(Qe,Tt){for(var vt=[],Lt=Qe.text,at=0,Vt=0,_r=Tt;Vt<_r.length;Vt+=1){var Tr=_r[Vt];vt.push(Qe.substring(at,Tr)),at=Tr}return at<Lt.length&&vt.push(Qe.substring(at,Lt.length)),vt})(K,Qc(K,b,c,t,a,z,j));var bt=[],pt={positionedLines:bt,text:K.toString(),top:S[1],bottom:S[1],left:S[0],right:S[0],writingMode:I,iconsInText:!1,verticalizable:!1};return(function(Qe,Tt,vt,Lt,at,Vt,_r,Tr,Sr,xr,Ar,Qr){for(var ei=0,Ci=-17,li=0,ki=0,Br=Tr==="right"?1:Tr==="left"?0:.5,ci=0,Bt=0,nr=at;Bt<nr.length;Bt+=1){var Jt=nr[Bt];Jt.trim();var Ot=Jt.getMaxScale(),Oi=24*(Ot-1),_i={positionedGlyphs:[],lineOffset:0};Qe.positionedLines[ci]=_i;var dr=_i.positionedGlyphs,Ur=0;if(Jt.length()){for(var xi=0;xi<Jt.length();xi++){var qt=Jt.getSection(xi),so=Jt.getSectionIndex(xi),hn=Jt.getCharCode(xi),uo=0,zr=null,lo=null,kn=null,Ds=24,ja=!(Sr===pn.horizontal||!Ar&&!ps(hn)||Ar&&(Zl[hn]||(qo=hn,Re.Arabic(qo)||Re["Arabic Supplement"](qo)||Re["Arabic Extended-A"](qo)||Re["Arabic Presentation Forms-A"](qo)||Re["Arabic Presentation Forms-B"](qo))));if(qt.imageName){var Rs=Lt[qt.imageName];if(!Rs)continue;kn=qt.imageName,Qe.iconsInText=Qe.iconsInText||!0,lo=Rs.paddedRect;var Vo=Rs.displaySize;qt.scale=24*qt.scale/Qr,uo=Oi+(24-Vo[1]*qt.scale),Ds=(zr={width:Vo[0],height:Vo[1],left:1,top:-3,advance:ja?Vo[1]:Vo[0]}).advance;var Ls=ja?Vo[0]*qt.scale-24*Ot:Vo[1]*qt.scale-24*Ot;Ls>0&&Ls>Ur&&(Ur=Ls)}else{var tc=vt[qt.fontStack],Fs=tc&&tc[hn];if(Fs&&Fs.rect)lo=Fs.rect,zr=Fs.metrics;else{var Ou=Tt[qt.fontStack],rc=Ou&&Ou[hn];if(!rc)continue;zr=rc.metrics}uo=24*(Ot-qt.scale)}ja?(Qe.verticalizable=!0,dr.push({glyph:hn,imageName:kn,x:ei,y:Ci+uo,vertical:ja,scale:qt.scale,fontStack:qt.fontStack,sectionIndex:so,metrics:zr,rect:lo}),ei+=Ds*qt.scale+xr):(dr.push({glyph:hn,imageName:kn,x:ei,y:Ci+uo,vertical:ja,scale:qt.scale,fontStack:qt.fontStack,sectionIndex:so,metrics:zr,rect:lo}),ei+=zr.advance*qt.scale+xr)}dr.length!==0&&(li=Math.max(ei-xr,li),r0(dr,0,dr.length-1,Br,Ur)),ei=0;var ic=Vt*Ot+Ur;_i.lineOffset=Math.max(Ur,Oi),Ci+=ic,ki=Math.max(ic,ki),++ci}else Ci+=Vt,++ci}var qo,Vu=Ci- -17,Os=ep(_r),la=Os.horizontalAlign,Vs=Os.verticalAlign;(function(nc,oc,qu,Uu,ac,Nu,ju,Gu,sc){var qs,uc=(oc-qu)*ac;qs=Nu!==ju?-Gu*Uu- -17:(-Uu*sc+.5)*ju;for(var Us=0,$u=nc;Us<$u.length;Us+=1)for(var Ga=0,Zu=$u[Us].positionedGlyphs;Ga<Zu.length;Ga+=1){var Ns=Zu[Ga];Ns.x+=uc,Ns.y+=qs}})(Qe.positionedLines,Br,la,Vs,li,ki,Vt,Vu,at.length),Qe.top+=-Vs*Vu,Qe.bottom=Qe.top+Vu,Qe.left+=-la*li,Qe.right=Qe.left+li})(pt,t,r,a,te,h,m,g,I,b,C,G),!(function(Qe){for(var Tt=0,vt=Qe;Tt<vt.length;Tt+=1)if(vt[Tt].positionedGlyphs.length!==0)return!1;return!0})(bt)&&pt}Pi.fromFeature=function(e,t){for(var r=new Pi,a=0;a<e.sections.length;a++){var l=e.sections[a];l.image?r.addImageSection(l):r.addTextSection(l,t)}return r},Pi.prototype.length=function(){return this.text.length},Pi.prototype.getSection=function(e){return this.sections[this.sectionIndex[e]]},Pi.prototype.getSectionIndex=function(e){return this.sectionIndex[e]},Pi.prototype.getCharCode=function(e){return this.text.charCodeAt(e)},Pi.prototype.verticalizePunctuation=function(){this.text=(function(e){for(var t="",r=0;r<e.length;r++){var a=e.charCodeAt(r+1)||null,l=e.charCodeAt(r-1)||null;t+=a&&gu(a)&&!zu[e[r+1]]||l&&gu(l)&&!zu[e[r-1]]||!zu[e[r]]?e[r]:zu[e[r]]}return t})(this.text)},Pi.prototype.trim=function(){for(var e=0,t=0;t<this.text.length&&Zl[this.text.charCodeAt(t)];t++)e++;for(var r=this.text.length,a=this.text.length-1;a>=0&&a>=e&&Zl[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},Pi.prototype.substring=function(e,t){var r=new Pi;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},Pi.prototype.toString=function(){return this.text},Pi.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce((function(t,r){return Math.max(t,e.sections[r].scale)}),0)},Pi.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(As.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,a=0;a<e.text.length;++a)this.sectionIndex.push(r)},Pi.prototype.addImageSection=function(e){var t=e.image?e.image.name:"";if(t.length!==0){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(As.forImage(t)),this.sectionIndex.push(this.sections.length-1)):St("Reached maximum number of images 6401")}else St("Can't add FormattedSection with an empty image.")},Pi.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Zl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},tn={};function Dm(e,t,r,a,l,c){if(t.imageName){var h=a[t.imageName];return h?h.displaySize[0]*t.scale*24/c+l:0}var m=r[t.fontStack],g=m&&m[e];return g?g.metrics.advance*t.scale+l:0}function Rm(e,t,r,a){var l=Math.pow(e-t,2);return a?e<t?l/2:2*l:l+Math.abs(r)*r}function t0(e,t,r){var a=0;return e===10&&(a-=1e4),r&&(a+=150),e!==40&&e!==65288||(a+=50),t!==41&&t!==65289||(a+=50),a}function Lm(e,t,r,a,l,c){for(var h=null,m=Rm(t,r,l,c),g=0,b=a;g<b.length;g+=1){var S=b[g],I=Rm(t-S.x,r,l,c)+S.badness;I<=m&&(h=S,m=I)}return{index:e,x:t,priorBreak:h,badness:m}}function Qc(e,t,r,a,l,c,h){if(c!=="point")return[];if(!e)return[];for(var m,g=[],b=(function(te,K,oe,le,ce,he){for(var xe=0,Pe=0;Pe<te.length();Pe++){var ze=te.getSection(Pe);xe+=Dm(te.getCharCode(Pe),ze,le,ce,K,he)}return xe/Math.max(1,Math.ceil(xe/oe))})(e,t,r,a,l,h),S=e.text.indexOf("")>=0,I=0,C=0;C<e.length();C++){var z=e.getSection(C),j=e.getCharCode(C);if(Zl[j]||(I+=Dm(j,z,a,l,t,h)),C<e.length()-1){var G=!((m=j)<11904||!(Re["Bopomofo Extended"](m)||Re.Bopomofo(m)||Re["CJK Compatibility Forms"](m)||Re["CJK Compatibility Ideographs"](m)||Re["CJK Compatibility"](m)||Re["CJK Radicals Supplement"](m)||Re["CJK Strokes"](m)||Re["CJK Symbols and Punctuation"](m)||Re["CJK Unified Ideographs Extension A"](m)||Re["CJK Unified Ideographs"](m)||Re["Enclosed CJK Letters and Months"](m)||Re["Halfwidth and Fullwidth Forms"](m)||Re.Hiragana(m)||Re["Ideographic Description Characters"](m)||Re["Kangxi Radicals"](m)||Re["Katakana Phonetic Extensions"](m)||Re.Katakana(m)||Re["Vertical Forms"](m)||Re["Yi Radicals"](m)||Re["Yi Syllables"](m)));(tn[j]||G||z.imageName)&&g.push(Lm(C+1,I,b,g,t0(j,e.getCharCode(C+1),G&&S),!1))}}return(function te(K){return K?te(K.priorBreak).concat(K.index):[]})(Lm(e.length(),I,b,g,0,!0))}function ep(e){var t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function r0(e,t,r,a,l){if(a||l)for(var c=e[r],h=(e[r].x+c.metrics.advance*c.scale)*a,m=t;m<=r;m++)e[m].x-=h,e[m].y+=l}function Fm(e,t,r,a,l,c){var h,m=e.image;if(m.content){var g=m.content,b=m.pixelRatio||1;h=[g[0]/b,g[1]/b,m.displaySize[0]-g[2]/b,m.displaySize[1]-g[3]/b]}var S,I,C,z,j=t.left*c,G=t.right*c;r==="width"||r==="both"?(z=l[0]+j-a[3],I=l[0]+G+a[1]):I=(z=l[0]+(j+G-m.displaySize[0])/2)+m.displaySize[0];var te=t.top*c,K=t.bottom*c;return r==="height"||r==="both"?(S=l[1]+te-a[0],C=l[1]+K+a[2]):C=(S=l[1]+(te+K-m.displaySize[1])/2)+m.displaySize[1],{image:m,top:S,right:I,bottom:C,left:z,collisionPadding:h}}tn[10]=!0,tn[32]=!0,tn[38]=!0,tn[40]=!0,tn[41]=!0,tn[43]=!0,tn[45]=!0,tn[47]=!0,tn[173]=!0,tn[183]=!0,tn[8203]=!0,tn[8208]=!0,tn[8211]=!0,tn[8231]=!0;var Es=(function(e){function t(r,a,l,c){e.call(this,r,a),this.angle=l,c!==void 0&&(this.segment=c)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.clone=function(){return new t(this.x,this.y,this.angle,this.segment)},t})(X);function tp(e,t){var r=t.expression;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new kt(e+1))};if(r.kind==="source")return{kind:"source"};for(var a=r.zoomStops,l=r.interpolationType,c=0;c<a.length&&a[c]<=e;)c++;for(var h=c=Math.max(0,c-1);h<a.length&&a[h]<e+1;)h++;h=Math.min(a.length-1,h);var m=a[c],g=a[h];return r.kind==="composite"?{kind:"composite",minZoom:m,maxZoom:g,interpolationType:l}:{kind:"camera",minZoom:m,maxZoom:g,minSize:r.evaluate(new kt(m)),maxSize:r.evaluate(new kt(g)),interpolationType:l}}function Om(e,t,r){var a=t.uSize,l=r.lowerSize;return e.kind==="source"?l/128:e.kind==="composite"?Vr(l/128,r.upperSize/128,t.uSizeT):a}function Vm(e,t){var r=0,a=0;if(e.kind==="constant")a=e.layoutSize;else if(e.kind!=="source"){var l=e.interpolationType,c=l?Ze(mi.interpolationFactor(l,t,e.minZoom,e.maxZoom),0,1):0;e.kind==="camera"?a=Vr(e.minSize,e.maxSize,c):r=c}return{uSizeT:r,uSize:a}}Xe("Anchor",Es);var i0=Object.freeze({__proto__:null,getSizeData:tp,evaluateSizeForFeature:Om,evaluateSizeForZoom:Vm,SIZE_PACK_FACTOR:128});function qm(e,t,r,a,l){if(t.segment===void 0)return!0;for(var c=t,h=t.segment+1,m=0;m>-r/2;){if(--h<0)return!1;m-=e[h].dist(c),c=e[h]}m+=e[h].dist(e[h+1]),h++;for(var g=[],b=0;m<r/2;){var S=e[h],I=e[h+1];if(!I)return!1;var C=e[h-1].angleTo(S)-S.angleTo(I);for(C=Math.abs((C+3*Math.PI)%(2*Math.PI)-Math.PI),g.push({distance:m,angleDelta:C}),b+=C;m-g[0].distance>a;)b-=g.shift().angleDelta;if(b>l)return!1;h++,m+=S.dist(I)}return!0}function Um(e){for(var t=0,r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function Nm(e,t,r){return e?.6*t*r:0}function jm(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function n0(e,t,r,a,l,c){for(var h=Nm(r,l,c),m=jm(r,a)*c,g=0,b=Um(e)/2,S=0;S<e.length-1;S++){var I=e[S],C=e[S+1],z=I.dist(C);if(g+z>b){var j=(b-g)/z,G=Vr(I.x,C.x,j),te=Vr(I.y,C.y,j),K=new Es(G,te,C.angleTo(I),S);return K._round(),!h||qm(e,K,m,h,t)?K:void 0}g+=z}}function o0(e,t,r,a,l,c,h,m,g){var b=Nm(a,c,h),S=jm(a,l),I=S*h,C=e[0].x===0||e[0].x===g||e[0].y===0||e[0].y===g;return t-I<t/4&&(t=I+t/4),(function z(j,G,te,K,oe,le,ce,he,xe){for(var Pe=le/2,ze=Um(j),rt=0,Oe=G-te,ot=[],qe=0;qe<j.length-1;qe++){for(var bt=j[qe],pt=j[qe+1],Qe=bt.dist(pt),Tt=pt.angleTo(bt);Oe+te<rt+Qe;){var vt=((Oe+=te)-rt)/Qe,Lt=Vr(bt.x,pt.x,vt),at=Vr(bt.y,pt.y,vt);if(Lt>=0&&Lt<xe&&at>=0&&at<xe&&Oe-Pe>=0&&Oe+Pe<=ze){var Vt=new Es(Lt,at,Tt,qe);Vt._round(),K&&!qm(j,Vt,le,K,oe)||ot.push(Vt)}}rt+=Qe}return he||ot.length||ce||(ot=z(j,rt/2,te,K,oe,le,ce,!0,xe)),ot})(e,C?t/2*m%t:(S/2+2*c)*h*m%t,t,b,r,I,C,!1,g)}function Gm(e,t,r,a,l){for(var c=[],h=0;h<e.length;h++)for(var m=e[h],g=void 0,b=0;b<m.length-1;b++){var S=m[b],I=m[b+1];S.x<t&&I.x<t||(S.x<t?S=new X(t,S.y+(t-S.x)/(I.x-S.x)*(I.y-S.y))._round():I.x<t&&(I=new X(t,S.y+(t-S.x)/(I.x-S.x)*(I.y-S.y))._round()),S.y<r&&I.y<r||(S.y<r?S=new X(S.x+(r-S.y)/(I.y-S.y)*(I.x-S.x),r)._round():I.y<r&&(I=new X(S.x+(r-S.y)/(I.y-S.y)*(I.x-S.x),r)._round()),S.x>=a&&I.x>=a||(S.x>=a?S=new X(a,S.y+(a-S.x)/(I.x-S.x)*(I.y-S.y))._round():I.x>=a&&(I=new X(a,S.y+(a-S.x)/(I.x-S.x)*(I.y-S.y))._round()),S.y>=l&&I.y>=l||(S.y>=l?S=new X(S.x+(l-S.y)/(I.y-S.y)*(I.x-S.x),l)._round():I.y>=l&&(I=new X(S.x+(l-S.y)/(I.y-S.y)*(I.x-S.x),l)._round()),g&&S.equals(g[g.length-1])||c.push(g=[S]),g.push(I)))))}return c}function $m(e,t,r,a){var l=[],c=e.image,h=c.pixelRatio,m=c.paddedRect.w-2,g=c.paddedRect.h-2,b=e.right-e.left,S=e.bottom-e.top,I=c.stretchX||[[0,m]],C=c.stretchY||[[0,g]],z=function(Lt,at){return Lt+at[1]-at[0]},j=I.reduce(z,0),G=C.reduce(z,0),te=m-j,K=g-G,oe=0,le=j,ce=0,he=G,xe=0,Pe=te,ze=0,rt=K;if(c.content&&a){var Oe=c.content;oe=Wl(I,0,Oe[0]),ce=Wl(C,0,Oe[1]),le=Wl(I,Oe[0],Oe[2]),he=Wl(C,Oe[1],Oe[3]),xe=Oe[0]-oe,ze=Oe[1]-ce,Pe=Oe[2]-Oe[0]-le,rt=Oe[3]-Oe[1]-he}var ot=function(Lt,at,Vt,_r){var Tr=Hl(Lt.stretch-oe,le,b,e.left),Sr=Xl(Lt.fixed-xe,Pe,Lt.stretch,j),xr=Hl(at.stretch-ce,he,S,e.top),Ar=Xl(at.fixed-ze,rt,at.stretch,G),Qr=Hl(Vt.stretch-oe,le,b,e.left),ei=Xl(Vt.fixed-xe,Pe,Vt.stretch,j),Ci=Hl(_r.stretch-ce,he,S,e.top),li=Xl(_r.fixed-ze,rt,_r.stretch,G),ki=new X(Tr,xr),Br=new X(Qr,xr),ci=new X(Qr,Ci),Bt=new X(Tr,Ci),nr=new X(Sr/h,Ar/h),Jt=new X(ei/h,li/h),Ot=t*Math.PI/180;if(Ot){var Oi=Math.sin(Ot),_i=Math.cos(Ot),dr=[_i,-Oi,Oi,_i];ki._matMult(dr),Br._matMult(dr),Bt._matMult(dr),ci._matMult(dr)}var Ur=Lt.stretch+Lt.fixed,xi=at.stretch+at.fixed;return{tl:ki,tr:Br,bl:Bt,br:ci,tex:{x:c.paddedRect.x+1+Ur,y:c.paddedRect.y+1+xi,w:Vt.stretch+Vt.fixed-Ur,h:_r.stretch+_r.fixed-xi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:nr,pixelOffsetBR:Jt,minFontScaleX:Pe/h/b,minFontScaleY:rt/h/S,isSDF:r}};if(a&&(c.stretchX||c.stretchY))for(var qe=Zm(I,te,j),bt=Zm(C,K,G),pt=0;pt<qe.length-1;pt++)for(var Qe=qe[pt],Tt=qe[pt+1],vt=0;vt<bt.length-1;vt++)l.push(ot(Qe,bt[vt],Tt,bt[vt+1]));else l.push(ot({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:m+1},{fixed:0,stretch:g+1}));return l}function Wl(e,t,r){for(var a=0,l=0,c=e;l<c.length;l+=1){var h=c[l];a+=Math.max(t,Math.min(r,h[1]))-Math.max(t,Math.min(r,h[0]))}return a}function Zm(e,t,r){for(var a=[{fixed:-1,stretch:0}],l=0,c=e;l<c.length;l+=1){var h=c[l],m=h[0],g=h[1],b=a[a.length-1];a.push({fixed:m-b.stretch,stretch:b.stretch}),a.push({fixed:m-b.stretch,stretch:b.stretch+(g-m)})}return a.push({fixed:t+1,stretch:r}),a}function Hl(e,t,r,a){return e/t*r+a}function Xl(e,t,r,a){return e-t*r/a}var Kl=function(e,t,r,a,l,c,h,m,g,b){if(this.boxStartIndex=e.length,g){var S=c.top,I=c.bottom,C=c.collisionPadding;C&&(S-=C[1],I+=C[3]);var z=I-S;z>0&&(z=Math.max(10,z),this.circleDiameter=z)}else{var j=c.top*h-m,G=c.bottom*h+m,te=c.left*h-m,K=c.right*h+m,oe=c.collisionPadding;if(oe&&(te-=oe[0]*h,j-=oe[1]*h,K+=oe[2]*h,G+=oe[3]*h),b){var le=new X(te,j),ce=new X(K,j),he=new X(te,G),xe=new X(K,G),Pe=b*Math.PI/180;le._rotate(Pe),ce._rotate(Pe),he._rotate(Pe),xe._rotate(Pe),te=Math.min(le.x,ce.x,he.x,xe.x),K=Math.max(le.x,ce.x,he.x,xe.x),j=Math.min(le.y,ce.y,he.y,xe.y),G=Math.max(le.y,ce.y,he.y,xe.y)}e.emplaceBack(t.x,t.y,te,j,K,G,r,a,l)}this.boxEndIndex=e.length},Ps=function(e,t){if(e===void 0&&(e=[]),t===void 0&&(t=a0),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function a0(e,t){return e<t?-1:e>t?1:0}function s0(e,t,r){r===void 0&&(r=!1);for(var a=1/0,l=1/0,c=-1/0,h=-1/0,m=e[0],g=0;g<m.length;g++){var b=m[g];(!g||b.x<a)&&(a=b.x),(!g||b.y<l)&&(l=b.y),(!g||b.x>c)&&(c=b.x),(!g||b.y>h)&&(h=b.y)}var S=Math.min(c-a,h-l),I=S/2,C=new Ps([],u0);if(S===0)return new X(a,l);for(var z=a;z<c;z+=S)for(var j=l;j<h;j+=S)C.push(new Cs(z+I,j+I,I,e));for(var G=(function(oe){for(var le=0,ce=0,he=0,xe=oe[0],Pe=0,ze=xe.length,rt=ze-1;Pe<ze;rt=Pe++){var Oe=xe[Pe],ot=xe[rt],qe=Oe.x*ot.y-ot.x*Oe.y;ce+=(Oe.x+ot.x)*qe,he+=(Oe.y+ot.y)*qe,le+=3*qe}return new Cs(ce/le,he/le,0,oe)})(e),te=C.length;C.length;){var K=C.pop();(K.d>G.d||!G.d)&&(G=K,r&&console.log("found best %d after %d probes",Math.round(1e4*K.d)/1e4,te)),K.max-G.d<=t||(C.push(new Cs(K.p.x-(I=K.h/2),K.p.y-I,I,e)),C.push(new Cs(K.p.x+I,K.p.y-I,I,e)),C.push(new Cs(K.p.x-I,K.p.y+I,I,e)),C.push(new Cs(K.p.x+I,K.p.y+I,I,e)),te+=4)}return r&&(console.log("num probes: "+te),console.log("best distance: "+G.d)),G.p}function u0(e,t){return t.max-e.max}function Cs(e,t,r,a){this.p=new X(e,t),this.h=r,this.d=(function(l,c){for(var h=!1,m=1/0,g=0;g<c.length;g++)for(var b=c[g],S=0,I=b.length,C=I-1;S<I;C=S++){var z=b[S],j=b[C];z.y>l.y!=j.y>l.y&&l.x<(j.x-z.x)*(l.y-z.y)/(j.y-z.y)+z.x&&(h=!h),m=Math.min(m,oa(l,z,j))}return(h?1:-1)*Math.sqrt(m)})(this.p,a),this.max=this.d+this.h*Math.SQRT2}Ps.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},Ps.prototype.pop=function(){if(this.length!==0){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},Ps.prototype.peek=function(){return this.data[0]},Ps.prototype._up=function(e){for(var t=this.data,r=this.compare,a=t[e];e>0;){var l=e-1>>1,c=t[l];if(r(a,c)>=0)break;t[e]=c,e=l}t[e]=a},Ps.prototype._down=function(e){for(var t=this.data,r=this.compare,a=this.length>>1,l=t[e];e<a;){var c=1+(e<<1),h=t[c],m=c+1;if(m<this.length&&r(t[m],h)<0&&(c=m,h=t[m]),r(h,l)>=0)break;t[e]=h,e=c}t[e]=l};var rp=Number.POSITIVE_INFINITY;function Wm(e,t){return t[1]!==rp?(function(r,a,l){var c=0,h=0;switch(a=Math.abs(a),l=Math.abs(l),r){case"top-right":case"top-left":case"top":h=l-7;break;case"bottom-right":case"bottom-left":case"bottom":h=7-l}switch(r){case"top-right":case"bottom-right":case"right":c=-a;break;case"top-left":case"bottom-left":case"left":c=a}return[c,h]})(e,t[0],t[1]):(function(r,a){var l=0,c=0;a<0&&(a=0);var h=a/Math.sqrt(2);switch(r){case"top-right":case"top-left":c=h-7;break;case"bottom-right":case"bottom-left":c=7-h;break;case"bottom":c=7-a;break;case"top":c=a-7}switch(r){case"top-right":case"bottom-right":l=-h;break;case"top-left":case"bottom-left":l=h;break;case"left":l=a;break;case"right":l=-a}return[l,c]})(e,t[0])}function ip(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Hm(e,t,r,a,l,c,h,m,g,b,S,I,C,z,j){var G=(function(ce,he,xe,Pe,ze,rt,Oe,ot){for(var qe=Pe.layout.get("text-rotate").evaluate(rt,{})*Math.PI/180,bt=[],pt=0,Qe=he.positionedLines;pt<Qe.length;pt+=1)for(var Tt=Qe[pt],vt=0,Lt=Tt.positionedGlyphs;vt<Lt.length;vt+=1){var at=Lt[vt];if(at.rect){var Vt=at.rect||{},_r=4,Tr=!0,Sr=1,xr=0,Ar=(ze||ot)&&at.vertical,Qr=at.metrics.advance*at.scale/2;if(ot&&he.verticalizable&&(xr=Tt.lineOffset/2-(at.imageName?-(24-at.metrics.width*at.scale)/2:24*(at.scale-1))),at.imageName){var ei=Oe[at.imageName];Tr=ei.sdf,_r=1/(Sr=ei.pixelRatio)}var Ci=ze?[at.x+Qr,at.y]:[0,0],li=ze?[0,0]:[at.x+Qr+xe[0],at.y+xe[1]-xr],ki=[0,0];Ar&&(ki=li,li=[0,0]);var Br=(at.metrics.left-_r)*at.scale-Qr+li[0],ci=(-at.metrics.top-_r)*at.scale+li[1],Bt=Br+Vt.w*at.scale/Sr,nr=ci+Vt.h*at.scale/Sr,Jt=new X(Br,ci),Ot=new X(Bt,ci),Oi=new X(Br,nr),_i=new X(Bt,nr);if(Ar){var dr=new X(-Qr,Qr- -17),Ur=-Math.PI/2,xi=12-Qr,qt=new X(22-xi,-(at.imageName?xi:0)),so=new(Function.prototype.bind.apply(X,[null].concat(ki)));Jt._rotateAround(Ur,dr)._add(qt)._add(so),Ot._rotateAround(Ur,dr)._add(qt)._add(so),Oi._rotateAround(Ur,dr)._add(qt)._add(so),_i._rotateAround(Ur,dr)._add(qt)._add(so)}if(qe){var hn=Math.sin(qe),uo=Math.cos(qe),zr=[uo,-hn,hn,uo];Jt._matMult(zr),Ot._matMult(zr),Oi._matMult(zr),_i._matMult(zr)}var lo=new X(0,0),kn=new X(0,0);bt.push({tl:Jt,tr:Ot,bl:Oi,br:_i,tex:Vt,writingMode:he.writingMode,glyphOffset:Ci,sectionIndex:at.sectionIndex,isSDF:Tr,pixelOffsetTL:lo,pixelOffsetBR:kn,minFontScaleX:0,minFontScaleY:0})}}return bt})(0,r,m,l,c,h,a,e.allowVerticalPlacement),te=e.textSizeData,K=null;te.kind==="source"?(K=[128*l.layout.get("text-size").evaluate(h,{})])[0]>32640&&St(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):te.kind==="composite"&&((K=[128*z.compositeTextSizes[0].evaluate(h,{},j),128*z.compositeTextSizes[1].evaluate(h,{},j)])[0]>32640||K[1]>32640)&&St(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),e.addSymbols(e.text,G,K,m,c,h,b,t,g.lineStartIndex,g.lineLength,C,j);for(var oe=0,le=S;oe<le.length;oe+=1)I[le[oe]]=e.text.placedSymbolArray.length-1;return 4*G.length}function Xm(e){for(var t in e)return e[t];return null}function l0(e,t,r,a){var l=e.compareText;if(t in l){for(var c=l[t],h=c.length-1;h>=0;h--)if(a.dist(c[h])<r)return!0}else l[t]=[];return l[t].push(a),!1}var c0=Ss.VectorTileFeature.types,p0=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Jl(e,t,r,a,l,c,h,m,g,b,S,I,C){var z=m?Math.min(32640,Math.round(m[0])):0,j=m?Math.min(32640,Math.round(m[1])):0;e.emplaceBack(t,r,Math.round(32*a),Math.round(32*l),c,h,(z<<1)+(g?1:0),j,16*b,16*S,256*I,256*C)}function np(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function h0(e){for(var t=0,r=e.sections;t<r.length;t+=1)if(hs(r[t].text))return!0;return!1}var ks=function(e){this.layoutVertexArray=new ys,this.indexArray=new to,this.programConfigurations=e,this.segments=new F,this.dynamicLayoutVertexArray=new ra,this.opacityVertexArray=new za,this.placedSymbolArray=new s};ks.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},ks.prototype.upload=function(e,t,r,a){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ob.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Vb.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,p0,!0),this.opacityVertexBuffer.itemSize=1),(r||a)&&this.programConfigurations.upload(e))},ks.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Xe("SymbolBuffers",ks);var Lu=function(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new F,this.collisionVertexArray=new Iu};Lu.prototype.upload=function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,qb.members,!0)},Lu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Xe("CollisionBuffers",Lu);var er=function(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(c){return c.id})),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=en([]),this.placementViewportMatrix=en([]);var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=tp(this.zoom,t["text-size"]),this.iconSizeData=tp(this.zoom,t["icon-size"]);var r=this.layers[0].layout,a=r.get("symbol-sort-key"),l=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=l!=="viewport-y"&&a.constantOr(1)!==void 0,this.sortFeaturesByY=(l==="viewport-y"||l==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,r.get("symbol-placement")==="point"&&(this.writingModes=r.get("text-writing-mode").map((function(c){return pn[c]}))),this.stateDependentLayerIds=this.layers.filter((function(c){return c.isStateDependent()})).map((function(c){return c.id})),this.sourceID=e.sourceID};er.prototype.createArrays=function(){this.text=new ks(new ct(this.layers,this.zoom,(function(e){return/^text/.test(e)}))),this.icon=new ks(new ct(this.layers,this.zoom,(function(e){return/^icon/.test(e)}))),this.glyphOffsetArray=new d,this.lineVertexArray=new v,this.symbolInstances=new f},er.prototype.calculateGlyphDependencies=function(e,t,r,a,l){for(var c=0;c<e.length;c++)if(t[e.charCodeAt(c)]=!0,(r||a)&&l){var h=zu[e.charAt(c)];h&&(t[h.charCodeAt(0)]=!0)}},er.prototype.populate=function(e,t,r){var a=this.layers[0],l=a.layout,c=l.get("text-font"),h=l.get("text-field"),m=l.get("icon-image"),g=(h.value.kind!=="constant"||h.value.value instanceof ni&&!h.value.value.isEmpty()||h.value.value.toString().length>0)&&(c.value.kind!=="constant"||c.value.value.length>0),b=m.value.kind!=="constant"||!!m.value.value||Object.keys(m.parameters).length>0,S=l.get("symbol-sort-key");if(this.features=[],g||b){for(var I=t.iconDependencies,C=t.glyphDependencies,z=t.availableImages,j=new kt(this.zoom),G=0,te=e;G<te.length;G+=1){var K=te[G],oe=K.feature,le=K.id,ce=K.index,he=K.sourceLayerIndex,xe=a._featureFilter.needGeometry,Pe=Mr(oe,xe);if(a._featureFilter.filter(j,Pe,r)){xe||(Pe.geometry=wr(oe));var ze=void 0;if(g){var rt=a.getValueAndResolveTokens("text-field",Pe,r,z),Oe=ni.factory(rt);h0(Oe)&&(this.hasRTLText=!0),(!this.hasRTLText||xu()==="unavailable"||this.hasRTLText&&Qi.isParsed())&&(ze=Nb(Oe,a,Pe))}var ot=void 0;if(b){var qe=a.getValueAndResolveTokens("icon-image",Pe,r,z);ot=qe instanceof Di?qe:Di.fromString(qe)}if(ze||ot){var bt=this.sortFeaturesByKey?S.evaluate(Pe,{},r):void 0;if(this.features.push({id:le,text:ze,icon:ot,index:ce,sourceLayerIndex:he,geometry:Pe.geometry,properties:oe.properties,type:c0[oe.type],sortKey:bt}),ot&&(I[ot.name]=!0),ze){var pt=c.evaluate(Pe,{},r).join(","),Qe=l.get("text-rotation-alignment")==="map"&&l.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(pn.vertical)>=0;for(var Tt=0,vt=ze.sections;Tt<vt.length;Tt+=1){var Lt=vt[Tt];if(Lt.image)I[Lt.image.name]=!0;else{var at=vu(ze.toString()),Vt=Lt.fontStack||pt,_r=C[Vt]=C[Vt]||{};this.calculateGlyphDependencies(Lt.text,_r,Qe,this.allowVerticalPlacement,at)}}}}}}l.get("symbol-placement")==="line"&&(this.features=(function(Tr){var Sr={},xr={},Ar=[],Qr=0;function ei(dr){Ar.push(Tr[dr]),Qr++}function Ci(dr,Ur,xi){var qt=xr[dr];return delete xr[dr],xr[Ur]=qt,Ar[qt].geometry[0].pop(),Ar[qt].geometry[0]=Ar[qt].geometry[0].concat(xi[0]),qt}function li(dr,Ur,xi){var qt=Sr[Ur];return delete Sr[Ur],Sr[dr]=qt,Ar[qt].geometry[0].shift(),Ar[qt].geometry[0]=xi[0].concat(Ar[qt].geometry[0]),qt}function ki(dr,Ur,xi){var qt=xi?Ur[0][Ur[0].length-1]:Ur[0][0];return dr+":"+qt.x+":"+qt.y}for(var Br=0;Br<Tr.length;Br++){var ci=Tr[Br],Bt=ci.geometry,nr=ci.text?ci.text.toString():null;if(nr){var Jt=ki(nr,Bt),Ot=ki(nr,Bt,!0);if(Jt in xr&&Ot in Sr&&xr[Jt]!==Sr[Ot]){var Oi=li(Jt,Ot,Bt),_i=Ci(Jt,Ot,Ar[Oi].geometry);delete Sr[Jt],delete xr[Ot],xr[ki(nr,Ar[_i].geometry,!0)]=_i,Ar[Oi].geometry=null}else Jt in xr?Ci(Jt,Ot,Bt):Ot in Sr?li(Jt,Ot,Bt):(ei(Br),Sr[Jt]=Qr-1,xr[Ot]=Qr-1)}else ei(Br)}return Ar.filter((function(dr){return dr.geometry}))})(this.features)),this.sortFeaturesByKey&&this.features.sort((function(Tr,Sr){return Tr.sortKey-Sr.sortKey}))}},er.prototype.update=function(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))},er.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},er.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},er.prototype.upload=function(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},er.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},er.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},er.prototype.addToLineVertexArray=function(e,t){var r=this.lineVertexArray.length;if(e.segment!==void 0){for(var a=e.dist(t[e.segment+1]),l=e.dist(t[e.segment]),c={},h=e.segment+1;h<t.length;h++)c[h]={x:t[h].x,y:t[h].y,tileUnitDistanceFromAnchor:a},h<t.length-1&&(a+=t[h+1].dist(t[h]));for(var m=e.segment||0;m>=0;m--)c[m]={x:t[m].x,y:t[m].y,tileUnitDistanceFromAnchor:l},m>0&&(l+=t[m-1].dist(t[m]));for(var g=0;g<t.length;g++){var b=c[g];this.lineVertexArray.emplaceBack(b.x,b.y,b.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},er.prototype.addSymbols=function(e,t,r,a,l,c,h,m,g,b,S,I){for(var C=e.indexArray,z=e.layoutVertexArray,j=e.segments.prepareSegment(4*t.length,z,C,this.canOverlap?c.sortKey:void 0),G=this.glyphOffsetArray.length,te=j.vertexLength,K=this.allowVerticalPlacement&&h===pn.vertical?Math.PI/2:0,oe=c.text&&c.text.sections,le=0;le<t.length;le++){var ce=t[le],he=ce.tl,xe=ce.tr,Pe=ce.bl,ze=ce.br,rt=ce.tex,Oe=ce.pixelOffsetTL,ot=ce.pixelOffsetBR,qe=ce.minFontScaleX,bt=ce.minFontScaleY,pt=ce.glyphOffset,Qe=ce.isSDF,Tt=ce.sectionIndex,vt=j.vertexLength,Lt=pt[1];Jl(z,m.x,m.y,he.x,Lt+he.y,rt.x,rt.y,r,Qe,Oe.x,Oe.y,qe,bt),Jl(z,m.x,m.y,xe.x,Lt+xe.y,rt.x+rt.w,rt.y,r,Qe,ot.x,Oe.y,qe,bt),Jl(z,m.x,m.y,Pe.x,Lt+Pe.y,rt.x,rt.y+rt.h,r,Qe,Oe.x,ot.y,qe,bt),Jl(z,m.x,m.y,ze.x,Lt+ze.y,rt.x+rt.w,rt.y+rt.h,r,Qe,ot.x,ot.y,qe,bt),np(e.dynamicLayoutVertexArray,m,K),C.emplaceBack(vt,vt+1,vt+2),C.emplaceBack(vt+1,vt+2,vt+3),j.vertexLength+=4,j.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(pt[0]),le!==t.length-1&&Tt===t[le+1].sectionIndex||e.programConfigurations.populatePaintArrays(z.length,c,c.index,{},I,oe&&oe[Tt])}e.placedSymbolArray.emplaceBack(m.x,m.y,G,this.glyphOffsetArray.length-G,te,g,b,m.segment,r?r[0]:0,r?r[1]:0,a[0],a[1],h,0,!1,0,S)},er.prototype._addCollisionDebugVertex=function(e,t,r,a,l,c){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,a,l,Math.round(c.x),Math.round(c.y))},er.prototype.addCollisionDebugVertices=function(e,t,r,a,l,c,h){var m=l.segments.prepareSegment(4,l.layoutVertexArray,l.indexArray),g=m.vertexLength,b=l.layoutVertexArray,S=l.collisionVertexArray,I=h.anchorX,C=h.anchorY;this._addCollisionDebugVertex(b,S,c,I,C,new X(e,t)),this._addCollisionDebugVertex(b,S,c,I,C,new X(r,t)),this._addCollisionDebugVertex(b,S,c,I,C,new X(r,a)),this._addCollisionDebugVertex(b,S,c,I,C,new X(e,a)),m.vertexLength+=4;var z=l.indexArray;z.emplaceBack(g,g+1),z.emplaceBack(g+1,g+2),z.emplaceBack(g+2,g+3),z.emplaceBack(g+3,g),m.primitiveLength+=4},er.prototype.addDebugCollisionBoxes=function(e,t,r,a){for(var l=e;l<t;l++){var c=this.collisionBoxArray.get(l);this.addCollisionDebugVertices(c.x1,c.y1,c.x2,c.y2,a?this.textCollisionBox:this.iconCollisionBox,c.anchorPoint,r)}},er.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Lu(ia,Em.members,Da),this.iconCollisionBox=new Lu(ia,Em.members,Da);for(var e=0;e<this.symbolInstances.length;e++){var t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}},er.prototype._deserializeCollisionBoxesForSymbol=function(e,t,r,a,l,c,h,m,g){for(var b={},S=t;S<r;S++){var I=e.get(S);b.textBox={x1:I.x1,y1:I.y1,x2:I.x2,y2:I.y2,anchorPointX:I.anchorPointX,anchorPointY:I.anchorPointY},b.textFeatureIndex=I.featureIndex;break}for(var C=a;C<l;C++){var z=e.get(C);b.verticalTextBox={x1:z.x1,y1:z.y1,x2:z.x2,y2:z.y2,anchorPointX:z.anchorPointX,anchorPointY:z.anchorPointY},b.verticalTextFeatureIndex=z.featureIndex;break}for(var j=c;j<h;j++){var G=e.get(j);b.iconBox={x1:G.x1,y1:G.y1,x2:G.x2,y2:G.y2,anchorPointX:G.anchorPointX,anchorPointY:G.anchorPointY},b.iconFeatureIndex=G.featureIndex;break}for(var te=m;te<g;te++){var K=e.get(te);b.verticalIconBox={x1:K.x1,y1:K.y1,x2:K.x2,y2:K.y2,anchorPointX:K.anchorPointX,anchorPointY:K.anchorPointY},b.verticalIconFeatureIndex=K.featureIndex;break}return b},er.prototype.deserializeCollisionBoxes=function(e){this.collisionArrays=[];for(var t=0;t<this.symbolInstances.length;t++){var r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},er.prototype.hasTextData=function(){return this.text.segments.get().length>0},er.prototype.hasIconData=function(){return this.icon.segments.get().length>0},er.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},er.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},er.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},er.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),a=r.vertexStartIndex+4*r.numGlyphs,l=r.vertexStartIndex;l<a;l+=4)e.indexArray.emplaceBack(l,l+1,l+2),e.indexArray.emplaceBack(l+1,l+2,l+3)},er.prototype.getSortedSymbolIndexes=function(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var t=Math.sin(e),r=Math.cos(e),a=[],l=[],c=[],h=0;h<this.symbolInstances.length;++h){c.push(h);var m=this.symbolInstances.get(h);a.push(0|Math.round(t*m.anchorX+r*m.anchorY)),l.push(m.featureIndex)}return c.sort((function(g,b){return a[g]-a[b]||l[b]-l[g]})),c},er.prototype.addToSortKeyRanges=function(e,t){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})},er.prototype.sortFeatures=function(e){var t=this;if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,a=this.symbolInstanceIndexes;r<a.length;r+=1){var l=this.symbolInstances.get(a[r]);this.featureSortOrder.push(l.featureIndex),[l.rightJustifiedTextSymbolIndex,l.centerJustifiedTextSymbolIndex,l.leftJustifiedTextSymbolIndex].forEach((function(c,h,m){c>=0&&m.indexOf(c)===h&&t.addIndicesForPlacedSymbol(t.text,c)})),l.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,l.verticalPlacedTextSymbolIndex),l.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.placedIconSymbolIndex),l.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Xe("SymbolBucket",er,{omit:["layers","collisionBoxArray","features","compareText"]}),er.MAX_GLYPHS=65535,er.addDynamicAttributes=np;var f0=new vi({"symbol-placement":new it(L.layout_symbol["symbol-placement"]),"symbol-spacing":new it(L.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new it(L.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ye(L.layout_symbol["symbol-sort-key"]),"symbol-z-order":new it(L.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new it(L.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new it(L.layout_symbol["icon-ignore-placement"]),"icon-optional":new it(L.layout_symbol["icon-optional"]),"icon-rotation-alignment":new it(L.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ye(L.layout_symbol["icon-size"]),"icon-text-fit":new it(L.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new it(L.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ye(L.layout_symbol["icon-image"]),"icon-rotate":new Ye(L.layout_symbol["icon-rotate"]),"icon-padding":new it(L.layout_symbol["icon-padding"]),"icon-keep-upright":new it(L.layout_symbol["icon-keep-upright"]),"icon-offset":new Ye(L.layout_symbol["icon-offset"]),"icon-anchor":new Ye(L.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new it(L.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new it(L.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new it(L.layout_symbol["text-rotation-alignment"]),"text-field":new Ye(L.layout_symbol["text-field"]),"text-font":new Ye(L.layout_symbol["text-font"]),"text-size":new Ye(L.layout_symbol["text-size"]),"text-max-width":new Ye(L.layout_symbol["text-max-width"]),"text-line-height":new it(L.layout_symbol["text-line-height"]),"text-letter-spacing":new Ye(L.layout_symbol["text-letter-spacing"]),"text-justify":new Ye(L.layout_symbol["text-justify"]),"text-radial-offset":new Ye(L.layout_symbol["text-radial-offset"]),"text-variable-anchor":new it(L.layout_symbol["text-variable-anchor"]),"text-anchor":new Ye(L.layout_symbol["text-anchor"]),"text-max-angle":new it(L.layout_symbol["text-max-angle"]),"text-writing-mode":new it(L.layout_symbol["text-writing-mode"]),"text-rotate":new Ye(L.layout_symbol["text-rotate"]),"text-padding":new it(L.layout_symbol["text-padding"]),"text-keep-upright":new it(L.layout_symbol["text-keep-upright"]),"text-transform":new Ye(L.layout_symbol["text-transform"]),"text-offset":new Ye(L.layout_symbol["text-offset"]),"text-allow-overlap":new it(L.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new it(L.layout_symbol["text-ignore-placement"]),"text-optional":new it(L.layout_symbol["text-optional"])}),op={paint:new vi({"icon-opacity":new Ye(L.paint_symbol["icon-opacity"]),"icon-color":new Ye(L.paint_symbol["icon-color"]),"icon-halo-color":new Ye(L.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ye(L.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ye(L.paint_symbol["icon-halo-blur"]),"icon-translate":new it(L.paint_symbol["icon-translate"]),"icon-translate-anchor":new it(L.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ye(L.paint_symbol["text-opacity"]),"text-color":new Ye(L.paint_symbol["text-color"],{runtimeType:Me,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new Ye(L.paint_symbol["text-halo-color"]),"text-halo-width":new Ye(L.paint_symbol["text-halo-width"]),"text-halo-blur":new Ye(L.paint_symbol["text-halo-blur"]),"text-translate":new it(L.paint_symbol["text-translate"]),"text-translate-anchor":new it(L.paint_symbol["text-translate-anchor"])}),layout:f0},Ms=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Ge,this.defaultValue=e};Ms.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},Ms.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},Ms.prototype.outputDefined=function(){return!1},Ms.prototype.serialize=function(){return null},Xe("FormatSectionOverride",Ms,{omit:["defaultValue"]});var d0=(function(e){function t(r){e.call(this,r,op)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){if(e.prototype.recalculate.call(this,r,a),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"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 l=this.layout.get("text-writing-mode");if(l){for(var c=[],h=0,m=l;h<m.length;h+=1){var g=m[h];c.indexOf(g)<0&&c.push(g)}this.layout._values["text-writing-mode"]=c}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},t.prototype.getValueAndResolveTokens=function(r,a,l,c){var h=this.layout.get(r).evaluate(a,{},l,c),m=this._unevaluatedLayout._values[r];return m.isDataDriven()||wa(m.value)||!h?h:(function(g,b){return b.replace(/{([^{}]+)}/g,(function(S,I){return I in g?String(g[I]):""}))})(a.properties,h)},t.prototype.createBucket=function(r){return new er(r)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype._setPaintOverrides=function(){for(var r=0,a=op.paint.overridableProperties;r<a.length;r+=1){var l=a[r];if(t.hasPaintOverride(this.layout,l)){var c,h=this.paint.get(l),m=new Ms(h),g=new Ko(m,h.property.specification);c=h.value.kind==="constant"||h.value.kind==="source"?new Sa("source",g):new Jo("composite",g,h.value.zoomStops,h.value._interpolationType),this.paint._values[l]=new Ti(h.property,c,h.parameters)}}},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,l){return!(!this.layout||a.isDataDriven()||l.isDataDriven())&&t.hasPaintOverride(this.layout,r)},t.hasPaintOverride=function(r,a){var l=r.get("text-field"),c=op.paint.properties[a],h=!1,m=function(S){for(var I=0,C=S;I<C.length;I+=1)if(c.overrides&&c.overrides.hasOverride(C[I]))return void(h=!0)};if(l.value.kind==="constant"&&l.value.value instanceof ni)m(l.value.value.sections);else if(l.value.kind==="source"){var g=function(S){h||(S instanceof Si&&kr(S.value)===rr?m(S.value.sections):S instanceof yn?m(S.sections):S.eachChild(g))},b=l.value;b._styleExpression&&g(b._styleExpression.expression)}return h},t})(An),m0={paint:new vi({"background-color":new it(L.paint_background["background-color"]),"background-pattern":new Ai(L.paint_background["background-pattern"]),"background-opacity":new it(L.paint_background["background-opacity"])})},y0=(function(e){function t(r){e.call(this,r,m0)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(An),v0={paint:new vi({"raster-opacity":new it(L.paint_raster["raster-opacity"]),"raster-hue-rotate":new it(L.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new it(L.paint_raster["raster-brightness-min"]),"raster-brightness-max":new it(L.paint_raster["raster-brightness-max"]),"raster-saturation":new it(L.paint_raster["raster-saturation"]),"raster-contrast":new it(L.paint_raster["raster-contrast"]),"raster-resampling":new it(L.paint_raster["raster-resampling"]),"raster-fade-duration":new it(L.paint_raster["raster-fade-duration"])})},g0=(function(e){function t(r){e.call(this,r,v0)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(An),_0=(function(e){function t(r){e.call(this,r,{}),this.implementation=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},t.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},t.prototype.recalculate=function(){},t.prototype.updateTransitions=function(){},t.prototype.hasTransition=function(){},t.prototype.serialize=function(){},t.prototype.onAdd=function(r){this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},t.prototype.onRemove=function(r){this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},t})(An),x0={circle:jc,heatmap:ib,hillshade:ob,fill:wb,"fill-extrusion":Mb,line:Fb,symbol:d0,background:y0,raster:g0},Km=J.HTMLImageElement,Jm=J.HTMLCanvasElement,Ym=J.HTMLVideoElement,Qm=J.ImageData,Yl=J.ImageBitmap,qa=function(e,t,r,a){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,a)};qa.prototype.update=function(e,t,r){var a=e.width,l=e.height,c=!(this.size&&this.size[0]===a&&this.size[1]===l||r),h=this.context,m=h.gl;if(this.useMipmap=!!(t&&t.useMipmap),m.bindTexture(m.TEXTURE_2D,this.texture),h.pixelStoreUnpackFlipY.set(!1),h.pixelStoreUnpack.set(1),h.pixelStoreUnpackPremultiplyAlpha.set(this.format===m.RGBA&&(!t||t.premultiply!==!1)),c)this.size=[a,l],e instanceof Km||e instanceof Jm||e instanceof Ym||e instanceof Qm||Yl&&e instanceof Yl?m.texImage2D(m.TEXTURE_2D,0,this.format,this.format,m.UNSIGNED_BYTE,e):m.texImage2D(m.TEXTURE_2D,0,this.format,a,l,0,this.format,m.UNSIGNED_BYTE,e.data);else{var g=r||{x:0,y:0},b=g.x,S=g.y;e instanceof Km||e instanceof Jm||e instanceof Ym||e instanceof Qm||Yl&&e instanceof Yl?m.texSubImage2D(m.TEXTURE_2D,0,b,S,m.RGBA,m.UNSIGNED_BYTE,e):m.texSubImage2D(m.TEXTURE_2D,0,b,S,a,l,m.RGBA,m.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&m.generateMipmap(m.TEXTURE_2D)},qa.prototype.bind=function(e,t,r){var a=this.context.gl;a.bindTexture(a.TEXTURE_2D,this.texture),r!==a.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=a.LINEAR),e!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,t),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,t),this.wrap=t)},qa.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},qa.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var ap=function(e){var t=this;this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){t._triggered=!1,t._callback()})};ap.prototype.trigger=function(){var e=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){e._triggered=!1,e._callback()}),0))},ap.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Bs=function(e,t,r){this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},we(["receive","process"],this),this.invoker=new ap(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Pr()?e:J};function ey(e,t,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[e*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}Bs.prototype.send=function(e,t,r,a,l){var c=this;l===void 0&&(l=!1);var h=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[h]=r);var m=Rr(this.globalScope)?void 0:[];return this.target.postMessage({id:h,type:e,hasCallback:!!r,targetMapId:a,mustQueue:l,sourceMapId:this.mapId,data:gn(t,m)},m),{cancel:function(){r&&delete c.callbacks[h],c.target.postMessage({id:h,type:"<cancel>",targetMapId:a,sourceMapId:c.mapId})}}},Bs.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if(t.type==="<cancel>"){delete this.tasks[r];var a=this.cancelCallbacks[r];delete this.cancelCallbacks[r],a&&a()}else Pr()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)},Bs.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},Bs.prototype.processTask=function(e,t){var r=this;if(t.type==="<response>"){var a=this.callbacks[e];delete this.callbacks[e],a&&(t.error?a(ji(t.error)):a(null,ji(t.data)))}else{var l=!1,c=Rr(this.globalScope)?void 0:[],h=t.hasCallback?function(S,I){l=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"<response>",sourceMapId:r.mapId,error:S?gn(S):null,data:gn(I,c)},c)}:function(S){l=!0},m=null,g=ji(t.data);if(this.parent[t.type])m=this.parent[t.type](t.sourceMapId,g,h);else if(this.parent.getWorkerSource){var b=t.type.split(".");m=this.parent.getWorkerSource(t.sourceMapId,b[0],g.source)[b[1]](g,h)}else h(new Error("Could not find function "+t.type));!l&&m&&m.cancel&&(this.cancelCallbacks[e]=m.cancel)}},Bs.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Zr=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};Zr.prototype.setNorthEast=function(e){return this._ne=e instanceof gr?new gr(e.lng,e.lat):gr.convert(e),this},Zr.prototype.setSouthWest=function(e){return this._sw=e instanceof gr?new gr(e.lng,e.lat):gr.convert(e),this},Zr.prototype.extend=function(e){var t,r,a=this._sw,l=this._ne;if(e instanceof gr)t=e,r=e;else{if(!(e instanceof Zr))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(Zr.convert(e)):this.extend(gr.convert(e)):this;if(r=e._ne,!(t=e._sw)||!r)return this}return a||l?(a.lng=Math.min(t.lng,a.lng),a.lat=Math.min(t.lat,a.lat),l.lng=Math.max(r.lng,l.lng),l.lat=Math.max(r.lat,l.lat)):(this._sw=new gr(t.lng,t.lat),this._ne=new gr(r.lng,r.lat)),this},Zr.prototype.getCenter=function(){return new gr((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Zr.prototype.getSouthWest=function(){return this._sw},Zr.prototype.getNorthEast=function(){return this._ne},Zr.prototype.getNorthWest=function(){return new gr(this.getWest(),this.getNorth())},Zr.prototype.getSouthEast=function(){return new gr(this.getEast(),this.getSouth())},Zr.prototype.getWest=function(){return this._sw.lng},Zr.prototype.getSouth=function(){return this._sw.lat},Zr.prototype.getEast=function(){return this._ne.lng},Zr.prototype.getNorth=function(){return this._ne.lat},Zr.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Zr.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Zr.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Zr.prototype.contains=function(e){var t=gr.convert(e),r=t.lng,a=t.lat,l=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&l},Zr.convert=function(e){return!e||e instanceof Zr?e:new Zr(e)};var gr=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};gr.prototype.wrap=function(){return new gr(He(this.lng,-180,180),this.lat)},gr.prototype.toArray=function(){return[this.lng,this.lat]},gr.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},gr.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,a=e.lat*t,l=Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos((e.lng-this.lng)*t);return 63710088e-1*Math.acos(Math.min(l,1))},gr.prototype.toBounds=function(e){e===void 0&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new Zr(new gr(this.lng-r,this.lat-t),new gr(this.lng+r,this.lat+t))},gr.convert=function(e){if(e instanceof gr)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new gr(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new gr(Number("lng"in e?e.lng:e.lon),Number(e.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 ty=2*Math.PI*63710088e-1;function ry(e){return ty*Math.cos(e*Math.PI/180)}function iy(e){return(180+e)/360}function ny(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function oy(e,t){return e/ry(t)}function sp(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}var Ua=function(e,t,r){r===void 0&&(r=0),this.x=+e,this.y=+t,this.z=+r};Ua.fromLngLat=function(e,t){t===void 0&&(t=0);var r=gr.convert(e);return new Ua(iy(r.lng),ny(r.lat),oy(t,r.lat))},Ua.prototype.toLngLat=function(){return new gr(360*this.x-180,sp(this.y))},Ua.prototype.toAltitude=function(){return this.z*ry(sp(this.y))},Ua.prototype.meterInMercatorCoordinateUnits=function(){return 1/ty*(e=sp(this.y),1/Math.cos(e*Math.PI/180));var e};var Na=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=Fu(0,e,e,t,r)};Na.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Na.prototype.url=function(e,t){var r,a,l,c,h,m=(a=this.y,l=this.z,c=ey(256*(r=this.x),256*(a=Math.pow(2,l)-a-1),l),h=ey(256*(r+1),256*(a+1),l),c[0]+","+c[1]+","+h[0]+","+h[1]),g=(function(b,S,I){for(var C,z="",j=b;j>0;j--)z+=(S&(C=1<<j-1)?1:0)+(I&C?2:0);return z})(this.z,this.x,this.y);return e[(this.x+this.y)%e.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(t==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",g).replace("{bbox-epsg-3857}",m)},Na.prototype.getTilePoint=function(e){var t=Math.pow(2,this.z);return new X(8192*(e.x*t-this.x),8192*(e.y*t-this.y))},Na.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var ay=function(e,t){this.wrap=e,this.canonical=t,this.key=Fu(e,t.z,t.z,t.x,t.y)},Wr=function(e,t,r,a,l){this.overscaledZ=e,this.wrap=t,this.canonical=new Na(r,+a,+l),this.key=Fu(t,e,r,a,l)};function Fu(e,t,r,a,l){(e*=2)<0&&(e=-1*e-1);var c=1<<r;return(c*c*e+c*l+a).toString(36)+r.toString(36)+t.toString(36)}Wr.prototype.equals=function(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)},Wr.prototype.scaledTo=function(e){var t=this.canonical.z-e;return e>this.canonical.z?new Wr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Wr(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},Wr.prototype.calculateScaledKey=function(e,t){var r=this.canonical.z-e;return e>this.canonical.z?Fu(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):Fu(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)},Wr.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t},Wr.prototype.children=function(e){if(this.overscaledZ>=e)return[new Wr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,r=2*this.canonical.x,a=2*this.canonical.y;return[new Wr(t,this.wrap,t,r,a),new Wr(t,this.wrap,t,r+1,a),new Wr(t,this.wrap,t,r,a+1),new Wr(t,this.wrap,t,r+1,a+1)]},Wr.prototype.isLessThan=function(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))},Wr.prototype.wrapped=function(){return new Wr(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Wr.prototype.unwrapTo=function(e){return new Wr(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)},Wr.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Wr.prototype.toUnwrapped=function(){return new ay(this.wrap,this.canonical)},Wr.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Wr.prototype.getTilePoint=function(e){return this.canonical.getTilePoint(new Ua(e.x-this.wrap,e.y))},Xe("CanonicalTileID",Na),Xe("OverscaledTileID",Wr,{omit:["posMatrix"]});var Fo=function(e,t,r){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&r!=="mapbox"&&r!=="terrarium")return St('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=t.height;var a=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=r||"mapbox";for(var l=0;l<a;l++)this.data[this._idx(-1,l)]=this.data[this._idx(0,l)],this.data[this._idx(a,l)]=this.data[this._idx(a-1,l)],this.data[this._idx(l,-1)]=this.data[this._idx(l,0)],this.data[this._idx(l,a)]=this.data[this._idx(l,a-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(a,-1)]=this.data[this._idx(a-1,0)],this.data[this._idx(-1,a)]=this.data[this._idx(0,a-1)],this.data[this._idx(a,a)]=this.data[this._idx(a-1,a-1)]};Fo.prototype.get=function(e,t){var r=new Uint8Array(this.data.buffer),a=4*this._idx(e,t);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(r[a],r[a+1],r[a+2])},Fo.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Fo.prototype._idx=function(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)},Fo.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},Fo.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},Fo.prototype.getPixels=function(){return new Hi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Fo.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var a=t*this.dim,l=t*this.dim+this.dim,c=r*this.dim,h=r*this.dim+this.dim;switch(t){case-1:a=l-1;break;case 1:l=a+1}switch(r){case-1:c=h-1;break;case 1:h=c+1}for(var m=-t*this.dim,g=-r*this.dim,b=c;b<h;b++)for(var S=a;S<l;S++)this.data[this._idx(S,b)]=e.data[this._idx(S+m,b+g)]},Xe("DEMData",Fo);var Ql=function(e){this._stringToNumber={},this._numberToString=[];for(var t=0;t<e.length;t++){var r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}};Ql.prototype.encode=function(e){return this._stringToNumber[e]},Ql.prototype.decode=function(e){return this._numberToString[e]};var ec=function(e,t,r,a,l){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=a,this.properties=e.properties,this.id=l},up={geometry:{configurable:!0}};up.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},up.geometry.set=function(e){this._geometry=e},ec.prototype.toJSON=function(){var e={geometry:this.geometry};for(var t in this)t!=="_geometry"&&t!=="_vectorTileFeature"&&(e[t]=this[t]);return e},Object.defineProperties(ec.prototype,up);var zs=function(){this.state={},this.stateChanges={},this.deletedStates={}};zs.prototype.updateState=function(e,t,r){var a=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][a]=this.stateChanges[e][a]||{},Ue(this.stateChanges[e][a],r),this.deletedStates[e]===null)for(var l in this.deletedStates[e]={},this.state[e])l!==a&&(this.deletedStates[e][l]=null);else if(this.deletedStates[e]&&this.deletedStates[e][a]===null)for(var c in this.deletedStates[e][a]={},this.state[e][a])r[c]||(this.deletedStates[e][a][c]=null);else for(var h in r)this.deletedStates[e]&&this.deletedStates[e][a]&&this.deletedStates[e][a][h]===null&&delete this.deletedStates[e][a][h]},zs.prototype.removeFeatureState=function(e,t,r){if(this.deletedStates[e]!==null){var a=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&t!==void 0)this.deletedStates[e][a]!==null&&(this.deletedStates[e][a]=this.deletedStates[e][a]||{},this.deletedStates[e][a][r]=null);else if(t!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][a])for(r in this.deletedStates[e][a]={},this.stateChanges[e][a])this.deletedStates[e][a][r]=null;else this.deletedStates[e][a]=null;else this.deletedStates[e]=null}},zs.prototype.getState=function(e,t){var r=String(t),a=Ue({},(this.state[e]||{})[r],(this.stateChanges[e]||{})[r]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){var l=this.deletedStates[e][t];if(l===null)return{};for(var c in l)delete a[c]}return a},zs.prototype.initializeTileState=function(e,t){e.setFeatureState(this.state,t)},zs.prototype.coalesceChanges=function(e,t){var r={};for(var a in this.stateChanges){this.state[a]=this.state[a]||{};var l={};for(var c in this.stateChanges[a])this.state[a][c]||(this.state[a][c]={}),Ue(this.state[a][c],this.stateChanges[a][c]),l[c]=this.state[a][c];r[a]=l}for(var h in this.deletedStates){this.state[h]=this.state[h]||{};var m={};if(this.deletedStates[h]===null)for(var g in this.state[h])m[g]={},this.state[h][g]={};else for(var b in this.deletedStates[h]){if(this.deletedStates[h][b]===null)this.state[h][b]={};else for(var S=0,I=Object.keys(this.deletedStates[h][b]);S<I.length;S+=1)delete this.state[h][b][I[S]];m[b]=this.state[h][b]}r[h]=r[h]||{},Ue(r[h],m)}if(this.stateChanges={},this.deletedStates={},Object.keys(r).length!==0)for(var C in e)e[C].setFeatureState(r,t)};var Oo=function(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Rn(8192,16,0),this.grid3D=new Rn(8192,16,0),this.featureIndexArray=new A,this.promoteId=t};function sy(e,t,r,a,l){return Le(e,(function(c,h){var m=t instanceof Ba?t.get(h):null;return m&&m.evaluate?m.evaluate(r,a,l):m}))}function uy(e){for(var t=1/0,r=1/0,a=-1/0,l=-1/0,c=0,h=e;c<h.length;c+=1){var m=h[c];t=Math.min(t,m.x),r=Math.min(r,m.y),a=Math.max(a,m.x),l=Math.max(l,m.y)}return{minX:t,minY:r,maxX:a,maxY:l}}function b0(e,t){return t-e}Oo.prototype.insert=function(e,t,r,a,l,c){var h=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,a,l);for(var m=c?this.grid3D:this.grid,g=0;g<t.length;g++){for(var b=t[g],S=[1/0,1/0,-1/0,-1/0],I=0;I<b.length;I++){var C=b[I];S[0]=Math.min(S[0],C.x),S[1]=Math.min(S[1],C.y),S[2]=Math.max(S[2],C.x),S[3]=Math.max(S[3],C.y)}S[0]<8192&&S[1]<8192&&S[2]>=0&&S[3]>=0&&m.insert(h,S[0],S[1],S[2],S[3])}},Oo.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ss.VectorTile(new Nl(this.rawTileData)).layers,this.sourceLayerCoder=new Ql(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Oo.prototype.query=function(e,t,r,a){var l=this;this.loadVTLayers();for(var c=e.params||{},h=8192/e.tileSize/e.scale,m=as(c.filter),g=e.queryGeometry,b=e.queryPadding*h,S=uy(g),I=this.grid.query(S.minX-b,S.minY-b,S.maxX+b,S.maxY+b),C=uy(e.cameraQueryGeometry),z=this.grid3D.query(C.minX-b,C.minY-b,C.maxX+b,C.maxY+b,(function(ce,he,xe,Pe){return(function(ze,rt,Oe,ot,qe){for(var bt=0,pt=ze;bt<pt.length;bt+=1){var Qe=pt[bt];if(rt<=Qe.x&&Oe<=Qe.y&&ot>=Qe.x&&qe>=Qe.y)return!0}var Tt=[new X(rt,Oe),new X(rt,qe),new X(ot,qe),new X(ot,Oe)];if(ze.length>2){for(var vt=0,Lt=Tt;vt<Lt.length;vt+=1)if(Pn(ze,Lt[vt]))return!0}for(var at=0;at<ze.length-1;at++)if(Fa(ze[at],ze[at+1],Tt))return!0;return!1})(e.cameraQueryGeometry,ce-b,he-b,xe+b,Pe+b)})),j=0,G=z;j<G.length;j+=1)I.push(G[j]);I.sort(b0);for(var te,K={},oe=function(ce){var he=I[ce];if(he!==te){te=he;var xe=l.featureIndexArray.get(he),Pe=null;l.loadMatchingFeature(K,xe.bucketIndex,xe.sourceLayerIndex,xe.featureIndex,m,c.layers,c.availableImages,t,r,a,(function(ze,rt,Oe){return Pe||(Pe=wr(ze)),rt.queryIntersectsFeature(g,ze,Oe,Pe,l.z,e.transform,h,e.pixelPosMatrix)}))}},le=0;le<I.length;le++)oe(le);return K},Oo.prototype.loadMatchingFeature=function(e,t,r,a,l,c,h,m,g,b,S){var I=this.bucketLayerIDs[t];if(!c||(function(ze,rt){for(var Oe=0;Oe<ze.length;Oe++)if(rt.indexOf(ze[Oe])>=0)return!0;return!1})(c,I)){var C=this.sourceLayerCoder.decode(r),z=this.vtLayers[C].feature(a);if(l.needGeometry){var j=Mr(z,!0);if(!l.filter(new kt(this.tileID.overscaledZ),j,this.tileID.canonical))return}else if(!l.filter(new kt(this.tileID.overscaledZ),z))return;for(var G=this.getId(z,C),te=0;te<I.length;te++){var K=I[te];if(!(c&&c.indexOf(K)<0)){var oe=m[K];if(oe){var le={};G!==void 0&&b&&(le=b.getState(oe.sourceLayer||"_geojsonTileLayer",G));var ce=Ue({},g[K]);ce.paint=sy(ce.paint,oe.paint,z,le,h),ce.layout=sy(ce.layout,oe.layout,z,le,h);var he=!S||S(z,oe,le);if(he){var xe=new ec(z,this.z,this.x,this.y,G);xe.layer=ce;var Pe=e[K];Pe===void 0&&(Pe=e[K]=[]),Pe.push({featureIndex:a,feature:xe,intersectionZ:he})}}}}}},Oo.prototype.lookupSymbolFeatures=function(e,t,r,a,l,c,h,m){var g={};this.loadVTLayers();for(var b=as(l),S=0,I=e;S<I.length;S+=1)this.loadMatchingFeature(g,r,a,I[S],b,c,h,m,t);return g},Oo.prototype.hasLayer=function(e){for(var t=0,r=this.bucketLayerIDs;t<r.length;t+=1)for(var a=0,l=r[t];a<l.length;a+=1)if(e===l[a])return!0;return!1},Oo.prototype.getId=function(e,t){var r=e.id;return this.promoteId&&typeof(r=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[t]])=="boolean"&&(r=Number(r)),r},Xe("FeatureIndex",Oo,{omit:["rawTileData","sourceLayerCoder"]});var ui=function(e,t){this.tileID=e,this.uid=Ke(),this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};ui.prototype.registerFadeDuration=function(e){var t=e+this.timeAdded;t<Xi.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)},ui.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},ui.prototype.loadVectorData=function(e,t,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){for(var a in e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=(function(b,S){var I={};if(!S)return I;for(var C=function(){var G=j[z],te=G.layerIds.map((function(le){return S.getLayer(le)})).filter(Boolean);if(te.length!==0){G.layers=te,G.stateDependentLayerIds&&(G.stateDependentLayers=G.stateDependentLayerIds.map((function(le){return te.filter((function(ce){return ce.id===le}))[0]})));for(var K=0,oe=te;K<oe.length;K+=1)I[oe[K].id]=G}},z=0,j=b;z<j.length;z+=1)C();return I})(e.buckets,t.style),this.hasSymbolBuckets=!1,this.buckets){var l=this.buckets[a];if(l instanceof er){if(this.hasSymbolBuckets=!0,!r)break;l.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var c in this.buckets){var h=this.buckets[c];if(h instanceof er&&h.hasRTLText){this.hasRTLText=!0,Qi.isLoading()||Qi.isLoaded()||xu()!=="deferred"||_n();break}}for(var m in this.queryPadding=0,this.buckets){var g=this.buckets[m];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(m).queryRadius(g))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new o},ui.prototype.unloadVectorData=function(){for(var e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},ui.prototype.getBucket=function(e){return this.buckets[e.id]},ui.prototype.upload=function(e){for(var t in this.buckets){var r=this.buckets[t];r.uploadPending()&&r.upload(e)}var a=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new qa(e,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new qa(e,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)},ui.prototype.prepare=function(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)},ui.prototype.queryRenderedFeatures=function(e,t,r,a,l,c,h,m,g,b){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:a,cameraQueryGeometry:l,scale:c,tileSize:this.tileSize,pixelPosMatrix:b,transform:m,params:h,queryPadding:this.queryPadding*g},e,t,r):{}},ui.prototype.querySourceFeatures=function(e,t){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var a=r.loadVTLayers(),l=t?t.sourceLayer:"",c=a._geojsonTileLayer||a[l];if(c)for(var h=as(t&&t.filter),m=this.tileID.canonical,g=m.z,b=m.x,S=m.y,I={z:g,x:b,y:S},C=0;C<c.length;C++){var z=c.feature(C);if(h.needGeometry){var j=Mr(z,!0);if(!h.filter(new kt(this.tileID.overscaledZ),j,this.tileID.canonical))continue}else if(!h.filter(new kt(this.tileID.overscaledZ),z))continue;var G=r.getId(z,l),te=new ec(z,g,b,S,G);te.tile=I,e.push(te)}}},ui.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},ui.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},ui.prototype.setExpiryData=function(e){var t=this.expirationTime;if(e.cacheControl){var r=bi(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var a=Date.now(),l=!1;if(this.expirationTime>a)l=!1;else if(t)if(this.expirationTime<t)l=!0;else{var c=this.expirationTime-t;c?this.expirationTime=a+Math.max(c,3e4):l=!0}else l=!0;l?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},ui.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)},ui.prototype.setFeatureState=function(e,t){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&Object.keys(e).length!==0){var r=this.latestFeatureIndex.loadVTLayers();for(var a in this.buckets)if(t.style.hasLayer(a)){var l=this.buckets[a],c=l.layers[0].sourceLayer||"_geojsonTileLayer",h=r[c],m=e[c];if(h&&m&&Object.keys(m).length!==0){l.update(m,h,this.imageAtlas&&this.imageAtlas.patternPositions||{});var g=t&&t.style&&t.style.getLayer(a);g&&(this.queryPadding=Math.max(this.queryPadding,g.queryRadius(l)))}}}},ui.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},ui.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Xi.now()},ui.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},ui.prototype.setHoldDuration=function(e){this.symbolFadeHoldUntil=Xi.now()+e},ui.prototype.setDependencies=function(e,t){for(var r={},a=0,l=t;a<l.length;a+=1)r[l[a]]=!0;this.dependencies[e]=r},ui.prototype.hasDependency=function(e,t){for(var r=0,a=e;r<a.length;r+=1){var l=this.dependencies[a[r]];if(l){for(var c=0,h=t;c<h.length;c+=1)if(l[h[c]])return!0}}return!1};var ua=J.performance,ly=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},ua.mark(this._marks.start)};ly.prototype.finish=function(){ua.mark(this._marks.end);var e=ua.getEntriesByName(this._marks.measure);return e.length===0&&(ua.measure(this._marks.measure,this._marks.start,this._marks.end),e=ua.getEntriesByName(this._marks.measure),ua.clearMarks(this._marks.start),ua.clearMarks(this._marks.end),ua.clearMeasures(this._marks.measure)),e},u.Actor=Bs,u.AlphaImage=Va,u.CanonicalTileID=Na,u.CollisionBoxArray=o,u.Color=$t,u.DEMData=Fo,u.DataConstantProperty=it,u.DictionaryCoder=Ql,u.EXTENT=8192,u.ErrorEvent=re,u.EvaluationParameters=kt,u.Event=$,u.Evented=ie,u.FeatureIndex=Oo,u.FillBucket=Vn,u.FillExtrusionBucket=qn,u.ImageAtlas=Ru,u.ImagePosition=Gl,u.LineBucket=Fi,u.LngLat=gr,u.LngLatBounds=Zr,u.MercatorCoordinate=Ua,u.ONE_EM=24,u.OverscaledTileID=Wr,u.Point=X,u.Point$1=X,u.Properties=vi,u.Protobuf=Nl,u.RGBAImage=Hi,u.RequestManager=hr,u.RequestPerformance=ly,u.ResourceType=jt,u.SegmentVector=F,u.SourceFeatureState=zs,u.StructArrayLayout1ui2=Au,u.StructArrayLayout2f1f2i16=zo,u.StructArrayLayout2i4=Bo,u.StructArrayLayout3ui6=to,u.StructArrayLayout4i8=wu,u.SymbolBucket=er,u.Texture=qa,u.Tile=ui,u.Transitionable=yi,u.Uniform1f=ke,u.Uniform1i=Te,u.Uniform2f=Ce,u.Uniform3f=$e,u.Uniform4f=nt,u.UniformColor=ut,u.UniformMatrix4f=Ft,u.UnwrappedTileID=ay,u.ValidationError=H,u.WritingMode=pn,u.ZoomHistory=yu,u.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},u.addDynamicAttributes=np,u.asyncAll=function(e,t,r){if(!e.length)return r(null,[]);var a=e.length,l=new Array(e.length),c=null;e.forEach((function(h,m){t(h,(function(g,b){g&&(c=g),l[m]=b,--a==0&&r(c,l)}))}))},u.bezier=be,u.bindAll=we,u.browser=Xi,u.cacheEntryPossiblyAdded=function(e){++de>Zo&&(e.getActor().send("enforceCacheSizeLimit",Bn),de=0)},u.clamp=Ze,u.clearTileCache=function(e){var t=J.caches.delete("mapbox-tiles");e&&t.catch(e).then((function(){return e()}))},u.clipLine=Gm,u.clone=function(e){var t=new Zt(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},u.clone$1=Mt,u.clone$2=function(e){var t=new Zt(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},u.collisionCircleLayout=Ub,u.config=Nt,u.create=function(){var e=new Zt(16);return Zt!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},u.create$1=function(){var e=new Zt(9);return Zt!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},u.create$2=function(){var e=new Zt(4);return Zt!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},u.createCommonjsModule=U,u.createExpression=ns,u.createLayout=ai,u.createStyleLayer=function(e){return e.type==="custom"?new _0(e):new x0[e.type](e)},u.cross=function(e,t,r){var a=t[0],l=t[1],c=t[2],h=r[0],m=r[1],g=r[2];return e[0]=l*g-c*m,e[1]=c*h-a*g,e[2]=a*m-l*h,e},u.deepEqual=function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(var a=0;a<t.length;a++)if(!e(t[a],r[a]))return!1;return!0}if(typeof t=="object"&&t!==null&&r!==null){if(typeof r!="object"||Object.keys(t).length!==Object.keys(r).length)return!1;for(var l in t)if(!e(t[l],r[l]))return!1;return!0}return t===r},u.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},u.dot$1=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},u.ease=De,u.emitValidationErrors=Ca,u.endsWith=je,u.enforceCacheSizeLimit=function(e){jn(),ri&&ri.then((function(t){t.keys().then((function(r){for(var a=0;a<r.length-e;a++)t.delete(r[a])}))}))},u.evaluateSizeForFeature=Om,u.evaluateSizeForZoom=Vm,u.evaluateVariableOffset=Wm,u.evented=_u,u.extend=Ue,u.featureFilter=as,u.filterObject=tt,u.fromRotation=function(e,t){var r=Math.sin(t),a=Math.cos(t);return e[0]=a,e[1]=r,e[2]=0,e[3]=-r,e[4]=a,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},u.getAnchorAlignment=ep,u.getAnchorJustification=ip,u.getArrayBuffer=ii,u.getImage=P,u.getJSON=function(e,t){return qi(Ue(e,{type:"json"}),t)},u.getRTLTextPluginStatus=xu,u.getReferrer=Kt,u.getVideo=function(e,t){var r,a,l=J.document.createElement("video");l.muted=!0,l.onloadstart=function(){t(null,l)};for(var c=0;c<e.length;c++){var h=J.document.createElement("source");r=e[c],a=void 0,(a=J.document.createElement("a")).href=r,(a.protocol!==J.document.location.protocol||a.host!==J.document.location.host)&&(l.crossOrigin="Anonymous"),h.src=e[c],l.appendChild(h)}return{cancel:function(){}}},u.identity=en,u.invert=function(e,t){var r=t[0],a=t[1],l=t[2],c=t[3],h=t[4],m=t[5],g=t[6],b=t[7],S=t[8],I=t[9],C=t[10],z=t[11],j=t[12],G=t[13],te=t[14],K=t[15],oe=r*m-a*h,le=r*g-l*h,ce=r*b-c*h,he=a*g-l*m,xe=a*b-c*m,Pe=l*b-c*g,ze=S*G-I*j,rt=S*te-C*j,Oe=S*K-z*j,ot=I*te-C*G,qe=I*K-z*G,bt=C*K-z*te,pt=oe*bt-le*qe+ce*ot+he*Oe-xe*rt+Pe*ze;return pt?(e[0]=(m*bt-g*qe+b*ot)*(pt=1/pt),e[1]=(l*qe-a*bt-c*ot)*pt,e[2]=(G*Pe-te*xe+K*he)*pt,e[3]=(C*xe-I*Pe-z*he)*pt,e[4]=(g*Oe-h*bt-b*rt)*pt,e[5]=(r*bt-l*Oe+c*rt)*pt,e[6]=(te*ce-j*Pe-K*le)*pt,e[7]=(S*Pe-C*ce+z*le)*pt,e[8]=(h*qe-m*Oe+b*ze)*pt,e[9]=(a*Oe-r*qe-c*ze)*pt,e[10]=(j*xe-G*ce+K*oe)*pt,e[11]=(I*ce-S*xe-z*oe)*pt,e[12]=(m*rt-h*ot-g*ze)*pt,e[13]=(r*ot-a*rt+l*ze)*pt,e[14]=(G*le-j*he-te*oe)*pt,e[15]=(S*he-I*le+C*oe)*pt,e):null},u.isChar=Re,u.isMapboxURL=jr,u.keysDifference=function(e,t){var r=[];for(var a in e)a in t||r.push(a);return r},u.makeRequest=qi,u.mapObject=Le,u.mercatorXfromLng=iy,u.mercatorYfromLat=ny,u.mercatorZfromAltitude=oy,u.mul=Nc,u.multiply=Li,u.mvt=Ss,u.nextPowerOfTwo=function(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},u.normalize=function(e,t){var r=t[0],a=t[1],l=t[2],c=r*r+a*a+l*l;return c>0&&(c=1/Math.sqrt(c)),e[0]=t[0]*c,e[1]=t[1]*c,e[2]=t[2]*c,e},u.number=Vr,u.offscreenCanvasSupported=_e,u.ortho=function(e,t,r,a,l,c,h){var m=1/(t-r),g=1/(a-l),b=1/(c-h);return e[0]=-2*m,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*g,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*b,e[11]=0,e[12]=(t+r)*m,e[13]=(l+a)*g,e[14]=(h+c)*b,e[15]=1,e},u.parseGlyphPBF=function(e){return new Nl(e).readFields(Yb,[])},u.pbf=Nl,u.performSymbolLayout=function(e,t,r,a,l,c,h){e.createArrays(),e.tilePixelRatio=8192/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;var m=e.layers[0].layout,g=e.layers[0]._unevaluatedLayout._values,b={};if(e.textSizeData.kind==="composite"){var S=e.textSizeData,I=S.maxZoom;b.compositeTextSizes=[g["text-size"].possiblyEvaluate(new kt(S.minZoom),h),g["text-size"].possiblyEvaluate(new kt(I),h)]}if(e.iconSizeData.kind==="composite"){var C=e.iconSizeData,z=C.maxZoom;b.compositeIconSizes=[g["icon-size"].possiblyEvaluate(new kt(C.minZoom),h),g["icon-size"].possiblyEvaluate(new kt(z),h)]}b.layoutTextSize=g["text-size"].possiblyEvaluate(new kt(e.zoom+1),h),b.layoutIconSize=g["icon-size"].possiblyEvaluate(new kt(e.zoom+1),h),b.textMaxSize=g["text-size"].possiblyEvaluate(new kt(18));for(var j=24*m.get("text-line-height"),G=m.get("text-rotation-alignment")==="map"&&m.get("symbol-placement")!=="point",te=m.get("text-keep-upright"),K=m.get("text-size"),oe=function(){var he=ce[le],xe=m.get("text-font").evaluate(he,{},h).join(","),Pe=K.evaluate(he,{},h),ze=b.layoutTextSize.evaluate(he,{},h),rt=b.layoutIconSize.evaluate(he,{},h),Oe={horizontal:{},vertical:void 0},ot=he.text,qe=[0,0];if(ot){var bt=ot.toString(),pt=24*m.get("text-letter-spacing").evaluate(he,{},h),Qe=(function(Bt){for(var nr=0,Jt=Bt;nr<Jt.length;nr+=1)if(Ot=Jt[nr].charCodeAt(0),Re.Arabic(Ot)||Re["Arabic Supplement"](Ot)||Re["Arabic Extended-A"](Ot)||Re["Arabic Presentation Forms-A"](Ot)||Re["Arabic Presentation Forms-B"](Ot))return!1;var Ot;return!0})(bt)?pt:0,Tt=m.get("text-anchor").evaluate(he,{},h),vt=m.get("text-variable-anchor");if(!vt){var Lt=m.get("text-radial-offset").evaluate(he,{},h);qe=Lt?Wm(Tt,[24*Lt,rp]):m.get("text-offset").evaluate(he,{},h).map((function(Bt){return 24*Bt}))}var at=G?"center":m.get("text-justify").evaluate(he,{},h),Vt=m.get("symbol-placement"),_r=Vt==="point"?24*m.get("text-max-width").evaluate(he,{},h):0,Tr=function(){e.allowVerticalPlacement&&vu(bt)&&(Oe.vertical=$l(ot,t,r,l,xe,_r,j,Tt,"left",Qe,qe,pn.vertical,!0,Vt,ze,Pe))};if(!G&&vt){for(var Sr=at==="auto"?vt.map((function(Bt){return ip(Bt)})):[at],xr=!1,Ar=0;Ar<Sr.length;Ar++){var Qr=Sr[Ar];if(!Oe.horizontal[Qr])if(xr)Oe.horizontal[Qr]=Oe.horizontal[0];else{var ei=$l(ot,t,r,l,xe,_r,j,"center",Qr,Qe,qe,pn.horizontal,!1,Vt,ze,Pe);ei&&(Oe.horizontal[Qr]=ei,xr=ei.positionedLines.length===1)}}Tr()}else{at==="auto"&&(at=ip(Tt));var Ci=$l(ot,t,r,l,xe,_r,j,Tt,at,Qe,qe,pn.horizontal,!1,Vt,ze,Pe);Ci&&(Oe.horizontal[at]=Ci),Tr(),vu(bt)&&G&&te&&(Oe.vertical=$l(ot,t,r,l,xe,_r,j,Tt,at,Qe,qe,pn.vertical,!1,Vt,ze,Pe))}}var li=void 0,ki=!1;if(he.icon&&he.icon.name){var Br=a[he.icon.name];Br&&(li=(function(Bt,nr,Jt){var Ot=ep(Jt),Oi=nr[0]-Bt.displaySize[0]*Ot.horizontalAlign,_i=nr[1]-Bt.displaySize[1]*Ot.verticalAlign;return{image:Bt,top:_i,bottom:_i+Bt.displaySize[1],left:Oi,right:Oi+Bt.displaySize[0]}})(l[he.icon.name],m.get("icon-offset").evaluate(he,{},h),m.get("icon-anchor").evaluate(he,{},h)),ki=Br.sdf,e.sdfIcons===void 0?e.sdfIcons=Br.sdf:e.sdfIcons!==Br.sdf&&St("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Br.pixelRatio!==e.pixelRatio||m.get("icon-rotate").constantOr(1)!==0)&&(e.iconsNeedLinear=!0))}var ci=Xm(Oe.horizontal)||Oe.vertical;e.iconsInText=!!ci&&ci.iconsInText,(ci||li)&&(function(Bt,nr,Jt,Ot,Oi,_i,dr,Ur,xi,qt,so){var hn=_i.textMaxSize.evaluate(nr,{});hn===void 0&&(hn=dr);var uo,zr=Bt.layers[0].layout,lo=zr.get("icon-offset").evaluate(nr,{},so),kn=Xm(Jt.horizontal),Ds=dr/24,ja=Bt.tilePixelRatio*Ds,Rs=Bt.tilePixelRatio*hn/24,Vo=Bt.tilePixelRatio*Ur,Ls=Bt.tilePixelRatio*zr.get("symbol-spacing"),tc=zr.get("text-padding")*Bt.tilePixelRatio,Fs=zr.get("icon-padding")*Bt.tilePixelRatio,Ou=zr.get("text-max-angle")/180*Math.PI,rc=zr.get("text-rotation-alignment")==="map"&&zr.get("symbol-placement")!=="point",ic=zr.get("icon-rotation-alignment")==="map"&&zr.get("symbol-placement")!=="point",qo=zr.get("symbol-placement"),Vu=Ls/2,Os=zr.get("icon-text-fit");Ot&&Os!=="none"&&(Bt.allowVerticalPlacement&&Jt.vertical&&(uo=Fm(Ot,Jt.vertical,Os,zr.get("icon-text-fit-padding"),lo,Ds)),kn&&(Ot=Fm(Ot,kn,Os,zr.get("icon-text-fit-padding"),lo,Ds)));var la=function(w0,Wu){Wu.x<0||Wu.x>=8192||Wu.y<0||Wu.y>=8192||(function(Dr,Un,S0,ca,hp,hy,lc,co,cc,Hu,pc,hc,fp,fy,Xu,dy,my,yy,vy,gy,fn,fc,_y,po,I0){var xy,$a,js,Gs,$s,Zs=Dr.addToLineVertexArray(Un,S0),by=0,wy=0,Sy=0,Iy=0,dp=-1,mp=-1,Uo={},Ty=N(""),yp=0,vp=0;if(co._unevaluatedLayout.getValue("text-radial-offset")===void 0?(yp=(xy=co.layout.get("text-offset").evaluate(fn,{},po).map((function(Ju){return 24*Ju})))[0],vp=xy[1]):(yp=24*co.layout.get("text-radial-offset").evaluate(fn,{},po),vp=rp),Dr.allowVerticalPlacement&&ca.vertical){var Ay=co.layout.get("text-rotate").evaluate(fn,{},po)+90;Gs=new Kl(cc,Un,Hu,pc,hc,ca.vertical,fp,fy,Xu,Ay),lc&&($s=new Kl(cc,Un,Hu,pc,hc,lc,my,yy,Xu,Ay))}if(hp){var gp=co.layout.get("icon-rotate").evaluate(fn,{}),Ey=co.layout.get("icon-text-fit")!=="none",Py=$m(hp,gp,_y,Ey),_p=lc?$m(lc,gp,_y,Ey):void 0;js=new Kl(cc,Un,Hu,pc,hc,hp,my,yy,!1,gp),by=4*Py.length;var Cy=Dr.iconSizeData,Ku=null;Cy.kind==="source"?(Ku=[128*co.layout.get("icon-size").evaluate(fn,{})])[0]>32640&&St(Dr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):Cy.kind==="composite"&&((Ku=[128*fc.compositeIconSizes[0].evaluate(fn,{},po),128*fc.compositeIconSizes[1].evaluate(fn,{},po)])[0]>32640||Ku[1]>32640)&&St(Dr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),Dr.addSymbols(Dr.icon,Py,Ku,gy,vy,fn,!1,Un,Zs.lineStartIndex,Zs.lineLength,-1,po),dp=Dr.icon.placedSymbolArray.length-1,_p&&(wy=4*_p.length,Dr.addSymbols(Dr.icon,_p,Ku,gy,vy,fn,pn.vertical,Un,Zs.lineStartIndex,Zs.lineLength,-1,po),mp=Dr.icon.placedSymbolArray.length-1)}for(var ky in ca.horizontal){var dc=ca.horizontal[ky];if(!$a){Ty=N(dc.text);var T0=co.layout.get("text-rotate").evaluate(fn,{},po);$a=new Kl(cc,Un,Hu,pc,hc,dc,fp,fy,Xu,T0)}var My=dc.positionedLines.length===1;if(Sy+=Hm(Dr,Un,dc,hy,co,Xu,fn,dy,Zs,ca.vertical?pn.horizontal:pn.horizontalOnly,My?Object.keys(ca.horizontal):[ky],Uo,dp,fc,po),My)break}ca.vertical&&(Iy+=Hm(Dr,Un,ca.vertical,hy,co,Xu,fn,dy,Zs,pn.vertical,["vertical"],Uo,mp,fc,po));var A0=$a?$a.boxStartIndex:Dr.collisionBoxArray.length,E0=$a?$a.boxEndIndex:Dr.collisionBoxArray.length,P0=Gs?Gs.boxStartIndex:Dr.collisionBoxArray.length,C0=Gs?Gs.boxEndIndex:Dr.collisionBoxArray.length,k0=js?js.boxStartIndex:Dr.collisionBoxArray.length,M0=js?js.boxEndIndex:Dr.collisionBoxArray.length,B0=$s?$s.boxStartIndex:Dr.collisionBoxArray.length,z0=$s?$s.boxEndIndex:Dr.collisionBoxArray.length,ho=-1,mc=function(Ju,zy){return Ju&&Ju.circleDiameter?Math.max(Ju.circleDiameter,zy):zy};ho=mc($a,ho),ho=mc(Gs,ho),ho=mc(js,ho);var By=(ho=mc($s,ho))>-1?1:0;By&&(ho*=I0/24),Dr.glyphOffsetArray.length>=er.MAX_GLYPHS&&St("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),fn.sortKey!==void 0&&Dr.addToSortKeyRanges(Dr.symbolInstances.length,fn.sortKey),Dr.symbolInstances.emplaceBack(Un.x,Un.y,Uo.right>=0?Uo.right:-1,Uo.center>=0?Uo.center:-1,Uo.left>=0?Uo.left:-1,Uo.vertical||-1,dp,mp,Ty,A0,E0,P0,C0,k0,M0,B0,z0,Hu,Sy,Iy,by,wy,By,0,fp,yp,vp,ho)})(Bt,Wu,w0,Jt,Ot,Oi,uo,Bt.layers[0],Bt.collisionBoxArray,nr.index,nr.sourceLayerIndex,Bt.index,ja,tc,rc,xi,Vo,Fs,ic,lo,nr,_i,qt,so,dr)};if(qo==="line")for(var Vs=0,nc=Gm(nr.geometry,0,0,8192,8192);Vs<nc.length;Vs+=1)for(var oc=nc[Vs],qu=0,Uu=o0(oc,Ls,Ou,Jt.vertical||kn,Ot,24,Rs,Bt.overscaling,8192);qu<Uu.length;qu+=1){var ac=Uu[qu];kn&&l0(Bt,kn.text,Vu,ac)||la(oc,ac)}else if(qo==="line-center")for(var Nu=0,ju=nr.geometry;Nu<ju.length;Nu+=1){var Gu=ju[Nu];if(Gu.length>1){var sc=n0(Gu,Ou,Jt.vertical||kn,Ot,24,Rs);sc&&la(Gu,sc)}}else if(nr.type==="Polygon")for(var qs=0,uc=Xc(nr.geometry,0);qs<uc.length;qs+=1){var Us=uc[qs],$u=s0(Us,16);la(Us[0],new Es($u.x,$u.y,0))}else if(nr.type==="LineString")for(var Ga=0,Zu=nr.geometry;Ga<Zu.length;Ga+=1){var Ns=Zu[Ga];la(Ns,new Es(Ns[0].x,Ns[0].y,0))}else if(nr.type==="Point")for(var lp=0,cy=nr.geometry;lp<cy.length;lp+=1)for(var cp=0,py=cy[lp];cp<py.length;cp+=1){var pp=py[cp];la([pp],new Es(pp.x,pp.y,0))}})(e,he,Oe,li,a,b,ze,rt,qe,ki,h)},le=0,ce=e.features;le<ce.length;le+=1)oe();c&&e.generateCollisionDebugBuffers()},u.perspective=function(e,t,r,a,l){var c,h=1/Math.tan(t/2);return e[0]=h/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=h,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,l!=null&&l!==1/0?(e[10]=(l+a)*(c=1/(a-l)),e[14]=2*l*a*c):(e[10]=-1,e[14]=-2*a),e},u.pick=function(e,t){for(var r={},a=0;a<t.length;a++){var l=t[a];l in e&&(r[l]=e[l])}return r},u.plugin=Qi,u.polygonIntersectsPolygon=no,u.postMapLoadEvent=Mn,u.postTurnstileEvent=$o,u.potpack=zm,u.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],u.register=Xe,u.registerForPluginStateChange=function(e){return e({pluginStatus:$i,pluginURL:Ln}),_u.on("pluginStateChange",e),e},u.renderColorRamp=dm,u.rotate=function(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3],m=Math.sin(r),g=Math.cos(r);return e[0]=a*g+c*m,e[1]=l*g+h*m,e[2]=a*-m+c*g,e[3]=l*-m+h*g,e},u.rotateX=function(e,t,r){var a=Math.sin(r),l=Math.cos(r),c=t[4],h=t[5],m=t[6],g=t[7],b=t[8],S=t[9],I=t[10],C=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=c*l+b*a,e[5]=h*l+S*a,e[6]=m*l+I*a,e[7]=g*l+C*a,e[8]=b*l-c*a,e[9]=S*l-h*a,e[10]=I*l-m*a,e[11]=C*l-g*a,e},u.rotateZ=function(e,t,r){var a=Math.sin(r),l=Math.cos(r),c=t[0],h=t[1],m=t[2],g=t[3],b=t[4],S=t[5],I=t[6],C=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=c*l+b*a,e[1]=h*l+S*a,e[2]=m*l+I*a,e[3]=g*l+C*a,e[4]=b*l-c*a,e[5]=S*l-h*a,e[6]=I*l-m*a,e[7]=C*l-g*a,e},u.scale=function(e,t,r){var a=r[0],l=r[1],c=r[2];return e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e[3]=t[3]*a,e[4]=t[4]*l,e[5]=t[5]*l,e[6]=t[6]*l,e[7]=t[7]*l,e[8]=t[8]*c,e[9]=t[9]*c,e[10]=t[10]*c,e[11]=t[11]*c,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},u.scale$1=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},u.scale$2=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},u.setCacheLimits=function(e,t){Bn=e,Zo=t},u.setRTLTextPlugin=function(e,t,r){if(r===void 0&&(r=!1),$i==="deferred"||$i==="loading"||$i==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");Ln=Xi.resolveURL(e),$i="deferred",fs=t,Ma(),r||_n()},u.sphericalToCartesian=function(e){var t=e[0],r=e[1],a=e[2];return r+=90,r*=Math.PI/180,a*=Math.PI/180,{x:t*Math.cos(r)*Math.sin(a),y:t*Math.sin(r)*Math.sin(a),z:t*Math.cos(a)}},u.sqrLen=function(e){var t=e[0],r=e[1];return t*t+r*r},u.styleSpec=L,u.sub=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e},u.symbolSize=i0,u.transformMat3=function(e,t,r){var a=t[0],l=t[1],c=t[2];return e[0]=a*r[0]+l*r[3]+c*r[6],e[1]=a*r[1]+l*r[4]+c*r[7],e[2]=a*r[2]+l*r[5]+c*r[8],e},u.transformMat4=_s,u.translate=function(e,t,r){var a,l,c,h,m,g,b,S,I,C,z,j,G=r[0],te=r[1],K=r[2];return t===e?(e[12]=t[0]*G+t[4]*te+t[8]*K+t[12],e[13]=t[1]*G+t[5]*te+t[9]*K+t[13],e[14]=t[2]*G+t[6]*te+t[10]*K+t[14],e[15]=t[3]*G+t[7]*te+t[11]*K+t[15]):(l=t[1],c=t[2],h=t[3],m=t[4],g=t[5],b=t[6],S=t[7],I=t[8],C=t[9],z=t[10],j=t[11],e[0]=a=t[0],e[1]=l,e[2]=c,e[3]=h,e[4]=m,e[5]=g,e[6]=b,e[7]=S,e[8]=I,e[9]=C,e[10]=z,e[11]=j,e[12]=a*G+m*te+I*K+t[12],e[13]=l*G+g*te+C*K+t[13],e[14]=c*G+b*te+z*K+t[14],e[15]=h*G+S*te+j*K+t[15]),e},u.triggerPluginCompletionEvent=Rl,u.uniqueId=Ke,u.validateCustomStyleLayer=function(e){var t=[],r=e.id;return r===void 0&&t.push({message:"layers."+r+': missing required property "id"'}),e.render===void 0&&t.push({message:"layers."+r+': missing required method "render"'}),e.renderingMode&&e.renderingMode!=="2d"&&e.renderingMode!=="3d"&&t.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),t},u.validateLight=qc,u.validateStyle=Ea,u.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},u.vectorTile=Ss,u.version="1.13.3",u.warnOnce=St,u.webpSupported=Nr,u.window=J,u.wrap=He})),D(["./shared"],(function(u){function U(T){var P=typeof T;if(P==="number"||P==="boolean"||P==="string"||T==null)return JSON.stringify(T);if(Array.isArray(T)){for(var B="[",V=0,$=T;V<$.length;V+=1)B+=U($[V])+",";return B+"]"}for(var re=Object.keys(T).sort(),ie="{",L=0;L<re.length;L++)ie+=JSON.stringify(re[L])+":"+U(T[re[L]])+",";return ie+"}"}function M(T){for(var P="",B=0,V=u.refProperties;B<V.length;B+=1)P+="/"+U(T[V[B]]);return P}var Y=function(T){this.keyCache={},T&&this.replace(T)};Y.prototype.replace=function(T){this._layerConfigs={},this._layers={},this.update(T,[])},Y.prototype.update=function(T,P){for(var B=this,V=0,$=T;V<$.length;V+=1){var re=$[V];this._layerConfigs[re.id]=re;var ie=this._layers[re.id]=u.createStyleLayer(re);ie._featureFilter=u.featureFilter(ie.filter),this.keyCache[re.id]&&delete this.keyCache[re.id]}for(var L=0,H=P;L<H.length;L+=1){var se=H[L];delete this.keyCache[se],delete this._layerConfigs[se],delete this._layers[se]}this.familiesBySource={};for(var Ie=0,Ee=(function(Be,Me){for(var yt={},Fe=0;Fe<Be.length;Fe++){var Pt=Me&&Me[Be[Fe].id]||M(Be[Fe]);Me&&(Me[Be[Fe].id]=Pt);var rr=yt[Pt];rr||(rr=yt[Pt]=[]),rr.push(Be[Fe])}var Ct=[];for(var Gt in yt)Ct.push(yt[Gt]);return Ct})(u.values(this._layerConfigs),this.keyCache);Ie<Ee.length;Ie+=1){var ye=Ee[Ie].map((function(Be){return B._layers[Be.id]})),Ae=ye[0];if(Ae.visibility!=="none"){var Je=Ae.source||"",Ge=this.familiesBySource[Je];Ge||(Ge=this.familiesBySource[Je]={});var ge=Ae.sourceLayer||"_geojsonTileLayer",Ve=Ge[ge];Ve||(Ve=Ge[ge]=[]),Ve.push(ye)}}};var X=function(T){var P={},B=[];for(var V in T){var $=T[V],re=P[V]={};for(var ie in $){var L=$[+ie];if(L&&L.bitmap.width!==0&&L.bitmap.height!==0){var H={x:0,y:0,w:L.bitmap.width+2,h:L.bitmap.height+2};B.push(H),re[ie]={rect:H,metrics:L.metrics}}}}var se=u.potpack(B),Ie=new u.AlphaImage({width:se.w||1,height:se.h||1});for(var Ee in T){var ye=T[Ee];for(var Ae in ye){var Je=ye[+Ae];if(Je&&Je.bitmap.width!==0&&Je.bitmap.height!==0){var Ge=P[Ee][Ae].rect;u.AlphaImage.copy(Je.bitmap,Ie,{x:0,y:0},{x:Ge.x+1,y:Ge.y+1},Je.bitmap)}}}this.image=Ie,this.positions=P};u.register("GlyphAtlas",X);var ae=function(T){this.tileID=new u.OverscaledTileID(T.tileID.overscaledZ,T.tileID.wrap,T.tileID.canonical.z,T.tileID.canonical.x,T.tileID.canonical.y),this.uid=T.uid,this.zoom=T.zoom,this.pixelRatio=T.pixelRatio,this.tileSize=T.tileSize,this.source=T.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=T.showCollisionBoxes,this.collectResourceTiming=!!T.collectResourceTiming,this.returnDependencies=!!T.returnDependencies,this.promoteId=T.promoteId};function J(T,P,B){for(var V=new u.EvaluationParameters(P),$=0,re=T;$<re.length;$+=1)re[$].recalculate(V,B)}function Se(T,P){var B=u.getArrayBuffer(T.request,(function(V,$,re,ie){V?P(V):$&&P(null,{vectorTile:new u.vectorTile.VectorTile(new u.pbf($)),rawData:$,cacheControl:re,expires:ie})}));return function(){B.cancel(),P()}}ae.prototype.parse=function(T,P,B,V,$){var re=this;this.status="parsing",this.data=T,this.collisionBoxArray=new u.CollisionBoxArray;var ie=new u.DictionaryCoder(Object.keys(T.layers).sort()),L=new u.FeatureIndex(this.tileID,this.promoteId);L.bucketLayerIDs=[];var H,se,Ie,Ee,ye={},Ae={featureIndex:L,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:B},Je=P.familiesBySource[this.source];for(var Ge in Je){var ge=T.layers[Ge];if(ge){ge.version===1&&u.warnOnce('Vector tile source "'+this.source+'" layer "'+Ge+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var Ve=ie.encode(Ge),Be=[],Me=0;Me<ge.length;Me++){var yt=ge.feature(Me),Fe=L.getId(yt,Ge);Be.push({feature:yt,id:Fe,index:Me,sourceLayerIndex:Ve})}for(var Pt=0,rr=Je[Ge];Pt<rr.length;Pt+=1){var Ct=rr[Pt],Gt=Ct[0];Gt.minzoom&&this.zoom<Math.floor(Gt.minzoom)||Gt.maxzoom&&this.zoom>=Gt.maxzoom||Gt.visibility!=="none"&&(J(Ct,this.zoom,B),(ye[Gt.id]=Gt.createBucket({index:L.bucketLayerIDs.length,layers:Ct,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Ve,sourceID:this.source})).populate(Be,Ae,this.tileID.canonical),L.bucketLayerIDs.push(Ct.map((function(Qt){return Qt.id}))))}}}var Rt=u.mapObject(Ae.glyphDependencies,(function(Qt){return Object.keys(Qt).map(Number)}));Object.keys(Rt).length?V.send("getGlyphs",{uid:this.uid,stacks:Rt},(function(Qt,zt){H||(H=Qt,se=zt,Cr.call(re))})):se={};var wi=Object.keys(Ae.iconDependencies);wi.length?V.send("getImages",{icons:wi,source:this.source,tileID:this.tileID,type:"icons"},(function(Qt,zt){H||(H=Qt,Ie=zt,Cr.call(re))})):Ie={};var Ht=Object.keys(Ae.patternDependencies);function Cr(){if(H)return $(H);if(se&&Ie&&Ee){var Qt=new X(se),zt=new u.ImageAtlas(Ie,Ee);for(var $t in ye){var zi=ye[$t];zi instanceof u.SymbolBucket?(J(zi.layers,this.zoom,B),u.performSymbolLayout(zi,se,Qt.positions,Ie,zt.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):zi.hasPattern&&(zi instanceof u.LineBucket||zi instanceof u.FillBucket||zi instanceof u.FillExtrusionBucket)&&(J(zi.layers,this.zoom,B),zi.addFeatures(Ae,this.tileID.canonical,zt.patternPositions))}this.status="done",$(null,{buckets:u.values(ye).filter((function(ma){return!ma.isEmpty()})),featureIndex:L,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Qt.image,imageAtlas:zt,glyphMap:this.returnDependencies?se:null,iconMap:this.returnDependencies?Ie:null,glyphPositions:this.returnDependencies?Qt.positions:null})}}Ht.length?V.send("getImages",{icons:Ht,source:this.source,tileID:this.tileID,type:"patterns"},(function(Qt,zt){H||(H=Qt,Ee=zt,Cr.call(re))})):Ee={},Cr.call(this)};var be=function(T,P,B,V){this.actor=T,this.layerIndex=P,this.availableImages=B,this.loadVectorData=V||Se,this.loading={},this.loaded={}};be.prototype.loadTile=function(T,P){var B=this,V=T.uid;this.loading||(this.loading={});var $=!!(T&&T.request&&T.request.collectResourceTiming)&&new u.RequestPerformance(T.request),re=this.loading[V]=new ae(T);re.abort=this.loadVectorData(T,(function(ie,L){if(delete B.loading[V],ie||!L)return re.status="done",B.loaded[V]=re,P(ie);var H=L.rawData,se={};L.expires&&(se.expires=L.expires),L.cacheControl&&(se.cacheControl=L.cacheControl);var Ie={};if($){var Ee=$.finish();Ee&&(Ie.resourceTiming=JSON.parse(JSON.stringify(Ee)))}re.vectorTile=L.vectorTile,re.parse(L.vectorTile,B.layerIndex,B.availableImages,B.actor,(function(ye,Ae){if(ye||!Ae)return P(ye);P(null,u.extend({rawTileData:H.slice(0)},Ae,se,Ie))})),B.loaded=B.loaded||{},B.loaded[V]=re}))},be.prototype.reloadTile=function(T,P){var B=this,V=this.loaded,$=T.uid,re=this;if(V&&V[$]){var ie=V[$];ie.showCollisionBoxes=T.showCollisionBoxes;var L=function(H,se){var Ie=ie.reloadCallback;Ie&&(delete ie.reloadCallback,ie.parse(ie.vectorTile,re.layerIndex,B.availableImages,re.actor,Ie)),P(H,se)};ie.status==="parsing"?ie.reloadCallback=L:ie.status==="done"&&(ie.vectorTile?ie.parse(ie.vectorTile,this.layerIndex,this.availableImages,this.actor,L):L())}},be.prototype.abortTile=function(T,P){var B=this.loading,V=T.uid;B&&B[V]&&B[V].abort&&(B[V].abort(),delete B[V]),P()},be.prototype.removeTile=function(T,P){var B=this.loaded,V=T.uid;B&&B[V]&&delete B[V],P()};var De=u.window.ImageBitmap,Ze=function(){this.loaded={}};function He(T,P){if(T.length!==0){Ue(T[0],P);for(var B=1;B<T.length;B++)Ue(T[B],!P)}}function Ue(T,P){for(var B=0,V=0,$=0,re=T.length,ie=re-1;$<re;ie=$++){var L=(T[$][0]-T[ie][0])*(T[ie][1]+T[$][1]),H=B+L;V+=Math.abs(B)>=Math.abs(L)?B-H+L:L-H+B,B=H}B+V>=0!=!!P&&T.reverse()}Ze.prototype.loadTile=function(T,P){var B=T.uid,V=T.encoding,$=T.rawImageData,re=De&&$ instanceof De?this.getImageData($):$,ie=new u.DEMData(B,re,V);this.loaded=this.loaded||{},this.loaded[B]=ie,P(null,ie)},Ze.prototype.getImageData=function(T){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(T.width,T.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=T.width,this.offscreenCanvas.height=T.height,this.offscreenCanvasContext.drawImage(T,0,0,T.width,T.height);var P=this.offscreenCanvasContext.getImageData(-1,-1,T.width+2,T.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new u.RGBAImage({width:P.width,height:P.height},P.data)},Ze.prototype.removeTile=function(T){var P=this.loaded,B=T.uid;P&&P[B]&&delete P[B]};var fe=u.vectorTile.VectorTileFeature.prototype.toGeoJSON,Ke=function(T){this._feature=T,this.extent=u.EXTENT,this.type=T.type,this.properties=T.tags,"id"in T&&!isNaN(T.id)&&(this.id=parseInt(T.id,10))};Ke.prototype.loadGeometry=function(){if(this._feature.type===1){for(var T=[],P=0,B=this._feature.geometry;P<B.length;P+=1){var V=B[P];T.push([new u.Point$1(V[0],V[1])])}return T}for(var $=[],re=0,ie=this._feature.geometry;re<ie.length;re+=1){for(var L=[],H=0,se=ie[re];H<se.length;H+=1){var Ie=se[H];L.push(new u.Point$1(Ie[0],Ie[1]))}$.push(L)}return $},Ke.prototype.toGeoJSON=function(T,P,B){return fe.call(this,T,P,B)};var Ne=function(T){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=u.EXTENT,this.length=T.length,this._features=T};Ne.prototype.feature=function(T){return new Ke(this._features[T])};var It=u.vectorTile.VectorTileFeature,we=je;function je(T,P){this.options=P||{},this.features=T,this.length=T.length}function Le(T,P){this.id=typeof T.id=="number"?T.id:void 0,this.type=T.type,this.rawGeometry=T.type===1?[T.geometry]:T.geometry,this.properties=T.tags,this.extent=P||4096}je.prototype.feature=function(T){return new Le(this.features[T],this.options.extent)},Le.prototype.loadGeometry=function(){var T=this.rawGeometry;this.geometry=[];for(var P=0;P<T.length;P++){for(var B=T[P],V=[],$=0;$<B.length;$++)V.push(new u.Point$1(B[$][0],B[$][1]));this.geometry.push(V)}return this.geometry},Le.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var T=this.geometry,P=1/0,B=-1/0,V=1/0,$=-1/0,re=0;re<T.length;re++)for(var ie=T[re],L=0;L<ie.length;L++){var H=ie[L];P=Math.min(P,H.x),B=Math.max(B,H.x),V=Math.min(V,H.y),$=Math.max($,H.y)}return[P,V,B,$]},Le.prototype.toGeoJSON=It.prototype.toGeoJSON;var tt=Wt,Mt=we;function Wt(T){var P=new u.pbf;return(function(B,V){for(var $ in B.layers)V.writeMessage(3,St,B.layers[$])})(T,P),P.finish()}function St(T,P){var B;P.writeVarintField(15,T.version||1),P.writeStringField(1,T.name||""),P.writeVarintField(5,T.extent||4096);var V={keys:[],values:[],keycache:{},valuecache:{}};for(B=0;B<T.length;B++)V.feature=T.feature(B),P.writeMessage(2,Ut,V);var $=V.keys;for(B=0;B<$.length;B++)P.writeStringField(3,$[B]);var re=V.values;for(B=0;B<re.length;B++)P.writeMessage(4,Rr,re[B])}function Ut(T,P){var B=T.feature;B.id!==void 0&&P.writeVarintField(1,B.id),P.writeMessage(2,Hr,T),P.writeVarintField(3,B.type),P.writeMessage(4,or,B)}function Hr(T,P){var B=T.feature,V=T.keys,$=T.values,re=T.keycache,ie=T.valuecache;for(var L in B.properties){var H=re[L];H===void 0&&(V.push(L),re[L]=H=V.length-1),P.writeVarint(H);var se=B.properties[L],Ie=typeof se;Ie!=="string"&&Ie!=="boolean"&&Ie!=="number"&&(se=JSON.stringify(se));var Ee=Ie+":"+se,ye=ie[Ee];ye===void 0&&($.push(se),ie[Ee]=ye=$.length-1),P.writeVarint(ye)}}function Pr(T,P){return(P<<3)+(7&T)}function bi(T){return T<<1^T>>31}function or(T,P){for(var B=T.loadGeometry(),V=T.type,$=0,re=0,ie=B.length,L=0;L<ie;L++){var H=B[L],se=1;V===1&&(se=H.length),P.writeVarint(Pr(1,se));for(var Ie=V===3?H.length-1:H.length,Ee=0;Ee<Ie;Ee++){Ee===1&&V!==1&&P.writeVarint(Pr(2,Ie-1));var ye=H[Ee].x-$,Ae=H[Ee].y-re;P.writeVarint(bi(ye)),P.writeVarint(bi(Ae)),$+=ye,re+=Ae}V===3&&P.writeVarint(Pr(7,1))}}function Rr(T,P){var B=typeof T;B==="string"?P.writeStringField(1,T):B==="boolean"?P.writeBooleanField(7,T):B==="number"&&(T%1!=0?P.writeDoubleField(3,T):T<0?P.writeSVarintField(6,T):P.writeVarintField(5,T))}function et(T,P,B,V){Lr(T,B,V),Lr(P,2*B,2*V),Lr(P,2*B+1,2*V+1)}function Lr(T,P,B){var V=T[P];T[P]=T[B],T[B]=V}function Xr(T,P,B,V){var $=T-B,re=P-V;return $*$+re*re}tt.fromVectorTileJs=Wt,tt.fromGeojsonVt=function(T,P){P=P||{};var B={};for(var V in T)B[V]=new we(T[V].features,P),B[V].name=V,B[V].version=P.version,B[V].extent=P.extent;return Wt({layers:B})},tt.GeoJSONWrapper=Mt;var Et=function(T){return T[0]},Fr=function(T){return T[1]},Mi=function(T,P,B,V,$){P===void 0&&(P=Et),B===void 0&&(B=Fr),V===void 0&&(V=64),$===void 0&&($=Float64Array),this.nodeSize=V,this.points=T;for(var re=T.length<65536?Uint16Array:Uint32Array,ie=this.ids=new re(T.length),L=this.coords=new $(2*T.length),H=0;H<T.length;H++)ie[H]=H,L[2*H]=P(T[H]),L[2*H+1]=B(T[H]);(function se(Ie,Ee,ye,Ae,Je,Ge){if(!(Je-Ae<=ye)){var ge=Ae+Je>>1;(function Ve(Be,Me,yt,Fe,Pt,rr){for(;Pt>Fe;){if(Pt-Fe>600){var Ct=Pt-Fe+1,Gt=yt-Fe+1,Rt=Math.log(Ct),wi=.5*Math.exp(2*Rt/3),Ht=.5*Math.sqrt(Rt*wi*(Ct-wi)/Ct)*(Gt-Ct/2<0?-1:1);Ve(Be,Me,yt,Math.max(Fe,Math.floor(yt-Gt*wi/Ct+Ht)),Math.min(Pt,Math.floor(yt+(Ct-Gt)*wi/Ct+Ht)),rr)}var Cr=Me[2*yt+rr],Qt=Fe,zt=Pt;for(et(Be,Me,Fe,yt),Me[2*Pt+rr]>Cr&&et(Be,Me,Fe,Pt);Qt<zt;){for(et(Be,Me,Qt,zt),Qt++,zt--;Me[2*Qt+rr]<Cr;)Qt++;for(;Me[2*zt+rr]>Cr;)zt--}Me[2*Fe+rr]===Cr?et(Be,Me,Fe,zt):et(Be,Me,++zt,Pt),zt<=yt&&(Fe=zt+1),yt<=zt&&(Pt=zt-1)}})(Ie,Ee,ge,Ae,Je,Ge%2),se(Ie,Ee,ye,Ae,ge-1,Ge+1),se(Ie,Ee,ye,ge+1,Je,Ge+1)}})(ie,L,V,0,ie.length-1,0)};Mi.prototype.range=function(T,P,B,V){return(function($,re,ie,L,H,se,Ie){for(var Ee,ye,Ae=[0,$.length-1,0],Je=[];Ae.length;){var Ge=Ae.pop(),ge=Ae.pop(),Ve=Ae.pop();if(ge-Ve<=Ie)for(var Be=Ve;Be<=ge;Be++)ye=re[2*Be+1],(Ee=re[2*Be])>=ie&&Ee<=H&&ye>=L&&ye<=se&&Je.push($[Be]);else{var Me=Math.floor((Ve+ge)/2);ye=re[2*Me+1],(Ee=re[2*Me])>=ie&&Ee<=H&&ye>=L&&ye<=se&&Je.push($[Me]);var yt=(Ge+1)%2;(Ge===0?ie<=Ee:L<=ye)&&(Ae.push(Ve),Ae.push(Me-1),Ae.push(yt)),(Ge===0?H>=Ee:se>=ye)&&(Ae.push(Me+1),Ae.push(ge),Ae.push(yt))}}return Je})(this.ids,this.coords,T,P,B,V,this.nodeSize)},Mi.prototype.within=function(T,P,B){return(function(V,$,re,ie,L,H){for(var se=[0,V.length-1,0],Ie=[],Ee=L*L;se.length;){var ye=se.pop(),Ae=se.pop(),Je=se.pop();if(Ae-Je<=H)for(var Ge=Je;Ge<=Ae;Ge++)Xr($[2*Ge],$[2*Ge+1],re,ie)<=Ee&&Ie.push(V[Ge]);else{var ge=Math.floor((Je+Ae)/2),Ve=$[2*ge],Be=$[2*ge+1];Xr(Ve,Be,re,ie)<=Ee&&Ie.push(V[ge]);var Me=(ye+1)%2;(ye===0?re-L<=Ve:ie-L<=Be)&&(se.push(Je),se.push(ge-1),se.push(Me)),(ye===0?re+L>=Ve:ie+L>=Be)&&(se.push(ge+1),se.push(Ae),se.push(Me))}}return Ie})(this.ids,this.coords,T,P,B,this.nodeSize)};var pi={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(T){return T}},Or=function(T){this.options=mr(Object.create(pi),T),this.trees=new Array(this.options.maxZoom+1)};function Xi(T,P,B,V,$){return{x:T,y:P,zoom:1/0,id:B,parentId:-1,numPoints:V,properties:$}}function Nt(T,P){var B=T.geometry.coordinates,V=B[1];return{x:sr(B[0]),y:lt(V),zoom:1/0,index:P,parentId:-1}}function Nr(T){return{type:"Feature",id:T.id,properties:ar(T),geometry:{type:"Point",coordinates:[(V=T.x,360*(V-.5)),(P=T.y,B=(180-360*P)*Math.PI/180,360*Math.atan(Math.exp(B))/Math.PI-90)]}};var P,B,V}function ar(T){var P=T.numPoints,B=P>=1e4?Math.round(P/1e3)+"k":P>=1e3?Math.round(P/100)/10+"k":P;return mr(mr({},T.properties),{cluster:!0,cluster_id:T.id,point_count:P,point_count_abbreviated:B})}function sr(T){return T/360+.5}function lt(T){var P=Math.sin(T*Math.PI/180),B=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return B<0?0:B>1?1:B}function mr(T,P){for(var B in P)T[B]=P[B];return T}function hr(T){return T.x}function jr(T){return T.y}function fr(T,P,B,V,$,re){var ie=$-B,L=re-V;if(ie!==0||L!==0){var H=((T-B)*ie+(P-V)*L)/(ie*ie+L*L);H>1?(B=$,V=re):H>0&&(B+=ie*H,V+=L*H)}return(ie=T-B)*ie+(L=P-V)*L}function br(T,P,B,V){var $={id:T===void 0?null:T,type:P,geometry:B,tags:V,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return(function(re){var ie=re.geometry,L=re.type;if(L==="Point"||L==="MultiPoint"||L==="LineString")dn(re,ie);else if(L==="Polygon"||L==="MultiLineString")for(var H=0;H<ie.length;H++)dn(re,ie[H]);else if(L==="MultiPolygon")for(H=0;H<ie.length;H++)for(var se=0;se<ie[H].length;se++)dn(re,ie[H][se])})($),$}function dn(T,P){for(var B=0;B<P.length;B+=3)T.minX=Math.min(T.minX,P[B]),T.minY=Math.min(T.minY,P[B+1]),T.maxX=Math.max(T.maxX,P[B]),T.maxY=Math.max(T.maxY,P[B+1])}function Kr(T,P,B,V){if(P.geometry){var $=P.geometry.coordinates,re=P.geometry.type,ie=Math.pow(B.tolerance/((1<<B.maxZoom)*B.extent),2),L=[],H=P.id;if(B.promoteId?H=P.properties[B.promoteId]:B.generateId&&(H=V||0),re==="Point")Bi($,L);else if(re==="MultiPoint")for(var se=0;se<$.length;se++)Bi($[se],L);else if(re==="LineString")hi($,L,ie,!1);else if(re==="MultiLineString"){if(B.lineMetrics){for(se=0;se<$.length;se++)hi($[se],L=[],ie,!1),T.push(br(H,"LineString",L,P.properties));return}ti($,L,ie,!1)}else if(re==="Polygon")ti($,L,ie,!0);else{if(re!=="MultiPolygon"){if(re==="GeometryCollection"){for(se=0;se<P.geometry.geometries.length;se++)Kr(T,{id:H,geometry:P.geometry.geometries[se],properties:P.properties},B,V);return}throw new Error("Input data is not a valid GeoJSON object.")}for(se=0;se<$.length;se++){var Ie=[];ti($[se],Ie,ie,!0),L.push(Ie)}}T.push(br(H,re,L,P.properties))}}function Bi(T,P){P.push(ri(T[0])),P.push(Vi(T[1])),P.push(0)}function hi(T,P,B,V){for(var $,re,ie=0,L=0;L<T.length;L++){var H=ri(T[L][0]),se=Vi(T[L][1]);P.push(H),P.push(se),P.push(0),L>0&&(ie+=V?($*se-H*re)/2:Math.sqrt(Math.pow(H-$,2)+Math.pow(se-re,2))),$=H,re=se}var Ie=P.length-3;P[2]=1,(function Ee(ye,Ae,Je,Ge){for(var ge,Ve=Ge,Be=Je-Ae>>1,Me=Je-Ae,yt=ye[Ae],Fe=ye[Ae+1],Pt=ye[Je],rr=ye[Je+1],Ct=Ae+3;Ct<Je;Ct+=3){var Gt=fr(ye[Ct],ye[Ct+1],yt,Fe,Pt,rr);if(Gt>Ve)ge=Ct,Ve=Gt;else if(Gt===Ve){var Rt=Math.abs(Ct-Be);Rt<Me&&(ge=Ct,Me=Rt)}}Ve>Ge&&(ge-Ae>3&&Ee(ye,Ae,ge,Ge),ye[ge+2]=Ve,Je-ge>3&&Ee(ye,ge,Je,Ge))})(P,0,Ie,B),P[Ie+2]=1,P.size=Math.abs(ie),P.start=0,P.end=P.size}function ti(T,P,B,V){for(var $=0;$<T.length;$++){var re=[];hi(T[$],re,B,V),P.push(re)}}function ri(T){return T/360+.5}function Vi(T){var P=Math.sin(T*Math.PI/180),B=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return B<0?0:B>1?1:B}function Ki(T,P,B,V,$,re,ie,L){if(V/=P,re>=(B/=P)&&ie<V)return T;if(ie<B||re>=V)return null;for(var H=[],se=0;se<T.length;se++){var Ie=T[se],Ee=Ie.geometry,ye=Ie.type,Ae=$===0?Ie.minX:Ie.minY,Je=$===0?Ie.maxX:Ie.maxY;if(Ae>=B&&Je<V)H.push(Ie);else if(!(Je<B||Ae>=V)){var Ge=[];if(ye==="Point"||ye==="MultiPoint")yo(Ee,Ge,B,V,$);else if(ye==="LineString")$o(Ee,Ge,B,V,$,!1,L.lineMetrics);else if(ye==="MultiLineString")Mn(Ee,Ge,B,V,$,!1);else if(ye==="Polygon")Mn(Ee,Ge,B,V,$,!0);else if(ye==="MultiPolygon")for(var ge=0;ge<Ee.length;ge++){var Ve=[];Mn(Ee[ge],Ve,B,V,$,!0),Ve.length&&Ge.push(Ve)}if(Ge.length){if(L.lineMetrics&&ye==="LineString"){for(ge=0;ge<Ge.length;ge++)H.push(br(Ie.id,ye,Ge[ge],Ie.tags));continue}ye!=="LineString"&&ye!=="MultiLineString"||(Ge.length===1?(ye="LineString",Ge=Ge[0]):ye="MultiLineString"),ye!=="Point"&&ye!=="MultiPoint"||(ye=Ge.length===3?"Point":"MultiPoint"),H.push(br(Ie.id,ye,Ge,Ie.tags))}}}return H.length?H:null}function yo(T,P,B,V,$){for(var re=0;re<T.length;re+=3){var ie=T[re+$];ie>=B&&ie<=V&&(P.push(T[re]),P.push(T[re+1]),P.push(T[re+2]))}}function $o(T,P,B,V,$,re,ie){for(var L,H,se=mn(T),Ie=$===0?Zo:jn,Ee=T.start,ye=0;ye<T.length-3;ye+=3){var Ae=T[ye],Je=T[ye+1],Ge=T[ye+2],ge=T[ye+3],Ve=T[ye+4],Be=$===0?Ae:Je,Me=$===0?ge:Ve,yt=!1;ie&&(L=Math.sqrt(Math.pow(Ae-ge,2)+Math.pow(Je-Ve,2))),Be<B?Me>B&&(H=Ie(se,Ae,Je,ge,Ve,B),ie&&(se.start=Ee+L*H)):Be>V?Me<V&&(H=Ie(se,Ae,Je,ge,Ve,V),ie&&(se.start=Ee+L*H)):Bn(se,Ae,Je,Ge),Me<B&&Be>=B&&(H=Ie(se,Ae,Je,ge,Ve,B),yt=!0),Me>V&&Be<=V&&(H=Ie(se,Ae,Je,ge,Ve,V),yt=!0),!re&&yt&&(ie&&(se.end=Ee+L*H),P.push(se),se=mn(T)),ie&&(Ee+=L)}var Fe=T.length-3;Ae=T[Fe],Je=T[Fe+1],Ge=T[Fe+2],(Be=$===0?Ae:Je)>=B&&Be<=V&&Bn(se,Ae,Je,Ge),Fe=se.length-3,re&&Fe>=3&&(se[Fe]!==se[0]||se[Fe+1]!==se[1])&&Bn(se,se[0],se[1],se[2]),se.length&&P.push(se)}function mn(T){var P=[];return P.size=T.size,P.start=T.start,P.end=T.end,P}function Mn(T,P,B,V,$,re){for(var ie=0;ie<T.length;ie++)$o(T[ie],P,B,V,$,re,!1)}function Bn(T,P,B,V){T.push(P),T.push(B),T.push(V)}function Zo(T,P,B,V,$,re){var ie=(re-P)/(V-P);return T.push(re),T.push(B+($-B)*ie),T.push(1),ie}function jn(T,P,B,V,$,re){var ie=(re-B)/($-B);return T.push(P+(V-P)*ie),T.push(re),T.push(1),ie}function zn(T,P){for(var B=[],V=0;V<T.length;V++){var $,re=T[V],ie=re.type;if(ie==="Point"||ie==="MultiPoint"||ie==="LineString")$=rn(re.geometry,P);else if(ie==="MultiLineString"||ie==="Polygon"){$=[];for(var L=0;L<re.geometry.length;L++)$.push(rn(re.geometry[L],P))}else if(ie==="MultiPolygon")for($=[],L=0;L<re.geometry.length;L++){for(var H=[],se=0;se<re.geometry[L].length;se++)H.push(rn(re.geometry[L][se],P));$.push(H)}B.push(br(re.id,ie,$,re.tags))}return B}function rn(T,P){var B=[];B.size=T.size,T.start!==void 0&&(B.start=T.start,B.end=T.end);for(var V=0;V<T.length;V+=3)B.push(T[V]+P,T[V+1],T[V+2]);return B}function de(T,P){if(T.transformed)return T;var B,V,$,re=1<<T.z,ie=T.x,L=T.y;for(B=0;B<T.features.length;B++){var H=T.features[B],se=H.geometry,Ie=H.type;if(H.geometry=[],Ie===1)for(V=0;V<se.length;V+=2)H.geometry.push(_e(se[V],se[V+1],P,re,ie,L));else for(V=0;V<se.length;V++){var Ee=[];for($=0;$<se[V].length;$+=2)Ee.push(_e(se[V][$],se[V][$+1],P,re,ie,L));H.geometry.push(Ee)}}return T.transformed=!0,T}function _e(T,P,B,V,$,re){return[Math.round(B*(T*V-$)),Math.round(B*(P*V-re))]}function jt(T,P,B,V,$){for(var re=P===$.maxZoom?0:$.tolerance/((1<<P)*$.extent),ie={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:B,y:V,z:P,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},L=0;L<T.length;L++){ie.numFeatures++,tr(ie,T[L],re,$);var H=T[L].minX,se=T[L].minY,Ie=T[L].maxX,Ee=T[L].maxY;H<ie.minX&&(ie.minX=H),se<ie.minY&&(ie.minY=se),Ie>ie.maxX&&(ie.maxX=Ie),Ee>ie.maxY&&(ie.maxY=Ee)}return ie}function tr(T,P,B,V){var $=P.geometry,re=P.type,ie=[];if(re==="Point"||re==="MultiPoint")for(var L=0;L<$.length;L+=3)ie.push($[L]),ie.push($[L+1]),T.numPoints++,T.numSimplified++;else if(re==="LineString")Kt(ie,$,T,B,!1,!1);else if(re==="MultiLineString"||re==="Polygon")for(L=0;L<$.length;L++)Kt(ie,$[L],T,B,re==="Polygon",L===0);else if(re==="MultiPolygon")for(var H=0;H<$.length;H++){var se=$[H];for(L=0;L<se.length;L++)Kt(ie,se[L],T,B,!0,L===0)}if(ie.length){var Ie=P.tags||null;if(re==="LineString"&&V.lineMetrics){for(var Ee in Ie={},P.tags)Ie[Ee]=P.tags[Ee];Ie.mapbox_clip_start=$.start/$.size,Ie.mapbox_clip_end=$.end/$.size}var ye={geometry:ie,type:re==="Polygon"||re==="MultiPolygon"?3:re==="LineString"||re==="MultiLineString"?2:1,tags:Ie};P.id!==null&&(ye.id=P.id),T.features.push(ye)}}function Kt(T,P,B,V,$,re){var ie=V*V;if(V>0&&P.size<($?ie:V))B.numPoints+=P.length/3;else{for(var L=[],H=0;H<P.length;H+=3)(V===0||P[H+2]>ie)&&(B.numSimplified++,L.push(P[H]),L.push(P[H+1])),B.numPoints++;$&&(function(se,Ie){for(var Ee=0,ye=0,Ae=se.length,Je=Ae-2;ye<Ae;Je=ye,ye+=2)Ee+=(se[ye]-se[Je])*(se[ye+1]+se[Je+1]);if(Ee>0===Ie)for(ye=0,Ae=se.length;ye<Ae/2;ye+=2){var Ge=se[ye],ge=se[ye+1];se[ye]=se[Ae-2-ye],se[ye+1]=se[Ae-1-ye],se[Ae-2-ye]=Ge,se[Ae-1-ye]=ge}})(L,re),T.push(L)}}function _t(T,P){var B=(P=this.options=(function($,re){for(var ie in re)$[ie]=re[ie];return $})(Object.create(this.options),P)).debug;if(B&&console.time("preprocess data"),P.maxZoom<0||P.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(P.promoteId&&P.generateId)throw new Error("promoteId and generateId cannot be used together.");var V=(function($,re){var ie=[];if($.type==="FeatureCollection")for(var L=0;L<$.features.length;L++)Kr(ie,$.features[L],re,L);else Kr(ie,$.type==="Feature"?$:{geometry:$},re);return ie})(T,P);this.tiles={},this.tileCoords=[],B&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",P.indexMaxZoom,P.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(V=(function($,re){var ie=re.buffer/re.extent,L=$,H=Ki($,1,-1-ie,ie,0,-1,2,re),se=Ki($,1,1-ie,2+ie,0,-1,2,re);return(H||se)&&(L=Ki($,1,-ie,1+ie,0,-1,2,re)||[],H&&(L=zn(H,1).concat(L)),se&&(L=L.concat(zn(se,-1)))),L})(V,P)).length&&this.splitTile(V,0,0,0),B&&(V.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)))}function fi(T,P,B){return 32*((1<<T)*B+P)+T}function qi(T,P){var B=T.tileID.canonical;if(!this._geoJSONIndex)return P(null,null);var V=this._geoJSONIndex.getTile(B.z,B.x,B.y);if(!V)return P(null,null);var $=new Ne(V.features),re=tt($);re.byteOffset===0&&re.byteLength===re.buffer.byteLength||(re=new Uint8Array(re)),P(null,{vectorTile:$,rawData:re.buffer})}Or.prototype.load=function(T){var P=this.options,B=P.log,V=P.minZoom,$=P.maxZoom,re=P.nodeSize;B&&console.time("total time");var ie="prepare "+T.length+" points";B&&console.time(ie),this.points=T;for(var L=[],H=0;H<T.length;H++)T[H].geometry&&L.push(Nt(T[H],H));this.trees[$+1]=new Mi(L,hr,jr,re,Float32Array),B&&console.timeEnd(ie);for(var se=$;se>=V;se--){var Ie=+Date.now();L=this._cluster(L,se),this.trees[se]=new Mi(L,hr,jr,re,Float32Array),B&&console.log("z%d: %d clusters in %dms",se,L.length,+Date.now()-Ie)}return B&&console.timeEnd("total time"),this},Or.prototype.getClusters=function(T,P){var B=((T[0]+180)%360+360)%360-180,V=Math.max(-90,Math.min(90,T[1])),$=T[2]===180?180:((T[2]+180)%360+360)%360-180,re=Math.max(-90,Math.min(90,T[3]));if(T[2]-T[0]>=360)B=-180,$=180;else if(B>$){var ie=this.getClusters([B,V,180,re],P),L=this.getClusters([-180,V,$,re],P);return ie.concat(L)}for(var H=this.trees[this._limitZoom(P)],se=[],Ie=0,Ee=H.range(sr(B),lt(re),sr($),lt(V));Ie<Ee.length;Ie+=1){var ye=H.points[Ee[Ie]];se.push(ye.numPoints?Nr(ye):this.points[ye.index])}return se},Or.prototype.getChildren=function(T){var P=this._getOriginId(T),B=this._getOriginZoom(T),V="No cluster with the specified id.",$=this.trees[B];if(!$)throw new Error(V);var re=$.points[P];if(!re)throw new Error(V);for(var ie=this.options.radius/(this.options.extent*Math.pow(2,B-1)),L=[],H=0,se=$.within(re.x,re.y,ie);H<se.length;H+=1){var Ie=$.points[se[H]];Ie.parentId===T&&L.push(Ie.numPoints?Nr(Ie):this.points[Ie.index])}if(L.length===0)throw new Error(V);return L},Or.prototype.getLeaves=function(T,P,B){var V=[];return this._appendLeaves(V,T,P=P||10,B=B||0,0),V},Or.prototype.getTile=function(T,P,B){var V=this.trees[this._limitZoom(T)],$=Math.pow(2,T),re=this.options,ie=re.radius/re.extent,L=(B-ie)/$,H=(B+1+ie)/$,se={features:[]};return this._addTileFeatures(V.range((P-ie)/$,L,(P+1+ie)/$,H),V.points,P,B,$,se),P===0&&this._addTileFeatures(V.range(1-ie/$,L,1,H),V.points,$,B,$,se),P===$-1&&this._addTileFeatures(V.range(0,L,ie/$,H),V.points,-1,B,$,se),se.features.length?se:null},Or.prototype.getClusterExpansionZoom=function(T){for(var P=this._getOriginZoom(T)-1;P<=this.options.maxZoom;){var B=this.getChildren(T);if(P++,B.length!==1)break;T=B[0].properties.cluster_id}return P},Or.prototype._appendLeaves=function(T,P,B,V,$){for(var re=0,ie=this.getChildren(P);re<ie.length;re+=1){var L=ie[re],H=L.properties;if(H&&H.cluster?$+H.point_count<=V?$+=H.point_count:$=this._appendLeaves(T,H.cluster_id,B,V,$):$<V?$++:T.push(L),T.length===B)break}return $},Or.prototype._addTileFeatures=function(T,P,B,V,$,re){for(var ie=0,L=T;ie<L.length;ie+=1){var H=P[L[ie]],se=H.numPoints,Ie={type:1,geometry:[[Math.round(this.options.extent*(H.x*$-B)),Math.round(this.options.extent*(H.y*$-V))]],tags:se?ar(H):this.points[H.index].properties},Ee=void 0;se?Ee=H.id:this.options.generateId?Ee=H.index:this.points[H.index].id&&(Ee=this.points[H.index].id),Ee!==void 0&&(Ie.id=Ee),re.features.push(Ie)}},Or.prototype._limitZoom=function(T){return Math.max(this.options.minZoom,Math.min(+T,this.options.maxZoom+1))},Or.prototype._cluster=function(T,P){for(var B=[],V=this.options,$=V.reduce,re=V.minPoints,ie=V.radius/(V.extent*Math.pow(2,P)),L=0;L<T.length;L++){var H=T[L];if(!(H.zoom<=P)){H.zoom=P;for(var se=this.trees[P+1],Ie=se.within(H.x,H.y,ie),Ee=H.numPoints||1,ye=Ee,Ae=0,Je=Ie;Ae<Je.length;Ae+=1){var Ge=se.points[Je[Ae]];Ge.zoom>P&&(ye+=Ge.numPoints||1)}if(ye>=re){for(var ge=H.x*Ee,Ve=H.y*Ee,Be=$&&Ee>1?this._map(H,!0):null,Me=(L<<5)+(P+1)+this.points.length,yt=0,Fe=Ie;yt<Fe.length;yt+=1){var Pt=se.points[Fe[yt]];if(!(Pt.zoom<=P)){Pt.zoom=P;var rr=Pt.numPoints||1;ge+=Pt.x*rr,Ve+=Pt.y*rr,Pt.parentId=Me,$&&(Be||(Be=this._map(H,!0)),$(Be,this._map(Pt)))}}H.parentId=Me,B.push(Xi(ge/ye,Ve/ye,Me,ye,Be))}else if(B.push(H),ye>1)for(var Ct=0,Gt=Ie;Ct<Gt.length;Ct+=1){var Rt=se.points[Gt[Ct]];Rt.zoom<=P||(Rt.zoom=P,B.push(Rt))}}}return B},Or.prototype._getOriginId=function(T){return T-this.points.length>>5},Or.prototype._getOriginZoom=function(T){return(T-this.points.length)%32},Or.prototype._map=function(T,P){if(T.numPoints)return P?mr({},T.properties):T.properties;var B=this.points[T.index].properties,V=this.options.map(B);return P&&V===B?mr({},V):V},_t.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},_t.prototype.splitTile=function(T,P,B,V,$,re,ie){for(var L=[T,P,B,V],H=this.options,se=H.debug;L.length;){V=L.pop(),B=L.pop(),P=L.pop(),T=L.pop();var Ie=1<<P,Ee=fi(P,B,V),ye=this.tiles[Ee];if(!ye&&(se>1&&console.time("creation"),ye=this.tiles[Ee]=jt(T,P,B,V,H),this.tileCoords.push({z:P,x:B,y:V}),se)){se>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",P,B,V,ye.numFeatures,ye.numPoints,ye.numSimplified),console.timeEnd("creation"));var Ae="z"+P;this.stats[Ae]=(this.stats[Ae]||0)+1,this.total++}if(ye.source=T,$){if(P===H.maxZoom||P===$)continue;var Je=1<<$-P;if(B!==Math.floor(re/Je)||V!==Math.floor(ie/Je))continue}else if(P===H.indexMaxZoom||ye.numPoints<=H.indexMaxPoints)continue;if(ye.source=null,T.length!==0){se>1&&console.time("clipping");var Ge,ge,Ve,Be,Me,yt,Fe=.5*H.buffer/H.extent,Pt=.5-Fe,rr=.5+Fe,Ct=1+Fe;Ge=ge=Ve=Be=null,Me=Ki(T,Ie,B-Fe,B+rr,0,ye.minX,ye.maxX,H),yt=Ki(T,Ie,B+Pt,B+Ct,0,ye.minX,ye.maxX,H),T=null,Me&&(Ge=Ki(Me,Ie,V-Fe,V+rr,1,ye.minY,ye.maxY,H),ge=Ki(Me,Ie,V+Pt,V+Ct,1,ye.minY,ye.maxY,H),Me=null),yt&&(Ve=Ki(yt,Ie,V-Fe,V+rr,1,ye.minY,ye.maxY,H),Be=Ki(yt,Ie,V+Pt,V+Ct,1,ye.minY,ye.maxY,H),yt=null),se>1&&console.timeEnd("clipping"),L.push(Ge||[],P+1,2*B,2*V),L.push(ge||[],P+1,2*B,2*V+1),L.push(Ve||[],P+1,2*B+1,2*V),L.push(Be||[],P+1,2*B+1,2*V+1)}}},_t.prototype.getTile=function(T,P,B){var V=this.options,$=V.extent,re=V.debug;if(T<0||T>24)return null;var ie=1<<T,L=fi(T,P=(P%ie+ie)%ie,B);if(this.tiles[L])return de(this.tiles[L],$);re>1&&console.log("drilling down to z%d-%d-%d",T,P,B);for(var H,se=T,Ie=P,Ee=B;!H&&se>0;)se--,Ie=Math.floor(Ie/2),Ee=Math.floor(Ee/2),H=this.tiles[fi(se,Ie,Ee)];return H&&H.source?(re>1&&console.log("found parent tile z%d-%d-%d",se,Ie,Ee),re>1&&console.time("drilling down"),this.splitTile(H.source,se,Ie,Ee,T,P,B),re>1&&console.timeEnd("drilling down"),this.tiles[L]?de(this.tiles[L],$):null):null};var ii=(function(T){function P(B,V,$,re){T.call(this,B,V,$,qi),re&&(this.loadGeoJSON=re)}return T&&(P.__proto__=T),(P.prototype=Object.create(T&&T.prototype)).constructor=P,P.prototype.loadData=function(B,V){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=V,this._pendingLoadDataParams=B,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},P.prototype._loadData=function(){var B=this;if(this._pendingCallback&&this._pendingLoadDataParams){var V=this._pendingCallback,$=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var re=!!($&&$.request&&$.request.collectResourceTiming)&&new u.RequestPerformance($.request);this.loadGeoJSON($,(function(ie,L){if(ie||!L)return V(ie);if(typeof L!="object")return V(new Error("Input data given to '"+$.source+"' is not a valid GeoJSON object."));(function ye(Ae,Je){var Ge,ge=Ae&&Ae.type;if(ge==="FeatureCollection")for(Ge=0;Ge<Ae.features.length;Ge++)ye(Ae.features[Ge],Je);else if(ge==="GeometryCollection")for(Ge=0;Ge<Ae.geometries.length;Ge++)ye(Ae.geometries[Ge],Je);else if(ge==="Feature")ye(Ae.geometry,Je);else if(ge==="Polygon")He(Ae.coordinates,Je);else if(ge==="MultiPolygon")for(Ge=0;Ge<Ae.coordinates.length;Ge++)He(Ae.coordinates[Ge],Je);return Ae})(L,!0);try{if($.filter){var H=u.createExpression($.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(H.result==="error")throw new Error(H.value.map((function(ye){return ye.key+": "+ye.message})).join(", "));var se=L.features.filter((function(ye){return H.value.evaluate({zoom:0},ye)}));L={type:"FeatureCollection",features:se}}B._geoJSONIndex=$.cluster?new Or((function(ye){var Ae=ye.superclusterOptions,Je=ye.clusterProperties;if(!Je||!Ae)return Ae;for(var Ge={},ge={},Ve={accumulated:null,zoom:0},Be={properties:null},Me=Object.keys(Je),yt=0,Fe=Me;yt<Fe.length;yt+=1){var Pt=Fe[yt],rr=Je[Pt],Ct=rr[0],Gt=u.createExpression(rr[1]),Rt=u.createExpression(typeof Ct=="string"?[Ct,["accumulated"],["get",Pt]]:Ct);Ge[Pt]=Gt.value,ge[Pt]=Rt.value}return Ae.map=function(wi){Be.properties=wi;for(var Ht={},Cr=0,Qt=Me;Cr<Qt.length;Cr+=1){var zt=Qt[Cr];Ht[zt]=Ge[zt].evaluate(Ve,Be)}return Ht},Ae.reduce=function(wi,Ht){Be.properties=Ht;for(var Cr=0,Qt=Me;Cr<Qt.length;Cr+=1){var zt=Qt[Cr];Ve.accumulated=wi[zt],wi[zt]=ge[zt].evaluate(Ve,Be)}},Ae})($)).load(L.features):(function(ye,Ae){return new _t(ye,Ae)})(L,$.geojsonVtOptions)}catch(ye){return V(ye)}B.loaded={};var Ie={};if(re){var Ee=re.finish();Ee&&(Ie.resourceTiming={},Ie.resourceTiming[$.source]=JSON.parse(JSON.stringify(Ee)))}V(null,Ie)}))}},P.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},P.prototype.reloadTile=function(B,V){var $=this.loaded;return $&&$[B.uid]?T.prototype.reloadTile.call(this,B,V):this.loadTile(B,V)},P.prototype.loadGeoJSON=function(B,V){if(B.request)u.getJSON(B.request,V);else{if(typeof B.data!="string")return V(new Error("Input data given to '"+B.source+"' is not a valid GeoJSON object."));try{return V(null,JSON.parse(B.data))}catch{return V(new Error("Input data given to '"+B.source+"' is not a valid GeoJSON object."))}}},P.prototype.removeSource=function(B,V){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),V()},P.prototype.getClusterExpansionZoom=function(B,V){try{V(null,this._geoJSONIndex.getClusterExpansionZoom(B.clusterId))}catch($){V($)}},P.prototype.getClusterChildren=function(B,V){try{V(null,this._geoJSONIndex.getChildren(B.clusterId))}catch($){V($)}},P.prototype.getClusterLeaves=function(B,V){try{V(null,this._geoJSONIndex.getLeaves(B.clusterId,B.limit,B.offset))}catch($){V($)}},P})(be),Yt=function(T){var P=this;this.self=T,this.actor=new u.Actor(T,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:be,geojson:ii},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(B,V){if(P.workerSourceTypes[B])throw new Error('Worker source with name "'+B+'" already registered.');P.workerSourceTypes[B]=V},this.self.registerRTLTextPlugin=function(B){if(u.plugin.isParsed())throw new Error("RTL text plugin already registered.");u.plugin.applyArabicShaping=B.applyArabicShaping,u.plugin.processBidirectionalText=B.processBidirectionalText,u.plugin.processStyledBidirectionalText=B.processStyledBidirectionalText}};return Yt.prototype.setReferrer=function(T,P){this.referrer=P},Yt.prototype.setImages=function(T,P,B){for(var V in this.availableImages[T]=P,this.workerSources[T]){var $=this.workerSources[T][V];for(var re in $)$[re].availableImages=P}B()},Yt.prototype.setLayers=function(T,P,B){this.getLayerIndex(T).replace(P),B()},Yt.prototype.updateLayers=function(T,P,B){this.getLayerIndex(T).update(P.layers,P.removedIds),B()},Yt.prototype.loadTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).loadTile(P,B)},Yt.prototype.loadDEMTile=function(T,P,B){this.getDEMWorkerSource(T,P.source).loadTile(P,B)},Yt.prototype.reloadTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).reloadTile(P,B)},Yt.prototype.abortTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).abortTile(P,B)},Yt.prototype.removeTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).removeTile(P,B)},Yt.prototype.removeDEMTile=function(T,P){this.getDEMWorkerSource(T,P.source).removeTile(P)},Yt.prototype.removeSource=function(T,P,B){if(this.workerSources[T]&&this.workerSources[T][P.type]&&this.workerSources[T][P.type][P.source]){var V=this.workerSources[T][P.type][P.source];delete this.workerSources[T][P.type][P.source],V.removeSource!==void 0?V.removeSource(P,B):B()}},Yt.prototype.loadWorkerSource=function(T,P,B){try{this.self.importScripts(P.url),B()}catch(V){B(V.toString())}},Yt.prototype.syncRTLPluginState=function(T,P,B){try{u.plugin.setState(P);var V=u.plugin.getPluginURL();if(u.plugin.isLoaded()&&!u.plugin.isParsed()&&V!=null){this.self.importScripts(V);var $=u.plugin.isParsed();B($?void 0:new Error("RTL Text Plugin failed to import scripts from "+V),$)}}catch(re){B(re.toString())}},Yt.prototype.getAvailableImages=function(T){var P=this.availableImages[T];return P||(P=[]),P},Yt.prototype.getLayerIndex=function(T){var P=this.layerIndexes[T];return P||(P=this.layerIndexes[T]=new Y),P},Yt.prototype.getWorkerSource=function(T,P,B){var V=this;return this.workerSources[T]||(this.workerSources[T]={}),this.workerSources[T][P]||(this.workerSources[T][P]={}),this.workerSources[T][P][B]||(this.workerSources[T][P][B]=new this.workerSourceTypes[P]({send:function($,re,ie){V.actor.send($,re,ie,T)}},this.getLayerIndex(T),this.getAvailableImages(T))),this.workerSources[T][P][B]},Yt.prototype.getDEMWorkerSource=function(T,P){return this.demWorkerSources[T]||(this.demWorkerSources[T]={}),this.demWorkerSources[T][P]||(this.demWorkerSources[T][P]=new Ze),this.demWorkerSources[T][P]},Yt.prototype.enforceCacheSizeLimit=function(T,P){u.enforceCacheSizeLimit(P)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Yt(self)),Yt})),D(["./shared"],(function(u){var U=u.createCommonjsModule((function(i){function o(p){return!n(p)}function n(p){return typeof window>"u"||typeof document>"u"?"not a browser":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.prototype&&Function.prototype.bind?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?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?(function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var d,v,w=new Blob([""],{type:"text/javascript"}),A=URL.createObjectURL(w);try{v=new Worker(A),d=!0}catch{d=!1}return v&&v.terminate(),URL.revokeObjectURL(A),d})()?"Uint8ClampedArray"in window?ArrayBuffer.isView?(function(){var d=document.createElement("canvas");d.width=d.height=1;var v=d.getContext("2d");if(!v)return!1;var w=v.getImageData(0,0,1,1);return w&&w.width===d.width})()?(s[f=p&&p.failIfMajorPerformanceCaveat]===void 0&&(s[f]=(function(d){var v=(function(A){var R=document.createElement("canvas"),F=Object.create(o.webGLContextAttributes);return F.failIfMajorPerformanceCaveat=A,R.probablySupportsContext?R.probablySupportsContext("webgl",F)||R.probablySupportsContext("experimental-webgl",F):R.supportsContext?R.supportsContext("webgl",F)||R.supportsContext("experimental-webgl",F):R.getContext("webgl",F)||R.getContext("experimental-webgl",F)})(d);if(!v)return!1;var w=v.createShader(v.VERTEX_SHADER);return!(!w||v.isContextLost())&&(v.shaderSource(w,"void main() {}"),v.compileShader(w),v.getShaderParameter(w,v.COMPILE_STATUS)===!0)})(f)),s[f]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var f}i.exports?i.exports=o:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=o,window.mapboxgl.notSupportedReason=n);var s={};o.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),M={create:function(i,o,n){var s=u.window.document.createElement(i);return o!==void 0&&(s.className=o),n&&n.appendChild(s),s},createNS:function(i,o){return u.window.document.createElementNS(i,o)}},Y=u.window.document&&u.window.document.documentElement.style;function X(i){if(!Y)return i[0];for(var o=0;o<i.length;o++)if(i[o]in Y)return i[o];return i[0]}var ae,J=X(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);M.disableDrag=function(){Y&&J&&(ae=Y[J],Y[J]="none")},M.enableDrag=function(){Y&&J&&(Y[J]=ae)};var Se=X(["transform","WebkitTransform"]);M.setTransform=function(i,o){i.style[Se]=o};var be=!1;try{var De=Object.defineProperty({},"passive",{get:function(){be=!0}});u.window.addEventListener("test",De,De),u.window.removeEventListener("test",De,De)}catch{be=!1}M.addEventListener=function(i,o,n,s){s===void 0&&(s={}),i.addEventListener(o,n,"passive"in s&&be?s:s.capture)},M.removeEventListener=function(i,o,n,s){s===void 0&&(s={}),i.removeEventListener(o,n,"passive"in s&&be?s:s.capture)};var Ze=function(i){i.preventDefault(),i.stopPropagation(),u.window.removeEventListener("click",Ze,!0)};function He(i){var o=i.userImage;return!!(o&&o.render&&o.render())&&(i.data.replace(new Uint8Array(o.data.buffer)),!0)}M.suppressClick=function(){u.window.addEventListener("click",Ze,!0),u.window.setTimeout((function(){u.window.removeEventListener("click",Ze,!0)}),0)},M.mousePos=function(i,o){var n=i.getBoundingClientRect();return new u.Point(o.clientX-n.left-i.clientLeft,o.clientY-n.top-i.clientTop)},M.touchPos=function(i,o){for(var n=i.getBoundingClientRect(),s=[],p=0;p<o.length;p++)s.push(new u.Point(o[p].clientX-n.left-i.clientLeft,o[p].clientY-n.top-i.clientTop));return s},M.mouseButton=function(i){return u.window.InstallTrigger!==void 0&&i.button===2&&i.ctrlKey&&u.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:i.button},M.remove=function(i){i.parentNode&&i.parentNode.removeChild(i)};var Ue=(function(i){function o(){i.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new u.RGBAImage({width:1,height:1}),this.dirty=!0}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.isLoaded=function(){return this.loaded},o.prototype.setLoaded=function(n){if(this.loaded!==n&&(this.loaded=n,n)){for(var s=0,p=this.requestors;s<p.length;s+=1){var f=p[s];this._notify(f.ids,f.callback)}this.requestors=[]}},o.prototype.getImage=function(n){return this.images[n]},o.prototype.addImage=function(n,s){this._validate(n,s)&&(this.images[n]=s)},o.prototype._validate=function(n,s){var p=!0;return this._validateStretch(s.stretchX,s.data&&s.data.width)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchX" value'))),p=!1),this._validateStretch(s.stretchY,s.data&&s.data.height)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchY" value'))),p=!1),this._validateContent(s.content,s)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "content" value'))),p=!1),p},o.prototype._validateStretch=function(n,s){if(!n)return!0;for(var p=0,f=0,d=n;f<d.length;f+=1){var v=d[f];if(v[0]<p||v[1]<v[0]||s<v[1])return!1;p=v[1]}return!0},o.prototype._validateContent=function(n,s){return!(n&&(n.length!==4||n[0]<0||s.data.width<n[0]||n[1]<0||s.data.height<n[1]||n[2]<0||s.data.width<n[2]||n[3]<0||s.data.height<n[3]||n[2]<n[0]||n[3]<n[1]))},o.prototype.updateImage=function(n,s){s.version=this.images[n].version+1,this.images[n]=s,this.updatedImages[n]=!0},o.prototype.removeImage=function(n){var s=this.images[n];delete this.images[n],delete this.patterns[n],s.userImage&&s.userImage.onRemove&&s.userImage.onRemove()},o.prototype.listImages=function(){return Object.keys(this.images)},o.prototype.getImages=function(n,s){var p=!0;if(!this.isLoaded())for(var f=0,d=n;f<d.length;f+=1)this.images[d[f]]||(p=!1);this.isLoaded()||p?this._notify(n,s):this.requestors.push({ids:n,callback:s})},o.prototype._notify=function(n,s){for(var p={},f=0,d=n;f<d.length;f+=1){var v=d[f];this.images[v]||this.fire(new u.Event("styleimagemissing",{id:v}));var w=this.images[v];w?p[v]={data:w.data.clone(),pixelRatio:w.pixelRatio,sdf:w.sdf,version:w.version,stretchX:w.stretchX,stretchY:w.stretchY,content:w.content,hasRenderCallback:!!(w.userImage&&w.userImage.render)}:u.warnOnce('Image "'+v+'" 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.')}s(null,p)},o.prototype.getPixelSize=function(){var n=this.atlasImage;return{width:n.width,height:n.height}},o.prototype.getPattern=function(n){var s=this.patterns[n],p=this.getImage(n);if(!p)return null;if(s&&s.position.version===p.version)return s.position;if(s)s.position.version=p.version;else{var f={w:p.data.width+2,h:p.data.height+2,x:0,y:0},d=new u.ImagePosition(f,p);this.patterns[n]={bin:f,position:d}}return this._updatePatternAtlas(),this.patterns[n].position},o.prototype.bind=function(n){var s=n.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u.Texture(n,this.atlasImage,s.RGBA),this.atlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE)},o.prototype._updatePatternAtlas=function(){var n=[];for(var s in this.patterns)n.push(this.patterns[s].bin);var p=u.potpack(n),f=p.w,d=p.h,v=this.atlasImage;for(var w in v.resize({width:f||1,height:d||1}),this.patterns){var A=this.patterns[w].bin,R=A.x+1,F=A.y+1,O=this.images[w].data,W=O.width,Z=O.height;u.RGBAImage.copy(O,v,{x:0,y:0},{x:R,y:F},{width:W,height:Z}),u.RGBAImage.copy(O,v,{x:0,y:Z-1},{x:R,y:F-1},{width:W,height:1}),u.RGBAImage.copy(O,v,{x:0,y:0},{x:R,y:F+Z},{width:W,height:1}),u.RGBAImage.copy(O,v,{x:W-1,y:0},{x:R-1,y:F},{width:1,height:Z}),u.RGBAImage.copy(O,v,{x:0,y:0},{x:R+W,y:F},{width:1,height:Z})}this.dirty=!0},o.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},o.prototype.dispatchRenderCallbacks=function(n){for(var s=0,p=n;s<p.length;s+=1){var f=p[s];if(!this.callbackDispatchedThisFrame[f]){this.callbackDispatchedThisFrame[f]=!0;var d=this.images[f];He(d)&&this.updateImage(f,d)}}},o})(u.Evented),fe=It,Ke=It,Ne=1e20;function It(i,o,n,s,p,f){this.fontSize=i||24,this.buffer=o===void 0?3:o,this.cutoff=s||.25,this.fontFamily=p||"sans-serif",this.fontWeight=f||"normal",this.radius=n||8;var d=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=d,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(d*d),this.gridInner=new Float64Array(d*d),this.f=new Float64Array(d),this.d=new Float64Array(d),this.z=new Float64Array(d+1),this.v=new Int16Array(d),this.middle=Math.round(d/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function we(i,o,n,s,p,f,d){for(var v=0;v<o;v++){for(var w=0;w<n;w++)s[w]=i[w*o+v];for(je(s,p,f,d,n),w=0;w<n;w++)i[w*o+v]=p[w]}for(w=0;w<n;w++){for(v=0;v<o;v++)s[v]=i[w*o+v];for(je(s,p,f,d,o),v=0;v<o;v++)i[w*o+v]=Math.sqrt(p[v])}}function je(i,o,n,s,p){n[0]=0,s[0]=-Ne,s[1]=+Ne;for(var f=1,d=0;f<p;f++){for(var v=(i[f]+f*f-(i[n[d]]+n[d]*n[d]))/(2*f-2*n[d]);v<=s[d];)d--,v=(i[f]+f*f-(i[n[d]]+n[d]*n[d]))/(2*f-2*n[d]);n[++d]=f,s[d]=v,s[d+1]=+Ne}for(f=0,d=0;f<p;f++){for(;s[d+1]<f;)d++;o[f]=(f-n[d])*(f-n[d])+i[n[d]]}}It.prototype.draw=function(i){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(i,this.buffer,this.middle);for(var o=this.ctx.getImageData(0,0,this.size,this.size),n=new Uint8ClampedArray(this.size*this.size),s=0;s<this.size*this.size;s++){var p=o.data[4*s+3]/255;this.gridOuter[s]=p===1?0:p===0?Ne:Math.pow(Math.max(0,.5-p),2),this.gridInner[s]=p===1?Ne:p===0?0:Math.pow(Math.max(0,p-.5),2)}for(we(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),we(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),s=0;s<this.size*this.size;s++)n[s]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[s]-this.gridInner[s])/this.radius+this.cutoff))));return n},fe.default=Ke;var Le=function(i,o){this.requestManager=i,this.localIdeographFontFamily=o,this.entries={}};Le.prototype.setURL=function(i){this.url=i},Le.prototype.getGlyphs=function(i,o){var n=this,s=[];for(var p in i)for(var f=0,d=i[p];f<d.length;f+=1)s.push({stack:p,id:d[f]});u.asyncAll(s,(function(v,w){var A=v.stack,R=v.id,F=n.entries[A];F||(F=n.entries[A]={glyphs:{},requests:{},ranges:{}});var O=F.glyphs[R];if(O===void 0){if(O=n._tinySDF(F,A,R))return F.glyphs[R]=O,void w(null,{stack:A,id:R,glyph:O});var W=Math.floor(R/256);if(256*W>65535)w(new Error("glyphs > 65535 not supported"));else if(F.ranges[W])w(null,{stack:A,id:R,glyph:O});else{var Z=F.requests[W];Z||(Z=F.requests[W]=[],Le.loadGlyphRange(A,W,n.url,n.requestManager,(function(ee,N){if(N){for(var Q in N)n._doesCharSupportLocalGlyph(+Q)||(F.glyphs[+Q]=N[+Q]);F.ranges[W]=!0}for(var ne=0,ue=Z;ne<ue.length;ne+=1)(0,ue[ne])(ee,N);delete F.requests[W]}))),Z.push((function(ee,N){ee?w(ee):N&&w(null,{stack:A,id:R,glyph:N[R]||null})}))}}else w(null,{stack:A,id:R,glyph:O})}),(function(v,w){if(v)o(v);else if(w){for(var A={},R=0,F=w;R<F.length;R+=1){var O=F[R],W=O.stack,Z=O.id,ee=O.glyph;(A[W]||(A[W]={}))[Z]=ee&&{id:ee.id,bitmap:ee.bitmap.clone(),metrics:ee.metrics}}o(null,A)}}))},Le.prototype._doesCharSupportLocalGlyph=function(i){return!!this.localIdeographFontFamily&&(u.isChar["CJK Unified Ideographs"](i)||u.isChar["Hangul Syllables"](i)||u.isChar.Hiragana(i)||u.isChar.Katakana(i))},Le.prototype._tinySDF=function(i,o,n){var s=this.localIdeographFontFamily;if(s&&this._doesCharSupportLocalGlyph(n)){var p=i.tinySDF;if(!p){var f="400";/bold/i.test(o)?f="900":/medium/i.test(o)?f="500":/light/i.test(o)&&(f="200"),p=i.tinySDF=new Le.TinySDF(24,3,8,.25,s,f)}return{id:n,bitmap:new u.AlphaImage({width:30,height:30},p.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},Le.loadGlyphRange=function(i,o,n,s,p){var f=256*o,d=f+255,v=s.transformRequest(s.normalizeGlyphsURL(n).replace("{fontstack}",i).replace("{range}",f+"-"+d),u.ResourceType.Glyphs);u.getArrayBuffer(v,(function(w,A){if(w)p(w);else if(A){for(var R={},F=0,O=u.parseGlyphPBF(A);F<O.length;F+=1){var W=O[F];R[W.id]=W}p(null,R)}}))},Le.TinySDF=fe;var tt=function(){this.specification=u.styleSpec.light.position};tt.prototype.possiblyEvaluate=function(i,o){return u.sphericalToCartesian(i.expression.evaluate(o))},tt.prototype.interpolate=function(i,o,n){return{x:u.number(i.x,o.x,n),y:u.number(i.y,o.y,n),z:u.number(i.z,o.z,n)}};var Mt=new u.Properties({anchor:new u.DataConstantProperty(u.styleSpec.light.anchor),position:new tt,color:new u.DataConstantProperty(u.styleSpec.light.color),intensity:new u.DataConstantProperty(u.styleSpec.light.intensity)}),Wt=(function(i){function o(n){i.call(this),this._transitionable=new u.Transitionable(Mt),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getLight=function(){return this._transitionable.serialize()},o.prototype.setLight=function(n,s){if(s===void 0&&(s={}),!this._validate(u.validateLight,n,s))for(var p in n){var f=n[p];u.endsWith(p,"-transition")?this._transitionable.setTransition(p.slice(0,-11),f):this._transitionable.setValue(p,f)}},o.prototype.updateTransitions=function(n){this._transitioning=this._transitionable.transitioned(n,this._transitioning)},o.prototype.hasTransition=function(){return this._transitioning.hasTransition()},o.prototype.recalculate=function(n){this.properties=this._transitioning.possiblyEvaluate(n)},o.prototype._validate=function(n,s,p){return(!p||p.validate!==!1)&&u.emitValidationErrors(this,n.call(u.validateStyle,u.extend({value:s,style:{glyphs:!0,sprite:!0},styleSpec:u.styleSpec})))},o})(u.Evented),St=function(i,o){this.width=i,this.height=o,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};St.prototype.getDash=function(i,o){var n=i.join(",")+String(o);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(i,o)),this.dashEntry[n]},St.prototype.getDashRanges=function(i,o,n){var s=[],p=i.length%2==1?-i[i.length-1]*n:0,f=i[0]*n,d=!0;s.push({left:p,right:f,isDash:d,zeroLength:i[0]===0});for(var v=i[0],w=1;w<i.length;w++){var A=i[w];s.push({left:p=v*n,right:f=(v+=A)*n,isDash:d=!d,zeroLength:A===0})}return s},St.prototype.addRoundDash=function(i,o,n){for(var s=o/2,p=-n;p<=n;p++)for(var f=this.width*(this.nextRow+n+p),d=0,v=i[d],w=0;w<this.width;w++){w/v.right>1&&(v=i[++d]);var A=Math.abs(w-v.left),R=Math.abs(w-v.right),F=Math.min(A,R),O=void 0,W=p/n*(s+1);if(v.isDash){var Z=s-Math.abs(W);O=Math.sqrt(F*F+Z*Z)}else O=s-Math.sqrt(F*F+W*W);this.data[f+w]=Math.max(0,Math.min(255,O+128))}},St.prototype.addRegularDash=function(i){for(var o=i.length-1;o>=0;--o){var n=i[o],s=i[o+1];n.zeroLength?i.splice(o,1):s&&s.isDash===n.isDash&&(s.left=n.left,i.splice(o,1))}var p=i[0],f=i[i.length-1];p.isDash===f.isDash&&(p.left=f.left-this.width,f.right=p.right+this.width);for(var d=this.width*this.nextRow,v=0,w=i[v],A=0;A<this.width;A++){A/w.right>1&&(w=i[++v]);var R=Math.abs(A-w.left),F=Math.abs(A-w.right),O=Math.min(R,F);this.data[d+A]=Math.max(0,Math.min(255,(w.isDash?O:-O)+128))}},St.prototype.addDash=function(i,o){var n=o?7:0,s=2*n+1;if(this.nextRow+s>this.height)return u.warnOnce("LineAtlas out of space"),null;for(var p=0,f=0;f<i.length;f++)p+=i[f];if(p!==0){var d=this.width/p,v=this.getDashRanges(i,this.width,d);o?this.addRoundDash(v,d,n):this.addRegularDash(v)}var w={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:p};return this.nextRow+=s,this.dirty=!0,w},St.prototype.bind=function(i){var o=i.gl;this.texture?(o.bindTexture(o.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,o.texSubImage2D(o.TEXTURE_2D,0,0,0,this.width,this.height,o.ALPHA,o.UNSIGNED_BYTE,this.data))):(this.texture=o.createTexture(),o.bindTexture(o.TEXTURE_2D,this.texture),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texImage2D(o.TEXTURE_2D,0,o.ALPHA,this.width,this.height,0,o.ALPHA,o.UNSIGNED_BYTE,this.data))};var Ut=function i(o,n){this.workerPool=o,this.actors=[],this.currentActor=0,this.id=u.uniqueId();for(var s=this.workerPool.acquire(this.id),p=0;p<s.length;p++){var f=new i.Actor(s[p],n,this.id);f.name="Worker "+p,this.actors.push(f)}};function Hr(i,o,n){var s=function(p,f){if(p)return n(p);if(f){var d=u.pick(u.extend(f,i),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);f.vector_layers&&(d.vectorLayers=f.vector_layers,d.vectorLayerIds=d.vectorLayers.map((function(v){return v.id}))),d.tiles=o.canonicalizeTileset(d,i.url),n(null,d)}};return i.url?u.getJSON(o.transformRequest(o.normalizeSourceURL(i.url),u.ResourceType.Source),s):u.browser.frame((function(){return s(null,i)}))}Ut.prototype.broadcast=function(i,o,n){u.asyncAll(this.actors,(function(s,p){s.send(i,o,p)}),n=n||function(){})},Ut.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},Ut.prototype.remove=function(){this.actors.forEach((function(i){i.remove()})),this.actors=[],this.workerPool.release(this.id)},Ut.Actor=u.Actor;var Pr=function(i,o,n){this.bounds=u.LngLatBounds.convert(this.validateBounds(i)),this.minzoom=o||0,this.maxzoom=n||24};Pr.prototype.validateBounds=function(i){return Array.isArray(i)&&i.length===4?[Math.max(-180,i[0]),Math.max(-90,i[1]),Math.min(180,i[2]),Math.min(90,i[3])]:[-180,-90,180,90]},Pr.prototype.contains=function(i){var o=Math.pow(2,i.z),n=Math.floor(u.mercatorXfromLng(this.bounds.getWest())*o),s=Math.floor(u.mercatorYfromLat(this.bounds.getNorth())*o),p=Math.ceil(u.mercatorXfromLng(this.bounds.getEast())*o),f=Math.ceil(u.mercatorYfromLat(this.bounds.getSouth())*o);return i.x>=n&&i.x<p&&i.y>=s&&i.y<f};var bi=(function(i){function o(n,s,p,f){if(i.call(this),this.id=n,this.dispatcher=p,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,u.extend(this,u.pick(s,["url","scheme","tileSize","promoteId"])),this._options=u.extend({type:"vector"},s),this._collectResourceTiming=s.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(f)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Hr(this._options,this.map._requestManager,(function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new u.ErrorEvent(s)):p&&(u.extend(n,p),p.bounds&&(n.tileBounds=new Pr(p.bounds,n.minzoom,n.maxzoom)),u.postTurnstileEvent(p.tiles,n.map._requestManager._customAccessToken),u.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken,n.map._requestManager._customAccessToken),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setSourceProperty=function(n){this._tileJSONRequest&&this._tileJSONRequest.cancel(),n(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},o.prototype.setTiles=function(n){var s=this;return this.setSourceProperty((function(){s._options.tiles=n})),this},o.prototype.setUrl=function(n){var s=this;return this.setSourceProperty((function(){s.url=n,s._options.url=n})),this},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return u.extend({},this._options)},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme)),f={request:this.map._requestManager.transformRequest(p,u.ResourceType.Tile),uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,tileSize:this.tileSize*n.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:u.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function d(v,w){return delete n.request,n.aborted?s(null):v&&v.status!==404?s(v):(w&&w.resourceTiming&&(n.resourceTiming=w.resourceTiming),this.map._refreshExpiredTiles&&w&&n.setExpiryData(w),n.loadVectorData(w,this.map.painter),u.cacheEntryPossiblyAdded(this.dispatcher),s(null),void(n.reloadCallback&&(this.loadTile(n,n.reloadCallback),n.reloadCallback=null)))}f.request.collectResourceTiming=this._collectResourceTiming,n.actor&&n.state!=="expired"?n.state==="loading"?n.reloadCallback=s:n.request=n.actor.send("reloadTile",f,d.bind(this)):(n.actor=this.dispatcher.getActor(),n.request=n.actor.send("loadTile",f,d.bind(this)))},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.actor&&n.actor.send("abortTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.unloadTile=function(n){n.unloadVectorData(),n.actor&&n.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.hasTransition=function(){return!1},o})(u.Evented),or=(function(i){function o(n,s,p,f){i.call(this),this.id=n,this.dispatcher=p,this.setEventedParent(f),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=u.extend({type:"raster"},s),u.extend(this,u.pick(s,["url","scheme","tileSize"]))}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Hr(this._options,this.map._requestManager,(function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new u.ErrorEvent(s)):p&&(u.extend(n,p),p.bounds&&(n.tileBounds=new Pr(p.bounds,n.minzoom,n.maxzoom)),u.postTurnstileEvent(p.tiles),u.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return u.extend({},this._options)},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.loadTile=function(n,s){var p=this,f=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);n.request=u.getImage(this.map._requestManager.transformRequest(f,u.ResourceType.Tile),(function(d,v){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(d)n.state="errored",s(d);else if(v){p.map._refreshExpiredTiles&&n.setExpiryData(v),delete v.cacheControl,delete v.expires;var w=p.map.painter.context,A=w.gl;n.texture=p.map.painter.getTileTexture(v.width),n.texture?n.texture.update(v,{useMipmap:!0}):(n.texture=new u.Texture(w,v,A.RGBA,{useMipmap:!0}),n.texture.bind(A.LINEAR,A.CLAMP_TO_EDGE,A.LINEAR_MIPMAP_NEAREST),w.extTextureFilterAnisotropic&&A.texParameterf(A.TEXTURE_2D,w.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,w.extTextureFilterAnisotropicMax)),n.state="loaded",u.cacheEntryPossiblyAdded(p.dispatcher),s(null)}}))},o.prototype.abortTile=function(n,s){n.request&&(n.request.cancel(),delete n.request),s()},o.prototype.unloadTile=function(n,s){n.texture&&this.map.painter.saveTileTexture(n.texture),s()},o.prototype.hasTransition=function(){return!1},o})(u.Evented),Rr=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),this.type="raster-dem",this.maxzoom=22,this._options=u.extend({type:"raster-dem"},s),this.encoding=s.encoding||"mapbox"}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function f(d,v){d&&(n.state="errored",s(d)),v&&(n.dem=v,n.needsHillshadePrepare=!0,n.state="loaded",s(null))}n.request=u.getImage(this.map._requestManager.transformRequest(p,u.ResourceType.Tile),(function(d,v){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(d)n.state="errored",s(d);else if(v){this.map._refreshExpiredTiles&&n.setExpiryData(v),delete v.cacheControl,delete v.expires;var w=u.window.ImageBitmap&&v instanceof u.window.ImageBitmap&&u.offscreenCanvasSupported()?v:u.browser.getImageData(v,1),A={uid:n.uid,coord:n.tileID,source:this.id,rawImageData:w,encoding:this.encoding};n.actor&&n.state!=="expired"||(n.actor=this.dispatcher.getActor(),n.actor.send("loadDEMTile",A,f.bind(this)))}}).bind(this)),n.neighboringTiles=this._getNeighboringTiles(n.tileID)},o.prototype._getNeighboringTiles=function(n){var s=n.canonical,p=Math.pow(2,s.z),f=(s.x-1+p)%p,d=s.x===0?n.wrap-1:n.wrap,v=(s.x+1+p)%p,w=s.x+1===p?n.wrap+1:n.wrap,A={};return A[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,w,s.z,v,s.y).key]={backfilled:!1},s.y>0&&(A[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y-1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y-1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,w,s.z,v,s.y-1).key]={backfilled:!1}),s.y+1<p&&(A[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y+1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y+1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,w,s.z,v,s.y+1).key]={backfilled:!1}),A},o.prototype.unloadTile=function(n){n.demTexture&&this.map.painter.saveTileTexture(n.demTexture),n.fbo&&(n.fbo.destroy(),delete n.fbo),n.dem&&delete n.dem,delete n.neighboringTiles,n.state="unloaded",n.actor&&n.actor.send("removeDEMTile",{uid:n.uid,source:this.id})},o})(or),et=(function(i){function o(n,s,p,f){i.call(this),this.id=n,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=p.getActor(),this.setEventedParent(f),this._data=s.data,this._options=u.extend({},s),this._collectResourceTiming=s.collectResourceTiming,this._resourceTiming=[],s.maxzoom!==void 0&&(this.maxzoom=s.maxzoom),s.type&&(this.type=s.type),s.attribution&&(this.attribution=s.attribution),this.promoteId=s.promoteId;var d=u.EXTENT/this.tileSize;this.workerOptions=u.extend({source:this.id,cluster:s.cluster||!1,geojsonVtOptions:{buffer:(s.buffer!==void 0?s.buffer:128)*d,tolerance:(s.tolerance!==void 0?s.tolerance:.375)*d,extent:u.EXTENT,maxZoom:this.maxzoom,lineMetrics:s.lineMetrics||!1,generateId:s.generateId||!1},superclusterOptions:{maxZoom:s.clusterMaxZoom!==void 0?Math.min(s.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,s.clusterMinPoints||2),extent:u.EXTENT,radius:(s.clusterRadius||50)*d,log:!1,generateId:s.generateId||!1},clusterProperties:s.clusterProperties,filter:s.filter},s.workerOptions)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this.fire(new u.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(s){if(s)n.fire(new u.ErrorEvent(s));else{var p={dataType:"source",sourceDataType:"metadata"};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(p.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new u.Event("data",p))}}))},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setData=function(n){var s=this;return this._data=n,this.fire(new u.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(p){if(p)s.fire(new u.ErrorEvent(p));else{var f={dataType:"source",sourceDataType:"content"};s._collectResourceTiming&&s._resourceTiming&&s._resourceTiming.length>0&&(f.resourceTiming=s._resourceTiming,s._resourceTiming=[]),s.fire(new u.Event("data",f))}})),this},o.prototype.getClusterExpansionZoom=function(n,s){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:n,source:this.id},s),this},o.prototype.getClusterChildren=function(n,s){return this.actor.send("geojson.getClusterChildren",{clusterId:n,source:this.id},s),this},o.prototype.getClusterLeaves=function(n,s,p,f){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:n,limit:s,offset:p},f),this},o.prototype._updateWorkerData=function(n){var s=this;this._loaded=!1;var p=u.extend({},this.workerOptions),f=this._data;typeof f=="string"?(p.request=this.map._requestManager.transformRequest(u.browser.resolveURL(f),u.ResourceType.Source),p.request.collectResourceTiming=this._collectResourceTiming):p.data=JSON.stringify(f),this.actor.send(this.type+".loadData",p,(function(d,v){s._removed||v&&v.abandoned||(s._loaded=!0,v&&v.resourceTiming&&v.resourceTiming[s.id]&&(s._resourceTiming=v.resourceTiming[s.id].slice(0)),s.actor.send(s.type+".coalesce",{source:p.source},null),n(d))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.loadTile=function(n,s){var p=this,f=n.actor?"reloadTile":"loadTile";n.actor=this.actor,n.request=this.actor.send(f,{type:this.type,uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:u.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(d,v){return delete n.request,n.unloadVectorData(),n.aborted?s(null):d?s(d):(n.loadVectorData(v,p.map.painter,f==="reloadTile"),s(null))}))},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.aborted=!0},o.prototype.unloadTile=function(n){n.unloadVectorData(),this.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id})},o.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},o.prototype.serialize=function(){return u.extend({},this._options,{type:this.type,data:this._data})},o.prototype.hasTransition=function(){return!1},o})(u.Evented),Lr=u.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Xr=(function(i){function o(n,s,p,f){i.call(this),this.id=n,this.dispatcher=p,this.coordinates=s.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(f),this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(n,s){var p=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this.url=this.options.url,u.getImage(this.map._requestManager.transformRequest(this.url,u.ResourceType.Image),(function(f,d){p._loaded=!0,f?p.fire(new u.ErrorEvent(f)):d&&(p.image=d,n&&(p.coordinates=n),s&&s(),p._finishLoading())}))},o.prototype.loaded=function(){return this._loaded},o.prototype.updateImage=function(n){var s=this;return this.image&&n.url?(this.options.url=n.url,this.load(n.coordinates,(function(){s.texture=null})),this):this},o.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})))},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setCoordinates=function(n){var s=this;this.coordinates=n;var p=n.map(u.MercatorCoordinate.fromLngLat);this.tileID=(function(d){for(var v=1/0,w=1/0,A=-1/0,R=-1/0,F=0,O=d;F<O.length;F+=1){var W=O[F];v=Math.min(v,W.x),w=Math.min(w,W.y),A=Math.max(A,W.x),R=Math.max(R,W.y)}var Z=Math.max(A-v,R-w),ee=Math.max(0,Math.floor(-Math.log(Z)/Math.LN2)),N=Math.pow(2,ee);return new u.CanonicalTileID(ee,Math.floor((v+A)/2*N),Math.floor((w+R)/2*N))})(p),this.minzoom=this.maxzoom=this.tileID.z;var f=p.map((function(d){return s.tileID.getTilePoint(d)._round()}));return this._boundsArray=new u.StructArrayLayout4i8,this._boundsArray.emplaceBack(f[0].x,f[0].y,0,0),this._boundsArray.emplaceBack(f[1].x,f[1].y,u.EXTENT,0),this._boundsArray.emplaceBack(f[3].x,f[3].y,0,u.EXTENT),this._boundsArray.emplaceBack(f[2].x,f[2].y,u.EXTENT,u.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})),this},o.prototype.prepare=function(){if(Object.keys(this.tiles).length!==0&&this.image){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Lr.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new u.Texture(n,this.image,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var f=this.tiles[p];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture)}}},o.prototype.loadTile=function(n,s){this.tileID&&this.tileID.equals(n.tileID.canonical)?(this.tiles[String(n.tileID.wrap)]=n,n.buckets={},s(null)):(n.state="errored",s(null))},o.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return!1},o})(u.Evented),Et=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),this.roundZoom=!0,this.type="video",this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1;var s=this.options;this.urls=[];for(var p=0,f=s.urls;p<f.length;p+=1)this.urls.push(this.map._requestManager.transformRequest(f[p],u.ResourceType.Source).url);u.getVideo(this.urls,(function(d,v){n._loaded=!0,d?n.fire(new u.ErrorEvent(d)):v&&(n.video=v,n.video.loop=!0,n.video.setAttribute("playsinline",""),n.video.addEventListener("playing",(function(){n.map.triggerRepaint()})),n.map&&n.video.play(),n._finishLoading())}))},o.prototype.pause=function(){this.video&&this.video.pause()},o.prototype.play=function(){this.video&&this.video.play()},o.prototype.seek=function(n){if(this.video){var s=this.video.seekable;n<s.start(0)||n>s.end(0)?this.fire(new u.ErrorEvent(new u.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+s.start(0)+" and "+s.end(0)+"-second mark."))):this.video.currentTime=n}},o.prototype.getVideo=function(){return this.video},o.prototype.onAdd=function(n){this.map||(this.map=n,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},o.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Lr.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),s.texSubImage2D(s.TEXTURE_2D,0,0,0,s.RGBA,s.UNSIGNED_BYTE,this.video)):(this.texture=new u.Texture(n,this.video,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var f=this.tiles[p];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this.video&&!this.video.paused},o})(Xr),Fr=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),s.coordinates?Array.isArray(s.coordinates)&&s.coordinates.length===4&&!s.coordinates.some((function(d){return!Array.isArray(d)||d.length!==2||d.some((function(v){return typeof v!="number"}))}))||this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'missing required property "coordinates"'))),s.animate&&typeof s.animate!="boolean"&&this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'optional "animate" property must be a boolean value'))),s.canvas?typeof s.canvas=="string"||s.canvas instanceof u.window.HTMLCanvasElement||this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,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 u.ErrorEvent(new u.ValidationError("sources."+n,null,'missing required property "canvas"'))),this.options=s,this.animate=s.animate===void 0||s.animate}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof u.window.HTMLCanvasElement?this.options.canvas:u.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new u.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},o.prototype.getCanvas=function(){return this.canvas},o.prototype.onAdd=function(n){this.map=n,this.load(),this.canvas&&this.animate&&this.play()},o.prototype.onRemove=function(){this.pause()},o.prototype.prepare=function(){var n=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,n=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,n=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var s=this.map.painter.context,p=s.gl;for(var f in this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,Lr.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(n||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new u.Texture(s,this.canvas,p.RGBA,{premultiply:!0}),this.tiles){var d=this.tiles[f];d.state!=="loaded"&&(d.state="loaded",d.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this._playing},o.prototype._hasInvalidDimensions=function(){for(var n=0,s=[this.canvas.width,this.canvas.height];n<s.length;n+=1){var p=s[n];if(isNaN(p)||p<=0)return!0}return!1},o})(Xr),Mi={vector:bi,raster:or,"raster-dem":Rr,geojson:et,video:Et,image:Xr,canvas:Fr};function pi(i,o){var n=u.identity([]);return u.translate(n,n,[1,1,0]),u.scale(n,n,[.5*i.width,.5*i.height,1]),u.multiply(n,n,i.calculatePosMatrix(o.toUnwrapped()))}function Or(i,o,n,s,p,f){var d=(function(ee,N,Q){if(ee)for(var ne=0,ue=ee;ne<ue.length;ne+=1){var me=N[ue[ne]];if(me&&me.source===Q&&me.type==="fill-extrusion")return!0}else for(var pe in N){var ve=N[pe];if(ve.source===Q&&ve.type==="fill-extrusion")return!0}return!1})(p&&p.layers,o,i.id),v=f.maxPitchScaleFactor(),w=i.tilesIn(s,v,d);w.sort(Xi);for(var A=[],R=0,F=w;R<F.length;R+=1){var O=F[R];A.push({wrappedTileID:O.tileID.wrapped().key,queryResults:O.tile.queryRenderedFeatures(o,n,i._state,O.queryGeometry,O.cameraQueryGeometry,O.scale,p,f,v,pi(i.transform,O.tileID))})}var W=(function(ee){for(var N={},Q={},ne=0,ue=ee;ne<ue.length;ne+=1){var me=ue[ne],pe=me.queryResults,ve=me.wrappedTileID,Te=Q[ve]=Q[ve]||{};for(var ke in pe)for(var Ce=pe[ke],$e=Te[ke]=Te[ke]||{},nt=N[ke]=N[ke]||[],ut=0,st=Ce;ut<st.length;ut+=1){var Ft=st[ut];$e[Ft.featureIndex]||($e[Ft.featureIndex]=!0,nt.push(Ft))}}return N})(A);for(var Z in W)W[Z].forEach((function(ee){var N=ee.feature,Q=i.getFeatureState(N.layer["source-layer"],N.id);N.source=N.layer.source,N.layer["source-layer"]&&(N.sourceLayer=N.layer["source-layer"]),N.state=Q}));return W}function Xi(i,o){var n=i.tileID,s=o.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}var Nt=function(i,o){this.max=i,this.onRemove=o,this.reset()};Nt.prototype.reset=function(){for(var i in this.data)for(var o=0,n=this.data[i];o<n.length;o+=1){var s=n[o];s.timeout&&clearTimeout(s.timeout),this.onRemove(s.value)}return this.data={},this.order=[],this},Nt.prototype.add=function(i,o,n){var s=this,p=i.wrapped().key;this.data[p]===void 0&&(this.data[p]=[]);var f={value:o,timeout:void 0};if(n!==void 0&&(f.timeout=setTimeout((function(){s.remove(i,f)}),n)),this.data[p].push(f),this.order.push(p),this.order.length>this.max){var d=this._getAndRemoveByKey(this.order[0]);d&&this.onRemove(d)}return this},Nt.prototype.has=function(i){return i.wrapped().key in this.data},Nt.prototype.getAndRemove=function(i){return this.has(i)?this._getAndRemoveByKey(i.wrapped().key):null},Nt.prototype._getAndRemoveByKey=function(i){var o=this.data[i].shift();return o.timeout&&clearTimeout(o.timeout),this.data[i].length===0&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),o.value},Nt.prototype.getByKey=function(i){var o=this.data[i];return o?o[0].value:null},Nt.prototype.get=function(i){return this.has(i)?this.data[i.wrapped().key][0].value:null},Nt.prototype.remove=function(i,o){if(!this.has(i))return this;var n=i.wrapped().key,s=o===void 0?0:this.data[n].indexOf(o),p=this.data[n][s];return this.data[n].splice(s,1),p.timeout&&clearTimeout(p.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(p.value),this.order.splice(this.order.indexOf(n),1),this},Nt.prototype.setMaxSize=function(i){for(this.max=i;this.order.length>this.max;){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},Nt.prototype.filter=function(i){var o=[];for(var n in this.data)for(var s=0,p=this.data[n];s<p.length;s+=1){var f=p[s];i(f.value)||o.push(f)}for(var d=0,v=o;d<v.length;d+=1){var w=v[d];this.remove(w.value.tileID,w)}};var Nr=function(i,o,n){this.context=i;var s=i.gl;this.buffer=s.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),i.bindElementBuffer.set(this.buffer),s.bufferData(s.ELEMENT_ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?s.DYNAMIC_DRAW:s.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};Nr.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Nr.prototype.updateData=function(i){var o=this.context.gl;this.context.unbindVAO(),this.bind(),o.bufferSubData(o.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)},Nr.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var ar={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},sr=function(i,o,n,s){this.length=o.length,this.attributes=n,this.itemSize=o.bytesPerElement,this.dynamicDraw=s,this.context=i;var p=i.gl;this.buffer=p.createBuffer(),i.bindVertexBuffer.set(this.buffer),p.bufferData(p.ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};sr.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},sr.prototype.updateData=function(i){var o=this.context.gl;this.bind(),o.bufferSubData(o.ARRAY_BUFFER,0,i.arrayBuffer)},sr.prototype.enableAttributes=function(i,o){for(var n=0;n<this.attributes.length;n++){var s=o.attributes[this.attributes[n].name];s!==void 0&&i.enableVertexAttribArray(s)}},sr.prototype.setVertexAttribPointers=function(i,o,n){for(var s=0;s<this.attributes.length;s++){var p=this.attributes[s],f=o.attributes[p.name];f!==void 0&&i.vertexAttribPointer(f,p.components,i[ar[p.type]],!1,this.itemSize,p.offset+this.itemSize*(n||0))}},sr.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var lt=function(i){this.gl=i.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};lt.prototype.get=function(){return this.current},lt.prototype.set=function(i){},lt.prototype.getDefault=function(){return this.default},lt.prototype.setDefault=function(){this.set(this.default)};var mr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return u.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.clearColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o})(lt),hr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 1},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearDepth(n),this.current=n,this.dirty=!1)},o})(lt),jr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearStencil(n),this.current=n,this.dirty=!1)},o})(lt),fr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[!0,!0,!0,!0]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.colorMask(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o})(lt),br=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthMask(n),this.current=n,this.dirty=!1)},o})(lt),dn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 255},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.stencilMask(n),this.current=n,this.dirty=!1)},o})(lt),Kr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},o.prototype.set=function(n){var s=this.current;(n.func!==s.func||n.ref!==s.ref||n.mask!==s.mask||this.dirty)&&(this.gl.stencilFunc(n.func,n.ref,n.mask),this.current=n,this.dirty=!1)},o})(lt),Bi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.KEEP,n.KEEP,n.KEEP]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||this.dirty)&&(this.gl.stencilOp(n[0],n[1],n[2]),this.current=n,this.dirty=!1)},o})(lt),hi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.STENCIL_TEST):s.disable(s.STENCIL_TEST),this.current=n,this.dirty=!1}},o})(lt),ti=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[0,1]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.depthRange(n[0],n[1]),this.current=n,this.dirty=!1)},o})(lt),ri=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.DEPTH_TEST):s.disable(s.DEPTH_TEST),this.current=n,this.dirty=!1}},o})(lt),Vi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.LESS},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthFunc(n),this.current=n,this.dirty=!1)},o})(lt),Ki=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.BLEND):s.disable(s.BLEND),this.current=n,this.dirty=!1}},o})(lt),yo=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.ONE,n.ZERO]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.blendFunc(n[0],n[1]),this.current=n,this.dirty=!1)},o})(lt),$o=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return u.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.blendColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o})(lt),mn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.FUNC_ADD},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.blendEquation(n),this.current=n,this.dirty=!1)},o})(lt),Mn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.CULL_FACE):s.disable(s.CULL_FACE),this.current=n,this.dirty=!1}},o})(lt),Bn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.BACK},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.cullFace(n),this.current=n,this.dirty=!1)},o})(lt),Zo=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.CCW},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.frontFace(n),this.current=n,this.dirty=!1)},o})(lt),jn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.useProgram(n),this.current=n,this.dirty=!1)},o})(lt),zn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.TEXTURE0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.activeTexture(n),this.current=n,this.dirty=!1)},o})(lt),rn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[0,0,n.drawingBufferWidth,n.drawingBufferHeight]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.viewport(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o})(lt),de=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindFramebuffer(s.FRAMEBUFFER,n),this.current=n,this.dirty=!1}},o})(lt),_e=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindRenderbuffer(s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o})(lt),jt=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindTexture(s.TEXTURE_2D,n),this.current=n,this.dirty=!1}},o})(lt),tr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindBuffer(s.ARRAY_BUFFER,n),this.current=n,this.dirty=!1}},o})(lt),Kt=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){var s=this.gl;s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,n),this.current=n,this.dirty=!1},o})(lt),_t=(function(i){function o(n){i.call(this,n),this.vao=n.extVertexArrayObject}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){this.vao&&(n!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(n),this.current=n,this.dirty=!1)},o})(lt),fi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 4},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,n),this.current=n,this.dirty=!1}},o})(lt),qi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),this.current=n,this.dirty=!1}},o})(lt),ii=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,n),this.current=n,this.dirty=!1}},o})(lt),Yt=(function(i){function o(n,s){i.call(this,n),this.context=n,this.parent=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o})(lt),T=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.setDirty=function(){this.dirty=!0},o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,n,0),this.current=n,this.dirty=!1}},o})(Yt),P=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o})(Yt),B=function(i,o,n,s){this.context=i,this.width=o,this.height=n;var p=this.framebuffer=i.gl.createFramebuffer();this.colorAttachment=new T(i,p),s&&(this.depthAttachment=new P(i,p))};B.prototype.destroy=function(){var i=this.context.gl,o=this.colorAttachment.get();if(o&&i.deleteTexture(o),this.depthAttachment){var n=this.depthAttachment.get();n&&i.deleteRenderbuffer(n)}i.deleteFramebuffer(this.framebuffer)};var V=function(i,o,n){this.func=i,this.mask=o,this.range=n};V.ReadOnly=!1,V.ReadWrite=!0,V.disabled=new V(519,V.ReadOnly,[0,1]);var $=function(i,o,n,s,p,f){this.test=i,this.ref=o,this.mask=n,this.fail=s,this.depthFail=p,this.pass=f};$.disabled=new $({func:519,mask:0},0,0,7680,7680,7680);var re=function(i,o,n){this.blendFunction=i,this.blendColor=o,this.mask=n};re.disabled=new re(re.Replace=[1,0],u.Color.transparent,[!1,!1,!1,!1]),re.unblended=new re(re.Replace,u.Color.transparent,[!0,!0,!0,!0]),re.alphaBlended=new re([1,771],u.Color.transparent,[!0,!0,!0,!0]);var ie=function(i,o,n){this.enable=i,this.mode=o,this.frontFace=n};ie.disabled=new ie(!1,1029,2305),ie.backCCW=new ie(!0,1029,2305);var L=function(i){this.gl=i,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new mr(this),this.clearDepth=new hr(this),this.clearStencil=new jr(this),this.colorMask=new fr(this),this.depthMask=new br(this),this.stencilMask=new dn(this),this.stencilFunc=new Kr(this),this.stencilOp=new Bi(this),this.stencilTest=new hi(this),this.depthRange=new ti(this),this.depthTest=new ri(this),this.depthFunc=new Vi(this),this.blend=new Ki(this),this.blendFunc=new yo(this),this.blendColor=new $o(this),this.blendEquation=new mn(this),this.cullFace=new Mn(this),this.cullFaceSide=new Bn(this),this.frontFace=new Zo(this),this.program=new jn(this),this.activeTexture=new zn(this),this.viewport=new rn(this),this.bindFramebuffer=new de(this),this.bindRenderbuffer=new _e(this),this.bindTexture=new jt(this),this.bindVertexBuffer=new tr(this),this.bindElementBuffer=new Kt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new _t(this),this.pixelStoreUnpack=new fi(this),this.pixelStoreUnpackPremultiplyAlpha=new qi(this),this.pixelStoreUnpackFlipY=new ii(this),this.extTextureFilterAnisotropic=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=i.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=i.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(i.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=i.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=i.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE)};L.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()},L.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},L.prototype.createIndexBuffer=function(i,o){return new Nr(this,i,o)},L.prototype.createVertexBuffer=function(i,o,n){return new sr(this,i,o,n)},L.prototype.createRenderbuffer=function(i,o,n){var s=this.gl,p=s.createRenderbuffer();return this.bindRenderbuffer.set(p),s.renderbufferStorage(s.RENDERBUFFER,i,o,n),this.bindRenderbuffer.set(null),p},L.prototype.createFramebuffer=function(i,o,n){return new B(this,i,o,n)},L.prototype.clear=function(i){var o=i.color,n=i.depth,s=this.gl,p=0;o&&(p|=s.COLOR_BUFFER_BIT,this.clearColor.set(o),this.colorMask.set([!0,!0,!0,!0])),n!==void 0&&(p|=s.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),s.clear(p)},L.prototype.setCullFace=function(i){i.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(i.mode),this.frontFace.set(i.frontFace))},L.prototype.setDepthMode=function(i){i.func!==this.gl.ALWAYS||i.mask?(this.depthTest.set(!0),this.depthFunc.set(i.func),this.depthMask.set(i.mask),this.depthRange.set(i.range)):this.depthTest.set(!1)},L.prototype.setStencilMode=function(i){i.test.func!==this.gl.ALWAYS||i.mask?(this.stencilTest.set(!0),this.stencilMask.set(i.mask),this.stencilOp.set([i.fail,i.depthFail,i.pass]),this.stencilFunc.set({func:i.test.func,ref:i.ref,mask:i.test.mask})):this.stencilTest.set(!1)},L.prototype.setColorMode=function(i){u.deepEqual(i.blendFunction,re.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(i.blendFunction),this.blendColor.set(i.blendColor)),this.colorMask.set(i.mask)},L.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var H=(function(i){function o(n,s,p){var f=this;i.call(this),this.id=n,this.dispatcher=p,this.on("data",(function(d){d.dataType==="source"&&d.sourceDataType==="metadata"&&(f._sourceLoaded=!0),f._sourceLoaded&&!f._paused&&d.dataType==="source"&&d.sourceDataType==="content"&&(f.reload(),f.transform&&f.update(f.transform))})),this.on("error",(function(){f._sourceErrored=!0})),this._source=(function(d,v,w,A){var R=new Mi[v.type](d,v,w,A);if(R.id!==d)throw new Error("Expected Source id to be "+d+" instead of "+R.id);return u.bindAll(["load","abort","unload","serialize","prepare"],R),R})(n,s,p,this),this._tiles={},this._cache=new Nt(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new u.SourceFeatureState}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.onAdd=function(n){this.map=n,this._maxTileCacheSize=n?n._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(n)},o.prototype.onRemove=function(n){this._source&&this._source.onRemove&&this._source.onRemove(n)},o.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var n in this._tiles){var s=this._tiles[n];if(s.state!=="loaded"&&s.state!=="errored")return!1}return!0},o.prototype.getSource=function(){return this._source},o.prototype.pause=function(){this._paused=!0},o.prototype.resume=function(){if(this._paused){var n=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,n&&this.reload(),this.transform&&this.update(this.transform)}},o.prototype._loadTile=function(n,s){return this._source.loadTile(n,s)},o.prototype._unloadTile=function(n){if(this._source.unloadTile)return this._source.unloadTile(n,(function(){}))},o.prototype._abortTile=function(n){if(this._source.abortTile)return this._source.abortTile(n,(function(){}))},o.prototype.serialize=function(){return this._source.serialize()},o.prototype.prepare=function(n){for(var s in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var p=this._tiles[s];p.upload(n),p.prepare(this.map.style.imageManager)}},o.prototype.getIds=function(){return u.values(this._tiles).map((function(n){return n.tileID})).sort(se).map((function(n){return n.key}))},o.prototype.getRenderableIds=function(n){var s=this,p=[];for(var f in this._tiles)this._isIdRenderable(f,n)&&p.push(this._tiles[f]);return n?p.sort((function(d,v){var w=d.tileID,A=v.tileID,R=new u.Point(w.canonical.x,w.canonical.y)._rotate(s.transform.angle),F=new u.Point(A.canonical.x,A.canonical.y)._rotate(s.transform.angle);return w.overscaledZ-A.overscaledZ||F.y-R.y||F.x-R.x})).map((function(d){return d.tileID.key})):p.map((function(d){return d.tileID})).sort(se).map((function(d){return d.key}))},o.prototype.hasRenderableParent=function(n){var s=this.findLoadedParent(n,0);return!!s&&this._isIdRenderable(s.tileID.key)},o.prototype._isIdRenderable=function(n,s){return this._tiles[n]&&this._tiles[n].hasData()&&!this._coveredTiles[n]&&(s||!this._tiles[n].holdingForFade())},o.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var n in this._cache.reset(),this._tiles)this._tiles[n].state!=="errored"&&this._reloadTile(n,"reloading")},o.prototype._reloadTile=function(n,s){var p=this._tiles[n];p&&(p.state!=="loading"&&(p.state=s),this._loadTile(p,this._tileLoaded.bind(this,p,n,s)))},o.prototype._tileLoaded=function(n,s,p,f){if(f)return n.state="errored",void(f.status!==404?this._source.fire(new u.ErrorEvent(f,{tile:n})):this.update(this.transform));n.timeAdded=u.browser.now(),p==="expired"&&(n.refreshedUponExpiration=!0),this._setTileReloadTimer(s,n),this.getSource().type==="raster-dem"&&n.dem&&this._backfillDEM(n),this._state.initializeTileState(n,this.map?this.map.painter:null),this._source.fire(new u.Event("data",{dataType:"source",tile:n,coord:n.tileID}))},o.prototype._backfillDEM=function(n){for(var s=this.getRenderableIds(),p=0;p<s.length;p++){var f=s[p];if(n.neighboringTiles&&n.neighboringTiles[f]){var d=this.getTileByID(f);v(n,d),v(d,n)}}function v(w,A){w.needsHillshadePrepare=!0;var R=A.tileID.canonical.x-w.tileID.canonical.x,F=A.tileID.canonical.y-w.tileID.canonical.y,O=Math.pow(2,w.tileID.canonical.z),W=A.tileID.key;R===0&&F===0||Math.abs(F)>1||(Math.abs(R)>1&&(Math.abs(R+O)===1?R+=O:Math.abs(R-O)===1&&(R-=O)),A.dem&&w.dem&&(w.dem.backfillBorder(A.dem,R,F),w.neighboringTiles&&w.neighboringTiles[W]&&(w.neighboringTiles[W].backfilled=!0)))}},o.prototype.getTile=function(n){return this.getTileByID(n.key)},o.prototype.getTileByID=function(n){return this._tiles[n]},o.prototype._retainLoadedChildren=function(n,s,p,f){for(var d in this._tiles){var v=this._tiles[d];if(!(f[d]||!v.hasData()||v.tileID.overscaledZ<=s||v.tileID.overscaledZ>p)){for(var w=v.tileID;v&&v.tileID.overscaledZ>s+1;){var A=v.tileID.scaledTo(v.tileID.overscaledZ-1);(v=this._tiles[A.key])&&v.hasData()&&(w=A)}for(var R=w;R.overscaledZ>s;)if(n[(R=R.scaledTo(R.overscaledZ-1)).key]){f[w.key]=w;break}}}},o.prototype.findLoadedParent=function(n,s){if(n.key in this._loadedParentTiles){var p=this._loadedParentTiles[n.key];return p&&p.tileID.overscaledZ>=s?p:null}for(var f=n.overscaledZ-1;f>=s;f--){var d=n.scaledTo(f),v=this._getLoadedTile(d);if(v)return v}},o.prototype._getLoadedTile=function(n){var s=this._tiles[n.key];return s&&s.hasData()?s:this._cache.getByKey(n.wrapped().key)},o.prototype.updateCacheSize=function(n){var s=Math.ceil(n.width/this._source.tileSize)+1,p=Math.ceil(n.height/this._source.tileSize)+1,f=Math.floor(s*p*5),d=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,f):f;this._cache.setMaxSize(d)},o.prototype.handleWrapJump=function(n){var s=Math.round((n-(this._prevLng===void 0?n:this._prevLng))/360);if(this._prevLng=n,s){var p={};for(var f in this._tiles){var d=this._tiles[f];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+s),p[d.tileID.key]=d}for(var v in this._tiles=p,this._timers)clearTimeout(this._timers[v]),delete this._timers[v];for(var w in this._tiles)this._setTileReloadTimer(w,this._tiles[w])}},o.prototype.update=function(n){var s=this;if(this.transform=n,this._sourceLoaded&&!this._paused){var p;this.updateCacheSize(n),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?p=n.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(Te){return new u.OverscaledTileID(Te.canonical.z,Te.wrap,Te.canonical.z,Te.canonical.x,Te.canonical.y)})):(p=n.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(p=p.filter((function(Te){return s._source.hasTile(Te)})))):p=[];var f=n.coveringZoomLevel(this._source),d=Math.max(f-o.maxOverzooming,this._source.minzoom),v=Math.max(f+o.maxUnderzooming,this._source.minzoom),w=this._updateRetainedTiles(p,f);if(Ie(this._source.type)){for(var A={},R={},F=0,O=Object.keys(w);F<O.length;F+=1){var W=O[F],Z=w[W],ee=this._tiles[W];if(ee&&!(ee.fadeEndTime&&ee.fadeEndTime<=u.browser.now())){var N=this.findLoadedParent(Z,d);N&&(this._addTile(N.tileID),A[N.tileID.key]=N.tileID),R[W]=Z}}for(var Q in this._retainLoadedChildren(R,f,v,w),A)w[Q]||(this._coveredTiles[Q]=!0,w[Q]=A[Q])}for(var ne in w)this._tiles[ne].clearFadeHold();for(var ue=0,me=u.keysDifference(this._tiles,w);ue<me.length;ue+=1){var pe=me[ue],ve=this._tiles[pe];ve.hasSymbolBuckets&&!ve.holdingForFade()?ve.setHoldDuration(this.map._fadeDuration):ve.hasSymbolBuckets&&!ve.symbolFadeFinished()||this._removeTile(pe)}this._updateLoadedParentTileCache()}},o.prototype.releaseSymbolFadeTiles=function(){for(var n in this._tiles)this._tiles[n].holdingForFade()&&this._removeTile(n)},o.prototype._updateRetainedTiles=function(n,s){for(var p={},f={},d=Math.max(s-o.maxOverzooming,this._source.minzoom),v=Math.max(s+o.maxUnderzooming,this._source.minzoom),w={},A=0,R=n;A<R.length;A+=1){var F=R[A],O=this._addTile(F);p[F.key]=F,O.hasData()||s<this._source.maxzoom&&(w[F.key]=F)}this._retainLoadedChildren(w,s,v,p);for(var W=0,Z=n;W<Z.length;W+=1){var ee=Z[W],N=this._tiles[ee.key];if(!N.hasData()){if(s+1>this._source.maxzoom){var Q=ee.children(this._source.maxzoom)[0],ne=this.getTile(Q);if(ne&&ne.hasData()){p[Q.key]=Q;continue}}else{var ue=ee.children(this._source.maxzoom);if(p[ue[0].key]&&p[ue[1].key]&&p[ue[2].key]&&p[ue[3].key])continue}for(var me=N.wasRequested(),pe=ee.overscaledZ-1;pe>=d;--pe){var ve=ee.scaledTo(pe);if(f[ve.key]||(f[ve.key]=!0,!(N=this.getTile(ve))&&me&&(N=this._addTile(ve)),N&&(p[ve.key]=ve,me=N.wasRequested(),N.hasData())))break}}}return p},o.prototype._updateLoadedParentTileCache=function(){for(var n in this._loadedParentTiles={},this._tiles){for(var s=[],p=void 0,f=this._tiles[n].tileID;f.overscaledZ>0;){if(f.key in this._loadedParentTiles){p=this._loadedParentTiles[f.key];break}s.push(f.key);var d=f.scaledTo(f.overscaledZ-1);if(p=this._getLoadedTile(d))break;f=d}for(var v=0,w=s;v<w.length;v+=1)this._loadedParentTiles[w[v]]=p}},o.prototype._addTile=function(n){var s=this._tiles[n.key];if(s)return s;(s=this._cache.getAndRemove(n))&&(this._setTileReloadTimer(n.key,s),s.tileID=n,this._state.initializeTileState(s,this.map?this.map.painter:null),this._cacheTimers[n.key]&&(clearTimeout(this._cacheTimers[n.key]),delete this._cacheTimers[n.key],this._setTileReloadTimer(n.key,s)));var p=!!s;return p||(s=new u.Tile(n,this._source.tileSize*n.overscaleFactor()),this._loadTile(s,this._tileLoaded.bind(this,s,n.key,s.state))),s?(s.uses++,this._tiles[n.key]=s,p||this._source.fire(new u.Event("dataloading",{tile:s,coord:s.tileID,dataType:"source"})),s):null},o.prototype._setTileReloadTimer=function(n,s){var p=this;n in this._timers&&(clearTimeout(this._timers[n]),delete this._timers[n]);var f=s.getExpiryTimeout();f&&(this._timers[n]=setTimeout((function(){p._reloadTile(n,"expired"),delete p._timers[n]}),f))},o.prototype._removeTile=function(n){var s=this._tiles[n];s&&(s.uses--,delete this._tiles[n],this._timers[n]&&(clearTimeout(this._timers[n]),delete this._timers[n]),s.uses>0||(s.hasData()&&s.state!=="reloading"?this._cache.add(s.tileID,s,s.getExpiryTimeout()):(s.aborted=!0,this._abortTile(s),this._unloadTile(s))))},o.prototype.clearTiles=function(){for(var n in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(n);this._cache.reset()},o.prototype.tilesIn=function(n,s,p){var f=this,d=[],v=this.transform;if(!v)return d;for(var w=p?v.getCameraQueryGeometry(n):n,A=n.map((function(pe){return v.pointCoordinate(pe)})),R=w.map((function(pe){return v.pointCoordinate(pe)})),F=this.getIds(),O=1/0,W=1/0,Z=-1/0,ee=-1/0,N=0,Q=R;N<Q.length;N+=1){var ne=Q[N];O=Math.min(O,ne.x),W=Math.min(W,ne.y),Z=Math.max(Z,ne.x),ee=Math.max(ee,ne.y)}for(var ue=function(pe){var ve=f._tiles[F[pe]];if(!ve.holdingForFade()){var Te=ve.tileID,ke=Math.pow(2,v.zoom-ve.tileID.overscaledZ),Ce=s*ve.queryPadding*u.EXTENT/ve.tileSize/ke,$e=[Te.getTilePoint(new u.MercatorCoordinate(O,W)),Te.getTilePoint(new u.MercatorCoordinate(Z,ee))];if($e[0].x-Ce<u.EXTENT&&$e[0].y-Ce<u.EXTENT&&$e[1].x+Ce>=0&&$e[1].y+Ce>=0){var nt=A.map((function(st){return Te.getTilePoint(st)})),ut=R.map((function(st){return Te.getTilePoint(st)}));d.push({tile:ve,tileID:Te,queryGeometry:nt,cameraQueryGeometry:ut,scale:ke})}}},me=0;me<F.length;me++)ue(me);return d},o.prototype.getVisibleCoordinates=function(n){for(var s=this,p=this.getRenderableIds(n).map((function(w){return s._tiles[w].tileID})),f=0,d=p;f<d.length;f+=1){var v=d[f];v.posMatrix=this.transform.calculatePosMatrix(v.toUnwrapped())}return p},o.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Ie(this._source.type))for(var n in this._tiles){var s=this._tiles[n];if(s.fadeEndTime!==void 0&&s.fadeEndTime>=u.browser.now())return!0}return!1},o.prototype.setFeatureState=function(n,s,p){this._state.updateState(n=n||"_geojsonTileLayer",s,p)},o.prototype.removeFeatureState=function(n,s,p){this._state.removeFeatureState(n=n||"_geojsonTileLayer",s,p)},o.prototype.getFeatureState=function(n,s){return this._state.getState(n=n||"_geojsonTileLayer",s)},o.prototype.setDependencies=function(n,s,p){var f=this._tiles[n];f&&f.setDependencies(s,p)},o.prototype.reloadTilesForDependencies=function(n,s){for(var p in this._tiles)this._tiles[p].hasDependency(n,s)&&this._reloadTile(p,"reloading");this._cache.filter((function(f){return!f.hasDependency(n,s)}))},o})(u.Evented);function se(i,o){var n=Math.abs(2*i.wrap)-+(i.wrap<0),s=Math.abs(2*o.wrap)-+(o.wrap<0);return i.overscaledZ-o.overscaledZ||s-n||o.canonical.y-i.canonical.y||o.canonical.x-i.canonical.x}function Ie(i){return i==="raster"||i==="image"||i==="video"}function Ee(){return new u.window.Worker(gs.workerUrl)}H.maxOverzooming=10,H.maxUnderzooming=3;var ye="mapboxgl_preloaded_worker_pool",Ae=function(){this.active={}};Ae.prototype.acquire=function(i){if(!this.workers)for(this.workers=[];this.workers.length<Ae.workerCount;)this.workers.push(new Ee);return this.active[i]=!0,this.workers.slice()},Ae.prototype.release=function(i){delete this.active[i],this.numActive()===0&&(this.workers.forEach((function(o){o.terminate()})),this.workers=null)},Ae.prototype.isPreloaded=function(){return!!this.active[ye]},Ae.prototype.numActive=function(){return Object.keys(this.active).length};var Je,Ge=Math.floor(u.browser.hardwareConcurrency/2);function ge(){return Je||(Je=new Ae),Je}function Ve(i,o){var n={};for(var s in i)s!=="ref"&&(n[s]=i[s]);return u.refProperties.forEach((function(p){p in o&&(n[p]=o[p])})),n}function Be(i){i=i.slice();for(var o=Object.create(null),n=0;n<i.length;n++)o[i[n].id]=i[n];for(var s=0;s<i.length;s++)"ref"in i[s]&&(i[s]=Ve(i[s],o[i[s].ref]));return i}Ae.workerCount=Math.max(Math.min(Ge,6),1);var Me={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 yt(i,o,n){n.push({command:Me.addSource,args:[i,o[i]]})}function Fe(i,o,n){o.push({command:Me.removeSource,args:[i]}),n[i]=!0}function Pt(i,o,n,s){Fe(i,n,s),yt(i,o,n)}function rr(i,o,n){var s;for(s in i[n])if(i[n].hasOwnProperty(s)&&s!=="data"&&!u.deepEqual(i[n][s],o[n][s]))return!1;for(s in o[n])if(o[n].hasOwnProperty(s)&&s!=="data"&&!u.deepEqual(i[n][s],o[n][s]))return!1;return!0}function Ct(i,o,n,s,p,f){var d;for(d in o=o||{},i=i||{})i.hasOwnProperty(d)&&(u.deepEqual(i[d],o[d])||n.push({command:f,args:[s,d,o[d],p]}));for(d in o)o.hasOwnProperty(d)&&!i.hasOwnProperty(d)&&(u.deepEqual(i[d],o[d])||n.push({command:f,args:[s,d,o[d],p]}))}function Gt(i){return i.id}function Rt(i,o){return i[o.id]=o,i}var wi=function(i,o){this.reset(i,o)};wi.prototype.reset=function(i,o){this.points=i||[],this._distances=[0];for(var n=1;n<this.points.length;n++)this._distances[n]=this._distances[n-1]+this.points[n].dist(this.points[n-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(o||0,.5*this.length),this.paddedLength=this.length-2*this.padding},wi.prototype.lerp=function(i){if(this.points.length===1)return this.points[0];i=u.clamp(i,0,1);for(var o=1,n=this._distances[o],s=i*this.paddedLength+this.padding;n<s&&o<this._distances.length;)n=this._distances[++o];var p=o-1,f=this._distances[p],d=n-f,v=d>0?(s-f)/d:0;return this.points[p].mult(1-v).add(this.points[o].mult(v))};var Ht=function(i,o,n){var s=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(i/n),this.yCellCount=Math.ceil(o/n);for(var f=0;f<this.xCellCount*this.yCellCount;f++)s.push([]),p.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=i,this.height=o,this.xScale=this.xCellCount/i,this.yScale=this.yCellCount/o,this.boxUid=0,this.circleUid=0};function Cr(i,o,n,s,p){var f=u.create();return o?(u.scale(f,f,[1/p,1/p,1]),n||u.rotateZ(f,f,s.angle)):u.multiply(f,s.labelPlaneMatrix,i),f}function Qt(i,o,n,s,p){if(o){var f=u.clone(i);return u.scale(f,f,[p,p,1]),n||u.rotateZ(f,f,-s.angle),f}return s.glCoordMatrix}function zt(i,o){var n=[i.x,i.y,0,1];oi(n,n,o);var s=n[3];return{point:new u.Point(n[0]/s,n[1]/s),signedDistanceFromCamera:s}}function $t(i,o){return .5+i/o*.5}function zi(i,o){var n=i[0]/i[3],s=i[1]/i[3];return n>=-o[0]&&n<=o[0]&&s>=-o[1]&&s<=o[1]}function ma(i,o,n,s,p,f,d,v){var w=s?i.textSizeData:i.iconSizeData,A=u.evaluateSizeForZoom(w,n.transform.zoom),R=[256/n.width*2+1,256/n.height*2+1],F=s?i.text.dynamicLayoutVertexArray:i.icon.dynamicLayoutVertexArray;F.clear();for(var O=i.lineVertexArray,W=s?i.text.placedSymbolArray:i.icon.placedSymbolArray,Z=n.transform.width/n.transform.height,ee=!1,N=0;N<W.length;N++){var Q=W.get(N);if(Q.hidden||Q.writingMode===u.WritingMode.vertical&&!ee)Si(Q.numGlyphs,F);else{ee=!1;var ne=[Q.anchorX,Q.anchorY,0,1];if(u.transformMat4(ne,ne,o),zi(ne,R)){var ue=$t(n.transform.cameraToCenterDistance,ne[3]),me=u.evaluateSizeForFeature(w,A,Q),pe=d?me/ue:me*ue,ve=new u.Point(Q.anchorX,Q.anchorY),Te=zt(ve,p).point,ke={},Ce=ru(Q,pe,!1,v,o,p,f,i.glyphOffsetArray,O,F,Te,ve,ke,Z);ee=Ce.useVertical,(Ce.notEnoughRoom||ee||Ce.needsFlipping&&ru(Q,pe,!0,v,o,p,f,i.glyphOffsetArray,O,F,Te,ve,ke,Z).notEnoughRoom)&&Si(Q.numGlyphs,F)}else Si(Q.numGlyphs,F)}}s?i.text.dynamicLayoutVertexBuffer.updateData(F):i.icon.dynamicLayoutVertexBuffer.updateData(F)}function ni(i,o,n,s,p,f,d,v,w,A,R){var F=v.glyphStartIndex+v.numGlyphs,O=v.lineStartIndex,W=v.lineStartIndex+v.lineLength,Z=o.getoffsetX(v.glyphStartIndex),ee=o.getoffsetX(F-1),N=kr(i*Z,n,s,p,f,d,v.segment,O,W,w,A,R);if(!N)return null;var Q=kr(i*ee,n,s,p,f,d,v.segment,O,W,w,A,R);return Q?{first:N,last:Q}:null}function Di(i,o,n,s){return i===u.WritingMode.horizontal&&Math.abs(n.y-o.y)>Math.abs(n.x-o.x)*s?{useVertical:!0}:(i===u.WritingMode.vertical?o.y<n.y:o.x>n.x)?{needsFlipping:!0}:null}function ru(i,o,n,s,p,f,d,v,w,A,R,F,O,W){var Z,ee=o/24,N=i.lineOffsetX*ee,Q=i.lineOffsetY*ee;if(i.numGlyphs>1){var ne=i.glyphStartIndex+i.numGlyphs,ue=i.lineStartIndex,me=i.lineStartIndex+i.lineLength,pe=ni(ee,v,N,Q,n,R,F,i,w,f,O);if(!pe)return{notEnoughRoom:!0};var ve=zt(pe.first.point,d).point,Te=zt(pe.last.point,d).point;if(s&&!n){var ke=Di(i.writingMode,ve,Te,W);if(ke)return ke}Z=[pe.first];for(var Ce=i.glyphStartIndex+1;Ce<ne-1;Ce++)Z.push(kr(ee*v.getoffsetX(Ce),N,Q,n,R,F,i.segment,ue,me,w,f,O));Z.push(pe.last)}else{if(s&&!n){var $e=zt(F,p).point,nt=i.lineStartIndex+i.segment+1,ut=new u.Point(w.getx(nt),w.gety(nt)),st=zt(ut,p),Ft=st.signedDistanceFromCamera>0?st.point:ya(F,ut,$e,1,p),We=Di(i.writingMode,$e,Ft,W);if(We)return We}var mt=kr(ee*v.getoffsetX(i.glyphStartIndex),N,Q,n,R,F,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,w,f,O);if(!mt)return{notEnoughRoom:!0};Z=[mt]}for(var xt=0,dt=Z;xt<dt.length;xt+=1){var ft=dt[xt];u.addDynamicAttributes(A,ft.point,ft.angle)}return{}}function ya(i,o,n,s,p){var f=zt(i.add(i.sub(o)._unit()),p).point,d=n.sub(f);return n.add(d._mult(s/d.mag()))}function kr(i,o,n,s,p,f,d,v,w,A,R,F){var O=s?i-o:i+o,W=O>0?1:-1,Z=0;s&&(W*=-1,Z=Math.PI),W<0&&(Z+=Math.PI);for(var ee=W>0?v+d:v+d+1,N=p,Q=p,ne=0,ue=0,me=Math.abs(O),pe=[];ne+ue<=me;){if((ee+=W)<v||ee>=w)return null;if(Q=N,pe.push(N),(N=F[ee])===void 0){var ve=new u.Point(A.getx(ee),A.gety(ee)),Te=zt(ve,R);if(Te.signedDistanceFromCamera>0)N=F[ee]=Te.point;else{var ke=ee-W;N=ya(ne===0?f:new u.Point(A.getx(ke),A.gety(ke)),ve,Q,me-ne+1,R)}}ne+=ue,ue=Q.dist(N)}var Ce=(me-ne)/ue,$e=N.sub(Q),nt=$e.mult(Ce)._add(Q);nt._add($e._unit()._perp()._mult(n*W));var ut=Z+Math.atan2(N.y-Q.y,N.x-Q.x);return pe.push(nt),{point:nt,angle:ut,path:pe}}Ht.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Ht.prototype.insert=function(i,o,n,s,p){this._forEachCell(o,n,s,p,this._insertBoxCell,this.boxUid++),this.boxKeys.push(i),this.bboxes.push(o),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(p)},Ht.prototype.insertCircle=function(i,o,n,s){this._forEachCell(o-s,n-s,o+s,n+s,this._insertCircleCell,this.circleUid++),this.circleKeys.push(i),this.circles.push(o),this.circles.push(n),this.circles.push(s)},Ht.prototype._insertBoxCell=function(i,o,n,s,p,f){this.boxCells[p].push(f)},Ht.prototype._insertCircleCell=function(i,o,n,s,p,f){this.circleCells[p].push(f)},Ht.prototype._query=function(i,o,n,s,p,f){if(n<0||i>this.width||s<0||o>this.height)return!p&&[];var d=[];if(i<=0&&o<=0&&this.width<=n&&this.height<=s){if(p)return!0;for(var v=0;v<this.boxKeys.length;v++)d.push({key:this.boxKeys[v],x1:this.bboxes[4*v],y1:this.bboxes[4*v+1],x2:this.bboxes[4*v+2],y2:this.bboxes[4*v+3]});for(var w=0;w<this.circleKeys.length;w++){var A=this.circles[3*w],R=this.circles[3*w+1],F=this.circles[3*w+2];d.push({key:this.circleKeys[w],x1:A-F,y1:R-F,x2:A+F,y2:R+F})}return f?d.filter(f):d}return this._forEachCell(i,o,n,s,this._queryCell,d,{hitTest:p,seenUids:{box:{},circle:{}}},f),p?d.length>0:d},Ht.prototype._queryCircle=function(i,o,n,s,p){var f=i-n,d=i+n,v=o-n,w=o+n;if(d<0||f>this.width||w<0||v>this.height)return!s&&[];var A=[];return this._forEachCell(f,v,d,w,this._queryCellCircle,A,{hitTest:s,circle:{x:i,y:o,radius:n},seenUids:{box:{},circle:{}}},p),s?A.length>0:A},Ht.prototype.query=function(i,o,n,s,p){return this._query(i,o,n,s,!1,p)},Ht.prototype.hitTest=function(i,o,n,s,p){return this._query(i,o,n,s,!0,p)},Ht.prototype.hitTestCircle=function(i,o,n,s){return this._queryCircle(i,o,n,!0,s)},Ht.prototype._queryCell=function(i,o,n,s,p,f,d,v){var w=d.seenUids,A=this.boxCells[p];if(A!==null)for(var R=this.bboxes,F=0,O=A;F<O.length;F+=1){var W=O[F];if(!w.box[W]){w.box[W]=!0;var Z=4*W;if(i<=R[Z+2]&&o<=R[Z+3]&&n>=R[Z+0]&&s>=R[Z+1]&&(!v||v(this.boxKeys[W]))){if(d.hitTest)return f.push(!0),!0;f.push({key:this.boxKeys[W],x1:R[Z],y1:R[Z+1],x2:R[Z+2],y2:R[Z+3]})}}}var ee=this.circleCells[p];if(ee!==null)for(var N=this.circles,Q=0,ne=ee;Q<ne.length;Q+=1){var ue=ne[Q];if(!w.circle[ue]){w.circle[ue]=!0;var me=3*ue;if(this._circleAndRectCollide(N[me],N[me+1],N[me+2],i,o,n,s)&&(!v||v(this.circleKeys[ue]))){if(d.hitTest)return f.push(!0),!0;var pe=N[me],ve=N[me+1],Te=N[me+2];f.push({key:this.circleKeys[ue],x1:pe-Te,y1:ve-Te,x2:pe+Te,y2:ve+Te})}}}},Ht.prototype._queryCellCircle=function(i,o,n,s,p,f,d,v){var w=d.circle,A=d.seenUids,R=this.boxCells[p];if(R!==null)for(var F=this.bboxes,O=0,W=R;O<W.length;O+=1){var Z=W[O];if(!A.box[Z]){A.box[Z]=!0;var ee=4*Z;if(this._circleAndRectCollide(w.x,w.y,w.radius,F[ee+0],F[ee+1],F[ee+2],F[ee+3])&&(!v||v(this.boxKeys[Z])))return f.push(!0),!0}}var N=this.circleCells[p];if(N!==null)for(var Q=this.circles,ne=0,ue=N;ne<ue.length;ne+=1){var me=ue[ne];if(!A.circle[me]){A.circle[me]=!0;var pe=3*me;if(this._circlesCollide(Q[pe],Q[pe+1],Q[pe+2],w.x,w.y,w.radius)&&(!v||v(this.circleKeys[me])))return f.push(!0),!0}}},Ht.prototype._forEachCell=function(i,o,n,s,p,f,d,v){for(var w=this._convertToXCellCoord(i),A=this._convertToYCellCoord(o),R=this._convertToXCellCoord(n),F=this._convertToYCellCoord(s),O=w;O<=R;O++)for(var W=A;W<=F;W++)if(p.call(this,i,o,n,s,this.xCellCount*W+O,f,d,v))return},Ht.prototype._convertToXCellCoord=function(i){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(i*this.xScale)))},Ht.prototype._convertToYCellCoord=function(i){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(i*this.yScale)))},Ht.prototype._circlesCollide=function(i,o,n,s,p,f){var d=s-i,v=p-o,w=n+f;return w*w>d*d+v*v},Ht.prototype._circleAndRectCollide=function(i,o,n,s,p,f,d){var v=(f-s)/2,w=Math.abs(i-(s+v));if(w>v+n)return!1;var A=(d-p)/2,R=Math.abs(o-(p+A));if(R>A+n)return!1;if(w<=v||R<=A)return!0;var F=w-v,O=R-A;return F*F+O*O<=n*n};var va=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Si(i,o){for(var n=0;n<i;n++){var s=o.length;o.resize(s+4),o.float32.set(va,3*s)}}function oi(i,o,n){var s=o[0],p=o[1];return i[0]=n[0]*s+n[4]*p+n[12],i[1]=n[1]*s+n[5]*p+n[13],i[3]=n[3]*s+n[7]*p+n[15],i}var nn=function(i,o,n){o===void 0&&(o=new Ht(i.width+200,i.height+200,25)),n===void 0&&(n=new Ht(i.width+200,i.height+200,25)),this.transform=i,this.grid=o,this.ignoredGrid=n,this.pitchfactor=Math.cos(i._pitch)*i.cameraToCenterDistance,this.screenRightBoundary=i.width+100,this.screenBottomBoundary=i.height+100,this.gridRightBoundary=i.width+200,this.gridBottomBoundary=i.height+200};function yr(i,o,n){return o*(u.EXTENT/(i.tileSize*Math.pow(2,n-i.tileID.overscaledZ)))}nn.prototype.placeCollisionBox=function(i,o,n,s,p){var f=this.projectAndGetPerspectiveRatio(s,i.anchorPointX,i.anchorPointY),d=n*f.perspectiveRatio,v=i.x1*d+f.point.x,w=i.y1*d+f.point.y,A=i.x2*d+f.point.x,R=i.y2*d+f.point.y;return!this.isInsideGrid(v,w,A,R)||!o&&this.grid.hitTest(v,w,A,R,p)?{box:[],offscreen:!1}:{box:[v,w,A,R],offscreen:this.isOffscreen(v,w,A,R)}},nn.prototype.placeCollisionCircles=function(i,o,n,s,p,f,d,v,w,A,R,F,O){var W=[],Z=new u.Point(o.anchorX,o.anchorY),ee=zt(Z,f),N=$t(this.transform.cameraToCenterDistance,ee.signedDistanceFromCamera),Q=(A?p/N:p*N)/u.ONE_EM,ne=zt(Z,d).point,ue=ni(Q,s,o.lineOffsetX*Q,o.lineOffsetY*Q,!1,ne,Z,o,n,d,{}),me=!1,pe=!1,ve=!0;if(ue){for(var Te=.5*F*N+O,ke=new u.Point(-100,-100),Ce=new u.Point(this.screenRightBoundary,this.screenBottomBoundary),$e=new wi,nt=ue.first,ut=ue.last,st=[],Ft=nt.path.length-1;Ft>=1;Ft--)st.push(nt.path[Ft]);for(var We=1;We<ut.path.length;We++)st.push(ut.path[We]);var mt=2.5*Te;if(v){var xt=st.map((function(cn){return zt(cn,v)}));st=xt.some((function(cn){return cn.signedDistanceFromCamera<=0}))?[]:xt.map((function(cn){return cn.point}))}var dt=[];if(st.length>0){for(var ft=st[0].clone(),gt=st[0].clone(),ht=1;ht<st.length;ht++)ft.x=Math.min(ft.x,st[ht].x),ft.y=Math.min(ft.y,st[ht].y),gt.x=Math.max(gt.x,st[ht].x),gt.y=Math.max(gt.y,st[ht].y);dt=ft.x>=ke.x&>.x<=Ce.x&&ft.y>=ke.y&>.y<=Ce.y?[st]:gt.x<ke.x||ft.x>Ce.x||gt.y<ke.y||ft.y>Ce.y?[]:u.clipLine([st],ke.x,ke.y,Ce.x,Ce.y)}for(var ct=0,Jr=dt;ct<Jr.length;ct+=1){var Ir;$e.reset(Jr[ct],.25*Te),Ir=$e.length<=.5*Te?1:Math.ceil($e.paddedLength/mt)+1;for(var gi=0;gi<Ir;gi++){var si=gi/Math.max(Ir-1,1),wr=$e.lerp(si),Mr=wr.x+100,Wi=wr.y+100;W.push(Mr,Wi,Te,0);var Ei=Mr-Te,no=Wi-Te,Ri=Mr+Te,wn=Wi+Te;if(ve=ve&&this.isOffscreen(Ei,no,Ri,wn),pe=pe||this.isInsideGrid(Ei,no,Ri,wn),!i&&this.grid.hitTestCircle(Mr,Wi,Te,R)&&(me=!0,!w))return{circles:[],offscreen:!1,collisionDetected:me}}}}return{circles:!w&&me||!pe?[]:W,offscreen:ve,collisionDetected:me}},nn.prototype.queryRenderedSymbols=function(i){if(i.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var o=[],n=1/0,s=1/0,p=-1/0,f=-1/0,d=0,v=i;d<v.length;d+=1){var w=v[d],A=new u.Point(w.x+100,w.y+100);n=Math.min(n,A.x),s=Math.min(s,A.y),p=Math.max(p,A.x),f=Math.max(f,A.y),o.push(A)}for(var R={},F={},O=0,W=this.grid.query(n,s,p,f).concat(this.ignoredGrid.query(n,s,p,f));O<W.length;O+=1){var Z=W[O],ee=Z.key;if(R[ee.bucketInstanceId]===void 0&&(R[ee.bucketInstanceId]={}),!R[ee.bucketInstanceId][ee.featureIndex]){var N=[new u.Point(Z.x1,Z.y1),new u.Point(Z.x2,Z.y1),new u.Point(Z.x2,Z.y2),new u.Point(Z.x1,Z.y2)];u.polygonIntersectsPolygon(o,N)&&(R[ee.bucketInstanceId][ee.featureIndex]=!0,F[ee.bucketInstanceId]===void 0&&(F[ee.bucketInstanceId]=[]),F[ee.bucketInstanceId].push(ee.featureIndex))}}return F},nn.prototype.insertCollisionBox=function(i,o,n,s,p){(o?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:s,collisionGroupID:p},i[0],i[1],i[2],i[3])},nn.prototype.insertCollisionCircles=function(i,o,n,s,p){for(var f=o?this.ignoredGrid:this.grid,d={bucketInstanceId:n,featureIndex:s,collisionGroupID:p},v=0;v<i.length;v+=4)f.insertCircle(d,i[v],i[v+1],i[v+2])},nn.prototype.projectAndGetPerspectiveRatio=function(i,o,n){var s=[o,n,0,1];return oi(s,s,i),{point:new u.Point((s[0]/s[3]+1)/2*this.transform.width+100,(-s[1]/s[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/s[3]*.5}},nn.prototype.isOffscreen=function(i,o,n,s){return n<100||i>=this.screenRightBoundary||s<100||o>this.screenBottomBoundary},nn.prototype.isInsideGrid=function(i,o,n,s){return n>=0&&i<this.gridRightBoundary&&s>=0&&o<this.gridBottomBoundary},nn.prototype.getViewportMatrix=function(){var i=u.identity([]);return u.translate(i,i,[-100,-100,0]),i};var yn=function(i,o,n,s){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?o:-o))):s&&n?1:0,this.placed=n};yn.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var Ji=function(i,o,n,s,p){this.text=new yn(i?i.text:null,o,n,p),this.icon=new yn(i?i.icon:null,o,s,p)};Ji.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var al=function(i,o,n){this.text=i,this.icon=o,this.skipFade=n},on=function(){this.invProjMatrix=u.create(),this.viewportMatrix=u.create(),this.circles=[]},Pc=function(i,o,n,s,p){this.bucketInstanceId=i,this.featureIndex=o,this.sourceLayerIndex=n,this.bucketIndex=s,this.tileID=p},Dn=function(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}};function di(i,o,n,s,p){var f=u.getAnchorAlignment(i),d=-(f.horizontalAlign-.5)*o,v=-(f.verticalAlign-.5)*n,w=u.evaluateVariableOffset(i,s);return new u.Point(d+w[0]*p,v+w[1]*p)}function In(i,o,n,s,p,f){var d=i.x1,v=i.x2,w=i.y1,A=i.y2,R=i.anchorPointX,F=i.anchorPointY,O=new u.Point(o,n);return s&&O._rotate(p?f:-f),{x1:d+O.x,y1:w+O.y,x2:v+O.x,y2:A+O.y,anchorPointX:R,anchorPointY:F}}Dn.prototype.get=function(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){var o=++this.maxGroupID;this.collisionGroups[i]={ID:o,predicate:function(n){return n.collisionGroupID===o}}}return this.collisionGroups[i]};var Ii=function(i,o,n,s){this.transform=i.clone(),this.collisionIndex=new nn(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new Dn(n),this.collisionCircleArrays={},this.prevPlacement=s,s&&(s.prevPlacement=void 0),this.placedOrientations={}};function vo(i,o,n,s,p){i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0)}Ii.prototype.getBucketParts=function(i,o,n,s){var p=n.getBucket(o),f=n.latestFeatureIndex;if(p&&f&&o.id===p.layerIds[0]){var d=n.collisionBoxArray,v=p.layers[0].layout,w=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),A=n.tileSize/u.EXTENT,R=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),F=v.get("text-pitch-alignment")==="map",O=v.get("text-rotation-alignment")==="map",W=yr(n,1,this.transform.zoom),Z=Cr(R,F,O,this.transform,W),ee=null;if(F){var N=Qt(R,F,O,this.transform,W);ee=u.multiply([],this.transform.labelPlaneMatrix,N)}this.retainedQueryData[p.bucketInstanceId]=new Pc(p.bucketInstanceId,f,p.sourceLayerIndex,p.index,n.tileID);var Q={bucket:p,layout:v,posMatrix:R,textLabelPlaneMatrix:Z,labelToScreenMatrix:ee,scale:w,textPixelRatio:A,holdingForFade:n.holdingForFade(),collisionBoxArray:d,partiallyEvaluatedTextSize:u.evaluateSizeForZoom(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(s)for(var ne=0,ue=p.sortKeyRanges;ne<ue.length;ne+=1){var me=ue[ne];i.push({sortKey:me.sortKey,symbolInstanceStart:me.symbolInstanceStart,symbolInstanceEnd:me.symbolInstanceEnd,parameters:Q})}else i.push({symbolInstanceStart:0,symbolInstanceEnd:p.symbolInstances.length,parameters:Q})}},Ii.prototype.attemptAnchorPlacement=function(i,o,n,s,p,f,d,v,w,A,R,F,O,W,Z){var ee,N=[F.textOffset0,F.textOffset1],Q=di(i,n,s,N,p),ne=this.collisionIndex.placeCollisionBox(In(o,Q.x,Q.y,f,d,this.transform.angle),R,v,w,A.predicate);if(!Z||this.collisionIndex.placeCollisionBox(In(Z,Q.x,Q.y,f,d,this.transform.angle),R,v,w,A.predicate).box.length!==0)return ne.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[F.crossTileID]&&this.prevPlacement.placements[F.crossTileID]&&this.prevPlacement.placements[F.crossTileID].text&&(ee=this.prevPlacement.variableOffsets[F.crossTileID].anchor),this.variableOffsets[F.crossTileID]={textOffset:N,width:n,height:s,anchor:i,textBoxScale:p,prevAnchor:ee},this.markUsedJustification(O,i,F,W),O.allowVerticalPlacement&&(this.markUsedOrientation(O,W,F),this.placedOrientations[F.crossTileID]=W),{shift:Q,placedGlyphBoxes:ne}):void 0},Ii.prototype.placeLayerBucketPart=function(i,o,n){var s=this,p=i.parameters,f=p.bucket,d=p.layout,v=p.posMatrix,w=p.textLabelPlaneMatrix,A=p.labelToScreenMatrix,R=p.textPixelRatio,F=p.holdingForFade,O=p.collisionBoxArray,W=p.partiallyEvaluatedTextSize,Z=p.collisionGroup,ee=d.get("text-optional"),N=d.get("icon-optional"),Q=d.get("text-allow-overlap"),ne=d.get("icon-allow-overlap"),ue=d.get("text-rotation-alignment")==="map",me=d.get("text-pitch-alignment")==="map",pe=d.get("icon-text-fit")!=="none",ve=d.get("symbol-z-order")==="viewport-y",Te=Q&&(ne||!f.hasIconData()||N),ke=ne&&(Q||!f.hasTextData()||ee);!f.collisionArrays&&O&&f.deserializeCollisionBoxes(O);var Ce=function(We,mt){if(!o[We.crossTileID])if(F)s.placements[We.crossTileID]=new al(!1,!1,!1);else{var xt,dt=!1,ft=!1,gt=!0,ht=null,ct={box:null,offscreen:null},Jr={box:null,offscreen:null},Ir=null,gi=null,si=0,wr=0,Mr=0;mt.textFeatureIndex?si=mt.textFeatureIndex:We.useRuntimeCollisionCircles&&(si=We.featureIndex),mt.verticalTextFeatureIndex&&(wr=mt.verticalTextFeatureIndex);var Wi=mt.textBox;if(Wi){var Ei=function(Zt){var en=u.WritingMode.horizontal;if(f.allowVerticalPlacement&&!Zt&&s.prevPlacement){var Li=s.prevPlacement.placedOrientations[We.crossTileID];Li&&(s.placedOrientations[We.crossTileID]=Li,s.markUsedOrientation(f,en=Li,We))}return en},no=function(Zt,en){if(f.allowVerticalPlacement&&We.numVerticalGlyphVertices>0&&mt.verticalTextBox)for(var Li=0,Ro=f.writingModes;Li<Ro.length&&(Ro[Li]===u.WritingMode.vertical?(ct=en(),Jr=ct):ct=Zt(),!(ct&&ct.box&&ct.box.length));Li+=1);else ct=Zt()};if(d.get("text-variable-anchor")){var Ri=d.get("text-variable-anchor");if(s.prevPlacement&&s.prevPlacement.variableOffsets[We.crossTileID]){var wn=s.prevPlacement.variableOffsets[We.crossTileID];Ri.indexOf(wn.anchor)>0&&(Ri=Ri.filter((function(Zt){return Zt!==wn.anchor}))).unshift(wn.anchor)}var cn=function(Zt,en,Li){for(var Ro=Zt.x2-Zt.x1,Nc=Zt.y2-Zt.y1,_s=We.textBoxScale,jc=pe&&!ne?en:null,Oa={box:[],offscreen:!1},Fl=Q?2*Ri.length:Ri.length,aa=0;aa<Fl;++aa){var xs=s.attemptAnchorPlacement(Ri[aa%Ri.length],Zt,Ro,Nc,_s,ue,me,R,v,Z,aa>=Ri.length,We,f,Li,jc);if(xs&&(Oa=xs.placedGlyphBoxes)&&Oa.box&&Oa.box.length){dt=!0,ht=xs.shift;break}}return Oa};no((function(){return cn(Wi,mt.iconBox,u.WritingMode.horizontal)}),(function(){var Zt=mt.verticalTextBox;return f.allowVerticalPlacement&&!(ct&&ct.box&&ct.box.length)&&We.numVerticalGlyphVertices>0&&Zt?cn(Zt,mt.verticalIconBox,u.WritingMode.vertical):{box:null,offscreen:null}})),ct&&(dt=ct.box,gt=ct.offscreen);var Ra=Ei(ct&&ct.box);if(!dt&&s.prevPlacement){var na=s.prevPlacement.variableOffsets[We.crossTileID];na&&(s.variableOffsets[We.crossTileID]=na,s.markUsedJustification(f,na.anchor,We,Ra))}}else{var oo=function(Zt,en){var Li=s.collisionIndex.placeCollisionBox(Zt,Q,R,v,Z.predicate);return Li&&Li.box&&Li.box.length&&(s.markUsedOrientation(f,en,We),s.placedOrientations[We.crossTileID]=en),Li};no((function(){return oo(Wi,u.WritingMode.horizontal)}),(function(){var Zt=mt.verticalTextBox;return f.allowVerticalPlacement&&We.numVerticalGlyphVertices>0&&Zt?oo(Zt,u.WritingMode.vertical):{box:null,offscreen:null}})),Ei(ct&&ct.box&&ct.box.length)}}if(dt=(xt=ct)&&xt.box&&xt.box.length>0,gt=xt&&xt.offscreen,We.useRuntimeCollisionCircles){var oa=f.text.placedSymbolArray.get(We.centerJustifiedTextSymbolIndex),La=u.evaluateSizeForFeature(f.textSizeData,W,oa),Pn=d.get("text-padding");Ir=s.collisionIndex.placeCollisionCircles(Q,oa,f.lineVertexArray,f.glyphOffsetArray,La,v,w,A,n,me,Z.predicate,We.collisionCircleDiameter,Pn),dt=Q||Ir.circles.length>0&&!Ir.collisionDetected,gt=gt&&Ir.offscreen}if(mt.iconFeatureIndex&&(Mr=mt.iconFeatureIndex),mt.iconBox){var Fa=function(Zt){var en=pe&&ht?In(Zt,ht.x,ht.y,ue,me,s.transform.angle):Zt;return s.collisionIndex.placeCollisionBox(en,ne,R,v,Z.predicate)};ft=Jr&&Jr.box&&Jr.box.length&&mt.verticalIconBox?(gi=Fa(mt.verticalIconBox)).box.length>0:(gi=Fa(mt.iconBox)).box.length>0,gt=gt&&gi.offscreen}var Cn=ee||We.numHorizontalGlyphVertices===0&&We.numVerticalGlyphVertices===0,Yr=N||We.numIconVertices===0;if(Cn||Yr?Yr?Cn||(ft=ft&&dt):dt=ft&&dt:ft=dt=ft&&dt,dt&&xt&&xt.box&&s.collisionIndex.insertCollisionBox(xt.box,d.get("text-ignore-placement"),f.bucketInstanceId,Jr&&Jr.box&&wr?wr:si,Z.ID),ft&&gi&&s.collisionIndex.insertCollisionBox(gi.box,d.get("icon-ignore-placement"),f.bucketInstanceId,Mr,Z.ID),Ir&&(dt&&s.collisionIndex.insertCollisionCircles(Ir.circles,d.get("text-ignore-placement"),f.bucketInstanceId,si,Z.ID),n)){var On=f.bucketInstanceId,ao=s.collisionCircleArrays[On];ao===void 0&&(ao=s.collisionCircleArrays[On]=new on);for(var Do=0;Do<Ir.circles.length;Do+=4)ao.circles.push(Ir.circles[Do+0]),ao.circles.push(Ir.circles[Do+1]),ao.circles.push(Ir.circles[Do+2]),ao.circles.push(Ir.collisionDetected?1:0)}s.placements[We.crossTileID]=new al(dt||Te,ft||ke,gt||f.justReloaded),o[We.crossTileID]=!0}};if(ve)for(var $e=f.getSortedSymbolIndexes(this.transform.angle),nt=$e.length-1;nt>=0;--nt){var ut=$e[nt];Ce(f.symbolInstances.get(ut),f.collisionArrays[ut])}else for(var st=i.symbolInstanceStart;st<i.symbolInstanceEnd;st++)Ce(f.symbolInstances.get(st),f.collisionArrays[st]);if(n&&f.bucketInstanceId in this.collisionCircleArrays){var Ft=this.collisionCircleArrays[f.bucketInstanceId];u.invert(Ft.invProjMatrix,v),Ft.viewportMatrix=this.collisionIndex.getViewportMatrix()}f.justReloaded=!1},Ii.prototype.markUsedJustification=function(i,o,n,s){var p;p=s===u.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[u.getAnchorJustification(o)];for(var f=0,d=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];f<d.length;f+=1){var v=d[f];v>=0&&(i.text.placedSymbolArray.get(v).crossTileID=p>=0&&v!==p?0:n.crossTileID)}},Ii.prototype.markUsedOrientation=function(i,o,n){for(var s=o===u.WritingMode.horizontal||o===u.WritingMode.horizontalOnly?o:0,p=o===u.WritingMode.vertical?o:0,f=0,d=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];f<d.length;f+=1)i.text.placedSymbolArray.get(d[f]).placedOrientation=s;n.verticalPlacedTextSymbolIndex&&(i.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=p)},Ii.prototype.commit=function(i){this.commitTime=i,this.zoomAtLastRecencyCheck=this.transform.zoom;var o=this.prevPlacement,n=!1;this.prevZoomAdjustment=o?o.zoomAdjustment(this.transform.zoom):0;var s=o?o.symbolFadeChange(i):1,p=o?o.opacities:{},f=o?o.variableOffsets:{},d=o?o.placedOrientations:{};for(var v in this.placements){var w=this.placements[v],A=p[v];A?(this.opacities[v]=new Ji(A,s,w.text,w.icon),n=n||w.text!==A.text.placed||w.icon!==A.icon.placed):(this.opacities[v]=new Ji(null,s,w.text,w.icon,w.skipFade),n=n||w.text||w.icon)}for(var R in p){var F=p[R];if(!this.opacities[R]){var O=new Ji(F,s,!1,!1);O.isHidden()||(this.opacities[R]=O,n=n||F.text.placed||F.icon.placed)}}for(var W in f)this.variableOffsets[W]||!this.opacities[W]||this.opacities[W].isHidden()||(this.variableOffsets[W]=f[W]);for(var Z in d)this.placedOrientations[Z]||!this.opacities[Z]||this.opacities[Z].isHidden()||(this.placedOrientations[Z]=d[Z]);n?this.lastPlacementChangeTime=i:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=o?o.lastPlacementChangeTime:i)},Ii.prototype.updateLayerOpacities=function(i,o){for(var n={},s=0,p=o;s<p.length;s+=1){var f=p[s],d=f.getBucket(i);d&&f.latestFeatureIndex&&i.id===d.layerIds[0]&&this.updateBucketOpacities(d,n,f.collisionBoxArray)}},Ii.prototype.updateBucketOpacities=function(i,o,n){var s=this;i.hasTextData()&&i.text.opacityVertexArray.clear(),i.hasIconData()&&i.icon.opacityVertexArray.clear(),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexArray.clear(),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexArray.clear();var p=i.layers[0].layout,f=new Ji(null,0,!1,!1,!0),d=p.get("text-allow-overlap"),v=p.get("icon-allow-overlap"),w=p.get("text-variable-anchor"),A=p.get("text-rotation-alignment")==="map",R=p.get("text-pitch-alignment")==="map",F=p.get("icon-text-fit")!=="none",O=new Ji(null,0,d&&(v||!i.hasIconData()||p.get("icon-optional")),v&&(d||!i.hasTextData()||p.get("text-optional")),!0);!i.collisionArrays&&n&&(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData())&&i.deserializeCollisionBoxes(n);for(var W=function(Q,ne,ue){for(var me=0;me<ne/4;me++)Q.opacityVertexArray.emplaceBack(ue)},Z=function(Q){var ne=i.symbolInstances.get(Q),ue=ne.numHorizontalGlyphVertices,me=ne.numVerticalGlyphVertices,pe=ne.crossTileID,ve=s.opacities[pe];o[pe]?ve=f:ve||(s.opacities[pe]=ve=O),o[pe]=!0;var Te=ne.numIconVertices>0,ke=s.placedOrientations[ne.crossTileID],Ce=ke===u.WritingMode.vertical,$e=ke===u.WritingMode.horizontal||ke===u.WritingMode.horizontalOnly;if(ue>0||me>0){var nt=ll(ve.text);W(i.text,ue,Ce?Wo:nt),W(i.text,me,$e?Wo:nt);var ut=ve.text.isHidden();[ne.rightJustifiedTextSymbolIndex,ne.centerJustifiedTextSymbolIndex,ne.leftJustifiedTextSymbolIndex].forEach((function(ct){ct>=0&&(i.text.placedSymbolArray.get(ct).hidden=ut||Ce?1:0)})),ne.verticalPlacedTextSymbolIndex>=0&&(i.text.placedSymbolArray.get(ne.verticalPlacedTextSymbolIndex).hidden=ut||$e?1:0);var st=s.variableOffsets[ne.crossTileID];st&&s.markUsedJustification(i,st.anchor,ne,ke);var Ft=s.placedOrientations[ne.crossTileID];Ft&&(s.markUsedJustification(i,"left",ne,Ft),s.markUsedOrientation(i,Ft,ne))}if(Te){var We=ll(ve.icon),mt=!(F&&ne.verticalPlacedIconSymbolIndex&&Ce);ne.placedIconSymbolIndex>=0&&(W(i.icon,ne.numIconVertices,mt?We:Wo),i.icon.placedSymbolArray.get(ne.placedIconSymbolIndex).hidden=ve.icon.isHidden()),ne.verticalPlacedIconSymbolIndex>=0&&(W(i.icon,ne.numVerticalIconVertices,mt?Wo:We),i.icon.placedSymbolArray.get(ne.verticalPlacedIconSymbolIndex).hidden=ve.icon.isHidden())}if(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData()){var xt=i.collisionArrays[Q];if(xt){var dt=new u.Point(0,0);if(xt.textBox||xt.verticalTextBox){var ft=!0;if(w){var gt=s.variableOffsets[pe];gt?(dt=di(gt.anchor,gt.width,gt.height,gt.textOffset,gt.textBoxScale),A&&dt._rotate(R?s.transform.angle:-s.transform.angle)):ft=!1}xt.textBox&&vo(i.textCollisionBox.collisionVertexArray,ve.text.placed,!ft||Ce,dt.x,dt.y),xt.verticalTextBox&&vo(i.textCollisionBox.collisionVertexArray,ve.text.placed,!ft||$e,dt.x,dt.y)}var ht=!!(!$e&&xt.verticalIconBox);xt.iconBox&&vo(i.iconCollisionBox.collisionVertexArray,ve.icon.placed,ht,F?dt.x:0,F?dt.y:0),xt.verticalIconBox&&vo(i.iconCollisionBox.collisionVertexArray,ve.icon.placed,!ht,F?dt.x:0,F?dt.y:0)}}},ee=0;ee<i.symbolInstances.length;ee++)Z(ee);if(i.sortFeatures(this.transform.angle),this.retainedQueryData[i.bucketInstanceId]&&(this.retainedQueryData[i.bucketInstanceId].featureSortOrder=i.featureSortOrder),i.hasTextData()&&i.text.opacityVertexBuffer&&i.text.opacityVertexBuffer.updateData(i.text.opacityVertexArray),i.hasIconData()&&i.icon.opacityVertexBuffer&&i.icon.opacityVertexBuffer.updateData(i.icon.opacityVertexArray),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexBuffer&&i.iconCollisionBox.collisionVertexBuffer.updateData(i.iconCollisionBox.collisionVertexArray),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexBuffer&&i.textCollisionBox.collisionVertexBuffer.updateData(i.textCollisionBox.collisionVertexArray),i.bucketInstanceId in this.collisionCircleArrays){var N=this.collisionCircleArrays[i.bucketInstanceId];i.placementInvProjMatrix=N.invProjMatrix,i.placementViewportMatrix=N.viewportMatrix,i.collisionCircleArray=N.circles,delete this.collisionCircleArrays[i.bucketInstanceId]}},Ii.prototype.symbolFadeChange=function(i){return this.fadeDuration===0?1:(i-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Ii.prototype.zoomAdjustment=function(i){return Math.max(0,(this.transform.zoom-i)/1.5)},Ii.prototype.hasTransitions=function(i){return this.stale||i-this.lastPlacementChangeTime<this.fadeDuration},Ii.prototype.stillRecent=function(i,o){var n=this.zoomAtLastRecencyCheck===o?1-this.zoomAdjustment(o):1;return this.zoomAtLastRecencyCheck=o,this.commitTime+this.fadeDuration*n>i},Ii.prototype.setStale=function(){this.stale=!0};var Cc=Math.pow(2,25),kc=Math.pow(2,24),iu=Math.pow(2,17),Mc=Math.pow(2,16),sl=Math.pow(2,9),Bc=Math.pow(2,8),ul=Math.pow(2,1);function ll(i){if(i.opacity===0&&!i.placed)return 0;if(i.opacity===1&&i.placed)return 4294967295;var o=i.placed?1:0,n=Math.floor(127*i.opacity);return n*Cc+o*kc+n*iu+o*Mc+n*sl+o*Bc+n*ul+o}var Wo=0,nu=function(i){this._sortAcrossTiles=i.layout.get("symbol-z-order")!=="viewport-y"&&i.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};nu.prototype.continuePlacement=function(i,o,n,s,p){for(var f=this._bucketParts;this._currentTileIndex<i.length;)if(o.getBucketParts(f,s,i[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,p())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,f.sort((function(d,v){return d.sortKey-v.sortKey})));this._currentPartIndex<f.length;)if(o.placeLayerBucketPart(f[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,p())return!0;return!1};var ga=function(i,o,n,s,p,f,d){this.placement=new Ii(i,p,f,d),this._currentPlacementIndex=o.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=s,this._done=!1};ga.prototype.isDone=function(){return this._done},ga.prototype.continuePlacement=function(i,o,n){for(var s=this,p=u.browser.now(),f=function(){var w=u.browser.now()-p;return!s._forceFullPlacement&&w>2};this._currentPlacementIndex>=0;){var d=o[i[this._currentPlacementIndex]],v=this.placement.collisionIndex.transform.zoom;if(d.type==="symbol"&&(!d.minzoom||d.minzoom<=v)&&(!d.maxzoom||d.maxzoom>v)){if(this._inProgressLayer||(this._inProgressLayer=new nu(d)),this._inProgressLayer.continuePlacement(n[d.source],this.placement,this._showCollisionBoxes,d,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ga.prototype.commit=function(i){return this.placement.commit(i),this.placement};var cl=512/u.EXTENT/2,Qa=function(i,o,n){this.tileID=i,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var s=0;s<o.length;s++){var p=o.get(s),f=p.key;this.indexedSymbolInstances[f]||(this.indexedSymbolInstances[f]=[]),this.indexedSymbolInstances[f].push({crossTileID:p.crossTileID,coord:this.getScaledCoordinates(p,i)})}};Qa.prototype.getScaledCoordinates=function(i,o){var n=cl/Math.pow(2,o.canonical.z-this.tileID.canonical.z);return{x:Math.floor((o.canonical.x*u.EXTENT+i.anchorX)*n),y:Math.floor((o.canonical.y*u.EXTENT+i.anchorY)*n)}},Qa.prototype.findMatches=function(i,o,n){for(var s=this.tileID.canonical.z<o.canonical.z?1:Math.pow(2,this.tileID.canonical.z-o.canonical.z),p=0;p<i.length;p++){var f=i.get(p);if(!f.crossTileID){var d=this.indexedSymbolInstances[f.key];if(d)for(var v=this.getScaledCoordinates(f,o),w=0,A=d;w<A.length;w+=1){var R=A[w];if(Math.abs(R.coord.x-v.x)<=s&&Math.abs(R.coord.y-v.y)<=s&&!n[R.crossTileID]){n[R.crossTileID]=!0,f.crossTileID=R.crossTileID;break}}}}};var an=function(){this.maxCrossTileID=0};an.prototype.generate=function(){return++this.maxCrossTileID};var Gn=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Gn.prototype.handleWrapJump=function(i){var o=Math.round((i-this.lng)/360);if(o!==0)for(var n in this.indexes){var s=this.indexes[n],p={};for(var f in s){var d=s[f];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+o),p[d.tileID.key]=d}this.indexes[n]=p}this.lng=i},Gn.prototype.addBucket=function(i,o,n){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===o.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(var s=0;s<o.symbolInstances.length;s++)o.symbolInstances.get(s).crossTileID=0;this.usedCrossTileIDs[i.overscaledZ]||(this.usedCrossTileIDs[i.overscaledZ]={});var p=this.usedCrossTileIDs[i.overscaledZ];for(var f in this.indexes){var d=this.indexes[f];if(Number(f)>i.overscaledZ)for(var v in d){var w=d[v];w.tileID.isChildOf(i)&&w.findMatches(o.symbolInstances,i,p)}else{var A=d[i.scaledTo(Number(f)).key];A&&A.findMatches(o.symbolInstances,i,p)}}for(var R=0;R<o.symbolInstances.length;R++){var F=o.symbolInstances.get(R);F.crossTileID||(F.crossTileID=n.generate(),p[F.crossTileID]=!0)}return this.indexes[i.overscaledZ]===void 0&&(this.indexes[i.overscaledZ]={}),this.indexes[i.overscaledZ][i.key]=new Qa(i,o.symbolInstances,o.bucketInstanceId),!0},Gn.prototype.removeBucketCrossTileIDs=function(i,o){for(var n in o.indexedSymbolInstances)for(var s=0,p=o.indexedSymbolInstances[n];s<p.length;s+=1)delete this.usedCrossTileIDs[i][p[s].crossTileID]},Gn.prototype.removeStaleBuckets=function(i){var o=!1;for(var n in this.indexes){var s=this.indexes[n];for(var p in s)i[s[p].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,s[p]),delete s[p],o=!0)}return o};var $n=function(){this.layerIndexes={},this.crossTileIDs=new an,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};$n.prototype.addLayer=function(i,o,n){var s=this.layerIndexes[i.id];s===void 0&&(s=this.layerIndexes[i.id]=new Gn);var p=!1,f={};s.handleWrapJump(n);for(var d=0,v=o;d<v.length;d+=1){var w=v[d],A=w.getBucket(i);A&&i.id===A.layerIds[0]&&(A.bucketInstanceId||(A.bucketInstanceId=++this.maxBucketInstanceId),s.addBucket(w.tileID,A,this.crossTileIDs)&&(p=!0),f[A.bucketInstanceId]=!0)}return s.removeStaleBuckets(f)&&(p=!0),p},$n.prototype.pruneUnusedLayers=function(i){var o={};for(var n in i.forEach((function(s){o[s]=!0})),this.layerIndexes)o[n]||delete this.layerIndexes[n]};var go=function(i,o){return u.emitValidationErrors(i,o&&o.filter((function(n){return n.identifier!=="source.canvas"})))},Zn=u.pick(Me,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Wn=u.pick(Me,["setCenter","setZoom","setBearing","setPitch"]),es=(function(){var i={},o=u.styleSpec.$version;for(var n in u.styleSpec.$root){var s,p=u.styleSpec.$root[n];p.required&&(s=n==="version"?o:p.type==="array"?[]:{})!=null&&(i[n]=s)}return i})(),Ui=(function(i){function o(n,s){var p=this;s===void 0&&(s={}),i.call(this),this.map=n,this.dispatcher=new Ut(ge(),this),this.imageManager=new Ue,this.imageManager.setEventedParent(this),this.glyphManager=new Le(n._requestManager,s.localIdeographFontFamily),this.lineAtlas=new St(256,512),this.crossTileSymbolIndex=new $n,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new u.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",u.getReferrer());var f=this;this._rtlTextPluginCallback=o.registerForPluginStateChange((function(d){f.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:d.pluginStatus,pluginURL:d.pluginURL},(function(v,w){if(u.triggerPluginCompletionEvent(v),w&&w.every((function(R){return R})))for(var A in f.sourceCaches)f.sourceCaches[A].reload()}))})),this.on("data",(function(d){if(d.dataType==="source"&&d.sourceDataType==="metadata"){var v=p.sourceCaches[d.sourceId];if(v){var w=v.getSource();if(w&&w.vectorLayerIds)for(var A in p._layers){var R=p._layers[A];R.source===w.id&&p._validateLayer(R)}}}}))}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.loadURL=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new u.Event("dataloading",{dataType:"style"}));var f=typeof s.validate=="boolean"?s.validate:!u.isMapboxURL(n);n=this.map._requestManager.normalizeStyleURL(n,s.accessToken);var d=this.map._requestManager.transformRequest(n,u.ResourceType.Style);this._request=u.getJSON(d,(function(v,w){p._request=null,v?p.fire(new u.ErrorEvent(v)):w&&p._load(w,f)}))},o.prototype.loadJSON=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new u.Event("dataloading",{dataType:"style"})),this._request=u.browser.frame((function(){p._request=null,p._load(n,s.validate!==!1)}))},o.prototype.loadEmpty=function(){this.fire(new u.Event("dataloading",{dataType:"style"})),this._load(es,!1)},o.prototype._load=function(n,s){if(!s||!go(this,u.validateStyle(n))){for(var p in this._loaded=!0,this.stylesheet=n,n.sources)this.addSource(p,n.sources[p],{validate:!1});n.sprite?this._loadSprite(n.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(n.glyphs);var f=Be(this.stylesheet.layers);this._order=f.map((function(A){return A.id})),this._layers={},this._serializedLayers={};for(var d=0,v=f;d<v.length;d+=1){var w=v[d];(w=u.createStyleLayer(w)).setEventedParent(this,{layer:{id:w.id}}),this._layers[w.id]=w,this._serializedLayers[w.id]=w.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Wt(this.stylesheet.light),this.fire(new u.Event("data",{dataType:"style"})),this.fire(new u.Event("style.load"))}},o.prototype._loadSprite=function(n){var s=this;this._spriteRequest=(function(p,f,d){var v,w,A,R=u.browser.devicePixelRatio>1?"@2x":"",F=u.getJSON(f.transformRequest(f.normalizeSpriteURL(p,R,".json"),u.ResourceType.SpriteJSON),(function(Z,ee){F=null,A||(A=Z,v=ee,W())})),O=u.getImage(f.transformRequest(f.normalizeSpriteURL(p,R,".png"),u.ResourceType.SpriteImage),(function(Z,ee){O=null,A||(A=Z,w=ee,W())}));function W(){if(A)d(A);else if(v&&w){var Z=u.browser.getImageData(w),ee={};for(var N in v){var Q=v[N],ne=Q.width,ue=Q.height,me=Q.x,pe=Q.y,ve=Q.sdf,Te=Q.pixelRatio,ke=Q.stretchX,Ce=Q.stretchY,$e=Q.content,nt=new u.RGBAImage({width:ne,height:ue});u.RGBAImage.copy(Z,nt,{x:me,y:pe},{x:0,y:0},{width:ne,height:ue}),ee[N]={data:nt,pixelRatio:Te,sdf:ve,stretchX:ke,stretchY:Ce,content:$e}}d(null,ee)}}return{cancel:function(){F&&(F.cancel(),F=null),O&&(O.cancel(),O=null)}}})(n,this.map._requestManager,(function(p,f){if(s._spriteRequest=null,p)s.fire(new u.ErrorEvent(p));else if(f)for(var d in f)s.imageManager.addImage(d,f[d]);s.imageManager.setLoaded(!0),s._availableImages=s.imageManager.listImages(),s.dispatcher.broadcast("setImages",s._availableImages),s.fire(new u.Event("data",{dataType:"style"}))}))},o.prototype._validateLayer=function(n){var s=this.sourceCaches[n.source];if(s){var p=n.sourceLayer;if(p){var f=s.getSource();(f.type==="geojson"||f.vectorLayerIds&&f.vectorLayerIds.indexOf(p)===-1)&&this.fire(new u.ErrorEvent(new Error('Source layer "'+p+'" does not exist on source "'+f.id+'" as specified by style layer "'+n.id+'"')))}}},o.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var n in this.sourceCaches)if(!this.sourceCaches[n].loaded())return!1;return!!this.imageManager.isLoaded()},o.prototype._serializeLayers=function(n){for(var s=[],p=0,f=n;p<f.length;p+=1){var d=this._layers[f[p]];d.type!=="custom"&&s.push(d.serialize())}return s},o.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var n in this.sourceCaches)if(this.sourceCaches[n].hasTransition())return!0;for(var s in this._layers)if(this._layers[s].hasTransition())return!0;return!1},o.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},o.prototype.update=function(n){if(this._loaded){var s=this._changed;if(this._changed){var p=Object.keys(this._updatedLayers),f=Object.keys(this._removedLayers);for(var d in(p.length||f.length)&&this._updateWorkerLayers(p,f),this._updatedSources){var v=this._updatedSources[d];v==="reload"?this._reloadSource(d):v==="clear"&&this._clearSource(d)}for(var w in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[w].updateTransitions(n);this.light.updateTransitions(n),this._resetUpdates()}var A={};for(var R in this.sourceCaches){var F=this.sourceCaches[R];A[R]=F.used,F.used=!1}for(var O=0,W=this._order;O<W.length;O+=1){var Z=this._layers[W[O]];Z.recalculate(n,this._availableImages),!Z.isHidden(n.zoom)&&Z.source&&(this.sourceCaches[Z.source].used=!0)}for(var ee in A){var N=this.sourceCaches[ee];A[ee]!==N.used&&N.fire(new u.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:ee}))}this.light.recalculate(n),this.z=n.zoom,s&&this.fire(new u.Event("data",{dataType:"style"}))}},o.prototype._updateTilesForChangedImages=function(){var n=Object.keys(this._changedImages);if(n.length){for(var s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["icons","patterns"],n);this._changedImages={}}},o.prototype._updateWorkerLayers=function(n,s){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(n),removedIds:s})},o.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},o.prototype.setState=function(n){var s=this;if(this._checkLoaded(),go(this,u.validateStyle(n)))return!1;(n=u.clone$1(n)).layers=Be(n.layers);var p=(function(d,v){if(!d)return[{command:Me.setStyle,args:[v]}];var w=[];try{if(!u.deepEqual(d.version,v.version))return[{command:Me.setStyle,args:[v]}];u.deepEqual(d.center,v.center)||w.push({command:Me.setCenter,args:[v.center]}),u.deepEqual(d.zoom,v.zoom)||w.push({command:Me.setZoom,args:[v.zoom]}),u.deepEqual(d.bearing,v.bearing)||w.push({command:Me.setBearing,args:[v.bearing]}),u.deepEqual(d.pitch,v.pitch)||w.push({command:Me.setPitch,args:[v.pitch]}),u.deepEqual(d.sprite,v.sprite)||w.push({command:Me.setSprite,args:[v.sprite]}),u.deepEqual(d.glyphs,v.glyphs)||w.push({command:Me.setGlyphs,args:[v.glyphs]}),u.deepEqual(d.transition,v.transition)||w.push({command:Me.setTransition,args:[v.transition]}),u.deepEqual(d.light,v.light)||w.push({command:Me.setLight,args:[v.light]});var A={},R=[];(function(O,W,Z,ee){var N;for(N in W=W||{},O=O||{})O.hasOwnProperty(N)&&(W.hasOwnProperty(N)||Fe(N,Z,ee));for(N in W)W.hasOwnProperty(N)&&(O.hasOwnProperty(N)?u.deepEqual(O[N],W[N])||(O[N].type==="geojson"&&W[N].type==="geojson"&&rr(O,W,N)?Z.push({command:Me.setGeoJSONSourceData,args:[N,W[N].data]}):Pt(N,W,Z,ee)):yt(N,W,Z))})(d.sources,v.sources,R,A);var F=[];d.layers&&d.layers.forEach((function(O){A[O.source]?w.push({command:Me.removeLayer,args:[O.id]}):F.push(O)})),w=w.concat(R),(function(O,W,Z){W=W||[];var ee,N,Q,ne,ue,me,pe,ve=(O=O||[]).map(Gt),Te=W.map(Gt),ke=O.reduce(Rt,{}),Ce=W.reduce(Rt,{}),$e=ve.slice(),nt=Object.create(null);for(ee=0,N=0;ee<ve.length;ee++)Ce.hasOwnProperty(Q=ve[ee])?N++:(Z.push({command:Me.removeLayer,args:[Q]}),$e.splice($e.indexOf(Q,N),1));for(ee=0,N=0;ee<Te.length;ee++)$e[$e.length-1-ee]!==(Q=Te[Te.length-1-ee])&&(ke.hasOwnProperty(Q)?(Z.push({command:Me.removeLayer,args:[Q]}),$e.splice($e.lastIndexOf(Q,$e.length-N),1)):N++,Z.push({command:Me.addLayer,args:[Ce[Q],me=$e[$e.length-ee]]}),$e.splice($e.length-ee,0,Q),nt[Q]=!0);for(ee=0;ee<Te.length;ee++)if(ne=ke[Q=Te[ee]],ue=Ce[Q],!nt[Q]&&!u.deepEqual(ne,ue))if(u.deepEqual(ne.source,ue.source)&&u.deepEqual(ne["source-layer"],ue["source-layer"])&&u.deepEqual(ne.type,ue.type)){for(pe in Ct(ne.layout,ue.layout,Z,Q,null,Me.setLayoutProperty),Ct(ne.paint,ue.paint,Z,Q,null,Me.setPaintProperty),u.deepEqual(ne.filter,ue.filter)||Z.push({command:Me.setFilter,args:[Q,ue.filter]}),u.deepEqual(ne.minzoom,ue.minzoom)&&u.deepEqual(ne.maxzoom,ue.maxzoom)||Z.push({command:Me.setLayerZoomRange,args:[Q,ue.minzoom,ue.maxzoom]}),ne)ne.hasOwnProperty(pe)&&pe!=="layout"&&pe!=="paint"&&pe!=="filter"&&pe!=="metadata"&&pe!=="minzoom"&&pe!=="maxzoom"&&(pe.indexOf("paint.")===0?Ct(ne[pe],ue[pe],Z,Q,pe.slice(6),Me.setPaintProperty):u.deepEqual(ne[pe],ue[pe])||Z.push({command:Me.setLayerProperty,args:[Q,pe,ue[pe]]}));for(pe in ue)ue.hasOwnProperty(pe)&&!ne.hasOwnProperty(pe)&&pe!=="layout"&&pe!=="paint"&&pe!=="filter"&&pe!=="metadata"&&pe!=="minzoom"&&pe!=="maxzoom"&&(pe.indexOf("paint.")===0?Ct(ne[pe],ue[pe],Z,Q,pe.slice(6),Me.setPaintProperty):u.deepEqual(ne[pe],ue[pe])||Z.push({command:Me.setLayerProperty,args:[Q,pe,ue[pe]]}))}else Z.push({command:Me.removeLayer,args:[Q]}),me=$e[$e.lastIndexOf(Q)+1],Z.push({command:Me.addLayer,args:[ue,me]})})(F,v.layers,w)}catch(O){console.warn("Unable to compute style diff:",O),w=[{command:Me.setStyle,args:[v]}]}return w})(this.serialize(),n).filter((function(d){return!(d.command in Wn)}));if(p.length===0)return!1;var f=p.filter((function(d){return!(d.command in Zn)}));if(f.length>0)throw new Error("Unimplemented: "+f.map((function(d){return d.command})).join(", ")+".");return p.forEach((function(d){d.command!=="setTransition"&&s[d.command].apply(s,d.args)})),this.stylesheet=n,!0},o.prototype.addImage=function(n,s){if(this.getImage(n))return this.fire(new u.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(n,s),this._afterImageUpdated(n)},o.prototype.updateImage=function(n,s){this.imageManager.updateImage(n,s)},o.prototype.getImage=function(n){return this.imageManager.getImage(n)},o.prototype.removeImage=function(n){if(!this.getImage(n))return this.fire(new u.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(n),this._afterImageUpdated(n)},o.prototype._afterImageUpdated=function(n){this._availableImages=this.imageManager.listImages(),this._changedImages[n]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.Event("data",{dataType:"style"}))},o.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},o.prototype.addSource=function(n,s,p){var f=this;if(p===void 0&&(p={}),this._checkLoaded(),this.sourceCaches[n]!==void 0)throw new Error("There is already a source with this ID");if(!s.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(s).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(s.type)>=0&&this._validate(u.validateStyle.source,"sources."+n,s,null,p))){this.map&&this.map._collectResourceTiming&&(s.collectResourceTiming=!0);var d=this.sourceCaches[n]=new H(n,s,this.dispatcher);d.style=this,d.setEventedParent(this,(function(){return{isSourceLoaded:f.loaded(),source:d.serialize(),sourceId:n}})),d.onAdd(this.map),this._changed=!0}},o.prototype.removeSource=function(n){if(this._checkLoaded(),this.sourceCaches[n]===void 0)throw new Error("There is no source with this ID");for(var s in this._layers)if(this._layers[s].source===n)return this.fire(new u.ErrorEvent(new Error('Source "'+n+'" cannot be removed while layer "'+s+'" is using it.')));var p=this.sourceCaches[n];delete this.sourceCaches[n],delete this._updatedSources[n],p.fire(new u.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:n})),p.setEventedParent(null),p.clearTiles(),p.onRemove&&p.onRemove(this.map),this._changed=!0},o.prototype.setGeoJSONSourceData=function(n,s){this._checkLoaded(),this.sourceCaches[n].getSource().setData(s),this._changed=!0},o.prototype.getSource=function(n){return this.sourceCaches[n]&&this.sourceCaches[n].getSource()},o.prototype.addLayer=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var f=n.id;if(this.getLayer(f))this.fire(new u.ErrorEvent(new Error('Layer with id "'+f+'" already exists on this map')));else{var d;if(n.type==="custom"){if(go(this,u.validateCustomStyleLayer(n)))return;d=u.createStyleLayer(n)}else{if(typeof n.source=="object"&&(this.addSource(f,n.source),n=u.clone$1(n),n=u.extend(n,{source:f})),this._validate(u.validateStyle.layer,"layers."+f,n,{arrayIndex:-1},p))return;d=u.createStyleLayer(n),this._validateLayer(d),d.setEventedParent(this,{layer:{id:f}}),this._serializedLayers[d.id]=d.serialize()}var v=s?this._order.indexOf(s):this._order.length;if(s&&v===-1)this.fire(new u.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.')));else{if(this._order.splice(v,0,f),this._layerOrderChanged=!0,this._layers[f]=d,this._removedLayers[f]&&d.source&&d.type!=="custom"){var w=this._removedLayers[f];delete this._removedLayers[f],w.type!==d.type?this._updatedSources[d.source]="clear":(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause())}this._updateLayer(d),d.onAdd&&d.onAdd(this.map)}}},o.prototype.moveLayer=function(n,s){if(this._checkLoaded(),this._changed=!0,this._layers[n]){if(n!==s){var p=this._order.indexOf(n);this._order.splice(p,1);var f=s?this._order.indexOf(s):this._order.length;s&&f===-1?this.fire(new u.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.'))):(this._order.splice(f,0,n),this._layerOrderChanged=!0)}}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be moved.")))},o.prototype.removeLayer=function(n){this._checkLoaded();var s=this._layers[n];if(s){s.setEventedParent(null);var p=this._order.indexOf(n);this._order.splice(p,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[n]=s,delete this._layers[n],delete this._serializedLayers[n],delete this._updatedLayers[n],delete this._updatedPaintProps[n],s.onRemove&&s.onRemove(this.map)}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be removed.")))},o.prototype.getLayer=function(n){return this._layers[n]},o.prototype.hasLayer=function(n){return n in this._layers},o.prototype.setLayerZoomRange=function(n,s,p){this._checkLoaded();var f=this.getLayer(n);f?f.minzoom===s&&f.maxzoom===p||(s!=null&&(f.minzoom=s),p!=null&&(f.maxzoom=p),this._updateLayer(f)):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot have zoom extent.")))},o.prototype.setFilter=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var f=this.getLayer(n);if(f){if(!u.deepEqual(f.filter,s))return s==null?(f.filter=void 0,void this._updateLayer(f)):void(this._validate(u.validateStyle.filter,"layers."+f.id+".filter",s,null,p)||(f.filter=u.clone$1(s),this._updateLayer(f)))}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be filtered.")))},o.prototype.getFilter=function(n){return u.clone$1(this.getLayer(n).filter)},o.prototype.setLayoutProperty=function(n,s,p,f){f===void 0&&(f={}),this._checkLoaded();var d=this.getLayer(n);d?u.deepEqual(d.getLayoutProperty(s),p)||(d.setLayoutProperty(s,p,f),this._updateLayer(d)):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getLayoutProperty=function(n,s){var p=this.getLayer(n);if(p)return p.getLayoutProperty(s);this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style.")))},o.prototype.setPaintProperty=function(n,s,p,f){f===void 0&&(f={}),this._checkLoaded();var d=this.getLayer(n);d?u.deepEqual(d.getPaintProperty(s),p)||(d.setPaintProperty(s,p,f)&&this._updateLayer(d),this._changed=!0,this._updatedPaintProps[n]=!0):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getPaintProperty=function(n,s){return this.getLayer(n).getPaintProperty(s)},o.prototype.setFeatureState=function(n,s){this._checkLoaded();var p=n.source,f=n.sourceLayer,d=this.sourceCaches[p];if(d!==void 0){var v=d.getSource().type;v==="geojson"&&f?this.fire(new u.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):v!=="vector"||f?(n.id===void 0&&this.fire(new u.ErrorEvent(new Error("The feature id parameter must be provided."))),d.setFeatureState(f,n.id,s)):this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.removeFeatureState=function(n,s){this._checkLoaded();var p=n.source,f=this.sourceCaches[p];if(f!==void 0){var d=f.getSource().type,v=d==="vector"?n.sourceLayer:void 0;d!=="vector"||v?s&&typeof n.id!="string"&&typeof n.id!="number"?this.fire(new u.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):f.removeFeatureState(v,n.id,s):this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.getFeatureState=function(n){this._checkLoaded();var s=n.source,p=n.sourceLayer,f=this.sourceCaches[s];if(f!==void 0){if(f.getSource().type!=="vector"||p)return n.id===void 0&&this.fire(new u.ErrorEvent(new Error("The feature id parameter must be provided."))),f.getFeatureState(p,n.id);this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+s+"' does not exist in the map's style.")))},o.prototype.getTransition=function(){return u.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},o.prototype.serialize=function(){return u.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:u.mapObject(this.sourceCaches,(function(n){return n.serialize()})),layers:this._serializeLayers(this._order)},(function(n){return n!==void 0}))},o.prototype._updateLayer=function(n){this._updatedLayers[n.id]=!0,n.source&&!this._updatedSources[n.source]&&this.sourceCaches[n.source].getSource().type!=="raster"&&(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause()),this._changed=!0},o.prototype._flattenAndSortRenderedFeatures=function(n){for(var s=this,p=function(ke){return s._layers[ke].type==="fill-extrusion"},f={},d=[],v=this._order.length-1;v>=0;v--){var w=this._order[v];if(p(w)){f[w]=v;for(var A=0,R=n;A<R.length;A+=1){var F=R[A][w];if(F)for(var O=0,W=F;O<W.length;O+=1)d.push(W[O])}}}d.sort((function(ke,Ce){return Ce.intersectionZ-ke.intersectionZ}));for(var Z=[],ee=this._order.length-1;ee>=0;ee--){var N=this._order[ee];if(p(N))for(var Q=d.length-1;Q>=0;Q--){var ne=d[Q].feature;if(f[ne.layer.id]<ee)break;Z.push(ne),d.pop()}else for(var ue=0,me=n;ue<me.length;ue+=1){var pe=me[ue][N];if(pe)for(var ve=0,Te=pe;ve<Te.length;ve+=1)Z.push(Te[ve].feature)}}return Z},o.prototype.queryRenderedFeatures=function(n,s,p){s&&s.filter&&this._validate(u.validateStyle.filter,"queryRenderedFeatures.filter",s.filter,null,s);var f={};if(s&&s.layers){if(!Array.isArray(s.layers))return this.fire(new u.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var d=0,v=s.layers;d<v.length;d+=1){var w=v[d],A=this._layers[w];if(!A)return this.fire(new u.ErrorEvent(new Error("The layer '"+w+"' does not exist in the map's style and cannot be queried for features."))),[];f[A.source]=!0}}var R=[];for(var F in s.availableImages=this._availableImages,this.sourceCaches)s.layers&&!f[F]||R.push(Or(this.sourceCaches[F],this._layers,this._serializedLayers,n,s,p));return this.placement&&R.push((function(O,W,Z,ee,N,Q,ne){for(var ue={},me=Q.queryRenderedSymbols(ee),pe=[],ve=0,Te=Object.keys(me).map(Number);ve<Te.length;ve+=1)pe.push(ne[Te[ve]]);pe.sort(Xi);for(var ke=function(){var st=$e[Ce],Ft=st.featureIndex.lookupSymbolFeatures(me[st.bucketInstanceId],W,st.bucketIndex,st.sourceLayerIndex,N.filter,N.layers,N.availableImages,O);for(var We in Ft){var mt=ue[We]=ue[We]||[],xt=Ft[We];xt.sort((function(gt,ht){var ct=st.featureSortOrder;if(ct){var Jr=ct.indexOf(gt.featureIndex);return ct.indexOf(ht.featureIndex)-Jr}return ht.featureIndex-gt.featureIndex}));for(var dt=0,ft=xt;dt<ft.length;dt+=1)mt.push(ft[dt])}},Ce=0,$e=pe;Ce<$e.length;Ce+=1)ke();var nt=function(st){ue[st].forEach((function(Ft){var We=Ft.feature,mt=Z[O[st].source].getFeatureState(We.layer["source-layer"],We.id);We.source=We.layer.source,We.layer["source-layer"]&&(We.sourceLayer=We.layer["source-layer"]),We.state=mt}))};for(var ut in ue)nt(ut);return ue})(this._layers,this._serializedLayers,this.sourceCaches,n,s,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(R)},o.prototype.querySourceFeatures=function(n,s){s&&s.filter&&this._validate(u.validateStyle.filter,"querySourceFeatures.filter",s.filter,null,s);var p=this.sourceCaches[n];return p?(function(f,d){for(var v=f.getRenderableIds().map((function(W){return f.getTileByID(W)})),w=[],A={},R=0;R<v.length;R++){var F=v[R],O=F.tileID.canonical.key;A[O]||(A[O]=!0,F.querySourceFeatures(w,d))}return w})(p,s):[]},o.prototype.addSourceType=function(n,s,p){return o.getSourceType(n)?p(new Error('A source type called "'+n+'" already exists.')):(o.setSourceType(n,s),s.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:n,url:s.workerSourceURL},p):p(null,null))},o.prototype.getLight=function(){return this.light.getLight()},o.prototype.setLight=function(n,s){s===void 0&&(s={}),this._checkLoaded();var p=this.light.getLight(),f=!1;for(var d in n)if(!u.deepEqual(n[d],p[d])){f=!0;break}if(f){var v={now:u.browser.now(),transition:u.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(n,s),this.light.updateTransitions(v)}},o.prototype._validate=function(n,s,p,f,d){return d===void 0&&(d={}),(!d||d.validate!==!1)&&go(this,n.call(u.validateStyle,u.extend({key:s,style:this.serialize(),value:p,styleSpec:u.styleSpec},f)))},o.prototype._remove=function(){for(var n in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),u.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[n].setEventedParent(null);for(var s in this.sourceCaches)this.sourceCaches[s].clearTiles(),this.sourceCaches[s].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},o.prototype._clearSource=function(n){this.sourceCaches[n].clearTiles()},o.prototype._reloadSource=function(n){this.sourceCaches[n].resume(),this.sourceCaches[n].reload()},o.prototype._updateSources=function(n){for(var s in this.sourceCaches)this.sourceCaches[s].update(n)},o.prototype._generateCollisionBoxes=function(){for(var n in this.sourceCaches)this._reloadSource(n)},o.prototype._updatePlacement=function(n,s,p,f,d){d===void 0&&(d=!1);for(var v=!1,w=!1,A={},R=0,F=this._order;R<F.length;R+=1){var O=this._layers[F[R]];if(O.type==="symbol"){if(!A[O.source]){var W=this.sourceCaches[O.source];A[O.source]=W.getRenderableIds(!0).map((function(ne){return W.getTileByID(ne)})).sort((function(ne,ue){return ue.tileID.overscaledZ-ne.tileID.overscaledZ||(ne.tileID.isLessThan(ue.tileID)?-1:1)}))}var Z=this.crossTileSymbolIndex.addLayer(O,A[O.source],n.center.lng);v=v||Z}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((d=d||this._layerOrderChanged||p===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(u.browser.now(),n.zoom))&&(this.pauseablePlacement=new ga(n,this._order,d,s,p,f,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,A),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(u.browser.now()),w=!0),v&&this.pauseablePlacement.placement.setStale()),w||v)for(var ee=0,N=this._order;ee<N.length;ee+=1){var Q=this._layers[N[ee]];Q.type==="symbol"&&this.placement.updateLayerOpacities(Q,A[Q.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(u.browser.now())},o.prototype._releaseSymbolFadeTiles=function(){for(var n in this.sourceCaches)this.sourceCaches[n].releaseSymbolFadeTiles()},o.prototype.getImages=function(n,s,p){this.imageManager.getImages(s.icons,p),this._updateTilesForChangedImages();var f=this.sourceCaches[s.source];f&&f.setDependencies(s.tileID.key,s.type,s.icons)},o.prototype.getGlyphs=function(n,s,p){this.glyphManager.getGlyphs(s.stacks,p)},o.prototype.getResource=function(n,s,p){return u.makeRequest(s,p)},o})(u.Evented);Ui.getSourceType=function(i){return Mi[i]},Ui.setSourceType=function(i,o){Mi[i]=o},Ui.registerForPluginStateChange=u.registerForPluginStateChange;var Vr=u.createLayout([{name:"a_pos",type:"Int16",components:2}]),Ho=ir(`#ifdef GL_ES
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ct=require("./LoadingSpinner-BCH3FvFp.js"),D=require("vue"),ra=require("pinia");let Ra=null;typeof window<"u"&&(Ra=document.currentScript);const uh={options:{div:"map",logo:"os-logo-maps",statement:"Contains OS data © Crown copyright and database rights YYYY",prefix:"",suffix:""},init(T){if(typeof window<"u"){Ra&&(this.options.div=Ra.getAttribute("data-div")||this.options.div,this.options.logo=Ra.getAttribute("data-logo")||this.options.logo,this.options.statement=Ra.getAttribute("data-statement")||this.options.statement,this.options.prefix=Ra.getAttribute("data-prefix")||this.options.prefix,this.options.suffix=Ra.getAttribute("data-suffix")||this.options.suffix),T=typeof T<"u"?T:{},Object.assign(this.options,T);const K=document.getElementById(this.options.div);let ee="os-api-branding logo";this.options.logo==="os-logo-maps-white"&&(ee="os-api-branding logo white");let qe=this.options.statement;qe=qe.replace("YYYY",new Date().getFullYear()),this.options.prefix!==""&&(qe=`${this.options.prefix}<span>|</span>${qe}`),this.options.suffix!==""&&(qe=`${qe}<span>|</span>${this.options.suffix}`),document.querySelectorAll(`#${this.options.div} .os-api-branding`).forEach(u=>u.remove());const Le=document.createElement("div");Le.className=ee,K.appendChild(Le);const me=document.createElement("div");me.className="os-api-branding copyright",me.innerHTML=qe,K.appendChild(me)}}},en=ra.defineStore("map",()=>{const T=D.ref([]),K=D.ref([]),ee=D.ref(null),qe=D.ref(null),Le=D.ref(null);function me(rt){T.value.push({id:rt.id,filters:rt.filters,places:rt.places,activePins:rt.activePins,hovered:"",activePlace:null})}function u(rt){T.value.forEach(rr=>{rr.id===rt.mapId&&(rr.hovered=rt.hoveredFeature)})}function ot(rt){T.value.forEach(rr=>{rr.id===rt.mapId&&(rr.activePlace=rt.activeFeature)})}function pe(rt){K.value=rt}function dt(rt){ee.value=rt}function Ze(rt){qe.value=rt}function yr(rt){return T.value.find(rr=>rr.id===rt)}function Ce(rt){return T.value.find(gr=>gr.id===rt)?.hovered}function Zi(rt){return T.value.find(gr=>gr.id===rt)?.activePlace}return{maps:T,activeSubcatFilters:K,selectedSubCategory:ee,activeMarkerPos:qe,activePlace:Le,addMapInstance:me,setHoveredPlace:u,setActivePlace:ot,setActiveSubcatFilters:pe,setSelectedSubcat:dt,setActiveMarkerPos:Ze,getMapById:yr,getHoveredStop:Ce,getActivePlace:Zi}});var ju={exports:{}},$f=ju.exports,ch;function Qf(){return ch||(ch=1,(function(T,K){(function(ee,qe){T.exports=qe()})($f,(function(){var ee,qe,Le;function me(u,ot){if(!ee)ee=ot;else if(!qe)qe=ot;else{var pe="var sharedChunk = {}; ("+ee+")(sharedChunk); ("+qe+")(sharedChunk);",dt={};ee(dt),Le=ot(dt),typeof window<"u"&&(Le.workerUrl=window.URL.createObjectURL(new Blob([pe],{type:"text/javascript"})))}}return me(["exports"],(function(u){function ot(e,t){return e(t={exports:{}},t.exports),t.exports}var pe=dt;function dt(e,t,r,a){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=a,this.p2x=r,this.p2y=a}dt.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},dt.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},dt.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},dt.prototype.solveCurveX=function(e,t){var r,a,l,c,h;for(t===void 0&&(t=1e-6),l=e,h=0;h<8;h++){if(c=this.sampleCurveX(l)-e,Math.abs(c)<t)return l;var m=this.sampleCurveDerivativeX(l);if(Math.abs(m)<1e-6)break;l-=c/m}if((l=e)<(r=0))return r;if(l>(a=1))return a;for(;r<a;){if(c=this.sampleCurveX(l),Math.abs(c-e)<t)return l;e>c?r=l:a=l,l=.5*(a-r)+r}return l},dt.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var Ze=yr;function yr(e,t){this.x=e,this.y=t}yr.prototype={clone:function(){return new yr(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},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(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),a=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=a,this},_rotateAround:function(e,t){var r=Math.cos(e),a=Math.sin(e),l=t.y+a*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-a*(this.y-t.y),this.y=l,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},yr.convert=function(e){return e instanceof yr?e:Array.isArray(e)?new yr(e[0],e[1]):e};var Ce=typeof self<"u"?self:{},Zi=Math.pow(2,53)-1;function rt(e,t,r,a){var l=new pe(e,t,r,a);return function(c){return l.solve(c)}}var rr=rt(.25,.1,.25,1);function gr(e,t,r){return Math.min(r,Math.max(t,e))}function ao(e,t,r){var a=r-t,l=((e-t)%a+a)%a+t;return l===t?r:l}function Sr(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,l=t;a<l.length;a+=1){var c=l[a];for(var h in c)e[h]=c[h]}return e}var so=1;function pr(){return so++}function Mi(){return(function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)})()}function tn(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function mn(e,t){e.forEach((function(r){t[r]&&(t[r]=t[r].bind(t))}))}function fi(e,t){return e.indexOf(t,e.length-t.length)!==-1}function zr(e,t,r){var a={};for(var l in e)a[l]=t.call(r||this,e[l],l,e);return a}function Gi(e,t,r){var a={};for(var l in e)t.call(r||this,e[l],l,e)&&(a[l]=e[l]);return a}function Si(e){return Array.isArray(e)?e.map(Si):typeof e=="object"&&e?zr(e,Si):e}var Pn={};function Ht(e){Pn[e]||(typeof console<"u"&&console.warn(e),Pn[e]=!0)}function Kr(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function Bo(e){for(var t=0,r=0,a=e.length,l=a-1,c=void 0,h=void 0;r<a;l=r++)t+=((h=e[l]).x-(c=e[r]).x)*(c.y+h.y);return t}function di(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function An(e){var t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(a,l,c,h){var m=c||h;return t[l]=!m||m.toLowerCase(),""})),t["max-age"]){var r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t}var zn=null;function Ro(e){if(zn==null){var t=e.navigator?e.navigator.userAgent:null;zn=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return zn}function Ii(e){try{var t=Ce[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}var oi,Di,rn,nn,Wi=Ce.performance&&Ce.performance.now?Ce.performance.now.bind(Ce.performance):Date.now.bind(Date),Ur=Ce.requestAnimationFrame||Ce.mozRequestAnimationFrame||Ce.webkitRequestAnimationFrame||Ce.msRequestAnimationFrame,Kt=Ce.cancelAnimationFrame||Ce.mozCancelAnimationFrame||Ce.webkitCancelAnimationFrame||Ce.msCancelAnimationFrame,Ir={now:Wi,frame:function(e){var t=Ur(e);return{cancel:function(){return Kt(t)}}},getImageData:function(e,t){t===void 0&&(t=0);var r=Ce.document.createElement("canvas"),a=r.getContext("2d");if(!a)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,a.drawImage(e,0,0,e.width,e.height),a.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return oi||(oi=Ce.document.createElement("a")),oi.href=e,oi.href},hardwareConcurrency:Ce.navigator&&Ce.navigator.hardwareConcurrency||4,get devicePixelRatio(){return Ce.devicePixelRatio},get prefersReducedMotion(){return!!Ce.matchMedia&&(Di==null&&(Di=Ce.matchMedia("(prefers-reduced-motion: reduce)")),Di.matches)}},mt={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},Ei={supported:!1,testSupport:function(e){!ue&&nn&&(_e?le(e):rn=e)}},ue=!1,_e=!1;function le(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,nn),e.isContextLost())return;Ei.supported=!0}catch{}e.deleteTexture(t),ue=!0}Ce.document&&((nn=Ce.document.createElement("img")).onload=function(){rn&&le(rn),rn=null,_e=!0},nn.onerror=function(){ue=!0,rn=null},nn.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var We="01",et=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function ut(e){return e.indexOf("mapbox:")===0}et.prototype._createSkuToken=function(){var e=(function(){for(var t="",r=0;r<10;r++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",We,t].join(""),tokenExpiresAt:Date.now()+432e5}})();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},et.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},et.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},et.prototype.normalizeStyleURL=function(e,t){if(!ut(e))return e;var r=Jt(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},et.prototype.normalizeGlyphsURL=function(e,t){if(!ut(e))return e;var r=Jt(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},et.prototype.normalizeSourceURL=function(e,t){if(!ut(e))return e;var r=Jt(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},et.prototype.normalizeSpriteURL=function(e,t,r,a){var l=Jt(e);return ut(e)?(l.path="/styles/v1"+l.path+"/sprite"+t+r,this._makeAPIURL(l,this._customAccessToken||a)):(l.path+=""+t+r,ir(l))},et.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!ut(e))return e;var r=Jt(e);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(Ir.devicePixelRatio>=2||t===512?"@2x":"")+(Ei.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||(function(l){for(var c=0,h=l;c<h.length;c+=1){var m=h[c].match(/^access_token=(.*)$/);if(m)return m[1]}return null})(r.params)||mt.ACCESS_TOKEN;return mt.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,a)},et.prototype.canonicalizeTileURL=function(e,t){var r=Jt(e);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return e;var a="mapbox://tiles/";a+=r.path.replace("/v4/","");var l=r.params;return t&&(l=l.filter((function(c){return!c.match(/^access_token=/)}))),l.length&&(a+="?"+l.join("&")),a},et.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&ut(t),a=[],l=0,c=e.tiles||[];l<c.length;l+=1){var h=c[l];Nt(h)?a.push(this.canonicalizeTileURL(h,r)):a.push(h)}return a},et.prototype._makeAPIURL=function(e,t){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",a=Jt(mt.API_URL);if(e.protocol=a.protocol,e.authority=a.authority,e.protocol==="http"){var l=e.params.indexOf("secure");l>=0&&e.params.splice(l,1)}if(a.path!=="/"&&(e.path=""+a.path+e.path),!mt.REQUIRE_ACCESS_TOKEN)return ir(e);if(!(t=t||mt.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if(t[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return e.params=e.params.filter((function(c){return c.indexOf("access_token")===-1})),e.params.push("access_token="+t),ir(e)};var Ft=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Nt(e){return Ft.test(e)}var Er=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Jt(e){var t=e.match(Er);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function ir(e){var t=e.params.length?"?"+e.params.join("&"):"";return e.protocol+"://"+e.authority+e.path+t}function hr(e){if(!e)return null;var t=e.split(".");if(!t||t.length!==3)return null;try{return JSON.parse(decodeURIComponent(Ce.atob(t[1]).split("").map((function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch{return null}}var vr=function(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};vr.prototype.getStorageKey=function(e){var t,r=hr(mt.ACCESS_TOKEN);return t=r&&r.u?Ce.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(a,l){return String.fromCharCode(+("0x"+l))}))):mt.ACCESS_TOKEN||"",e?"mapbox.eventData."+e+":"+t:"mapbox.eventData:"+t},vr.prototype.fetchEventData=function(){var e=Ii("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{var a=Ce.localStorage.getItem(t);a&&(this.eventData=JSON.parse(a));var l=Ce.localStorage.getItem(r);l&&(this.anonId=l)}catch{Ht("Unable to read from LocalStorage")}},vr.prototype.saveEventData=function(){var e=Ii("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{Ce.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&Ce.localStorage.setItem(t,JSON.stringify(this.eventData))}catch{Ht("Unable to write to LocalStorage")}},vr.prototype.processRequests=function(e){},vr.prototype.postEvent=function(e,t,r,a){var l=this;if(mt.EVENTS_URL){var c=Jt(mt.EVENTS_URL);c.params.push("access_token="+(a||mt.ACCESS_TOKEN||""));var h={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:We,userId:this.anonId},m=t?Sr(h,t):h,g={url:ir(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([m])};this.pendingRequest=nr(g,(function(v){l.pendingRequest=null,r(v),l.saveEventData(),l.processRequests(a)}))}},vr.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var Ve,Ti,Gr=(function(e){function t(){e.call(this,"map.load"),this.success={},this.skuToken=""}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postMapLoadEvent=function(r,a,l,c){this.skuToken=l;var h=!(!c&&!mt.ACCESS_TOKEN),m=Array.isArray(r)&&r.some((function(g){return ut(g)||Nt(g)}));mt.EVENTS_URL&&h&&m&&this.queueRequest({id:a,timestamp:Date.now()},c)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){var l=this.queue.shift(),c=l.id,h=l.timestamp;c&&this.success[c]||(this.anonId||this.fetchEventData(),tn(this.anonId)||(this.anonId=Mi()),this.postEvent(h,{skuToken:this.skuToken},(function(m){m||c&&(a.success[c]=!0)}),r))}},t})(vr),on=new((function(e){function t(r){e.call(this,"appUserTurnstile"),this._customAccessToken=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postTurnstileEvent=function(r,a){mt.EVENTS_URL&&mt.ACCESS_TOKEN&&Array.isArray(r)&&r.some((function(l){return ut(l)||Nt(l)}))&&this.queueRequest(Date.now(),a)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var l=hr(mt.ACCESS_TOKEN),c=l?l.u:mt.ACCESS_TOKEN,h=c!==this.eventData.tokenU;tn(this.anonId)||(this.anonId=Mi(),h=!0);var m=this.queue.shift();if(this.eventData.lastSuccess){var g=new Date(this.eventData.lastSuccess),v=new Date(m),x=(m-this.eventData.lastSuccess)/864e5;h=h||x>=1||x<-1||g.getDate()!==v.getDate()}else h=!0;if(!h)return this.processRequests();this.postEvent(m,{"enabled.telemetry":!1},(function(b){b||(a.eventData.lastSuccess=m,a.eventData.tokenU=c)}),r)}},t})(vr)),Mn=on.postTurnstileEvent.bind(on),Dn=new Gr,Ln=Dn.postMapLoadEvent.bind(Dn),an=500,lo=50;function yn(){Ce.caches&&!Ve&&(Ve=Ce.caches.open("mapbox-tiles"))}function Bn(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}var ai,gn=1/0;function sn(){return ai==null&&(ai=Ce.OffscreenCanvas&&new Ce.OffscreenCanvas(1,1).getContext("2d")&&typeof Ce.createImageBitmap=="function"),ai}var Tr={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Tr);var Mr=(function(e){function t(r,a,l){a===401&&Nt(l)&&(r+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),e.call(this,r),this.status=a,this.url=l,this.name=this.constructor.name,this.message=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},t})(Error),vn=di()?function(){return self.worker&&self.worker.referrer}:function(){return(Ce.location.protocol==="blob:"?Ce.parent:Ce).location.href},_n,xn,Fo=function(e,t){if(!(/^file:/.test(r=e.url)||/^file:/.test(vn())&&!/^\w+:/.test(r))){if(Ce.fetch&&Ce.Request&&Ce.AbortController&&Ce.Request.prototype.hasOwnProperty("signal"))return(function(a,l){var c,h=new Ce.AbortController,m=new Ce.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:vn(),signal:h.signal}),g=!1,v=!1,x=(c=m.url).indexOf("sku=")>0&&Nt(c);a.type==="json"&&m.headers.set("Accept","application/json");var b=function(C,R,F){if(!v){if(C&&C.message!=="SecurityError"&&Ht(C),R&&F)return E(R);var G=Date.now();Ce.fetch(m).then((function(j){if(j.ok){var J=x?j.clone():null;return E(j,J,G)}return l(new Mr(j.statusText,j.status,a.url))})).catch((function(j){j.code!==20&&l(new Error(j.message))}))}},E=function(C,R,F){(a.type==="arrayBuffer"?C.arrayBuffer():a.type==="json"?C.json():C.text()).then((function(G){v||(R&&F&&(function(j,J,Q){if(yn(),Ve){var te={status:J.status,statusText:J.statusText,headers:new Ce.Headers};J.headers.forEach((function(ce,ge){return te.headers.set(ge,ce)}));var ie=An(J.headers.get("Cache-Control")||"");ie["no-store"]||(ie["max-age"]&&te.headers.set("Expires",new Date(Q+1e3*ie["max-age"]).toUTCString()),new Date(te.headers.get("Expires")).getTime()-Q<42e4||(function(ce,ge){if(Ti===void 0)try{new Response(new ReadableStream),Ti=!0}catch{Ti=!1}Ti?ge(ce.body):ce.blob().then(ge)})(J,(function(ce){var ge=new Ce.Response(ce,te);yn(),Ve&&Ve.then((function(be){return be.put(Bn(j.url),ge)})).catch((function(be){return Ht(be.message)}))})))}})(m,R,F),g=!0,l(null,G,C.headers.get("Cache-Control"),C.headers.get("Expires")))})).catch((function(G){v||l(new Error(G.message))}))};return x?(function(C,R){if(yn(),!Ve)return R(null);var F=Bn(C.url);Ve.then((function(G){G.match(F).then((function(j){var J=(function(Q){if(!Q)return!1;var te=new Date(Q.headers.get("Expires")||0),ie=An(Q.headers.get("Cache-Control")||"");return te>Date.now()&&!ie["no-cache"]})(j);G.delete(F),J&&G.put(F,j.clone()),R(null,j,J)})).catch(R)})).catch(R)})(m,b):b(null,null),{cancel:function(){v=!0,g||h.abort()}}})(e,t);if(di()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return(function(a,l){var c=new Ce.XMLHttpRequest;for(var h in c.open(a.method||"GET",a.url,!0),a.type==="arrayBuffer"&&(c.responseType="arraybuffer"),a.headers)c.setRequestHeader(h,a.headers[h]);return a.type==="json"&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials=a.credentials==="include",c.onerror=function(){l(new Error(c.statusText))},c.onload=function(){if((c.status>=200&&c.status<300||c.status===0)&&c.response!==null){var m=c.response;if(a.type==="json")try{m=JSON.parse(c.response)}catch(g){return l(g)}l(null,m,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else l(new Mr(c.statusText,c.status,a.url))},c.send(a.body),{cancel:function(){return c.abort()}}})(e,t)},ia=function(e,t){return Fo(Sr(e,{type:"arrayBuffer"}),t)},nr=function(e,t){return Fo(Sr(e,{method:"POST"}),t)},w="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";_n=[],xn=0;var I=function(e,t){if(Ei.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),xn>=mt.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return _n.push(r),r}xn++;var a=!1,l=function(){if(!a)for(a=!0,xn--;_n.length&&xn<mt.MAX_PARALLEL_IMAGE_REQUESTS;){var h=_n.shift();h.cancelled||(h.cancel=I(h.requestParameters,h.callback).cancel)}},c=ia(e,(function(h,m,g,v){l(),h?t(h):m&&(sn()?(function(x,b){var E=new Ce.Blob([new Uint8Array(x)],{type:"image/png"});Ce.createImageBitmap(E).then((function(C){b(null,C)})).catch((function(C){b(new Error("Could not load image because of "+C.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))})(m,t):(function(x,b,E,C){var R=new Ce.Image,F=Ce.URL;R.onload=function(){b(null,R),F.revokeObjectURL(R.src),R.onload=null,Ce.requestAnimationFrame((function(){R.src=w}))},R.onerror=function(){return b(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 G=new Ce.Blob([new Uint8Array(x)],{type:"image/png"});R.cacheControl=E,R.expires=C,R.src=x.byteLength?F.createObjectURL(G):w})(m,t,g,v))}));return{cancel:function(){c.cancel(),l()}}};function k(e,t,r){r[e]&&r[e].indexOf(t)!==-1||(r[e]=r[e]||[],r[e].push(t))}function L(e,t,r){if(r&&r[e]){var a=r[e].indexOf(t);a!==-1&&r[e].splice(a,1)}}var V=function(e,t){t===void 0&&(t={}),Sr(this,t),this.type=e},W=(function(e){function t(r,a){a===void 0&&(a={}),e.call(this,"error",Sr({error:r},a))}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(V),H=function(){};H.prototype.on=function(e,t){return this._listeners=this._listeners||{},k(e,t,this._listeners),this},H.prototype.off=function(e,t){return L(e,t,this._listeners),L(e,t,this._oneTimeListeners),this},H.prototype.once=function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},k(e,t,this._oneTimeListeners),this},H.prototype.fire=function(e,t){typeof e=="string"&&(e=new V(e,t||{}));var r=e.type;if(this.listens(r)){e.target=this;for(var a=0,l=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];a<l.length;a+=1)l[a].call(this,e);for(var c=0,h=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];c<h.length;c+=1){var m=h[c];L(r,m,this._oneTimeListeners),m.call(this,e)}var g=this._eventedParent;g&&(Sr(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),g.fire(e))}else e instanceof W&&console.error(e.error);return this},H.prototype.listens=function(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},H.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var A={$version:8,$root:{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"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{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"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"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"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],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"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-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"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-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"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"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"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},N=function(e,t,r,a){this.message=(e?e+": ":"")+r,a&&(this.identifier=a),t!=null&&t.__line__&&(this.line=t.__line__)};function $(e){var t=e.value;return t?[new N(e.key,t,"constants have been deprecated as of v8")]:[]}function fe(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,l=t;a<l.length;a+=1){var c=l[a];for(var h in c)e[h]=c[h]}return e}function ye(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function ae(e){if(Array.isArray(e))return e.map(ae);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var r in e)t[r]=ae(e[r]);return t}return ye(e)}var de=(function(e){function t(r,a){e.call(this,a),this.message=a,this.key=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(Error),Be=function(e,t){t===void 0&&(t=[]),this.parent=e,this.bindings={};for(var r=0,a=t;r<a.length;r+=1){var l=a[r];this.bindings[l[0]]=l[1]}};Be.prototype.concat=function(e){return new Be(this,e)},Be.prototype.get=function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(e+" not found in scope.")},Be.prototype.has=function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)};var Me={kind:"null"},se={kind:"number"},Pe={kind:"string"},we={kind:"boolean"},Ie={kind:"color"},lt={kind:"object"},Te={kind:"value"},gt={kind:"collator"},Lt={kind:"formatted"},pt={kind:"resolvedImage"};function Et(e,t){return{kind:"array",itemType:e,N:t}}function _t(e){if(e.kind==="array"){var t=_t(e.itemType);return typeof e.N=="number"?"array<"+t+", "+e.N+">":e.itemType.kind==="value"?"array":"array<"+t+">"}return e.kind}var Jr=[Me,se,Pe,we,Ie,Lt,lt,Et(Te),pt];function Pt(e,t){if(t.kind==="error")return null;if(e.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Pt(e.itemType,t.itemType))&&(typeof e.N!="number"||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind==="value"){for(var r=0,a=Jr;r<a.length;r+=1)if(!Pt(a[r],t))return null}}return"Expected "+_t(e)+" but found "+_t(t)+" instead."}function or(e,t){return t.some((function(r){return r.kind===e.kind}))}function Mt(e,t){return t.some((function(r){return r==="null"?e===null:r==="array"?Array.isArray(e):r==="object"?e&&!Array.isArray(e)&&typeof e=="object":r===typeof e}))}var yt=ot((function(e,t){var r={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 a(m){return(m=Math.round(m))<0?0:m>255?255:m}function l(m){return a(m[m.length-1]==="%"?parseFloat(m)/100*255:parseInt(m))}function c(m){return(g=m[m.length-1]==="%"?parseFloat(m)/100:parseFloat(m))<0?0:g>1?1:g;var g}function h(m,g,v){return v<0?v+=1:v>1&&(v-=1),6*v<1?m+(g-m)*v*6:2*v<1?g:3*v<2?m+(g-m)*(2/3-v)*6:m}try{t.parseCSSColor=function(m){var g,v=m.replace(/ /g,"").toLowerCase();if(v in r)return r[v].slice();if(v[0]==="#")return v.length===4?(g=parseInt(v.substr(1),16))>=0&&g<=4095?[(3840&g)>>4|(3840&g)>>8,240&g|(240&g)>>4,15&g|(15&g)<<4,1]:null:v.length===7&&(g=parseInt(v.substr(1),16))>=0&&g<=16777215?[(16711680&g)>>16,(65280&g)>>8,255&g,1]:null;var x=v.indexOf("("),b=v.indexOf(")");if(x!==-1&&b+1===v.length){var E=v.substr(0,x),C=v.substr(x+1,b-(x+1)).split(","),R=1;switch(E){case"rgba":if(C.length!==4)return null;R=c(C.pop());case"rgb":return C.length!==3?null:[l(C[0]),l(C[1]),l(C[2]),R];case"hsla":if(C.length!==4)return null;R=c(C.pop());case"hsl":if(C.length!==3)return null;var F=(parseFloat(C[0])%360+360)%360/360,G=c(C[1]),j=c(C[2]),J=j<=.5?j*(G+1):j+G-j*G,Q=2*j-J;return[a(255*h(Q,J,F+1/3)),a(255*h(Q,J,F)),a(255*h(Q,J,F-1/3)),R];default:return null}}return null}}catch{}})).parseCSSColor,Tt=function(e,t,r,a){a===void 0&&(a=1),this.r=e,this.g=t,this.b=r,this.a=a};Tt.parse=function(e){if(e){if(e instanceof Tt)return e;if(typeof e=="string"){var t=yt(e);if(t)return new Tt(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},Tt.prototype.toString=function(){var e=this.toArray(),t=e[1],r=e[2],a=e[3];return"rgba("+Math.round(e[0])+","+Math.round(t)+","+Math.round(r)+","+a+")"},Tt.prototype.toArray=function(){var e=this.a;return e===0?[0,0,0,0]:[255*this.r/e,255*this.g/e,255*this.b/e,e]},Tt.black=new Tt(0,0,0,1),Tt.white=new Tt(1,1,1,1),Tt.transparent=new Tt(0,0,0,0),Tt.red=new Tt(1,0,0,1);var si=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};si.prototype.compare=function(e,t){return this.collator.compare(e,t)},si.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var na=function(e,t,r,a,l){this.text=e,this.image=t,this.scale=r,this.fontStack=a,this.textColor=l},Dr=function(e){this.sections=e};Dr.fromString=function(e){return new Dr([new na(e,null,null,null,null)])},Dr.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some((function(e){return e.text.length!==0||e.image&&e.image.name.length!==0}))},Dr.factory=function(e){return e instanceof Dr?e:Dr.fromString(e)},Dr.prototype.toString=function(){return this.sections.length===0?"":this.sections.map((function(e){return e.text})).join("")},Dr.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];if(a.image)e.push(["image",a.image.name]);else{e.push(a.text);var l={};a.fontStack&&(l["text-font"]=["literal",a.fontStack.split(",")]),a.scale&&(l["font-scale"]=a.scale),a.textColor&&(l["text-color"]=["rgba"].concat(a.textColor.toArray())),e.push(l)}}return e};var li=function(e){this.name=e.name,this.available=e.available};function Ms(e,t,r,a){return typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:"Invalid rgba value ["+[e,t,r,a].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof a=="number"?[e,t,r,a]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function oa(e){if(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||e instanceof Tt||e instanceof si||e instanceof Dr||e instanceof li)return!0;if(Array.isArray(e)){for(var t=0,r=e;t<r.length;t+=1)if(!oa(r[t]))return!1;return!0}if(typeof e=="object"){for(var a in e)if(!oa(e[a]))return!1;return!0}return!1}function ar(e){if(e===null)return Me;if(typeof e=="string")return Pe;if(typeof e=="boolean")return we;if(typeof e=="number")return se;if(e instanceof Tt)return Ie;if(e instanceof si)return gt;if(e instanceof Dr)return Lt;if(e instanceof li)return pt;if(Array.isArray(e)){for(var t,r=e.length,a=0,l=e;a<l.length;a+=1){var c=ar(l[a]);if(t){if(t===c)continue;t=Te;break}t=c}return Et(t||Te,r)}return lt}function aa(e){var t=typeof e;return e===null?"":t==="string"||t==="number"||t==="boolean"?String(e):e instanceof Tt||e instanceof Dr||e instanceof li?e.toString():JSON.stringify(e)}li.prototype.toString=function(){return this.name},li.fromString=function(e){return e?new li({name:e,available:!1}):null},li.prototype.serialize=function(){return["image",this.name]};var Yr=function(e,t){this.type=e,this.value=t};Yr.parse=function(e,t){if(e.length!==2)return t.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!oa(e[1]))return t.error("invalid value");var r=e[1],a=ar(r),l=t.expectedType;return a.kind!=="array"||a.N!==0||!l||l.kind!=="array"||typeof l.N=="number"&&l.N!==0||(a=l),new Yr(a,r)},Yr.prototype.evaluate=function(){return this.value},Yr.prototype.eachChild=function(){},Yr.prototype.outputDefined=function(){return!0},Yr.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Tt?["rgba"].concat(this.value.toArray()):this.value instanceof Dr?this.value.serialize():this.value};var Lr=function(e){this.name="ExpressionEvaluationError",this.message=e};Lr.prototype.toJSON=function(){return this.message};var Li={string:Pe,number:se,boolean:we,object:lt},qt=function(e,t){this.type=e,this.args=t};qt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r,a=1,l=e[0];if(l==="array"){var c,h;if(e.length>2){var m=e[1];if(typeof m!="string"||!(m in Li)||m==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);c=Li[m],a++}else c=Te;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);h=e[2],a++}r=Et(c,h)}else r=Li[l];for(var g=[];a<e.length;a++){var v=t.parse(e[a],a,Te);if(!v)return null;g.push(v)}return new qt(r,g)},qt.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var r=this.args[t].evaluate(e);if(!Pt(this.type,ar(r)))return r;if(t===this.args.length-1)throw new Lr("Expected value to be of type "+_t(this.type)+", but found "+_t(ar(r))+" instead.")}return null},qt.prototype.eachChild=function(e){this.args.forEach(e)},qt.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},qt.prototype.serialize=function(){var e=this.type,t=[e.kind];if(e.kind==="array"){var r=e.itemType;if(r.kind==="string"||r.kind==="number"||r.kind==="boolean"){t.push(r.kind);var a=e.N;(typeof a=="number"||this.args.length>1)&&t.push(a)}}return t.concat(this.args.map((function(l){return l.serialize()})))};var Xi=function(e){this.type=Lt,this.sections=e};Xi.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&typeof r=="object")return t.error("First argument must be an image or text section.");for(var a=[],l=!1,c=1;c<=e.length-1;++c){var h=e[c];if(l&&typeof h=="object"&&!Array.isArray(h)){l=!1;var m=null;if(h["font-scale"]&&!(m=t.parse(h["font-scale"],1,se)))return null;var g=null;if(h["text-font"]&&!(g=t.parse(h["text-font"],1,Et(Pe))))return null;var v=null;if(h["text-color"]&&!(v=t.parse(h["text-color"],1,Ie)))return null;var x=a[a.length-1];x.scale=m,x.font=g,x.textColor=v}else{var b=t.parse(e[c],1,Te);if(!b)return null;var E=b.type.kind;if(E!=="string"&&E!=="value"&&E!=="null"&&E!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");l=!0,a.push({content:b,scale:null,font:null,textColor:null})}}return new Xi(a)},Xi.prototype.evaluate=function(e){return new Dr(this.sections.map((function(t){var r=t.content.evaluate(e);return ar(r)===pt?new na("",r,null,null,null):new na(aa(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))},Xi.prototype.eachChild=function(e){for(var t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e(a.content),a.scale&&e(a.scale),a.font&&e(a.font),a.textColor&&e(a.textColor)}},Xi.prototype.outputDefined=function(){return!1},Xi.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e.push(a.content.serialize());var l={};a.scale&&(l["font-scale"]=a.scale.serialize()),a.font&&(l["text-font"]=a.font.serialize()),a.textColor&&(l["text-color"]=a.textColor.serialize()),e.push(l)}return e};var ki=function(e){this.type=pt,this.input=e};ki.parse=function(e,t){if(e.length!==2)return t.error("Expected two arguments.");var r=t.parse(e[1],1,Pe);return r?new ki(r):t.error("No image name provided.")},ki.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=li.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r},ki.prototype.eachChild=function(e){e(this.input)},ki.prototype.outputDefined=function(){return!1},ki.prototype.serialize=function(){return["image",this.input.serialize()]};var Pl={"to-boolean":we,"to-color":Ie,"to-number":se,"to-string":Pe},Bi=function(e,t){this.type=e,this.args=t};Bi.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if((r==="to-boolean"||r==="to-string")&&e.length!==2)return t.error("Expected one argument.");for(var a=Pl[r],l=[],c=1;c<e.length;c++){var h=t.parse(e[c],c,Te);if(!h)return null;l.push(h)}return new Bi(a,l)},Bi.prototype.evaluate=function(e){if(this.type.kind==="boolean")return!!this.args[0].evaluate(e);if(this.type.kind==="color"){for(var t,r,a=0,l=this.args;a<l.length;a+=1){if(r=null,(t=l[a].evaluate(e))instanceof Tt)return t;if(typeof t=="string"){var c=e.parseColor(t);if(c)return c}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":Ms(t[0],t[1],t[2],t[3])))return new Tt(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Lr(r||"Could not parse color from value '"+(typeof t=="string"?t:String(JSON.stringify(t)))+"'")}if(this.type.kind==="number"){for(var h=null,m=0,g=this.args;m<g.length;m+=1){if((h=g[m].evaluate(e))===null)return 0;var v=Number(h);if(!isNaN(v))return v}throw new Lr("Could not convert "+JSON.stringify(h)+" to number.")}return this.type.kind==="formatted"?Dr.fromString(aa(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?li.fromString(aa(this.args[0].evaluate(e))):aa(this.args[0].evaluate(e))},Bi.prototype.eachChild=function(e){this.args.forEach(e)},Bi.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},Bi.prototype.serialize=function(){if(this.type.kind==="formatted")return new Xi([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new ki(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild((function(t){e.push(t.serialize())})),e};var Gu=["Unknown","Point","LineString","Polygon"],bn=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};bn.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},bn.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?Gu[this.feature.type]:this.feature.type:null},bn.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},bn.prototype.canonicalID=function(){return this.canonical},bn.prototype.properties=function(){return this.feature&&this.feature.properties||{}},bn.prototype.parseColor=function(e){var t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Tt.parse(e)),t};var Nr=function(e,t,r,a){this.name=e,this.type=t,this._evaluate=r,this.args=a};Nr.prototype.evaluate=function(e){return this._evaluate(e,this.args)},Nr.prototype.eachChild=function(e){this.args.forEach(e)},Nr.prototype.outputDefined=function(){return!1},Nr.prototype.serialize=function(){return[this.name].concat(this.args.map((function(e){return e.serialize()})))},Nr.parse=function(e,t){var r,a=e[0],l=Nr.definitions[a];if(!l)return t.error('Unknown expression "'+a+'". If you wanted a literal array, use ["literal", [...]].',0);for(var c=Array.isArray(l)?l[0]:l.type,h=Array.isArray(l)?[[l[1],l[2]]]:l.overloads,m=h.filter((function(je){var ke=je[0];return!Array.isArray(ke)||ke.length===e.length-1})),g=null,v=0,x=m;v<x.length;v+=1){var b=x[v],E=b[0],C=b[1];g=new Vn(t.registry,t.path,null,t.scope);for(var R=[],F=!1,G=1;G<e.length;G++){var j=e[G],J=Array.isArray(E)?E[G-1]:E.type,Q=g.parse(j,1+R.length,J);if(!Q){F=!0;break}R.push(Q)}if(!F)if(Array.isArray(E)&&E.length!==R.length)g.error("Expected "+E.length+" arguments, but found "+R.length+" instead.");else{for(var te=0;te<R.length;te++){var ie=Array.isArray(E)?E[te]:E.type,ce=R[te];g.concat(te+1).checkSubtype(ie,ce.type)}if(g.errors.length===0)return new Nr(a,c,C,R)}}if(m.length===1)(r=t.errors).push.apply(r,g.errors);else{for(var ge=(m.length?m:h).map((function(je){var ke;return ke=je[0],Array.isArray(ke)?"("+ke.map(_t).join(", ")+")":"("+_t(ke.type)+"...)"})).join(" | "),be=[],Oe=1;Oe<e.length;Oe++){var Ee=t.parse(e[Oe],1+be.length);if(!Ee)return null;be.push(_t(Ee.type))}t.error("Expected arguments of type "+ge+", but found ("+be.join(", ")+") instead.")}return null},Nr.register=function(e,t){for(var r in Nr.definitions=t,t)e[r]=Nr};var ln=function(e,t,r){this.type=gt,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t};function $r(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function uo(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Wu(e,t){var r=(180+e[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,l=Math.pow(2,t.z);return[Math.round(r*l*8192),Math.round(a*l*8192)]}function Xu(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function Ds(e,t){for(var r,a,l,c,h,m,g,v=!1,x=0,b=t.length;x<b;x++)for(var E=t[x],C=0,R=E.length;C<R-1;C++){if((c=(r=e)[0]-(a=E[C])[0])*(g=r[1]-(l=E[C+1])[1])-(m=r[0]-l[0])*(h=r[1]-a[1])==0&&c*m<=0&&h*g<=0)return!1;Xu(e,E[C],E[C+1])&&(v=!v)}return v}function Hu(e,t){for(var r=0;r<t.length;r++)if(Ds(e,t[r]))return!0;return!1}function Al(e,t,r,a){var l=a[0]-r[0],c=a[1]-r[1],h=(e[0]-r[0])*c-l*(e[1]-r[1]),m=(t[0]-r[0])*c-l*(t[1]-r[1]);return h>0&&m<0||h<0&&m>0}function Ku(e,t,r){for(var a=0,l=r;a<l.length;a+=1)for(var c=l[a],h=0;h<c.length-1;++h)if((b=[(x=c[h+1])[0]-(v=c[h])[0],x[1]-v[1]])[0]*(E=[(g=t)[0]-(m=e)[0],g[1]-m[1]])[1]-b[1]*E[0]!=0&&Al(m,g,v,x)&&Al(v,x,m,g))return!0;var m,g,v,x,b,E;return!1}function zl(e,t){for(var r=0;r<e.length;++r)if(!Ds(e[r],t))return!1;for(var a=0;a<e.length-1;++a)if(Ku(e[a],e[a+1],t))return!1;return!0}function Ml(e,t){for(var r=0;r<t.length;r++)if(zl(e,t[r]))return!0;return!1}function Oo(e,t,r){for(var a=[],l=0;l<e.length;l++){for(var c=[],h=0;h<e[l].length;h++){var m=Wu(e[l][h],r);$r(t,m),c.push(m)}a.push(c)}return a}function Ls(e,t,r){for(var a=[],l=0;l<e.length;l++){var c=Oo(e[l],t,r);a.push(c)}return a}function sa(e,t,r,a){if(e[0]<r[0]||e[0]>r[2]){var l=.5*a,c=e[0]-r[0]>l?-a:r[0]-e[0]>l?a:0;c===0&&(c=e[0]-r[2]>l?-a:r[2]-e[0]>l?a:0),e[0]+=c}$r(t,e)}function Dl(e,t,r,a){for(var l=8192*Math.pow(2,a.z),c=[8192*a.x,8192*a.y],h=[],m=0,g=e;m<g.length;m+=1)for(var v=0,x=g[m];v<x.length;v+=1){var b=x[v],E=[b.x+c[0],b.y+c[1]];sa(E,t,r,l),h.push(E)}return h}function Fa(e,t,r,a){for(var l,c=8192*Math.pow(2,a.z),h=[8192*a.x,8192*a.y],m=[],g=0,v=e;g<v.length;g+=1){for(var x=[],b=0,E=v[g];b<E.length;b+=1){var C=E[b],R=[C.x+h[0],C.y+h[1]];$r(t,R),x.push(R)}m.push(x)}if(t[2]-t[0]<=c/2){(l=t)[0]=l[1]=1/0,l[2]=l[3]=-1/0;for(var F=0,G=m;F<G.length;F+=1)for(var j=0,J=G[F];j<J.length;j+=1)sa(J[j],t,r,c)}return m}ln.parse=function(e,t){if(e.length!==2)return t.error("Expected one argument.");var r=e[1];if(typeof r!="object"||Array.isArray(r))return t.error("Collator options argument must be an object.");var a=t.parse(r["case-sensitive"]!==void 0&&r["case-sensitive"],1,we);if(!a)return null;var l=t.parse(r["diacritic-sensitive"]!==void 0&&r["diacritic-sensitive"],1,we);if(!l)return null;var c=null;return r.locale&&!(c=t.parse(r.locale,1,Pe))?null:new ln(a,l,c)},ln.prototype.evaluate=function(e){return new si(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},ln.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},ln.prototype.outputDefined=function(){return!1},ln.prototype.serialize=function(){var e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]};var Ri=function(e,t){this.type=we,this.geojson=e,this.geometries=t};function Rn(e){if(e instanceof Nr&&(e.name==="get"&&e.args.length===1||e.name==="feature-state"||e.name==="has"&&e.args.length===1||e.name==="properties"||e.name==="geometry-type"||e.name==="id"||/^filter-/.test(e.name))||e instanceof Ri)return!1;var t=!0;return e.eachChild((function(r){t&&!Rn(r)&&(t=!1)})),t}function Fn(e){if(e instanceof Nr&&e.name==="feature-state")return!1;var t=!0;return e.eachChild((function(r){t&&!Fn(r)&&(t=!1)})),t}function co(e,t){if(e instanceof Nr&&t.indexOf(e.name)>=0)return!1;var r=!0;return e.eachChild((function(a){r&&!co(a,t)&&(r=!1)})),r}Ri.parse=function(e,t){if(e.length!==2)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(oa(e[1])){var r=e[1];if(r.type==="FeatureCollection")for(var a=0;a<r.features.length;++a){var l=r.features[a].geometry.type;if(l==="Polygon"||l==="MultiPolygon")return new Ri(r,r.features[a].geometry)}else if(r.type==="Feature"){var c=r.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new Ri(r,r.geometry)}else if(r.type==="Polygon"||r.type==="MultiPolygon")return new Ri(r,r)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Ri.prototype.evaluate=function(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(t,r){var a=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var h=Oo(r.coordinates,l,c),m=Dl(t.geometry(),a,l,c);if(!uo(a,l))return!1;for(var g=0,v=m;g<v.length;g+=1)if(!Ds(v[g],h))return!1}if(r.type==="MultiPolygon"){var x=Ls(r.coordinates,l,c),b=Dl(t.geometry(),a,l,c);if(!uo(a,l))return!1;for(var E=0,C=b;E<C.length;E+=1)if(!Hu(C[E],x))return!1}return!0})(e,this.geometries);if(e.geometryType()==="LineString")return(function(t,r){var a=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var h=Oo(r.coordinates,l,c),m=Fa(t.geometry(),a,l,c);if(!uo(a,l))return!1;for(var g=0,v=m;g<v.length;g+=1)if(!zl(v[g],h))return!1}if(r.type==="MultiPolygon"){var x=Ls(r.coordinates,l,c),b=Fa(t.geometry(),a,l,c);if(!uo(a,l))return!1;for(var E=0,C=b;E<C.length;E+=1)if(!Ml(C[E],x))return!1}return!0})(e,this.geometries)}return!1},Ri.prototype.eachChild=function(){},Ri.prototype.outputDefined=function(){return!0},Ri.prototype.serialize=function(){return["within",this.geojson]};var On=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};On.parse=function(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");var r=e[1];return t.scope.has(r)?new On(r,t.scope.get(r)):t.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},On.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},On.prototype.eachChild=function(){},On.prototype.outputDefined=function(){return!1},On.prototype.serialize=function(){return["var",this.name]};var Vn=function(e,t,r,a,l){t===void 0&&(t=[]),a===void 0&&(a=new Be),l===void 0&&(l=[]),this.registry=e,this.path=t,this.key=t.map((function(c){return"["+c+"]"})).join(""),this.scope=a,this.errors=l,this.expectedType=r};function Oa(e,t){for(var r,a=e.length-1,l=0,c=a,h=0;l<=c;)if((r=e[h=Math.floor((l+c)/2)])<=t){if(h===a||t<e[h+1])return h;l=h+1}else{if(!(r>t))throw new Lr("Input is not a number.");c=h-1}return 0}Vn.prototype.parse=function(e,t,r,a,l){return l===void 0&&(l={}),t?this.concat(t,r,a)._parse(e,l):this._parse(e,l)},Vn.prototype._parse=function(e,t){function r(v,x,b){return b==="assert"?new qt(x,[v]):b==="coerce"?new Bi(x,[v]):v}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var a=e[0];if(typeof a!="string")return this.error("Expression name must be a string, but found "+typeof a+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var l=this.registry[a];if(l){var c=l.parse(e,this);if(!c)return null;if(this.expectedType){var h=this.expectedType,m=c.type;if(h.kind!=="string"&&h.kind!=="number"&&h.kind!=="boolean"&&h.kind!=="object"&&h.kind!=="array"||m.kind!=="value")if(h.kind!=="color"&&h.kind!=="formatted"&&h.kind!=="resolvedImage"||m.kind!=="value"&&m.kind!=="string"){if(this.checkSubtype(h,m))return null}else c=r(c,h,t.typeAnnotation||"coerce");else c=r(c,h,t.typeAnnotation||"assert")}if(!(c instanceof Yr)&&c.type.kind!=="resolvedImage"&&(function v(x){if(x instanceof On)return v(x.boundExpression);if(x instanceof Nr&&x.name==="error"||x instanceof ln||x instanceof Ri)return!1;var b=x instanceof Bi||x instanceof qt,E=!0;return x.eachChild((function(C){E=b?E&&v(C):E&&C instanceof Yr})),!!E&&Rn(x)&&co(x,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])})(c)){var g=new bn;try{c=new Yr(c.type,c.evaluate(g))}catch(v){return this.error(v.message),null}}return c}return this.error('Unknown expression "'+a+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof e+" instead.")},Vn.prototype.concat=function(e,t,r){var a=typeof e=="number"?this.path.concat(e):this.path,l=r?this.scope.concat(r):this.scope;return new Vn(this.registry,a,t||null,l,this.errors)},Vn.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var a=""+this.key+t.map((function(l){return"["+l+"]"})).join("");this.errors.push(new de(a,e))},Vn.prototype.checkSubtype=function(e,t){var r=Pt(e,t);return r&&this.error(r),r};var mi=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var a=0,l=r;a<l.length;a+=1){var c=l[a],h=c[1];this.labels.push(c[0]),this.outputs.push(h)}};function fr(e,t,r){return e*(1-r)+t*r}mi.parse=function(e,t){if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");var r=t.parse(e[1],1,se);if(!r)return null;var a=[],l=null;t.expectedType&&t.expectedType.kind!=="value"&&(l=t.expectedType);for(var c=1;c<e.length;c+=2){var h=c===1?-1/0:e[c],m=e[c+1],g=c,v=c+1;if(typeof h!="number")return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',g);if(a.length&&a[a.length-1][0]>=h)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',g);var x=t.parse(m,v,l);if(!x)return null;l=l||x.type,a.push([h,x])}return new mi(l,r,a)},mi.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var l=t.length;return a>=t[l-1]?r[l-1].evaluate(e):r[Oa(t,a)].evaluate(e)},mi.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},mi.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},mi.prototype.serialize=function(){for(var e=["step",this.input.serialize()],t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var Vo=Object.freeze({__proto__:null,number:fr,color:function(e,t,r){return new Tt(fr(e.r,t.r,r),fr(e.g,t.g,r),fr(e.b,t.b,r),fr(e.a,t.a,r))},array:function(e,t,r){return e.map((function(a,l){return fr(a,t[l],r)}))}}),Ll=6/29*3*(6/29),Ju=Math.PI/180,Yu=180/Math.PI;function Bs(e){return e>.008856451679035631?Math.pow(e,1/3):e/Ll+4/29}function Rs(e){return e>6/29?e*e*e:Ll*(e-4/29)}function Fs(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Os(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Bl(e){var t=Os(e.r),r=Os(e.g),a=Os(e.b),l=Bs((.4124564*t+.3575761*r+.1804375*a)/.95047),c=Bs((.2126729*t+.7151522*r+.072175*a)/1);return{l:116*c-16,a:500*(l-c),b:200*(c-Bs((.0193339*t+.119192*r+.9503041*a)/1.08883)),alpha:e.a}}function Rl(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,a=isNaN(e.b)?t:t-e.b/200;return t=1*Rs(t),r=.95047*Rs(r),a=1.08883*Rs(a),new Tt(Fs(3.2404542*r-1.5371385*t-.4985314*a),Fs(-.969266*r+1.8760108*t+.041556*a),Fs(.0556434*r-.2040259*t+1.0572252*a),e.alpha)}function $u(e,t,r){var a=t-e;return e+r*(a>180||a<-180?a-360*Math.round(a/360):a)}var la={forward:Bl,reverse:Rl,interpolate:function(e,t,r){return{l:fr(e.l,t.l,r),a:fr(e.a,t.a,r),b:fr(e.b,t.b,r),alpha:fr(e.alpha,t.alpha,r)}}},ua={forward:function(e){var t=Bl(e),r=t.l,a=t.a,l=t.b,c=Math.atan2(l,a)*Yu;return{h:c<0?c+360:c,c:Math.sqrt(a*a+l*l),l:r,alpha:e.a}},reverse:function(e){var t=e.h*Ju,r=e.c;return Rl({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:$u(e.h,t.h,r),c:fr(e.c,t.c,r),l:fr(e.l,t.l,r),alpha:fr(e.alpha,t.alpha,r)}}},Fl=Object.freeze({__proto__:null,lab:la,hcl:ua}),jr=function(e,t,r,a,l){this.type=e,this.operator=t,this.interpolation=r,this.input=a,this.labels=[],this.outputs=[];for(var c=0,h=l;c<h.length;c+=1){var m=h[c],g=m[1];this.labels.push(m[0]),this.outputs.push(g)}};function Vs(e,t,r,a){var l=a-r,c=e-r;return l===0?0:t===1?c/l:(Math.pow(t,c)-1)/(Math.pow(t,l)-1)}jr.interpolationFactor=function(e,t,r,a){var l=0;if(e.name==="exponential")l=Vs(t,e.base,r,a);else if(e.name==="linear")l=Vs(t,1,r,a);else if(e.name==="cubic-bezier"){var c=e.controlPoints;l=new pe(c[0],c[1],c[2],c[3]).solve(Vs(t,1,r,a))}return l},jr.parse=function(e,t){var r=e[0],a=e[1],l=e[2],c=e.slice(3);if(!Array.isArray(a)||a.length===0)return t.error("Expected an interpolation type expression.",1);if(a[0]==="linear")a={name:"linear"};else if(a[0]==="exponential"){var h=a[1];if(typeof h!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:h}}else{if(a[0]!=="cubic-bezier")return t.error("Unknown interpolation type "+String(a[0]),1,0);var m=a.slice(1);if(m.length!==4||m.some((function(G){return typeof G!="number"||G<0||G>1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:m}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(l=t.parse(l,2,se)))return null;var g=[],v=null;r==="interpolate-hcl"||r==="interpolate-lab"?v=Ie:t.expectedType&&t.expectedType.kind!=="value"&&(v=t.expectedType);for(var x=0;x<c.length;x+=2){var b=c[x],E=c[x+1],C=x+3,R=x+4;if(typeof b!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',C);if(g.length&&g[g.length-1][0]>=b)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',C);var F=t.parse(E,R,v);if(!F)return null;v=v||F.type,g.push([b,F])}return v.kind==="number"||v.kind==="color"||v.kind==="array"&&v.itemType.kind==="number"&&typeof v.N=="number"?new jr(v,r,a,l,g):t.error("Type "+_t(v)+" is not interpolatable.")},jr.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var l=t.length;if(a>=t[l-1])return r[l-1].evaluate(e);var c=Oa(t,a),h=jr.interpolationFactor(this.interpolation,a,t[c],t[c+1]),m=r[c].evaluate(e),g=r[c+1].evaluate(e);return this.operator==="interpolate"?Vo[this.type.kind.toLowerCase()](m,g,h):this.operator==="interpolate-hcl"?ua.reverse(ua.interpolate(ua.forward(m),ua.forward(g),h)):la.reverse(la.interpolate(la.forward(m),la.forward(g),h))},jr.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},jr.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},jr.prototype.serialize=function(){var e;e=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var t=[this.operator,e,this.input.serialize()],r=0;r<this.labels.length;r++)t.push(this.labels[r],this.outputs[r].serialize());return t};var Un=function(e,t){this.type=e,this.args=t};Un.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var r=null,a=t.expectedType;a&&a.kind!=="value"&&(r=a);for(var l=[],c=0,h=e.slice(1);c<h.length;c+=1){var m=t.parse(h[c],1+l.length,r,void 0,{typeAnnotation:"omit"});if(!m)return null;r=r||m.type,l.push(m)}var g=a&&l.some((function(v){return Pt(a,v.type)}));return new Un(g?Te:r,l)},Un.prototype.evaluate=function(e){for(var t,r=null,a=0,l=0,c=this.args;l<c.length&&(a++,(r=c[l].evaluate(e))&&r instanceof li&&!r.available&&(t||(t=r.name),r=null,a===this.args.length&&(r=t)),r===null);l+=1);return r},Un.prototype.eachChild=function(e){this.args.forEach(e)},Un.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},Un.prototype.serialize=function(){var e=["coalesce"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Nn=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};Nn.prototype.evaluate=function(e){return this.result.evaluate(e)},Nn.prototype.eachChild=function(e){for(var t=0,r=this.bindings;t<r.length;t+=1)e(r[t][1]);e(this.result)},Nn.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found "+(e.length-1)+" instead.");for(var r=[],a=1;a<e.length-1;a+=2){var l=e[a];if(typeof l!="string")return t.error("Expected string, but found "+typeof l+" instead.",a);if(/[^a-zA-Z0-9_]/.test(l))return t.error("Variable names must contain only alphanumeric characters or '_'.",a);var c=t.parse(e[a+1],a+1);if(!c)return null;r.push([l,c])}var h=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return h?new Nn(r,h):null},Nn.prototype.outputDefined=function(){return this.result.outputDefined()},Nn.prototype.serialize=function(){for(var e=["let"],t=0,r=this.bindings;t<r.length;t+=1){var a=r[t];e.push(a[0],a[1].serialize())}return e.push(this.result.serialize()),e};var po=function(e,t,r){this.type=e,this.index=t,this.input=r};po.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,se),a=t.parse(e[2],2,Et(t.expectedType||Te));return r&&a?new po(a.type.itemType,r,a):null},po.prototype.evaluate=function(e){var t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new Lr("Array index out of bounds: "+t+" < 0.");if(t>=r.length)throw new Lr("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new Lr("Array index must be an integer, but found "+t+" instead.");return r[t]},po.prototype.eachChild=function(e){e(this.index),e(this.input)},po.prototype.outputDefined=function(){return!1},po.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var ho=function(e,t){this.type=we,this.needle=e,this.haystack=t};ho.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Te),a=t.parse(e[2],2,Te);return r&&a?or(r.type,[we,Pe,se,Me,Te])?new ho(r,a):t.error("Expected first argument to be of type boolean, string, number or null, but found "+_t(r.type)+" instead"):null},ho.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Mt(t,["boolean","string","number","null"]))throw new Lr("Expected first argument to be of type boolean, string, number or null, but found "+_t(ar(t))+" instead.");if(!Mt(r,["string","array"]))throw new Lr("Expected second argument to be of type array or string, but found "+_t(ar(r))+" instead.");return r.indexOf(t)>=0},ho.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},ho.prototype.outputDefined=function(){return!0},ho.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var jn=function(e,t,r){this.type=se,this.needle=e,this.haystack=t,this.fromIndex=r};jn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Te),a=t.parse(e[2],2,Te);if(!r||!a)return null;if(!or(r.type,[we,Pe,se,Me,Te]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+_t(r.type)+" instead");if(e.length===4){var l=t.parse(e[3],3,se);return l?new jn(r,a,l):null}return new jn(r,a)},jn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Mt(t,["boolean","string","number","null"]))throw new Lr("Expected first argument to be of type boolean, string, number or null, but found "+_t(ar(t))+" instead.");if(!Mt(r,["string","array"]))throw new Lr("Expected second argument to be of type array or string, but found "+_t(ar(r))+" instead.");if(this.fromIndex){var a=this.fromIndex.evaluate(e);return r.indexOf(t,a)}return r.indexOf(t)},jn.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},jn.prototype.outputDefined=function(){return!1},jn.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var fo=function(e,t,r,a,l,c){this.inputType=e,this.type=t,this.input=r,this.cases=a,this.outputs=l,this.otherwise=c};fo.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var r,a;t.expectedType&&t.expectedType.kind!=="value"&&(a=t.expectedType);for(var l={},c=[],h=2;h<e.length-1;h+=2){var m=e[h],g=e[h+1];Array.isArray(m)||(m=[m]);var v=t.concat(h);if(m.length===0)return v.error("Expected at least one branch label.");for(var x=0,b=m;x<b.length;x+=1){var E=b[x];if(typeof E!="number"&&typeof E!="string")return v.error("Branch labels must be numbers or strings.");if(typeof E=="number"&&Math.abs(E)>Number.MAX_SAFE_INTEGER)return v.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof E=="number"&&Math.floor(E)!==E)return v.error("Numeric branch labels must be integer values.");if(r){if(v.checkSubtype(r,ar(E)))return null}else r=ar(E);if(l[String(E)]!==void 0)return v.error("Branch labels must be unique.");l[String(E)]=c.length}var C=t.parse(g,h,a);if(!C)return null;a=a||C.type,c.push(C)}var R=t.parse(e[1],1,Te);if(!R)return null;var F=t.parse(e[e.length-1],e.length-1,a);return F?R.type.kind!=="value"&&t.concat(1).checkSubtype(r,R.type)?null:new fo(r,a,R,l,c,F):null},fo.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(ar(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},fo.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},fo.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},fo.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],a={},l=0,c=Object.keys(this.cases).sort();l<c.length;l+=1){var h=c[l];(b=a[this.cases[h]])===void 0?(a[this.cases[h]]=r.length,r.push([this.cases[h],[h]])):r[b][1].push(h)}for(var m=function(C){return e.inputType.kind==="number"?Number(C):C},g=0,v=r;g<v.length;g+=1){var x=v[g],b=x[0],E=x[1];t.push(E.length===1?m(E[0]):E.map(m)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var mo=function(e,t,r){this.type=e,this.branches=t,this.otherwise=r};mo.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only "+(e.length-1)+".");if(e.length%2!=0)return t.error("Expected an odd number of arguments.");var r;t.expectedType&&t.expectedType.kind!=="value"&&(r=t.expectedType);for(var a=[],l=1;l<e.length-1;l+=2){var c=t.parse(e[l],l,we);if(!c)return null;var h=t.parse(e[l+1],l+1,r);if(!h)return null;a.push([c,h]),r=r||h.type}var m=t.parse(e[e.length-1],e.length-1,r);return m?new mo(r,a,m):null},mo.prototype.evaluate=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],l=a[1];if(a[0].evaluate(e))return l.evaluate(e)}return this.otherwise.evaluate(e)},mo.prototype.eachChild=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],l=a[1];e(a[0]),e(l)}e(this.otherwise)},mo.prototype.outputDefined=function(){return this.branches.every((function(e){return e[1].outputDefined()}))&&this.otherwise.outputDefined()},mo.prototype.serialize=function(){var e=["case"];return this.eachChild((function(t){e.push(t.serialize())})),e};var qn=function(e,t,r,a){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=a};function Ol(e,t){return e==="=="||e==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function Vl(e,t,r,a){return a.compare(t,r)===0}function Bt(e,t,r){var a=e!=="=="&&e!=="!=";return(function(){function l(c,h,m){this.type=we,this.lhs=c,this.rhs=h,this.collator=m,this.hasUntypedArgument=c.type.kind==="value"||h.type.kind==="value"}return l.parse=function(c,h){if(c.length!==3&&c.length!==4)return h.error("Expected two or three arguments.");var m=c[0],g=h.parse(c[1],1,Te);if(!g)return null;if(!Ol(m,g.type))return h.concat(1).error('"'+m+`" comparisons are not supported for type '`+_t(g.type)+"'.");var v=h.parse(c[2],2,Te);if(!v)return null;if(!Ol(m,v.type))return h.concat(2).error('"'+m+`" comparisons are not supported for type '`+_t(v.type)+"'.");if(g.type.kind!==v.type.kind&&g.type.kind!=="value"&&v.type.kind!=="value")return h.error("Cannot compare types '"+_t(g.type)+"' and '"+_t(v.type)+"'.");a&&(g.type.kind==="value"&&v.type.kind!=="value"?g=new qt(v.type,[g]):g.type.kind!=="value"&&v.type.kind==="value"&&(v=new qt(g.type,[v])));var x=null;if(c.length===4){if(g.type.kind!=="string"&&v.type.kind!=="string"&&g.type.kind!=="value"&&v.type.kind!=="value")return h.error("Cannot use collator to compare non-string types.");if(!(x=h.parse(c[3],3,gt)))return null}return new l(g,v,x)},l.prototype.evaluate=function(c){var h=this.lhs.evaluate(c),m=this.rhs.evaluate(c);if(a&&this.hasUntypedArgument){var g=ar(h),v=ar(m);if(g.kind!==v.kind||g.kind!=="string"&&g.kind!=="number")throw new Lr('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+g.kind+", "+v.kind+") instead.")}if(this.collator&&!a&&this.hasUntypedArgument){var x=ar(h),b=ar(m);if(x.kind!=="string"||b.kind!=="string")return t(c,h,m)}return this.collator?r(c,h,m,this.collator.evaluate(c)):t(c,h,m)},l.prototype.eachChild=function(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)},l.prototype.outputDefined=function(){return!0},l.prototype.serialize=function(){var c=[e];return this.eachChild((function(h){c.push(h.serialize())})),c},l})()}qn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Te),a=t.parse(e[2],2,se);if(!r||!a)return null;if(!or(r.type,[Et(Te),Pe,Te]))return t.error("Expected first argument to be of type array or string, but found "+_t(r.type)+" instead");if(e.length===4){var l=t.parse(e[3],3,se);return l?new qn(r.type,r,a,l):null}return new qn(r.type,r,a)},qn.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Mt(t,["string","array"]))throw new Lr("Expected first argument to be of type array or string, but found "+_t(ar(t))+" instead.");if(this.endIndex){var a=this.endIndex.evaluate(e);return t.slice(r,a)}return t.slice(r)},qn.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},qn.prototype.outputDefined=function(){return!1},qn.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Qu=Bt("==",(function(e,t,r){return t===r}),Vl),Va=Bt("!=",(function(e,t,r){return t!==r}),(function(e,t,r,a){return!Vl(0,t,r,a)})),Ul=Bt("<",(function(e,t,r){return t<r}),(function(e,t,r,a){return a.compare(t,r)<0})),Nl=Bt(">",(function(e,t,r){return t>r}),(function(e,t,r,a){return a.compare(t,r)>0})),jl=Bt("<=",(function(e,t,r){return t<=r}),(function(e,t,r,a){return a.compare(t,r)<=0})),ql=Bt(">=",(function(e,t,r){return t>=r}),(function(e,t,r,a){return a.compare(t,r)>=0})),yo=function(e,t,r,a,l){this.type=Pe,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=a,this.maxFractionDigits=l};yo.parse=function(e,t){if(e.length!==3)return t.error("Expected two arguments.");var r=t.parse(e[1],1,se);if(!r)return null;var a=e[2];if(typeof a!="object"||Array.isArray(a))return t.error("NumberFormat options argument must be an object.");var l=null;if(a.locale&&!(l=t.parse(a.locale,1,Pe)))return null;var c=null;if(a.currency&&!(c=t.parse(a.currency,1,Pe)))return null;var h=null;if(a["min-fraction-digits"]&&!(h=t.parse(a["min-fraction-digits"],1,se)))return null;var m=null;return a["max-fraction-digits"]&&!(m=t.parse(a["max-fraction-digits"],1,se))?null:new yo(r,l,c,h,m)},yo.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},yo.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},yo.prototype.outputDefined=function(){return!1},yo.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var Zn=function(e){this.type=se,this.input=e};Zn.parse=function(e,t){if(e.length!==2)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?r.type.kind!=="array"&&r.type.kind!=="string"&&r.type.kind!=="value"?t.error("Expected argument of type string or array, but found "+_t(r.type)+" instead."):new Zn(r):null},Zn.prototype.evaluate=function(e){var t=this.input.evaluate(e);if(typeof t=="string"||Array.isArray(t))return t.length;throw new Lr("Expected value to be of type string or array, but found "+_t(ar(t))+" instead.")},Zn.prototype.eachChild=function(e){e(this.input)},Zn.prototype.outputDefined=function(){return!1},Zn.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var go={"==":Qu,"!=":Va,">":Nl,"<":Ul,">=":ql,"<=":jl,array:qt,at:po,boolean:qt,case:mo,coalesce:Un,collator:ln,format:Xi,image:ki,in:ho,"index-of":jn,interpolate:jr,"interpolate-hcl":jr,"interpolate-lab":jr,length:Zn,let:Nn,literal:Yr,match:fo,number:qt,"number-format":yo,object:qt,slice:qn,step:mi,string:qt,"to-boolean":Bi,"to-color":Bi,"to-number":Bi,"to-string":Bi,var:On,within:Ri};function Zl(e,t){var r=t[0],a=t[1],l=t[2],c=t[3];r=r.evaluate(e),a=a.evaluate(e),l=l.evaluate(e);var h=c?c.evaluate(e):1,m=Ms(r,a,l,h);if(m)throw new Lr(m);return new Tt(r/255*h,a/255*h,l/255*h,h)}function Gl(e,t){return e in t}function Us(e,t){var r=t[e];return r===void 0?null:r}function vo(e){return{type:e}}function Wl(e){return{result:"success",value:e}}function _o(e){return{result:"error",value:e}}function xo(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function Xl(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function ca(e){return!!e.expression&&e.expression.interpolated}function Ot(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":e===null?"null":typeof e}function Ua(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ec(e){return e}function Uo(e,t,r){return e!==void 0?e:t!==void 0?t:r!==void 0?r:void 0}function Hl(e,t,r,a,l){return Uo(typeof r===l?a[r]:void 0,e.default,t.default)}function tc(e,t,r){if(Ot(r)!=="number")return Uo(e.default,t.default);var a=e.stops.length;if(a===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[a-1][0])return e.stops[a-1][1];var l=Oa(e.stops.map((function(c){return c[0]})),r);return e.stops[l][1]}function Kl(e,t,r){var a=e.base!==void 0?e.base:1;if(Ot(r)!=="number")return Uo(e.default,t.default);var l=e.stops.length;if(l===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[l-1][0])return e.stops[l-1][1];var c=Oa(e.stops.map((function(b){return b[0]})),r),h=(function(b,E,C,R){var F=R-C,G=b-C;return F===0?0:E===1?G/F:(Math.pow(E,G)-1)/(Math.pow(E,F)-1)})(r,a,e.stops[c][0],e.stops[c+1][0]),m=e.stops[c][1],g=e.stops[c+1][1],v=Vo[t.type]||ec;if(e.colorSpace&&e.colorSpace!=="rgb"){var x=Fl[e.colorSpace];v=function(b,E){return x.reverse(x.interpolate(x.forward(b),x.forward(E),h))}}return typeof m.evaluate=="function"?{evaluate:function(){for(var b=[],E=arguments.length;E--;)b[E]=arguments[E];var C=m.evaluate.apply(void 0,b),R=g.evaluate.apply(void 0,b);if(C!==void 0&&R!==void 0)return v(C,R,h)}}:v(m,g,h)}function Na(e,t,r){return t.type==="color"?r=Tt.parse(r):t.type==="formatted"?r=Dr.fromString(r.toString()):t.type==="resolvedImage"?r=li.fromString(r.toString()):Ot(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0),Uo(r,e.default,t.default)}Nr.register(go,{error:[{kind:"error"},[Pe],function(e,t){throw new Lr(t[0].evaluate(e))}],typeof:[Pe,[Te],function(e,t){return _t(ar(t[0].evaluate(e)))}],"to-rgba":[Et(se,4),[Ie],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[Ie,[se,se,se],Zl],rgba:[Ie,[se,se,se,se],Zl],has:{type:we,overloads:[[[Pe],function(e,t){return Gl(t[0].evaluate(e),e.properties())}],[[Pe,lt],function(e,t){var r=t[1];return Gl(t[0].evaluate(e),r.evaluate(e))}]]},get:{type:Te,overloads:[[[Pe],function(e,t){return Us(t[0].evaluate(e),e.properties())}],[[Pe,lt],function(e,t){var r=t[1];return Us(t[0].evaluate(e),r.evaluate(e))}]]},"feature-state":[Te,[Pe],function(e,t){return Us(t[0].evaluate(e),e.featureState||{})}],properties:[lt,[],function(e){return e.properties()}],"geometry-type":[Pe,[],function(e){return e.geometryType()}],id:[Te,[],function(e){return e.id()}],zoom:[se,[],function(e){return e.globals.zoom}],"heatmap-density":[se,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[se,[],function(e){return e.globals.lineProgress||0}],accumulated:[Te,[],function(e){return e.globals.accumulated===void 0?null:e.globals.accumulated}],"+":[se,vo(se),function(e,t){for(var r=0,a=0,l=t;a<l.length;a+=1)r+=l[a].evaluate(e);return r}],"*":[se,vo(se),function(e,t){for(var r=1,a=0,l=t;a<l.length;a+=1)r*=l[a].evaluate(e);return r}],"-":{type:se,overloads:[[[se,se],function(e,t){var r=t[1];return t[0].evaluate(e)-r.evaluate(e)}],[[se],function(e,t){return-t[0].evaluate(e)}]]},"/":[se,[se,se],function(e,t){var r=t[1];return t[0].evaluate(e)/r.evaluate(e)}],"%":[se,[se,se],function(e,t){var r=t[1];return t[0].evaluate(e)%r.evaluate(e)}],ln2:[se,[],function(){return Math.LN2}],pi:[se,[],function(){return Math.PI}],e:[se,[],function(){return Math.E}],"^":[se,[se,se],function(e,t){var r=t[1];return Math.pow(t[0].evaluate(e),r.evaluate(e))}],sqrt:[se,[se],function(e,t){return Math.sqrt(t[0].evaluate(e))}],log10:[se,[se],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN10}],ln:[se,[se],function(e,t){return Math.log(t[0].evaluate(e))}],log2:[se,[se],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN2}],sin:[se,[se],function(e,t){return Math.sin(t[0].evaluate(e))}],cos:[se,[se],function(e,t){return Math.cos(t[0].evaluate(e))}],tan:[se,[se],function(e,t){return Math.tan(t[0].evaluate(e))}],asin:[se,[se],function(e,t){return Math.asin(t[0].evaluate(e))}],acos:[se,[se],function(e,t){return Math.acos(t[0].evaluate(e))}],atan:[se,[se],function(e,t){return Math.atan(t[0].evaluate(e))}],min:[se,vo(se),function(e,t){return Math.min.apply(Math,t.map((function(r){return r.evaluate(e)})))}],max:[se,vo(se),function(e,t){return Math.max.apply(Math,t.map((function(r){return r.evaluate(e)})))}],abs:[se,[se],function(e,t){return Math.abs(t[0].evaluate(e))}],round:[se,[se],function(e,t){var r=t[0].evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[se,[se],function(e,t){return Math.floor(t[0].evaluate(e))}],ceil:[se,[se],function(e,t){return Math.ceil(t[0].evaluate(e))}],"filter-==":[we,[Pe,Te],function(e,t){var r=t[0],a=t[1];return e.properties()[r.value]===a.value}],"filter-id-==":[we,[Te],function(e,t){var r=t[0];return e.id()===r.value}],"filter-type-==":[we,[Pe],function(e,t){var r=t[0];return e.geometryType()===r.value}],"filter-<":[we,[Pe,Te],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l<c}],"filter-id-<":[we,[Te],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a<l}],"filter->":[we,[Pe,Te],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l>c}],"filter-id->":[we,[Te],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a>l}],"filter-<=":[we,[Pe,Te],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l<=c}],"filter-id-<=":[we,[Te],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a<=l}],"filter->=":[we,[Pe,Te],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l>=c}],"filter-id->=":[we,[Te],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a>=l}],"filter-has":[we,[Te],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[we,[],function(e){return e.id()!==null&&e.id()!==void 0}],"filter-type-in":[we,[Et(Pe)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[we,[Et(Te)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[we,[Pe,Et(Te)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[we,[Pe,Et(Te)],function(e,t){var r=t[0],a=t[1];return(function(l,c,h,m){for(;h<=m;){var g=h+m>>1;if(c[g]===l)return!0;c[g]>l?m=g-1:h=g+1}return!1})(e.properties()[r.value],a.value,0,a.value.length-1)}],all:{type:we,overloads:[[[we,we],function(e,t){var r=t[1];return t[0].evaluate(e)&&r.evaluate(e)}],[vo(we),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(!a[r].evaluate(e))return!1;return!0}]]},any:{type:we,overloads:[[[we,we],function(e,t){var r=t[1];return t[0].evaluate(e)||r.evaluate(e)}],[vo(we),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(a[r].evaluate(e))return!0;return!1}]]},"!":[we,[we],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[we,[Pe],function(e,t){var r=e.globals&&e.globals.isSupportedScript;return!r||r(t[0].evaluate(e))}],upcase:[Pe,[Pe],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[Pe,[Pe],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[Pe,vo(Te),function(e,t){return t.map((function(r){return aa(r.evaluate(e))})).join("")}],"resolved-locale":[Pe,[gt],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});var No=function(e,t){this.expression=e,this._warningHistory={},this._evaluator=new bn,this._defaultValue=t?(function(r){return r.type==="color"&&Ua(r.default)?new Tt(0,0,0,0):r.type==="color"?Tt.parse(r.default)||null:r.default===void 0?null:r.default})(t):null,this._enumValues=t&&t.type==="enum"?t.values:null};function pa(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in go}function ja(e,t){var r=new Vn(go,[],t?(function(l){var c={color:Ie,string:Pe,number:se,enum:Pe,boolean:we,formatted:Lt,resolvedImage:pt};return l.type==="array"?Et(c[l.value]||Te,l.length):c[l.type]})(t):void 0),a=r.parse(e,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?Wl(new No(a,t)):_o(r.errors)}No.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=a,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=c,this.expression.evaluate(this._evaluator)},No.prototype.evaluate=function(e,t,r,a,l,c){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=a,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=c||null;try{var h=this.expression.evaluate(this._evaluator);if(h==null||typeof h=="number"&&h!=h)return this._defaultValue;if(this._enumValues&&!(h in this._enumValues))throw new Lr("Expected value to be one of "+Object.keys(this._enumValues).map((function(m){return JSON.stringify(m)})).join(", ")+", but found "+JSON.stringify(h)+" instead.");return h}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console<"u"&&console.warn(m.message)),this._defaultValue}};var ha=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!Fn(t.expression)};ha.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,l,c)},ha.prototype.evaluate=function(e,t,r,a,l,c){return this._styleExpression.evaluate(e,t,r,a,l,c)};var jo=function(e,t,r,a){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!Fn(t.expression),this.interpolationType=a};function Jl(e,t){if((e=ja(e,t)).result==="error")return e;var r=e.value.expression,a=Rn(r);if(!a&&!xo(t))return _o([new de("","data expressions not supported")]);var l=co(r,["zoom"]);if(!l&&!Xl(t))return _o([new de("","zoom expressions not supported")]);var c=(function h(m){var g=null;if(m instanceof Nn)g=h(m.result);else if(m instanceof Un)for(var v=0,x=m.args;v<x.length&&!(g=h(x[v]));v+=1);else(m instanceof mi||m instanceof jr)&&m.input instanceof Nr&&m.input.name==="zoom"&&(g=m);return g instanceof de||m.eachChild((function(b){var E=h(b);E instanceof de?g=E:!g&&E?g=new de("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):g&&E&&g!==E&&(g=new de("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),g})(r);return c||l?c instanceof de?_o([c]):c instanceof jr&&!ca(t)?_o([new de("",'"interpolate" expressions cannot be used with this property')]):Wl(c?new jo(a?"camera":"composite",e.value,c.labels,c instanceof jr?c.interpolation:void 0):new ha(a?"constant":"source",e.value)):_o([new de("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}jo.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,l,c)},jo.prototype.evaluate=function(e,t,r,a,l,c){return this._styleExpression.evaluate(e,t,r,a,l,c)},jo.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?jr.interpolationFactor(this.interpolationType,e,t,r):0};var qo=function(e,t){this._parameters=e,this._specification=t,fe(this,(function r(a,l){var c,h,m,g=l.type==="color",v=a.stops&&typeof a.stops[0][0]=="object",x=v||!(v||a.property!==void 0),b=a.type||(ca(l)?"exponential":"interval");if(g&&((a=fe({},a)).stops&&(a.stops=a.stops.map((function(Ee){return[Ee[0],Tt.parse(Ee[1])]}))),a.default=Tt.parse(a.default?a.default:l.default)),a.colorSpace&&a.colorSpace!=="rgb"&&!Fl[a.colorSpace])throw new Error("Unknown color space: "+a.colorSpace);if(b==="exponential")c=Kl;else if(b==="interval")c=tc;else if(b==="categorical"){c=Hl,h=Object.create(null);for(var E=0,C=a.stops;E<C.length;E+=1){var R=C[E];h[R[0]]=R[1]}m=typeof a.stops[0][0]}else{if(b!=="identity")throw new Error('Unknown function type "'+b+'"');c=Na}if(v){for(var F={},G=[],j=0;j<a.stops.length;j++){var J=a.stops[j],Q=J[0].zoom;F[Q]===void 0&&(F[Q]={zoom:Q,type:a.type,property:a.property,default:a.default,stops:[]},G.push(Q)),F[Q].stops.push([J[0].value,J[1]])}for(var te=[],ie=0,ce=G;ie<ce.length;ie+=1){var ge=ce[ie];te.push([F[ge].zoom,r(F[ge],l)])}var be={name:"linear"};return{kind:"composite",interpolationType:be,interpolationFactor:jr.interpolationFactor.bind(void 0,be),zoomStops:te.map((function(Ee){return Ee[0]})),evaluate:function(Ee,je){var ke=Ee.zoom;return Kl({stops:te,base:a.base},l,ke).evaluate(ke,je)}}}if(x){var Oe=b==="exponential"?{name:"exponential",base:a.base!==void 0?a.base:1}:null;return{kind:"camera",interpolationType:Oe,interpolationFactor:jr.interpolationFactor.bind(void 0,Oe),zoomStops:a.stops.map((function(Ee){return Ee[0]})),evaluate:function(Ee){return c(a,l,Ee.zoom,h,m)}}}return{kind:"source",evaluate:function(Ee,je){var ke=je&&je.properties?je.properties[a.property]:void 0;return ke===void 0?Uo(a.default,l.default):c(a,l,ke,h,m)}}})(this._parameters,this._specification))};function Hi(e){var t=e.key,r=e.value,a=e.valueSpec||{},l=e.objectElementValidators||{},c=e.style,h=e.styleSpec,m=[],g=Ot(r);if(g!=="object")return[new N(t,r,"object expected, "+g+" found")];for(var v in r){var x=v.split(".")[0],b=a[x]||a["*"],E=void 0;if(l[x])E=l[x];else if(a[x])E=vt;else if(l["*"])E=l["*"];else{if(!a["*"]){m.push(new N(t,r[v],'unknown property "'+v+'"'));continue}E=vt}m=m.concat(E({key:(t&&t+".")+v,value:r[v],valueSpec:b,style:c,styleSpec:h,object:r,objectKey:v},r))}for(var C in a)l[C]||a[C].required&&a[C].default===void 0&&r[C]===void 0&&m.push(new N(t,r,'missing required property "'+C+'"'));return m}function Yl(e){var t=e.value,r=e.valueSpec,a=e.style,l=e.styleSpec,c=e.key,h=e.arrayElementValidator||vt;if(Ot(t)!=="array")return[new N(c,t,"array expected, "+Ot(t)+" found")];if(r.length&&t.length!==r.length)return[new N(c,t,"array length "+r.length+" expected, length "+t.length+" found")];if(r["min-length"]&&t.length<r["min-length"])return[new N(c,t,"array length at least "+r["min-length"]+" expected, length "+t.length+" found")];var m={type:r.value,values:r.values};l.$version<7&&(m.function=r.function),Ot(r.value)==="object"&&(m=r.value);for(var g=[],v=0;v<t.length;v++)g=g.concat(h({array:t,arrayIndex:v,value:t[v],valueSpec:m,style:a,styleSpec:l,key:c+"["+v+"]"}));return g}function $l(e){var t=e.key,r=e.value,a=e.valueSpec,l=Ot(r);return l==="number"&&r!=r&&(l="NaN"),l!=="number"?[new N(t,r,"number expected, "+l+" found")]:"minimum"in a&&r<a.minimum?[new N(t,r,r+" is less than the minimum value "+a.minimum)]:"maximum"in a&&r>a.maximum?[new N(t,r,r+" is greater than the maximum value "+a.maximum)]:[]}function Ql(e){var t,r,a,l=e.valueSpec,c=ye(e.value.type),h={},m=c!=="categorical"&&e.value.property===void 0,g=!m,v=Ot(e.value.stops)==="array"&&Ot(e.value.stops[0])==="array"&&Ot(e.value.stops[0][0])==="object",x=Hi({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(C){if(c==="identity")return[new N(C.key,C.value,'identity function may not have a "stops" property')];var R=[],F=C.value;return R=R.concat(Yl({key:C.key,value:F,valueSpec:C.valueSpec,style:C.style,styleSpec:C.styleSpec,arrayElementValidator:b})),Ot(F)==="array"&&F.length===0&&R.push(new N(C.key,F,"array must have at least one stop")),R},default:function(C){return vt({key:C.key,value:C.value,valueSpec:l,style:C.style,styleSpec:C.styleSpec})}}});return c==="identity"&&m&&x.push(new N(e.key,e.value,'missing required property "property"')),c==="identity"||e.value.stops||x.push(new N(e.key,e.value,'missing required property "stops"')),c==="exponential"&&e.valueSpec.expression&&!ca(e.valueSpec)&&x.push(new N(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(g&&!xo(e.valueSpec)?x.push(new N(e.key,e.value,"property functions not supported")):m&&!Xl(e.valueSpec)&&x.push(new N(e.key,e.value,"zoom functions not supported"))),c!=="categorical"&&!v||e.value.property!==void 0||x.push(new N(e.key,e.value,'"property" property is required')),x;function b(C){var R=[],F=C.value,G=C.key;if(Ot(F)!=="array")return[new N(G,F,"array expected, "+Ot(F)+" found")];if(F.length!==2)return[new N(G,F,"array length 2 expected, length "+F.length+" found")];if(v){if(Ot(F[0])!=="object")return[new N(G,F,"object expected, "+Ot(F[0])+" found")];if(F[0].zoom===void 0)return[new N(G,F,"object stop key must have zoom")];if(F[0].value===void 0)return[new N(G,F,"object stop key must have value")];if(a&&a>ye(F[0].zoom))return[new N(G,F[0].zoom,"stop zoom values must appear in ascending order")];ye(F[0].zoom)!==a&&(a=ye(F[0].zoom),r=void 0,h={}),R=R.concat(Hi({key:G+"[0]",value:F[0],valueSpec:{zoom:{}},style:C.style,styleSpec:C.styleSpec,objectElementValidators:{zoom:$l,value:E}}))}else R=R.concat(E({key:G+"[0]",value:F[0],style:C.style,styleSpec:C.styleSpec},F));return pa(ae(F[1]))?R.concat([new N(G+"[1]",F[1],"expressions are not allowed in function stops.")]):R.concat(vt({key:G+"[1]",value:F[1],valueSpec:l,style:C.style,styleSpec:C.styleSpec}))}function E(C,R){var F=Ot(C.value),G=ye(C.value),j=C.value!==null?C.value:R;if(t){if(F!==t)return[new N(C.key,j,F+" stop domain type must match previous stop domain type "+t)]}else t=F;if(F!=="number"&&F!=="string"&&F!=="boolean")return[new N(C.key,j,"stop domain value must be a number, string, or boolean")];if(F!=="number"&&c!=="categorical"){var J="number expected, "+F+" found";return xo(l)&&c===void 0&&(J+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new N(C.key,j,J)]}return c!=="categorical"||F!=="number"||isFinite(G)&&Math.floor(G)===G?c!=="categorical"&&F==="number"&&r!==void 0&&G<r?[new N(C.key,j,"stop domain values must appear in ascending order")]:(r=G,c==="categorical"&&G in h?[new N(C.key,j,"stop domain values must be unique")]:(h[G]=!0,[])):[new N(C.key,j,"integer expected, found "+G)]}}function bo(e){var t=(e.expressionContext==="property"?Jl:ja)(ae(e.value),e.valueSpec);if(t.result==="error")return t.value.map((function(a){return new N(""+e.key+a.key,e.value,a.message)}));var r=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext==="property"&&e.propertyKey==="text-font"&&!r.outputDefined())return[new N(e.key,e.value,'Invalid data expression for "'+e.propertyKey+'". Output values must be contained as literals within the expression.')];if(e.expressionContext==="property"&&e.propertyType==="layout"&&!Fn(r))return[new N(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if(e.expressionContext==="filter"&&!Fn(r))return[new N(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!co(r,["zoom","feature-state"]))return[new N(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(e.expressionContext==="cluster-initial"&&!Rn(r))return[new N(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function fa(e){var t=e.key,r=e.value,a=e.valueSpec,l=[];return Array.isArray(a.values)?a.values.indexOf(ye(r))===-1&&l.push(new N(t,r,"expected one of ["+a.values.join(", ")+"], "+JSON.stringify(r)+" found")):Object.keys(a.values).indexOf(ye(r))===-1&&l.push(new N(t,r,"expected one of ["+Object.keys(a.values).join(", ")+"], "+JSON.stringify(r)+" found")),l}function qa(e){if(e===!0||e===!1)return!0;if(!Array.isArray(e)||e.length===0)return!1;switch(e[0]){case"has":return e.length>=2&&e[1]!=="$id"&&e[1]!=="$type";case"in":return e.length>=3&&(typeof e[1]!="string"||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);t<r.length;t+=1){var a=r[t];if(!qa(a)&&typeof a!="boolean")return!1}return!0;default:return!0}}qo.deserialize=function(e){return new qo(e._parameters,e._specification)},qo.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}};var Ns={type:"boolean",default:!1};function Za(e){if(e==null)return{filter:function(){return!0},needGeometry:!1};qa(e)||(e=Ga(e));var t=ja(e,Ns);if(t.result==="error")throw new Error(t.value.map((function(r){return r.key+": "+r.message})).join(", "));return{filter:function(r,a,l){return t.value.evaluate(r,a,{},l)},needGeometry:(function r(a){if(!Array.isArray(a))return!1;if(a[0]==="within")return!0;for(var l=1;l<a.length;l++)if(r(a[l]))return!0;return!1})(e)}}function rc(e,t){return e<t?-1:e>t?1:0}function Ga(e){if(!e)return!0;var t,r=e[0];return e.length<=1?r!=="any":r==="=="?js(e[1],e[2],"=="):r==="!="?Wa(js(e[1],e[2],"==")):r==="<"||r===">"||r==="<="||r===">="?js(e[1],e[2],r):r==="any"?(t=e.slice(1),["any"].concat(t.map(Ga))):r==="all"?["all"].concat(e.slice(1).map(Ga)):r==="none"?["all"].concat(e.slice(1).map(Ga).map(Wa)):r==="in"?eu(e[1],e.slice(2)):r==="!in"?Wa(eu(e[1],e.slice(2))):r==="has"?tu(e[1]):r==="!has"?Wa(tu(e[1])):r!=="within"||e}function js(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function eu(e,t){if(t.length===0)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(r){return typeof r!=typeof t[0]}))?["filter-in-large",e,["literal",t.sort(rc)]]:["filter-in-small",e,["literal",t]]}}function tu(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Wa(e){return["!",e]}function qs(e){return qa(ae(e.value))?bo(fe({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):(function t(r){var a=r.value,l=r.key;if(Ot(a)!=="array")return[new N(l,a,"array expected, "+Ot(a)+" found")];var c,h=r.styleSpec,m=[];if(a.length<1)return[new N(l,a,"filter array must have at least 1 element")];switch(m=m.concat(fa({key:l+"[0]",value:a[0],valueSpec:h.filter_operator,style:r.style,styleSpec:r.styleSpec})),ye(a[0])){case"<":case"<=":case">":case">=":a.length>=2&&ye(a[1])==="$type"&&m.push(new N(l,a,'"$type" cannot be use with operator "'+a[0]+'"'));case"==":case"!=":a.length!==3&&m.push(new N(l,a,'filter array for operator "'+a[0]+'" must have 3 elements'));case"in":case"!in":a.length>=2&&(c=Ot(a[1]))!=="string"&&m.push(new N(l+"[1]",a[1],"string expected, "+c+" found"));for(var g=2;g<a.length;g++)c=Ot(a[g]),ye(a[1])==="$type"?m=m.concat(fa({key:l+"["+g+"]",value:a[g],valueSpec:h.geometry_type,style:r.style,styleSpec:r.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&m.push(new N(l+"["+g+"]",a[g],"string, number, or boolean expected, "+c+" found"));break;case"any":case"all":case"none":for(var v=1;v<a.length;v++)m=m.concat(t({key:l+"["+v+"]",value:a[v],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":c=Ot(a[1]),a.length!==2?m.push(new N(l,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="string"&&m.push(new N(l+"[1]",a[1],"string expected, "+c+" found"));break;case"within":c=Ot(a[1]),a.length!==2?m.push(new N(l,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="object"&&m.push(new N(l+"[1]",a[1],"object expected, "+c+" found"))}return m})(e)}function Zs(e,t){var r=e.key,a=e.style,l=e.styleSpec,c=e.value,h=e.objectKey,m=l[t+"_"+e.layerType];if(!m)return[];var g=h.match(/^(.*)-transition$/);if(t==="paint"&&g&&m[g[1]]&&m[g[1]].transition)return vt({key:r,value:c,valueSpec:l.transition,style:a,styleSpec:l});var v,x=e.valueSpec||m[h];if(!x)return[new N(r,c,'unknown property "'+h+'"')];if(Ot(c)==="string"&&xo(x)&&!x.tokens&&(v=/^{([^}]+)}$/.exec(c)))return[new N(r,c,'"'+h+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(v[1])+" }`.")];var b=[];return e.layerType==="symbol"&&(h==="text-field"&&a&&!a.glyphs&&b.push(new N(r,c,'use of "text-field" requires a style "glyphs" property')),h==="text-font"&&Ua(ae(c))&&ye(c.type)==="identity"&&b.push(new N(r,c,'"text-font" does not support identity functions'))),b.concat(vt({key:e.key,value:c,valueSpec:x,style:a,styleSpec:l,expressionContext:"property",propertyType:t,propertyKey:h}))}function Gs(e){return Zs(e,"paint")}function da(e){return Zs(e,"layout")}function ru(e){var t=[],r=e.value,a=e.key,l=e.style,c=e.styleSpec;r.type||r.ref||t.push(new N(a,r,'either "type" or "ref" is required'));var h,m=ye(r.type),g=ye(r.ref);if(r.id)for(var v=ye(r.id),x=0;x<e.arrayIndex;x++){var b=l.layers[x];ye(b.id)===v&&t.push(new N(a,r.id,'duplicate layer id "'+r.id+'", previously used at line '+b.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(R){R in r&&t.push(new N(a,r[R],'"'+R+'" is prohibited for ref layers'))})),l.layers.forEach((function(R){ye(R.id)===g&&(h=R)})),h?h.ref?t.push(new N(a,r.ref,"ref cannot reference another ref layer")):m=ye(h.type):t.push(new N(a,r.ref,'ref layer "'+g+'" not found'));else if(m!=="background")if(r.source){var E=l.sources&&l.sources[r.source],C=E&&ye(E.type);E?C==="vector"&&m==="raster"?t.push(new N(a,r.source,'layer "'+r.id+'" requires a raster source')):C==="raster"&&m!=="raster"?t.push(new N(a,r.source,'layer "'+r.id+'" requires a vector source')):C!=="vector"||r["source-layer"]?C==="raster-dem"&&m!=="hillshade"?t.push(new N(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):m!=="line"||!r.paint||!r.paint["line-gradient"]||C==="geojson"&&E.lineMetrics||t.push(new N(a,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new N(a,r,'layer "'+r.id+'" must specify a "source-layer"')):t.push(new N(a,r.source,'source "'+r.source+'" not found'))}else t.push(new N(a,r,'missing required property "source"'));return t=t.concat(Hi({key:a,value:r,valueSpec:c.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return vt({key:a+".type",value:r.type,valueSpec:c.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"})},filter:qs,layout:function(R){return Hi({layer:r,key:R.key,value:R.value,style:R.style,styleSpec:R.styleSpec,objectElementValidators:{"*":function(F){return da(fe({layerType:m},F))}}})},paint:function(R){return Hi({layer:r,key:R.key,value:R.value,style:R.style,styleSpec:R.styleSpec,objectElementValidators:{"*":function(F){return Gs(fe({layerType:m},F))}}})}}}))}function wo(e){var t=e.value,r=e.key,a=Ot(t);return a!=="string"?[new N(r,t,"string expected, "+a+" found")]:[]}var Zt={promoteId:function(e){var t=e.key,r=e.value;if(Ot(r)==="string")return wo({key:t,value:r});var a=[];for(var l in r)a.push.apply(a,wo({key:t+"."+l,value:r[l]}));return a}};function Xa(e){var t=e.value,r=e.key,a=e.styleSpec,l=e.style;if(!t.type)return[new N(r,t,'"type" is required')];var c,h=ye(t.type);switch(h){case"vector":case"raster":case"raster-dem":return Hi({key:r,value:t,valueSpec:a["source_"+h.replace("-","_")],style:e.style,styleSpec:a,objectElementValidators:Zt});case"geojson":if(c=Hi({key:r,value:t,valueSpec:a.source_geojson,style:l,styleSpec:a,objectElementValidators:Zt}),t.cluster)for(var m in t.clusterProperties){var g=t.clusterProperties[m],v=g[0],x=typeof v=="string"?[v,["accumulated"],["get",m]]:v;c.push.apply(c,bo({key:r+"."+m+".map",value:g[1],expressionContext:"cluster-map"})),c.push.apply(c,bo({key:r+"."+m+".reduce",value:x,expressionContext:"cluster-reduce"}))}return c;case"video":return Hi({key:r,value:t,valueSpec:a.source_video,style:l,styleSpec:a});case"image":return Hi({key:r,value:t,valueSpec:a.source_image,style:l,styleSpec:a});case"canvas":return[new N(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return fa({key:r+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function So(e){var t=e.value,r=e.styleSpec,a=r.light,l=e.style,c=[],h=Ot(t);if(t===void 0)return c;if(h!=="object")return c.concat([new N("light",t,"object expected, "+h+" found")]);for(var m in t){var g=m.match(/^(.*)-transition$/);c=c.concat(g&&a[g[1]]&&a[g[1]].transition?vt({key:m,value:t[m],valueSpec:r.transition,style:l,styleSpec:r}):a[m]?vt({key:m,value:t[m],valueSpec:a[m],style:l,styleSpec:r}):[new N(m,t[m],'unknown property "'+m+'"')])}return c}var Gn={"*":function(){return[]},array:Yl,boolean:function(e){var t=e.value,r=e.key,a=Ot(t);return a!=="boolean"?[new N(r,t,"boolean expected, "+a+" found")]:[]},number:$l,color:function(e){var t=e.key,r=e.value,a=Ot(r);return a!=="string"?[new N(t,r,"color expected, "+a+" found")]:yt(r)===null?[new N(t,r,'color expected, "'+r+'" found')]:[]},constants:$,enum:fa,filter:qs,function:Ql,layer:ru,object:Hi,source:Xa,light:So,string:wo,formatted:function(e){return wo(e).length===0?[]:bo(e)},resolvedImage:function(e){return wo(e).length===0?[]:bo(e)}};function vt(e){var t=e.value,r=e.valueSpec,a=e.styleSpec;return r.expression&&Ua(ye(t))?Ql(e):r.expression&&pa(ae(t))?bo(e):r.type&&Gn[r.type]?Gn[r.type](e):Hi(fe({},e,{valueSpec:r.type?a[r.type]:r}))}function Vt(e){var t=e.value,r=e.key,a=wo(e);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new N(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new N(r,t,'"glyphs" url must include a "{range}" token'))),a}function Ci(e,t){t===void 0&&(t=A);var r=[];return r=r.concat(vt({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:Vt,"*":function(){return[]}}})),e.constants&&(r=r.concat($({key:"constants",value:e.constants}))),ma(r)}function ma(e){return[].concat(e).sort((function(t,r){return t.line-r.line}))}function Zo(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return ma(e.apply(this,t))}}Ci.source=Zo(Xa),Ci.light=Zo(So),Ci.layer=Zo(ru),Ci.filter=Zo(qs),Ci.paintProperty=Zo(Gs),Ci.layoutProperty=Zo(da);var ya=Ci,ic=ya.light,nc=ya.paintProperty,ga=ya.layoutProperty;function va(e,t){var r=!1;if(t&&t.length)for(var a=0,l=t;a<l.length;a+=1)e.fire(new W(new Error(l[a].message))),r=!0;return r}var wn=_r;function _r(e,t,r){var a=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var l=new Int32Array(this.arrayBuffer);e=l[0],this.d=(t=l[1])+2*(r=l[2]);for(var c=0;c<this.d*this.d;c++){var h=l[3+c],m=l[3+c+1];a.push(h===m?null:l.subarray(h,m))}var g=l[3+a.length+1];this.keys=l.subarray(l[3+a.length],g),this.bboxes=l.subarray(g),this.insert=this._insertReadonly}else{this.d=t+2*r;for(var v=0;v<this.d*this.d;v++)a.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;var x=r/t*e;this.min=-x,this.max=e+x}_r.prototype.insert=function(e,t,r,a,l){this._forEachCell(t,r,a,l,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(a),this.bboxes.push(l)},_r.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},_r.prototype._insertCell=function(e,t,r,a,l,c){this.cells[l].push(c)},_r.prototype.query=function(e,t,r,a,l){var c=this.min,h=this.max;if(e<=c&&t<=c&&h<=r&&h<=a&&!l)return Array.prototype.slice.call(this.keys);var m=[];return this._forEachCell(e,t,r,a,this._queryCell,m,{},l),m},_r.prototype._queryCell=function(e,t,r,a,l,c,h,m){var g=this.cells[l];if(g!==null)for(var v=this.keys,x=this.bboxes,b=0;b<g.length;b++){var E=g[b];if(h[E]===void 0){var C=4*E;(m?m(x[C+0],x[C+1],x[C+2],x[C+3]):e<=x[C+2]&&t<=x[C+3]&&r>=x[C+0]&&a>=x[C+1])?(h[E]=!0,c.push(v[E])):h[E]=!1}}},_r.prototype._forEachCell=function(e,t,r,a,l,c,h,m){for(var g=this._convertToCellCoord(e),v=this._convertToCellCoord(t),x=this._convertToCellCoord(r),b=this._convertToCellCoord(a),E=g;E<=x;E++)for(var C=v;C<=b;C++){var R=this.d*C+E;if((!m||m(this._convertFromCellCoord(E),this._convertFromCellCoord(C),this._convertFromCellCoord(E+1),this._convertFromCellCoord(C+1)))&&l.call(this,e,t,r,a,R,c,h,m))return}},_r.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},_r.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},_r.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=3+this.cells.length+1+1,r=0,a=0;a<this.cells.length;a++)r+=this.cells[a].length;var l=new Int32Array(t+r+this.keys.length+this.bboxes.length);l[0]=this.extent,l[1]=this.n,l[2]=this.padding;for(var c=t,h=0;h<e.length;h++){var m=e[h];l[3+h]=c,l.set(m,c),c+=m.length}return l[3+e.length]=c,l.set(this.keys,c),l[3+e.length+1]=c+=this.keys.length,l.set(this.bboxes,c),c+=this.bboxes.length,l.buffer};var _a=Ce.ImageData,iu=Ce.ImageBitmap,dr={};function De(e,t,r){r===void 0&&(r={}),Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),dr[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}for(var yi in De("Object",Object),wn.serialize=function(e,t){var r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}},wn.deserialize=function(e){return new wn(e.buffer)},De("Grid",wn),De("Color",Tt),De("Error",Error),De("ResolvedImage",li),De("StylePropertyFunction",qo),De("StyleExpression",No,{omit:["_evaluator"]}),De("ZoomDependentExpression",jo),De("ZoomConstantExpression",ha),De("CompoundExpression",Nr,{omit:["_evaluate"]}),go)go[yi]._classRegistryKey||De("Expression_"+yi,go[yi]);function Ha(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}function Go(e){return iu&&e instanceof iu}function Ki(e,t){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(Ha(e)||Go(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var r=e;return t&&t.push(r.buffer),r}if(e instanceof _a)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){for(var a=[],l=0,c=e;l<c.length;l+=1)a.push(Ki(c[l],t));return a}if(typeof e=="object"){var h=e.constructor,m=h._classRegistryKey;if(!m)throw new Error("can't serialize object of unregistered class");var g=h.serialize?h.serialize(e,t):{};if(!h.serialize){for(var v in e)if(e.hasOwnProperty(v)&&!(dr[m].omit.indexOf(v)>=0)){var x=e[v];g[v]=dr[m].shallow.indexOf(v)>=0?x:Ki(x,t)}e instanceof Error&&(g.message=e.message)}if(g.$name)throw new Error("$name property is reserved for worker serialization logic.");return m!=="Object"&&(g.$name=m),g}throw new Error("can't serialize object of type "+typeof e)}function gi(e){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||Ha(e)||Go(e)||ArrayBuffer.isView(e)||e instanceof _a)return e;if(Array.isArray(e))return e.map(gi);if(typeof e=="object"){var t=e.$name||"Object",r=dr[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var a=Object.create(r.prototype),l=0,c=Object.keys(e);l<c.length;l+=1){var h=c[l];if(h!=="$name"){var m=e[h];a[h]=dr[t].shallow.indexOf(h)>=0?m:gi(m)}}return a}throw new Error("can't deserialize object of type "+typeof e)}var Ws=function(){this.first=!0};Ws.prototype.update=function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))};var Se={"Latin-1 Supplement":function(e){return e>=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function Xs(e){for(var t=0,r=e;t<r.length;t+=1)if(Ka(r[t].charCodeAt(0)))return!0;return!1}function Ka(e){return!(e!==746&&e!==747&&(e<4352||!(Se["Bopomofo Extended"](e)||Se.Bopomofo(e)||Se["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||Se["CJK Compatibility Ideographs"](e)||Se["CJK Compatibility"](e)||Se["CJK Radicals Supplement"](e)||Se["CJK Strokes"](e)||!(!Se["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||e===12336)||Se["CJK Unified Ideographs Extension A"](e)||Se["CJK Unified Ideographs"](e)||Se["Enclosed CJK Letters and Months"](e)||Se["Hangul Compatibility Jamo"](e)||Se["Hangul Jamo Extended-A"](e)||Se["Hangul Jamo Extended-B"](e)||Se["Hangul Jamo"](e)||Se["Hangul Syllables"](e)||Se.Hiragana(e)||Se["Ideographic Description Characters"](e)||Se.Kanbun(e)||Se["Kangxi Radicals"](e)||Se["Katakana Phonetic Extensions"](e)||Se.Katakana(e)&&e!==12540||!(!Se["Halfwidth and Fullwidth Forms"](e)||e===65288||e===65289||e===65293||e>=65306&&e<=65310||e===65339||e===65341||e===65343||e>=65371&&e<=65503||e===65507||e>=65512&&e<=65519)||!(!Se["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||Se["Unified Canadian Aboriginal Syllabics"](e)||Se["Unified Canadian Aboriginal Syllabics Extended"](e)||Se["Vertical Forms"](e)||Se["Yijing Hexagram Symbols"](e)||Se["Yi Syllables"](e)||Se["Yi Radicals"](e))))}function Hs(e){return!(Ka(e)||(function(t){return!!(Se["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||Se["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||Se["Letterlike Symbols"](t)||Se["Number Forms"](t)||Se["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||Se["Control Pictures"](t)&&t!==9251||Se["Optical Character Recognition"](t)||Se["Enclosed Alphanumerics"](t)||Se["Geometric Shapes"](t)||Se["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Se["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Se["CJK Symbols and Punctuation"](t)||Se.Katakana(t)||Se["Private Use Area"](t)||Se["CJK Compatibility Forms"](t)||Se["Small Form Variants"](t)||Se["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)})(e))}function Fi(e){return e>=1424&&e<=2303||Se["Arabic Presentation Forms-A"](e)||Se["Arabic Presentation Forms-B"](e)}function vi(e,t){return!(!t&&Fi(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Se.Khmer(e))}function Ja(e){for(var t=0,r=e;t<r.length;t+=1)if(Fi(r[t].charCodeAt(0)))return!0;return!1}var Ya=null,_i="unavailable",Sn=null,nu=function(e){e&&typeof e=="string"&&e.indexOf("NetworkError")>-1&&(_i="error"),Ya&&Ya(e)};function xa(){Ks.fire(new V("pluginStateChange",{pluginStatus:_i,pluginURL:Sn}))}var Ks=new H,Js=function(){return _i},Ji=function(){if(_i!=="deferred"||!Sn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");_i="loading",xa(),Sn&&ia({url:Sn},(function(e){e?nu(e):(_i="loaded",xa())}))},Pi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return _i==="loaded"||Pi.applyArabicShaping!=null},isLoading:function(){return _i==="loading"},setState:function(e){_i=e.pluginStatus,Sn=e.pluginURL},isParsed:function(){return Pi.applyArabicShaping!=null&&Pi.processBidirectionalText!=null&&Pi.processStyledBidirectionalText!=null},getPluginURL:function(){return Sn}},ht=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ws,this.transition={})};ht.prototype.isSupportedScript=function(e){return(function(t,r){for(var a=0,l=t;a<l.length;a+=1)if(!vi(l[a].charCodeAt(0),r))return!1;return!0})(e,Pi.isLoaded())},ht.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},ht.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}};var un=function(e,t){this.property=e,this.value=t,this.expression=(function(r,a){if(Ua(r))return new qo(r,a);if(pa(r)){var l=Jl(r,a);if(l.result==="error")throw new Error(l.value.map((function(h){return h.key+": "+h.message})).join(", "));return l.value}var c=r;return typeof r=="string"&&a.type==="color"&&(c=Tt.parse(r)),{kind:"constant",evaluate:function(){return c}}})(t===void 0?e.specification.default:t,e.specification)};un.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},un.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var Oi=function(e){this.property=e,this.value=new un(e,void 0)};Oi.prototype.transitioned=function(e,t){return new Io(this.property,this.value,t,Sr({},e.transition,this.transition),e.now)},Oi.prototype.untransitioned=function(){return new Io(this.property,this.value,null,{},0)};var qr=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};qr.prototype.getValue=function(e){return Si(this._values[e].value.value)},qr.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Oi(this._values[e].property)),this._values[e].value=new un(this._values[e].property,t===null?void 0:Si(t))},qr.prototype.getTransition=function(e){return Si(this._values[e].transition)},qr.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Oi(this._values[e].property)),this._values[e].transition=Si(t)||void 0},qr.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],l=this.getValue(a);l!==void 0&&(e[a]=l);var c=this.getTransition(a);c!==void 0&&(e[a+"-transition"]=c)}return e},qr.prototype.transitioned=function(e,t){for(var r=new Wn(this._properties),a=0,l=Object.keys(this._values);a<l.length;a+=1){var c=l[a];r._values[c]=this._values[c].transitioned(e,t._values[c])}return r},qr.prototype.untransitioned=function(){for(var e=new Wn(this._properties),t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t];e._values[a]=this._values[a].untransitioned()}return e};var Io=function(e,t,r,a,l){this.property=e,this.value=t,this.begin=l+a.delay||0,this.end=this.begin+a.duration||0,e.specification.transition&&(a.delay||a.duration)&&(this.prior=r)};Io.prototype.possiblyEvaluate=function(e,t,r){var a=e.now||0,l=this.value.possiblyEvaluate(e,t,r),c=this.prior;if(c){if(a>this.end)return this.prior=null,l;if(this.value.isDataDriven())return this.prior=null,l;if(a<this.begin)return c.possiblyEvaluate(e,t,r);var h=(a-this.begin)/(this.end-this.begin);return this.property.interpolate(c.possiblyEvaluate(e,t,r),l,(function(m){if(m<=0)return 0;if(m>=1)return 1;var g=m*m,v=g*m;return 4*(m<.5?v:3*(m-g)+v-.75)})(h))}return l};var Wn=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};Wn.prototype.possiblyEvaluate=function(e,t,r){for(var a=new ba(this._properties),l=0,c=Object.keys(this._values);l<c.length;l+=1){var h=c[l];a._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return a},Wn.prototype.hasTransition=function(){for(var e=0,t=Object.keys(this._values);e<t.length;e+=1)if(this._values[t[e]].prior)return!0;return!1};var Yi=function(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)};Yi.prototype.getValue=function(e){return Si(this._values[e].value)},Yi.prototype.setValue=function(e,t){this._values[e]=new un(this._values[e].property,t===null?void 0:Si(t))},Yi.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],l=this.getValue(a);l!==void 0&&(e[a]=l)}return e},Yi.prototype.possiblyEvaluate=function(e,t,r){for(var a=new ba(this._properties),l=0,c=Object.keys(this._values);l<c.length;l+=1){var h=c[l];a._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return a};var Qr=function(e,t,r){this.property=e,this.value=t,this.parameters=r};Qr.prototype.isConstant=function(){return this.value.kind==="constant"},Qr.prototype.constantOr=function(e){return this.value.kind==="constant"?this.value.value:e},Qr.prototype.evaluate=function(e,t,r,a){return this.property.evaluate(this.value,this.parameters,e,t,r,a)};var ba=function(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)};ba.prototype.get=function(e){return this._values[e]};var Ue=function(e){this.specification=e};Ue.prototype.possiblyEvaluate=function(e,t){return e.expression.evaluate(t)},Ue.prototype.interpolate=function(e,t,r){var a=Vo[this.specification.type];return a?a(e,t,r):e};var Re=function(e,t){this.specification=e,this.overrides=t};Re.prototype.possiblyEvaluate=function(e,t,r,a){return new Qr(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(t,null,{},r,a)}:e.expression,t)},Re.prototype.interpolate=function(e,t,r){if(e.value.kind!=="constant"||t.value.kind!=="constant")return e;if(e.value.value===void 0||t.value.value===void 0)return new Qr(this,{kind:"constant",value:void 0},e.parameters);var a=Vo[this.specification.type];return a?new Qr(this,{kind:"constant",value:a(e.value.value,t.value.value,r)},e.parameters):e},Re.prototype.evaluate=function(e,t,r,a,l,c){return e.kind==="constant"?e.value:e.evaluate(t,r,a,l,c)};var $a=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a,l,c){if(r.value===void 0)return new Qr(this,{kind:"constant",value:void 0},a);if(r.expression.kind==="constant"){var h=r.expression.evaluate(a,null,{},l,c),m=r.property.specification.type==="resolvedImage"&&typeof h!="string"?h.name:h,g=this._calculate(m,m,m,a);return new Qr(this,{kind:"constant",value:g},a)}if(r.expression.kind==="camera"){var v=this._calculate(r.expression.evaluate({zoom:a.zoom-1}),r.expression.evaluate({zoom:a.zoom}),r.expression.evaluate({zoom:a.zoom+1}),a);return new Qr(this,{kind:"constant",value:v},a)}return new Qr(this,r.expression,a)},t.prototype.evaluate=function(r,a,l,c,h,m){if(r.kind==="source"){var g=r.evaluate(a,l,c,h,m);return this._calculate(g,g,g,a)}return r.kind==="composite"?this._calculate(r.evaluate({zoom:Math.floor(a.zoom)-1},l,c),r.evaluate({zoom:Math.floor(a.zoom)},l,c),r.evaluate({zoom:Math.floor(a.zoom)+1},l,c),a):r.value},t.prototype._calculate=function(r,a,l,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:r,to:a}:{from:l,to:a}},t.prototype.interpolate=function(r){return r},t})(Re),ei=function(e){this.specification=e};ei.prototype.possiblyEvaluate=function(e,t,r,a){if(e.value!==void 0){if(e.expression.kind==="constant"){var l=e.expression.evaluate(t,null,{},r,a);return this._calculate(l,l,l,t)}return this._calculate(e.expression.evaluate(new ht(Math.floor(t.zoom-1),t)),e.expression.evaluate(new ht(Math.floor(t.zoom),t)),e.expression.evaluate(new ht(Math.floor(t.zoom+1),t)),t)}},ei.prototype._calculate=function(e,t,r,a){return a.zoom>a.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},ei.prototype.interpolate=function(e){return e};var $i=function(e){this.specification=e};$i.prototype.possiblyEvaluate=function(e,t,r,a){return!!e.expression.evaluate(t,null,{},r,a)},$i.prototype.interpolate=function(){return!1};var Zr=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var a=this.defaultPropertyValues[t]=new un(r,void 0),l=this.defaultTransitionablePropertyValues[t]=new Oi(r);this.defaultTransitioningPropertyValues[t]=l.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=a.possiblyEvaluate({})}};De("DataDrivenProperty",Re),De("DataConstantProperty",Ue),De("CrossFadedDataDrivenProperty",$a),De("CrossFadedProperty",ei),De("ColorRampProperty",$i);var cn=(function(e){function t(r,a){if(e.call(this),this.id=r.id,this.type=r.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},r.type!=="custom"&&(this.metadata=(r=r).metadata,this.minzoom=r.minzoom,this.maxzoom=r.maxzoom,r.type!=="background"&&(this.source=r.source,this.sourceLayer=r["source-layer"],this.filter=r.filter),a.layout&&(this._unevaluatedLayout=new Yi(a.layout)),a.paint)){for(var l in this._transitionablePaint=new qr(a.paint),r.paint)this.setPaintProperty(l,r.paint[l],{validate:!1});for(var c in r.layout)this.setLayoutProperty(c,r.layout[c],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ba(a.paint)}}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(r){return r==="visibility"?this.visibility:this._unevaluatedLayout.getValue(r)},t.prototype.setLayoutProperty=function(r,a,l){l===void 0&&(l={}),a!=null&&this._validate(ga,"layers."+this.id+".layout."+r,r,a,l)||(r!=="visibility"?this._unevaluatedLayout.setValue(r,a):this.visibility=a)},t.prototype.getPaintProperty=function(r){return fi(r,"-transition")?this._transitionablePaint.getTransition(r.slice(0,-11)):this._transitionablePaint.getValue(r)},t.prototype.setPaintProperty=function(r,a,l){if(l===void 0&&(l={}),a!=null&&this._validate(nc,"layers."+this.id+".paint."+r,r,a,l))return!1;if(fi(r,"-transition"))return this._transitionablePaint.setTransition(r.slice(0,-11),a||void 0),!1;var c=this._transitionablePaint._values[r],h=c.property.specification["property-type"]==="cross-faded-data-driven",m=c.value.isDataDriven(),g=c.value;this._transitionablePaint.setValue(r,a),this._handleSpecialPaintPropertyUpdate(r);var v=this._transitionablePaint._values[r].value;return v.isDataDriven()||m||h||this._handleOverridablePaintPropertyUpdate(r,g,v)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,l){return!1},t.prototype.isHidden=function(r){return!!(this.minzoom&&r<this.minzoom)||!!(this.maxzoom&&r>=this.maxzoom)||this.visibility==="none"},t.prototype.updateTransitions=function(r){this._transitioningPaint=this._transitionablePaint.transitioned(r,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(r,a){r.getCrossfadeParameters&&(this._crossfadeParameters=r.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(r,void 0,a)),this.paint=this._transitioningPaint.possiblyEvaluate(r,void 0,a)},t.prototype.serialize=function(){var r={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&&(r.layout=r.layout||{},r.layout.visibility=this.visibility),Gi(r,(function(a,l){return!(a===void 0||l==="layout"&&!Object.keys(a).length||l==="paint"&&!Object.keys(a).length)}))},t.prototype._validate=function(r,a,l,c,h){return h===void 0&&(h={}),(!h||h.validate!==!1)&&va(this,r.call(ya,{key:a,layerType:this.type,objectKey:l,value:c,styleSpec:A,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var r in this.paint._values){var a=this.paint.get(r);if(a instanceof Qr&&xo(a.property.specification)&&(a.value.kind==="source"||a.value.kind==="composite")&&a.value.isStateDependent)return!0}return!1},t})(H),Ys={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Qa=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},At=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Br(e,t){t===void 0&&(t=1);var r=0,a=0;return{members:e.map((function(l){var c=Ys[l.type].BYTES_PER_ELEMENT,h=r=ou(r,Math.max(t,c)),m=l.components||1;return a=Math.max(a,c),r+=c*m,{name:l.name,type:l.type,components:m,offset:h}})),size:ou(r,Math.max(a,t)),alignment:t}}function ou(e,t){return Math.ceil(e/t)*t}At.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},At.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},At.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},At.prototype.clear=function(){this.length=0},At.prototype.resize=function(e){this.reserve(e),this.length=e},At.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},At.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Eo=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.int16[c+0]=a,this.int16[c+1]=l,r},t})(At);Eo.prototype.bytesPerElement=4,De("StructArrayLayout2i4",Eo);var $s=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=4*r;return this.int16[m+0]=a,this.int16[m+1]=l,this.int16[m+2]=c,this.int16[m+3]=h,r},t})(At);$s.prototype.bytesPerElement=8,De("StructArrayLayout4i8",$s);var In=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var v=6*r;return this.int16[v+0]=a,this.int16[v+1]=l,this.int16[v+2]=c,this.int16[v+3]=h,this.int16[v+4]=m,this.int16[v+5]=g,r},t})(At);In.prototype.bytesPerElement=12,De("StructArrayLayout2i4i12",In);var xi=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var v=4*r,x=8*r;return this.int16[v+0]=a,this.int16[v+1]=l,this.uint8[x+4]=c,this.uint8[x+5]=h,this.uint8[x+6]=m,this.uint8[x+7]=g,r},t})(At);xi.prototype.bytesPerElement=8,De("StructArrayLayout2i4ub8",xi);var Wo=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.float32[c+0]=a,this.float32[c+1]=l,r},t})(At);Wo.prototype.bytesPerElement=8,De("StructArrayLayout2f8",Wo);var pn=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,v,x,b){var E=this.length;return this.resize(E+1),this.emplace(E,r,a,l,c,h,m,g,v,x,b)},t.prototype.emplace=function(r,a,l,c,h,m,g,v,x,b,E){var C=10*r;return this.uint16[C+0]=a,this.uint16[C+1]=l,this.uint16[C+2]=c,this.uint16[C+3]=h,this.uint16[C+4]=m,this.uint16[C+5]=g,this.uint16[C+6]=v,this.uint16[C+7]=x,this.uint16[C+8]=b,this.uint16[C+9]=E,r},t})(At);pn.prototype.bytesPerElement=20,De("StructArrayLayout10ui20",pn);var es=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,v,x,b,E,C){var R=this.length;return this.resize(R+1),this.emplace(R,r,a,l,c,h,m,g,v,x,b,E,C)},t.prototype.emplace=function(r,a,l,c,h,m,g,v,x,b,E,C,R){var F=12*r;return this.int16[F+0]=a,this.int16[F+1]=l,this.int16[F+2]=c,this.int16[F+3]=h,this.uint16[F+4]=m,this.uint16[F+5]=g,this.uint16[F+6]=v,this.uint16[F+7]=x,this.int16[F+8]=b,this.int16[F+9]=E,this.int16[F+10]=C,this.int16[F+11]=R,r},t})(At);es.prototype.bytesPerElement=24,De("StructArrayLayout4i4ui4i24",es);var Xo=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.float32[h+0]=a,this.float32[h+1]=l,this.float32[h+2]=c,r},t})(At);Xo.prototype.bytesPerElement=12,De("StructArrayLayout3f12",Xo);var wa=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint32[1*r+0]=a,r},t})(At);wa.prototype.bytesPerElement=4,De("StructArrayLayout1ul4",wa);var Qs=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.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)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,v,x){var b=this.length;return this.resize(b+1),this.emplace(b,r,a,l,c,h,m,g,v,x)},t.prototype.emplace=function(r,a,l,c,h,m,g,v,x,b){var E=10*r,C=5*r;return this.int16[E+0]=a,this.int16[E+1]=l,this.int16[E+2]=c,this.int16[E+3]=h,this.int16[E+4]=m,this.int16[E+5]=g,this.uint32[C+3]=v,this.uint16[E+8]=x,this.uint16[E+9]=b,r},t})(At);Qs.prototype.bytesPerElement=20,De("StructArrayLayout6i1ul2ui20",Qs);var Ho=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var v=6*r;return this.int16[v+0]=a,this.int16[v+1]=l,this.int16[v+2]=c,this.int16[v+3]=h,this.int16[v+4]=m,this.int16[v+5]=g,r},t})(At);Ho.prototype.bytesPerElement=12,De("StructArrayLayout2i2i2i12",Ho);var To=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h){var m=this.length;return this.resize(m+1),this.emplace(m,r,a,l,c,h)},t.prototype.emplace=function(r,a,l,c,h,m){var g=4*r,v=8*r;return this.float32[g+0]=a,this.float32[g+1]=l,this.float32[g+2]=c,this.int16[v+6]=h,this.int16[v+7]=m,r},t})(At);To.prototype.bytesPerElement=16,De("StructArrayLayout2f1f2i16",To);var el=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=12*r,g=3*r;return this.uint8[m+0]=a,this.uint8[m+1]=l,this.float32[g+1]=c,this.float32[g+2]=h,r},t})(At);el.prototype.bytesPerElement=12,De("StructArrayLayout2ub2f12",el);var Xn=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.uint16[h+0]=a,this.uint16[h+1]=l,this.uint16[h+2]=c,r},t})(At);Xn.prototype.bytesPerElement=6,De("StructArrayLayout3ui6",Xn);var Hn=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.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)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,v,x,b,E,C,R,F,G,j,J){var Q=this.length;return this.resize(Q+1),this.emplace(Q,r,a,l,c,h,m,g,v,x,b,E,C,R,F,G,j,J)},t.prototype.emplace=function(r,a,l,c,h,m,g,v,x,b,E,C,R,F,G,j,J,Q){var te=24*r,ie=12*r,ce=48*r;return this.int16[te+0]=a,this.int16[te+1]=l,this.uint16[te+2]=c,this.uint16[te+3]=h,this.uint32[ie+2]=m,this.uint32[ie+3]=g,this.uint32[ie+4]=v,this.uint16[te+10]=x,this.uint16[te+11]=b,this.uint16[te+12]=E,this.float32[ie+7]=C,this.float32[ie+8]=R,this.uint8[ce+36]=F,this.uint8[ce+37]=G,this.uint8[ce+38]=j,this.uint32[ie+10]=J,this.int16[te+22]=Q,r},t})(At);Hn.prototype.bytesPerElement=48,De("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Hn);var ts=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.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)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,v,x,b,E,C,R,F,G,j,J,Q,te,ie,ce,ge,be,Oe,Ee,je,ke,st){var Je=this.length;return this.resize(Je+1),this.emplace(Je,r,a,l,c,h,m,g,v,x,b,E,C,R,F,G,j,J,Q,te,ie,ce,ge,be,Oe,Ee,je,ke,st)},t.prototype.emplace=function(r,a,l,c,h,m,g,v,x,b,E,C,R,F,G,j,J,Q,te,ie,ce,ge,be,Oe,Ee,je,ke,st,Je){var Fe=34*r,ct=17*r;return this.int16[Fe+0]=a,this.int16[Fe+1]=l,this.int16[Fe+2]=c,this.int16[Fe+3]=h,this.int16[Fe+4]=m,this.int16[Fe+5]=g,this.int16[Fe+6]=v,this.int16[Fe+7]=x,this.uint16[Fe+8]=b,this.uint16[Fe+9]=E,this.uint16[Fe+10]=C,this.uint16[Fe+11]=R,this.uint16[Fe+12]=F,this.uint16[Fe+13]=G,this.uint16[Fe+14]=j,this.uint16[Fe+15]=J,this.uint16[Fe+16]=Q,this.uint16[Fe+17]=te,this.uint16[Fe+18]=ie,this.uint16[Fe+19]=ce,this.uint16[Fe+20]=ge,this.uint16[Fe+21]=be,this.uint16[Fe+22]=Oe,this.uint32[ct+12]=Ee,this.float32[ct+13]=je,this.float32[ct+14]=ke,this.float32[ct+15]=st,this.float32[ct+16]=Je,r},t})(At);ts.prototype.bytesPerElement=68,De("StructArrayLayout8i15ui1ul4f68",ts);var Kn=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.float32[1*r+0]=a,r},t})(At);Kn.prototype.bytesPerElement=4,De("StructArrayLayout1f4",Kn);var Vi=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.int16[h+0]=a,this.int16[h+1]=l,this.int16[h+2]=c,r},t})(At);Vi.prototype.bytesPerElement=6,De("StructArrayLayout3i6",Vi);var tl=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=4*r;return this.uint32[2*r+0]=a,this.uint16[h+2]=l,this.uint16[h+3]=c,r},t})(At);tl.prototype.bytesPerElement=8,De("StructArrayLayout1ul2ui8",tl);var Sa=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.uint16[c+0]=a,this.uint16[c+1]=l,r},t})(At);Sa.prototype.bytesPerElement=4,De("StructArrayLayout2ui4",Sa);var rl=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint16[1*r+0]=a,r},t})(At);rl.prototype.bytesPerElement=2,De("StructArrayLayout1ui2",rl);var rs=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=4*r;return this.float32[m+0]=a,this.float32[m+1]=l,this.float32[m+2]=c,this.float32[m+3]=h,r},t})(At);rs.prototype.bytesPerElement=16,De("StructArrayLayout4f16",rs);var i=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={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 r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new Ze(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t})(Qa);i.prototype.size=20;var o=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new i(this,r)},t})(Qs);De("CollisionBoxArray",o);var n=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={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 r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(a){this._structArray.uint8[this._pos1+37]=a},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(a){this._structArray.uint8[this._pos1+38]=a},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+10]=a},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t})(Qa);n.prototype.size=48;var s=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new n(this,r)},t})(Hn);De("PlacedSymbolArray",s);var p=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={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 r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+12]=a},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t})(Qa);p.prototype.size=68;var f=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new p(this,r)},t})(ts);De("SymbolInstanceArray",f);var d=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getoffsetX=function(r){return this.float32[1*r+0]},t})(Kn);De("GlyphOffsetArray",d);var y=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getx=function(r){return this.int16[3*r+0]},t.prototype.gety=function(r){return this.int16[3*r+1]},t.prototype.gettileUnitDistanceFromAnchor=function(r){return this.int16[3*r+2]},t})(Vi);De("SymbolLineVertexArray",y);var _=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,r),t})(Qa);_.prototype.size=8;var S=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new _(this,r)},t})(tl);De("FeatureIndexArray",S);var P=Br([{name:"a_pos",components:2,type:"Int16"}],4).members,z=function(e){e===void 0&&(e=[]),this.segments=e};function M(e,t){return 256*(e=gr(Math.floor(e),0,255))+gr(Math.floor(t),0,255)}z.prototype.prepareSegment=function(e,t,r,a){var l=this.segments[this.segments.length-1];return e>z.MAX_VERTEX_ARRAY_LENGTH&&Ht("Max vertices per segment is "+z.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!l||l.vertexLength+e>z.MAX_VERTEX_ARRAY_LENGTH||l.sortKey!==a)&&(l={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},a!==void 0&&(l.sortKey=a),this.segments.push(l)),l},z.prototype.get=function(){return this.segments},z.prototype.destroy=function(){for(var e=0,t=this.segments;e<t.length;e+=1){var r=t[e];for(var a in r.vaos)r.vaos[a].destroy()}},z.simpleSegment=function(e,t,r,a){return new z([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:a,vaos:{},sortKey:0}])},z.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,De("SegmentVector",z);var U=Br([{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"}]),O=ot((function(e){e.exports=function(t,r){var a,l,c,h,m,g,v,x;for(l=t.length-(a=3&t.length),c=r,m=3432918353,g=461845907,x=0;x<l;)v=255&t.charCodeAt(x)|(255&t.charCodeAt(++x))<<8|(255&t.charCodeAt(++x))<<16|(255&t.charCodeAt(++x))<<24,++x,c=27492+(65535&(h=5*(65535&(c=(c^=v=(65535&(v=(v=(65535&v)*m+(((v>>>16)*m&65535)<<16)&4294967295)<<15|v>>>17))*g+(((v>>>16)*g&65535)<<16)&4294967295)<<13|c>>>19))+((5*(c>>>16)&65535)<<16)&4294967295))+((58964+(h>>>16)&65535)<<16);switch(v=0,a){case 3:v^=(255&t.charCodeAt(x+2))<<16;case 2:v^=(255&t.charCodeAt(x+1))<<8;case 1:c^=v=(65535&(v=(v=(65535&(v^=255&t.charCodeAt(x)))*m+(((v>>>16)*m&65535)<<16)&4294967295)<<15|v>>>17))*g+(((v>>>16)*g&65535)<<16)&4294967295}return c^=t.length,c=2246822507*(65535&(c^=c>>>16))+((2246822507*(c>>>16)&65535)<<16)&4294967295,c=3266489909*(65535&(c^=c>>>13))+((3266489909*(c>>>16)&65535)<<16)&4294967295,(c^=c>>>16)>>>0}})),Z=ot((function(e){e.exports=function(t,r){for(var a,l=t.length,c=r^l,h=0;l>=4;)a=1540483477*(65535&(a=255&t.charCodeAt(h)|(255&t.charCodeAt(++h))<<8|(255&t.charCodeAt(++h))<<16|(255&t.charCodeAt(++h))<<24))+((1540483477*(a>>>16)&65535)<<16),c=1540483477*(65535&c)+((1540483477*(c>>>16)&65535)<<16)^(a=1540483477*(65535&(a^=a>>>24))+((1540483477*(a>>>16)&65535)<<16)),l-=4,++h;switch(l){case 3:c^=(255&t.charCodeAt(h+2))<<16;case 2:c^=(255&t.charCodeAt(h+1))<<8;case 1:c=1540483477*(65535&(c^=255&t.charCodeAt(h)))+((1540483477*(c>>>16)&65535)<<16)}return c=1540483477*(65535&(c^=c>>>13))+((1540483477*(c>>>16)&65535)<<16),(c^=c>>>15)>>>0}})),B=O,q=Z;B.murmur3=O,B.murmur2=q;var X=function(){this.ids=[],this.positions=[],this.indexed=!1};X.prototype.add=function(e,t,r,a){this.ids.push(ne(e)),this.positions.push(t,r,a)},X.prototype.getPositions=function(e){for(var t=ne(e),r=0,a=this.ids.length-1;r<a;){var l=r+a>>1;this.ids[l]>=t?a=l:r=l+1}for(var c=[];this.ids[r]===t;)c.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return c},X.serialize=function(e,t){var r=new Float64Array(e.ids),a=new Uint32Array(e.positions);return(function l(c,h,m,g){for(;m<g;){for(var v=c[m+g>>1],x=m-1,b=g+1;;){do x++;while(c[x]<v);do b--;while(c[b]>v);if(x>=b)break;re(c,x,b),re(h,3*x,3*b),re(h,3*x+1,3*b+1),re(h,3*x+2,3*b+2)}b-m<g-b?(l(c,h,m,b),m=b+1):(l(c,h,b+1,g),g=b)}})(r,a,0,r.length-1),t&&t.push(r.buffer,a.buffer),{ids:r,positions:a}},X.deserialize=function(e){var t=new X;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var Y=Math.pow(2,53)-1;function ne(e){var t=+e;return!isNaN(t)&&t<=Y?t:B(String(e))}function re(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}De("FeaturePositionMap",X);var oe=function(e,t){this.gl=e.gl,this.location=t},he=(function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))},t})(oe),xe=(function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r))},t})(oe),ve=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1]))},t})(oe),Ae=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2]))},t})(oe),Ne=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3]))},t})(oe),He=(function(e){function t(r,a){e.call(this,r,a),this.current=Tt.transparent}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a))},t})(oe),Xe=new Float32Array(16),bt=(function(e){function t(r,a){e.call(this,r,a),this.current=Xe}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(var a=1;a<16;a++)if(r[a]!==this.current[a]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}},t})(oe);function ze(e){return[M(255*e.r,255*e.g),M(255*e.b,255*e.a)]}var tt=function(e,t,r){this.value=e,this.uniformNames=t.map((function(a){return"u_"+a})),this.type=r};tt.prototype.setUniform=function(e,t,r){e.set(r.constantOr(this.value))},tt.prototype.getBinding=function(e,t,r){return this.type==="color"?new He(e,t):new xe(e,t)};var at=function(e,t){this.uniformNames=t.map((function(r){return"u_"+r})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};at.prototype.setConstantPatternPositions=function(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr},at.prototype.setUniform=function(e,t,r,a){var l=a==="u_pattern_to"?this.patternTo:a==="u_pattern_from"?this.patternFrom:a==="u_pixel_ratio_to"?this.pixelRatioTo:a==="u_pixel_ratio_from"?this.pixelRatioFrom:null;l&&e.set(l)},at.prototype.getBinding=function(e,t,r){return r.substr(0,9)==="u_pattern"?new Ne(e,t):new xe(e,t)};var Qe=function(e,t,r,a){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((function(l){return{name:"a_"+l,type:"Float32",components:r==="color"?2:1,offset:0}})),this.paintVertexArray=new a};Qe.prototype.populatePaintArray=function(e,t,r,a,l){var c=this.paintVertexArray.length,h=this.expression.evaluate(new ht(0),t,{},a,[],l);this.paintVertexArray.resize(e),this._setPaintValue(c,e,h)},Qe.prototype.updatePaintArray=function(e,t,r,a){var l=this.expression.evaluate({zoom:0},r,a);this._setPaintValue(e,t,l)},Qe.prototype._setPaintValue=function(e,t,r){if(this.type==="color")for(var a=ze(r),l=e;l<t;l++)this.paintVertexArray.emplace(l,a[0],a[1]);else{for(var c=e;c<t;c++)this.paintVertexArray.emplace(c,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},Qe.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Qe.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var $e=function(e,t,r,a,l,c){this.expression=e,this.uniformNames=t.map((function(h){return"u_"+h+"_t"})),this.type=r,this.useIntegerZoom=a,this.zoom=l,this.maxValue=0,this.paintVertexAttributes=t.map((function(h){return{name:"a_"+h,type:"Float32",components:r==="color"?4:2,offset:0}})),this.paintVertexArray=new c};$e.prototype.populatePaintArray=function(e,t,r,a,l){var c=this.expression.evaluate(new ht(this.zoom),t,{},a,[],l),h=this.expression.evaluate(new ht(this.zoom+1),t,{},a,[],l),m=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(m,e,c,h)},$e.prototype.updatePaintArray=function(e,t,r,a){var l=this.expression.evaluate({zoom:this.zoom},r,a),c=this.expression.evaluate({zoom:this.zoom+1},r,a);this._setPaintValue(e,t,l,c)},$e.prototype._setPaintValue=function(e,t,r,a){if(this.type==="color")for(var l=ze(r),c=ze(a),h=e;h<t;h++)this.paintVertexArray.emplace(h,l[0],l[1],c[0],c[1]);else{for(var m=e;m<t;m++)this.paintVertexArray.emplace(m,r,a);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(a))}},$e.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},$e.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},$e.prototype.setUniform=function(e,t){var r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,a=gr(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(a)},$e.prototype.getBinding=function(e,t,r){return new xe(e,t)};var nt=function(e,t,r,a,l,c){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=a,this.layerId=c,this.zoomInPaintVertexArray=new l,this.zoomOutPaintVertexArray=new l};nt.prototype.populatePaintArray=function(e,t,r){var a=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(a,e,t.patterns&&t.patterns[this.layerId],r)},nt.prototype.updatePaintArray=function(e,t,r,a,l){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],l)},nt.prototype._setPaintValues=function(e,t,r,a){if(a&&r){var l=a[r.min],c=a[r.mid],h=a[r.max];if(l&&c&&h)for(var m=e;m<t;m++)this.zoomInPaintVertexArray.emplace(m,c.tl[0],c.tl[1],c.br[0],c.br[1],l.tl[0],l.tl[1],l.br[0],l.br[1],c.pixelRatio,l.pixelRatio),this.zoomOutPaintVertexArray.emplace(m,c.tl[0],c.tl[1],c.br[0],c.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1],c.pixelRatio,h.pixelRatio)}},nt.prototype.upload=function(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,U.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,U.members,this.expression.isStateDependent))},nt.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Ye=function(e,t,r){this.binders={},this._buffers=[];var a=[];for(var l in e.paint._values)if(r(l)){var c=e.paint.get(l);if(c instanceof Qr&&xo(c.property.specification)){var h=kr(l,e.type),m=c.value,g=c.property.specification.type,v=c.property.useIntegerZoom,x=c.property.specification["property-type"],b=x==="cross-faded"||x==="cross-faded-data-driven";if(m.kind==="constant")this.binders[l]=b?new at(m.value,h):new tt(m.value,h,g),a.push("/u_"+l);else if(m.kind==="source"||b){var E=Qt(l,g,"source");this.binders[l]=b?new nt(m,g,v,t,E,e.id):new Qe(m,h,g,E),a.push("/a_"+l)}else{var C=Qt(l,g,"composite");this.binders[l]=new $e(m,h,g,v,t,C),a.push("/z_"+l)}}}this.cacheKey=a.sort().join("")};Ye.prototype.getMaxValue=function(e){var t=this.binders[e];return t instanceof Qe||t instanceof $e?t.maxValue:0},Ye.prototype.populatePaintArrays=function(e,t,r,a,l){for(var c in this.binders){var h=this.binders[c];(h instanceof Qe||h instanceof $e||h instanceof nt)&&h.populatePaintArray(e,t,r,a,l)}},Ye.prototype.setConstantPatternPositions=function(e,t){for(var r in this.binders){var a=this.binders[r];a instanceof at&&a.setConstantPatternPositions(e,t)}},Ye.prototype.updatePaintArrays=function(e,t,r,a,l){var c=!1;for(var h in e)for(var m=0,g=t.getPositions(h);m<g.length;m+=1){var v=g[m],x=r.feature(v.index);for(var b in this.binders){var E=this.binders[b];if((E instanceof Qe||E instanceof $e||E instanceof nt)&&E.expression.isStateDependent===!0){var C=a.paint.get(b);E.expression=C.value,E.updatePaintArray(v.start,v.end,x,e[h],l),c=!0}}}return c},Ye.prototype.defines=function(){var e=[];for(var t in this.binders){var r=this.binders[t];(r instanceof tt||r instanceof at)&&e.push.apply(e,r.uniformNames.map((function(a){return"#define HAS_UNIFORM_"+a})))}return e},Ye.prototype.getBinderAttributes=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof Qe||r instanceof $e)for(var a=0;a<r.paintVertexAttributes.length;a++)e.push(r.paintVertexAttributes[a].name);else if(r instanceof nt)for(var l=0;l<U.members.length;l++)e.push(U.members[l].name)}return e},Ye.prototype.getBinderUniforms=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof tt||r instanceof at||r instanceof $e)for(var a=0,l=r.uniformNames;a<l.length;a+=1)e.push(l[a])}return e},Ye.prototype.getPaintVertexBuffers=function(){return this._buffers},Ye.prototype.getUniforms=function(e,t){var r=[];for(var a in this.binders){var l=this.binders[a];if(l instanceof tt||l instanceof at||l instanceof $e)for(var c=0,h=l.uniformNames;c<h.length;c+=1){var m=h[c];if(t[m]){var g=l.getBinding(e,t[m],m);r.push({name:m,property:a,binding:g})}}}return r},Ye.prototype.setUniforms=function(e,t,r,a){for(var l=0,c=t;l<c.length;l+=1){var h=c[l],m=h.name,g=h.property;this.binders[g].setUniform(h.binding,a,r.get(g),m)}},Ye.prototype.updatePaintBuffers=function(e){for(var t in this._buffers=[],this.binders){var r=this.binders[t];if(e&&r instanceof nt){var a=e.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;a&&this._buffers.push(a)}else(r instanceof Qe||r instanceof $e)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},Ye.prototype.upload=function(e){for(var t in this.binders){var r=this.binders[t];(r instanceof Qe||r instanceof $e||r instanceof nt)&&r.upload(e)}this.updatePaintBuffers()},Ye.prototype.destroy=function(){for(var e in this.binders){var t=this.binders[e];(t instanceof Qe||t instanceof $e||t instanceof nt)&&t.destroy()}};var Ke=function(e,t,r){r===void 0&&(r=function(){return!0}),this.programConfigurations={};for(var a=0,l=e;a<l.length;a+=1){var c=l[a];this.programConfigurations[c.id]=new Ye(c,t,r)}this.needsUpload=!1,this._featureMap=new X,this._bufferOffset=0};function kr(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace(t+"-","").replace(/-/g,"_")]}function Qt(e,t,r){var a={color:{source:Wo,composite:rs},number:{source:Kn,composite:Wo}},l=(function(c){return{"line-pattern":{source:pn,composite:pn},"fill-pattern":{source:pn,composite:pn},"fill-extrusion-pattern":{source:pn,composite:pn}}[c]})(e);return l&&l[r]||a[t][r]}Ke.prototype.populatePaintArrays=function(e,t,r,a,l,c){for(var h in this.programConfigurations)this.programConfigurations[h].populatePaintArrays(e,t,a,l,c);t.id!==void 0&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0},Ke.prototype.updatePaintArrays=function(e,t,r,a){for(var l=0,c=r;l<c.length;l+=1){var h=c[l];this.needsUpload=this.programConfigurations[h.id].updatePaintArrays(e,this._featureMap,t,h,a)||this.needsUpload}},Ke.prototype.get=function(e){return this.programConfigurations[e]},Ke.prototype.upload=function(e){if(this.needsUpload){for(var t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}},Ke.prototype.destroy=function(){for(var e in this.programConfigurations)this.programConfigurations[e].destroy()},De("ConstantBinder",tt),De("CrossFadedConstantBinder",at),De("SourceExpressionBinder",Qe),De("CrossFadedCompositeBinder",nt),De("CompositeExpressionBinder",$e),De("ProgramConfiguration",Ye,{omit:["_buffers"]}),De("ProgramConfigurationSet",Ke);var Wr=Math.pow(2,14)-1,Rr=-Wr-1;function Yt(e){for(var t=8192/e.extent,r=e.loadGeometry(),a=0;a<r.length;a++)for(var l=r[a],c=0;c<l.length;c++){var h=l[c],m=Math.round(h.x*t),g=Math.round(h.y*t);h.x=gr(m,Rr,Wr),h.y=gr(g,Rr,Wr),(m<h.x||m>h.x+1||g<h.y||g>h.y+1)&&Ht("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function sr(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Yt(e):[]}}function bi(e,t,r,a,l){e.emplaceBack(2*t+(a+1)/2,2*r+(l+1)/2)}var ti=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Eo,this.indexArray=new Xn,this.segments=new z,this.programConfigurations=new Ke(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Jn(e,t){for(var r=0;r<e.length;r++)if(hn(t,e[r]))return!0;for(var a=0;a<t.length;a++)if(hn(e,t[a]))return!0;return!!Ia(e,t)}function ui(e,t,r){return!!hn(e,t)||!!Yn(t,e,r)}function Qi(e,t){if(e.length===1)return Ea(t,e[0]);for(var r=0;r<t.length;r++)for(var a=t[r],l=0;l<a.length;l++)if(hn(e,a[l]))return!0;for(var c=0;c<e.length;c++)if(Ea(t,e[c]))return!0;for(var h=0;h<t.length;h++)if(Ia(e,t[h]))return!0;return!1}function Ui(e,t,r){if(e.length>1){if(Ia(e,t))return!0;for(var a=0;a<t.length;a++)if(Yn(t[a],e,r))return!0}for(var l=0;l<e.length;l++)if(Yn(e[l],t,r))return!0;return!1}function Ia(e,t){if(e.length===0||t.length===0)return!1;for(var r=0;r<e.length-1;r++)for(var a=e[r],l=e[r+1],c=0;c<t.length-1;c++)if(Ko(a,l,t[c],t[c+1]))return!0;return!1}function Ko(e,t,r,a){return Kr(e,r,a)!==Kr(t,r,a)&&Kr(e,t,r)!==Kr(e,t,a)}function Yn(e,t,r){var a=r*r;if(t.length===1)return e.distSqr(t[0])<a;for(var l=1;l<t.length;l++)if(Jo(e,t[l-1],t[l])<a)return!0;return!1}function Jo(e,t,r){var a=t.distSqr(r);if(a===0)return e.distSqr(t);var l=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/a;return e.distSqr(l<0?t:l>1?r:r.sub(t)._mult(l)._add(t))}function Ea(e,t){for(var r,a,l,c=!1,h=0;h<e.length;h++)for(var m=0,g=(r=e[h]).length-1;m<r.length;g=m++)(a=r[m]).y>t.y!=(l=r[g]).y>t.y&&t.x<(l.x-a.x)*(t.y-a.y)/(l.y-a.y)+a.x&&(c=!c);return c}function hn(e,t){for(var r=!1,a=0,l=e.length-1;a<e.length;l=a++){var c=e[a],h=e[l];c.y>t.y!=h.y>t.y&&t.x<(h.x-c.x)*(t.y-c.y)/(h.y-c.y)+c.x&&(r=!r)}return r}function Ta(e,t,r){var a=r[0],l=r[2];if(e.x<a.x&&t.x<a.x||e.x>l.x&&t.x>l.x||e.y<a.y&&t.y<a.y||e.y>l.y&&t.y>l.y)return!1;var c=Kr(e,t,r[0]);return c!==Kr(e,t,r[1])||c!==Kr(e,t,r[2])||c!==Kr(e,t,r[3])}function fn(e,t,r){var a=t.paint.get(e).value;return a.kind==="constant"?a.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Cr(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function En(e,t,r,a,l){if(!t[0]&&!t[1])return e;var c=Ze.convert(t)._mult(l);r==="viewport"&&c._rotate(-a);for(var h=[],m=0;m<e.length;m++)h.push(e[m].sub(c));return h}ti.prototype.populate=function(e,t,r){var a=this.layers[0],l=[],c=null;a.type==="circle"&&(c=a.layout.get("circle-sort-key"));for(var h=0,m=e;h<m.length;h+=1){var g=m[h],v=g.feature,x=g.id,b=g.index,E=g.sourceLayerIndex,C=this.layers[0]._featureFilter.needGeometry,R=sr(v,C);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),R,r)){var F=c?c.evaluate(R,{},r):void 0,G={id:x,properties:v.properties,type:v.type,sourceLayerIndex:E,index:b,geometry:C?R.geometry:Yt(v),patterns:{},sortKey:F};l.push(G)}}c&&l.sort((function(be,Oe){return be.sortKey-Oe.sortKey}));for(var j=0,J=l;j<J.length;j+=1){var Q=J[j],te=Q.geometry,ie=Q.index,ce=Q.sourceLayerIndex,ge=e[ie].feature;this.addFeature(Q,te,ie,r),t.featureIndex.insert(ge,te,ie,ce,this.index)}},ti.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},ti.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},ti.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ti.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,P),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},ti.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},ti.prototype.addFeature=function(e,t,r,a){for(var l=0,c=t;l<c.length;l+=1)for(var h=0,m=c[l];h<m.length;h+=1){var g=m[h],v=g.x,x=g.y;if(!(v<0||v>=8192||x<0||x>=8192)){var b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),E=b.vertexLength;bi(this.layoutVertexArray,v,x,-1,-1),bi(this.layoutVertexArray,v,x,1,-1),bi(this.layoutVertexArray,v,x,1,1),bi(this.layoutVertexArray,v,x,-1,1),this.indexArray.emplaceBack(E,E+1,E+2),this.indexArray.emplaceBack(E,E+3,E+2),b.vertexLength+=4,b.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},a)},De("CircleBucket",ti,{omit:["layers"]});var $n=new Zr({"circle-sort-key":new Re(A.layout_circle["circle-sort-key"])}),ko={paint:new Zr({"circle-radius":new Re(A.paint_circle["circle-radius"]),"circle-color":new Re(A.paint_circle["circle-color"]),"circle-blur":new Re(A.paint_circle["circle-blur"]),"circle-opacity":new Re(A.paint_circle["circle-opacity"]),"circle-translate":new Ue(A.paint_circle["circle-translate"]),"circle-translate-anchor":new Ue(A.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ue(A.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ue(A.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Re(A.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Re(A.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Re(A.paint_circle["circle-stroke-opacity"])}),layout:$n},kt=typeof Float32Array<"u"?Float32Array:Array;function Ai(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ci(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3],m=t[4],g=t[5],v=t[6],x=t[7],b=t[8],E=t[9],C=t[10],R=t[11],F=t[12],G=t[13],j=t[14],J=t[15],Q=r[0],te=r[1],ie=r[2],ce=r[3];return e[0]=Q*a+te*m+ie*b+ce*F,e[1]=Q*l+te*g+ie*E+ce*G,e[2]=Q*c+te*v+ie*C+ce*j,e[3]=Q*h+te*x+ie*R+ce*J,e[4]=(Q=r[4])*a+(te=r[5])*m+(ie=r[6])*b+(ce=r[7])*F,e[5]=Q*l+te*g+ie*E+ce*G,e[6]=Q*c+te*v+ie*C+ce*j,e[7]=Q*h+te*x+ie*R+ce*J,e[8]=(Q=r[8])*a+(te=r[9])*m+(ie=r[10])*b+(ce=r[11])*F,e[9]=Q*l+te*g+ie*E+ce*G,e[10]=Q*c+te*v+ie*C+ce*j,e[11]=Q*h+te*x+ie*R+ce*J,e[12]=(Q=r[12])*a+(te=r[13])*m+(ie=r[14])*b+(ce=r[15])*F,e[13]=Q*l+te*g+ie*E+ce*G,e[14]=Q*c+te*v+ie*C+ce*j,e[15]=Q*h+te*x+ie*R+ce*J,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var Co,oc=ci;function is(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3];return e[0]=r[0]*a+r[4]*l+r[8]*c+r[12]*h,e[1]=r[1]*a+r[5]*l+r[9]*c+r[13]*h,e[2]=r[2]*a+r[6]*l+r[10]*c+r[14]*h,e[3]=r[3]*a+r[7]*l+r[11]*c+r[15]*h,e}Co=new kt(3),kt!=Float32Array&&(Co[0]=0,Co[1]=0,Co[2]=0),(function(){var e=new kt(4);kt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)})();var ac=((function(){var e=new kt(2);kt!=Float32Array&&(e[0]=0,e[1]=0)})(),(function(e){function t(r){e.call(this,r,ko)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new ti(r)},t.prototype.queryRadius=function(r){var a=r;return fn("circle-radius",this,a)+fn("circle-stroke-width",this,a)+Cr(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g,v){for(var x=En(r,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),m.angle,g),b=this.paint.get("circle-radius").evaluate(a,l)+this.paint.get("circle-stroke-width").evaluate(a,l),E=this.paint.get("circle-pitch-alignment")==="map",C=E?x:(function(ge,be){return ge.map((function(Oe){return ka(Oe,be)}))})(x,v),R=E?b*g:b,F=0,G=c;F<G.length;F+=1)for(var j=0,J=G[F];j<J.length;j+=1){var Q=J[j],te=E?Q:ka(Q,v),ie=R,ce=is([],[Q.x,Q.y,0,1],v);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?ie*=ce[3]/m.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(ie*=m.cameraToCenterDistance/ce[3]),ui(C,te,ie))return!0}return!1},t})(cn));function ka(e,t){var r=is([],[e.x,e.y,0,1],t);return new Ze(r[0]/r[3],r[1]/r[3])}var au=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(ti);function Yo(e,t,r,a){var l=t.width,c=t.height;if(a){if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==l*c*r)throw new RangeError("mismatched image size")}else a=new Uint8Array(l*c*r);return e.width=l,e.height=c,e.data=a,e}function ns(e,t,r){var a=t.width,l=t.height;if(a!==e.width||l!==e.height){var c=Yo({},{width:a,height:l},r);sc(e,c,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,a),height:Math.min(e.height,l)},r),e.width=a,e.height=l,e.data=c.data}}function sc(e,t,r,a,l,c){if(l.width===0||l.height===0)return t;if(l.width>e.width||l.height>e.height||r.x>e.width-l.width||r.y>e.height-l.height)throw new RangeError("out of range source coordinates for image copy");if(l.width>t.width||l.height>t.height||a.x>t.width-l.width||a.y>t.height-l.height)throw new RangeError("out of range destination coordinates for image copy");for(var h=e.data,m=t.data,g=0;g<l.height;g++)for(var v=((r.y+g)*e.width+r.x)*c,x=((a.y+g)*t.width+a.x)*c,b=0;b<l.width*c;b++)m[x+b]=h[v+b];return t}De("HeatmapBucket",au,{omit:["layers"]});var Ca=function(e,t){Yo(this,e,1,t)};Ca.prototype.resize=function(e){ns(this,e,1)},Ca.prototype.clone=function(){return new Ca({width:this.width,height:this.height},new Uint8Array(this.data))},Ca.copy=function(e,t,r,a,l){sc(e,t,r,a,l,1)};var wi=function(e,t){Yo(this,e,4,t)};wi.prototype.resize=function(e){ns(this,e,4)},wi.prototype.replace=function(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e},wi.prototype.clone=function(){return new wi({width:this.width,height:this.height},new Uint8Array(this.data))},wi.copy=function(e,t,r,a,l){sc(e,t,r,a,l,4)},De("AlphaImage",Ca),De("RGBAImage",wi);var _h={paint:new Zr({"heatmap-radius":new Re(A.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Re(A.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ue(A.paint_heatmap["heatmap-intensity"]),"heatmap-color":new $i(A.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ue(A.paint_heatmap["heatmap-opacity"])})};function qc(e){var t={},r=e.resolution||256,a=e.clips?e.clips.length:1,l=e.image||new wi({width:r,height:a}),c=function(R,F,G){t[e.evaluationKey]=G;var j=e.expression.evaluate(t);l.data[R+F+0]=Math.floor(255*j.r/j.a),l.data[R+F+1]=Math.floor(255*j.g/j.a),l.data[R+F+2]=Math.floor(255*j.b/j.a),l.data[R+F+3]=Math.floor(255*j.a)};if(e.clips)for(var h=0,m=0;h<a;++h,m+=4*r)for(var g=0,v=0;g<r;g++,v+=4){var x=g/(r-1),b=e.clips[h];c(m,v,b.start*(1-x)+b.end*x)}else for(var E=0,C=0;E<r;E++,C+=4)c(0,C,E/(r-1));return l}var xh=(function(e){function t(r){e.call(this,r,_h),this._updateColorRamp()}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new au(r)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="heatmap-color"&&this._updateColorRamp()},t.prototype._updateColorRamp=function(){this.colorRamp=qc({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},t.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},t})(cn),bh={paint:new Zr({"hillshade-illumination-direction":new Ue(A.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Ue(A.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ue(A.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ue(A.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ue(A.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ue(A.paint_hillshade["hillshade-accent-color"])})},wh=(function(e){function t(r){e.call(this,r,bh)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},t})(cn),Sh=Br([{name:"a_pos",components:2,type:"Int16"}],4).members,lc=su,Ih=su;function su(e,t,r){r=r||2;var a,l,c,h,m,g,v,x=t&&t.length,b=x?t[0]*r:e.length,E=Zc(e,0,b,r,!0),C=[];if(!E||E.next===E.prev)return C;if(x&&(E=(function(F,G,j,J){var Q,te,ie,ce=[];for(Q=0,te=G.length;Q<te;Q++)(ie=Zc(F,G[Q]*J,Q<te-1?G[Q+1]*J:F.length,J,!1))===ie.next&&(ie.steiner=!0),ce.push(Mh(ie));for(ce.sort(Ph),Q=0;Q<ce.length;Q++)Ah(ce[Q],j),j=$o(j,j.next);return j})(e,t,E,r)),e.length>80*r){a=c=e[0],l=h=e[1];for(var R=r;R<b;R+=r)(m=e[R])<a&&(a=m),(g=e[R+1])<l&&(l=g),m>c&&(c=m),g>h&&(h=g);v=(v=Math.max(c-a,h-l))!==0?1/v:0}return il(E,C,r,a,l,v),C}function Zc(e,t,r,a,l){var c,h;if(l===pc(e,t,r,a)>0)for(c=t;c<r;c+=a)h=Xc(c,e[c],e[c+1],h);else for(c=r-a;c>=t;c-=a)h=Xc(c,e[c],e[c+1],h);return h&&lu(h,h.next)&&(ol(h),h=h.next),h}function $o(e,t){if(!e)return e;t||(t=e);var r,a=e;do if(r=!1,a.steiner||!lu(a,a.next)&&xr(a.prev,a,a.next)!==0)a=a.next;else{if(ol(a),(a=t=a.prev)===a.next)break;r=!0}while(r||a!==t);return t}function il(e,t,r,a,l,c,h){if(e){!h&&c&&(function(x,b,E,C){var R=x;do R.z===null&&(R.z=uc(R.x,R.y,b,E,C)),R.prevZ=R.prev,R.nextZ=R.next,R=R.next;while(R!==x);R.prevZ.nextZ=null,R.prevZ=null,(function(F){var G,j,J,Q,te,ie,ce,ge,be=1;do{for(j=F,F=null,te=null,ie=0;j;){for(ie++,J=j,ce=0,G=0;G<be&&(ce++,J=J.nextZ);G++);for(ge=be;ce>0||ge>0&&J;)ce!==0&&(ge===0||!J||j.z<=J.z)?(Q=j,j=j.nextZ,ce--):(Q=J,J=J.nextZ,ge--),te?te.nextZ=Q:F=Q,Q.prevZ=te,te=Q;j=J}te.nextZ=null,be*=2}while(ie>1)})(R)})(e,a,l,c);for(var m,g,v=e;e.prev!==e.next;)if(m=e.prev,g=e.next,c?Th(e,a,l,c):Eh(e))t.push(m.i/r),t.push(e.i/r),t.push(g.i/r),ol(e),e=g.next,v=g.next;else if((e=g)===v){h?h===1?il(e=kh($o(e),t,r),t,r,a,l,c,2):h===2&&Ch(e,t,r,a,l,c):il($o(e),t,r,a,l,c,1);break}}}function Eh(e){var t=e.prev,r=e,a=e.next;if(xr(t,r,a)>=0)return!1;for(var l=e.next.next;l!==e.prev;){if(os(t.x,t.y,r.x,r.y,a.x,a.y,l.x,l.y)&&xr(l.prev,l,l.next)>=0)return!1;l=l.next}return!0}function Th(e,t,r,a){var l=e.prev,c=e,h=e.next;if(xr(l,c,h)>=0)return!1;for(var m=l.x>c.x?l.x>h.x?l.x:h.x:c.x>h.x?c.x:h.x,g=l.y>c.y?l.y>h.y?l.y:h.y:c.y>h.y?c.y:h.y,v=uc(l.x<c.x?l.x<h.x?l.x:h.x:c.x<h.x?c.x:h.x,l.y<c.y?l.y<h.y?l.y:h.y:c.y<h.y?c.y:h.y,t,r,a),x=uc(m,g,t,r,a),b=e.prevZ,E=e.nextZ;b&&b.z>=v&&E&&E.z<=x;){if(b!==e.prev&&b!==e.next&&os(l.x,l.y,c.x,c.y,h.x,h.y,b.x,b.y)&&xr(b.prev,b,b.next)>=0||(b=b.prevZ,E!==e.prev&&E!==e.next&&os(l.x,l.y,c.x,c.y,h.x,h.y,E.x,E.y)&&xr(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;b&&b.z>=v;){if(b!==e.prev&&b!==e.next&&os(l.x,l.y,c.x,c.y,h.x,h.y,b.x,b.y)&&xr(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;E&&E.z<=x;){if(E!==e.prev&&E!==e.next&&os(l.x,l.y,c.x,c.y,h.x,h.y,E.x,E.y)&&xr(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function kh(e,t,r){var a=e;do{var l=a.prev,c=a.next.next;!lu(l,c)&&Gc(l,a,a.next,c)&&nl(l,c)&&nl(c,l)&&(t.push(l.i/r),t.push(a.i/r),t.push(c.i/r),ol(a),ol(a.next),a=e=c),a=a.next}while(a!==e);return $o(a)}function Ch(e,t,r,a,l,c){var h=e;do{for(var m=h.next.next;m!==h.prev;){if(h.i!==m.i&&Dh(h,m)){var g=Wc(h,m);return h=$o(h,h.next),g=$o(g,g.next),il(h,t,r,a,l,c),void il(g,t,r,a,l,c)}m=m.next}h=h.next}while(h!==e)}function Ph(e,t){return e.x-t.x}function Ah(e,t){if(t=(function(a,l){var c,h=l,m=a.x,g=a.y,v=-1/0;do{if(g<=h.y&&g>=h.next.y&&h.next.y!==h.y){var x=h.x+(g-h.y)*(h.next.x-h.x)/(h.next.y-h.y);if(x<=m&&x>v){if(v=x,x===m){if(g===h.y)return h;if(g===h.next.y)return h.next}c=h.x<h.next.x?h:h.next}}h=h.next}while(h!==l);if(!c)return null;if(m===v)return c;var b,E=c,C=c.x,R=c.y,F=1/0;h=c;do m>=h.x&&h.x>=C&&m!==h.x&&os(g<R?m:v,g,C,R,g<R?v:m,g,h.x,h.y)&&(b=Math.abs(g-h.y)/(m-h.x),nl(h,a)&&(b<F||b===F&&(h.x>c.x||h.x===c.x&&zh(c,h)))&&(c=h,F=b)),h=h.next;while(h!==E);return c})(e,t)){var r=Wc(t,e);$o(t,t.next),$o(r,r.next)}}function zh(e,t){return xr(e.prev,e,t.prev)<0&&xr(t.next,e,e.next)<0}function uc(e,t,r,a,l){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*l)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-a)*l)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Mh(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function os(e,t,r,a,l,c,h,m){return(l-h)*(t-m)-(e-h)*(c-m)>=0&&(e-h)*(a-m)-(r-h)*(t-m)>=0&&(r-h)*(c-m)-(l-h)*(a-m)>=0}function Dh(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!(function(r,a){var l=r;do{if(l.i!==r.i&&l.next.i!==r.i&&l.i!==a.i&&l.next.i!==a.i&&Gc(l,l.next,r,a))return!0;l=l.next}while(l!==r);return!1})(e,t)&&(nl(e,t)&&nl(t,e)&&(function(r,a){var l=r,c=!1,h=(r.x+a.x)/2,m=(r.y+a.y)/2;do l.y>m!=l.next.y>m&&l.next.y!==l.y&&h<(l.next.x-l.x)*(m-l.y)/(l.next.y-l.y)+l.x&&(c=!c),l=l.next;while(l!==r);return c})(e,t)&&(xr(e.prev,e,t.prev)||xr(e,t.prev,t))||lu(e,t)&&xr(e.prev,e,e.next)>0&&xr(t.prev,t,t.next)>0)}function xr(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function lu(e,t){return e.x===t.x&&e.y===t.y}function Gc(e,t,r,a){var l=cu(xr(e,t,r)),c=cu(xr(e,t,a)),h=cu(xr(r,a,e)),m=cu(xr(r,a,t));return l!==c&&h!==m||!(l!==0||!uu(e,r,t))||!(c!==0||!uu(e,a,t))||!(h!==0||!uu(r,e,a))||!(m!==0||!uu(r,t,a))}function uu(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function cu(e){return e>0?1:e<0?-1:0}function nl(e,t){return xr(e.prev,e,e.next)<0?xr(e,t,e.next)>=0&&xr(e,e.prev,t)>=0:xr(e,t,e.prev)<0||xr(e,e.next,t)<0}function Wc(e,t){var r=new cc(e.i,e.x,e.y),a=new cc(t.i,t.x,t.y),l=e.next,c=t.prev;return e.next=t,t.prev=e,r.next=l,l.prev=r,a.next=r,r.prev=a,c.next=a,a.prev=c,a}function Xc(e,t,r,a){var l=new cc(e,t,r);return a?(l.next=a.next,l.prev=a,a.next.prev=l,a.next=l):(l.prev=l,l.next=l),l}function ol(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function cc(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function pc(e,t,r,a){for(var l=0,c=t,h=r-a;c<r;c+=a)l+=(e[h]-e[c])*(e[c+1]+e[h+1]),h=c;return l}function Lh(e,t,r,a,l){(function c(h,m,g,v,x){for(;v>g;){if(v-g>600){var b=v-g+1,E=m-g+1,C=Math.log(b),R=.5*Math.exp(2*C/3),F=.5*Math.sqrt(C*R*(b-R)/b)*(E-b/2<0?-1:1);c(h,m,Math.max(g,Math.floor(m-E*R/b+F)),Math.min(v,Math.floor(m+(b-E)*R/b+F)),x)}var G=h[m],j=g,J=v;for(al(h,g,m),x(h[v],G)>0&&al(h,g,v);j<J;){for(al(h,j,J),j++,J--;x(h[j],G)<0;)j++;for(;x(h[J],G)>0;)J--}x(h[g],G)===0?al(h,g,J):al(h,++J,v),J<=m&&(g=J+1),m<=J&&(v=J-1)}})(e,t,r,a||e.length-1,l||Bh)}function al(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function Bh(e,t){return e<t?-1:e>t?1:0}function hc(e,t){var r=e.length;if(r<=1)return[e];for(var a,l,c=[],h=0;h<r;h++){var m=Bo(e[h]);m!==0&&(e[h].area=Math.abs(m),l===void 0&&(l=m<0),l===m<0?(a&&c.push(a),a=[e[h]]):a.push(e[h]))}if(a&&c.push(a),t>1)for(var g=0;g<c.length;g++)c[g].length<=t||(Lh(c[g],t,1,c[g].length-1,Rh),c[g]=c[g].slice(0,t));return c}function Rh(e,t){return t.area-e.area}function fc(e,t,r){for(var a=r.patternDependencies,l=!1,c=0,h=t;c<h.length;c+=1){var m=h[c].paint.get(e+"-pattern");m.isConstant()||(l=!0);var g=m.constantOr(null);g&&(l=!0,a[g.to]=!0,a[g.from]=!0)}return l}function dc(e,t,r,a,l){for(var c=l.patternDependencies,h=0,m=t;h<m.length;h+=1){var g=m[h],v=g.paint.get(e+"-pattern").value;if(v.kind!=="constant"){var x=v.evaluate({zoom:a-1},r,{},l.availableImages),b=v.evaluate({zoom:a},r,{},l.availableImages),E=v.evaluate({zoom:a+1},r,{},l.availableImages);b=b&&b.name?b.name:b,E=E&&E.name?E.name:E,c[x=x&&x.name?x.name:x]=!0,c[b]=!0,c[E]=!0,r.patterns[g.id]={min:x,mid:b,max:E}}}return r}su.deviation=function(e,t,r,a){var l=t&&t.length,c=Math.abs(pc(e,0,l?t[0]*r:e.length,r));if(l)for(var h=0,m=t.length;h<m;h++)c-=Math.abs(pc(e,t[h]*r,h<m-1?t[h+1]*r:e.length,r));var g=0;for(h=0;h<a.length;h+=3){var v=a[h]*r,x=a[h+1]*r,b=a[h+2]*r;g+=Math.abs((e[v]-e[b])*(e[x+1]-e[v+1])-(e[v]-e[x])*(e[b+1]-e[v+1]))}return c===0&&g===0?0:Math.abs((g-c)/c)},su.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},a=0,l=0;l<e.length;l++){for(var c=0;c<e[l].length;c++)for(var h=0;h<t;h++)r.vertices.push(e[l][c][h]);l>0&&r.holes.push(a+=e[l-1].length)}return r},lc.default=Ih;var Tn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Eo,this.indexArray=new Xn,this.indexArray2=new Sa,this.programConfigurations=new Ke(e.layers,e.zoom),this.segments=new z,this.segments2=new z,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Tn.prototype.populate=function(e,t,r){this.hasPattern=fc("fill",this.layers,t);for(var a=this.layers[0].layout.get("fill-sort-key"),l=[],c=0,h=e;c<h.length;c+=1){var m=h[c],g=m.feature,v=m.id,x=m.index,b=m.sourceLayerIndex,E=this.layers[0]._featureFilter.needGeometry,C=sr(g,E);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),C,r)){var R=a?a.evaluate(C,{},r,t.availableImages):void 0,F={id:v,properties:g.properties,type:g.type,sourceLayerIndex:b,index:x,geometry:E?C.geometry:Yt(g),patterns:{},sortKey:R};l.push(F)}}a&&l.sort((function(ge,be){return ge.sortKey-be.sortKey}));for(var G=0,j=l;G<j.length;G+=1){var J=j[G],Q=J.geometry,te=J.index,ie=J.sourceLayerIndex;if(this.hasPattern){var ce=dc("fill",this.layers,J,this.zoom,t);this.patternFeatures.push(ce)}else this.addFeature(J,Q,te,r,{});t.featureIndex.insert(e[te].feature,Q,te,ie,this.index)}},Tn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Tn.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.patternFeatures;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},Tn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Tn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Tn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Sh),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0},Tn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Tn.prototype.addFeature=function(e,t,r,a,l){for(var c=0,h=hc(t,500);c<h.length;c+=1){for(var m=h[c],g=0,v=0,x=m;v<x.length;v+=1)g+=x[v].length;for(var b=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray),E=b.vertexLength,C=[],R=[],F=0,G=m;F<G.length;F+=1){var j=G[F];if(j.length!==0){j!==m[0]&&R.push(C.length/2);var J=this.segments2.prepareSegment(j.length,this.layoutVertexArray,this.indexArray2),Q=J.vertexLength;this.layoutVertexArray.emplaceBack(j[0].x,j[0].y),this.indexArray2.emplaceBack(Q+j.length-1,Q),C.push(j[0].x),C.push(j[0].y);for(var te=1;te<j.length;te++)this.layoutVertexArray.emplaceBack(j[te].x,j[te].y),this.indexArray2.emplaceBack(Q+te-1,Q+te),C.push(j[te].x),C.push(j[te].y);J.vertexLength+=j.length,J.primitiveLength+=j.length}}for(var ie=lc(C,R),ce=0;ce<ie.length;ce+=3)this.indexArray.emplaceBack(E+ie[ce],E+ie[ce+1],E+ie[ce+2]);b.vertexLength+=g,b.primitiveLength+=ie.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},De("FillBucket",Tn,{omit:["layers","patternFeatures"]});var Fh=new Zr({"fill-sort-key":new Re(A.layout_fill["fill-sort-key"])}),Oh={paint:new Zr({"fill-antialias":new Ue(A.paint_fill["fill-antialias"]),"fill-opacity":new Re(A.paint_fill["fill-opacity"]),"fill-color":new Re(A.paint_fill["fill-color"]),"fill-outline-color":new Re(A.paint_fill["fill-outline-color"]),"fill-translate":new Ue(A.paint_fill["fill-translate"]),"fill-translate-anchor":new Ue(A.paint_fill["fill-translate-anchor"]),"fill-pattern":new $a(A.paint_fill["fill-pattern"])}),layout:Fh},Vh=(function(e){function t(r){e.call(this,r,Oh)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a);var l=this.paint._values["fill-outline-color"];l.value.kind==="constant"&&l.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},t.prototype.createBucket=function(r){return new Tn(r)},t.prototype.queryRadius=function(){return Cr(this.paint.get("fill-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g){return Qi(En(r,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),m.angle,g),c)},t.prototype.isTileClipped=function(){return!0},t})(cn),Uh=Br([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Hc=as;function as(e,t,r,a,l){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=a,this._values=l,e.readFields(Nh,this,t)}function Nh(e,t,r){e==1?t.id=r.readVarint():e==2?(function(a,l){for(var c=a.readVarint()+a.pos;a.pos<c;){var h=l._keys[a.readVarint()],m=l._values[a.readVarint()];l.properties[h]=m}})(r,t):e==3?t.type=r.readVarint():e==4&&(t._geometry=r.pos)}function jh(e){for(var t,r,a=0,l=0,c=e.length,h=c-1;l<c;h=l++)a+=((r=e[h]).x-(t=e[l]).x)*(t.y+r.y);return a}as.types=["Unknown","Point","LineString","Polygon"],as.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,a=1,l=0,c=0,h=0,m=[];e.pos<r;){if(l<=0){var g=e.readVarint();a=7&g,l=g>>3}if(l--,a===1||a===2)c+=e.readSVarint(),h+=e.readSVarint(),a===1&&(t&&m.push(t),t=[]),t.push(new Ze(c,h));else{if(a!==7)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&m.push(t),m},as.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,a=0,l=0,c=0,h=1/0,m=-1/0,g=1/0,v=-1/0;e.pos<t;){if(a<=0){var x=e.readVarint();r=7&x,a=x>>3}if(a--,r===1||r===2)(l+=e.readSVarint())<h&&(h=l),l>m&&(m=l),(c+=e.readSVarint())<g&&(g=c),c>v&&(v=c);else if(r!==7)throw new Error("unknown command "+r)}return[h,g,m,v]},as.prototype.toGeoJSON=function(e,t,r){var a,l,c=this.extent*Math.pow(2,r),h=this.extent*e,m=this.extent*t,g=this.loadGeometry(),v=as.types[this.type];function x(C){for(var R=0;R<C.length;R++){var F=C[R];C[R]=[360*(F.x+h)/c-180,360/Math.PI*Math.atan(Math.exp((180-360*(F.y+m)/c)*Math.PI/180))-90]}}switch(this.type){case 1:var b=[];for(a=0;a<g.length;a++)b[a]=g[a][0];x(g=b);break;case 2:for(a=0;a<g.length;a++)x(g[a]);break;case 3:for(g=(function(C){var R=C.length;if(R<=1)return[C];for(var F,G,j=[],J=0;J<R;J++){var Q=jh(C[J]);Q!==0&&(G===void 0&&(G=Q<0),G===Q<0?(F&&j.push(F),F=[C[J]]):F.push(C[J]))}return F&&j.push(F),j})(g),a=0;a<g.length;a++)for(l=0;l<g[a].length;l++)x(g[a][l])}g.length===1?g=g[0]:v="Multi"+v;var E={type:"Feature",geometry:{type:v,coordinates:g},properties:this.properties};return"id"in this&&(E.id=this.id),E};var Kc=Jc;function Jc(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(qh,this,t),this.length=this._features.length}function qh(e,t,r){e===15?t.version=r.readVarint():e===1?t.name=r.readString():e===5?t.extent=r.readVarint():e===2?t._features.push(r.pos):e===3?t._keys.push(r.readString()):e===4&&t._values.push((function(a){for(var l=null,c=a.readVarint()+a.pos;a.pos<c;){var h=a.readVarint()>>3;l=h===1?a.readString():h===2?a.readFloat():h===3?a.readDouble():h===4?a.readVarint64():h===5?a.readVarint():h===6?a.readSVarint():h===7?a.readBoolean():null}return l})(r))}function Zh(e,t,r){if(e===3){var a=new Kc(r,r.readVarint()+r.pos);a.length&&(t[a.name]=a)}}Jc.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new Hc(this._pbf,t,this.extent,this._keys,this._values)};var ss={VectorTile:function(e,t){this.layers=e.readFields(Zh,{},t)},VectorTileFeature:Hc,VectorTileLayer:Kc},Gh=ss.VectorTileFeature.types,mc=Math.pow(2,13);function sl(e,t,r,a,l,c,h,m){e.emplaceBack(t,r,2*Math.floor(a*mc)+h,l*mc*2,c*mc*2,Math.round(m))}var kn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new In,this.indexArray=new Xn,this.programConfigurations=new Ke(e.layers,e.zoom),this.segments=new z,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Wh(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}kn.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=fc("fill-extrusion",this.layers,t);for(var a=0,l=e;a<l.length;a+=1){var c=l[a],h=c.feature,m=c.id,g=c.index,v=c.sourceLayerIndex,x=this.layers[0]._featureFilter.needGeometry,b=sr(h,x);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),b,r)){var E={id:m,sourceLayerIndex:v,index:g,geometry:x?b.geometry:Yt(h),properties:h.properties,type:h.type,patterns:{}};this.hasPattern?this.features.push(dc("fill-extrusion",this.layers,E,this.zoom,t)):this.addFeature(E,E.geometry,g,r,{}),t.featureIndex.insert(h,E.geometry,g,v,this.index,!0)}}},kn.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.features;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},kn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},kn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},kn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},kn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Uh),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},kn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},kn.prototype.addFeature=function(e,t,r,a,l){for(var c=0,h=hc(t,500);c<h.length;c+=1){for(var m=h[c],g=0,v=0,x=m;v<x.length;v+=1)g+=x[v].length;for(var b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),E=0,C=m;E<C.length;E+=1){var R=C[E];if(R.length!==0&&!((ct=R).every((function(it){return it.x<0}))||ct.every((function(it){return it.x>8192}))||ct.every((function(it){return it.y<0}))||ct.every((function(it){return it.y>8192}))))for(var F=0,G=0;G<R.length;G++){var j=R[G];if(G>=1){var J=R[G-1];if(!Wh(j,J)){b.vertexLength+4>z.MAX_VERTEX_ARRAY_LENGTH&&(b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Q=j.sub(J)._perp()._unit(),te=J.dist(j);F+te>32768&&(F=0),sl(this.layoutVertexArray,j.x,j.y,Q.x,Q.y,0,0,F),sl(this.layoutVertexArray,j.x,j.y,Q.x,Q.y,0,1,F),sl(this.layoutVertexArray,J.x,J.y,Q.x,Q.y,0,0,F+=te),sl(this.layoutVertexArray,J.x,J.y,Q.x,Q.y,0,1,F);var ie=b.vertexLength;this.indexArray.emplaceBack(ie,ie+2,ie+1),this.indexArray.emplaceBack(ie+1,ie+2,ie+3),b.vertexLength+=4,b.primitiveLength+=2}}}}if(b.vertexLength+g>z.MAX_VERTEX_ARRAY_LENGTH&&(b=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray)),Gh[e.type]==="Polygon"){for(var ce=[],ge=[],be=b.vertexLength,Oe=0,Ee=m;Oe<Ee.length;Oe+=1){var je=Ee[Oe];if(je.length!==0){je!==m[0]&&ge.push(ce.length/2);for(var ke=0;ke<je.length;ke++){var st=je[ke];sl(this.layoutVertexArray,st.x,st.y,0,0,1,1,0),ce.push(st.x),ce.push(st.y)}}}for(var Je=lc(ce,ge),Fe=0;Fe<Je.length;Fe+=3)this.indexArray.emplaceBack(be+Je[Fe],be+Je[Fe+2],be+Je[Fe+1]);b.primitiveLength+=Je.length/3,b.vertexLength+=g}}var ct;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},De("FillExtrusionBucket",kn,{omit:["layers","features"]});var Xh={paint:new Zr({"fill-extrusion-opacity":new Ue(A["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Re(A["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ue(A["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ue(A["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new $a(A["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Re(A["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Re(A["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ue(A["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Hh=(function(e){function t(r){e.call(this,r,Xh)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new kn(r)},t.prototype.queryRadius=function(){return Cr(this.paint.get("fill-extrusion-translate"))},t.prototype.is3D=function(){return!0},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g,v){var x=En(r,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),m.angle,g),b=this.paint.get("fill-extrusion-height").evaluate(a,l),E=this.paint.get("fill-extrusion-base").evaluate(a,l),C=(function(F,G,j,J){for(var Q=[],te=0,ie=F;te<ie.length;te+=1){var ce=ie[te],ge=[ce.x,ce.y,0,1];is(ge,ge,G),Q.push(new Ze(ge[0]/ge[3],ge[1]/ge[3]))}return Q})(x,v),R=(function(F,G,j,J){for(var Q=[],te=[],ie=J[8]*G,ce=J[9]*G,ge=J[10]*G,be=J[11]*G,Oe=J[8]*j,Ee=J[9]*j,je=J[10]*j,ke=J[11]*j,st=0,Je=F;st<Je.length;st+=1){for(var Fe=[],ct=[],it=0,xt=Je[st];it<xt.length;it+=1){var Ge=xt[it],St=Ge.x,Wt=Ge.y,er=J[0]*St+J[4]*Wt+J[12],$t=J[1]*St+J[5]*Wt+J[13],Xt=J[2]*St+J[6]*Wt+J[14],tr=J[3]*St+J[7]*Wt+J[15],Pr=Xt+ge,Ar=tr+be,ii=er+Oe,Or=$t+Ee,ni=Xt+je,lr=tr+ke,Vr=new Ze((er+ie)/Ar,($t+ce)/Ar);Vr.z=Pr/Ar,Fe.push(Vr);var ft=new Ze(ii/lr,Or/lr);ft.z=ni/lr,ct.push(ft)}Q.push(Fe),te.push(ct)}return[Q,te]})(c,E,b,v);return(function(F,G,j){var J=1/0;Qi(j,G)&&(J=Yc(j,G[0]));for(var Q=0;Q<G.length;Q++)for(var te=G[Q],ie=F[Q],ce=0;ce<te.length-1;ce++){var ge=te[ce],be=[ge,te[ce+1],ie[ce+1],ie[ce],ge];Jn(j,be)&&(J=Math.min(J,Yc(j,be)))}return J!==1/0&&J})(R[0],R[1],C)},t})(cn);function ll(e,t){return e.x*t.x+e.y*t.y}function Yc(e,t){if(e.length===1){for(var r,a=0,l=t[a++];!r||l.equals(r);)if(!(r=t[a++]))return 1/0;for(;a<t.length;a++){var c=t[a],h=e[0],m=r.sub(l),g=c.sub(l),v=h.sub(l),x=ll(m,m),b=ll(m,g),E=ll(g,g),C=ll(v,m),R=ll(v,g),F=x*E-b*b,G=(E*C-b*R)/F,j=(x*R-b*C)/F,J=l.z*(1-G-j)+r.z*G+c.z*j;if(isFinite(J))return J}return 1/0}for(var Q=1/0,te=0,ie=t;te<ie.length;te+=1)Q=Math.min(Q,ie[te].z);return Q}var Kh=Br([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Jh=Br([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,Yh=ss.VectorTileFeature.types,$h=Math.cos(Math.PI/180*37.5),$c=Math.pow(2,14)/.5,pi=function(e){var t=this;this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(r){return r.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(r){t.gradients[r.id]={}})),this.layoutVertexArray=new xi,this.layoutVertexArray2=new Wo,this.indexArray=new Xn,this.programConfigurations=new Ke(e.layers,e.zoom),this.segments=new z,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(r){return r.isStateDependent()})).map((function(r){return r.id}))};pi.prototype.populate=function(e,t,r){this.hasPattern=fc("line",this.layers,t);for(var a=this.layers[0].layout.get("line-sort-key"),l=[],c=0,h=e;c<h.length;c+=1){var m=h[c],g=m.feature,v=m.id,x=m.index,b=m.sourceLayerIndex,E=this.layers[0]._featureFilter.needGeometry,C=sr(g,E);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),C,r)){var R=a?a.evaluate(C,{},r):void 0,F={id:v,properties:g.properties,type:g.type,sourceLayerIndex:b,index:x,geometry:E?C.geometry:Yt(g),patterns:{},sortKey:R};l.push(F)}}a&&l.sort((function(ge,be){return ge.sortKey-be.sortKey}));for(var G=0,j=l;G<j.length;G+=1){var J=j[G],Q=J.geometry,te=J.index,ie=J.sourceLayerIndex;if(this.hasPattern){var ce=dc("line",this.layers,J,this.zoom,t);this.patternFeatures.push(ce)}else this.addFeature(J,Q,te,r,{});t.featureIndex.insert(e[te].feature,Q,te,ie,this.index)}},pi.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},pi.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.patternFeatures;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},pi.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},pi.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},pi.prototype.upload=function(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Jh)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Kh),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},pi.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},pi.prototype.lineFeatureClips=function(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}},pi.prototype.addFeature=function(e,t,r,a,l){var c=this.layers[0].layout,h=c.get("line-join").evaluate(e,{}),m=c.get("line-cap"),g=c.get("line-miter-limit"),v=c.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(var x=0,b=t;x<b.length;x+=1)this.addLine(b[x],e,h,m,g,v);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},pi.prototype.addLine=function(e,t,r,a,l,c){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var h=0;h<e.length-1;h++)this.totalDistance+=e[h].dist(e[h+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var m=Yh[t.type]==="Polygon",g=e.length;g>=2&&e[g-1].equals(e[g-2]);)g--;for(var v=0;v<g-1&&e[v].equals(e[v+1]);)v++;if(!(g<(m?3:2))){r==="bevel"&&(l=1.05);var x,b=this.overscaling<=16?122880/(512*this.overscaling):0,E=this.segments.prepareSegment(10*g,this.layoutVertexArray,this.indexArray),C=void 0,R=void 0,F=void 0,G=void 0;this.e1=this.e2=-1,m&&(G=e[v].sub(x=e[g-2])._unit()._perp());for(var j=v;j<g;j++)if(!(R=j===g-1?m?e[v+1]:void 0:e[j+1])||!e[j].equals(R)){G&&(F=G),x&&(C=x),x=e[j],G=R?R.sub(x)._unit()._perp():F;var J=(F=F||G).add(G);J.x===0&&J.y===0||J._unit();var Q=F.x*G.x+F.y*G.y,te=J.x*G.x+J.y*G.y,ie=te!==0?1/te:1/0,ce=2*Math.sqrt(2-2*te),ge=te<$h&&C&&R,be=F.x*G.y-F.y*G.x>0;if(ge&&j>v){var Oe=x.dist(C);if(Oe>2*b){var Ee=x.sub(x.sub(C)._mult(b/Oe)._round());this.updateDistance(C,Ee),this.addCurrentVertex(Ee,F,0,0,E),C=Ee}}var je=C&&R,ke=je?r:m?"butt":a;if(je&&ke==="round"&&(ie<c?ke="miter":ie<=2&&(ke="fakeround")),ke==="miter"&&ie>l&&(ke="bevel"),ke==="bevel"&&(ie>2&&(ke="flipbevel"),ie<l&&(ke="miter")),C&&this.updateDistance(C,x),ke==="miter")J._mult(ie),this.addCurrentVertex(x,J,0,0,E);else if(ke==="flipbevel"){if(ie>100)J=G.mult(-1);else{var st=ie*F.add(G).mag()/F.sub(G).mag();J._perp()._mult(st*(be?-1:1))}this.addCurrentVertex(x,J,0,0,E),this.addCurrentVertex(x,J.mult(-1),0,0,E)}else if(ke==="bevel"||ke==="fakeround"){var Je=-Math.sqrt(ie*ie-1),Fe=be?Je:0,ct=be?0:Je;if(C&&this.addCurrentVertex(x,F,Fe,ct,E),ke==="fakeround")for(var it=Math.round(180*ce/Math.PI/20),xt=1;xt<it;xt++){var Ge=xt/it;if(Ge!==.5){var St=Ge-.5;Ge+=Ge*St*(Ge-1)*((1.0904+Q*(Q*(3.55645-1.43519*Q)-3.2452))*St*St+(.848013+Q*(.215638*Q-1.06021)))}var Wt=G.sub(F)._mult(Ge)._add(F)._unit()._mult(be?-1:1);this.addHalfVertex(x,Wt.x,Wt.y,!1,be,0,E)}R&&this.addCurrentVertex(x,G,-Fe,-ct,E)}else if(ke==="butt")this.addCurrentVertex(x,J,0,0,E);else if(ke==="square"){var er=C?1:-1;this.addCurrentVertex(x,J,er,er,E)}else ke==="round"&&(C&&(this.addCurrentVertex(x,F,0,0,E),this.addCurrentVertex(x,F,1,1,E,!0)),R&&(this.addCurrentVertex(x,G,-1,-1,E,!0),this.addCurrentVertex(x,G,0,0,E)));if(ge&&j<g-1){var $t=x.dist(R);if($t>2*b){var Xt=x.add(R.sub(x)._mult(b/$t)._round());this.updateDistance(x,Xt),this.addCurrentVertex(Xt,G,0,0,E),x=Xt}}}}},pi.prototype.addCurrentVertex=function(e,t,r,a,l,c){c===void 0&&(c=!1);var h=t.y*a-t.x,m=-t.y-t.x*a;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,c,!1,r,l),this.addHalfVertex(e,h,m,c,!0,-a,l),this.distance>$c/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(e,t,r,a,l,c))},pi.prototype.addHalfVertex=function(e,t,r,a,l,c,h){var m=.5*(this.lineClips?this.scaledDistance*($c-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e.x<<1)+(a?1:0),(e.y<<1)+(l?1:0),Math.round(63*t)+128,Math.round(63*r)+128,1+(c===0?0:c<0?-1:1)|(63&m)<<2,m>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var g=h.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,g),h.primitiveLength++),l?this.e2=g:this.e1=g},pi.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},pi.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},De("LineBucket",pi,{omit:["layers","patternFeatures"]});var Qh=new Zr({"line-cap":new Ue(A.layout_line["line-cap"]),"line-join":new Re(A.layout_line["line-join"]),"line-miter-limit":new Ue(A.layout_line["line-miter-limit"]),"line-round-limit":new Ue(A.layout_line["line-round-limit"]),"line-sort-key":new Re(A.layout_line["line-sort-key"])}),Qc={paint:new Zr({"line-opacity":new Re(A.paint_line["line-opacity"]),"line-color":new Re(A.paint_line["line-color"]),"line-translate":new Ue(A.paint_line["line-translate"]),"line-translate-anchor":new Ue(A.paint_line["line-translate-anchor"]),"line-width":new Re(A.paint_line["line-width"]),"line-gap-width":new Re(A.paint_line["line-gap-width"]),"line-offset":new Re(A.paint_line["line-offset"]),"line-blur":new Re(A.paint_line["line-blur"]),"line-dasharray":new ei(A.paint_line["line-dasharray"]),"line-pattern":new $a(A.paint_line["line-pattern"]),"line-gradient":new $i(A.paint_line["line-gradient"])}),layout:Qh},ep=new((function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a){return a=new ht(Math.floor(a.zoom),{now:a.now,fadeDuration:a.fadeDuration,zoomHistory:a.zoomHistory,transition:a.transition}),e.prototype.possiblyEvaluate.call(this,r,a)},t.prototype.evaluate=function(r,a,l,c){return a=Sr({},a,{zoom:Math.floor(a.zoom)}),e.prototype.evaluate.call(this,r,a,l,c)},t})(Re))(Qc.paint.properties["line-width"].specification);ep.useIntegerZoom=!0;var ef=(function(e){function t(r){e.call(this,r,Qc),this.gradientVersion=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof mi,this.gradientVersion=(this.gradientVersion+1)%Zi)},t.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a),this.paint._values["line-floorwidth"]=ep.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,r)},t.prototype.createBucket=function(r){return new pi(r)},t.prototype.queryRadius=function(r){var a=r,l=tp(fn("line-width",this,a),fn("line-gap-width",this,a)),c=fn("line-offset",this,a);return l/2+Math.abs(c)+Cr(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g){var v=En(r,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),m.angle,g),x=g/2*tp(this.paint.get("line-width").evaluate(a,l),this.paint.get("line-gap-width").evaluate(a,l)),b=this.paint.get("line-offset").evaluate(a,l);return b&&(c=(function(E,C){for(var R=[],F=new Ze(0,0),G=0;G<E.length;G++){for(var j=E[G],J=[],Q=0;Q<j.length;Q++){var te=j[Q],ie=j[Q+1],ce=Q===0?F:te.sub(j[Q-1])._unit()._perp(),ge=Q===j.length-1?F:ie.sub(te)._unit()._perp(),be=ce._add(ge)._unit();be._mult(1/(be.x*ge.x+be.y*ge.y)),J.push(be._mult(C)._add(te))}R.push(J)}return R})(c,b*g)),(function(E,C,R){for(var F=0;F<C.length;F++){var G=C[F];if(E.length>=3){for(var j=0;j<G.length;j++)if(hn(E,G[j]))return!0}if(Ui(E,G,R))return!0}return!1})(v,c,x)},t.prototype.isTileClipped=function(){return!0},t})(cn);function tp(e,t){return t>0?t+2*e:e}var tf=Br([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),rf=Br([{name:"a_projected_pos",components:3,type:"Float32"}],4),nf=(Br([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Br([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),rp=(Br([{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"}]),Br([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),of=Br([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function af(e,t,r){return e.sections.forEach((function(a){a.text=(function(l,c,h){var m=c.layout.get("text-transform").evaluate(h,{});return m==="uppercase"?l=l.toLocaleUpperCase():m==="lowercase"&&(l=l.toLocaleLowerCase()),Pi.applyArabicShaping&&(l=Pi.applyArabicShaping(l)),l})(a.text,t,r)})),e}Br([{name:"triangle",components:3,type:"Uint16"}]),Br([{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"}]),Br([{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"}]),Br([{type:"Float32",name:"offsetX"}]),Br([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var ul={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},ip=function(e,t,r,a,l){var c,h,m=8*l-a-1,g=(1<<m)-1,v=g>>1,x=-7,b=l-1,E=-1,C=e[t+b];for(b+=E,c=C&(1<<-x)-1,C>>=-x,x+=m;x>0;c=256*c+e[t+b],b+=E,x-=8);for(h=c&(1<<-x)-1,c>>=-x,x+=a;x>0;h=256*h+e[t+b],b+=E,x-=8);if(c===0)c=1-v;else{if(c===g)return h?NaN:1/0*(C?-1:1);h+=Math.pow(2,a),c-=v}return(C?-1:1)*h*Math.pow(2,c-a)},np=function(e,t,r,a,l,c){var h,m,g,v=8*c-l-1,x=(1<<v)-1,b=x>>1,E=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=0,R=1,F=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,h=x):(h=Math.floor(Math.log(t)/Math.LN2),t*(g=Math.pow(2,-h))<1&&(h--,g*=2),(t+=h+b>=1?E/g:E*Math.pow(2,1-b))*g>=2&&(h++,g/=2),h+b>=x?(m=0,h=x):h+b>=1?(m=(t*g-1)*Math.pow(2,l),h+=b):(m=t*Math.pow(2,b-1)*Math.pow(2,l),h=0));l>=8;e[r+C]=255&m,C+=R,m/=256,l-=8);for(h=h<<l|m,v+=l;v>0;e[r+C]=255&h,C+=R,h/=256,v-=8);e[r+C-R]|=128*F},pu=Ut;function Ut(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Ut.Varint=0,Ut.Fixed64=1,Ut.Bytes=2,Ut.Fixed32=5;var op=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Po(e){return e.type===Ut.Bytes?e.readVarint()+e.pos:e.pos+1}function ls(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function ap(e,t,r){var a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(a);for(var l=r.pos-1;l>=e;l--)r.buf[l+a]=r.buf[l]}function sf(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function lf(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function uf(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function cf(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function pf(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function hf(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function ff(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function df(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function mf(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function hu(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function us(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function sp(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function yf(e,t,r){e===1&&r.readMessage(gf,t)}function gf(e,t,r){if(e===3){var a=r.readMessage(vf,{}),l=a.width,c=a.height,h=a.left,m=a.top,g=a.advance;t.push({id:a.id,bitmap:new Ca({width:l+6,height:c+6},a.bitmap),metrics:{width:l,height:c,left:h,top:m,advance:g}})}}function vf(e,t,r){e===1?t.id=r.readVarint():e===2?t.bitmap=r.readBytes():e===3?t.width=r.readVarint():e===4?t.height=r.readVarint():e===5?t.left=r.readSVarint():e===6?t.top=r.readSVarint():e===7&&(t.advance=r.readVarint())}function lp(e){for(var t=0,r=0,a=0,l=e;a<l.length;a+=1){var c=l[a];t+=c.w*c.h,r=Math.max(r,c.w)}e.sort((function(F,G){return G.h-F.h}));for(var h=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],m=0,g=0,v=0,x=e;v<x.length;v+=1)for(var b=x[v],E=h.length-1;E>=0;E--){var C=h[E];if(!(b.w>C.w||b.h>C.h)){if(b.x=C.x,b.y=C.y,g=Math.max(g,b.y+b.h),m=Math.max(m,b.x+b.w),b.w===C.w&&b.h===C.h){var R=h.pop();E<h.length&&(h[E]=R)}else b.h===C.h?(C.x+=b.w,C.w-=b.w):b.w===C.w?(C.y+=b.h,C.h-=b.h):(h.push({x:C.x+b.w,y:C.y,w:C.w-b.w,h:b.h}),C.y+=b.h,C.h-=b.h);break}}return{w:m,h:g,fill:t/(m*g)||0}}Ut.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var a=this.readVarint(),l=a>>3,c=this.pos;this.type=7&a,e(l,t,this),this.pos===c&&this.skip(a)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=hu(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=sp(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=hu(this.buf,this.pos)+4294967296*hu(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=hu(this.buf,this.pos)+4294967296*sp(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=ip(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=ip(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,a=this.buf;return t=127&(r=a[this.pos++]),r<128?t:(t|=(127&(r=a[this.pos++]))<<7,r<128?t:(t|=(127&(r=a[this.pos++]))<<14,r<128?t:(t|=(127&(r=a[this.pos++]))<<21,r<128?t:(function(l,c,h){var m,g,v=h.buf;if(m=(112&(g=v[h.pos++]))>>4,g<128||(m|=(127&(g=v[h.pos++]))<<3,g<128)||(m|=(127&(g=v[h.pos++]))<<10,g<128)||(m|=(127&(g=v[h.pos++]))<<17,g<128)||(m|=(127&(g=v[h.pos++]))<<24,g<128)||(m|=(1&(g=v[h.pos++]))<<31,g<128))return ls(l,m,c);throw new Error("Expected varint not more than 10 bytes")})(t|=(15&(r=a[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&op?(function(r,a,l){return op.decode(r.subarray(a,l))})(this.buf,t,e):(function(r,a,l){for(var c="",h=a;h<l;){var m,g,v,x=r[h],b=null,E=x>239?4:x>223?3:x>191?2:1;if(h+E>l)break;E===1?x<128&&(b=x):E===2?(192&(m=r[h+1]))==128&&(b=(31&x)<<6|63&m)<=127&&(b=null):E===3?(g=r[h+2],(192&(m=r[h+1]))==128&&(192&g)==128&&((b=(15&x)<<12|(63&m)<<6|63&g)<=2047||b>=55296&&b<=57343)&&(b=null)):E===4&&(g=r[h+2],v=r[h+3],(192&(m=r[h+1]))==128&&(192&g)==128&&(192&v)==128&&((b=(15&x)<<18|(63&m)<<12|(63&g)<<6|63&v)<=65535||b>=1114112)&&(b=null)),b===null?(b=65533,E=1):b>65535&&(b-=65536,c+=String.fromCharCode(b>>>10&1023|55296),b=56320|1023&b),c+=String.fromCharCode(b),h+=E}return c})(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Ut.Bytes)return e.push(this.readVarint(t));var r=Po(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==Ut.Bytes)return e.push(this.readSVarint());var t=Po(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==Ut.Bytes)return e.push(this.readBoolean());var t=Po(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==Ut.Bytes)return e.push(this.readFloat());var t=Po(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==Ut.Bytes)return e.push(this.readDouble());var t=Po(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==Ut.Bytes)return e.push(this.readFixed32());var t=Po(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==Ut.Bytes)return e.push(this.readSFixed32());var t=Po(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==Ut.Bytes)return e.push(this.readFixed64());var t=Po(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==Ut.Bytes)return e.push(this.readSFixed64());var t=Po(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===Ut.Varint)for(;this.buf[this.pos++]>127;);else if(t===Ut.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Ut.Fixed32)this.pos+=4;else{if(t!==Ut.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),us(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),us(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),us(this.buf,-1&e,this.pos),us(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),us(this.buf,-1&e,this.pos),us(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?(function(t,r){var a,l;if(t>=0?(a=t%4294967296|0,l=t/4294967296|0):(l=~(-t/4294967296),4294967295^(a=~(-t%4294967296))?a=a+1|0:(a=0,l=l+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),(function(c,h,m){m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,m.buf[m.pos]=127&(c>>>=7)})(a,0,r),(function(c,h){var m=(7&c)<<4;h.buf[h.pos++]|=m|((c>>>=3)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c)))))})(l,r)})(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(!!e)},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=(function(a,l,c){for(var h,m,g=0;g<l.length;g++){if((h=l.charCodeAt(g))>55295&&h<57344){if(!m){h>56319||g+1===l.length?(a[c++]=239,a[c++]=191,a[c++]=189):m=h;continue}if(h<56320){a[c++]=239,a[c++]=191,a[c++]=189,m=h;continue}h=m-55296<<10|h-56320|65536,m=null}else m&&(a[c++]=239,a[c++]=191,a[c++]=189,m=null);h<128?a[c++]=h:(h<2048?a[c++]=h>>6|192:(h<65536?a[c++]=h>>12|224:(a[c++]=h>>18|240,a[c++]=h>>12&63|128),a[c++]=h>>6&63|128),a[c++]=63&h|128)}return c})(this.buf,e,this.pos);var r=this.pos-t;r>=128&&ap(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),np(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),np(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var a=this.pos-r;a>=128&&ap(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(e,t,r){this.writeTag(e,Ut.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,sf,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,lf,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,pf,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,uf,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,cf,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,hf,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,ff,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,df,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,mf,t)},writeBytesField:function(e,t){this.writeTag(e,Ut.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Ut.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Ut.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Ut.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Ut.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Ut.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Ut.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Ut.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Ut.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Ut.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};var fu=function(e,t){var r=t.pixelRatio,a=t.version,l=t.stretchX,c=t.stretchY,h=t.content;this.paddedRect=e,this.pixelRatio=r,this.stretchX=l,this.stretchY=c,this.content=h,this.version=a},cl={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};cl.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},cl.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},cl.tlbr.get=function(){return this.tl.concat(this.br)},cl.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(fu.prototype,cl);var pl=function(e,t){var r={},a={};this.haveRenderCallbacks=[];var l=[];this.addImages(e,r,l),this.addImages(t,a,l);var c=lp(l),h=new wi({width:c.w||1,height:c.h||1});for(var m in e){var g=e[m],v=r[m].paddedRect;wi.copy(g.data,h,{x:0,y:0},{x:v.x+1,y:v.y+1},g.data)}for(var x in t){var b=t[x],E=a[x].paddedRect,C=E.x+1,R=E.y+1,F=b.data.width,G=b.data.height;wi.copy(b.data,h,{x:0,y:0},{x:C,y:R},b.data),wi.copy(b.data,h,{x:0,y:G-1},{x:C,y:R-1},{width:F,height:1}),wi.copy(b.data,h,{x:0,y:0},{x:C,y:R+G},{width:F,height:1}),wi.copy(b.data,h,{x:F-1,y:0},{x:C-1,y:R},{width:1,height:G}),wi.copy(b.data,h,{x:0,y:0},{x:C+F,y:R},{width:1,height:G})}this.image=h,this.iconPositions=r,this.patternPositions=a};pl.prototype.addImages=function(e,t,r){for(var a in e){var l=e[a],c={x:0,y:0,w:l.data.width+2,h:l.data.height+2};r.push(c),t[a]=new fu(c,l),l.hasRenderCallback&&this.haveRenderCallbacks.push(a)}},pl.prototype.patchUpdatedImages=function(e,t){for(var r in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)},pl.prototype.patchUpdatedImage=function(e,t,r){if(e&&t&&e.version!==t.version){e.version=t.version;var a=e.tl;r.update(t.data,void 0,{x:a[0],y:a[1]})}},De("ImagePosition",fu),De("ImageAtlas",pl);var Ni={horizontal:1,vertical:2,horizontalOnly:3},cs=function(){this.scale=1,this.fontStack="",this.imageName=null};cs.forText=function(e,t){var r=new cs;return r.scale=e||1,r.fontStack=t,r},cs.forImage=function(e){var t=new cs;return t.imageName=e,t};var ri=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function du(e,t,r,a,l,c,h,m,g,v,x,b,E,C,R,F){var G,j=ri.fromFeature(e,l);b===Ni.vertical&&j.verticalizePunctuation();var J=Pi.processBidirectionalText,Q=Pi.processStyledBidirectionalText;if(J&&j.sections.length===1){G=[];for(var te=0,ie=J(j.toString(),yc(j,v,c,t,a,C,R));te<ie.length;te+=1){var ce=ie[te],ge=new ri;ge.text=ce,ge.sections=j.sections;for(var be=0;be<ce.length;be++)ge.sectionIndex.push(0);G.push(ge)}}else if(Q){G=[];for(var Oe=0,Ee=Q(j.text,j.sectionIndex,yc(j,v,c,t,a,C,R));Oe<Ee.length;Oe+=1){var je=Ee[Oe],ke=new ri;ke.text=je[0],ke.sectionIndex=je[1],ke.sections=j.sections,G.push(ke)}}else G=(function(Fe,ct){for(var it=[],xt=Fe.text,Ge=0,St=0,Wt=ct;St<Wt.length;St+=1){var er=Wt[St];it.push(Fe.substring(Ge,er)),Ge=er}return Ge<xt.length&&it.push(Fe.substring(Ge,xt.length)),it})(j,yc(j,v,c,t,a,C,R));var st=[],Je={positionedLines:st,text:j.toString(),top:x[1],bottom:x[1],left:x[0],right:x[0],writingMode:b,iconsInText:!1,verticalizable:!1};return(function(Fe,ct,it,xt,Ge,St,Wt,er,$t,Xt,tr,Pr){for(var Ar=0,ii=-17,Or=0,ni=0,lr=er==="right"?1:er==="left"?0:.5,Vr=0,ft=0,Rt=Ge;ft<Rt.length;ft+=1){var zt=Rt[ft];zt.trim();var wt=zt.getMaxScale(),hi=24*(wt-1),Xr={positionedGlyphs:[],lineOffset:0};Fe.positionedLines[Vr]=Xr;var jt=Xr.positionedGlyphs,mr=0;if(zt.length()){for(var Hr=0;Hr<zt.length();Hr++){var It=zt.getSection(Hr),Qn=zt.getSectionIndex(Hr),ji=zt.getCharCode(Hr),eo=0,ur=null,to=null,dn=null,vs=24,Ma=!($t===Ni.horizontal||!tr&&!Ka(ji)||tr&&(mu[ji]||(Do=ji,Se.Arabic(Do)||Se["Arabic Supplement"](Do)||Se["Arabic Extended-A"](Do)||Se["Arabic Presentation Forms-A"](Do)||Se["Arabic Presentation Forms-B"](Do))));if(It.imageName){var _s=xt[It.imageName];if(!_s)continue;dn=It.imageName,Fe.iconsInText=Fe.iconsInText||!0,to=_s.paddedRect;var Mo=_s.displaySize;It.scale=24*It.scale/Pr,eo=hi+(24-Mo[1]*It.scale),vs=(ur={width:Mo[0],height:Mo[1],left:1,top:-3,advance:Ma?Mo[1]:Mo[0]}).advance;var xs=Ma?Mo[0]*It.scale-24*wt:Mo[1]*It.scale-24*wt;xs>0&&xs>mr&&(mr=xs)}else{var Iu=it[It.fontStack],bs=Iu&&Iu[ji];if(bs&&bs.rect)to=bs.rect,ur=bs.metrics;else{var dl=ct[It.fontStack],Eu=dl&&dl[ji];if(!Eu)continue;ur=Eu.metrics}eo=24*(wt-It.scale)}Ma?(Fe.verticalizable=!0,jt.push({glyph:ji,imageName:dn,x:Ar,y:ii+eo,vertical:Ma,scale:It.scale,fontStack:It.fontStack,sectionIndex:Qn,metrics:ur,rect:to}),Ar+=vs*It.scale+Xt):(jt.push({glyph:ji,imageName:dn,x:Ar,y:ii+eo,vertical:Ma,scale:It.scale,fontStack:It.fontStack,sectionIndex:Qn,metrics:ur,rect:to}),Ar+=ur.advance*It.scale+Xt)}jt.length!==0&&(Or=Math.max(Ar-Xt,Or),xf(jt,0,jt.length-1,lr,mr)),Ar=0;var Tu=St*wt+mr;Xr.lineOffset=Math.max(mr,hi),ii+=Tu,ni=Math.max(Tu,ni),++Vr}else ii+=St,++Vr}var Do,ml=ii- -17,ws=gc(Wt),ea=ws.horizontalAlign,Ss=ws.verticalAlign;(function(ku,Cu,yl,gl,Pu,vl,_l,xl,Au){var Is,zu=(Cu-yl)*Pu;Is=vl!==_l?-xl*gl- -17:(-gl*Au+.5)*_l;for(var Es=0,bl=ku;Es<bl.length;Es+=1)for(var Da=0,wl=bl[Es].positionedGlyphs;Da<wl.length;Da+=1){var Ts=wl[Da];Ts.x+=zu,Ts.y+=Is}})(Fe.positionedLines,lr,ea,Ss,Or,ni,St,ml,Ge.length),Fe.top+=-Ss*ml,Fe.bottom=Fe.top+ml,Fe.left+=-ea*Or,Fe.right=Fe.left+Or})(Je,t,r,a,G,h,m,g,b,v,E,F),!(function(Fe){for(var ct=0,it=Fe;ct<it.length;ct+=1)if(it[ct].positionedGlyphs.length!==0)return!1;return!0})(st)&&Je}ri.fromFeature=function(e,t){for(var r=new ri,a=0;a<e.sections.length;a++){var l=e.sections[a];l.image?r.addImageSection(l):r.addTextSection(l,t)}return r},ri.prototype.length=function(){return this.text.length},ri.prototype.getSection=function(e){return this.sections[this.sectionIndex[e]]},ri.prototype.getSectionIndex=function(e){return this.sectionIndex[e]},ri.prototype.getCharCode=function(e){return this.text.charCodeAt(e)},ri.prototype.verticalizePunctuation=function(){this.text=(function(e){for(var t="",r=0;r<e.length;r++){var a=e.charCodeAt(r+1)||null,l=e.charCodeAt(r-1)||null;t+=a&&Hs(a)&&!ul[e[r+1]]||l&&Hs(l)&&!ul[e[r-1]]||!ul[e[r]]?e[r]:ul[e[r]]}return t})(this.text)},ri.prototype.trim=function(){for(var e=0,t=0;t<this.text.length&&mu[this.text.charCodeAt(t)];t++)e++;for(var r=this.text.length,a=this.text.length-1;a>=0&&a>=e&&mu[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},ri.prototype.substring=function(e,t){var r=new ri;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},ri.prototype.toString=function(){return this.text},ri.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce((function(t,r){return Math.max(t,e.sections[r].scale)}),0)},ri.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(cs.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,a=0;a<e.text.length;++a)this.sectionIndex.push(r)},ri.prototype.addImageSection=function(e){var t=e.image?e.image.name:"";if(t.length!==0){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(cs.forImage(t)),this.sectionIndex.push(this.sections.length-1)):Ht("Reached maximum number of images 6401")}else Ht("Can't add FormattedSection with an empty image.")},ri.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var mu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},zi={};function up(e,t,r,a,l,c){if(t.imageName){var h=a[t.imageName];return h?h.displaySize[0]*t.scale*24/c+l:0}var m=r[t.fontStack],g=m&&m[e];return g?g.metrics.advance*t.scale+l:0}function cp(e,t,r,a){var l=Math.pow(e-t,2);return a?e<t?l/2:2*l:l+Math.abs(r)*r}function _f(e,t,r){var a=0;return e===10&&(a-=1e4),r&&(a+=150),e!==40&&e!==65288||(a+=50),t!==41&&t!==65289||(a+=50),a}function pp(e,t,r,a,l,c){for(var h=null,m=cp(t,r,l,c),g=0,v=a;g<v.length;g+=1){var x=v[g],b=cp(t-x.x,r,l,c)+x.badness;b<=m&&(h=x,m=b)}return{index:e,x:t,priorBreak:h,badness:m}}function yc(e,t,r,a,l,c,h){if(c!=="point")return[];if(!e)return[];for(var m,g=[],v=(function(G,j,J,Q,te,ie){for(var ce=0,ge=0;ge<G.length();ge++){var be=G.getSection(ge);ce+=up(G.getCharCode(ge),be,Q,te,j,ie)}return ce/Math.max(1,Math.ceil(ce/J))})(e,t,r,a,l,h),x=e.text.indexOf("")>=0,b=0,E=0;E<e.length();E++){var C=e.getSection(E),R=e.getCharCode(E);if(mu[R]||(b+=up(R,C,a,l,t,h)),E<e.length()-1){var F=!((m=R)<11904||!(Se["Bopomofo Extended"](m)||Se.Bopomofo(m)||Se["CJK Compatibility Forms"](m)||Se["CJK Compatibility Ideographs"](m)||Se["CJK Compatibility"](m)||Se["CJK Radicals Supplement"](m)||Se["CJK Strokes"](m)||Se["CJK Symbols and Punctuation"](m)||Se["CJK Unified Ideographs Extension A"](m)||Se["CJK Unified Ideographs"](m)||Se["Enclosed CJK Letters and Months"](m)||Se["Halfwidth and Fullwidth Forms"](m)||Se.Hiragana(m)||Se["Ideographic Description Characters"](m)||Se["Kangxi Radicals"](m)||Se["Katakana Phonetic Extensions"](m)||Se.Katakana(m)||Se["Vertical Forms"](m)||Se["Yi Radicals"](m)||Se["Yi Syllables"](m)));(zi[R]||F||C.imageName)&&g.push(pp(E+1,b,v,g,_f(R,e.getCharCode(E+1),F&&x),!1))}}return(function G(j){return j?G(j.priorBreak).concat(j.index):[]})(pp(e.length(),b,v,g,0,!0))}function gc(e){var t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function xf(e,t,r,a,l){if(a||l)for(var c=e[r],h=(e[r].x+c.metrics.advance*c.scale)*a,m=t;m<=r;m++)e[m].x-=h,e[m].y+=l}function hp(e,t,r,a,l,c){var h,m=e.image;if(m.content){var g=m.content,v=m.pixelRatio||1;h=[g[0]/v,g[1]/v,m.displaySize[0]-g[2]/v,m.displaySize[1]-g[3]/v]}var x,b,E,C,R=t.left*c,F=t.right*c;r==="width"||r==="both"?(C=l[0]+R-a[3],b=l[0]+F+a[1]):b=(C=l[0]+(R+F-m.displaySize[0])/2)+m.displaySize[0];var G=t.top*c,j=t.bottom*c;return r==="height"||r==="both"?(x=l[1]+G-a[0],E=l[1]+j+a[2]):E=(x=l[1]+(G+j-m.displaySize[1])/2)+m.displaySize[1],{image:m,top:x,right:b,bottom:E,left:C,collisionPadding:h}}zi[10]=!0,zi[32]=!0,zi[38]=!0,zi[40]=!0,zi[41]=!0,zi[43]=!0,zi[45]=!0,zi[47]=!0,zi[173]=!0,zi[183]=!0,zi[8203]=!0,zi[8208]=!0,zi[8211]=!0,zi[8231]=!0;var ps=(function(e){function t(r,a,l,c){e.call(this,r,a),this.angle=l,c!==void 0&&(this.segment=c)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.clone=function(){return new t(this.x,this.y,this.angle,this.segment)},t})(Ze);function vc(e,t){var r=t.expression;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new ht(e+1))};if(r.kind==="source")return{kind:"source"};for(var a=r.zoomStops,l=r.interpolationType,c=0;c<a.length&&a[c]<=e;)c++;for(var h=c=Math.max(0,c-1);h<a.length&&a[h]<e+1;)h++;h=Math.min(a.length-1,h);var m=a[c],g=a[h];return r.kind==="composite"?{kind:"composite",minZoom:m,maxZoom:g,interpolationType:l}:{kind:"camera",minZoom:m,maxZoom:g,minSize:r.evaluate(new ht(m)),maxSize:r.evaluate(new ht(g)),interpolationType:l}}function fp(e,t,r){var a=t.uSize,l=r.lowerSize;return e.kind==="source"?l/128:e.kind==="composite"?fr(l/128,r.upperSize/128,t.uSizeT):a}function dp(e,t){var r=0,a=0;if(e.kind==="constant")a=e.layoutSize;else if(e.kind!=="source"){var l=e.interpolationType,c=l?gr(jr.interpolationFactor(l,t,e.minZoom,e.maxZoom),0,1):0;e.kind==="camera"?a=fr(e.minSize,e.maxSize,c):r=c}return{uSizeT:r,uSize:a}}De("Anchor",ps);var bf=Object.freeze({__proto__:null,getSizeData:vc,evaluateSizeForFeature:fp,evaluateSizeForZoom:dp,SIZE_PACK_FACTOR:128});function mp(e,t,r,a,l){if(t.segment===void 0)return!0;for(var c=t,h=t.segment+1,m=0;m>-r/2;){if(--h<0)return!1;m-=e[h].dist(c),c=e[h]}m+=e[h].dist(e[h+1]),h++;for(var g=[],v=0;m<r/2;){var x=e[h],b=e[h+1];if(!b)return!1;var E=e[h-1].angleTo(x)-x.angleTo(b);for(E=Math.abs((E+3*Math.PI)%(2*Math.PI)-Math.PI),g.push({distance:m,angleDelta:E}),v+=E;m-g[0].distance>a;)v-=g.shift().angleDelta;if(v>l)return!1;h++,m+=x.dist(b)}return!0}function yp(e){for(var t=0,r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function gp(e,t,r){return e?.6*t*r:0}function vp(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function wf(e,t,r,a,l,c){for(var h=gp(r,l,c),m=vp(r,a)*c,g=0,v=yp(e)/2,x=0;x<e.length-1;x++){var b=e[x],E=e[x+1],C=b.dist(E);if(g+C>v){var R=(v-g)/C,F=fr(b.x,E.x,R),G=fr(b.y,E.y,R),j=new ps(F,G,E.angleTo(b),x);return j._round(),!h||mp(e,j,m,h,t)?j:void 0}g+=C}}function Sf(e,t,r,a,l,c,h,m,g){var v=gp(a,c,h),x=vp(a,l),b=x*h,E=e[0].x===0||e[0].x===g||e[0].y===0||e[0].y===g;return t-b<t/4&&(t=b+t/4),(function C(R,F,G,j,J,Q,te,ie,ce){for(var ge=Q/2,be=yp(R),Oe=0,Ee=F-G,je=[],ke=0;ke<R.length-1;ke++){for(var st=R[ke],Je=R[ke+1],Fe=st.dist(Je),ct=Je.angleTo(st);Ee+G<Oe+Fe;){var it=((Ee+=G)-Oe)/Fe,xt=fr(st.x,Je.x,it),Ge=fr(st.y,Je.y,it);if(xt>=0&&xt<ce&&Ge>=0&&Ge<ce&&Ee-ge>=0&&Ee+ge<=be){var St=new ps(xt,Ge,ct,ke);St._round(),j&&!mp(R,St,Q,j,J)||je.push(St)}}Oe+=Fe}return ie||je.length||te||(je=C(R,Oe/2,G,j,J,Q,te,!0,ce)),je})(e,E?t/2*m%t:(x/2+2*c)*h*m%t,t,v,r,b,E,!1,g)}function _p(e,t,r,a,l){for(var c=[],h=0;h<e.length;h++)for(var m=e[h],g=void 0,v=0;v<m.length-1;v++){var x=m[v],b=m[v+1];x.x<t&&b.x<t||(x.x<t?x=new Ze(t,x.y+(t-x.x)/(b.x-x.x)*(b.y-x.y))._round():b.x<t&&(b=new Ze(t,x.y+(t-x.x)/(b.x-x.x)*(b.y-x.y))._round()),x.y<r&&b.y<r||(x.y<r?x=new Ze(x.x+(r-x.y)/(b.y-x.y)*(b.x-x.x),r)._round():b.y<r&&(b=new Ze(x.x+(r-x.y)/(b.y-x.y)*(b.x-x.x),r)._round()),x.x>=a&&b.x>=a||(x.x>=a?x=new Ze(a,x.y+(a-x.x)/(b.x-x.x)*(b.y-x.y))._round():b.x>=a&&(b=new Ze(a,x.y+(a-x.x)/(b.x-x.x)*(b.y-x.y))._round()),x.y>=l&&b.y>=l||(x.y>=l?x=new Ze(x.x+(l-x.y)/(b.y-x.y)*(b.x-x.x),l)._round():b.y>=l&&(b=new Ze(x.x+(l-x.y)/(b.y-x.y)*(b.x-x.x),l)._round()),g&&x.equals(g[g.length-1])||c.push(g=[x]),g.push(b)))))}return c}function xp(e,t,r,a){var l=[],c=e.image,h=c.pixelRatio,m=c.paddedRect.w-2,g=c.paddedRect.h-2,v=e.right-e.left,x=e.bottom-e.top,b=c.stretchX||[[0,m]],E=c.stretchY||[[0,g]],C=function(xt,Ge){return xt+Ge[1]-Ge[0]},R=b.reduce(C,0),F=E.reduce(C,0),G=m-R,j=g-F,J=0,Q=R,te=0,ie=F,ce=0,ge=G,be=0,Oe=j;if(c.content&&a){var Ee=c.content;J=yu(b,0,Ee[0]),te=yu(E,0,Ee[1]),Q=yu(b,Ee[0],Ee[2]),ie=yu(E,Ee[1],Ee[3]),ce=Ee[0]-J,be=Ee[1]-te,ge=Ee[2]-Ee[0]-Q,Oe=Ee[3]-Ee[1]-ie}var je=function(xt,Ge,St,Wt){var er=gu(xt.stretch-J,Q,v,e.left),$t=vu(xt.fixed-ce,ge,xt.stretch,R),Xt=gu(Ge.stretch-te,ie,x,e.top),tr=vu(Ge.fixed-be,Oe,Ge.stretch,F),Pr=gu(St.stretch-J,Q,v,e.left),Ar=vu(St.fixed-ce,ge,St.stretch,R),ii=gu(Wt.stretch-te,ie,x,e.top),Or=vu(Wt.fixed-be,Oe,Wt.stretch,F),ni=new Ze(er,Xt),lr=new Ze(Pr,Xt),Vr=new Ze(Pr,ii),ft=new Ze(er,ii),Rt=new Ze($t/h,tr/h),zt=new Ze(Ar/h,Or/h),wt=t*Math.PI/180;if(wt){var hi=Math.sin(wt),Xr=Math.cos(wt),jt=[Xr,-hi,hi,Xr];ni._matMult(jt),lr._matMult(jt),ft._matMult(jt),Vr._matMult(jt)}var mr=xt.stretch+xt.fixed,Hr=Ge.stretch+Ge.fixed;return{tl:ni,tr:lr,bl:ft,br:Vr,tex:{x:c.paddedRect.x+1+mr,y:c.paddedRect.y+1+Hr,w:St.stretch+St.fixed-mr,h:Wt.stretch+Wt.fixed-Hr},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Rt,pixelOffsetBR:zt,minFontScaleX:ge/h/v,minFontScaleY:Oe/h/x,isSDF:r}};if(a&&(c.stretchX||c.stretchY))for(var ke=bp(b,G,R),st=bp(E,j,F),Je=0;Je<ke.length-1;Je++)for(var Fe=ke[Je],ct=ke[Je+1],it=0;it<st.length-1;it++)l.push(je(Fe,st[it],ct,st[it+1]));else l.push(je({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:m+1},{fixed:0,stretch:g+1}));return l}function yu(e,t,r){for(var a=0,l=0,c=e;l<c.length;l+=1){var h=c[l];a+=Math.max(t,Math.min(r,h[1]))-Math.max(t,Math.min(r,h[0]))}return a}function bp(e,t,r){for(var a=[{fixed:-1,stretch:0}],l=0,c=e;l<c.length;l+=1){var h=c[l],m=h[0],g=h[1],v=a[a.length-1];a.push({fixed:m-v.stretch,stretch:v.stretch}),a.push({fixed:m-v.stretch,stretch:v.stretch+(g-m)})}return a.push({fixed:t+1,stretch:r}),a}function gu(e,t,r,a){return e/t*r+a}function vu(e,t,r,a){return e-t*r/a}var _u=function(e,t,r,a,l,c,h,m,g,v){if(this.boxStartIndex=e.length,g){var x=c.top,b=c.bottom,E=c.collisionPadding;E&&(x-=E[1],b+=E[3]);var C=b-x;C>0&&(C=Math.max(10,C),this.circleDiameter=C)}else{var R=c.top*h-m,F=c.bottom*h+m,G=c.left*h-m,j=c.right*h+m,J=c.collisionPadding;if(J&&(G-=J[0]*h,R-=J[1]*h,j+=J[2]*h,F+=J[3]*h),v){var Q=new Ze(G,R),te=new Ze(j,R),ie=new Ze(G,F),ce=new Ze(j,F),ge=v*Math.PI/180;Q._rotate(ge),te._rotate(ge),ie._rotate(ge),ce._rotate(ge),G=Math.min(Q.x,te.x,ie.x,ce.x),j=Math.max(Q.x,te.x,ie.x,ce.x),R=Math.min(Q.y,te.y,ie.y,ce.y),F=Math.max(Q.y,te.y,ie.y,ce.y)}e.emplaceBack(t.x,t.y,G,R,j,F,r,a,l)}this.boxEndIndex=e.length},hs=function(e,t){if(e===void 0&&(e=[]),t===void 0&&(t=If),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function If(e,t){return e<t?-1:e>t?1:0}function Ef(e,t,r){r===void 0&&(r=!1);for(var a=1/0,l=1/0,c=-1/0,h=-1/0,m=e[0],g=0;g<m.length;g++){var v=m[g];(!g||v.x<a)&&(a=v.x),(!g||v.y<l)&&(l=v.y),(!g||v.x>c)&&(c=v.x),(!g||v.y>h)&&(h=v.y)}var x=Math.min(c-a,h-l),b=x/2,E=new hs([],Tf);if(x===0)return new Ze(a,l);for(var C=a;C<c;C+=x)for(var R=l;R<h;R+=x)E.push(new fs(C+b,R+b,b,e));for(var F=(function(J){for(var Q=0,te=0,ie=0,ce=J[0],ge=0,be=ce.length,Oe=be-1;ge<be;Oe=ge++){var Ee=ce[ge],je=ce[Oe],ke=Ee.x*je.y-je.x*Ee.y;te+=(Ee.x+je.x)*ke,ie+=(Ee.y+je.y)*ke,Q+=3*ke}return new fs(te/Q,ie/Q,0,J)})(e),G=E.length;E.length;){var j=E.pop();(j.d>F.d||!F.d)&&(F=j,r&&console.log("found best %d after %d probes",Math.round(1e4*j.d)/1e4,G)),j.max-F.d<=t||(E.push(new fs(j.p.x-(b=j.h/2),j.p.y-b,b,e)),E.push(new fs(j.p.x+b,j.p.y-b,b,e)),E.push(new fs(j.p.x-b,j.p.y+b,b,e)),E.push(new fs(j.p.x+b,j.p.y+b,b,e)),G+=4)}return r&&(console.log("num probes: "+G),console.log("best distance: "+F.d)),F.p}function Tf(e,t){return t.max-e.max}function fs(e,t,r,a){this.p=new Ze(e,t),this.h=r,this.d=(function(l,c){for(var h=!1,m=1/0,g=0;g<c.length;g++)for(var v=c[g],x=0,b=v.length,E=b-1;x<b;E=x++){var C=v[x],R=v[E];C.y>l.y!=R.y>l.y&&l.x<(R.x-C.x)*(l.y-C.y)/(R.y-C.y)+C.x&&(h=!h),m=Math.min(m,Jo(l,C,R))}return(h?1:-1)*Math.sqrt(m)})(this.p,a),this.max=this.d+this.h*Math.SQRT2}hs.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},hs.prototype.pop=function(){if(this.length!==0){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},hs.prototype.peek=function(){return this.data[0]},hs.prototype._up=function(e){for(var t=this.data,r=this.compare,a=t[e];e>0;){var l=e-1>>1,c=t[l];if(r(a,c)>=0)break;t[e]=c,e=l}t[e]=a},hs.prototype._down=function(e){for(var t=this.data,r=this.compare,a=this.length>>1,l=t[e];e<a;){var c=1+(e<<1),h=t[c],m=c+1;if(m<this.length&&r(t[m],h)<0&&(c=m,h=t[m]),r(h,l)>=0)break;t[e]=h,e=c}t[e]=l};var _c=Number.POSITIVE_INFINITY;function wp(e,t){return t[1]!==_c?(function(r,a,l){var c=0,h=0;switch(a=Math.abs(a),l=Math.abs(l),r){case"top-right":case"top-left":case"top":h=l-7;break;case"bottom-right":case"bottom-left":case"bottom":h=7-l}switch(r){case"top-right":case"bottom-right":case"right":c=-a;break;case"top-left":case"bottom-left":case"left":c=a}return[c,h]})(e,t[0],t[1]):(function(r,a){var l=0,c=0;a<0&&(a=0);var h=a/Math.sqrt(2);switch(r){case"top-right":case"top-left":c=h-7;break;case"bottom-right":case"bottom-left":c=7-h;break;case"bottom":c=7-a;break;case"top":c=a-7}switch(r){case"top-right":case"bottom-right":l=-h;break;case"top-left":case"bottom-left":l=h;break;case"left":l=a;break;case"right":l=-a}return[l,c]})(e,t[0])}function xc(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Sp(e,t,r,a,l,c,h,m,g,v,x,b,E,C,R){var F=(function(te,ie,ce,ge,be,Oe,Ee,je){for(var ke=ge.layout.get("text-rotate").evaluate(Oe,{})*Math.PI/180,st=[],Je=0,Fe=ie.positionedLines;Je<Fe.length;Je+=1)for(var ct=Fe[Je],it=0,xt=ct.positionedGlyphs;it<xt.length;it+=1){var Ge=xt[it];if(Ge.rect){var St=Ge.rect||{},Wt=4,er=!0,$t=1,Xt=0,tr=(be||je)&&Ge.vertical,Pr=Ge.metrics.advance*Ge.scale/2;if(je&&ie.verticalizable&&(Xt=ct.lineOffset/2-(Ge.imageName?-(24-Ge.metrics.width*Ge.scale)/2:24*(Ge.scale-1))),Ge.imageName){var Ar=Ee[Ge.imageName];er=Ar.sdf,Wt=1/($t=Ar.pixelRatio)}var ii=be?[Ge.x+Pr,Ge.y]:[0,0],Or=be?[0,0]:[Ge.x+Pr+ce[0],Ge.y+ce[1]-Xt],ni=[0,0];tr&&(ni=Or,Or=[0,0]);var lr=(Ge.metrics.left-Wt)*Ge.scale-Pr+Or[0],Vr=(-Ge.metrics.top-Wt)*Ge.scale+Or[1],ft=lr+St.w*Ge.scale/$t,Rt=Vr+St.h*Ge.scale/$t,zt=new Ze(lr,Vr),wt=new Ze(ft,Vr),hi=new Ze(lr,Rt),Xr=new Ze(ft,Rt);if(tr){var jt=new Ze(-Pr,Pr- -17),mr=-Math.PI/2,Hr=12-Pr,It=new Ze(22-Hr,-(Ge.imageName?Hr:0)),Qn=new(Function.prototype.bind.apply(Ze,[null].concat(ni)));zt._rotateAround(mr,jt)._add(It)._add(Qn),wt._rotateAround(mr,jt)._add(It)._add(Qn),hi._rotateAround(mr,jt)._add(It)._add(Qn),Xr._rotateAround(mr,jt)._add(It)._add(Qn)}if(ke){var ji=Math.sin(ke),eo=Math.cos(ke),ur=[eo,-ji,ji,eo];zt._matMult(ur),wt._matMult(ur),hi._matMult(ur),Xr._matMult(ur)}var to=new Ze(0,0),dn=new Ze(0,0);st.push({tl:zt,tr:wt,bl:hi,br:Xr,tex:St,writingMode:ie.writingMode,glyphOffset:ii,sectionIndex:Ge.sectionIndex,isSDF:er,pixelOffsetTL:to,pixelOffsetBR:dn,minFontScaleX:0,minFontScaleY:0})}}return st})(0,r,m,l,c,h,a,e.allowVerticalPlacement),G=e.textSizeData,j=null;G.kind==="source"?(j=[128*l.layout.get("text-size").evaluate(h,{})])[0]>32640&&Ht(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):G.kind==="composite"&&((j=[128*C.compositeTextSizes[0].evaluate(h,{},R),128*C.compositeTextSizes[1].evaluate(h,{},R)])[0]>32640||j[1]>32640)&&Ht(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),e.addSymbols(e.text,F,j,m,c,h,v,t,g.lineStartIndex,g.lineLength,E,R);for(var J=0,Q=x;J<Q.length;J+=1)b[Q[J]]=e.text.placedSymbolArray.length-1;return 4*F.length}function Ip(e){for(var t in e)return e[t];return null}function kf(e,t,r,a){var l=e.compareText;if(t in l){for(var c=l[t],h=c.length-1;h>=0;h--)if(a.dist(c[h])<r)return!0}else l[t]=[];return l[t].push(a),!1}var Cf=ss.VectorTileFeature.types,Pf=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function xu(e,t,r,a,l,c,h,m,g,v,x,b,E){var C=m?Math.min(32640,Math.round(m[0])):0,R=m?Math.min(32640,Math.round(m[1])):0;e.emplaceBack(t,r,Math.round(32*a),Math.round(32*l),c,h,(C<<1)+(g?1:0),R,16*v,16*x,256*b,256*E)}function bc(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function Af(e){for(var t=0,r=e.sections;t<r.length;t+=1)if(Ja(r[t].text))return!0;return!1}var ds=function(e){this.layoutVertexArray=new es,this.indexArray=new Xn,this.programConfigurations=e,this.segments=new z,this.dynamicLayoutVertexArray=new Xo,this.opacityVertexArray=new wa,this.placedSymbolArray=new s};ds.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},ds.prototype.upload=function(e,t,r,a){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,tf.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,rf.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Pf,!0),this.opacityVertexBuffer.itemSize=1),(r||a)&&this.programConfigurations.upload(e))},ds.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",ds);var hl=function(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new z,this.collisionVertexArray=new el};hl.prototype.upload=function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,nf.members,!0)},hl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},De("CollisionBuffers",hl);var Dt=function(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(c){return c.id})),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Ai([]),this.placementViewportMatrix=Ai([]);var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=vc(this.zoom,t["text-size"]),this.iconSizeData=vc(this.zoom,t["icon-size"]);var r=this.layers[0].layout,a=r.get("symbol-sort-key"),l=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=l!=="viewport-y"&&a.constantOr(1)!==void 0,this.sortFeaturesByY=(l==="viewport-y"||l==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,r.get("symbol-placement")==="point"&&(this.writingModes=r.get("text-writing-mode").map((function(c){return Ni[c]}))),this.stateDependentLayerIds=this.layers.filter((function(c){return c.isStateDependent()})).map((function(c){return c.id})),this.sourceID=e.sourceID};Dt.prototype.createArrays=function(){this.text=new ds(new Ke(this.layers,this.zoom,(function(e){return/^text/.test(e)}))),this.icon=new ds(new Ke(this.layers,this.zoom,(function(e){return/^icon/.test(e)}))),this.glyphOffsetArray=new d,this.lineVertexArray=new y,this.symbolInstances=new f},Dt.prototype.calculateGlyphDependencies=function(e,t,r,a,l){for(var c=0;c<e.length;c++)if(t[e.charCodeAt(c)]=!0,(r||a)&&l){var h=ul[e.charAt(c)];h&&(t[h.charCodeAt(0)]=!0)}},Dt.prototype.populate=function(e,t,r){var a=this.layers[0],l=a.layout,c=l.get("text-font"),h=l.get("text-field"),m=l.get("icon-image"),g=(h.value.kind!=="constant"||h.value.value instanceof Dr&&!h.value.value.isEmpty()||h.value.value.toString().length>0)&&(c.value.kind!=="constant"||c.value.value.length>0),v=m.value.kind!=="constant"||!!m.value.value||Object.keys(m.parameters).length>0,x=l.get("symbol-sort-key");if(this.features=[],g||v){for(var b=t.iconDependencies,E=t.glyphDependencies,C=t.availableImages,R=new ht(this.zoom),F=0,G=e;F<G.length;F+=1){var j=G[F],J=j.feature,Q=j.id,te=j.index,ie=j.sourceLayerIndex,ce=a._featureFilter.needGeometry,ge=sr(J,ce);if(a._featureFilter.filter(R,ge,r)){ce||(ge.geometry=Yt(J));var be=void 0;if(g){var Oe=a.getValueAndResolveTokens("text-field",ge,r,C),Ee=Dr.factory(Oe);Af(Ee)&&(this.hasRTLText=!0),(!this.hasRTLText||Js()==="unavailable"||this.hasRTLText&&Pi.isParsed())&&(be=af(Ee,a,ge))}var je=void 0;if(v){var ke=a.getValueAndResolveTokens("icon-image",ge,r,C);je=ke instanceof li?ke:li.fromString(ke)}if(be||je){var st=this.sortFeaturesByKey?x.evaluate(ge,{},r):void 0;if(this.features.push({id:Q,text:be,icon:je,index:te,sourceLayerIndex:ie,geometry:ge.geometry,properties:J.properties,type:Cf[J.type],sortKey:st}),je&&(b[je.name]=!0),be){var Je=c.evaluate(ge,{},r).join(","),Fe=l.get("text-rotation-alignment")==="map"&&l.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Ni.vertical)>=0;for(var ct=0,it=be.sections;ct<it.length;ct+=1){var xt=it[ct];if(xt.image)b[xt.image.name]=!0;else{var Ge=Xs(be.toString()),St=xt.fontStack||Je,Wt=E[St]=E[St]||{};this.calculateGlyphDependencies(xt.text,Wt,Fe,this.allowVerticalPlacement,Ge)}}}}}}l.get("symbol-placement")==="line"&&(this.features=(function(er){var $t={},Xt={},tr=[],Pr=0;function Ar(jt){tr.push(er[jt]),Pr++}function ii(jt,mr,Hr){var It=Xt[jt];return delete Xt[jt],Xt[mr]=It,tr[It].geometry[0].pop(),tr[It].geometry[0]=tr[It].geometry[0].concat(Hr[0]),It}function Or(jt,mr,Hr){var It=$t[mr];return delete $t[mr],$t[jt]=It,tr[It].geometry[0].shift(),tr[It].geometry[0]=Hr[0].concat(tr[It].geometry[0]),It}function ni(jt,mr,Hr){var It=Hr?mr[0][mr[0].length-1]:mr[0][0];return jt+":"+It.x+":"+It.y}for(var lr=0;lr<er.length;lr++){var Vr=er[lr],ft=Vr.geometry,Rt=Vr.text?Vr.text.toString():null;if(Rt){var zt=ni(Rt,ft),wt=ni(Rt,ft,!0);if(zt in Xt&&wt in $t&&Xt[zt]!==$t[wt]){var hi=Or(zt,wt,ft),Xr=ii(zt,wt,tr[hi].geometry);delete $t[zt],delete Xt[wt],Xt[ni(Rt,tr[Xr].geometry,!0)]=Xr,tr[hi].geometry=null}else zt in Xt?ii(zt,wt,ft):wt in $t?Or(zt,wt,ft):(Ar(lr),$t[zt]=Pr-1,Xt[wt]=Pr-1)}else Ar(lr)}return tr.filter((function(jt){return jt.geometry}))})(this.features)),this.sortFeaturesByKey&&this.features.sort((function(er,$t){return er.sortKey-$t.sortKey}))}},Dt.prototype.update=function(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))},Dt.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},Dt.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Dt.prototype.upload=function(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Dt.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Dt.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Dt.prototype.addToLineVertexArray=function(e,t){var r=this.lineVertexArray.length;if(e.segment!==void 0){for(var a=e.dist(t[e.segment+1]),l=e.dist(t[e.segment]),c={},h=e.segment+1;h<t.length;h++)c[h]={x:t[h].x,y:t[h].y,tileUnitDistanceFromAnchor:a},h<t.length-1&&(a+=t[h+1].dist(t[h]));for(var m=e.segment||0;m>=0;m--)c[m]={x:t[m].x,y:t[m].y,tileUnitDistanceFromAnchor:l},m>0&&(l+=t[m-1].dist(t[m]));for(var g=0;g<t.length;g++){var v=c[g];this.lineVertexArray.emplaceBack(v.x,v.y,v.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},Dt.prototype.addSymbols=function(e,t,r,a,l,c,h,m,g,v,x,b){for(var E=e.indexArray,C=e.layoutVertexArray,R=e.segments.prepareSegment(4*t.length,C,E,this.canOverlap?c.sortKey:void 0),F=this.glyphOffsetArray.length,G=R.vertexLength,j=this.allowVerticalPlacement&&h===Ni.vertical?Math.PI/2:0,J=c.text&&c.text.sections,Q=0;Q<t.length;Q++){var te=t[Q],ie=te.tl,ce=te.tr,ge=te.bl,be=te.br,Oe=te.tex,Ee=te.pixelOffsetTL,je=te.pixelOffsetBR,ke=te.minFontScaleX,st=te.minFontScaleY,Je=te.glyphOffset,Fe=te.isSDF,ct=te.sectionIndex,it=R.vertexLength,xt=Je[1];xu(C,m.x,m.y,ie.x,xt+ie.y,Oe.x,Oe.y,r,Fe,Ee.x,Ee.y,ke,st),xu(C,m.x,m.y,ce.x,xt+ce.y,Oe.x+Oe.w,Oe.y,r,Fe,je.x,Ee.y,ke,st),xu(C,m.x,m.y,ge.x,xt+ge.y,Oe.x,Oe.y+Oe.h,r,Fe,Ee.x,je.y,ke,st),xu(C,m.x,m.y,be.x,xt+be.y,Oe.x+Oe.w,Oe.y+Oe.h,r,Fe,je.x,je.y,ke,st),bc(e.dynamicLayoutVertexArray,m,j),E.emplaceBack(it,it+1,it+2),E.emplaceBack(it+1,it+2,it+3),R.vertexLength+=4,R.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Je[0]),Q!==t.length-1&&ct===t[Q+1].sectionIndex||e.programConfigurations.populatePaintArrays(C.length,c,c.index,{},b,J&&J[ct])}e.placedSymbolArray.emplaceBack(m.x,m.y,F,this.glyphOffsetArray.length-F,G,g,v,m.segment,r?r[0]:0,r?r[1]:0,a[0],a[1],h,0,!1,0,x)},Dt.prototype._addCollisionDebugVertex=function(e,t,r,a,l,c){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,a,l,Math.round(c.x),Math.round(c.y))},Dt.prototype.addCollisionDebugVertices=function(e,t,r,a,l,c,h){var m=l.segments.prepareSegment(4,l.layoutVertexArray,l.indexArray),g=m.vertexLength,v=l.layoutVertexArray,x=l.collisionVertexArray,b=h.anchorX,E=h.anchorY;this._addCollisionDebugVertex(v,x,c,b,E,new Ze(e,t)),this._addCollisionDebugVertex(v,x,c,b,E,new Ze(r,t)),this._addCollisionDebugVertex(v,x,c,b,E,new Ze(r,a)),this._addCollisionDebugVertex(v,x,c,b,E,new Ze(e,a)),m.vertexLength+=4;var C=l.indexArray;C.emplaceBack(g,g+1),C.emplaceBack(g+1,g+2),C.emplaceBack(g+2,g+3),C.emplaceBack(g+3,g),m.primitiveLength+=4},Dt.prototype.addDebugCollisionBoxes=function(e,t,r,a){for(var l=e;l<t;l++){var c=this.collisionBoxArray.get(l);this.addCollisionDebugVertices(c.x1,c.y1,c.x2,c.y2,a?this.textCollisionBox:this.iconCollisionBox,c.anchorPoint,r)}},Dt.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new hl(Ho,rp.members,Sa),this.iconCollisionBox=new hl(Ho,rp.members,Sa);for(var e=0;e<this.symbolInstances.length;e++){var t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}},Dt.prototype._deserializeCollisionBoxesForSymbol=function(e,t,r,a,l,c,h,m,g){for(var v={},x=t;x<r;x++){var b=e.get(x);v.textBox={x1:b.x1,y1:b.y1,x2:b.x2,y2:b.y2,anchorPointX:b.anchorPointX,anchorPointY:b.anchorPointY},v.textFeatureIndex=b.featureIndex;break}for(var E=a;E<l;E++){var C=e.get(E);v.verticalTextBox={x1:C.x1,y1:C.y1,x2:C.x2,y2:C.y2,anchorPointX:C.anchorPointX,anchorPointY:C.anchorPointY},v.verticalTextFeatureIndex=C.featureIndex;break}for(var R=c;R<h;R++){var F=e.get(R);v.iconBox={x1:F.x1,y1:F.y1,x2:F.x2,y2:F.y2,anchorPointX:F.anchorPointX,anchorPointY:F.anchorPointY},v.iconFeatureIndex=F.featureIndex;break}for(var G=m;G<g;G++){var j=e.get(G);v.verticalIconBox={x1:j.x1,y1:j.y1,x2:j.x2,y2:j.y2,anchorPointX:j.anchorPointX,anchorPointY:j.anchorPointY},v.verticalIconFeatureIndex=j.featureIndex;break}return v},Dt.prototype.deserializeCollisionBoxes=function(e){this.collisionArrays=[];for(var t=0;t<this.symbolInstances.length;t++){var r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},Dt.prototype.hasTextData=function(){return this.text.segments.get().length>0},Dt.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Dt.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Dt.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Dt.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Dt.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),a=r.vertexStartIndex+4*r.numGlyphs,l=r.vertexStartIndex;l<a;l+=4)e.indexArray.emplaceBack(l,l+1,l+2),e.indexArray.emplaceBack(l+1,l+2,l+3)},Dt.prototype.getSortedSymbolIndexes=function(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var t=Math.sin(e),r=Math.cos(e),a=[],l=[],c=[],h=0;h<this.symbolInstances.length;++h){c.push(h);var m=this.symbolInstances.get(h);a.push(0|Math.round(t*m.anchorX+r*m.anchorY)),l.push(m.featureIndex)}return c.sort((function(g,v){return a[g]-a[v]||l[v]-l[g]})),c},Dt.prototype.addToSortKeyRanges=function(e,t){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})},Dt.prototype.sortFeatures=function(e){var t=this;if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,a=this.symbolInstanceIndexes;r<a.length;r+=1){var l=this.symbolInstances.get(a[r]);this.featureSortOrder.push(l.featureIndex),[l.rightJustifiedTextSymbolIndex,l.centerJustifiedTextSymbolIndex,l.leftJustifiedTextSymbolIndex].forEach((function(c,h,m){c>=0&&m.indexOf(c)===h&&t.addIndicesForPlacedSymbol(t.text,c)})),l.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,l.verticalPlacedTextSymbolIndex),l.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.placedIconSymbolIndex),l.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},De("SymbolBucket",Dt,{omit:["layers","collisionBoxArray","features","compareText"]}),Dt.MAX_GLYPHS=65535,Dt.addDynamicAttributes=bc;var zf=new Zr({"symbol-placement":new Ue(A.layout_symbol["symbol-placement"]),"symbol-spacing":new Ue(A.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ue(A.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Re(A.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ue(A.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ue(A.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Ue(A.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ue(A.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ue(A.layout_symbol["icon-rotation-alignment"]),"icon-size":new Re(A.layout_symbol["icon-size"]),"icon-text-fit":new Ue(A.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ue(A.layout_symbol["icon-text-fit-padding"]),"icon-image":new Re(A.layout_symbol["icon-image"]),"icon-rotate":new Re(A.layout_symbol["icon-rotate"]),"icon-padding":new Ue(A.layout_symbol["icon-padding"]),"icon-keep-upright":new Ue(A.layout_symbol["icon-keep-upright"]),"icon-offset":new Re(A.layout_symbol["icon-offset"]),"icon-anchor":new Re(A.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ue(A.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ue(A.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ue(A.layout_symbol["text-rotation-alignment"]),"text-field":new Re(A.layout_symbol["text-field"]),"text-font":new Re(A.layout_symbol["text-font"]),"text-size":new Re(A.layout_symbol["text-size"]),"text-max-width":new Re(A.layout_symbol["text-max-width"]),"text-line-height":new Ue(A.layout_symbol["text-line-height"]),"text-letter-spacing":new Re(A.layout_symbol["text-letter-spacing"]),"text-justify":new Re(A.layout_symbol["text-justify"]),"text-radial-offset":new Re(A.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ue(A.layout_symbol["text-variable-anchor"]),"text-anchor":new Re(A.layout_symbol["text-anchor"]),"text-max-angle":new Ue(A.layout_symbol["text-max-angle"]),"text-writing-mode":new Ue(A.layout_symbol["text-writing-mode"]),"text-rotate":new Re(A.layout_symbol["text-rotate"]),"text-padding":new Ue(A.layout_symbol["text-padding"]),"text-keep-upright":new Ue(A.layout_symbol["text-keep-upright"]),"text-transform":new Re(A.layout_symbol["text-transform"]),"text-offset":new Re(A.layout_symbol["text-offset"]),"text-allow-overlap":new Ue(A.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Ue(A.layout_symbol["text-ignore-placement"]),"text-optional":new Ue(A.layout_symbol["text-optional"])}),wc={paint:new Zr({"icon-opacity":new Re(A.paint_symbol["icon-opacity"]),"icon-color":new Re(A.paint_symbol["icon-color"]),"icon-halo-color":new Re(A.paint_symbol["icon-halo-color"]),"icon-halo-width":new Re(A.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Re(A.paint_symbol["icon-halo-blur"]),"icon-translate":new Ue(A.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ue(A.paint_symbol["icon-translate-anchor"]),"text-opacity":new Re(A.paint_symbol["text-opacity"]),"text-color":new Re(A.paint_symbol["text-color"],{runtimeType:Ie,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new Re(A.paint_symbol["text-halo-color"]),"text-halo-width":new Re(A.paint_symbol["text-halo-width"]),"text-halo-blur":new Re(A.paint_symbol["text-halo-blur"]),"text-translate":new Ue(A.paint_symbol["text-translate"]),"text-translate-anchor":new Ue(A.paint_symbol["text-translate-anchor"])}),layout:zf},ms=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Me,this.defaultValue=e};ms.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},ms.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},ms.prototype.outputDefined=function(){return!1},ms.prototype.serialize=function(){return null},De("FormatSectionOverride",ms,{omit:["defaultValue"]});var Mf=(function(e){function t(r){e.call(this,r,wc)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){if(e.prototype.recalculate.call(this,r,a),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"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 l=this.layout.get("text-writing-mode");if(l){for(var c=[],h=0,m=l;h<m.length;h+=1){var g=m[h];c.indexOf(g)<0&&c.push(g)}this.layout._values["text-writing-mode"]=c}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},t.prototype.getValueAndResolveTokens=function(r,a,l,c){var h=this.layout.get(r).evaluate(a,{},l,c),m=this._unevaluatedLayout._values[r];return m.isDataDriven()||pa(m.value)||!h?h:(function(g,v){return v.replace(/{([^{}]+)}/g,(function(x,b){return b in g?String(g[b]):""}))})(a.properties,h)},t.prototype.createBucket=function(r){return new Dt(r)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype._setPaintOverrides=function(){for(var r=0,a=wc.paint.overridableProperties;r<a.length;r+=1){var l=a[r];if(t.hasPaintOverride(this.layout,l)){var c,h=this.paint.get(l),m=new ms(h),g=new No(m,h.property.specification);c=h.value.kind==="constant"||h.value.kind==="source"?new ha("source",g):new jo("composite",g,h.value.zoomStops,h.value._interpolationType),this.paint._values[l]=new Qr(h.property,c,h.parameters)}}},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,l){return!(!this.layout||a.isDataDriven()||l.isDataDriven())&&t.hasPaintOverride(this.layout,r)},t.hasPaintOverride=function(r,a){var l=r.get("text-field"),c=wc.paint.properties[a],h=!1,m=function(x){for(var b=0,E=x;b<E.length;b+=1)if(c.overrides&&c.overrides.hasOverride(E[b]))return void(h=!0)};if(l.value.kind==="constant"&&l.value.value instanceof Dr)m(l.value.value.sections);else if(l.value.kind==="source"){var g=function(x){h||(x instanceof Yr&&ar(x.value)===Lt?m(x.value.sections):x instanceof Xi?m(x.sections):x.eachChild(g))},v=l.value;v._styleExpression&&g(v._styleExpression.expression)}return h},t})(cn),Df={paint:new Zr({"background-color":new Ue(A.paint_background["background-color"]),"background-pattern":new ei(A.paint_background["background-pattern"]),"background-opacity":new Ue(A.paint_background["background-opacity"])})},Lf=(function(e){function t(r){e.call(this,r,Df)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(cn),Bf={paint:new Zr({"raster-opacity":new Ue(A.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ue(A.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ue(A.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ue(A.paint_raster["raster-brightness-max"]),"raster-saturation":new Ue(A.paint_raster["raster-saturation"]),"raster-contrast":new Ue(A.paint_raster["raster-contrast"]),"raster-resampling":new Ue(A.paint_raster["raster-resampling"]),"raster-fade-duration":new Ue(A.paint_raster["raster-fade-duration"])})},Rf=(function(e){function t(r){e.call(this,r,Bf)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(cn),Ff=(function(e){function t(r){e.call(this,r,{}),this.implementation=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},t.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},t.prototype.recalculate=function(){},t.prototype.updateTransitions=function(){},t.prototype.hasTransition=function(){},t.prototype.serialize=function(){},t.prototype.onAdd=function(r){this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},t.prototype.onRemove=function(r){this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},t})(cn),Of={circle:ac,heatmap:xh,hillshade:wh,fill:Vh,"fill-extrusion":Hh,line:ef,symbol:Mf,background:Lf,raster:Rf},Ep=Ce.HTMLImageElement,Tp=Ce.HTMLCanvasElement,kp=Ce.HTMLVideoElement,Cp=Ce.ImageData,bu=Ce.ImageBitmap,Pa=function(e,t,r,a){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,a)};Pa.prototype.update=function(e,t,r){var a=e.width,l=e.height,c=!(this.size&&this.size[0]===a&&this.size[1]===l||r),h=this.context,m=h.gl;if(this.useMipmap=!!(t&&t.useMipmap),m.bindTexture(m.TEXTURE_2D,this.texture),h.pixelStoreUnpackFlipY.set(!1),h.pixelStoreUnpack.set(1),h.pixelStoreUnpackPremultiplyAlpha.set(this.format===m.RGBA&&(!t||t.premultiply!==!1)),c)this.size=[a,l],e instanceof Ep||e instanceof Tp||e instanceof kp||e instanceof Cp||bu&&e instanceof bu?m.texImage2D(m.TEXTURE_2D,0,this.format,this.format,m.UNSIGNED_BYTE,e):m.texImage2D(m.TEXTURE_2D,0,this.format,a,l,0,this.format,m.UNSIGNED_BYTE,e.data);else{var g=r||{x:0,y:0},v=g.x,x=g.y;e instanceof Ep||e instanceof Tp||e instanceof kp||e instanceof Cp||bu&&e instanceof bu?m.texSubImage2D(m.TEXTURE_2D,0,v,x,m.RGBA,m.UNSIGNED_BYTE,e):m.texSubImage2D(m.TEXTURE_2D,0,v,x,a,l,m.RGBA,m.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&m.generateMipmap(m.TEXTURE_2D)},Pa.prototype.bind=function(e,t,r){var a=this.context.gl;a.bindTexture(a.TEXTURE_2D,this.texture),r!==a.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=a.LINEAR),e!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,t),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,t),this.wrap=t)},Pa.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Pa.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Sc=function(e){var t=this;this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){t._triggered=!1,t._callback()})};Sc.prototype.trigger=function(){var e=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){e._triggered=!1,e._callback()}),0))},Sc.prototype.remove=function(){delete this._channel,this._callback=function(){}};var ys=function(e,t,r){this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},mn(["receive","process"],this),this.invoker=new Sc(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=di()?e:Ce};function Pp(e,t,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[e*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}ys.prototype.send=function(e,t,r,a,l){var c=this;l===void 0&&(l=!1);var h=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[h]=r);var m=Ro(this.globalScope)?void 0:[];return this.target.postMessage({id:h,type:e,hasCallback:!!r,targetMapId:a,mustQueue:l,sourceMapId:this.mapId,data:Ki(t,m)},m),{cancel:function(){r&&delete c.callbacks[h],c.target.postMessage({id:h,type:"<cancel>",targetMapId:a,sourceMapId:c.mapId})}}},ys.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if(t.type==="<cancel>"){delete this.tasks[r];var a=this.cancelCallbacks[r];delete this.cancelCallbacks[r],a&&a()}else di()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)},ys.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},ys.prototype.processTask=function(e,t){var r=this;if(t.type==="<response>"){var a=this.callbacks[e];delete this.callbacks[e],a&&(t.error?a(gi(t.error)):a(null,gi(t.data)))}else{var l=!1,c=Ro(this.globalScope)?void 0:[],h=t.hasCallback?function(x,b){l=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"<response>",sourceMapId:r.mapId,error:x?Ki(x):null,data:Ki(b,c)},c)}:function(x){l=!0},m=null,g=gi(t.data);if(this.parent[t.type])m=this.parent[t.type](t.sourceMapId,g,h);else if(this.parent.getWorkerSource){var v=t.type.split(".");m=this.parent.getWorkerSource(t.sourceMapId,v[0],g.source)[v[1]](g,h)}else h(new Error("Could not find function "+t.type));!l&&m&&m.cancel&&(this.cancelCallbacks[e]=m.cancel)}},ys.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var br=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};br.prototype.setNorthEast=function(e){return this._ne=e instanceof Gt?new Gt(e.lng,e.lat):Gt.convert(e),this},br.prototype.setSouthWest=function(e){return this._sw=e instanceof Gt?new Gt(e.lng,e.lat):Gt.convert(e),this},br.prototype.extend=function(e){var t,r,a=this._sw,l=this._ne;if(e instanceof Gt)t=e,r=e;else{if(!(e instanceof br))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(br.convert(e)):this.extend(Gt.convert(e)):this;if(r=e._ne,!(t=e._sw)||!r)return this}return a||l?(a.lng=Math.min(t.lng,a.lng),a.lat=Math.min(t.lat,a.lat),l.lng=Math.max(r.lng,l.lng),l.lat=Math.max(r.lat,l.lat)):(this._sw=new Gt(t.lng,t.lat),this._ne=new Gt(r.lng,r.lat)),this},br.prototype.getCenter=function(){return new Gt((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},br.prototype.getSouthWest=function(){return this._sw},br.prototype.getNorthEast=function(){return this._ne},br.prototype.getNorthWest=function(){return new Gt(this.getWest(),this.getNorth())},br.prototype.getSouthEast=function(){return new Gt(this.getEast(),this.getSouth())},br.prototype.getWest=function(){return this._sw.lng},br.prototype.getSouth=function(){return this._sw.lat},br.prototype.getEast=function(){return this._ne.lng},br.prototype.getNorth=function(){return this._ne.lat},br.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},br.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},br.prototype.isEmpty=function(){return!(this._sw&&this._ne)},br.prototype.contains=function(e){var t=Gt.convert(e),r=t.lng,a=t.lat,l=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&l},br.convert=function(e){return!e||e instanceof br?e:new br(e)};var Gt=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Gt.prototype.wrap=function(){return new Gt(ao(this.lng,-180,180),this.lat)},Gt.prototype.toArray=function(){return[this.lng,this.lat]},Gt.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Gt.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,a=e.lat*t,l=Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos((e.lng-this.lng)*t);return 63710088e-1*Math.acos(Math.min(l,1))},Gt.prototype.toBounds=function(e){e===void 0&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new br(new Gt(this.lng-r,this.lat-t),new Gt(this.lng+r,this.lat+t))},Gt.convert=function(e){if(e instanceof Gt)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Gt(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Gt(Number("lng"in e?e.lng:e.lon),Number(e.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 Ap=2*Math.PI*63710088e-1;function zp(e){return Ap*Math.cos(e*Math.PI/180)}function Mp(e){return(180+e)/360}function Dp(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Lp(e,t){return e/zp(t)}function Ic(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}var Aa=function(e,t,r){r===void 0&&(r=0),this.x=+e,this.y=+t,this.z=+r};Aa.fromLngLat=function(e,t){t===void 0&&(t=0);var r=Gt.convert(e);return new Aa(Mp(r.lng),Dp(r.lat),Lp(t,r.lat))},Aa.prototype.toLngLat=function(){return new Gt(360*this.x-180,Ic(this.y))},Aa.prototype.toAltitude=function(){return this.z*zp(Ic(this.y))},Aa.prototype.meterInMercatorCoordinateUnits=function(){return 1/Ap*(e=Ic(this.y),1/Math.cos(e*Math.PI/180));var e};var za=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=fl(0,e,e,t,r)};za.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},za.prototype.url=function(e,t){var r,a,l,c,h,m=(a=this.y,l=this.z,c=Pp(256*(r=this.x),256*(a=Math.pow(2,l)-a-1),l),h=Pp(256*(r+1),256*(a+1),l),c[0]+","+c[1]+","+h[0]+","+h[1]),g=(function(v,x,b){for(var E,C="",R=v;R>0;R--)C+=(x&(E=1<<R-1)?1:0)+(b&E?2:0);return C})(this.z,this.x,this.y);return e[(this.x+this.y)%e.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(t==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",g).replace("{bbox-epsg-3857}",m)},za.prototype.getTilePoint=function(e){var t=Math.pow(2,this.z);return new Ze(8192*(e.x*t-this.x),8192*(e.y*t-this.y))},za.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Bp=function(e,t){this.wrap=e,this.canonical=t,this.key=fl(e,t.z,t.z,t.x,t.y)},wr=function(e,t,r,a,l){this.overscaledZ=e,this.wrap=t,this.canonical=new za(r,+a,+l),this.key=fl(t,e,r,a,l)};function fl(e,t,r,a,l){(e*=2)<0&&(e=-1*e-1);var c=1<<r;return(c*c*e+c*l+a).toString(36)+r.toString(36)+t.toString(36)}wr.prototype.equals=function(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)},wr.prototype.scaledTo=function(e){var t=this.canonical.z-e;return e>this.canonical.z?new wr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new wr(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},wr.prototype.calculateScaledKey=function(e,t){var r=this.canonical.z-e;return e>this.canonical.z?fl(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):fl(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)},wr.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t},wr.prototype.children=function(e){if(this.overscaledZ>=e)return[new wr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,r=2*this.canonical.x,a=2*this.canonical.y;return[new wr(t,this.wrap,t,r,a),new wr(t,this.wrap,t,r+1,a),new wr(t,this.wrap,t,r,a+1),new wr(t,this.wrap,t,r+1,a+1)]},wr.prototype.isLessThan=function(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))},wr.prototype.wrapped=function(){return new wr(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},wr.prototype.unwrapTo=function(e){return new wr(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)},wr.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},wr.prototype.toUnwrapped=function(){return new Bp(this.wrap,this.canonical)},wr.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},wr.prototype.getTilePoint=function(e){return this.canonical.getTilePoint(new Aa(e.x-this.wrap,e.y))},De("CanonicalTileID",za),De("OverscaledTileID",wr,{omit:["posMatrix"]});var Ao=function(e,t,r){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&r!=="mapbox"&&r!=="terrarium")return Ht('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=t.height;var a=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=r||"mapbox";for(var l=0;l<a;l++)this.data[this._idx(-1,l)]=this.data[this._idx(0,l)],this.data[this._idx(a,l)]=this.data[this._idx(a-1,l)],this.data[this._idx(l,-1)]=this.data[this._idx(l,0)],this.data[this._idx(l,a)]=this.data[this._idx(l,a-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(a,-1)]=this.data[this._idx(a-1,0)],this.data[this._idx(-1,a)]=this.data[this._idx(0,a-1)],this.data[this._idx(a,a)]=this.data[this._idx(a-1,a-1)]};Ao.prototype.get=function(e,t){var r=new Uint8Array(this.data.buffer),a=4*this._idx(e,t);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(r[a],r[a+1],r[a+2])},Ao.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Ao.prototype._idx=function(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)},Ao.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},Ao.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},Ao.prototype.getPixels=function(){return new wi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Ao.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var a=t*this.dim,l=t*this.dim+this.dim,c=r*this.dim,h=r*this.dim+this.dim;switch(t){case-1:a=l-1;break;case 1:l=a+1}switch(r){case-1:c=h-1;break;case 1:h=c+1}for(var m=-t*this.dim,g=-r*this.dim,v=c;v<h;v++)for(var x=a;x<l;x++)this.data[this._idx(x,v)]=e.data[this._idx(x+m,v+g)]},De("DEMData",Ao);var wu=function(e){this._stringToNumber={},this._numberToString=[];for(var t=0;t<e.length;t++){var r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}};wu.prototype.encode=function(e){return this._stringToNumber[e]},wu.prototype.decode=function(e){return this._numberToString[e]};var Su=function(e,t,r,a,l){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=a,this.properties=e.properties,this.id=l},Ec={geometry:{configurable:!0}};Ec.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},Ec.geometry.set=function(e){this._geometry=e},Su.prototype.toJSON=function(){var e={geometry:this.geometry};for(var t in this)t!=="_geometry"&&t!=="_vectorTileFeature"&&(e[t]=this[t]);return e},Object.defineProperties(Su.prototype,Ec);var gs=function(){this.state={},this.stateChanges={},this.deletedStates={}};gs.prototype.updateState=function(e,t,r){var a=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][a]=this.stateChanges[e][a]||{},Sr(this.stateChanges[e][a],r),this.deletedStates[e]===null)for(var l in this.deletedStates[e]={},this.state[e])l!==a&&(this.deletedStates[e][l]=null);else if(this.deletedStates[e]&&this.deletedStates[e][a]===null)for(var c in this.deletedStates[e][a]={},this.state[e][a])r[c]||(this.deletedStates[e][a][c]=null);else for(var h in r)this.deletedStates[e]&&this.deletedStates[e][a]&&this.deletedStates[e][a][h]===null&&delete this.deletedStates[e][a][h]},gs.prototype.removeFeatureState=function(e,t,r){if(this.deletedStates[e]!==null){var a=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&t!==void 0)this.deletedStates[e][a]!==null&&(this.deletedStates[e][a]=this.deletedStates[e][a]||{},this.deletedStates[e][a][r]=null);else if(t!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][a])for(r in this.deletedStates[e][a]={},this.stateChanges[e][a])this.deletedStates[e][a][r]=null;else this.deletedStates[e][a]=null;else this.deletedStates[e]=null}},gs.prototype.getState=function(e,t){var r=String(t),a=Sr({},(this.state[e]||{})[r],(this.stateChanges[e]||{})[r]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){var l=this.deletedStates[e][t];if(l===null)return{};for(var c in l)delete a[c]}return a},gs.prototype.initializeTileState=function(e,t){e.setFeatureState(this.state,t)},gs.prototype.coalesceChanges=function(e,t){var r={};for(var a in this.stateChanges){this.state[a]=this.state[a]||{};var l={};for(var c in this.stateChanges[a])this.state[a][c]||(this.state[a][c]={}),Sr(this.state[a][c],this.stateChanges[a][c]),l[c]=this.state[a][c];r[a]=l}for(var h in this.deletedStates){this.state[h]=this.state[h]||{};var m={};if(this.deletedStates[h]===null)for(var g in this.state[h])m[g]={},this.state[h][g]={};else for(var v in this.deletedStates[h]){if(this.deletedStates[h][v]===null)this.state[h][v]={};else for(var x=0,b=Object.keys(this.deletedStates[h][v]);x<b.length;x+=1)delete this.state[h][v][b[x]];m[v]=this.state[h][v]}r[h]=r[h]||{},Sr(r[h],m)}if(this.stateChanges={},this.deletedStates={},Object.keys(r).length!==0)for(var E in e)e[E].setFeatureState(r,t)};var zo=function(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new wn(8192,16,0),this.grid3D=new wn(8192,16,0),this.featureIndexArray=new S,this.promoteId=t};function Rp(e,t,r,a,l){return zr(e,(function(c,h){var m=t instanceof ba?t.get(h):null;return m&&m.evaluate?m.evaluate(r,a,l):m}))}function Fp(e){for(var t=1/0,r=1/0,a=-1/0,l=-1/0,c=0,h=e;c<h.length;c+=1){var m=h[c];t=Math.min(t,m.x),r=Math.min(r,m.y),a=Math.max(a,m.x),l=Math.max(l,m.y)}return{minX:t,minY:r,maxX:a,maxY:l}}function Vf(e,t){return t-e}zo.prototype.insert=function(e,t,r,a,l,c){var h=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,a,l);for(var m=c?this.grid3D:this.grid,g=0;g<t.length;g++){for(var v=t[g],x=[1/0,1/0,-1/0,-1/0],b=0;b<v.length;b++){var E=v[b];x[0]=Math.min(x[0],E.x),x[1]=Math.min(x[1],E.y),x[2]=Math.max(x[2],E.x),x[3]=Math.max(x[3],E.y)}x[0]<8192&&x[1]<8192&&x[2]>=0&&x[3]>=0&&m.insert(h,x[0],x[1],x[2],x[3])}},zo.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new ss.VectorTile(new pu(this.rawTileData)).layers,this.sourceLayerCoder=new wu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},zo.prototype.query=function(e,t,r,a){var l=this;this.loadVTLayers();for(var c=e.params||{},h=8192/e.tileSize/e.scale,m=Za(c.filter),g=e.queryGeometry,v=e.queryPadding*h,x=Fp(g),b=this.grid.query(x.minX-v,x.minY-v,x.maxX+v,x.maxY+v),E=Fp(e.cameraQueryGeometry),C=this.grid3D.query(E.minX-v,E.minY-v,E.maxX+v,E.maxY+v,(function(te,ie,ce,ge){return(function(be,Oe,Ee,je,ke){for(var st=0,Je=be;st<Je.length;st+=1){var Fe=Je[st];if(Oe<=Fe.x&&Ee<=Fe.y&&je>=Fe.x&&ke>=Fe.y)return!0}var ct=[new Ze(Oe,Ee),new Ze(Oe,ke),new Ze(je,ke),new Ze(je,Ee)];if(be.length>2){for(var it=0,xt=ct;it<xt.length;it+=1)if(hn(be,xt[it]))return!0}for(var Ge=0;Ge<be.length-1;Ge++)if(Ta(be[Ge],be[Ge+1],ct))return!0;return!1})(e.cameraQueryGeometry,te-v,ie-v,ce+v,ge+v)})),R=0,F=C;R<F.length;R+=1)b.push(F[R]);b.sort(Vf);for(var G,j={},J=function(te){var ie=b[te];if(ie!==G){G=ie;var ce=l.featureIndexArray.get(ie),ge=null;l.loadMatchingFeature(j,ce.bucketIndex,ce.sourceLayerIndex,ce.featureIndex,m,c.layers,c.availableImages,t,r,a,(function(be,Oe,Ee){return ge||(ge=Yt(be)),Oe.queryIntersectsFeature(g,be,Ee,ge,l.z,e.transform,h,e.pixelPosMatrix)}))}},Q=0;Q<b.length;Q++)J(Q);return j},zo.prototype.loadMatchingFeature=function(e,t,r,a,l,c,h,m,g,v,x){var b=this.bucketLayerIDs[t];if(!c||(function(be,Oe){for(var Ee=0;Ee<be.length;Ee++)if(Oe.indexOf(be[Ee])>=0)return!0;return!1})(c,b)){var E=this.sourceLayerCoder.decode(r),C=this.vtLayers[E].feature(a);if(l.needGeometry){var R=sr(C,!0);if(!l.filter(new ht(this.tileID.overscaledZ),R,this.tileID.canonical))return}else if(!l.filter(new ht(this.tileID.overscaledZ),C))return;for(var F=this.getId(C,E),G=0;G<b.length;G++){var j=b[G];if(!(c&&c.indexOf(j)<0)){var J=m[j];if(J){var Q={};F!==void 0&&v&&(Q=v.getState(J.sourceLayer||"_geojsonTileLayer",F));var te=Sr({},g[j]);te.paint=Rp(te.paint,J.paint,C,Q,h),te.layout=Rp(te.layout,J.layout,C,Q,h);var ie=!x||x(C,J,Q);if(ie){var ce=new Su(C,this.z,this.x,this.y,F);ce.layer=te;var ge=e[j];ge===void 0&&(ge=e[j]=[]),ge.push({featureIndex:a,feature:ce,intersectionZ:ie})}}}}}},zo.prototype.lookupSymbolFeatures=function(e,t,r,a,l,c,h,m){var g={};this.loadVTLayers();for(var v=Za(l),x=0,b=e;x<b.length;x+=1)this.loadMatchingFeature(g,r,a,b[x],v,c,h,m,t);return g},zo.prototype.hasLayer=function(e){for(var t=0,r=this.bucketLayerIDs;t<r.length;t+=1)for(var a=0,l=r[t];a<l.length;a+=1)if(e===l[a])return!0;return!1},zo.prototype.getId=function(e,t){var r=e.id;return this.promoteId&&typeof(r=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[t]])=="boolean"&&(r=Number(r)),r},De("FeatureIndex",zo,{omit:["rawTileData","sourceLayerCoder"]});var Fr=function(e,t){this.tileID=e,this.uid=pr(),this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};Fr.prototype.registerFadeDuration=function(e){var t=e+this.timeAdded;t<Ir.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)},Fr.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},Fr.prototype.loadVectorData=function(e,t,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){for(var a in e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=(function(v,x){var b={};if(!x)return b;for(var E=function(){var F=R[C],G=F.layerIds.map((function(Q){return x.getLayer(Q)})).filter(Boolean);if(G.length!==0){F.layers=G,F.stateDependentLayerIds&&(F.stateDependentLayers=F.stateDependentLayerIds.map((function(Q){return G.filter((function(te){return te.id===Q}))[0]})));for(var j=0,J=G;j<J.length;j+=1)b[J[j].id]=F}},C=0,R=v;C<R.length;C+=1)E();return b})(e.buckets,t.style),this.hasSymbolBuckets=!1,this.buckets){var l=this.buckets[a];if(l instanceof Dt){if(this.hasSymbolBuckets=!0,!r)break;l.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var c in this.buckets){var h=this.buckets[c];if(h instanceof Dt&&h.hasRTLText){this.hasRTLText=!0,Pi.isLoading()||Pi.isLoaded()||Js()!=="deferred"||Ji();break}}for(var m in this.queryPadding=0,this.buckets){var g=this.buckets[m];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(m).queryRadius(g))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new o},Fr.prototype.unloadVectorData=function(){for(var e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},Fr.prototype.getBucket=function(e){return this.buckets[e.id]},Fr.prototype.upload=function(e){for(var t in this.buckets){var r=this.buckets[t];r.uploadPending()&&r.upload(e)}var a=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Pa(e,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Pa(e,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)},Fr.prototype.prepare=function(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)},Fr.prototype.queryRenderedFeatures=function(e,t,r,a,l,c,h,m,g,v){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:a,cameraQueryGeometry:l,scale:c,tileSize:this.tileSize,pixelPosMatrix:v,transform:m,params:h,queryPadding:this.queryPadding*g},e,t,r):{}},Fr.prototype.querySourceFeatures=function(e,t){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var a=r.loadVTLayers(),l=t?t.sourceLayer:"",c=a._geojsonTileLayer||a[l];if(c)for(var h=Za(t&&t.filter),m=this.tileID.canonical,g=m.z,v=m.x,x=m.y,b={z:g,x:v,y:x},E=0;E<c.length;E++){var C=c.feature(E);if(h.needGeometry){var R=sr(C,!0);if(!h.filter(new ht(this.tileID.overscaledZ),R,this.tileID.canonical))continue}else if(!h.filter(new ht(this.tileID.overscaledZ),C))continue;var F=r.getId(C,l),G=new Su(C,g,v,x,F);G.tile=b,e.push(G)}}},Fr.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},Fr.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Fr.prototype.setExpiryData=function(e){var t=this.expirationTime;if(e.cacheControl){var r=An(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var a=Date.now(),l=!1;if(this.expirationTime>a)l=!1;else if(t)if(this.expirationTime<t)l=!0;else{var c=this.expirationTime-t;c?this.expirationTime=a+Math.max(c,3e4):l=!0}else l=!0;l?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Fr.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)},Fr.prototype.setFeatureState=function(e,t){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&Object.keys(e).length!==0){var r=this.latestFeatureIndex.loadVTLayers();for(var a in this.buckets)if(t.style.hasLayer(a)){var l=this.buckets[a],c=l.layers[0].sourceLayer||"_geojsonTileLayer",h=r[c],m=e[c];if(h&&m&&Object.keys(m).length!==0){l.update(m,h,this.imageAtlas&&this.imageAtlas.patternPositions||{});var g=t&&t.style&&t.style.getLayer(a);g&&(this.queryPadding=Math.max(this.queryPadding,g.queryRadius(l)))}}}},Fr.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},Fr.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Ir.now()},Fr.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Fr.prototype.setHoldDuration=function(e){this.symbolFadeHoldUntil=Ir.now()+e},Fr.prototype.setDependencies=function(e,t){for(var r={},a=0,l=t;a<l.length;a+=1)r[l[a]]=!0;this.dependencies[e]=r},Fr.prototype.hasDependency=function(e,t){for(var r=0,a=e;r<a.length;r+=1){var l=this.dependencies[a[r]];if(l){for(var c=0,h=t;c<h.length;c+=1)if(l[h[c]])return!0}}return!1};var Qo=Ce.performance,Op=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},Qo.mark(this._marks.start)};Op.prototype.finish=function(){Qo.mark(this._marks.end);var e=Qo.getEntriesByName(this._marks.measure);return e.length===0&&(Qo.measure(this._marks.measure,this._marks.start,this._marks.end),e=Qo.getEntriesByName(this._marks.measure),Qo.clearMarks(this._marks.start),Qo.clearMarks(this._marks.end),Qo.clearMeasures(this._marks.measure)),e},u.Actor=ys,u.AlphaImage=Ca,u.CanonicalTileID=za,u.CollisionBoxArray=o,u.Color=Tt,u.DEMData=Ao,u.DataConstantProperty=Ue,u.DictionaryCoder=wu,u.EXTENT=8192,u.ErrorEvent=W,u.EvaluationParameters=ht,u.Event=V,u.Evented=H,u.FeatureIndex=zo,u.FillBucket=Tn,u.FillExtrusionBucket=kn,u.ImageAtlas=pl,u.ImagePosition=fu,u.LineBucket=pi,u.LngLat=Gt,u.LngLatBounds=br,u.MercatorCoordinate=Aa,u.ONE_EM=24,u.OverscaledTileID=wr,u.Point=Ze,u.Point$1=Ze,u.Properties=Zr,u.Protobuf=pu,u.RGBAImage=wi,u.RequestManager=et,u.RequestPerformance=Op,u.ResourceType=Tr,u.SegmentVector=z,u.SourceFeatureState=gs,u.StructArrayLayout1ui2=rl,u.StructArrayLayout2f1f2i16=To,u.StructArrayLayout2i4=Eo,u.StructArrayLayout3ui6=Xn,u.StructArrayLayout4i8=$s,u.SymbolBucket=Dt,u.Texture=Pa,u.Tile=Fr,u.Transitionable=qr,u.Uniform1f=xe,u.Uniform1i=he,u.Uniform2f=ve,u.Uniform3f=Ae,u.Uniform4f=Ne,u.UniformColor=He,u.UniformMatrix4f=bt,u.UnwrappedTileID=Bp,u.ValidationError=N,u.WritingMode=Ni,u.ZoomHistory=Ws,u.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},u.addDynamicAttributes=bc,u.asyncAll=function(e,t,r){if(!e.length)return r(null,[]);var a=e.length,l=new Array(e.length),c=null;e.forEach((function(h,m){t(h,(function(g,v){g&&(c=g),l[m]=v,--a==0&&r(c,l)}))}))},u.bezier=rt,u.bindAll=mn,u.browser=Ir,u.cacheEntryPossiblyAdded=function(e){++gn>lo&&(e.getActor().send("enforceCacheSizeLimit",an),gn=0)},u.clamp=gr,u.clearTileCache=function(e){var t=Ce.caches.delete("mapbox-tiles");e&&t.catch(e).then((function(){return e()}))},u.clipLine=_p,u.clone=function(e){var t=new kt(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},u.clone$1=Si,u.clone$2=function(e){var t=new kt(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},u.collisionCircleLayout=of,u.config=mt,u.create=function(){var e=new kt(16);return kt!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},u.create$1=function(){var e=new kt(9);return kt!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},u.create$2=function(){var e=new kt(4);return kt!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},u.createCommonjsModule=ot,u.createExpression=ja,u.createLayout=Br,u.createStyleLayer=function(e){return e.type==="custom"?new Ff(e):new Of[e.type](e)},u.cross=function(e,t,r){var a=t[0],l=t[1],c=t[2],h=r[0],m=r[1],g=r[2];return e[0]=l*g-c*m,e[1]=c*h-a*g,e[2]=a*m-l*h,e},u.deepEqual=function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(var a=0;a<t.length;a++)if(!e(t[a],r[a]))return!1;return!0}if(typeof t=="object"&&t!==null&&r!==null){if(typeof r!="object"||Object.keys(t).length!==Object.keys(r).length)return!1;for(var l in t)if(!e(t[l],r[l]))return!1;return!0}return t===r},u.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},u.dot$1=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},u.ease=rr,u.emitValidationErrors=va,u.endsWith=fi,u.enforceCacheSizeLimit=function(e){yn(),Ve&&Ve.then((function(t){t.keys().then((function(r){for(var a=0;a<r.length-e;a++)t.delete(r[a])}))}))},u.evaluateSizeForFeature=fp,u.evaluateSizeForZoom=dp,u.evaluateVariableOffset=wp,u.evented=Ks,u.extend=Sr,u.featureFilter=Za,u.filterObject=Gi,u.fromRotation=function(e,t){var r=Math.sin(t),a=Math.cos(t);return e[0]=a,e[1]=r,e[2]=0,e[3]=-r,e[4]=a,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},u.getAnchorAlignment=gc,u.getAnchorJustification=xc,u.getArrayBuffer=ia,u.getImage=I,u.getJSON=function(e,t){return Fo(Sr(e,{type:"json"}),t)},u.getRTLTextPluginStatus=Js,u.getReferrer=vn,u.getVideo=function(e,t){var r,a,l=Ce.document.createElement("video");l.muted=!0,l.onloadstart=function(){t(null,l)};for(var c=0;c<e.length;c++){var h=Ce.document.createElement("source");r=e[c],a=void 0,(a=Ce.document.createElement("a")).href=r,(a.protocol!==Ce.document.location.protocol||a.host!==Ce.document.location.host)&&(l.crossOrigin="Anonymous"),h.src=e[c],l.appendChild(h)}return{cancel:function(){}}},u.identity=Ai,u.invert=function(e,t){var r=t[0],a=t[1],l=t[2],c=t[3],h=t[4],m=t[5],g=t[6],v=t[7],x=t[8],b=t[9],E=t[10],C=t[11],R=t[12],F=t[13],G=t[14],j=t[15],J=r*m-a*h,Q=r*g-l*h,te=r*v-c*h,ie=a*g-l*m,ce=a*v-c*m,ge=l*v-c*g,be=x*F-b*R,Oe=x*G-E*R,Ee=x*j-C*R,je=b*G-E*F,ke=b*j-C*F,st=E*j-C*G,Je=J*st-Q*ke+te*je+ie*Ee-ce*Oe+ge*be;return Je?(e[0]=(m*st-g*ke+v*je)*(Je=1/Je),e[1]=(l*ke-a*st-c*je)*Je,e[2]=(F*ge-G*ce+j*ie)*Je,e[3]=(E*ce-b*ge-C*ie)*Je,e[4]=(g*Ee-h*st-v*Oe)*Je,e[5]=(r*st-l*Ee+c*Oe)*Je,e[6]=(G*te-R*ge-j*Q)*Je,e[7]=(x*ge-E*te+C*Q)*Je,e[8]=(h*ke-m*Ee+v*be)*Je,e[9]=(a*Ee-r*ke-c*be)*Je,e[10]=(R*ce-F*te+j*J)*Je,e[11]=(b*te-x*ce-C*J)*Je,e[12]=(m*Oe-h*je-g*be)*Je,e[13]=(r*je-a*Oe+l*be)*Je,e[14]=(F*Q-R*ie-G*J)*Je,e[15]=(x*ie-b*Q+E*J)*Je,e):null},u.isChar=Se,u.isMapboxURL=ut,u.keysDifference=function(e,t){var r=[];for(var a in e)a in t||r.push(a);return r},u.makeRequest=Fo,u.mapObject=zr,u.mercatorXfromLng=Mp,u.mercatorYfromLat=Dp,u.mercatorZfromAltitude=Lp,u.mul=oc,u.multiply=ci,u.mvt=ss,u.nextPowerOfTwo=function(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},u.normalize=function(e,t){var r=t[0],a=t[1],l=t[2],c=r*r+a*a+l*l;return c>0&&(c=1/Math.sqrt(c)),e[0]=t[0]*c,e[1]=t[1]*c,e[2]=t[2]*c,e},u.number=fr,u.offscreenCanvasSupported=sn,u.ortho=function(e,t,r,a,l,c,h){var m=1/(t-r),g=1/(a-l),v=1/(c-h);return e[0]=-2*m,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*g,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*v,e[11]=0,e[12]=(t+r)*m,e[13]=(l+a)*g,e[14]=(h+c)*v,e[15]=1,e},u.parseGlyphPBF=function(e){return new pu(e).readFields(yf,[])},u.pbf=pu,u.performSymbolLayout=function(e,t,r,a,l,c,h){e.createArrays(),e.tilePixelRatio=8192/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;var m=e.layers[0].layout,g=e.layers[0]._unevaluatedLayout._values,v={};if(e.textSizeData.kind==="composite"){var x=e.textSizeData,b=x.maxZoom;v.compositeTextSizes=[g["text-size"].possiblyEvaluate(new ht(x.minZoom),h),g["text-size"].possiblyEvaluate(new ht(b),h)]}if(e.iconSizeData.kind==="composite"){var E=e.iconSizeData,C=E.maxZoom;v.compositeIconSizes=[g["icon-size"].possiblyEvaluate(new ht(E.minZoom),h),g["icon-size"].possiblyEvaluate(new ht(C),h)]}v.layoutTextSize=g["text-size"].possiblyEvaluate(new ht(e.zoom+1),h),v.layoutIconSize=g["icon-size"].possiblyEvaluate(new ht(e.zoom+1),h),v.textMaxSize=g["text-size"].possiblyEvaluate(new ht(18));for(var R=24*m.get("text-line-height"),F=m.get("text-rotation-alignment")==="map"&&m.get("symbol-placement")!=="point",G=m.get("text-keep-upright"),j=m.get("text-size"),J=function(){var ie=te[Q],ce=m.get("text-font").evaluate(ie,{},h).join(","),ge=j.evaluate(ie,{},h),be=v.layoutTextSize.evaluate(ie,{},h),Oe=v.layoutIconSize.evaluate(ie,{},h),Ee={horizontal:{},vertical:void 0},je=ie.text,ke=[0,0];if(je){var st=je.toString(),Je=24*m.get("text-letter-spacing").evaluate(ie,{},h),Fe=(function(ft){for(var Rt=0,zt=ft;Rt<zt.length;Rt+=1)if(wt=zt[Rt].charCodeAt(0),Se.Arabic(wt)||Se["Arabic Supplement"](wt)||Se["Arabic Extended-A"](wt)||Se["Arabic Presentation Forms-A"](wt)||Se["Arabic Presentation Forms-B"](wt))return!1;var wt;return!0})(st)?Je:0,ct=m.get("text-anchor").evaluate(ie,{},h),it=m.get("text-variable-anchor");if(!it){var xt=m.get("text-radial-offset").evaluate(ie,{},h);ke=xt?wp(ct,[24*xt,_c]):m.get("text-offset").evaluate(ie,{},h).map((function(ft){return 24*ft}))}var Ge=F?"center":m.get("text-justify").evaluate(ie,{},h),St=m.get("symbol-placement"),Wt=St==="point"?24*m.get("text-max-width").evaluate(ie,{},h):0,er=function(){e.allowVerticalPlacement&&Xs(st)&&(Ee.vertical=du(je,t,r,l,ce,Wt,R,ct,"left",Fe,ke,Ni.vertical,!0,St,be,ge))};if(!F&&it){for(var $t=Ge==="auto"?it.map((function(ft){return xc(ft)})):[Ge],Xt=!1,tr=0;tr<$t.length;tr++){var Pr=$t[tr];if(!Ee.horizontal[Pr])if(Xt)Ee.horizontal[Pr]=Ee.horizontal[0];else{var Ar=du(je,t,r,l,ce,Wt,R,"center",Pr,Fe,ke,Ni.horizontal,!1,St,be,ge);Ar&&(Ee.horizontal[Pr]=Ar,Xt=Ar.positionedLines.length===1)}}er()}else{Ge==="auto"&&(Ge=xc(ct));var ii=du(je,t,r,l,ce,Wt,R,ct,Ge,Fe,ke,Ni.horizontal,!1,St,be,ge);ii&&(Ee.horizontal[Ge]=ii),er(),Xs(st)&&F&&G&&(Ee.vertical=du(je,t,r,l,ce,Wt,R,ct,Ge,Fe,ke,Ni.vertical,!1,St,be,ge))}}var Or=void 0,ni=!1;if(ie.icon&&ie.icon.name){var lr=a[ie.icon.name];lr&&(Or=(function(ft,Rt,zt){var wt=gc(zt),hi=Rt[0]-ft.displaySize[0]*wt.horizontalAlign,Xr=Rt[1]-ft.displaySize[1]*wt.verticalAlign;return{image:ft,top:Xr,bottom:Xr+ft.displaySize[1],left:hi,right:hi+ft.displaySize[0]}})(l[ie.icon.name],m.get("icon-offset").evaluate(ie,{},h),m.get("icon-anchor").evaluate(ie,{},h)),ni=lr.sdf,e.sdfIcons===void 0?e.sdfIcons=lr.sdf:e.sdfIcons!==lr.sdf&&Ht("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(lr.pixelRatio!==e.pixelRatio||m.get("icon-rotate").constantOr(1)!==0)&&(e.iconsNeedLinear=!0))}var Vr=Ip(Ee.horizontal)||Ee.vertical;e.iconsInText=!!Vr&&Vr.iconsInText,(Vr||Or)&&(function(ft,Rt,zt,wt,hi,Xr,jt,mr,Hr,It,Qn){var ji=Xr.textMaxSize.evaluate(Rt,{});ji===void 0&&(ji=jt);var eo,ur=ft.layers[0].layout,to=ur.get("icon-offset").evaluate(Rt,{},Qn),dn=Ip(zt.horizontal),vs=jt/24,Ma=ft.tilePixelRatio*vs,_s=ft.tilePixelRatio*ji/24,Mo=ft.tilePixelRatio*mr,xs=ft.tilePixelRatio*ur.get("symbol-spacing"),Iu=ur.get("text-padding")*ft.tilePixelRatio,bs=ur.get("icon-padding")*ft.tilePixelRatio,dl=ur.get("text-max-angle")/180*Math.PI,Eu=ur.get("text-rotation-alignment")==="map"&&ur.get("symbol-placement")!=="point",Tu=ur.get("icon-rotation-alignment")==="map"&&ur.get("symbol-placement")!=="point",Do=ur.get("symbol-placement"),ml=xs/2,ws=ur.get("icon-text-fit");wt&&ws!=="none"&&(ft.allowVerticalPlacement&&zt.vertical&&(eo=hp(wt,zt.vertical,ws,ur.get("icon-text-fit-padding"),to,vs)),dn&&(wt=hp(wt,dn,ws,ur.get("icon-text-fit-padding"),to,vs)));var ea=function(Uf,Sl){Sl.x<0||Sl.x>=8192||Sl.y<0||Sl.y>=8192||(function(cr,Cn,Nf,ta,Pc,Np,Mu,ro,Du,Il,Lu,Bu,Ac,jp,El,qp,Zp,Gp,Wp,Xp,qi,Ru,Hp,io,jf){var Kp,La,ks,Cs,Ps,As=cr.addToLineVertexArray(Cn,Nf),Jp=0,Yp=0,$p=0,Qp=0,zc=-1,Mc=-1,Lo={},eh=B(""),Dc=0,Lc=0;if(ro._unevaluatedLayout.getValue("text-radial-offset")===void 0?(Dc=(Kp=ro.layout.get("text-offset").evaluate(qi,{},io).map((function(kl){return 24*kl})))[0],Lc=Kp[1]):(Dc=24*ro.layout.get("text-radial-offset").evaluate(qi,{},io),Lc=_c),cr.allowVerticalPlacement&&ta.vertical){var th=ro.layout.get("text-rotate").evaluate(qi,{},io)+90;Cs=new _u(Du,Cn,Il,Lu,Bu,ta.vertical,Ac,jp,El,th),Mu&&(Ps=new _u(Du,Cn,Il,Lu,Bu,Mu,Zp,Gp,El,th))}if(Pc){var Bc=ro.layout.get("icon-rotate").evaluate(qi,{}),rh=ro.layout.get("icon-text-fit")!=="none",ih=xp(Pc,Bc,Hp,rh),Rc=Mu?xp(Mu,Bc,Hp,rh):void 0;ks=new _u(Du,Cn,Il,Lu,Bu,Pc,Zp,Gp,!1,Bc),Jp=4*ih.length;var nh=cr.iconSizeData,Tl=null;nh.kind==="source"?(Tl=[128*ro.layout.get("icon-size").evaluate(qi,{})])[0]>32640&&Ht(cr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):nh.kind==="composite"&&((Tl=[128*Ru.compositeIconSizes[0].evaluate(qi,{},io),128*Ru.compositeIconSizes[1].evaluate(qi,{},io)])[0]>32640||Tl[1]>32640)&&Ht(cr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),cr.addSymbols(cr.icon,ih,Tl,Xp,Wp,qi,!1,Cn,As.lineStartIndex,As.lineLength,-1,io),zc=cr.icon.placedSymbolArray.length-1,Rc&&(Yp=4*Rc.length,cr.addSymbols(cr.icon,Rc,Tl,Xp,Wp,qi,Ni.vertical,Cn,As.lineStartIndex,As.lineLength,-1,io),Mc=cr.icon.placedSymbolArray.length-1)}for(var oh in ta.horizontal){var Fu=ta.horizontal[oh];if(!La){eh=B(Fu.text);var qf=ro.layout.get("text-rotate").evaluate(qi,{},io);La=new _u(Du,Cn,Il,Lu,Bu,Fu,Ac,jp,El,qf)}var ah=Fu.positionedLines.length===1;if($p+=Sp(cr,Cn,Fu,Np,ro,El,qi,qp,As,ta.vertical?Ni.horizontal:Ni.horizontalOnly,ah?Object.keys(ta.horizontal):[oh],Lo,zc,Ru,io),ah)break}ta.vertical&&(Qp+=Sp(cr,Cn,ta.vertical,Np,ro,El,qi,qp,As,Ni.vertical,["vertical"],Lo,Mc,Ru,io));var Zf=La?La.boxStartIndex:cr.collisionBoxArray.length,Gf=La?La.boxEndIndex:cr.collisionBoxArray.length,Wf=Cs?Cs.boxStartIndex:cr.collisionBoxArray.length,Xf=Cs?Cs.boxEndIndex:cr.collisionBoxArray.length,Hf=ks?ks.boxStartIndex:cr.collisionBoxArray.length,Kf=ks?ks.boxEndIndex:cr.collisionBoxArray.length,Jf=Ps?Ps.boxStartIndex:cr.collisionBoxArray.length,Yf=Ps?Ps.boxEndIndex:cr.collisionBoxArray.length,no=-1,Ou=function(kl,lh){return kl&&kl.circleDiameter?Math.max(kl.circleDiameter,lh):lh};no=Ou(La,no),no=Ou(Cs,no),no=Ou(ks,no);var sh=(no=Ou(Ps,no))>-1?1:0;sh&&(no*=jf/24),cr.glyphOffsetArray.length>=Dt.MAX_GLYPHS&&Ht("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),qi.sortKey!==void 0&&cr.addToSortKeyRanges(cr.symbolInstances.length,qi.sortKey),cr.symbolInstances.emplaceBack(Cn.x,Cn.y,Lo.right>=0?Lo.right:-1,Lo.center>=0?Lo.center:-1,Lo.left>=0?Lo.left:-1,Lo.vertical||-1,zc,Mc,eh,Zf,Gf,Wf,Xf,Hf,Kf,Jf,Yf,Il,$p,Qp,Jp,Yp,sh,0,Ac,Dc,Lc,no)})(ft,Sl,Uf,zt,wt,hi,eo,ft.layers[0],ft.collisionBoxArray,Rt.index,Rt.sourceLayerIndex,ft.index,Ma,Iu,Eu,Hr,Mo,bs,Tu,to,Rt,Xr,It,Qn,jt)};if(Do==="line")for(var Ss=0,ku=_p(Rt.geometry,0,0,8192,8192);Ss<ku.length;Ss+=1)for(var Cu=ku[Ss],yl=0,gl=Sf(Cu,xs,dl,zt.vertical||dn,wt,24,_s,ft.overscaling,8192);yl<gl.length;yl+=1){var Pu=gl[yl];dn&&kf(ft,dn.text,ml,Pu)||ea(Cu,Pu)}else if(Do==="line-center")for(var vl=0,_l=Rt.geometry;vl<_l.length;vl+=1){var xl=_l[vl];if(xl.length>1){var Au=wf(xl,dl,zt.vertical||dn,wt,24,_s);Au&&ea(xl,Au)}}else if(Rt.type==="Polygon")for(var Is=0,zu=hc(Rt.geometry,0);Is<zu.length;Is+=1){var Es=zu[Is],bl=Ef(Es,16);ea(Es[0],new ps(bl.x,bl.y,0))}else if(Rt.type==="LineString")for(var Da=0,wl=Rt.geometry;Da<wl.length;Da+=1){var Ts=wl[Da];ea(Ts,new ps(Ts[0].x,Ts[0].y,0))}else if(Rt.type==="Point")for(var Tc=0,Vp=Rt.geometry;Tc<Vp.length;Tc+=1)for(var kc=0,Up=Vp[Tc];kc<Up.length;kc+=1){var Cc=Up[kc];ea([Cc],new ps(Cc.x,Cc.y,0))}})(e,ie,Ee,Or,a,v,be,Oe,ke,ni,h)},Q=0,te=e.features;Q<te.length;Q+=1)J();c&&e.generateCollisionDebugBuffers()},u.perspective=function(e,t,r,a,l){var c,h=1/Math.tan(t/2);return e[0]=h/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=h,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,l!=null&&l!==1/0?(e[10]=(l+a)*(c=1/(a-l)),e[14]=2*l*a*c):(e[10]=-1,e[14]=-2*a),e},u.pick=function(e,t){for(var r={},a=0;a<t.length;a++){var l=t[a];l in e&&(r[l]=e[l])}return r},u.plugin=Pi,u.polygonIntersectsPolygon=Jn,u.postMapLoadEvent=Ln,u.postTurnstileEvent=Mn,u.potpack=lp,u.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],u.register=De,u.registerForPluginStateChange=function(e){return e({pluginStatus:_i,pluginURL:Sn}),Ks.on("pluginStateChange",e),e},u.renderColorRamp=qc,u.rotate=function(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3],m=Math.sin(r),g=Math.cos(r);return e[0]=a*g+c*m,e[1]=l*g+h*m,e[2]=a*-m+c*g,e[3]=l*-m+h*g,e},u.rotateX=function(e,t,r){var a=Math.sin(r),l=Math.cos(r),c=t[4],h=t[5],m=t[6],g=t[7],v=t[8],x=t[9],b=t[10],E=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=c*l+v*a,e[5]=h*l+x*a,e[6]=m*l+b*a,e[7]=g*l+E*a,e[8]=v*l-c*a,e[9]=x*l-h*a,e[10]=b*l-m*a,e[11]=E*l-g*a,e},u.rotateZ=function(e,t,r){var a=Math.sin(r),l=Math.cos(r),c=t[0],h=t[1],m=t[2],g=t[3],v=t[4],x=t[5],b=t[6],E=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=c*l+v*a,e[1]=h*l+x*a,e[2]=m*l+b*a,e[3]=g*l+E*a,e[4]=v*l-c*a,e[5]=x*l-h*a,e[6]=b*l-m*a,e[7]=E*l-g*a,e},u.scale=function(e,t,r){var a=r[0],l=r[1],c=r[2];return e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e[3]=t[3]*a,e[4]=t[4]*l,e[5]=t[5]*l,e[6]=t[6]*l,e[7]=t[7]*l,e[8]=t[8]*c,e[9]=t[9]*c,e[10]=t[10]*c,e[11]=t[11]*c,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},u.scale$1=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},u.scale$2=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},u.setCacheLimits=function(e,t){an=e,lo=t},u.setRTLTextPlugin=function(e,t,r){if(r===void 0&&(r=!1),_i==="deferred"||_i==="loading"||_i==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");Sn=Ir.resolveURL(e),_i="deferred",Ya=t,xa(),r||Ji()},u.sphericalToCartesian=function(e){var t=e[0],r=e[1],a=e[2];return r+=90,r*=Math.PI/180,a*=Math.PI/180,{x:t*Math.cos(r)*Math.sin(a),y:t*Math.sin(r)*Math.sin(a),z:t*Math.cos(a)}},u.sqrLen=function(e){var t=e[0],r=e[1];return t*t+r*r},u.styleSpec=A,u.sub=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e},u.symbolSize=bf,u.transformMat3=function(e,t,r){var a=t[0],l=t[1],c=t[2];return e[0]=a*r[0]+l*r[3]+c*r[6],e[1]=a*r[1]+l*r[4]+c*r[7],e[2]=a*r[2]+l*r[5]+c*r[8],e},u.transformMat4=is,u.translate=function(e,t,r){var a,l,c,h,m,g,v,x,b,E,C,R,F=r[0],G=r[1],j=r[2];return t===e?(e[12]=t[0]*F+t[4]*G+t[8]*j+t[12],e[13]=t[1]*F+t[5]*G+t[9]*j+t[13],e[14]=t[2]*F+t[6]*G+t[10]*j+t[14],e[15]=t[3]*F+t[7]*G+t[11]*j+t[15]):(l=t[1],c=t[2],h=t[3],m=t[4],g=t[5],v=t[6],x=t[7],b=t[8],E=t[9],C=t[10],R=t[11],e[0]=a=t[0],e[1]=l,e[2]=c,e[3]=h,e[4]=m,e[5]=g,e[6]=v,e[7]=x,e[8]=b,e[9]=E,e[10]=C,e[11]=R,e[12]=a*F+m*G+b*j+t[12],e[13]=l*F+g*G+E*j+t[13],e[14]=c*F+v*G+C*j+t[14],e[15]=h*F+x*G+R*j+t[15]),e},u.triggerPluginCompletionEvent=nu,u.uniqueId=pr,u.validateCustomStyleLayer=function(e){var t=[],r=e.id;return r===void 0&&t.push({message:"layers."+r+': missing required property "id"'}),e.render===void 0&&t.push({message:"layers."+r+': missing required method "render"'}),e.renderingMode&&e.renderingMode!=="2d"&&e.renderingMode!=="3d"&&t.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),t},u.validateLight=ic,u.validateStyle=ya,u.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},u.vectorTile=ss,u.version="1.13.3",u.warnOnce=Ht,u.webpSupported=Ei,u.window=Ce,u.wrap=ao})),me(["./shared"],(function(u){function ot(w){var I=typeof w;if(I==="number"||I==="boolean"||I==="string"||w==null)return JSON.stringify(w);if(Array.isArray(w)){for(var k="[",L=0,V=w;L<V.length;L+=1)k+=ot(V[L])+",";return k+"]"}for(var W=Object.keys(w).sort(),H="{",A=0;A<W.length;A++)H+=JSON.stringify(W[A])+":"+ot(w[W[A]])+",";return H+"}"}function pe(w){for(var I="",k=0,L=u.refProperties;k<L.length;k+=1)I+="/"+ot(w[L[k]]);return I}var dt=function(w){this.keyCache={},w&&this.replace(w)};dt.prototype.replace=function(w){this._layerConfigs={},this._layers={},this.update(w,[])},dt.prototype.update=function(w,I){for(var k=this,L=0,V=w;L<V.length;L+=1){var W=V[L];this._layerConfigs[W.id]=W;var H=this._layers[W.id]=u.createStyleLayer(W);H._featureFilter=u.featureFilter(H.filter),this.keyCache[W.id]&&delete this.keyCache[W.id]}for(var A=0,N=I;A<N.length;A+=1){var $=N[A];delete this.keyCache[$],delete this._layerConfigs[$],delete this._layers[$]}this.familiesBySource={};for(var fe=0,ye=(function(we,Ie){for(var lt={},Te=0;Te<we.length;Te++){var gt=Ie&&Ie[we[Te].id]||pe(we[Te]);Ie&&(Ie[we[Te].id]=gt);var Lt=lt[gt];Lt||(Lt=lt[gt]=[]),Lt.push(we[Te])}var pt=[];for(var Et in lt)pt.push(lt[Et]);return pt})(u.values(this._layerConfigs),this.keyCache);fe<ye.length;fe+=1){var ae=ye[fe].map((function(we){return k._layers[we.id]})),de=ae[0];if(de.visibility!=="none"){var Be=de.source||"",Me=this.familiesBySource[Be];Me||(Me=this.familiesBySource[Be]={});var se=de.sourceLayer||"_geojsonTileLayer",Pe=Me[se];Pe||(Pe=Me[se]=[]),Pe.push(ae)}}};var Ze=function(w){var I={},k=[];for(var L in w){var V=w[L],W=I[L]={};for(var H in V){var A=V[+H];if(A&&A.bitmap.width!==0&&A.bitmap.height!==0){var N={x:0,y:0,w:A.bitmap.width+2,h:A.bitmap.height+2};k.push(N),W[H]={rect:N,metrics:A.metrics}}}}var $=u.potpack(k),fe=new u.AlphaImage({width:$.w||1,height:$.h||1});for(var ye in w){var ae=w[ye];for(var de in ae){var Be=ae[+de];if(Be&&Be.bitmap.width!==0&&Be.bitmap.height!==0){var Me=I[ye][de].rect;u.AlphaImage.copy(Be.bitmap,fe,{x:0,y:0},{x:Me.x+1,y:Me.y+1},Be.bitmap)}}}this.image=fe,this.positions=I};u.register("GlyphAtlas",Ze);var yr=function(w){this.tileID=new u.OverscaledTileID(w.tileID.overscaledZ,w.tileID.wrap,w.tileID.canonical.z,w.tileID.canonical.x,w.tileID.canonical.y),this.uid=w.uid,this.zoom=w.zoom,this.pixelRatio=w.pixelRatio,this.tileSize=w.tileSize,this.source=w.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=w.showCollisionBoxes,this.collectResourceTiming=!!w.collectResourceTiming,this.returnDependencies=!!w.returnDependencies,this.promoteId=w.promoteId};function Ce(w,I,k){for(var L=new u.EvaluationParameters(I),V=0,W=w;V<W.length;V+=1)W[V].recalculate(L,k)}function Zi(w,I){var k=u.getArrayBuffer(w.request,(function(L,V,W,H){L?I(L):V&&I(null,{vectorTile:new u.vectorTile.VectorTile(new u.pbf(V)),rawData:V,cacheControl:W,expires:H})}));return function(){k.cancel(),I()}}yr.prototype.parse=function(w,I,k,L,V){var W=this;this.status="parsing",this.data=w,this.collisionBoxArray=new u.CollisionBoxArray;var H=new u.DictionaryCoder(Object.keys(w.layers).sort()),A=new u.FeatureIndex(this.tileID,this.promoteId);A.bucketLayerIDs=[];var N,$,fe,ye,ae={},de={featureIndex:A,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:k},Be=I.familiesBySource[this.source];for(var Me in Be){var se=w.layers[Me];if(se){se.version===1&&u.warnOnce('Vector tile source "'+this.source+'" layer "'+Me+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var Pe=H.encode(Me),we=[],Ie=0;Ie<se.length;Ie++){var lt=se.feature(Ie),Te=A.getId(lt,Me);we.push({feature:lt,id:Te,index:Ie,sourceLayerIndex:Pe})}for(var gt=0,Lt=Be[Me];gt<Lt.length;gt+=1){var pt=Lt[gt],Et=pt[0];Et.minzoom&&this.zoom<Math.floor(Et.minzoom)||Et.maxzoom&&this.zoom>=Et.maxzoom||Et.visibility!=="none"&&(Ce(pt,this.zoom,k),(ae[Et.id]=Et.createBucket({index:A.bucketLayerIDs.length,layers:pt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Pe,sourceID:this.source})).populate(we,de,this.tileID.canonical),A.bucketLayerIDs.push(pt.map((function(Mt){return Mt.id}))))}}}var _t=u.mapObject(de.glyphDependencies,(function(Mt){return Object.keys(Mt).map(Number)}));Object.keys(_t).length?L.send("getGlyphs",{uid:this.uid,stacks:_t},(function(Mt,yt){N||(N=Mt,$=yt,or.call(W))})):$={};var Jr=Object.keys(de.iconDependencies);Jr.length?L.send("getImages",{icons:Jr,source:this.source,tileID:this.tileID,type:"icons"},(function(Mt,yt){N||(N=Mt,fe=yt,or.call(W))})):fe={};var Pt=Object.keys(de.patternDependencies);function or(){if(N)return V(N);if($&&fe&&ye){var Mt=new Ze($),yt=new u.ImageAtlas(fe,ye);for(var Tt in ae){var si=ae[Tt];si instanceof u.SymbolBucket?(Ce(si.layers,this.zoom,k),u.performSymbolLayout(si,$,Mt.positions,fe,yt.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):si.hasPattern&&(si instanceof u.LineBucket||si instanceof u.FillBucket||si instanceof u.FillExtrusionBucket)&&(Ce(si.layers,this.zoom,k),si.addFeatures(de,this.tileID.canonical,yt.patternPositions))}this.status="done",V(null,{buckets:u.values(ae).filter((function(na){return!na.isEmpty()})),featureIndex:A,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Mt.image,imageAtlas:yt,glyphMap:this.returnDependencies?$:null,iconMap:this.returnDependencies?fe:null,glyphPositions:this.returnDependencies?Mt.positions:null})}}Pt.length?L.send("getImages",{icons:Pt,source:this.source,tileID:this.tileID,type:"patterns"},(function(Mt,yt){N||(N=Mt,ye=yt,or.call(W))})):ye={},or.call(this)};var rt=function(w,I,k,L){this.actor=w,this.layerIndex=I,this.availableImages=k,this.loadVectorData=L||Zi,this.loading={},this.loaded={}};rt.prototype.loadTile=function(w,I){var k=this,L=w.uid;this.loading||(this.loading={});var V=!!(w&&w.request&&w.request.collectResourceTiming)&&new u.RequestPerformance(w.request),W=this.loading[L]=new yr(w);W.abort=this.loadVectorData(w,(function(H,A){if(delete k.loading[L],H||!A)return W.status="done",k.loaded[L]=W,I(H);var N=A.rawData,$={};A.expires&&($.expires=A.expires),A.cacheControl&&($.cacheControl=A.cacheControl);var fe={};if(V){var ye=V.finish();ye&&(fe.resourceTiming=JSON.parse(JSON.stringify(ye)))}W.vectorTile=A.vectorTile,W.parse(A.vectorTile,k.layerIndex,k.availableImages,k.actor,(function(ae,de){if(ae||!de)return I(ae);I(null,u.extend({rawTileData:N.slice(0)},de,$,fe))})),k.loaded=k.loaded||{},k.loaded[L]=W}))},rt.prototype.reloadTile=function(w,I){var k=this,L=this.loaded,V=w.uid,W=this;if(L&&L[V]){var H=L[V];H.showCollisionBoxes=w.showCollisionBoxes;var A=function(N,$){var fe=H.reloadCallback;fe&&(delete H.reloadCallback,H.parse(H.vectorTile,W.layerIndex,k.availableImages,W.actor,fe)),I(N,$)};H.status==="parsing"?H.reloadCallback=A:H.status==="done"&&(H.vectorTile?H.parse(H.vectorTile,this.layerIndex,this.availableImages,this.actor,A):A())}},rt.prototype.abortTile=function(w,I){var k=this.loading,L=w.uid;k&&k[L]&&k[L].abort&&(k[L].abort(),delete k[L]),I()},rt.prototype.removeTile=function(w,I){var k=this.loaded,L=w.uid;k&&k[L]&&delete k[L],I()};var rr=u.window.ImageBitmap,gr=function(){this.loaded={}};function ao(w,I){if(w.length!==0){Sr(w[0],I);for(var k=1;k<w.length;k++)Sr(w[k],!I)}}function Sr(w,I){for(var k=0,L=0,V=0,W=w.length,H=W-1;V<W;H=V++){var A=(w[V][0]-w[H][0])*(w[H][1]+w[V][1]),N=k+A;L+=Math.abs(k)>=Math.abs(A)?k-N+A:A-N+k,k=N}k+L>=0!=!!I&&w.reverse()}gr.prototype.loadTile=function(w,I){var k=w.uid,L=w.encoding,V=w.rawImageData,W=rr&&V instanceof rr?this.getImageData(V):V,H=new u.DEMData(k,W,L);this.loaded=this.loaded||{},this.loaded[k]=H,I(null,H)},gr.prototype.getImageData=function(w){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(w.width,w.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=w.width,this.offscreenCanvas.height=w.height,this.offscreenCanvasContext.drawImage(w,0,0,w.width,w.height);var I=this.offscreenCanvasContext.getImageData(-1,-1,w.width+2,w.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new u.RGBAImage({width:I.width,height:I.height},I.data)},gr.prototype.removeTile=function(w){var I=this.loaded,k=w.uid;I&&I[k]&&delete I[k]};var so=u.vectorTile.VectorTileFeature.prototype.toGeoJSON,pr=function(w){this._feature=w,this.extent=u.EXTENT,this.type=w.type,this.properties=w.tags,"id"in w&&!isNaN(w.id)&&(this.id=parseInt(w.id,10))};pr.prototype.loadGeometry=function(){if(this._feature.type===1){for(var w=[],I=0,k=this._feature.geometry;I<k.length;I+=1){var L=k[I];w.push([new u.Point$1(L[0],L[1])])}return w}for(var V=[],W=0,H=this._feature.geometry;W<H.length;W+=1){for(var A=[],N=0,$=H[W];N<$.length;N+=1){var fe=$[N];A.push(new u.Point$1(fe[0],fe[1]))}V.push(A)}return V},pr.prototype.toGeoJSON=function(w,I,k){return so.call(this,w,I,k)};var Mi=function(w){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=u.EXTENT,this.length=w.length,this._features=w};Mi.prototype.feature=function(w){return new pr(this._features[w])};var tn=u.vectorTile.VectorTileFeature,mn=fi;function fi(w,I){this.options=I||{},this.features=w,this.length=w.length}function zr(w,I){this.id=typeof w.id=="number"?w.id:void 0,this.type=w.type,this.rawGeometry=w.type===1?[w.geometry]:w.geometry,this.properties=w.tags,this.extent=I||4096}fi.prototype.feature=function(w){return new zr(this.features[w],this.options.extent)},zr.prototype.loadGeometry=function(){var w=this.rawGeometry;this.geometry=[];for(var I=0;I<w.length;I++){for(var k=w[I],L=[],V=0;V<k.length;V++)L.push(new u.Point$1(k[V][0],k[V][1]));this.geometry.push(L)}return this.geometry},zr.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var w=this.geometry,I=1/0,k=-1/0,L=1/0,V=-1/0,W=0;W<w.length;W++)for(var H=w[W],A=0;A<H.length;A++){var N=H[A];I=Math.min(I,N.x),k=Math.max(k,N.x),L=Math.min(L,N.y),V=Math.max(V,N.y)}return[I,L,k,V]},zr.prototype.toGeoJSON=tn.prototype.toGeoJSON;var Gi=Pn,Si=mn;function Pn(w){var I=new u.pbf;return(function(k,L){for(var V in k.layers)L.writeMessage(3,Ht,k.layers[V])})(w,I),I.finish()}function Ht(w,I){var k;I.writeVarintField(15,w.version||1),I.writeStringField(1,w.name||""),I.writeVarintField(5,w.extent||4096);var L={keys:[],values:[],keycache:{},valuecache:{}};for(k=0;k<w.length;k++)L.feature=w.feature(k),I.writeMessage(2,Kr,L);var V=L.keys;for(k=0;k<V.length;k++)I.writeStringField(3,V[k]);var W=L.values;for(k=0;k<W.length;k++)I.writeMessage(4,Ro,W[k])}function Kr(w,I){var k=w.feature;k.id!==void 0&&I.writeVarintField(1,k.id),I.writeMessage(2,Bo,w),I.writeVarintField(3,k.type),I.writeMessage(4,zn,k)}function Bo(w,I){var k=w.feature,L=w.keys,V=w.values,W=w.keycache,H=w.valuecache;for(var A in k.properties){var N=W[A];N===void 0&&(L.push(A),W[A]=N=L.length-1),I.writeVarint(N);var $=k.properties[A],fe=typeof $;fe!=="string"&&fe!=="boolean"&&fe!=="number"&&($=JSON.stringify($));var ye=fe+":"+$,ae=H[ye];ae===void 0&&(V.push($),H[ye]=ae=V.length-1),I.writeVarint(ae)}}function di(w,I){return(I<<3)+(7&w)}function An(w){return w<<1^w>>31}function zn(w,I){for(var k=w.loadGeometry(),L=w.type,V=0,W=0,H=k.length,A=0;A<H;A++){var N=k[A],$=1;L===1&&($=N.length),I.writeVarint(di(1,$));for(var fe=L===3?N.length-1:N.length,ye=0;ye<fe;ye++){ye===1&&L!==1&&I.writeVarint(di(2,fe-1));var ae=N[ye].x-V,de=N[ye].y-W;I.writeVarint(An(ae)),I.writeVarint(An(de)),V+=ae,W+=de}L===3&&I.writeVarint(di(7,1))}}function Ro(w,I){var k=typeof w;k==="string"?I.writeStringField(1,w):k==="boolean"?I.writeBooleanField(7,w):k==="number"&&(w%1!=0?I.writeDoubleField(3,w):w<0?I.writeSVarintField(6,w):I.writeVarintField(5,w))}function Ii(w,I,k,L){oi(w,k,L),oi(I,2*k,2*L),oi(I,2*k+1,2*L+1)}function oi(w,I,k){var L=w[I];w[I]=w[k],w[k]=L}function Di(w,I,k,L){var V=w-k,W=I-L;return V*V+W*W}Gi.fromVectorTileJs=Pn,Gi.fromGeojsonVt=function(w,I){I=I||{};var k={};for(var L in w)k[L]=new mn(w[L].features,I),k[L].name=L,k[L].version=I.version,k[L].extent=I.extent;return Pn({layers:k})},Gi.GeoJSONWrapper=Si;var rn=function(w){return w[0]},nn=function(w){return w[1]},Wi=function(w,I,k,L,V){I===void 0&&(I=rn),k===void 0&&(k=nn),L===void 0&&(L=64),V===void 0&&(V=Float64Array),this.nodeSize=L,this.points=w;for(var W=w.length<65536?Uint16Array:Uint32Array,H=this.ids=new W(w.length),A=this.coords=new V(2*w.length),N=0;N<w.length;N++)H[N]=N,A[2*N]=I(w[N]),A[2*N+1]=k(w[N]);(function $(fe,ye,ae,de,Be,Me){if(!(Be-de<=ae)){var se=de+Be>>1;(function Pe(we,Ie,lt,Te,gt,Lt){for(;gt>Te;){if(gt-Te>600){var pt=gt-Te+1,Et=lt-Te+1,_t=Math.log(pt),Jr=.5*Math.exp(2*_t/3),Pt=.5*Math.sqrt(_t*Jr*(pt-Jr)/pt)*(Et-pt/2<0?-1:1);Pe(we,Ie,lt,Math.max(Te,Math.floor(lt-Et*Jr/pt+Pt)),Math.min(gt,Math.floor(lt+(pt-Et)*Jr/pt+Pt)),Lt)}var or=Ie[2*lt+Lt],Mt=Te,yt=gt;for(Ii(we,Ie,Te,lt),Ie[2*gt+Lt]>or&&Ii(we,Ie,Te,gt);Mt<yt;){for(Ii(we,Ie,Mt,yt),Mt++,yt--;Ie[2*Mt+Lt]<or;)Mt++;for(;Ie[2*yt+Lt]>or;)yt--}Ie[2*Te+Lt]===or?Ii(we,Ie,Te,yt):Ii(we,Ie,++yt,gt),yt<=lt&&(Te=yt+1),lt<=yt&&(gt=yt-1)}})(fe,ye,se,de,Be,Me%2),$(fe,ye,ae,de,se-1,Me+1),$(fe,ye,ae,se+1,Be,Me+1)}})(H,A,L,0,H.length-1,0)};Wi.prototype.range=function(w,I,k,L){return(function(V,W,H,A,N,$,fe){for(var ye,ae,de=[0,V.length-1,0],Be=[];de.length;){var Me=de.pop(),se=de.pop(),Pe=de.pop();if(se-Pe<=fe)for(var we=Pe;we<=se;we++)ae=W[2*we+1],(ye=W[2*we])>=H&&ye<=N&&ae>=A&&ae<=$&&Be.push(V[we]);else{var Ie=Math.floor((Pe+se)/2);ae=W[2*Ie+1],(ye=W[2*Ie])>=H&&ye<=N&&ae>=A&&ae<=$&&Be.push(V[Ie]);var lt=(Me+1)%2;(Me===0?H<=ye:A<=ae)&&(de.push(Pe),de.push(Ie-1),de.push(lt)),(Me===0?N>=ye:$>=ae)&&(de.push(Ie+1),de.push(se),de.push(lt))}}return Be})(this.ids,this.coords,w,I,k,L,this.nodeSize)},Wi.prototype.within=function(w,I,k){return(function(L,V,W,H,A,N){for(var $=[0,L.length-1,0],fe=[],ye=A*A;$.length;){var ae=$.pop(),de=$.pop(),Be=$.pop();if(de-Be<=N)for(var Me=Be;Me<=de;Me++)Di(V[2*Me],V[2*Me+1],W,H)<=ye&&fe.push(L[Me]);else{var se=Math.floor((Be+de)/2),Pe=V[2*se],we=V[2*se+1];Di(Pe,we,W,H)<=ye&&fe.push(L[se]);var Ie=(ae+1)%2;(ae===0?W-A<=Pe:H-A<=we)&&($.push(Be),$.push(se-1),$.push(Ie)),(ae===0?W+A>=Pe:H+A>=we)&&($.push(se+1),$.push(de),$.push(Ie))}}return fe})(this.ids,this.coords,w,I,k,this.nodeSize)};var Ur={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(w){return w}},Kt=function(w){this.options=We(Object.create(Ur),w),this.trees=new Array(this.options.maxZoom+1)};function Ir(w,I,k,L,V){return{x:w,y:I,zoom:1/0,id:k,parentId:-1,numPoints:L,properties:V}}function mt(w,I){var k=w.geometry.coordinates,L=k[1];return{x:_e(k[0]),y:le(L),zoom:1/0,index:I,parentId:-1}}function Ei(w){return{type:"Feature",id:w.id,properties:ue(w),geometry:{type:"Point",coordinates:[(L=w.x,360*(L-.5)),(I=w.y,k=(180-360*I)*Math.PI/180,360*Math.atan(Math.exp(k))/Math.PI-90)]}};var I,k,L}function ue(w){var I=w.numPoints,k=I>=1e4?Math.round(I/1e3)+"k":I>=1e3?Math.round(I/100)/10+"k":I;return We(We({},w.properties),{cluster:!0,cluster_id:w.id,point_count:I,point_count_abbreviated:k})}function _e(w){return w/360+.5}function le(w){var I=Math.sin(w*Math.PI/180),k=.5-.25*Math.log((1+I)/(1-I))/Math.PI;return k<0?0:k>1?1:k}function We(w,I){for(var k in I)w[k]=I[k];return w}function et(w){return w.x}function ut(w){return w.y}function Ft(w,I,k,L,V,W){var H=V-k,A=W-L;if(H!==0||A!==0){var N=((w-k)*H+(I-L)*A)/(H*H+A*A);N>1?(k=V,L=W):N>0&&(k+=H*N,L+=A*N)}return(H=w-k)*H+(A=I-L)*A}function Nt(w,I,k,L){var V={id:w===void 0?null:w,type:I,geometry:k,tags:L,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return(function(W){var H=W.geometry,A=W.type;if(A==="Point"||A==="MultiPoint"||A==="LineString")Er(W,H);else if(A==="Polygon"||A==="MultiLineString")for(var N=0;N<H.length;N++)Er(W,H[N]);else if(A==="MultiPolygon")for(N=0;N<H.length;N++)for(var $=0;$<H[N].length;$++)Er(W,H[N][$])})(V),V}function Er(w,I){for(var k=0;k<I.length;k+=3)w.minX=Math.min(w.minX,I[k]),w.minY=Math.min(w.minY,I[k+1]),w.maxX=Math.max(w.maxX,I[k]),w.maxY=Math.max(w.maxY,I[k+1])}function Jt(w,I,k,L){if(I.geometry){var V=I.geometry.coordinates,W=I.geometry.type,H=Math.pow(k.tolerance/((1<<k.maxZoom)*k.extent),2),A=[],N=I.id;if(k.promoteId?N=I.properties[k.promoteId]:k.generateId&&(N=L||0),W==="Point")ir(V,A);else if(W==="MultiPoint")for(var $=0;$<V.length;$++)ir(V[$],A);else if(W==="LineString")hr(V,A,H,!1);else if(W==="MultiLineString"){if(k.lineMetrics){for($=0;$<V.length;$++)hr(V[$],A=[],H,!1),w.push(Nt(N,"LineString",A,I.properties));return}vr(V,A,H,!1)}else if(W==="Polygon")vr(V,A,H,!0);else{if(W!=="MultiPolygon"){if(W==="GeometryCollection"){for($=0;$<I.geometry.geometries.length;$++)Jt(w,{id:N,geometry:I.geometry.geometries[$],properties:I.properties},k,L);return}throw new Error("Input data is not a valid GeoJSON object.")}for($=0;$<V.length;$++){var fe=[];vr(V[$],fe,H,!0),A.push(fe)}}w.push(Nt(N,W,A,I.properties))}}function ir(w,I){I.push(Ve(w[0])),I.push(Ti(w[1])),I.push(0)}function hr(w,I,k,L){for(var V,W,H=0,A=0;A<w.length;A++){var N=Ve(w[A][0]),$=Ti(w[A][1]);I.push(N),I.push($),I.push(0),A>0&&(H+=L?(V*$-N*W)/2:Math.sqrt(Math.pow(N-V,2)+Math.pow($-W,2))),V=N,W=$}var fe=I.length-3;I[2]=1,(function ye(ae,de,Be,Me){for(var se,Pe=Me,we=Be-de>>1,Ie=Be-de,lt=ae[de],Te=ae[de+1],gt=ae[Be],Lt=ae[Be+1],pt=de+3;pt<Be;pt+=3){var Et=Ft(ae[pt],ae[pt+1],lt,Te,gt,Lt);if(Et>Pe)se=pt,Pe=Et;else if(Et===Pe){var _t=Math.abs(pt-we);_t<Ie&&(se=pt,Ie=_t)}}Pe>Me&&(se-de>3&&ye(ae,de,se,Me),ae[se+2]=Pe,Be-se>3&&ye(ae,se,Be,Me))})(I,0,fe,k),I[fe+2]=1,I.size=Math.abs(H),I.start=0,I.end=I.size}function vr(w,I,k,L){for(var V=0;V<w.length;V++){var W=[];hr(w[V],W,k,L),I.push(W)}}function Ve(w){return w/360+.5}function Ti(w){var I=Math.sin(w*Math.PI/180),k=.5-.25*Math.log((1+I)/(1-I))/Math.PI;return k<0?0:k>1?1:k}function Gr(w,I,k,L,V,W,H,A){if(L/=I,W>=(k/=I)&&H<L)return w;if(H<k||W>=L)return null;for(var N=[],$=0;$<w.length;$++){var fe=w[$],ye=fe.geometry,ae=fe.type,de=V===0?fe.minX:fe.minY,Be=V===0?fe.maxX:fe.maxY;if(de>=k&&Be<L)N.push(fe);else if(!(Be<k||de>=L)){var Me=[];if(ae==="Point"||ae==="MultiPoint")on(ye,Me,k,L,V);else if(ae==="LineString")Mn(ye,Me,k,L,V,!1,A.lineMetrics);else if(ae==="MultiLineString")Ln(ye,Me,k,L,V,!1);else if(ae==="Polygon")Ln(ye,Me,k,L,V,!0);else if(ae==="MultiPolygon")for(var se=0;se<ye.length;se++){var Pe=[];Ln(ye[se],Pe,k,L,V,!0),Pe.length&&Me.push(Pe)}if(Me.length){if(A.lineMetrics&&ae==="LineString"){for(se=0;se<Me.length;se++)N.push(Nt(fe.id,ae,Me[se],fe.tags));continue}ae!=="LineString"&&ae!=="MultiLineString"||(Me.length===1?(ae="LineString",Me=Me[0]):ae="MultiLineString"),ae!=="Point"&&ae!=="MultiPoint"||(ae=Me.length===3?"Point":"MultiPoint"),N.push(Nt(fe.id,ae,Me,fe.tags))}}}return N.length?N:null}function on(w,I,k,L,V){for(var W=0;W<w.length;W+=3){var H=w[W+V];H>=k&&H<=L&&(I.push(w[W]),I.push(w[W+1]),I.push(w[W+2]))}}function Mn(w,I,k,L,V,W,H){for(var A,N,$=Dn(w),fe=V===0?lo:yn,ye=w.start,ae=0;ae<w.length-3;ae+=3){var de=w[ae],Be=w[ae+1],Me=w[ae+2],se=w[ae+3],Pe=w[ae+4],we=V===0?de:Be,Ie=V===0?se:Pe,lt=!1;H&&(A=Math.sqrt(Math.pow(de-se,2)+Math.pow(Be-Pe,2))),we<k?Ie>k&&(N=fe($,de,Be,se,Pe,k),H&&($.start=ye+A*N)):we>L?Ie<L&&(N=fe($,de,Be,se,Pe,L),H&&($.start=ye+A*N)):an($,de,Be,Me),Ie<k&&we>=k&&(N=fe($,de,Be,se,Pe,k),lt=!0),Ie>L&&we<=L&&(N=fe($,de,Be,se,Pe,L),lt=!0),!W&<&&(H&&($.end=ye+A*N),I.push($),$=Dn(w)),H&&(ye+=A)}var Te=w.length-3;de=w[Te],Be=w[Te+1],Me=w[Te+2],(we=V===0?de:Be)>=k&&we<=L&&an($,de,Be,Me),Te=$.length-3,W&&Te>=3&&($[Te]!==$[0]||$[Te+1]!==$[1])&&an($,$[0],$[1],$[2]),$.length&&I.push($)}function Dn(w){var I=[];return I.size=w.size,I.start=w.start,I.end=w.end,I}function Ln(w,I,k,L,V,W){for(var H=0;H<w.length;H++)Mn(w[H],I,k,L,V,W,!1)}function an(w,I,k,L){w.push(I),w.push(k),w.push(L)}function lo(w,I,k,L,V,W){var H=(W-I)/(L-I);return w.push(W),w.push(k+(V-k)*H),w.push(1),H}function yn(w,I,k,L,V,W){var H=(W-k)/(V-k);return w.push(I+(L-I)*H),w.push(W),w.push(1),H}function Bn(w,I){for(var k=[],L=0;L<w.length;L++){var V,W=w[L],H=W.type;if(H==="Point"||H==="MultiPoint"||H==="LineString")V=ai(W.geometry,I);else if(H==="MultiLineString"||H==="Polygon"){V=[];for(var A=0;A<W.geometry.length;A++)V.push(ai(W.geometry[A],I))}else if(H==="MultiPolygon")for(V=[],A=0;A<W.geometry.length;A++){for(var N=[],$=0;$<W.geometry[A].length;$++)N.push(ai(W.geometry[A][$],I));V.push(N)}k.push(Nt(W.id,H,V,W.tags))}return k}function ai(w,I){var k=[];k.size=w.size,w.start!==void 0&&(k.start=w.start,k.end=w.end);for(var L=0;L<w.length;L+=3)k.push(w[L]+I,w[L+1],w[L+2]);return k}function gn(w,I){if(w.transformed)return w;var k,L,V,W=1<<w.z,H=w.x,A=w.y;for(k=0;k<w.features.length;k++){var N=w.features[k],$=N.geometry,fe=N.type;if(N.geometry=[],fe===1)for(L=0;L<$.length;L+=2)N.geometry.push(sn($[L],$[L+1],I,W,H,A));else for(L=0;L<$.length;L++){var ye=[];for(V=0;V<$[L].length;V+=2)ye.push(sn($[L][V],$[L][V+1],I,W,H,A));N.geometry.push(ye)}}return w.transformed=!0,w}function sn(w,I,k,L,V,W){return[Math.round(k*(w*L-V)),Math.round(k*(I*L-W))]}function Tr(w,I,k,L,V){for(var W=I===V.maxZoom?0:V.tolerance/((1<<I)*V.extent),H={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:k,y:L,z:I,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},A=0;A<w.length;A++){H.numFeatures++,Mr(H,w[A],W,V);var N=w[A].minX,$=w[A].minY,fe=w[A].maxX,ye=w[A].maxY;N<H.minX&&(H.minX=N),$<H.minY&&(H.minY=$),fe>H.maxX&&(H.maxX=fe),ye>H.maxY&&(H.maxY=ye)}return H}function Mr(w,I,k,L){var V=I.geometry,W=I.type,H=[];if(W==="Point"||W==="MultiPoint")for(var A=0;A<V.length;A+=3)H.push(V[A]),H.push(V[A+1]),w.numPoints++,w.numSimplified++;else if(W==="LineString")vn(H,V,w,k,!1,!1);else if(W==="MultiLineString"||W==="Polygon")for(A=0;A<V.length;A++)vn(H,V[A],w,k,W==="Polygon",A===0);else if(W==="MultiPolygon")for(var N=0;N<V.length;N++){var $=V[N];for(A=0;A<$.length;A++)vn(H,$[A],w,k,!0,A===0)}if(H.length){var fe=I.tags||null;if(W==="LineString"&&L.lineMetrics){for(var ye in fe={},I.tags)fe[ye]=I.tags[ye];fe.mapbox_clip_start=V.start/V.size,fe.mapbox_clip_end=V.end/V.size}var ae={geometry:H,type:W==="Polygon"||W==="MultiPolygon"?3:W==="LineString"||W==="MultiLineString"?2:1,tags:fe};I.id!==null&&(ae.id=I.id),w.features.push(ae)}}function vn(w,I,k,L,V,W){var H=L*L;if(L>0&&I.size<(V?H:L))k.numPoints+=I.length/3;else{for(var A=[],N=0;N<I.length;N+=3)(L===0||I[N+2]>H)&&(k.numSimplified++,A.push(I[N]),A.push(I[N+1])),k.numPoints++;V&&(function($,fe){for(var ye=0,ae=0,de=$.length,Be=de-2;ae<de;Be=ae,ae+=2)ye+=($[ae]-$[Be])*($[ae+1]+$[Be+1]);if(ye>0===fe)for(ae=0,de=$.length;ae<de/2;ae+=2){var Me=$[ae],se=$[ae+1];$[ae]=$[de-2-ae],$[ae+1]=$[de-1-ae],$[de-2-ae]=Me,$[de-1-ae]=se}})(A,W),w.push(A)}}function _n(w,I){var k=(I=this.options=(function(V,W){for(var H in W)V[H]=W[H];return V})(Object.create(this.options),I)).debug;if(k&&console.time("preprocess data"),I.maxZoom<0||I.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(I.promoteId&&I.generateId)throw new Error("promoteId and generateId cannot be used together.");var L=(function(V,W){var H=[];if(V.type==="FeatureCollection")for(var A=0;A<V.features.length;A++)Jt(H,V.features[A],W,A);else Jt(H,V.type==="Feature"?V:{geometry:V},W);return H})(w,I);this.tiles={},this.tileCoords=[],k&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",I.indexMaxZoom,I.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(L=(function(V,W){var H=W.buffer/W.extent,A=V,N=Gr(V,1,-1-H,H,0,-1,2,W),$=Gr(V,1,1-H,2+H,0,-1,2,W);return(N||$)&&(A=Gr(V,1,-H,1+H,0,-1,2,W)||[],N&&(A=Bn(N,1).concat(A)),$&&(A=A.concat(Bn($,-1)))),A})(L,I)).length&&this.splitTile(L,0,0,0),k&&(L.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)))}function xn(w,I,k){return 32*((1<<w)*k+I)+w}function Fo(w,I){var k=w.tileID.canonical;if(!this._geoJSONIndex)return I(null,null);var L=this._geoJSONIndex.getTile(k.z,k.x,k.y);if(!L)return I(null,null);var V=new Mi(L.features),W=Gi(V);W.byteOffset===0&&W.byteLength===W.buffer.byteLength||(W=new Uint8Array(W)),I(null,{vectorTile:V,rawData:W.buffer})}Kt.prototype.load=function(w){var I=this.options,k=I.log,L=I.minZoom,V=I.maxZoom,W=I.nodeSize;k&&console.time("total time");var H="prepare "+w.length+" points";k&&console.time(H),this.points=w;for(var A=[],N=0;N<w.length;N++)w[N].geometry&&A.push(mt(w[N],N));this.trees[V+1]=new Wi(A,et,ut,W,Float32Array),k&&console.timeEnd(H);for(var $=V;$>=L;$--){var fe=+Date.now();A=this._cluster(A,$),this.trees[$]=new Wi(A,et,ut,W,Float32Array),k&&console.log("z%d: %d clusters in %dms",$,A.length,+Date.now()-fe)}return k&&console.timeEnd("total time"),this},Kt.prototype.getClusters=function(w,I){var k=((w[0]+180)%360+360)%360-180,L=Math.max(-90,Math.min(90,w[1])),V=w[2]===180?180:((w[2]+180)%360+360)%360-180,W=Math.max(-90,Math.min(90,w[3]));if(w[2]-w[0]>=360)k=-180,V=180;else if(k>V){var H=this.getClusters([k,L,180,W],I),A=this.getClusters([-180,L,V,W],I);return H.concat(A)}for(var N=this.trees[this._limitZoom(I)],$=[],fe=0,ye=N.range(_e(k),le(W),_e(V),le(L));fe<ye.length;fe+=1){var ae=N.points[ye[fe]];$.push(ae.numPoints?Ei(ae):this.points[ae.index])}return $},Kt.prototype.getChildren=function(w){var I=this._getOriginId(w),k=this._getOriginZoom(w),L="No cluster with the specified id.",V=this.trees[k];if(!V)throw new Error(L);var W=V.points[I];if(!W)throw new Error(L);for(var H=this.options.radius/(this.options.extent*Math.pow(2,k-1)),A=[],N=0,$=V.within(W.x,W.y,H);N<$.length;N+=1){var fe=V.points[$[N]];fe.parentId===w&&A.push(fe.numPoints?Ei(fe):this.points[fe.index])}if(A.length===0)throw new Error(L);return A},Kt.prototype.getLeaves=function(w,I,k){var L=[];return this._appendLeaves(L,w,I=I||10,k=k||0,0),L},Kt.prototype.getTile=function(w,I,k){var L=this.trees[this._limitZoom(w)],V=Math.pow(2,w),W=this.options,H=W.radius/W.extent,A=(k-H)/V,N=(k+1+H)/V,$={features:[]};return this._addTileFeatures(L.range((I-H)/V,A,(I+1+H)/V,N),L.points,I,k,V,$),I===0&&this._addTileFeatures(L.range(1-H/V,A,1,N),L.points,V,k,V,$),I===V-1&&this._addTileFeatures(L.range(0,A,H/V,N),L.points,-1,k,V,$),$.features.length?$:null},Kt.prototype.getClusterExpansionZoom=function(w){for(var I=this._getOriginZoom(w)-1;I<=this.options.maxZoom;){var k=this.getChildren(w);if(I++,k.length!==1)break;w=k[0].properties.cluster_id}return I},Kt.prototype._appendLeaves=function(w,I,k,L,V){for(var W=0,H=this.getChildren(I);W<H.length;W+=1){var A=H[W],N=A.properties;if(N&&N.cluster?V+N.point_count<=L?V+=N.point_count:V=this._appendLeaves(w,N.cluster_id,k,L,V):V<L?V++:w.push(A),w.length===k)break}return V},Kt.prototype._addTileFeatures=function(w,I,k,L,V,W){for(var H=0,A=w;H<A.length;H+=1){var N=I[A[H]],$=N.numPoints,fe={type:1,geometry:[[Math.round(this.options.extent*(N.x*V-k)),Math.round(this.options.extent*(N.y*V-L))]],tags:$?ue(N):this.points[N.index].properties},ye=void 0;$?ye=N.id:this.options.generateId?ye=N.index:this.points[N.index].id&&(ye=this.points[N.index].id),ye!==void 0&&(fe.id=ye),W.features.push(fe)}},Kt.prototype._limitZoom=function(w){return Math.max(this.options.minZoom,Math.min(+w,this.options.maxZoom+1))},Kt.prototype._cluster=function(w,I){for(var k=[],L=this.options,V=L.reduce,W=L.minPoints,H=L.radius/(L.extent*Math.pow(2,I)),A=0;A<w.length;A++){var N=w[A];if(!(N.zoom<=I)){N.zoom=I;for(var $=this.trees[I+1],fe=$.within(N.x,N.y,H),ye=N.numPoints||1,ae=ye,de=0,Be=fe;de<Be.length;de+=1){var Me=$.points[Be[de]];Me.zoom>I&&(ae+=Me.numPoints||1)}if(ae>=W){for(var se=N.x*ye,Pe=N.y*ye,we=V&&ye>1?this._map(N,!0):null,Ie=(A<<5)+(I+1)+this.points.length,lt=0,Te=fe;lt<Te.length;lt+=1){var gt=$.points[Te[lt]];if(!(gt.zoom<=I)){gt.zoom=I;var Lt=gt.numPoints||1;se+=gt.x*Lt,Pe+=gt.y*Lt,gt.parentId=Ie,V&&(we||(we=this._map(N,!0)),V(we,this._map(gt)))}}N.parentId=Ie,k.push(Ir(se/ae,Pe/ae,Ie,ae,we))}else if(k.push(N),ae>1)for(var pt=0,Et=fe;pt<Et.length;pt+=1){var _t=$.points[Et[pt]];_t.zoom<=I||(_t.zoom=I,k.push(_t))}}}return k},Kt.prototype._getOriginId=function(w){return w-this.points.length>>5},Kt.prototype._getOriginZoom=function(w){return(w-this.points.length)%32},Kt.prototype._map=function(w,I){if(w.numPoints)return I?We({},w.properties):w.properties;var k=this.points[w.index].properties,L=this.options.map(k);return I&&L===k?We({},L):L},_n.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},_n.prototype.splitTile=function(w,I,k,L,V,W,H){for(var A=[w,I,k,L],N=this.options,$=N.debug;A.length;){L=A.pop(),k=A.pop(),I=A.pop(),w=A.pop();var fe=1<<I,ye=xn(I,k,L),ae=this.tiles[ye];if(!ae&&($>1&&console.time("creation"),ae=this.tiles[ye]=Tr(w,I,k,L,N),this.tileCoords.push({z:I,x:k,y:L}),$)){$>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",I,k,L,ae.numFeatures,ae.numPoints,ae.numSimplified),console.timeEnd("creation"));var de="z"+I;this.stats[de]=(this.stats[de]||0)+1,this.total++}if(ae.source=w,V){if(I===N.maxZoom||I===V)continue;var Be=1<<V-I;if(k!==Math.floor(W/Be)||L!==Math.floor(H/Be))continue}else if(I===N.indexMaxZoom||ae.numPoints<=N.indexMaxPoints)continue;if(ae.source=null,w.length!==0){$>1&&console.time("clipping");var Me,se,Pe,we,Ie,lt,Te=.5*N.buffer/N.extent,gt=.5-Te,Lt=.5+Te,pt=1+Te;Me=se=Pe=we=null,Ie=Gr(w,fe,k-Te,k+Lt,0,ae.minX,ae.maxX,N),lt=Gr(w,fe,k+gt,k+pt,0,ae.minX,ae.maxX,N),w=null,Ie&&(Me=Gr(Ie,fe,L-Te,L+Lt,1,ae.minY,ae.maxY,N),se=Gr(Ie,fe,L+gt,L+pt,1,ae.minY,ae.maxY,N),Ie=null),lt&&(Pe=Gr(lt,fe,L-Te,L+Lt,1,ae.minY,ae.maxY,N),we=Gr(lt,fe,L+gt,L+pt,1,ae.minY,ae.maxY,N),lt=null),$>1&&console.timeEnd("clipping"),A.push(Me||[],I+1,2*k,2*L),A.push(se||[],I+1,2*k,2*L+1),A.push(Pe||[],I+1,2*k+1,2*L),A.push(we||[],I+1,2*k+1,2*L+1)}}},_n.prototype.getTile=function(w,I,k){var L=this.options,V=L.extent,W=L.debug;if(w<0||w>24)return null;var H=1<<w,A=xn(w,I=(I%H+H)%H,k);if(this.tiles[A])return gn(this.tiles[A],V);W>1&&console.log("drilling down to z%d-%d-%d",w,I,k);for(var N,$=w,fe=I,ye=k;!N&&$>0;)$--,fe=Math.floor(fe/2),ye=Math.floor(ye/2),N=this.tiles[xn($,fe,ye)];return N&&N.source?(W>1&&console.log("found parent tile z%d-%d-%d",$,fe,ye),W>1&&console.time("drilling down"),this.splitTile(N.source,$,fe,ye,w,I,k),W>1&&console.timeEnd("drilling down"),this.tiles[A]?gn(this.tiles[A],V):null):null};var ia=(function(w){function I(k,L,V,W){w.call(this,k,L,V,Fo),W&&(this.loadGeoJSON=W)}return w&&(I.__proto__=w),(I.prototype=Object.create(w&&w.prototype)).constructor=I,I.prototype.loadData=function(k,L){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=L,this._pendingLoadDataParams=k,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},I.prototype._loadData=function(){var k=this;if(this._pendingCallback&&this._pendingLoadDataParams){var L=this._pendingCallback,V=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var W=!!(V&&V.request&&V.request.collectResourceTiming)&&new u.RequestPerformance(V.request);this.loadGeoJSON(V,(function(H,A){if(H||!A)return L(H);if(typeof A!="object")return L(new Error("Input data given to '"+V.source+"' is not a valid GeoJSON object."));(function ae(de,Be){var Me,se=de&&de.type;if(se==="FeatureCollection")for(Me=0;Me<de.features.length;Me++)ae(de.features[Me],Be);else if(se==="GeometryCollection")for(Me=0;Me<de.geometries.length;Me++)ae(de.geometries[Me],Be);else if(se==="Feature")ae(de.geometry,Be);else if(se==="Polygon")ao(de.coordinates,Be);else if(se==="MultiPolygon")for(Me=0;Me<de.coordinates.length;Me++)ao(de.coordinates[Me],Be);return de})(A,!0);try{if(V.filter){var N=u.createExpression(V.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(N.result==="error")throw new Error(N.value.map((function(ae){return ae.key+": "+ae.message})).join(", "));var $=A.features.filter((function(ae){return N.value.evaluate({zoom:0},ae)}));A={type:"FeatureCollection",features:$}}k._geoJSONIndex=V.cluster?new Kt((function(ae){var de=ae.superclusterOptions,Be=ae.clusterProperties;if(!Be||!de)return de;for(var Me={},se={},Pe={accumulated:null,zoom:0},we={properties:null},Ie=Object.keys(Be),lt=0,Te=Ie;lt<Te.length;lt+=1){var gt=Te[lt],Lt=Be[gt],pt=Lt[0],Et=u.createExpression(Lt[1]),_t=u.createExpression(typeof pt=="string"?[pt,["accumulated"],["get",gt]]:pt);Me[gt]=Et.value,se[gt]=_t.value}return de.map=function(Jr){we.properties=Jr;for(var Pt={},or=0,Mt=Ie;or<Mt.length;or+=1){var yt=Mt[or];Pt[yt]=Me[yt].evaluate(Pe,we)}return Pt},de.reduce=function(Jr,Pt){we.properties=Pt;for(var or=0,Mt=Ie;or<Mt.length;or+=1){var yt=Mt[or];Pe.accumulated=Jr[yt],Jr[yt]=se[yt].evaluate(Pe,we)}},de})(V)).load(A.features):(function(ae,de){return new _n(ae,de)})(A,V.geojsonVtOptions)}catch(ae){return L(ae)}k.loaded={};var fe={};if(W){var ye=W.finish();ye&&(fe.resourceTiming={},fe.resourceTiming[V.source]=JSON.parse(JSON.stringify(ye)))}L(null,fe)}))}},I.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},I.prototype.reloadTile=function(k,L){var V=this.loaded;return V&&V[k.uid]?w.prototype.reloadTile.call(this,k,L):this.loadTile(k,L)},I.prototype.loadGeoJSON=function(k,L){if(k.request)u.getJSON(k.request,L);else{if(typeof k.data!="string")return L(new Error("Input data given to '"+k.source+"' is not a valid GeoJSON object."));try{return L(null,JSON.parse(k.data))}catch{return L(new Error("Input data given to '"+k.source+"' is not a valid GeoJSON object."))}}},I.prototype.removeSource=function(k,L){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),L()},I.prototype.getClusterExpansionZoom=function(k,L){try{L(null,this._geoJSONIndex.getClusterExpansionZoom(k.clusterId))}catch(V){L(V)}},I.prototype.getClusterChildren=function(k,L){try{L(null,this._geoJSONIndex.getChildren(k.clusterId))}catch(V){L(V)}},I.prototype.getClusterLeaves=function(k,L){try{L(null,this._geoJSONIndex.getLeaves(k.clusterId,k.limit,k.offset))}catch(V){L(V)}},I})(rt),nr=function(w){var I=this;this.self=w,this.actor=new u.Actor(w,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:rt,geojson:ia},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(k,L){if(I.workerSourceTypes[k])throw new Error('Worker source with name "'+k+'" already registered.');I.workerSourceTypes[k]=L},this.self.registerRTLTextPlugin=function(k){if(u.plugin.isParsed())throw new Error("RTL text plugin already registered.");u.plugin.applyArabicShaping=k.applyArabicShaping,u.plugin.processBidirectionalText=k.processBidirectionalText,u.plugin.processStyledBidirectionalText=k.processStyledBidirectionalText}};return nr.prototype.setReferrer=function(w,I){this.referrer=I},nr.prototype.setImages=function(w,I,k){for(var L in this.availableImages[w]=I,this.workerSources[w]){var V=this.workerSources[w][L];for(var W in V)V[W].availableImages=I}k()},nr.prototype.setLayers=function(w,I,k){this.getLayerIndex(w).replace(I),k()},nr.prototype.updateLayers=function(w,I,k){this.getLayerIndex(w).update(I.layers,I.removedIds),k()},nr.prototype.loadTile=function(w,I,k){this.getWorkerSource(w,I.type,I.source).loadTile(I,k)},nr.prototype.loadDEMTile=function(w,I,k){this.getDEMWorkerSource(w,I.source).loadTile(I,k)},nr.prototype.reloadTile=function(w,I,k){this.getWorkerSource(w,I.type,I.source).reloadTile(I,k)},nr.prototype.abortTile=function(w,I,k){this.getWorkerSource(w,I.type,I.source).abortTile(I,k)},nr.prototype.removeTile=function(w,I,k){this.getWorkerSource(w,I.type,I.source).removeTile(I,k)},nr.prototype.removeDEMTile=function(w,I){this.getDEMWorkerSource(w,I.source).removeTile(I)},nr.prototype.removeSource=function(w,I,k){if(this.workerSources[w]&&this.workerSources[w][I.type]&&this.workerSources[w][I.type][I.source]){var L=this.workerSources[w][I.type][I.source];delete this.workerSources[w][I.type][I.source],L.removeSource!==void 0?L.removeSource(I,k):k()}},nr.prototype.loadWorkerSource=function(w,I,k){try{this.self.importScripts(I.url),k()}catch(L){k(L.toString())}},nr.prototype.syncRTLPluginState=function(w,I,k){try{u.plugin.setState(I);var L=u.plugin.getPluginURL();if(u.plugin.isLoaded()&&!u.plugin.isParsed()&&L!=null){this.self.importScripts(L);var V=u.plugin.isParsed();k(V?void 0:new Error("RTL Text Plugin failed to import scripts from "+L),V)}}catch(W){k(W.toString())}},nr.prototype.getAvailableImages=function(w){var I=this.availableImages[w];return I||(I=[]),I},nr.prototype.getLayerIndex=function(w){var I=this.layerIndexes[w];return I||(I=this.layerIndexes[w]=new dt),I},nr.prototype.getWorkerSource=function(w,I,k){var L=this;return this.workerSources[w]||(this.workerSources[w]={}),this.workerSources[w][I]||(this.workerSources[w][I]={}),this.workerSources[w][I][k]||(this.workerSources[w][I][k]=new this.workerSourceTypes[I]({send:function(V,W,H){L.actor.send(V,W,H,w)}},this.getLayerIndex(w),this.getAvailableImages(w))),this.workerSources[w][I][k]},nr.prototype.getDEMWorkerSource=function(w,I){return this.demWorkerSources[w]||(this.demWorkerSources[w]={}),this.demWorkerSources[w][I]||(this.demWorkerSources[w][I]=new gr),this.demWorkerSources[w][I]},nr.prototype.enforceCacheSizeLimit=function(w,I){u.enforceCacheSizeLimit(I)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new nr(self)),nr})),me(["./shared"],(function(u){var ot=u.createCommonjsModule((function(i){function o(p){return!n(p)}function n(p){return typeof window>"u"||typeof document>"u"?"not a browser":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.prototype&&Function.prototype.bind?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?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?(function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var d,y,_=new Blob([""],{type:"text/javascript"}),S=URL.createObjectURL(_);try{y=new Worker(S),d=!0}catch{d=!1}return y&&y.terminate(),URL.revokeObjectURL(S),d})()?"Uint8ClampedArray"in window?ArrayBuffer.isView?(function(){var d=document.createElement("canvas");d.width=d.height=1;var y=d.getContext("2d");if(!y)return!1;var _=y.getImageData(0,0,1,1);return _&&_.width===d.width})()?(s[f=p&&p.failIfMajorPerformanceCaveat]===void 0&&(s[f]=(function(d){var y=(function(S){var P=document.createElement("canvas"),z=Object.create(o.webGLContextAttributes);return z.failIfMajorPerformanceCaveat=S,P.probablySupportsContext?P.probablySupportsContext("webgl",z)||P.probablySupportsContext("experimental-webgl",z):P.supportsContext?P.supportsContext("webgl",z)||P.supportsContext("experimental-webgl",z):P.getContext("webgl",z)||P.getContext("experimental-webgl",z)})(d);if(!y)return!1;var _=y.createShader(y.VERTEX_SHADER);return!(!_||y.isContextLost())&&(y.shaderSource(_,"void main() {}"),y.compileShader(_),y.getShaderParameter(_,y.COMPILE_STATUS)===!0)})(f)),s[f]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var f}i.exports?i.exports=o:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=o,window.mapboxgl.notSupportedReason=n);var s={};o.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),pe={create:function(i,o,n){var s=u.window.document.createElement(i);return o!==void 0&&(s.className=o),n&&n.appendChild(s),s},createNS:function(i,o){return u.window.document.createElementNS(i,o)}},dt=u.window.document&&u.window.document.documentElement.style;function Ze(i){if(!dt)return i[0];for(var o=0;o<i.length;o++)if(i[o]in dt)return i[o];return i[0]}var yr,Ce=Ze(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);pe.disableDrag=function(){dt&&Ce&&(yr=dt[Ce],dt[Ce]="none")},pe.enableDrag=function(){dt&&Ce&&(dt[Ce]=yr)};var Zi=Ze(["transform","WebkitTransform"]);pe.setTransform=function(i,o){i.style[Zi]=o};var rt=!1;try{var rr=Object.defineProperty({},"passive",{get:function(){rt=!0}});u.window.addEventListener("test",rr,rr),u.window.removeEventListener("test",rr,rr)}catch{rt=!1}pe.addEventListener=function(i,o,n,s){s===void 0&&(s={}),i.addEventListener(o,n,"passive"in s&&rt?s:s.capture)},pe.removeEventListener=function(i,o,n,s){s===void 0&&(s={}),i.removeEventListener(o,n,"passive"in s&&rt?s:s.capture)};var gr=function(i){i.preventDefault(),i.stopPropagation(),u.window.removeEventListener("click",gr,!0)};function ao(i){var o=i.userImage;return!!(o&&o.render&&o.render())&&(i.data.replace(new Uint8Array(o.data.buffer)),!0)}pe.suppressClick=function(){u.window.addEventListener("click",gr,!0),u.window.setTimeout((function(){u.window.removeEventListener("click",gr,!0)}),0)},pe.mousePos=function(i,o){var n=i.getBoundingClientRect();return new u.Point(o.clientX-n.left-i.clientLeft,o.clientY-n.top-i.clientTop)},pe.touchPos=function(i,o){for(var n=i.getBoundingClientRect(),s=[],p=0;p<o.length;p++)s.push(new u.Point(o[p].clientX-n.left-i.clientLeft,o[p].clientY-n.top-i.clientTop));return s},pe.mouseButton=function(i){return u.window.InstallTrigger!==void 0&&i.button===2&&i.ctrlKey&&u.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:i.button},pe.remove=function(i){i.parentNode&&i.parentNode.removeChild(i)};var Sr=(function(i){function o(){i.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new u.RGBAImage({width:1,height:1}),this.dirty=!0}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.isLoaded=function(){return this.loaded},o.prototype.setLoaded=function(n){if(this.loaded!==n&&(this.loaded=n,n)){for(var s=0,p=this.requestors;s<p.length;s+=1){var f=p[s];this._notify(f.ids,f.callback)}this.requestors=[]}},o.prototype.getImage=function(n){return this.images[n]},o.prototype.addImage=function(n,s){this._validate(n,s)&&(this.images[n]=s)},o.prototype._validate=function(n,s){var p=!0;return this._validateStretch(s.stretchX,s.data&&s.data.width)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchX" value'))),p=!1),this._validateStretch(s.stretchY,s.data&&s.data.height)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchY" value'))),p=!1),this._validateContent(s.content,s)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "content" value'))),p=!1),p},o.prototype._validateStretch=function(n,s){if(!n)return!0;for(var p=0,f=0,d=n;f<d.length;f+=1){var y=d[f];if(y[0]<p||y[1]<y[0]||s<y[1])return!1;p=y[1]}return!0},o.prototype._validateContent=function(n,s){return!(n&&(n.length!==4||n[0]<0||s.data.width<n[0]||n[1]<0||s.data.height<n[1]||n[2]<0||s.data.width<n[2]||n[3]<0||s.data.height<n[3]||n[2]<n[0]||n[3]<n[1]))},o.prototype.updateImage=function(n,s){s.version=this.images[n].version+1,this.images[n]=s,this.updatedImages[n]=!0},o.prototype.removeImage=function(n){var s=this.images[n];delete this.images[n],delete this.patterns[n],s.userImage&&s.userImage.onRemove&&s.userImage.onRemove()},o.prototype.listImages=function(){return Object.keys(this.images)},o.prototype.getImages=function(n,s){var p=!0;if(!this.isLoaded())for(var f=0,d=n;f<d.length;f+=1)this.images[d[f]]||(p=!1);this.isLoaded()||p?this._notify(n,s):this.requestors.push({ids:n,callback:s})},o.prototype._notify=function(n,s){for(var p={},f=0,d=n;f<d.length;f+=1){var y=d[f];this.images[y]||this.fire(new u.Event("styleimagemissing",{id:y}));var _=this.images[y];_?p[y]={data:_.data.clone(),pixelRatio:_.pixelRatio,sdf:_.sdf,version:_.version,stretchX:_.stretchX,stretchY:_.stretchY,content:_.content,hasRenderCallback:!!(_.userImage&&_.userImage.render)}:u.warnOnce('Image "'+y+'" 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.')}s(null,p)},o.prototype.getPixelSize=function(){var n=this.atlasImage;return{width:n.width,height:n.height}},o.prototype.getPattern=function(n){var s=this.patterns[n],p=this.getImage(n);if(!p)return null;if(s&&s.position.version===p.version)return s.position;if(s)s.position.version=p.version;else{var f={w:p.data.width+2,h:p.data.height+2,x:0,y:0},d=new u.ImagePosition(f,p);this.patterns[n]={bin:f,position:d}}return this._updatePatternAtlas(),this.patterns[n].position},o.prototype.bind=function(n){var s=n.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u.Texture(n,this.atlasImage,s.RGBA),this.atlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE)},o.prototype._updatePatternAtlas=function(){var n=[];for(var s in this.patterns)n.push(this.patterns[s].bin);var p=u.potpack(n),f=p.w,d=p.h,y=this.atlasImage;for(var _ in y.resize({width:f||1,height:d||1}),this.patterns){var S=this.patterns[_].bin,P=S.x+1,z=S.y+1,M=this.images[_].data,U=M.width,O=M.height;u.RGBAImage.copy(M,y,{x:0,y:0},{x:P,y:z},{width:U,height:O}),u.RGBAImage.copy(M,y,{x:0,y:O-1},{x:P,y:z-1},{width:U,height:1}),u.RGBAImage.copy(M,y,{x:0,y:0},{x:P,y:z+O},{width:U,height:1}),u.RGBAImage.copy(M,y,{x:U-1,y:0},{x:P-1,y:z},{width:1,height:O}),u.RGBAImage.copy(M,y,{x:0,y:0},{x:P+U,y:z},{width:1,height:O})}this.dirty=!0},o.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},o.prototype.dispatchRenderCallbacks=function(n){for(var s=0,p=n;s<p.length;s+=1){var f=p[s];if(!this.callbackDispatchedThisFrame[f]){this.callbackDispatchedThisFrame[f]=!0;var d=this.images[f];ao(d)&&this.updateImage(f,d)}}},o})(u.Evented),so=tn,pr=tn,Mi=1e20;function tn(i,o,n,s,p,f){this.fontSize=i||24,this.buffer=o===void 0?3:o,this.cutoff=s||.25,this.fontFamily=p||"sans-serif",this.fontWeight=f||"normal",this.radius=n||8;var d=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=d,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(d*d),this.gridInner=new Float64Array(d*d),this.f=new Float64Array(d),this.d=new Float64Array(d),this.z=new Float64Array(d+1),this.v=new Int16Array(d),this.middle=Math.round(d/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function mn(i,o,n,s,p,f,d){for(var y=0;y<o;y++){for(var _=0;_<n;_++)s[_]=i[_*o+y];for(fi(s,p,f,d,n),_=0;_<n;_++)i[_*o+y]=p[_]}for(_=0;_<n;_++){for(y=0;y<o;y++)s[y]=i[_*o+y];for(fi(s,p,f,d,o),y=0;y<o;y++)i[_*o+y]=Math.sqrt(p[y])}}function fi(i,o,n,s,p){n[0]=0,s[0]=-Mi,s[1]=+Mi;for(var f=1,d=0;f<p;f++){for(var y=(i[f]+f*f-(i[n[d]]+n[d]*n[d]))/(2*f-2*n[d]);y<=s[d];)d--,y=(i[f]+f*f-(i[n[d]]+n[d]*n[d]))/(2*f-2*n[d]);n[++d]=f,s[d]=y,s[d+1]=+Mi}for(f=0,d=0;f<p;f++){for(;s[d+1]<f;)d++;o[f]=(f-n[d])*(f-n[d])+i[n[d]]}}tn.prototype.draw=function(i){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(i,this.buffer,this.middle);for(var o=this.ctx.getImageData(0,0,this.size,this.size),n=new Uint8ClampedArray(this.size*this.size),s=0;s<this.size*this.size;s++){var p=o.data[4*s+3]/255;this.gridOuter[s]=p===1?0:p===0?Mi:Math.pow(Math.max(0,.5-p),2),this.gridInner[s]=p===1?Mi:p===0?0:Math.pow(Math.max(0,p-.5),2)}for(mn(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),mn(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),s=0;s<this.size*this.size;s++)n[s]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[s]-this.gridInner[s])/this.radius+this.cutoff))));return n},so.default=pr;var zr=function(i,o){this.requestManager=i,this.localIdeographFontFamily=o,this.entries={}};zr.prototype.setURL=function(i){this.url=i},zr.prototype.getGlyphs=function(i,o){var n=this,s=[];for(var p in i)for(var f=0,d=i[p];f<d.length;f+=1)s.push({stack:p,id:d[f]});u.asyncAll(s,(function(y,_){var S=y.stack,P=y.id,z=n.entries[S];z||(z=n.entries[S]={glyphs:{},requests:{},ranges:{}});var M=z.glyphs[P];if(M===void 0){if(M=n._tinySDF(z,S,P))return z.glyphs[P]=M,void _(null,{stack:S,id:P,glyph:M});var U=Math.floor(P/256);if(256*U>65535)_(new Error("glyphs > 65535 not supported"));else if(z.ranges[U])_(null,{stack:S,id:P,glyph:M});else{var O=z.requests[U];O||(O=z.requests[U]=[],zr.loadGlyphRange(S,U,n.url,n.requestManager,(function(Z,B){if(B){for(var q in B)n._doesCharSupportLocalGlyph(+q)||(z.glyphs[+q]=B[+q]);z.ranges[U]=!0}for(var X=0,Y=O;X<Y.length;X+=1)(0,Y[X])(Z,B);delete z.requests[U]}))),O.push((function(Z,B){Z?_(Z):B&&_(null,{stack:S,id:P,glyph:B[P]||null})}))}}else _(null,{stack:S,id:P,glyph:M})}),(function(y,_){if(y)o(y);else if(_){for(var S={},P=0,z=_;P<z.length;P+=1){var M=z[P],U=M.stack,O=M.id,Z=M.glyph;(S[U]||(S[U]={}))[O]=Z&&{id:Z.id,bitmap:Z.bitmap.clone(),metrics:Z.metrics}}o(null,S)}}))},zr.prototype._doesCharSupportLocalGlyph=function(i){return!!this.localIdeographFontFamily&&(u.isChar["CJK Unified Ideographs"](i)||u.isChar["Hangul Syllables"](i)||u.isChar.Hiragana(i)||u.isChar.Katakana(i))},zr.prototype._tinySDF=function(i,o,n){var s=this.localIdeographFontFamily;if(s&&this._doesCharSupportLocalGlyph(n)){var p=i.tinySDF;if(!p){var f="400";/bold/i.test(o)?f="900":/medium/i.test(o)?f="500":/light/i.test(o)&&(f="200"),p=i.tinySDF=new zr.TinySDF(24,3,8,.25,s,f)}return{id:n,bitmap:new u.AlphaImage({width:30,height:30},p.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},zr.loadGlyphRange=function(i,o,n,s,p){var f=256*o,d=f+255,y=s.transformRequest(s.normalizeGlyphsURL(n).replace("{fontstack}",i).replace("{range}",f+"-"+d),u.ResourceType.Glyphs);u.getArrayBuffer(y,(function(_,S){if(_)p(_);else if(S){for(var P={},z=0,M=u.parseGlyphPBF(S);z<M.length;z+=1){var U=M[z];P[U.id]=U}p(null,P)}}))},zr.TinySDF=so;var Gi=function(){this.specification=u.styleSpec.light.position};Gi.prototype.possiblyEvaluate=function(i,o){return u.sphericalToCartesian(i.expression.evaluate(o))},Gi.prototype.interpolate=function(i,o,n){return{x:u.number(i.x,o.x,n),y:u.number(i.y,o.y,n),z:u.number(i.z,o.z,n)}};var Si=new u.Properties({anchor:new u.DataConstantProperty(u.styleSpec.light.anchor),position:new Gi,color:new u.DataConstantProperty(u.styleSpec.light.color),intensity:new u.DataConstantProperty(u.styleSpec.light.intensity)}),Pn=(function(i){function o(n){i.call(this),this._transitionable=new u.Transitionable(Si),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getLight=function(){return this._transitionable.serialize()},o.prototype.setLight=function(n,s){if(s===void 0&&(s={}),!this._validate(u.validateLight,n,s))for(var p in n){var f=n[p];u.endsWith(p,"-transition")?this._transitionable.setTransition(p.slice(0,-11),f):this._transitionable.setValue(p,f)}},o.prototype.updateTransitions=function(n){this._transitioning=this._transitionable.transitioned(n,this._transitioning)},o.prototype.hasTransition=function(){return this._transitioning.hasTransition()},o.prototype.recalculate=function(n){this.properties=this._transitioning.possiblyEvaluate(n)},o.prototype._validate=function(n,s,p){return(!p||p.validate!==!1)&&u.emitValidationErrors(this,n.call(u.validateStyle,u.extend({value:s,style:{glyphs:!0,sprite:!0},styleSpec:u.styleSpec})))},o})(u.Evented),Ht=function(i,o){this.width=i,this.height=o,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};Ht.prototype.getDash=function(i,o){var n=i.join(",")+String(o);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(i,o)),this.dashEntry[n]},Ht.prototype.getDashRanges=function(i,o,n){var s=[],p=i.length%2==1?-i[i.length-1]*n:0,f=i[0]*n,d=!0;s.push({left:p,right:f,isDash:d,zeroLength:i[0]===0});for(var y=i[0],_=1;_<i.length;_++){var S=i[_];s.push({left:p=y*n,right:f=(y+=S)*n,isDash:d=!d,zeroLength:S===0})}return s},Ht.prototype.addRoundDash=function(i,o,n){for(var s=o/2,p=-n;p<=n;p++)for(var f=this.width*(this.nextRow+n+p),d=0,y=i[d],_=0;_<this.width;_++){_/y.right>1&&(y=i[++d]);var S=Math.abs(_-y.left),P=Math.abs(_-y.right),z=Math.min(S,P),M=void 0,U=p/n*(s+1);if(y.isDash){var O=s-Math.abs(U);M=Math.sqrt(z*z+O*O)}else M=s-Math.sqrt(z*z+U*U);this.data[f+_]=Math.max(0,Math.min(255,M+128))}},Ht.prototype.addRegularDash=function(i){for(var o=i.length-1;o>=0;--o){var n=i[o],s=i[o+1];n.zeroLength?i.splice(o,1):s&&s.isDash===n.isDash&&(s.left=n.left,i.splice(o,1))}var p=i[0],f=i[i.length-1];p.isDash===f.isDash&&(p.left=f.left-this.width,f.right=p.right+this.width);for(var d=this.width*this.nextRow,y=0,_=i[y],S=0;S<this.width;S++){S/_.right>1&&(_=i[++y]);var P=Math.abs(S-_.left),z=Math.abs(S-_.right),M=Math.min(P,z);this.data[d+S]=Math.max(0,Math.min(255,(_.isDash?M:-M)+128))}},Ht.prototype.addDash=function(i,o){var n=o?7:0,s=2*n+1;if(this.nextRow+s>this.height)return u.warnOnce("LineAtlas out of space"),null;for(var p=0,f=0;f<i.length;f++)p+=i[f];if(p!==0){var d=this.width/p,y=this.getDashRanges(i,this.width,d);o?this.addRoundDash(y,d,n):this.addRegularDash(y)}var _={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:p};return this.nextRow+=s,this.dirty=!0,_},Ht.prototype.bind=function(i){var o=i.gl;this.texture?(o.bindTexture(o.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,o.texSubImage2D(o.TEXTURE_2D,0,0,0,this.width,this.height,o.ALPHA,o.UNSIGNED_BYTE,this.data))):(this.texture=o.createTexture(),o.bindTexture(o.TEXTURE_2D,this.texture),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texImage2D(o.TEXTURE_2D,0,o.ALPHA,this.width,this.height,0,o.ALPHA,o.UNSIGNED_BYTE,this.data))};var Kr=function i(o,n){this.workerPool=o,this.actors=[],this.currentActor=0,this.id=u.uniqueId();for(var s=this.workerPool.acquire(this.id),p=0;p<s.length;p++){var f=new i.Actor(s[p],n,this.id);f.name="Worker "+p,this.actors.push(f)}};function Bo(i,o,n){var s=function(p,f){if(p)return n(p);if(f){var d=u.pick(u.extend(f,i),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);f.vector_layers&&(d.vectorLayers=f.vector_layers,d.vectorLayerIds=d.vectorLayers.map((function(y){return y.id}))),d.tiles=o.canonicalizeTileset(d,i.url),n(null,d)}};return i.url?u.getJSON(o.transformRequest(o.normalizeSourceURL(i.url),u.ResourceType.Source),s):u.browser.frame((function(){return s(null,i)}))}Kr.prototype.broadcast=function(i,o,n){u.asyncAll(this.actors,(function(s,p){s.send(i,o,p)}),n=n||function(){})},Kr.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},Kr.prototype.remove=function(){this.actors.forEach((function(i){i.remove()})),this.actors=[],this.workerPool.release(this.id)},Kr.Actor=u.Actor;var di=function(i,o,n){this.bounds=u.LngLatBounds.convert(this.validateBounds(i)),this.minzoom=o||0,this.maxzoom=n||24};di.prototype.validateBounds=function(i){return Array.isArray(i)&&i.length===4?[Math.max(-180,i[0]),Math.max(-90,i[1]),Math.min(180,i[2]),Math.min(90,i[3])]:[-180,-90,180,90]},di.prototype.contains=function(i){var o=Math.pow(2,i.z),n=Math.floor(u.mercatorXfromLng(this.bounds.getWest())*o),s=Math.floor(u.mercatorYfromLat(this.bounds.getNorth())*o),p=Math.ceil(u.mercatorXfromLng(this.bounds.getEast())*o),f=Math.ceil(u.mercatorYfromLat(this.bounds.getSouth())*o);return i.x>=n&&i.x<p&&i.y>=s&&i.y<f};var An=(function(i){function o(n,s,p,f){if(i.call(this),this.id=n,this.dispatcher=p,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,u.extend(this,u.pick(s,["url","scheme","tileSize","promoteId"])),this._options=u.extend({type:"vector"},s),this._collectResourceTiming=s.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(f)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Bo(this._options,this.map._requestManager,(function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new u.ErrorEvent(s)):p&&(u.extend(n,p),p.bounds&&(n.tileBounds=new di(p.bounds,n.minzoom,n.maxzoom)),u.postTurnstileEvent(p.tiles,n.map._requestManager._customAccessToken),u.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken,n.map._requestManager._customAccessToken),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setSourceProperty=function(n){this._tileJSONRequest&&this._tileJSONRequest.cancel(),n(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},o.prototype.setTiles=function(n){var s=this;return this.setSourceProperty((function(){s._options.tiles=n})),this},o.prototype.setUrl=function(n){var s=this;return this.setSourceProperty((function(){s.url=n,s._options.url=n})),this},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return u.extend({},this._options)},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme)),f={request:this.map._requestManager.transformRequest(p,u.ResourceType.Tile),uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,tileSize:this.tileSize*n.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:u.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function d(y,_){return delete n.request,n.aborted?s(null):y&&y.status!==404?s(y):(_&&_.resourceTiming&&(n.resourceTiming=_.resourceTiming),this.map._refreshExpiredTiles&&_&&n.setExpiryData(_),n.loadVectorData(_,this.map.painter),u.cacheEntryPossiblyAdded(this.dispatcher),s(null),void(n.reloadCallback&&(this.loadTile(n,n.reloadCallback),n.reloadCallback=null)))}f.request.collectResourceTiming=this._collectResourceTiming,n.actor&&n.state!=="expired"?n.state==="loading"?n.reloadCallback=s:n.request=n.actor.send("reloadTile",f,d.bind(this)):(n.actor=this.dispatcher.getActor(),n.request=n.actor.send("loadTile",f,d.bind(this)))},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.actor&&n.actor.send("abortTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.unloadTile=function(n){n.unloadVectorData(),n.actor&&n.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.hasTransition=function(){return!1},o})(u.Evented),zn=(function(i){function o(n,s,p,f){i.call(this),this.id=n,this.dispatcher=p,this.setEventedParent(f),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=u.extend({type:"raster"},s),u.extend(this,u.pick(s,["url","scheme","tileSize"]))}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Bo(this._options,this.map._requestManager,(function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new u.ErrorEvent(s)):p&&(u.extend(n,p),p.bounds&&(n.tileBounds=new di(p.bounds,n.minzoom,n.maxzoom)),u.postTurnstileEvent(p.tiles),u.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return u.extend({},this._options)},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.loadTile=function(n,s){var p=this,f=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);n.request=u.getImage(this.map._requestManager.transformRequest(f,u.ResourceType.Tile),(function(d,y){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(d)n.state="errored",s(d);else if(y){p.map._refreshExpiredTiles&&n.setExpiryData(y),delete y.cacheControl,delete y.expires;var _=p.map.painter.context,S=_.gl;n.texture=p.map.painter.getTileTexture(y.width),n.texture?n.texture.update(y,{useMipmap:!0}):(n.texture=new u.Texture(_,y,S.RGBA,{useMipmap:!0}),n.texture.bind(S.LINEAR,S.CLAMP_TO_EDGE,S.LINEAR_MIPMAP_NEAREST),_.extTextureFilterAnisotropic&&S.texParameterf(S.TEXTURE_2D,_.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,_.extTextureFilterAnisotropicMax)),n.state="loaded",u.cacheEntryPossiblyAdded(p.dispatcher),s(null)}}))},o.prototype.abortTile=function(n,s){n.request&&(n.request.cancel(),delete n.request),s()},o.prototype.unloadTile=function(n,s){n.texture&&this.map.painter.saveTileTexture(n.texture),s()},o.prototype.hasTransition=function(){return!1},o})(u.Evented),Ro=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),this.type="raster-dem",this.maxzoom=22,this._options=u.extend({type:"raster-dem"},s),this.encoding=s.encoding||"mapbox"}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function f(d,y){d&&(n.state="errored",s(d)),y&&(n.dem=y,n.needsHillshadePrepare=!0,n.state="loaded",s(null))}n.request=u.getImage(this.map._requestManager.transformRequest(p,u.ResourceType.Tile),(function(d,y){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(d)n.state="errored",s(d);else if(y){this.map._refreshExpiredTiles&&n.setExpiryData(y),delete y.cacheControl,delete y.expires;var _=u.window.ImageBitmap&&y instanceof u.window.ImageBitmap&&u.offscreenCanvasSupported()?y:u.browser.getImageData(y,1),S={uid:n.uid,coord:n.tileID,source:this.id,rawImageData:_,encoding:this.encoding};n.actor&&n.state!=="expired"||(n.actor=this.dispatcher.getActor(),n.actor.send("loadDEMTile",S,f.bind(this)))}}).bind(this)),n.neighboringTiles=this._getNeighboringTiles(n.tileID)},o.prototype._getNeighboringTiles=function(n){var s=n.canonical,p=Math.pow(2,s.z),f=(s.x-1+p)%p,d=s.x===0?n.wrap-1:n.wrap,y=(s.x+1+p)%p,_=s.x+1===p?n.wrap+1:n.wrap,S={};return S[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y).key]={backfilled:!1},S[new u.OverscaledTileID(n.overscaledZ,_,s.z,y,s.y).key]={backfilled:!1},s.y>0&&(S[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y-1).key]={backfilled:!1},S[new u.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y-1).key]={backfilled:!1},S[new u.OverscaledTileID(n.overscaledZ,_,s.z,y,s.y-1).key]={backfilled:!1}),s.y+1<p&&(S[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y+1).key]={backfilled:!1},S[new u.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y+1).key]={backfilled:!1},S[new u.OverscaledTileID(n.overscaledZ,_,s.z,y,s.y+1).key]={backfilled:!1}),S},o.prototype.unloadTile=function(n){n.demTexture&&this.map.painter.saveTileTexture(n.demTexture),n.fbo&&(n.fbo.destroy(),delete n.fbo),n.dem&&delete n.dem,delete n.neighboringTiles,n.state="unloaded",n.actor&&n.actor.send("removeDEMTile",{uid:n.uid,source:this.id})},o})(zn),Ii=(function(i){function o(n,s,p,f){i.call(this),this.id=n,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=p.getActor(),this.setEventedParent(f),this._data=s.data,this._options=u.extend({},s),this._collectResourceTiming=s.collectResourceTiming,this._resourceTiming=[],s.maxzoom!==void 0&&(this.maxzoom=s.maxzoom),s.type&&(this.type=s.type),s.attribution&&(this.attribution=s.attribution),this.promoteId=s.promoteId;var d=u.EXTENT/this.tileSize;this.workerOptions=u.extend({source:this.id,cluster:s.cluster||!1,geojsonVtOptions:{buffer:(s.buffer!==void 0?s.buffer:128)*d,tolerance:(s.tolerance!==void 0?s.tolerance:.375)*d,extent:u.EXTENT,maxZoom:this.maxzoom,lineMetrics:s.lineMetrics||!1,generateId:s.generateId||!1},superclusterOptions:{maxZoom:s.clusterMaxZoom!==void 0?Math.min(s.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,s.clusterMinPoints||2),extent:u.EXTENT,radius:(s.clusterRadius||50)*d,log:!1,generateId:s.generateId||!1},clusterProperties:s.clusterProperties,filter:s.filter},s.workerOptions)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this.fire(new u.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(s){if(s)n.fire(new u.ErrorEvent(s));else{var p={dataType:"source",sourceDataType:"metadata"};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(p.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new u.Event("data",p))}}))},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setData=function(n){var s=this;return this._data=n,this.fire(new u.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(p){if(p)s.fire(new u.ErrorEvent(p));else{var f={dataType:"source",sourceDataType:"content"};s._collectResourceTiming&&s._resourceTiming&&s._resourceTiming.length>0&&(f.resourceTiming=s._resourceTiming,s._resourceTiming=[]),s.fire(new u.Event("data",f))}})),this},o.prototype.getClusterExpansionZoom=function(n,s){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:n,source:this.id},s),this},o.prototype.getClusterChildren=function(n,s){return this.actor.send("geojson.getClusterChildren",{clusterId:n,source:this.id},s),this},o.prototype.getClusterLeaves=function(n,s,p,f){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:n,limit:s,offset:p},f),this},o.prototype._updateWorkerData=function(n){var s=this;this._loaded=!1;var p=u.extend({},this.workerOptions),f=this._data;typeof f=="string"?(p.request=this.map._requestManager.transformRequest(u.browser.resolveURL(f),u.ResourceType.Source),p.request.collectResourceTiming=this._collectResourceTiming):p.data=JSON.stringify(f),this.actor.send(this.type+".loadData",p,(function(d,y){s._removed||y&&y.abandoned||(s._loaded=!0,y&&y.resourceTiming&&y.resourceTiming[s.id]&&(s._resourceTiming=y.resourceTiming[s.id].slice(0)),s.actor.send(s.type+".coalesce",{source:p.source},null),n(d))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.loadTile=function(n,s){var p=this,f=n.actor?"reloadTile":"loadTile";n.actor=this.actor,n.request=this.actor.send(f,{type:this.type,uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:u.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(d,y){return delete n.request,n.unloadVectorData(),n.aborted?s(null):d?s(d):(n.loadVectorData(y,p.map.painter,f==="reloadTile"),s(null))}))},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.aborted=!0},o.prototype.unloadTile=function(n){n.unloadVectorData(),this.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id})},o.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},o.prototype.serialize=function(){return u.extend({},this._options,{type:this.type,data:this._data})},o.prototype.hasTransition=function(){return!1},o})(u.Evented),oi=u.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Di=(function(i){function o(n,s,p,f){i.call(this),this.id=n,this.dispatcher=p,this.coordinates=s.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(f),this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(n,s){var p=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this.url=this.options.url,u.getImage(this.map._requestManager.transformRequest(this.url,u.ResourceType.Image),(function(f,d){p._loaded=!0,f?p.fire(new u.ErrorEvent(f)):d&&(p.image=d,n&&(p.coordinates=n),s&&s(),p._finishLoading())}))},o.prototype.loaded=function(){return this._loaded},o.prototype.updateImage=function(n){var s=this;return this.image&&n.url?(this.options.url=n.url,this.load(n.coordinates,(function(){s.texture=null})),this):this},o.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})))},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setCoordinates=function(n){var s=this;this.coordinates=n;var p=n.map(u.MercatorCoordinate.fromLngLat);this.tileID=(function(d){for(var y=1/0,_=1/0,S=-1/0,P=-1/0,z=0,M=d;z<M.length;z+=1){var U=M[z];y=Math.min(y,U.x),_=Math.min(_,U.y),S=Math.max(S,U.x),P=Math.max(P,U.y)}var O=Math.max(S-y,P-_),Z=Math.max(0,Math.floor(-Math.log(O)/Math.LN2)),B=Math.pow(2,Z);return new u.CanonicalTileID(Z,Math.floor((y+S)/2*B),Math.floor((_+P)/2*B))})(p),this.minzoom=this.maxzoom=this.tileID.z;var f=p.map((function(d){return s.tileID.getTilePoint(d)._round()}));return this._boundsArray=new u.StructArrayLayout4i8,this._boundsArray.emplaceBack(f[0].x,f[0].y,0,0),this._boundsArray.emplaceBack(f[1].x,f[1].y,u.EXTENT,0),this._boundsArray.emplaceBack(f[3].x,f[3].y,0,u.EXTENT),this._boundsArray.emplaceBack(f[2].x,f[2].y,u.EXTENT,u.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})),this},o.prototype.prepare=function(){if(Object.keys(this.tiles).length!==0&&this.image){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,oi.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new u.Texture(n,this.image,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var f=this.tiles[p];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture)}}},o.prototype.loadTile=function(n,s){this.tileID&&this.tileID.equals(n.tileID.canonical)?(this.tiles[String(n.tileID.wrap)]=n,n.buckets={},s(null)):(n.state="errored",s(null))},o.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return!1},o})(u.Evented),rn=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),this.roundZoom=!0,this.type="video",this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1;var s=this.options;this.urls=[];for(var p=0,f=s.urls;p<f.length;p+=1)this.urls.push(this.map._requestManager.transformRequest(f[p],u.ResourceType.Source).url);u.getVideo(this.urls,(function(d,y){n._loaded=!0,d?n.fire(new u.ErrorEvent(d)):y&&(n.video=y,n.video.loop=!0,n.video.setAttribute("playsinline",""),n.video.addEventListener("playing",(function(){n.map.triggerRepaint()})),n.map&&n.video.play(),n._finishLoading())}))},o.prototype.pause=function(){this.video&&this.video.pause()},o.prototype.play=function(){this.video&&this.video.play()},o.prototype.seek=function(n){if(this.video){var s=this.video.seekable;n<s.start(0)||n>s.end(0)?this.fire(new u.ErrorEvent(new u.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+s.start(0)+" and "+s.end(0)+"-second mark."))):this.video.currentTime=n}},o.prototype.getVideo=function(){return this.video},o.prototype.onAdd=function(n){this.map||(this.map=n,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},o.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,oi.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),s.texSubImage2D(s.TEXTURE_2D,0,0,0,s.RGBA,s.UNSIGNED_BYTE,this.video)):(this.texture=new u.Texture(n,this.video,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var f=this.tiles[p];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this.video&&!this.video.paused},o})(Di),nn=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),s.coordinates?Array.isArray(s.coordinates)&&s.coordinates.length===4&&!s.coordinates.some((function(d){return!Array.isArray(d)||d.length!==2||d.some((function(y){return typeof y!="number"}))}))||this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'missing required property "coordinates"'))),s.animate&&typeof s.animate!="boolean"&&this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'optional "animate" property must be a boolean value'))),s.canvas?typeof s.canvas=="string"||s.canvas instanceof u.window.HTMLCanvasElement||this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,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 u.ErrorEvent(new u.ValidationError("sources."+n,null,'missing required property "canvas"'))),this.options=s,this.animate=s.animate===void 0||s.animate}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof u.window.HTMLCanvasElement?this.options.canvas:u.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new u.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},o.prototype.getCanvas=function(){return this.canvas},o.prototype.onAdd=function(n){this.map=n,this.load(),this.canvas&&this.animate&&this.play()},o.prototype.onRemove=function(){this.pause()},o.prototype.prepare=function(){var n=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,n=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,n=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var s=this.map.painter.context,p=s.gl;for(var f in this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,oi.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(n||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new u.Texture(s,this.canvas,p.RGBA,{premultiply:!0}),this.tiles){var d=this.tiles[f];d.state!=="loaded"&&(d.state="loaded",d.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this._playing},o.prototype._hasInvalidDimensions=function(){for(var n=0,s=[this.canvas.width,this.canvas.height];n<s.length;n+=1){var p=s[n];if(isNaN(p)||p<=0)return!0}return!1},o})(Di),Wi={vector:An,raster:zn,"raster-dem":Ro,geojson:Ii,video:rn,image:Di,canvas:nn};function Ur(i,o){var n=u.identity([]);return u.translate(n,n,[1,1,0]),u.scale(n,n,[.5*i.width,.5*i.height,1]),u.multiply(n,n,i.calculatePosMatrix(o.toUnwrapped()))}function Kt(i,o,n,s,p,f){var d=(function(Z,B,q){if(Z)for(var X=0,Y=Z;X<Y.length;X+=1){var ne=B[Y[X]];if(ne&&ne.source===q&&ne.type==="fill-extrusion")return!0}else for(var re in B){var oe=B[re];if(oe.source===q&&oe.type==="fill-extrusion")return!0}return!1})(p&&p.layers,o,i.id),y=f.maxPitchScaleFactor(),_=i.tilesIn(s,y,d);_.sort(Ir);for(var S=[],P=0,z=_;P<z.length;P+=1){var M=z[P];S.push({wrappedTileID:M.tileID.wrapped().key,queryResults:M.tile.queryRenderedFeatures(o,n,i._state,M.queryGeometry,M.cameraQueryGeometry,M.scale,p,f,y,Ur(i.transform,M.tileID))})}var U=(function(Z){for(var B={},q={},X=0,Y=Z;X<Y.length;X+=1){var ne=Y[X],re=ne.queryResults,oe=ne.wrappedTileID,he=q[oe]=q[oe]||{};for(var xe in re)for(var ve=re[xe],Ae=he[xe]=he[xe]||{},Ne=B[xe]=B[xe]||[],He=0,Xe=ve;He<Xe.length;He+=1){var bt=Xe[He];Ae[bt.featureIndex]||(Ae[bt.featureIndex]=!0,Ne.push(bt))}}return B})(S);for(var O in U)U[O].forEach((function(Z){var B=Z.feature,q=i.getFeatureState(B.layer["source-layer"],B.id);B.source=B.layer.source,B.layer["source-layer"]&&(B.sourceLayer=B.layer["source-layer"]),B.state=q}));return U}function Ir(i,o){var n=i.tileID,s=o.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}var mt=function(i,o){this.max=i,this.onRemove=o,this.reset()};mt.prototype.reset=function(){for(var i in this.data)for(var o=0,n=this.data[i];o<n.length;o+=1){var s=n[o];s.timeout&&clearTimeout(s.timeout),this.onRemove(s.value)}return this.data={},this.order=[],this},mt.prototype.add=function(i,o,n){var s=this,p=i.wrapped().key;this.data[p]===void 0&&(this.data[p]=[]);var f={value:o,timeout:void 0};if(n!==void 0&&(f.timeout=setTimeout((function(){s.remove(i,f)}),n)),this.data[p].push(f),this.order.push(p),this.order.length>this.max){var d=this._getAndRemoveByKey(this.order[0]);d&&this.onRemove(d)}return this},mt.prototype.has=function(i){return i.wrapped().key in this.data},mt.prototype.getAndRemove=function(i){return this.has(i)?this._getAndRemoveByKey(i.wrapped().key):null},mt.prototype._getAndRemoveByKey=function(i){var o=this.data[i].shift();return o.timeout&&clearTimeout(o.timeout),this.data[i].length===0&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),o.value},mt.prototype.getByKey=function(i){var o=this.data[i];return o?o[0].value:null},mt.prototype.get=function(i){return this.has(i)?this.data[i.wrapped().key][0].value:null},mt.prototype.remove=function(i,o){if(!this.has(i))return this;var n=i.wrapped().key,s=o===void 0?0:this.data[n].indexOf(o),p=this.data[n][s];return this.data[n].splice(s,1),p.timeout&&clearTimeout(p.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(p.value),this.order.splice(this.order.indexOf(n),1),this},mt.prototype.setMaxSize=function(i){for(this.max=i;this.order.length>this.max;){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},mt.prototype.filter=function(i){var o=[];for(var n in this.data)for(var s=0,p=this.data[n];s<p.length;s+=1){var f=p[s];i(f.value)||o.push(f)}for(var d=0,y=o;d<y.length;d+=1){var _=y[d];this.remove(_.value.tileID,_)}};var Ei=function(i,o,n){this.context=i;var s=i.gl;this.buffer=s.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),i.bindElementBuffer.set(this.buffer),s.bufferData(s.ELEMENT_ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?s.DYNAMIC_DRAW:s.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};Ei.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Ei.prototype.updateData=function(i){var o=this.context.gl;this.context.unbindVAO(),this.bind(),o.bufferSubData(o.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)},Ei.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var ue={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},_e=function(i,o,n,s){this.length=o.length,this.attributes=n,this.itemSize=o.bytesPerElement,this.dynamicDraw=s,this.context=i;var p=i.gl;this.buffer=p.createBuffer(),i.bindVertexBuffer.set(this.buffer),p.bufferData(p.ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};_e.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},_e.prototype.updateData=function(i){var o=this.context.gl;this.bind(),o.bufferSubData(o.ARRAY_BUFFER,0,i.arrayBuffer)},_e.prototype.enableAttributes=function(i,o){for(var n=0;n<this.attributes.length;n++){var s=o.attributes[this.attributes[n].name];s!==void 0&&i.enableVertexAttribArray(s)}},_e.prototype.setVertexAttribPointers=function(i,o,n){for(var s=0;s<this.attributes.length;s++){var p=this.attributes[s],f=o.attributes[p.name];f!==void 0&&i.vertexAttribPointer(f,p.components,i[ue[p.type]],!1,this.itemSize,p.offset+this.itemSize*(n||0))}},_e.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var le=function(i){this.gl=i.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};le.prototype.get=function(){return this.current},le.prototype.set=function(i){},le.prototype.getDefault=function(){return this.default},le.prototype.setDefault=function(){this.set(this.default)};var We=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return u.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.clearColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o})(le),et=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 1},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearDepth(n),this.current=n,this.dirty=!1)},o})(le),ut=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearStencil(n),this.current=n,this.dirty=!1)},o})(le),Ft=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[!0,!0,!0,!0]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.colorMask(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o})(le),Nt=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthMask(n),this.current=n,this.dirty=!1)},o})(le),Er=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 255},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.stencilMask(n),this.current=n,this.dirty=!1)},o})(le),Jt=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},o.prototype.set=function(n){var s=this.current;(n.func!==s.func||n.ref!==s.ref||n.mask!==s.mask||this.dirty)&&(this.gl.stencilFunc(n.func,n.ref,n.mask),this.current=n,this.dirty=!1)},o})(le),ir=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.KEEP,n.KEEP,n.KEEP]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||this.dirty)&&(this.gl.stencilOp(n[0],n[1],n[2]),this.current=n,this.dirty=!1)},o})(le),hr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.STENCIL_TEST):s.disable(s.STENCIL_TEST),this.current=n,this.dirty=!1}},o})(le),vr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[0,1]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.depthRange(n[0],n[1]),this.current=n,this.dirty=!1)},o})(le),Ve=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.DEPTH_TEST):s.disable(s.DEPTH_TEST),this.current=n,this.dirty=!1}},o})(le),Ti=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.LESS},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthFunc(n),this.current=n,this.dirty=!1)},o})(le),Gr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.BLEND):s.disable(s.BLEND),this.current=n,this.dirty=!1}},o})(le),on=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.ONE,n.ZERO]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.blendFunc(n[0],n[1]),this.current=n,this.dirty=!1)},o})(le),Mn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return u.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.blendColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o})(le),Dn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.FUNC_ADD},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.blendEquation(n),this.current=n,this.dirty=!1)},o})(le),Ln=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.CULL_FACE):s.disable(s.CULL_FACE),this.current=n,this.dirty=!1}},o})(le),an=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.BACK},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.cullFace(n),this.current=n,this.dirty=!1)},o})(le),lo=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.CCW},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.frontFace(n),this.current=n,this.dirty=!1)},o})(le),yn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.useProgram(n),this.current=n,this.dirty=!1)},o})(le),Bn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.TEXTURE0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.activeTexture(n),this.current=n,this.dirty=!1)},o})(le),ai=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[0,0,n.drawingBufferWidth,n.drawingBufferHeight]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.viewport(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o})(le),gn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindFramebuffer(s.FRAMEBUFFER,n),this.current=n,this.dirty=!1}},o})(le),sn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindRenderbuffer(s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o})(le),Tr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindTexture(s.TEXTURE_2D,n),this.current=n,this.dirty=!1}},o})(le),Mr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindBuffer(s.ARRAY_BUFFER,n),this.current=n,this.dirty=!1}},o})(le),vn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){var s=this.gl;s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,n),this.current=n,this.dirty=!1},o})(le),_n=(function(i){function o(n){i.call(this,n),this.vao=n.extVertexArrayObject}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){this.vao&&(n!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(n),this.current=n,this.dirty=!1)},o})(le),xn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 4},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,n),this.current=n,this.dirty=!1}},o})(le),Fo=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),this.current=n,this.dirty=!1}},o})(le),ia=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,n),this.current=n,this.dirty=!1}},o})(le),nr=(function(i){function o(n,s){i.call(this,n),this.context=n,this.parent=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o})(le),w=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.setDirty=function(){this.dirty=!0},o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,n,0),this.current=n,this.dirty=!1}},o})(nr),I=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o})(nr),k=function(i,o,n,s){this.context=i,this.width=o,this.height=n;var p=this.framebuffer=i.gl.createFramebuffer();this.colorAttachment=new w(i,p),s&&(this.depthAttachment=new I(i,p))};k.prototype.destroy=function(){var i=this.context.gl,o=this.colorAttachment.get();if(o&&i.deleteTexture(o),this.depthAttachment){var n=this.depthAttachment.get();n&&i.deleteRenderbuffer(n)}i.deleteFramebuffer(this.framebuffer)};var L=function(i,o,n){this.func=i,this.mask=o,this.range=n};L.ReadOnly=!1,L.ReadWrite=!0,L.disabled=new L(519,L.ReadOnly,[0,1]);var V=function(i,o,n,s,p,f){this.test=i,this.ref=o,this.mask=n,this.fail=s,this.depthFail=p,this.pass=f};V.disabled=new V({func:519,mask:0},0,0,7680,7680,7680);var W=function(i,o,n){this.blendFunction=i,this.blendColor=o,this.mask=n};W.disabled=new W(W.Replace=[1,0],u.Color.transparent,[!1,!1,!1,!1]),W.unblended=new W(W.Replace,u.Color.transparent,[!0,!0,!0,!0]),W.alphaBlended=new W([1,771],u.Color.transparent,[!0,!0,!0,!0]);var H=function(i,o,n){this.enable=i,this.mode=o,this.frontFace=n};H.disabled=new H(!1,1029,2305),H.backCCW=new H(!0,1029,2305);var A=function(i){this.gl=i,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new We(this),this.clearDepth=new et(this),this.clearStencil=new ut(this),this.colorMask=new Ft(this),this.depthMask=new Nt(this),this.stencilMask=new Er(this),this.stencilFunc=new Jt(this),this.stencilOp=new ir(this),this.stencilTest=new hr(this),this.depthRange=new vr(this),this.depthTest=new Ve(this),this.depthFunc=new Ti(this),this.blend=new Gr(this),this.blendFunc=new on(this),this.blendColor=new Mn(this),this.blendEquation=new Dn(this),this.cullFace=new Ln(this),this.cullFaceSide=new an(this),this.frontFace=new lo(this),this.program=new yn(this),this.activeTexture=new Bn(this),this.viewport=new ai(this),this.bindFramebuffer=new gn(this),this.bindRenderbuffer=new sn(this),this.bindTexture=new Tr(this),this.bindVertexBuffer=new Mr(this),this.bindElementBuffer=new vn(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new _n(this),this.pixelStoreUnpack=new xn(this),this.pixelStoreUnpackPremultiplyAlpha=new Fo(this),this.pixelStoreUnpackFlipY=new ia(this),this.extTextureFilterAnisotropic=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=i.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=i.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(i.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=i.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=i.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE)};A.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()},A.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},A.prototype.createIndexBuffer=function(i,o){return new Ei(this,i,o)},A.prototype.createVertexBuffer=function(i,o,n){return new _e(this,i,o,n)},A.prototype.createRenderbuffer=function(i,o,n){var s=this.gl,p=s.createRenderbuffer();return this.bindRenderbuffer.set(p),s.renderbufferStorage(s.RENDERBUFFER,i,o,n),this.bindRenderbuffer.set(null),p},A.prototype.createFramebuffer=function(i,o,n){return new k(this,i,o,n)},A.prototype.clear=function(i){var o=i.color,n=i.depth,s=this.gl,p=0;o&&(p|=s.COLOR_BUFFER_BIT,this.clearColor.set(o),this.colorMask.set([!0,!0,!0,!0])),n!==void 0&&(p|=s.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),s.clear(p)},A.prototype.setCullFace=function(i){i.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(i.mode),this.frontFace.set(i.frontFace))},A.prototype.setDepthMode=function(i){i.func!==this.gl.ALWAYS||i.mask?(this.depthTest.set(!0),this.depthFunc.set(i.func),this.depthMask.set(i.mask),this.depthRange.set(i.range)):this.depthTest.set(!1)},A.prototype.setStencilMode=function(i){i.test.func!==this.gl.ALWAYS||i.mask?(this.stencilTest.set(!0),this.stencilMask.set(i.mask),this.stencilOp.set([i.fail,i.depthFail,i.pass]),this.stencilFunc.set({func:i.test.func,ref:i.ref,mask:i.test.mask})):this.stencilTest.set(!1)},A.prototype.setColorMode=function(i){u.deepEqual(i.blendFunction,W.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(i.blendFunction),this.blendColor.set(i.blendColor)),this.colorMask.set(i.mask)},A.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var N=(function(i){function o(n,s,p){var f=this;i.call(this),this.id=n,this.dispatcher=p,this.on("data",(function(d){d.dataType==="source"&&d.sourceDataType==="metadata"&&(f._sourceLoaded=!0),f._sourceLoaded&&!f._paused&&d.dataType==="source"&&d.sourceDataType==="content"&&(f.reload(),f.transform&&f.update(f.transform))})),this.on("error",(function(){f._sourceErrored=!0})),this._source=(function(d,y,_,S){var P=new Wi[y.type](d,y,_,S);if(P.id!==d)throw new Error("Expected Source id to be "+d+" instead of "+P.id);return u.bindAll(["load","abort","unload","serialize","prepare"],P),P})(n,s,p,this),this._tiles={},this._cache=new mt(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new u.SourceFeatureState}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.onAdd=function(n){this.map=n,this._maxTileCacheSize=n?n._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(n)},o.prototype.onRemove=function(n){this._source&&this._source.onRemove&&this._source.onRemove(n)},o.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var n in this._tiles){var s=this._tiles[n];if(s.state!=="loaded"&&s.state!=="errored")return!1}return!0},o.prototype.getSource=function(){return this._source},o.prototype.pause=function(){this._paused=!0},o.prototype.resume=function(){if(this._paused){var n=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,n&&this.reload(),this.transform&&this.update(this.transform)}},o.prototype._loadTile=function(n,s){return this._source.loadTile(n,s)},o.prototype._unloadTile=function(n){if(this._source.unloadTile)return this._source.unloadTile(n,(function(){}))},o.prototype._abortTile=function(n){if(this._source.abortTile)return this._source.abortTile(n,(function(){}))},o.prototype.serialize=function(){return this._source.serialize()},o.prototype.prepare=function(n){for(var s in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var p=this._tiles[s];p.upload(n),p.prepare(this.map.style.imageManager)}},o.prototype.getIds=function(){return u.values(this._tiles).map((function(n){return n.tileID})).sort($).map((function(n){return n.key}))},o.prototype.getRenderableIds=function(n){var s=this,p=[];for(var f in this._tiles)this._isIdRenderable(f,n)&&p.push(this._tiles[f]);return n?p.sort((function(d,y){var _=d.tileID,S=y.tileID,P=new u.Point(_.canonical.x,_.canonical.y)._rotate(s.transform.angle),z=new u.Point(S.canonical.x,S.canonical.y)._rotate(s.transform.angle);return _.overscaledZ-S.overscaledZ||z.y-P.y||z.x-P.x})).map((function(d){return d.tileID.key})):p.map((function(d){return d.tileID})).sort($).map((function(d){return d.key}))},o.prototype.hasRenderableParent=function(n){var s=this.findLoadedParent(n,0);return!!s&&this._isIdRenderable(s.tileID.key)},o.prototype._isIdRenderable=function(n,s){return this._tiles[n]&&this._tiles[n].hasData()&&!this._coveredTiles[n]&&(s||!this._tiles[n].holdingForFade())},o.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var n in this._cache.reset(),this._tiles)this._tiles[n].state!=="errored"&&this._reloadTile(n,"reloading")},o.prototype._reloadTile=function(n,s){var p=this._tiles[n];p&&(p.state!=="loading"&&(p.state=s),this._loadTile(p,this._tileLoaded.bind(this,p,n,s)))},o.prototype._tileLoaded=function(n,s,p,f){if(f)return n.state="errored",void(f.status!==404?this._source.fire(new u.ErrorEvent(f,{tile:n})):this.update(this.transform));n.timeAdded=u.browser.now(),p==="expired"&&(n.refreshedUponExpiration=!0),this._setTileReloadTimer(s,n),this.getSource().type==="raster-dem"&&n.dem&&this._backfillDEM(n),this._state.initializeTileState(n,this.map?this.map.painter:null),this._source.fire(new u.Event("data",{dataType:"source",tile:n,coord:n.tileID}))},o.prototype._backfillDEM=function(n){for(var s=this.getRenderableIds(),p=0;p<s.length;p++){var f=s[p];if(n.neighboringTiles&&n.neighboringTiles[f]){var d=this.getTileByID(f);y(n,d),y(d,n)}}function y(_,S){_.needsHillshadePrepare=!0;var P=S.tileID.canonical.x-_.tileID.canonical.x,z=S.tileID.canonical.y-_.tileID.canonical.y,M=Math.pow(2,_.tileID.canonical.z),U=S.tileID.key;P===0&&z===0||Math.abs(z)>1||(Math.abs(P)>1&&(Math.abs(P+M)===1?P+=M:Math.abs(P-M)===1&&(P-=M)),S.dem&&_.dem&&(_.dem.backfillBorder(S.dem,P,z),_.neighboringTiles&&_.neighboringTiles[U]&&(_.neighboringTiles[U].backfilled=!0)))}},o.prototype.getTile=function(n){return this.getTileByID(n.key)},o.prototype.getTileByID=function(n){return this._tiles[n]},o.prototype._retainLoadedChildren=function(n,s,p,f){for(var d in this._tiles){var y=this._tiles[d];if(!(f[d]||!y.hasData()||y.tileID.overscaledZ<=s||y.tileID.overscaledZ>p)){for(var _=y.tileID;y&&y.tileID.overscaledZ>s+1;){var S=y.tileID.scaledTo(y.tileID.overscaledZ-1);(y=this._tiles[S.key])&&y.hasData()&&(_=S)}for(var P=_;P.overscaledZ>s;)if(n[(P=P.scaledTo(P.overscaledZ-1)).key]){f[_.key]=_;break}}}},o.prototype.findLoadedParent=function(n,s){if(n.key in this._loadedParentTiles){var p=this._loadedParentTiles[n.key];return p&&p.tileID.overscaledZ>=s?p:null}for(var f=n.overscaledZ-1;f>=s;f--){var d=n.scaledTo(f),y=this._getLoadedTile(d);if(y)return y}},o.prototype._getLoadedTile=function(n){var s=this._tiles[n.key];return s&&s.hasData()?s:this._cache.getByKey(n.wrapped().key)},o.prototype.updateCacheSize=function(n){var s=Math.ceil(n.width/this._source.tileSize)+1,p=Math.ceil(n.height/this._source.tileSize)+1,f=Math.floor(s*p*5),d=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,f):f;this._cache.setMaxSize(d)},o.prototype.handleWrapJump=function(n){var s=Math.round((n-(this._prevLng===void 0?n:this._prevLng))/360);if(this._prevLng=n,s){var p={};for(var f in this._tiles){var d=this._tiles[f];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+s),p[d.tileID.key]=d}for(var y in this._tiles=p,this._timers)clearTimeout(this._timers[y]),delete this._timers[y];for(var _ in this._tiles)this._setTileReloadTimer(_,this._tiles[_])}},o.prototype.update=function(n){var s=this;if(this.transform=n,this._sourceLoaded&&!this._paused){var p;this.updateCacheSize(n),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?p=n.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(he){return new u.OverscaledTileID(he.canonical.z,he.wrap,he.canonical.z,he.canonical.x,he.canonical.y)})):(p=n.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(p=p.filter((function(he){return s._source.hasTile(he)})))):p=[];var f=n.coveringZoomLevel(this._source),d=Math.max(f-o.maxOverzooming,this._source.minzoom),y=Math.max(f+o.maxUnderzooming,this._source.minzoom),_=this._updateRetainedTiles(p,f);if(fe(this._source.type)){for(var S={},P={},z=0,M=Object.keys(_);z<M.length;z+=1){var U=M[z],O=_[U],Z=this._tiles[U];if(Z&&!(Z.fadeEndTime&&Z.fadeEndTime<=u.browser.now())){var B=this.findLoadedParent(O,d);B&&(this._addTile(B.tileID),S[B.tileID.key]=B.tileID),P[U]=O}}for(var q in this._retainLoadedChildren(P,f,y,_),S)_[q]||(this._coveredTiles[q]=!0,_[q]=S[q])}for(var X in _)this._tiles[X].clearFadeHold();for(var Y=0,ne=u.keysDifference(this._tiles,_);Y<ne.length;Y+=1){var re=ne[Y],oe=this._tiles[re];oe.hasSymbolBuckets&&!oe.holdingForFade()?oe.setHoldDuration(this.map._fadeDuration):oe.hasSymbolBuckets&&!oe.symbolFadeFinished()||this._removeTile(re)}this._updateLoadedParentTileCache()}},o.prototype.releaseSymbolFadeTiles=function(){for(var n in this._tiles)this._tiles[n].holdingForFade()&&this._removeTile(n)},o.prototype._updateRetainedTiles=function(n,s){for(var p={},f={},d=Math.max(s-o.maxOverzooming,this._source.minzoom),y=Math.max(s+o.maxUnderzooming,this._source.minzoom),_={},S=0,P=n;S<P.length;S+=1){var z=P[S],M=this._addTile(z);p[z.key]=z,M.hasData()||s<this._source.maxzoom&&(_[z.key]=z)}this._retainLoadedChildren(_,s,y,p);for(var U=0,O=n;U<O.length;U+=1){var Z=O[U],B=this._tiles[Z.key];if(!B.hasData()){if(s+1>this._source.maxzoom){var q=Z.children(this._source.maxzoom)[0],X=this.getTile(q);if(X&&X.hasData()){p[q.key]=q;continue}}else{var Y=Z.children(this._source.maxzoom);if(p[Y[0].key]&&p[Y[1].key]&&p[Y[2].key]&&p[Y[3].key])continue}for(var ne=B.wasRequested(),re=Z.overscaledZ-1;re>=d;--re){var oe=Z.scaledTo(re);if(f[oe.key]||(f[oe.key]=!0,!(B=this.getTile(oe))&&ne&&(B=this._addTile(oe)),B&&(p[oe.key]=oe,ne=B.wasRequested(),B.hasData())))break}}}return p},o.prototype._updateLoadedParentTileCache=function(){for(var n in this._loadedParentTiles={},this._tiles){for(var s=[],p=void 0,f=this._tiles[n].tileID;f.overscaledZ>0;){if(f.key in this._loadedParentTiles){p=this._loadedParentTiles[f.key];break}s.push(f.key);var d=f.scaledTo(f.overscaledZ-1);if(p=this._getLoadedTile(d))break;f=d}for(var y=0,_=s;y<_.length;y+=1)this._loadedParentTiles[_[y]]=p}},o.prototype._addTile=function(n){var s=this._tiles[n.key];if(s)return s;(s=this._cache.getAndRemove(n))&&(this._setTileReloadTimer(n.key,s),s.tileID=n,this._state.initializeTileState(s,this.map?this.map.painter:null),this._cacheTimers[n.key]&&(clearTimeout(this._cacheTimers[n.key]),delete this._cacheTimers[n.key],this._setTileReloadTimer(n.key,s)));var p=!!s;return p||(s=new u.Tile(n,this._source.tileSize*n.overscaleFactor()),this._loadTile(s,this._tileLoaded.bind(this,s,n.key,s.state))),s?(s.uses++,this._tiles[n.key]=s,p||this._source.fire(new u.Event("dataloading",{tile:s,coord:s.tileID,dataType:"source"})),s):null},o.prototype._setTileReloadTimer=function(n,s){var p=this;n in this._timers&&(clearTimeout(this._timers[n]),delete this._timers[n]);var f=s.getExpiryTimeout();f&&(this._timers[n]=setTimeout((function(){p._reloadTile(n,"expired"),delete p._timers[n]}),f))},o.prototype._removeTile=function(n){var s=this._tiles[n];s&&(s.uses--,delete this._tiles[n],this._timers[n]&&(clearTimeout(this._timers[n]),delete this._timers[n]),s.uses>0||(s.hasData()&&s.state!=="reloading"?this._cache.add(s.tileID,s,s.getExpiryTimeout()):(s.aborted=!0,this._abortTile(s),this._unloadTile(s))))},o.prototype.clearTiles=function(){for(var n in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(n);this._cache.reset()},o.prototype.tilesIn=function(n,s,p){var f=this,d=[],y=this.transform;if(!y)return d;for(var _=p?y.getCameraQueryGeometry(n):n,S=n.map((function(re){return y.pointCoordinate(re)})),P=_.map((function(re){return y.pointCoordinate(re)})),z=this.getIds(),M=1/0,U=1/0,O=-1/0,Z=-1/0,B=0,q=P;B<q.length;B+=1){var X=q[B];M=Math.min(M,X.x),U=Math.min(U,X.y),O=Math.max(O,X.x),Z=Math.max(Z,X.y)}for(var Y=function(re){var oe=f._tiles[z[re]];if(!oe.holdingForFade()){var he=oe.tileID,xe=Math.pow(2,y.zoom-oe.tileID.overscaledZ),ve=s*oe.queryPadding*u.EXTENT/oe.tileSize/xe,Ae=[he.getTilePoint(new u.MercatorCoordinate(M,U)),he.getTilePoint(new u.MercatorCoordinate(O,Z))];if(Ae[0].x-ve<u.EXTENT&&Ae[0].y-ve<u.EXTENT&&Ae[1].x+ve>=0&&Ae[1].y+ve>=0){var Ne=S.map((function(Xe){return he.getTilePoint(Xe)})),He=P.map((function(Xe){return he.getTilePoint(Xe)}));d.push({tile:oe,tileID:he,queryGeometry:Ne,cameraQueryGeometry:He,scale:xe})}}},ne=0;ne<z.length;ne++)Y(ne);return d},o.prototype.getVisibleCoordinates=function(n){for(var s=this,p=this.getRenderableIds(n).map((function(_){return s._tiles[_].tileID})),f=0,d=p;f<d.length;f+=1){var y=d[f];y.posMatrix=this.transform.calculatePosMatrix(y.toUnwrapped())}return p},o.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(fe(this._source.type))for(var n in this._tiles){var s=this._tiles[n];if(s.fadeEndTime!==void 0&&s.fadeEndTime>=u.browser.now())return!0}return!1},o.prototype.setFeatureState=function(n,s,p){this._state.updateState(n=n||"_geojsonTileLayer",s,p)},o.prototype.removeFeatureState=function(n,s,p){this._state.removeFeatureState(n=n||"_geojsonTileLayer",s,p)},o.prototype.getFeatureState=function(n,s){return this._state.getState(n=n||"_geojsonTileLayer",s)},o.prototype.setDependencies=function(n,s,p){var f=this._tiles[n];f&&f.setDependencies(s,p)},o.prototype.reloadTilesForDependencies=function(n,s){for(var p in this._tiles)this._tiles[p].hasDependency(n,s)&&this._reloadTile(p,"reloading");this._cache.filter((function(f){return!f.hasDependency(n,s)}))},o})(u.Evented);function $(i,o){var n=Math.abs(2*i.wrap)-+(i.wrap<0),s=Math.abs(2*o.wrap)-+(o.wrap<0);return i.overscaledZ-o.overscaledZ||s-n||o.canonical.y-i.canonical.y||o.canonical.x-i.canonical.x}function fe(i){return i==="raster"||i==="image"||i==="video"}function ye(){return new u.window.Worker(rs.workerUrl)}N.maxOverzooming=10,N.maxUnderzooming=3;var ae="mapboxgl_preloaded_worker_pool",de=function(){this.active={}};de.prototype.acquire=function(i){if(!this.workers)for(this.workers=[];this.workers.length<de.workerCount;)this.workers.push(new ye);return this.active[i]=!0,this.workers.slice()},de.prototype.release=function(i){delete this.active[i],this.numActive()===0&&(this.workers.forEach((function(o){o.terminate()})),this.workers=null)},de.prototype.isPreloaded=function(){return!!this.active[ae]},de.prototype.numActive=function(){return Object.keys(this.active).length};var Be,Me=Math.floor(u.browser.hardwareConcurrency/2);function se(){return Be||(Be=new de),Be}function Pe(i,o){var n={};for(var s in i)s!=="ref"&&(n[s]=i[s]);return u.refProperties.forEach((function(p){p in o&&(n[p]=o[p])})),n}function we(i){i=i.slice();for(var o=Object.create(null),n=0;n<i.length;n++)o[i[n].id]=i[n];for(var s=0;s<i.length;s++)"ref"in i[s]&&(i[s]=Pe(i[s],o[i[s].ref]));return i}de.workerCount=Math.max(Math.min(Me,6),1);var Ie={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 lt(i,o,n){n.push({command:Ie.addSource,args:[i,o[i]]})}function Te(i,o,n){o.push({command:Ie.removeSource,args:[i]}),n[i]=!0}function gt(i,o,n,s){Te(i,n,s),lt(i,o,n)}function Lt(i,o,n){var s;for(s in i[n])if(i[n].hasOwnProperty(s)&&s!=="data"&&!u.deepEqual(i[n][s],o[n][s]))return!1;for(s in o[n])if(o[n].hasOwnProperty(s)&&s!=="data"&&!u.deepEqual(i[n][s],o[n][s]))return!1;return!0}function pt(i,o,n,s,p,f){var d;for(d in o=o||{},i=i||{})i.hasOwnProperty(d)&&(u.deepEqual(i[d],o[d])||n.push({command:f,args:[s,d,o[d],p]}));for(d in o)o.hasOwnProperty(d)&&!i.hasOwnProperty(d)&&(u.deepEqual(i[d],o[d])||n.push({command:f,args:[s,d,o[d],p]}))}function Et(i){return i.id}function _t(i,o){return i[o.id]=o,i}var Jr=function(i,o){this.reset(i,o)};Jr.prototype.reset=function(i,o){this.points=i||[],this._distances=[0];for(var n=1;n<this.points.length;n++)this._distances[n]=this._distances[n-1]+this.points[n].dist(this.points[n-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(o||0,.5*this.length),this.paddedLength=this.length-2*this.padding},Jr.prototype.lerp=function(i){if(this.points.length===1)return this.points[0];i=u.clamp(i,0,1);for(var o=1,n=this._distances[o],s=i*this.paddedLength+this.padding;n<s&&o<this._distances.length;)n=this._distances[++o];var p=o-1,f=this._distances[p],d=n-f,y=d>0?(s-f)/d:0;return this.points[p].mult(1-y).add(this.points[o].mult(y))};var Pt=function(i,o,n){var s=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(i/n),this.yCellCount=Math.ceil(o/n);for(var f=0;f<this.xCellCount*this.yCellCount;f++)s.push([]),p.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=i,this.height=o,this.xScale=this.xCellCount/i,this.yScale=this.yCellCount/o,this.boxUid=0,this.circleUid=0};function or(i,o,n,s,p){var f=u.create();return o?(u.scale(f,f,[1/p,1/p,1]),n||u.rotateZ(f,f,s.angle)):u.multiply(f,s.labelPlaneMatrix,i),f}function Mt(i,o,n,s,p){if(o){var f=u.clone(i);return u.scale(f,f,[p,p,1]),n||u.rotateZ(f,f,-s.angle),f}return s.glCoordMatrix}function yt(i,o){var n=[i.x,i.y,0,1];Lr(n,n,o);var s=n[3];return{point:new u.Point(n[0]/s,n[1]/s),signedDistanceFromCamera:s}}function Tt(i,o){return .5+i/o*.5}function si(i,o){var n=i[0]/i[3],s=i[1]/i[3];return n>=-o[0]&&n<=o[0]&&s>=-o[1]&&s<=o[1]}function na(i,o,n,s,p,f,d,y){var _=s?i.textSizeData:i.iconSizeData,S=u.evaluateSizeForZoom(_,n.transform.zoom),P=[256/n.width*2+1,256/n.height*2+1],z=s?i.text.dynamicLayoutVertexArray:i.icon.dynamicLayoutVertexArray;z.clear();for(var M=i.lineVertexArray,U=s?i.text.placedSymbolArray:i.icon.placedSymbolArray,O=n.transform.width/n.transform.height,Z=!1,B=0;B<U.length;B++){var q=U.get(B);if(q.hidden||q.writingMode===u.WritingMode.vertical&&!Z)Yr(q.numGlyphs,z);else{Z=!1;var X=[q.anchorX,q.anchorY,0,1];if(u.transformMat4(X,X,o),si(X,P)){var Y=Tt(n.transform.cameraToCenterDistance,X[3]),ne=u.evaluateSizeForFeature(_,S,q),re=d?ne/Y:ne*Y,oe=new u.Point(q.anchorX,q.anchorY),he=yt(oe,p).point,xe={},ve=Ms(q,re,!1,y,o,p,f,i.glyphOffsetArray,M,z,he,oe,xe,O);Z=ve.useVertical,(ve.notEnoughRoom||Z||ve.needsFlipping&&Ms(q,re,!0,y,o,p,f,i.glyphOffsetArray,M,z,he,oe,xe,O).notEnoughRoom)&&Yr(q.numGlyphs,z)}else Yr(q.numGlyphs,z)}}s?i.text.dynamicLayoutVertexBuffer.updateData(z):i.icon.dynamicLayoutVertexBuffer.updateData(z)}function Dr(i,o,n,s,p,f,d,y,_,S,P){var z=y.glyphStartIndex+y.numGlyphs,M=y.lineStartIndex,U=y.lineStartIndex+y.lineLength,O=o.getoffsetX(y.glyphStartIndex),Z=o.getoffsetX(z-1),B=ar(i*O,n,s,p,f,d,y.segment,M,U,_,S,P);if(!B)return null;var q=ar(i*Z,n,s,p,f,d,y.segment,M,U,_,S,P);return q?{first:B,last:q}:null}function li(i,o,n,s){return i===u.WritingMode.horizontal&&Math.abs(n.y-o.y)>Math.abs(n.x-o.x)*s?{useVertical:!0}:(i===u.WritingMode.vertical?o.y<n.y:o.x>n.x)?{needsFlipping:!0}:null}function Ms(i,o,n,s,p,f,d,y,_,S,P,z,M,U){var O,Z=o/24,B=i.lineOffsetX*Z,q=i.lineOffsetY*Z;if(i.numGlyphs>1){var X=i.glyphStartIndex+i.numGlyphs,Y=i.lineStartIndex,ne=i.lineStartIndex+i.lineLength,re=Dr(Z,y,B,q,n,P,z,i,_,f,M);if(!re)return{notEnoughRoom:!0};var oe=yt(re.first.point,d).point,he=yt(re.last.point,d).point;if(s&&!n){var xe=li(i.writingMode,oe,he,U);if(xe)return xe}O=[re.first];for(var ve=i.glyphStartIndex+1;ve<X-1;ve++)O.push(ar(Z*y.getoffsetX(ve),B,q,n,P,z,i.segment,Y,ne,_,f,M));O.push(re.last)}else{if(s&&!n){var Ae=yt(z,p).point,Ne=i.lineStartIndex+i.segment+1,He=new u.Point(_.getx(Ne),_.gety(Ne)),Xe=yt(He,p),bt=Xe.signedDistanceFromCamera>0?Xe.point:oa(z,He,Ae,1,p),ze=li(i.writingMode,Ae,bt,U);if(ze)return ze}var tt=ar(Z*y.getoffsetX(i.glyphStartIndex),B,q,n,P,z,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,_,f,M);if(!tt)return{notEnoughRoom:!0};O=[tt]}for(var at=0,Qe=O;at<Qe.length;at+=1){var $e=Qe[at];u.addDynamicAttributes(S,$e.point,$e.angle)}return{}}function oa(i,o,n,s,p){var f=yt(i.add(i.sub(o)._unit()),p).point,d=n.sub(f);return n.add(d._mult(s/d.mag()))}function ar(i,o,n,s,p,f,d,y,_,S,P,z){var M=s?i-o:i+o,U=M>0?1:-1,O=0;s&&(U*=-1,O=Math.PI),U<0&&(O+=Math.PI);for(var Z=U>0?y+d:y+d+1,B=p,q=p,X=0,Y=0,ne=Math.abs(M),re=[];X+Y<=ne;){if((Z+=U)<y||Z>=_)return null;if(q=B,re.push(B),(B=z[Z])===void 0){var oe=new u.Point(S.getx(Z),S.gety(Z)),he=yt(oe,P);if(he.signedDistanceFromCamera>0)B=z[Z]=he.point;else{var xe=Z-U;B=oa(X===0?f:new u.Point(S.getx(xe),S.gety(xe)),oe,q,ne-X+1,P)}}X+=Y,Y=q.dist(B)}var ve=(ne-X)/Y,Ae=B.sub(q),Ne=Ae.mult(ve)._add(q);Ne._add(Ae._unit()._perp()._mult(n*U));var He=O+Math.atan2(B.y-q.y,B.x-q.x);return re.push(Ne),{point:Ne,angle:He,path:re}}Pt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Pt.prototype.insert=function(i,o,n,s,p){this._forEachCell(o,n,s,p,this._insertBoxCell,this.boxUid++),this.boxKeys.push(i),this.bboxes.push(o),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(p)},Pt.prototype.insertCircle=function(i,o,n,s){this._forEachCell(o-s,n-s,o+s,n+s,this._insertCircleCell,this.circleUid++),this.circleKeys.push(i),this.circles.push(o),this.circles.push(n),this.circles.push(s)},Pt.prototype._insertBoxCell=function(i,o,n,s,p,f){this.boxCells[p].push(f)},Pt.prototype._insertCircleCell=function(i,o,n,s,p,f){this.circleCells[p].push(f)},Pt.prototype._query=function(i,o,n,s,p,f){if(n<0||i>this.width||s<0||o>this.height)return!p&&[];var d=[];if(i<=0&&o<=0&&this.width<=n&&this.height<=s){if(p)return!0;for(var y=0;y<this.boxKeys.length;y++)d.push({key:this.boxKeys[y],x1:this.bboxes[4*y],y1:this.bboxes[4*y+1],x2:this.bboxes[4*y+2],y2:this.bboxes[4*y+3]});for(var _=0;_<this.circleKeys.length;_++){var S=this.circles[3*_],P=this.circles[3*_+1],z=this.circles[3*_+2];d.push({key:this.circleKeys[_],x1:S-z,y1:P-z,x2:S+z,y2:P+z})}return f?d.filter(f):d}return this._forEachCell(i,o,n,s,this._queryCell,d,{hitTest:p,seenUids:{box:{},circle:{}}},f),p?d.length>0:d},Pt.prototype._queryCircle=function(i,o,n,s,p){var f=i-n,d=i+n,y=o-n,_=o+n;if(d<0||f>this.width||_<0||y>this.height)return!s&&[];var S=[];return this._forEachCell(f,y,d,_,this._queryCellCircle,S,{hitTest:s,circle:{x:i,y:o,radius:n},seenUids:{box:{},circle:{}}},p),s?S.length>0:S},Pt.prototype.query=function(i,o,n,s,p){return this._query(i,o,n,s,!1,p)},Pt.prototype.hitTest=function(i,o,n,s,p){return this._query(i,o,n,s,!0,p)},Pt.prototype.hitTestCircle=function(i,o,n,s){return this._queryCircle(i,o,n,!0,s)},Pt.prototype._queryCell=function(i,o,n,s,p,f,d,y){var _=d.seenUids,S=this.boxCells[p];if(S!==null)for(var P=this.bboxes,z=0,M=S;z<M.length;z+=1){var U=M[z];if(!_.box[U]){_.box[U]=!0;var O=4*U;if(i<=P[O+2]&&o<=P[O+3]&&n>=P[O+0]&&s>=P[O+1]&&(!y||y(this.boxKeys[U]))){if(d.hitTest)return f.push(!0),!0;f.push({key:this.boxKeys[U],x1:P[O],y1:P[O+1],x2:P[O+2],y2:P[O+3]})}}}var Z=this.circleCells[p];if(Z!==null)for(var B=this.circles,q=0,X=Z;q<X.length;q+=1){var Y=X[q];if(!_.circle[Y]){_.circle[Y]=!0;var ne=3*Y;if(this._circleAndRectCollide(B[ne],B[ne+1],B[ne+2],i,o,n,s)&&(!y||y(this.circleKeys[Y]))){if(d.hitTest)return f.push(!0),!0;var re=B[ne],oe=B[ne+1],he=B[ne+2];f.push({key:this.circleKeys[Y],x1:re-he,y1:oe-he,x2:re+he,y2:oe+he})}}}},Pt.prototype._queryCellCircle=function(i,o,n,s,p,f,d,y){var _=d.circle,S=d.seenUids,P=this.boxCells[p];if(P!==null)for(var z=this.bboxes,M=0,U=P;M<U.length;M+=1){var O=U[M];if(!S.box[O]){S.box[O]=!0;var Z=4*O;if(this._circleAndRectCollide(_.x,_.y,_.radius,z[Z+0],z[Z+1],z[Z+2],z[Z+3])&&(!y||y(this.boxKeys[O])))return f.push(!0),!0}}var B=this.circleCells[p];if(B!==null)for(var q=this.circles,X=0,Y=B;X<Y.length;X+=1){var ne=Y[X];if(!S.circle[ne]){S.circle[ne]=!0;var re=3*ne;if(this._circlesCollide(q[re],q[re+1],q[re+2],_.x,_.y,_.radius)&&(!y||y(this.circleKeys[ne])))return f.push(!0),!0}}},Pt.prototype._forEachCell=function(i,o,n,s,p,f,d,y){for(var _=this._convertToXCellCoord(i),S=this._convertToYCellCoord(o),P=this._convertToXCellCoord(n),z=this._convertToYCellCoord(s),M=_;M<=P;M++)for(var U=S;U<=z;U++)if(p.call(this,i,o,n,s,this.xCellCount*U+M,f,d,y))return},Pt.prototype._convertToXCellCoord=function(i){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(i*this.xScale)))},Pt.prototype._convertToYCellCoord=function(i){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(i*this.yScale)))},Pt.prototype._circlesCollide=function(i,o,n,s,p,f){var d=s-i,y=p-o,_=n+f;return _*_>d*d+y*y},Pt.prototype._circleAndRectCollide=function(i,o,n,s,p,f,d){var y=(f-s)/2,_=Math.abs(i-(s+y));if(_>y+n)return!1;var S=(d-p)/2,P=Math.abs(o-(p+S));if(P>S+n)return!1;if(_<=y||P<=S)return!0;var z=_-y,M=P-S;return z*z+M*M<=n*n};var aa=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Yr(i,o){for(var n=0;n<i;n++){var s=o.length;o.resize(s+4),o.float32.set(aa,3*s)}}function Lr(i,o,n){var s=o[0],p=o[1];return i[0]=n[0]*s+n[4]*p+n[12],i[1]=n[1]*s+n[5]*p+n[13],i[3]=n[3]*s+n[7]*p+n[15],i}var Li=function(i,o,n){o===void 0&&(o=new Pt(i.width+200,i.height+200,25)),n===void 0&&(n=new Pt(i.width+200,i.height+200,25)),this.transform=i,this.grid=o,this.ignoredGrid=n,this.pitchfactor=Math.cos(i._pitch)*i.cameraToCenterDistance,this.screenRightBoundary=i.width+100,this.screenBottomBoundary=i.height+100,this.gridRightBoundary=i.width+200,this.gridBottomBoundary=i.height+200};function qt(i,o,n){return o*(u.EXTENT/(i.tileSize*Math.pow(2,n-i.tileID.overscaledZ)))}Li.prototype.placeCollisionBox=function(i,o,n,s,p){var f=this.projectAndGetPerspectiveRatio(s,i.anchorPointX,i.anchorPointY),d=n*f.perspectiveRatio,y=i.x1*d+f.point.x,_=i.y1*d+f.point.y,S=i.x2*d+f.point.x,P=i.y2*d+f.point.y;return!this.isInsideGrid(y,_,S,P)||!o&&this.grid.hitTest(y,_,S,P,p)?{box:[],offscreen:!1}:{box:[y,_,S,P],offscreen:this.isOffscreen(y,_,S,P)}},Li.prototype.placeCollisionCircles=function(i,o,n,s,p,f,d,y,_,S,P,z,M){var U=[],O=new u.Point(o.anchorX,o.anchorY),Z=yt(O,f),B=Tt(this.transform.cameraToCenterDistance,Z.signedDistanceFromCamera),q=(S?p/B:p*B)/u.ONE_EM,X=yt(O,d).point,Y=Dr(q,s,o.lineOffsetX*q,o.lineOffsetY*q,!1,X,O,o,n,d,{}),ne=!1,re=!1,oe=!0;if(Y){for(var he=.5*z*B+M,xe=new u.Point(-100,-100),ve=new u.Point(this.screenRightBoundary,this.screenBottomBoundary),Ae=new Jr,Ne=Y.first,He=Y.last,Xe=[],bt=Ne.path.length-1;bt>=1;bt--)Xe.push(Ne.path[bt]);for(var ze=1;ze<He.path.length;ze++)Xe.push(He.path[ze]);var tt=2.5*he;if(y){var at=Xe.map((function(Ui){return yt(Ui,y)}));Xe=at.some((function(Ui){return Ui.signedDistanceFromCamera<=0}))?[]:at.map((function(Ui){return Ui.point}))}var Qe=[];if(Xe.length>0){for(var $e=Xe[0].clone(),nt=Xe[0].clone(),Ye=1;Ye<Xe.length;Ye++)$e.x=Math.min($e.x,Xe[Ye].x),$e.y=Math.min($e.y,Xe[Ye].y),nt.x=Math.max(nt.x,Xe[Ye].x),nt.y=Math.max(nt.y,Xe[Ye].y);Qe=$e.x>=xe.x&&nt.x<=ve.x&&$e.y>=xe.y&&nt.y<=ve.y?[Xe]:nt.x<xe.x||$e.x>ve.x||nt.y<xe.y||$e.y>ve.y?[]:u.clipLine([Xe],xe.x,xe.y,ve.x,ve.y)}for(var Ke=0,kr=Qe;Ke<kr.length;Ke+=1){var Qt;Ae.reset(kr[Ke],.25*he),Qt=Ae.length<=.5*he?1:Math.ceil(Ae.paddedLength/tt)+1;for(var Wr=0;Wr<Qt;Wr++){var Rr=Wr/Math.max(Qt-1,1),Yt=Ae.lerp(Rr),sr=Yt.x+100,bi=Yt.y+100;U.push(sr,bi,he,0);var ti=sr-he,Jn=bi-he,ui=sr+he,Qi=bi+he;if(oe=oe&&this.isOffscreen(ti,Jn,ui,Qi),re=re||this.isInsideGrid(ti,Jn,ui,Qi),!i&&this.grid.hitTestCircle(sr,bi,he,P)&&(ne=!0,!_))return{circles:[],offscreen:!1,collisionDetected:ne}}}}return{circles:!_&&ne||!re?[]:U,offscreen:oe,collisionDetected:ne}},Li.prototype.queryRenderedSymbols=function(i){if(i.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var o=[],n=1/0,s=1/0,p=-1/0,f=-1/0,d=0,y=i;d<y.length;d+=1){var _=y[d],S=new u.Point(_.x+100,_.y+100);n=Math.min(n,S.x),s=Math.min(s,S.y),p=Math.max(p,S.x),f=Math.max(f,S.y),o.push(S)}for(var P={},z={},M=0,U=this.grid.query(n,s,p,f).concat(this.ignoredGrid.query(n,s,p,f));M<U.length;M+=1){var O=U[M],Z=O.key;if(P[Z.bucketInstanceId]===void 0&&(P[Z.bucketInstanceId]={}),!P[Z.bucketInstanceId][Z.featureIndex]){var B=[new u.Point(O.x1,O.y1),new u.Point(O.x2,O.y1),new u.Point(O.x2,O.y2),new u.Point(O.x1,O.y2)];u.polygonIntersectsPolygon(o,B)&&(P[Z.bucketInstanceId][Z.featureIndex]=!0,z[Z.bucketInstanceId]===void 0&&(z[Z.bucketInstanceId]=[]),z[Z.bucketInstanceId].push(Z.featureIndex))}}return z},Li.prototype.insertCollisionBox=function(i,o,n,s,p){(o?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:s,collisionGroupID:p},i[0],i[1],i[2],i[3])},Li.prototype.insertCollisionCircles=function(i,o,n,s,p){for(var f=o?this.ignoredGrid:this.grid,d={bucketInstanceId:n,featureIndex:s,collisionGroupID:p},y=0;y<i.length;y+=4)f.insertCircle(d,i[y],i[y+1],i[y+2])},Li.prototype.projectAndGetPerspectiveRatio=function(i,o,n){var s=[o,n,0,1];return Lr(s,s,i),{point:new u.Point((s[0]/s[3]+1)/2*this.transform.width+100,(-s[1]/s[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/s[3]*.5}},Li.prototype.isOffscreen=function(i,o,n,s){return n<100||i>=this.screenRightBoundary||s<100||o>this.screenBottomBoundary},Li.prototype.isInsideGrid=function(i,o,n,s){return n>=0&&i<this.gridRightBoundary&&s>=0&&o<this.gridBottomBoundary},Li.prototype.getViewportMatrix=function(){var i=u.identity([]);return u.translate(i,i,[-100,-100,0]),i};var Xi=function(i,o,n,s){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?o:-o))):s&&n?1:0,this.placed=n};Xi.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var ki=function(i,o,n,s,p){this.text=new Xi(i?i.text:null,o,n,p),this.icon=new Xi(i?i.icon:null,o,s,p)};ki.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Pl=function(i,o,n){this.text=i,this.icon=o,this.skipFade=n},Bi=function(){this.invProjMatrix=u.create(),this.viewportMatrix=u.create(),this.circles=[]},Gu=function(i,o,n,s,p){this.bucketInstanceId=i,this.featureIndex=o,this.sourceLayerIndex=n,this.bucketIndex=s,this.tileID=p},bn=function(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}};function Nr(i,o,n,s,p){var f=u.getAnchorAlignment(i),d=-(f.horizontalAlign-.5)*o,y=-(f.verticalAlign-.5)*n,_=u.evaluateVariableOffset(i,s);return new u.Point(d+_[0]*p,y+_[1]*p)}function ln(i,o,n,s,p,f){var d=i.x1,y=i.x2,_=i.y1,S=i.y2,P=i.anchorPointX,z=i.anchorPointY,M=new u.Point(o,n);return s&&M._rotate(p?f:-f),{x1:d+M.x,y1:_+M.y,x2:y+M.x,y2:S+M.y,anchorPointX:P,anchorPointY:z}}bn.prototype.get=function(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){var o=++this.maxGroupID;this.collisionGroups[i]={ID:o,predicate:function(n){return n.collisionGroupID===o}}}return this.collisionGroups[i]};var $r=function(i,o,n,s){this.transform=i.clone(),this.collisionIndex=new Li(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new bn(n),this.collisionCircleArrays={},this.prevPlacement=s,s&&(s.prevPlacement=void 0),this.placedOrientations={}};function uo(i,o,n,s,p){i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0)}$r.prototype.getBucketParts=function(i,o,n,s){var p=n.getBucket(o),f=n.latestFeatureIndex;if(p&&f&&o.id===p.layerIds[0]){var d=n.collisionBoxArray,y=p.layers[0].layout,_=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),S=n.tileSize/u.EXTENT,P=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),z=y.get("text-pitch-alignment")==="map",M=y.get("text-rotation-alignment")==="map",U=qt(n,1,this.transform.zoom),O=or(P,z,M,this.transform,U),Z=null;if(z){var B=Mt(P,z,M,this.transform,U);Z=u.multiply([],this.transform.labelPlaneMatrix,B)}this.retainedQueryData[p.bucketInstanceId]=new Gu(p.bucketInstanceId,f,p.sourceLayerIndex,p.index,n.tileID);var q={bucket:p,layout:y,posMatrix:P,textLabelPlaneMatrix:O,labelToScreenMatrix:Z,scale:_,textPixelRatio:S,holdingForFade:n.holdingForFade(),collisionBoxArray:d,partiallyEvaluatedTextSize:u.evaluateSizeForZoom(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(s)for(var X=0,Y=p.sortKeyRanges;X<Y.length;X+=1){var ne=Y[X];i.push({sortKey:ne.sortKey,symbolInstanceStart:ne.symbolInstanceStart,symbolInstanceEnd:ne.symbolInstanceEnd,parameters:q})}else i.push({symbolInstanceStart:0,symbolInstanceEnd:p.symbolInstances.length,parameters:q})}},$r.prototype.attemptAnchorPlacement=function(i,o,n,s,p,f,d,y,_,S,P,z,M,U,O){var Z,B=[z.textOffset0,z.textOffset1],q=Nr(i,n,s,B,p),X=this.collisionIndex.placeCollisionBox(ln(o,q.x,q.y,f,d,this.transform.angle),P,y,_,S.predicate);if(!O||this.collisionIndex.placeCollisionBox(ln(O,q.x,q.y,f,d,this.transform.angle),P,y,_,S.predicate).box.length!==0)return X.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[z.crossTileID]&&this.prevPlacement.placements[z.crossTileID]&&this.prevPlacement.placements[z.crossTileID].text&&(Z=this.prevPlacement.variableOffsets[z.crossTileID].anchor),this.variableOffsets[z.crossTileID]={textOffset:B,width:n,height:s,anchor:i,textBoxScale:p,prevAnchor:Z},this.markUsedJustification(M,i,z,U),M.allowVerticalPlacement&&(this.markUsedOrientation(M,U,z),this.placedOrientations[z.crossTileID]=U),{shift:q,placedGlyphBoxes:X}):void 0},$r.prototype.placeLayerBucketPart=function(i,o,n){var s=this,p=i.parameters,f=p.bucket,d=p.layout,y=p.posMatrix,_=p.textLabelPlaneMatrix,S=p.labelToScreenMatrix,P=p.textPixelRatio,z=p.holdingForFade,M=p.collisionBoxArray,U=p.partiallyEvaluatedTextSize,O=p.collisionGroup,Z=d.get("text-optional"),B=d.get("icon-optional"),q=d.get("text-allow-overlap"),X=d.get("icon-allow-overlap"),Y=d.get("text-rotation-alignment")==="map",ne=d.get("text-pitch-alignment")==="map",re=d.get("icon-text-fit")!=="none",oe=d.get("symbol-z-order")==="viewport-y",he=q&&(X||!f.hasIconData()||B),xe=X&&(q||!f.hasTextData()||Z);!f.collisionArrays&&M&&f.deserializeCollisionBoxes(M);var ve=function(ze,tt){if(!o[ze.crossTileID])if(z)s.placements[ze.crossTileID]=new Pl(!1,!1,!1);else{var at,Qe=!1,$e=!1,nt=!0,Ye=null,Ke={box:null,offscreen:null},kr={box:null,offscreen:null},Qt=null,Wr=null,Rr=0,Yt=0,sr=0;tt.textFeatureIndex?Rr=tt.textFeatureIndex:ze.useRuntimeCollisionCircles&&(Rr=ze.featureIndex),tt.verticalTextFeatureIndex&&(Yt=tt.verticalTextFeatureIndex);var bi=tt.textBox;if(bi){var ti=function(kt){var Ai=u.WritingMode.horizontal;if(f.allowVerticalPlacement&&!kt&&s.prevPlacement){var ci=s.prevPlacement.placedOrientations[ze.crossTileID];ci&&(s.placedOrientations[ze.crossTileID]=ci,s.markUsedOrientation(f,Ai=ci,ze))}return Ai},Jn=function(kt,Ai){if(f.allowVerticalPlacement&&ze.numVerticalGlyphVertices>0&&tt.verticalTextBox)for(var ci=0,Co=f.writingModes;ci<Co.length&&(Co[ci]===u.WritingMode.vertical?(Ke=Ai(),kr=Ke):Ke=kt(),!(Ke&&Ke.box&&Ke.box.length));ci+=1);else Ke=kt()};if(d.get("text-variable-anchor")){var ui=d.get("text-variable-anchor");if(s.prevPlacement&&s.prevPlacement.variableOffsets[ze.crossTileID]){var Qi=s.prevPlacement.variableOffsets[ze.crossTileID];ui.indexOf(Qi.anchor)>0&&(ui=ui.filter((function(kt){return kt!==Qi.anchor}))).unshift(Qi.anchor)}var Ui=function(kt,Ai,ci){for(var Co=kt.x2-kt.x1,oc=kt.y2-kt.y1,is=ze.textBoxScale,ac=re&&!X?Ai:null,ka={box:[],offscreen:!1},au=q?2*ui.length:ui.length,Yo=0;Yo<au;++Yo){var ns=s.attemptAnchorPlacement(ui[Yo%ui.length],kt,Co,oc,is,Y,ne,P,y,O,Yo>=ui.length,ze,f,ci,ac);if(ns&&(ka=ns.placedGlyphBoxes)&&ka.box&&ka.box.length){Qe=!0,Ye=ns.shift;break}}return ka};Jn((function(){return Ui(bi,tt.iconBox,u.WritingMode.horizontal)}),(function(){var kt=tt.verticalTextBox;return f.allowVerticalPlacement&&!(Ke&&Ke.box&&Ke.box.length)&&ze.numVerticalGlyphVertices>0&&kt?Ui(kt,tt.verticalIconBox,u.WritingMode.vertical):{box:null,offscreen:null}})),Ke&&(Qe=Ke.box,nt=Ke.offscreen);var Ia=ti(Ke&&Ke.box);if(!Qe&&s.prevPlacement){var Ko=s.prevPlacement.variableOffsets[ze.crossTileID];Ko&&(s.variableOffsets[ze.crossTileID]=Ko,s.markUsedJustification(f,Ko.anchor,ze,Ia))}}else{var Yn=function(kt,Ai){var ci=s.collisionIndex.placeCollisionBox(kt,q,P,y,O.predicate);return ci&&ci.box&&ci.box.length&&(s.markUsedOrientation(f,Ai,ze),s.placedOrientations[ze.crossTileID]=Ai),ci};Jn((function(){return Yn(bi,u.WritingMode.horizontal)}),(function(){var kt=tt.verticalTextBox;return f.allowVerticalPlacement&&ze.numVerticalGlyphVertices>0&&kt?Yn(kt,u.WritingMode.vertical):{box:null,offscreen:null}})),ti(Ke&&Ke.box&&Ke.box.length)}}if(Qe=(at=Ke)&&at.box&&at.box.length>0,nt=at&&at.offscreen,ze.useRuntimeCollisionCircles){var Jo=f.text.placedSymbolArray.get(ze.centerJustifiedTextSymbolIndex),Ea=u.evaluateSizeForFeature(f.textSizeData,U,Jo),hn=d.get("text-padding");Qt=s.collisionIndex.placeCollisionCircles(q,Jo,f.lineVertexArray,f.glyphOffsetArray,Ea,y,_,S,n,ne,O.predicate,ze.collisionCircleDiameter,hn),Qe=q||Qt.circles.length>0&&!Qt.collisionDetected,nt=nt&&Qt.offscreen}if(tt.iconFeatureIndex&&(sr=tt.iconFeatureIndex),tt.iconBox){var Ta=function(kt){var Ai=re&&Ye?ln(kt,Ye.x,Ye.y,Y,ne,s.transform.angle):kt;return s.collisionIndex.placeCollisionBox(Ai,X,P,y,O.predicate)};$e=kr&&kr.box&&kr.box.length&&tt.verticalIconBox?(Wr=Ta(tt.verticalIconBox)).box.length>0:(Wr=Ta(tt.iconBox)).box.length>0,nt=nt&&Wr.offscreen}var fn=Z||ze.numHorizontalGlyphVertices===0&&ze.numVerticalGlyphVertices===0,Cr=B||ze.numIconVertices===0;if(fn||Cr?Cr?fn||($e=$e&&Qe):Qe=$e&&Qe:$e=Qe=$e&&Qe,Qe&&at&&at.box&&s.collisionIndex.insertCollisionBox(at.box,d.get("text-ignore-placement"),f.bucketInstanceId,kr&&kr.box&&Yt?Yt:Rr,O.ID),$e&&Wr&&s.collisionIndex.insertCollisionBox(Wr.box,d.get("icon-ignore-placement"),f.bucketInstanceId,sr,O.ID),Qt&&(Qe&&s.collisionIndex.insertCollisionCircles(Qt.circles,d.get("text-ignore-placement"),f.bucketInstanceId,Rr,O.ID),n)){var En=f.bucketInstanceId,$n=s.collisionCircleArrays[En];$n===void 0&&($n=s.collisionCircleArrays[En]=new Bi);for(var ko=0;ko<Qt.circles.length;ko+=4)$n.circles.push(Qt.circles[ko+0]),$n.circles.push(Qt.circles[ko+1]),$n.circles.push(Qt.circles[ko+2]),$n.circles.push(Qt.collisionDetected?1:0)}s.placements[ze.crossTileID]=new Pl(Qe||he,$e||xe,nt||f.justReloaded),o[ze.crossTileID]=!0}};if(oe)for(var Ae=f.getSortedSymbolIndexes(this.transform.angle),Ne=Ae.length-1;Ne>=0;--Ne){var He=Ae[Ne];ve(f.symbolInstances.get(He),f.collisionArrays[He])}else for(var Xe=i.symbolInstanceStart;Xe<i.symbolInstanceEnd;Xe++)ve(f.symbolInstances.get(Xe),f.collisionArrays[Xe]);if(n&&f.bucketInstanceId in this.collisionCircleArrays){var bt=this.collisionCircleArrays[f.bucketInstanceId];u.invert(bt.invProjMatrix,y),bt.viewportMatrix=this.collisionIndex.getViewportMatrix()}f.justReloaded=!1},$r.prototype.markUsedJustification=function(i,o,n,s){var p;p=s===u.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[u.getAnchorJustification(o)];for(var f=0,d=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];f<d.length;f+=1){var y=d[f];y>=0&&(i.text.placedSymbolArray.get(y).crossTileID=p>=0&&y!==p?0:n.crossTileID)}},$r.prototype.markUsedOrientation=function(i,o,n){for(var s=o===u.WritingMode.horizontal||o===u.WritingMode.horizontalOnly?o:0,p=o===u.WritingMode.vertical?o:0,f=0,d=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];f<d.length;f+=1)i.text.placedSymbolArray.get(d[f]).placedOrientation=s;n.verticalPlacedTextSymbolIndex&&(i.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=p)},$r.prototype.commit=function(i){this.commitTime=i,this.zoomAtLastRecencyCheck=this.transform.zoom;var o=this.prevPlacement,n=!1;this.prevZoomAdjustment=o?o.zoomAdjustment(this.transform.zoom):0;var s=o?o.symbolFadeChange(i):1,p=o?o.opacities:{},f=o?o.variableOffsets:{},d=o?o.placedOrientations:{};for(var y in this.placements){var _=this.placements[y],S=p[y];S?(this.opacities[y]=new ki(S,s,_.text,_.icon),n=n||_.text!==S.text.placed||_.icon!==S.icon.placed):(this.opacities[y]=new ki(null,s,_.text,_.icon,_.skipFade),n=n||_.text||_.icon)}for(var P in p){var z=p[P];if(!this.opacities[P]){var M=new ki(z,s,!1,!1);M.isHidden()||(this.opacities[P]=M,n=n||z.text.placed||z.icon.placed)}}for(var U in f)this.variableOffsets[U]||!this.opacities[U]||this.opacities[U].isHidden()||(this.variableOffsets[U]=f[U]);for(var O in d)this.placedOrientations[O]||!this.opacities[O]||this.opacities[O].isHidden()||(this.placedOrientations[O]=d[O]);n?this.lastPlacementChangeTime=i:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=o?o.lastPlacementChangeTime:i)},$r.prototype.updateLayerOpacities=function(i,o){for(var n={},s=0,p=o;s<p.length;s+=1){var f=p[s],d=f.getBucket(i);d&&f.latestFeatureIndex&&i.id===d.layerIds[0]&&this.updateBucketOpacities(d,n,f.collisionBoxArray)}},$r.prototype.updateBucketOpacities=function(i,o,n){var s=this;i.hasTextData()&&i.text.opacityVertexArray.clear(),i.hasIconData()&&i.icon.opacityVertexArray.clear(),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexArray.clear(),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexArray.clear();var p=i.layers[0].layout,f=new ki(null,0,!1,!1,!0),d=p.get("text-allow-overlap"),y=p.get("icon-allow-overlap"),_=p.get("text-variable-anchor"),S=p.get("text-rotation-alignment")==="map",P=p.get("text-pitch-alignment")==="map",z=p.get("icon-text-fit")!=="none",M=new ki(null,0,d&&(y||!i.hasIconData()||p.get("icon-optional")),y&&(d||!i.hasTextData()||p.get("text-optional")),!0);!i.collisionArrays&&n&&(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData())&&i.deserializeCollisionBoxes(n);for(var U=function(q,X,Y){for(var ne=0;ne<X/4;ne++)q.opacityVertexArray.emplaceBack(Y)},O=function(q){var X=i.symbolInstances.get(q),Y=X.numHorizontalGlyphVertices,ne=X.numVerticalGlyphVertices,re=X.crossTileID,oe=s.opacities[re];o[re]?oe=f:oe||(s.opacities[re]=oe=M),o[re]=!0;var he=X.numIconVertices>0,xe=s.placedOrientations[X.crossTileID],ve=xe===u.WritingMode.vertical,Ae=xe===u.WritingMode.horizontal||xe===u.WritingMode.horizontalOnly;if(Y>0||ne>0){var Ne=Ml(oe.text);U(i.text,Y,ve?Oo:Ne),U(i.text,ne,Ae?Oo:Ne);var He=oe.text.isHidden();[X.rightJustifiedTextSymbolIndex,X.centerJustifiedTextSymbolIndex,X.leftJustifiedTextSymbolIndex].forEach((function(Ke){Ke>=0&&(i.text.placedSymbolArray.get(Ke).hidden=He||ve?1:0)})),X.verticalPlacedTextSymbolIndex>=0&&(i.text.placedSymbolArray.get(X.verticalPlacedTextSymbolIndex).hidden=He||Ae?1:0);var Xe=s.variableOffsets[X.crossTileID];Xe&&s.markUsedJustification(i,Xe.anchor,X,xe);var bt=s.placedOrientations[X.crossTileID];bt&&(s.markUsedJustification(i,"left",X,bt),s.markUsedOrientation(i,bt,X))}if(he){var ze=Ml(oe.icon),tt=!(z&&X.verticalPlacedIconSymbolIndex&&ve);X.placedIconSymbolIndex>=0&&(U(i.icon,X.numIconVertices,tt?ze:Oo),i.icon.placedSymbolArray.get(X.placedIconSymbolIndex).hidden=oe.icon.isHidden()),X.verticalPlacedIconSymbolIndex>=0&&(U(i.icon,X.numVerticalIconVertices,tt?Oo:ze),i.icon.placedSymbolArray.get(X.verticalPlacedIconSymbolIndex).hidden=oe.icon.isHidden())}if(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData()){var at=i.collisionArrays[q];if(at){var Qe=new u.Point(0,0);if(at.textBox||at.verticalTextBox){var $e=!0;if(_){var nt=s.variableOffsets[re];nt?(Qe=Nr(nt.anchor,nt.width,nt.height,nt.textOffset,nt.textBoxScale),S&&Qe._rotate(P?s.transform.angle:-s.transform.angle)):$e=!1}at.textBox&&uo(i.textCollisionBox.collisionVertexArray,oe.text.placed,!$e||ve,Qe.x,Qe.y),at.verticalTextBox&&uo(i.textCollisionBox.collisionVertexArray,oe.text.placed,!$e||Ae,Qe.x,Qe.y)}var Ye=!!(!Ae&&at.verticalIconBox);at.iconBox&&uo(i.iconCollisionBox.collisionVertexArray,oe.icon.placed,Ye,z?Qe.x:0,z?Qe.y:0),at.verticalIconBox&&uo(i.iconCollisionBox.collisionVertexArray,oe.icon.placed,!Ye,z?Qe.x:0,z?Qe.y:0)}}},Z=0;Z<i.symbolInstances.length;Z++)O(Z);if(i.sortFeatures(this.transform.angle),this.retainedQueryData[i.bucketInstanceId]&&(this.retainedQueryData[i.bucketInstanceId].featureSortOrder=i.featureSortOrder),i.hasTextData()&&i.text.opacityVertexBuffer&&i.text.opacityVertexBuffer.updateData(i.text.opacityVertexArray),i.hasIconData()&&i.icon.opacityVertexBuffer&&i.icon.opacityVertexBuffer.updateData(i.icon.opacityVertexArray),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexBuffer&&i.iconCollisionBox.collisionVertexBuffer.updateData(i.iconCollisionBox.collisionVertexArray),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexBuffer&&i.textCollisionBox.collisionVertexBuffer.updateData(i.textCollisionBox.collisionVertexArray),i.bucketInstanceId in this.collisionCircleArrays){var B=this.collisionCircleArrays[i.bucketInstanceId];i.placementInvProjMatrix=B.invProjMatrix,i.placementViewportMatrix=B.viewportMatrix,i.collisionCircleArray=B.circles,delete this.collisionCircleArrays[i.bucketInstanceId]}},$r.prototype.symbolFadeChange=function(i){return this.fadeDuration===0?1:(i-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},$r.prototype.zoomAdjustment=function(i){return Math.max(0,(this.transform.zoom-i)/1.5)},$r.prototype.hasTransitions=function(i){return this.stale||i-this.lastPlacementChangeTime<this.fadeDuration},$r.prototype.stillRecent=function(i,o){var n=this.zoomAtLastRecencyCheck===o?1-this.zoomAdjustment(o):1;return this.zoomAtLastRecencyCheck=o,this.commitTime+this.fadeDuration*n>i},$r.prototype.setStale=function(){this.stale=!0};var Wu=Math.pow(2,25),Xu=Math.pow(2,24),Ds=Math.pow(2,17),Hu=Math.pow(2,16),Al=Math.pow(2,9),Ku=Math.pow(2,8),zl=Math.pow(2,1);function Ml(i){if(i.opacity===0&&!i.placed)return 0;if(i.opacity===1&&i.placed)return 4294967295;var o=i.placed?1:0,n=Math.floor(127*i.opacity);return n*Wu+o*Xu+n*Ds+o*Hu+n*Al+o*Ku+n*zl+o}var Oo=0,Ls=function(i){this._sortAcrossTiles=i.layout.get("symbol-z-order")!=="viewport-y"&&i.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Ls.prototype.continuePlacement=function(i,o,n,s,p){for(var f=this._bucketParts;this._currentTileIndex<i.length;)if(o.getBucketParts(f,s,i[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,p())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,f.sort((function(d,y){return d.sortKey-y.sortKey})));this._currentPartIndex<f.length;)if(o.placeLayerBucketPart(f[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,p())return!0;return!1};var sa=function(i,o,n,s,p,f,d){this.placement=new $r(i,p,f,d),this._currentPlacementIndex=o.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=s,this._done=!1};sa.prototype.isDone=function(){return this._done},sa.prototype.continuePlacement=function(i,o,n){for(var s=this,p=u.browser.now(),f=function(){var _=u.browser.now()-p;return!s._forceFullPlacement&&_>2};this._currentPlacementIndex>=0;){var d=o[i[this._currentPlacementIndex]],y=this.placement.collisionIndex.transform.zoom;if(d.type==="symbol"&&(!d.minzoom||d.minzoom<=y)&&(!d.maxzoom||d.maxzoom>y)){if(this._inProgressLayer||(this._inProgressLayer=new Ls(d)),this._inProgressLayer.continuePlacement(n[d.source],this.placement,this._showCollisionBoxes,d,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},sa.prototype.commit=function(i){return this.placement.commit(i),this.placement};var Dl=512/u.EXTENT/2,Fa=function(i,o,n){this.tileID=i,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var s=0;s<o.length;s++){var p=o.get(s),f=p.key;this.indexedSymbolInstances[f]||(this.indexedSymbolInstances[f]=[]),this.indexedSymbolInstances[f].push({crossTileID:p.crossTileID,coord:this.getScaledCoordinates(p,i)})}};Fa.prototype.getScaledCoordinates=function(i,o){var n=Dl/Math.pow(2,o.canonical.z-this.tileID.canonical.z);return{x:Math.floor((o.canonical.x*u.EXTENT+i.anchorX)*n),y:Math.floor((o.canonical.y*u.EXTENT+i.anchorY)*n)}},Fa.prototype.findMatches=function(i,o,n){for(var s=this.tileID.canonical.z<o.canonical.z?1:Math.pow(2,this.tileID.canonical.z-o.canonical.z),p=0;p<i.length;p++){var f=i.get(p);if(!f.crossTileID){var d=this.indexedSymbolInstances[f.key];if(d)for(var y=this.getScaledCoordinates(f,o),_=0,S=d;_<S.length;_+=1){var P=S[_];if(Math.abs(P.coord.x-y.x)<=s&&Math.abs(P.coord.y-y.y)<=s&&!n[P.crossTileID]){n[P.crossTileID]=!0,f.crossTileID=P.crossTileID;break}}}}};var Ri=function(){this.maxCrossTileID=0};Ri.prototype.generate=function(){return++this.maxCrossTileID};var Rn=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Rn.prototype.handleWrapJump=function(i){var o=Math.round((i-this.lng)/360);if(o!==0)for(var n in this.indexes){var s=this.indexes[n],p={};for(var f in s){var d=s[f];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+o),p[d.tileID.key]=d}this.indexes[n]=p}this.lng=i},Rn.prototype.addBucket=function(i,o,n){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===o.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(var s=0;s<o.symbolInstances.length;s++)o.symbolInstances.get(s).crossTileID=0;this.usedCrossTileIDs[i.overscaledZ]||(this.usedCrossTileIDs[i.overscaledZ]={});var p=this.usedCrossTileIDs[i.overscaledZ];for(var f in this.indexes){var d=this.indexes[f];if(Number(f)>i.overscaledZ)for(var y in d){var _=d[y];_.tileID.isChildOf(i)&&_.findMatches(o.symbolInstances,i,p)}else{var S=d[i.scaledTo(Number(f)).key];S&&S.findMatches(o.symbolInstances,i,p)}}for(var P=0;P<o.symbolInstances.length;P++){var z=o.symbolInstances.get(P);z.crossTileID||(z.crossTileID=n.generate(),p[z.crossTileID]=!0)}return this.indexes[i.overscaledZ]===void 0&&(this.indexes[i.overscaledZ]={}),this.indexes[i.overscaledZ][i.key]=new Fa(i,o.symbolInstances,o.bucketInstanceId),!0},Rn.prototype.removeBucketCrossTileIDs=function(i,o){for(var n in o.indexedSymbolInstances)for(var s=0,p=o.indexedSymbolInstances[n];s<p.length;s+=1)delete this.usedCrossTileIDs[i][p[s].crossTileID]},Rn.prototype.removeStaleBuckets=function(i){var o=!1;for(var n in this.indexes){var s=this.indexes[n];for(var p in s)i[s[p].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,s[p]),delete s[p],o=!0)}return o};var Fn=function(){this.layerIndexes={},this.crossTileIDs=new Ri,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Fn.prototype.addLayer=function(i,o,n){var s=this.layerIndexes[i.id];s===void 0&&(s=this.layerIndexes[i.id]=new Rn);var p=!1,f={};s.handleWrapJump(n);for(var d=0,y=o;d<y.length;d+=1){var _=y[d],S=_.getBucket(i);S&&i.id===S.layerIds[0]&&(S.bucketInstanceId||(S.bucketInstanceId=++this.maxBucketInstanceId),s.addBucket(_.tileID,S,this.crossTileIDs)&&(p=!0),f[S.bucketInstanceId]=!0)}return s.removeStaleBuckets(f)&&(p=!0),p},Fn.prototype.pruneUnusedLayers=function(i){var o={};for(var n in i.forEach((function(s){o[s]=!0})),this.layerIndexes)o[n]||delete this.layerIndexes[n]};var co=function(i,o){return u.emitValidationErrors(i,o&&o.filter((function(n){return n.identifier!=="source.canvas"})))},On=u.pick(Ie,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Vn=u.pick(Ie,["setCenter","setZoom","setBearing","setPitch"]),Oa=(function(){var i={},o=u.styleSpec.$version;for(var n in u.styleSpec.$root){var s,p=u.styleSpec.$root[n];p.required&&(s=n==="version"?o:p.type==="array"?[]:{})!=null&&(i[n]=s)}return i})(),mi=(function(i){function o(n,s){var p=this;s===void 0&&(s={}),i.call(this),this.map=n,this.dispatcher=new Kr(se(),this),this.imageManager=new Sr,this.imageManager.setEventedParent(this),this.glyphManager=new zr(n._requestManager,s.localIdeographFontFamily),this.lineAtlas=new Ht(256,512),this.crossTileSymbolIndex=new Fn,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new u.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",u.getReferrer());var f=this;this._rtlTextPluginCallback=o.registerForPluginStateChange((function(d){f.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:d.pluginStatus,pluginURL:d.pluginURL},(function(y,_){if(u.triggerPluginCompletionEvent(y),_&&_.every((function(P){return P})))for(var S in f.sourceCaches)f.sourceCaches[S].reload()}))})),this.on("data",(function(d){if(d.dataType==="source"&&d.sourceDataType==="metadata"){var y=p.sourceCaches[d.sourceId];if(y){var _=y.getSource();if(_&&_.vectorLayerIds)for(var S in p._layers){var P=p._layers[S];P.source===_.id&&p._validateLayer(P)}}}}))}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.loadURL=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new u.Event("dataloading",{dataType:"style"}));var f=typeof s.validate=="boolean"?s.validate:!u.isMapboxURL(n);n=this.map._requestManager.normalizeStyleURL(n,s.accessToken);var d=this.map._requestManager.transformRequest(n,u.ResourceType.Style);this._request=u.getJSON(d,(function(y,_){p._request=null,y?p.fire(new u.ErrorEvent(y)):_&&p._load(_,f)}))},o.prototype.loadJSON=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new u.Event("dataloading",{dataType:"style"})),this._request=u.browser.frame((function(){p._request=null,p._load(n,s.validate!==!1)}))},o.prototype.loadEmpty=function(){this.fire(new u.Event("dataloading",{dataType:"style"})),this._load(Oa,!1)},o.prototype._load=function(n,s){if(!s||!co(this,u.validateStyle(n))){for(var p in this._loaded=!0,this.stylesheet=n,n.sources)this.addSource(p,n.sources[p],{validate:!1});n.sprite?this._loadSprite(n.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(n.glyphs);var f=we(this.stylesheet.layers);this._order=f.map((function(S){return S.id})),this._layers={},this._serializedLayers={};for(var d=0,y=f;d<y.length;d+=1){var _=y[d];(_=u.createStyleLayer(_)).setEventedParent(this,{layer:{id:_.id}}),this._layers[_.id]=_,this._serializedLayers[_.id]=_.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Pn(this.stylesheet.light),this.fire(new u.Event("data",{dataType:"style"})),this.fire(new u.Event("style.load"))}},o.prototype._loadSprite=function(n){var s=this;this._spriteRequest=(function(p,f,d){var y,_,S,P=u.browser.devicePixelRatio>1?"@2x":"",z=u.getJSON(f.transformRequest(f.normalizeSpriteURL(p,P,".json"),u.ResourceType.SpriteJSON),(function(O,Z){z=null,S||(S=O,y=Z,U())})),M=u.getImage(f.transformRequest(f.normalizeSpriteURL(p,P,".png"),u.ResourceType.SpriteImage),(function(O,Z){M=null,S||(S=O,_=Z,U())}));function U(){if(S)d(S);else if(y&&_){var O=u.browser.getImageData(_),Z={};for(var B in y){var q=y[B],X=q.width,Y=q.height,ne=q.x,re=q.y,oe=q.sdf,he=q.pixelRatio,xe=q.stretchX,ve=q.stretchY,Ae=q.content,Ne=new u.RGBAImage({width:X,height:Y});u.RGBAImage.copy(O,Ne,{x:ne,y:re},{x:0,y:0},{width:X,height:Y}),Z[B]={data:Ne,pixelRatio:he,sdf:oe,stretchX:xe,stretchY:ve,content:Ae}}d(null,Z)}}return{cancel:function(){z&&(z.cancel(),z=null),M&&(M.cancel(),M=null)}}})(n,this.map._requestManager,(function(p,f){if(s._spriteRequest=null,p)s.fire(new u.ErrorEvent(p));else if(f)for(var d in f)s.imageManager.addImage(d,f[d]);s.imageManager.setLoaded(!0),s._availableImages=s.imageManager.listImages(),s.dispatcher.broadcast("setImages",s._availableImages),s.fire(new u.Event("data",{dataType:"style"}))}))},o.prototype._validateLayer=function(n){var s=this.sourceCaches[n.source];if(s){var p=n.sourceLayer;if(p){var f=s.getSource();(f.type==="geojson"||f.vectorLayerIds&&f.vectorLayerIds.indexOf(p)===-1)&&this.fire(new u.ErrorEvent(new Error('Source layer "'+p+'" does not exist on source "'+f.id+'" as specified by style layer "'+n.id+'"')))}}},o.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var n in this.sourceCaches)if(!this.sourceCaches[n].loaded())return!1;return!!this.imageManager.isLoaded()},o.prototype._serializeLayers=function(n){for(var s=[],p=0,f=n;p<f.length;p+=1){var d=this._layers[f[p]];d.type!=="custom"&&s.push(d.serialize())}return s},o.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var n in this.sourceCaches)if(this.sourceCaches[n].hasTransition())return!0;for(var s in this._layers)if(this._layers[s].hasTransition())return!0;return!1},o.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},o.prototype.update=function(n){if(this._loaded){var s=this._changed;if(this._changed){var p=Object.keys(this._updatedLayers),f=Object.keys(this._removedLayers);for(var d in(p.length||f.length)&&this._updateWorkerLayers(p,f),this._updatedSources){var y=this._updatedSources[d];y==="reload"?this._reloadSource(d):y==="clear"&&this._clearSource(d)}for(var _ in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[_].updateTransitions(n);this.light.updateTransitions(n),this._resetUpdates()}var S={};for(var P in this.sourceCaches){var z=this.sourceCaches[P];S[P]=z.used,z.used=!1}for(var M=0,U=this._order;M<U.length;M+=1){var O=this._layers[U[M]];O.recalculate(n,this._availableImages),!O.isHidden(n.zoom)&&O.source&&(this.sourceCaches[O.source].used=!0)}for(var Z in S){var B=this.sourceCaches[Z];S[Z]!==B.used&&B.fire(new u.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:Z}))}this.light.recalculate(n),this.z=n.zoom,s&&this.fire(new u.Event("data",{dataType:"style"}))}},o.prototype._updateTilesForChangedImages=function(){var n=Object.keys(this._changedImages);if(n.length){for(var s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["icons","patterns"],n);this._changedImages={}}},o.prototype._updateWorkerLayers=function(n,s){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(n),removedIds:s})},o.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},o.prototype.setState=function(n){var s=this;if(this._checkLoaded(),co(this,u.validateStyle(n)))return!1;(n=u.clone$1(n)).layers=we(n.layers);var p=(function(d,y){if(!d)return[{command:Ie.setStyle,args:[y]}];var _=[];try{if(!u.deepEqual(d.version,y.version))return[{command:Ie.setStyle,args:[y]}];u.deepEqual(d.center,y.center)||_.push({command:Ie.setCenter,args:[y.center]}),u.deepEqual(d.zoom,y.zoom)||_.push({command:Ie.setZoom,args:[y.zoom]}),u.deepEqual(d.bearing,y.bearing)||_.push({command:Ie.setBearing,args:[y.bearing]}),u.deepEqual(d.pitch,y.pitch)||_.push({command:Ie.setPitch,args:[y.pitch]}),u.deepEqual(d.sprite,y.sprite)||_.push({command:Ie.setSprite,args:[y.sprite]}),u.deepEqual(d.glyphs,y.glyphs)||_.push({command:Ie.setGlyphs,args:[y.glyphs]}),u.deepEqual(d.transition,y.transition)||_.push({command:Ie.setTransition,args:[y.transition]}),u.deepEqual(d.light,y.light)||_.push({command:Ie.setLight,args:[y.light]});var S={},P=[];(function(M,U,O,Z){var B;for(B in U=U||{},M=M||{})M.hasOwnProperty(B)&&(U.hasOwnProperty(B)||Te(B,O,Z));for(B in U)U.hasOwnProperty(B)&&(M.hasOwnProperty(B)?u.deepEqual(M[B],U[B])||(M[B].type==="geojson"&&U[B].type==="geojson"&&Lt(M,U,B)?O.push({command:Ie.setGeoJSONSourceData,args:[B,U[B].data]}):gt(B,U,O,Z)):lt(B,U,O))})(d.sources,y.sources,P,S);var z=[];d.layers&&d.layers.forEach((function(M){S[M.source]?_.push({command:Ie.removeLayer,args:[M.id]}):z.push(M)})),_=_.concat(P),(function(M,U,O){U=U||[];var Z,B,q,X,Y,ne,re,oe=(M=M||[]).map(Et),he=U.map(Et),xe=M.reduce(_t,{}),ve=U.reduce(_t,{}),Ae=oe.slice(),Ne=Object.create(null);for(Z=0,B=0;Z<oe.length;Z++)ve.hasOwnProperty(q=oe[Z])?B++:(O.push({command:Ie.removeLayer,args:[q]}),Ae.splice(Ae.indexOf(q,B),1));for(Z=0,B=0;Z<he.length;Z++)Ae[Ae.length-1-Z]!==(q=he[he.length-1-Z])&&(xe.hasOwnProperty(q)?(O.push({command:Ie.removeLayer,args:[q]}),Ae.splice(Ae.lastIndexOf(q,Ae.length-B),1)):B++,O.push({command:Ie.addLayer,args:[ve[q],ne=Ae[Ae.length-Z]]}),Ae.splice(Ae.length-Z,0,q),Ne[q]=!0);for(Z=0;Z<he.length;Z++)if(X=xe[q=he[Z]],Y=ve[q],!Ne[q]&&!u.deepEqual(X,Y))if(u.deepEqual(X.source,Y.source)&&u.deepEqual(X["source-layer"],Y["source-layer"])&&u.deepEqual(X.type,Y.type)){for(re in pt(X.layout,Y.layout,O,q,null,Ie.setLayoutProperty),pt(X.paint,Y.paint,O,q,null,Ie.setPaintProperty),u.deepEqual(X.filter,Y.filter)||O.push({command:Ie.setFilter,args:[q,Y.filter]}),u.deepEqual(X.minzoom,Y.minzoom)&&u.deepEqual(X.maxzoom,Y.maxzoom)||O.push({command:Ie.setLayerZoomRange,args:[q,Y.minzoom,Y.maxzoom]}),X)X.hasOwnProperty(re)&&re!=="layout"&&re!=="paint"&&re!=="filter"&&re!=="metadata"&&re!=="minzoom"&&re!=="maxzoom"&&(re.indexOf("paint.")===0?pt(X[re],Y[re],O,q,re.slice(6),Ie.setPaintProperty):u.deepEqual(X[re],Y[re])||O.push({command:Ie.setLayerProperty,args:[q,re,Y[re]]}));for(re in Y)Y.hasOwnProperty(re)&&!X.hasOwnProperty(re)&&re!=="layout"&&re!=="paint"&&re!=="filter"&&re!=="metadata"&&re!=="minzoom"&&re!=="maxzoom"&&(re.indexOf("paint.")===0?pt(X[re],Y[re],O,q,re.slice(6),Ie.setPaintProperty):u.deepEqual(X[re],Y[re])||O.push({command:Ie.setLayerProperty,args:[q,re,Y[re]]}))}else O.push({command:Ie.removeLayer,args:[q]}),ne=Ae[Ae.lastIndexOf(q)+1],O.push({command:Ie.addLayer,args:[Y,ne]})})(z,y.layers,_)}catch(M){console.warn("Unable to compute style diff:",M),_=[{command:Ie.setStyle,args:[y]}]}return _})(this.serialize(),n).filter((function(d){return!(d.command in Vn)}));if(p.length===0)return!1;var f=p.filter((function(d){return!(d.command in On)}));if(f.length>0)throw new Error("Unimplemented: "+f.map((function(d){return d.command})).join(", ")+".");return p.forEach((function(d){d.command!=="setTransition"&&s[d.command].apply(s,d.args)})),this.stylesheet=n,!0},o.prototype.addImage=function(n,s){if(this.getImage(n))return this.fire(new u.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(n,s),this._afterImageUpdated(n)},o.prototype.updateImage=function(n,s){this.imageManager.updateImage(n,s)},o.prototype.getImage=function(n){return this.imageManager.getImage(n)},o.prototype.removeImage=function(n){if(!this.getImage(n))return this.fire(new u.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(n),this._afterImageUpdated(n)},o.prototype._afterImageUpdated=function(n){this._availableImages=this.imageManager.listImages(),this._changedImages[n]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.Event("data",{dataType:"style"}))},o.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},o.prototype.addSource=function(n,s,p){var f=this;if(p===void 0&&(p={}),this._checkLoaded(),this.sourceCaches[n]!==void 0)throw new Error("There is already a source with this ID");if(!s.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(s).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(s.type)>=0&&this._validate(u.validateStyle.source,"sources."+n,s,null,p))){this.map&&this.map._collectResourceTiming&&(s.collectResourceTiming=!0);var d=this.sourceCaches[n]=new N(n,s,this.dispatcher);d.style=this,d.setEventedParent(this,(function(){return{isSourceLoaded:f.loaded(),source:d.serialize(),sourceId:n}})),d.onAdd(this.map),this._changed=!0}},o.prototype.removeSource=function(n){if(this._checkLoaded(),this.sourceCaches[n]===void 0)throw new Error("There is no source with this ID");for(var s in this._layers)if(this._layers[s].source===n)return this.fire(new u.ErrorEvent(new Error('Source "'+n+'" cannot be removed while layer "'+s+'" is using it.')));var p=this.sourceCaches[n];delete this.sourceCaches[n],delete this._updatedSources[n],p.fire(new u.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:n})),p.setEventedParent(null),p.clearTiles(),p.onRemove&&p.onRemove(this.map),this._changed=!0},o.prototype.setGeoJSONSourceData=function(n,s){this._checkLoaded(),this.sourceCaches[n].getSource().setData(s),this._changed=!0},o.prototype.getSource=function(n){return this.sourceCaches[n]&&this.sourceCaches[n].getSource()},o.prototype.addLayer=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var f=n.id;if(this.getLayer(f))this.fire(new u.ErrorEvent(new Error('Layer with id "'+f+'" already exists on this map')));else{var d;if(n.type==="custom"){if(co(this,u.validateCustomStyleLayer(n)))return;d=u.createStyleLayer(n)}else{if(typeof n.source=="object"&&(this.addSource(f,n.source),n=u.clone$1(n),n=u.extend(n,{source:f})),this._validate(u.validateStyle.layer,"layers."+f,n,{arrayIndex:-1},p))return;d=u.createStyleLayer(n),this._validateLayer(d),d.setEventedParent(this,{layer:{id:f}}),this._serializedLayers[d.id]=d.serialize()}var y=s?this._order.indexOf(s):this._order.length;if(s&&y===-1)this.fire(new u.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.')));else{if(this._order.splice(y,0,f),this._layerOrderChanged=!0,this._layers[f]=d,this._removedLayers[f]&&d.source&&d.type!=="custom"){var _=this._removedLayers[f];delete this._removedLayers[f],_.type!==d.type?this._updatedSources[d.source]="clear":(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause())}this._updateLayer(d),d.onAdd&&d.onAdd(this.map)}}},o.prototype.moveLayer=function(n,s){if(this._checkLoaded(),this._changed=!0,this._layers[n]){if(n!==s){var p=this._order.indexOf(n);this._order.splice(p,1);var f=s?this._order.indexOf(s):this._order.length;s&&f===-1?this.fire(new u.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.'))):(this._order.splice(f,0,n),this._layerOrderChanged=!0)}}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be moved.")))},o.prototype.removeLayer=function(n){this._checkLoaded();var s=this._layers[n];if(s){s.setEventedParent(null);var p=this._order.indexOf(n);this._order.splice(p,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[n]=s,delete this._layers[n],delete this._serializedLayers[n],delete this._updatedLayers[n],delete this._updatedPaintProps[n],s.onRemove&&s.onRemove(this.map)}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be removed.")))},o.prototype.getLayer=function(n){return this._layers[n]},o.prototype.hasLayer=function(n){return n in this._layers},o.prototype.setLayerZoomRange=function(n,s,p){this._checkLoaded();var f=this.getLayer(n);f?f.minzoom===s&&f.maxzoom===p||(s!=null&&(f.minzoom=s),p!=null&&(f.maxzoom=p),this._updateLayer(f)):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot have zoom extent.")))},o.prototype.setFilter=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var f=this.getLayer(n);if(f){if(!u.deepEqual(f.filter,s))return s==null?(f.filter=void 0,void this._updateLayer(f)):void(this._validate(u.validateStyle.filter,"layers."+f.id+".filter",s,null,p)||(f.filter=u.clone$1(s),this._updateLayer(f)))}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be filtered.")))},o.prototype.getFilter=function(n){return u.clone$1(this.getLayer(n).filter)},o.prototype.setLayoutProperty=function(n,s,p,f){f===void 0&&(f={}),this._checkLoaded();var d=this.getLayer(n);d?u.deepEqual(d.getLayoutProperty(s),p)||(d.setLayoutProperty(s,p,f),this._updateLayer(d)):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getLayoutProperty=function(n,s){var p=this.getLayer(n);if(p)return p.getLayoutProperty(s);this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style.")))},o.prototype.setPaintProperty=function(n,s,p,f){f===void 0&&(f={}),this._checkLoaded();var d=this.getLayer(n);d?u.deepEqual(d.getPaintProperty(s),p)||(d.setPaintProperty(s,p,f)&&this._updateLayer(d),this._changed=!0,this._updatedPaintProps[n]=!0):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getPaintProperty=function(n,s){return this.getLayer(n).getPaintProperty(s)},o.prototype.setFeatureState=function(n,s){this._checkLoaded();var p=n.source,f=n.sourceLayer,d=this.sourceCaches[p];if(d!==void 0){var y=d.getSource().type;y==="geojson"&&f?this.fire(new u.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):y!=="vector"||f?(n.id===void 0&&this.fire(new u.ErrorEvent(new Error("The feature id parameter must be provided."))),d.setFeatureState(f,n.id,s)):this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.removeFeatureState=function(n,s){this._checkLoaded();var p=n.source,f=this.sourceCaches[p];if(f!==void 0){var d=f.getSource().type,y=d==="vector"?n.sourceLayer:void 0;d!=="vector"||y?s&&typeof n.id!="string"&&typeof n.id!="number"?this.fire(new u.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):f.removeFeatureState(y,n.id,s):this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.getFeatureState=function(n){this._checkLoaded();var s=n.source,p=n.sourceLayer,f=this.sourceCaches[s];if(f!==void 0){if(f.getSource().type!=="vector"||p)return n.id===void 0&&this.fire(new u.ErrorEvent(new Error("The feature id parameter must be provided."))),f.getFeatureState(p,n.id);this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+s+"' does not exist in the map's style.")))},o.prototype.getTransition=function(){return u.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},o.prototype.serialize=function(){return u.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:u.mapObject(this.sourceCaches,(function(n){return n.serialize()})),layers:this._serializeLayers(this._order)},(function(n){return n!==void 0}))},o.prototype._updateLayer=function(n){this._updatedLayers[n.id]=!0,n.source&&!this._updatedSources[n.source]&&this.sourceCaches[n.source].getSource().type!=="raster"&&(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause()),this._changed=!0},o.prototype._flattenAndSortRenderedFeatures=function(n){for(var s=this,p=function(xe){return s._layers[xe].type==="fill-extrusion"},f={},d=[],y=this._order.length-1;y>=0;y--){var _=this._order[y];if(p(_)){f[_]=y;for(var S=0,P=n;S<P.length;S+=1){var z=P[S][_];if(z)for(var M=0,U=z;M<U.length;M+=1)d.push(U[M])}}}d.sort((function(xe,ve){return ve.intersectionZ-xe.intersectionZ}));for(var O=[],Z=this._order.length-1;Z>=0;Z--){var B=this._order[Z];if(p(B))for(var q=d.length-1;q>=0;q--){var X=d[q].feature;if(f[X.layer.id]<Z)break;O.push(X),d.pop()}else for(var Y=0,ne=n;Y<ne.length;Y+=1){var re=ne[Y][B];if(re)for(var oe=0,he=re;oe<he.length;oe+=1)O.push(he[oe].feature)}}return O},o.prototype.queryRenderedFeatures=function(n,s,p){s&&s.filter&&this._validate(u.validateStyle.filter,"queryRenderedFeatures.filter",s.filter,null,s);var f={};if(s&&s.layers){if(!Array.isArray(s.layers))return this.fire(new u.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var d=0,y=s.layers;d<y.length;d+=1){var _=y[d],S=this._layers[_];if(!S)return this.fire(new u.ErrorEvent(new Error("The layer '"+_+"' does not exist in the map's style and cannot be queried for features."))),[];f[S.source]=!0}}var P=[];for(var z in s.availableImages=this._availableImages,this.sourceCaches)s.layers&&!f[z]||P.push(Kt(this.sourceCaches[z],this._layers,this._serializedLayers,n,s,p));return this.placement&&P.push((function(M,U,O,Z,B,q,X){for(var Y={},ne=q.queryRenderedSymbols(Z),re=[],oe=0,he=Object.keys(ne).map(Number);oe<he.length;oe+=1)re.push(X[he[oe]]);re.sort(Ir);for(var xe=function(){var Xe=Ae[ve],bt=Xe.featureIndex.lookupSymbolFeatures(ne[Xe.bucketInstanceId],U,Xe.bucketIndex,Xe.sourceLayerIndex,B.filter,B.layers,B.availableImages,M);for(var ze in bt){var tt=Y[ze]=Y[ze]||[],at=bt[ze];at.sort((function(nt,Ye){var Ke=Xe.featureSortOrder;if(Ke){var kr=Ke.indexOf(nt.featureIndex);return Ke.indexOf(Ye.featureIndex)-kr}return Ye.featureIndex-nt.featureIndex}));for(var Qe=0,$e=at;Qe<$e.length;Qe+=1)tt.push($e[Qe])}},ve=0,Ae=re;ve<Ae.length;ve+=1)xe();var Ne=function(Xe){Y[Xe].forEach((function(bt){var ze=bt.feature,tt=O[M[Xe].source].getFeatureState(ze.layer["source-layer"],ze.id);ze.source=ze.layer.source,ze.layer["source-layer"]&&(ze.sourceLayer=ze.layer["source-layer"]),ze.state=tt}))};for(var He in Y)Ne(He);return Y})(this._layers,this._serializedLayers,this.sourceCaches,n,s,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(P)},o.prototype.querySourceFeatures=function(n,s){s&&s.filter&&this._validate(u.validateStyle.filter,"querySourceFeatures.filter",s.filter,null,s);var p=this.sourceCaches[n];return p?(function(f,d){for(var y=f.getRenderableIds().map((function(U){return f.getTileByID(U)})),_=[],S={},P=0;P<y.length;P++){var z=y[P],M=z.tileID.canonical.key;S[M]||(S[M]=!0,z.querySourceFeatures(_,d))}return _})(p,s):[]},o.prototype.addSourceType=function(n,s,p){return o.getSourceType(n)?p(new Error('A source type called "'+n+'" already exists.')):(o.setSourceType(n,s),s.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:n,url:s.workerSourceURL},p):p(null,null))},o.prototype.getLight=function(){return this.light.getLight()},o.prototype.setLight=function(n,s){s===void 0&&(s={}),this._checkLoaded();var p=this.light.getLight(),f=!1;for(var d in n)if(!u.deepEqual(n[d],p[d])){f=!0;break}if(f){var y={now:u.browser.now(),transition:u.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(n,s),this.light.updateTransitions(y)}},o.prototype._validate=function(n,s,p,f,d){return d===void 0&&(d={}),(!d||d.validate!==!1)&&co(this,n.call(u.validateStyle,u.extend({key:s,style:this.serialize(),value:p,styleSpec:u.styleSpec},f)))},o.prototype._remove=function(){for(var n in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),u.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[n].setEventedParent(null);for(var s in this.sourceCaches)this.sourceCaches[s].clearTiles(),this.sourceCaches[s].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},o.prototype._clearSource=function(n){this.sourceCaches[n].clearTiles()},o.prototype._reloadSource=function(n){this.sourceCaches[n].resume(),this.sourceCaches[n].reload()},o.prototype._updateSources=function(n){for(var s in this.sourceCaches)this.sourceCaches[s].update(n)},o.prototype._generateCollisionBoxes=function(){for(var n in this.sourceCaches)this._reloadSource(n)},o.prototype._updatePlacement=function(n,s,p,f,d){d===void 0&&(d=!1);for(var y=!1,_=!1,S={},P=0,z=this._order;P<z.length;P+=1){var M=this._layers[z[P]];if(M.type==="symbol"){if(!S[M.source]){var U=this.sourceCaches[M.source];S[M.source]=U.getRenderableIds(!0).map((function(X){return U.getTileByID(X)})).sort((function(X,Y){return Y.tileID.overscaledZ-X.tileID.overscaledZ||(X.tileID.isLessThan(Y.tileID)?-1:1)}))}var O=this.crossTileSymbolIndex.addLayer(M,S[M.source],n.center.lng);y=y||O}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((d=d||this._layerOrderChanged||p===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(u.browser.now(),n.zoom))&&(this.pauseablePlacement=new sa(n,this._order,d,s,p,f,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,S),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(u.browser.now()),_=!0),y&&this.pauseablePlacement.placement.setStale()),_||y)for(var Z=0,B=this._order;Z<B.length;Z+=1){var q=this._layers[B[Z]];q.type==="symbol"&&this.placement.updateLayerOpacities(q,S[q.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(u.browser.now())},o.prototype._releaseSymbolFadeTiles=function(){for(var n in this.sourceCaches)this.sourceCaches[n].releaseSymbolFadeTiles()},o.prototype.getImages=function(n,s,p){this.imageManager.getImages(s.icons,p),this._updateTilesForChangedImages();var f=this.sourceCaches[s.source];f&&f.setDependencies(s.tileID.key,s.type,s.icons)},o.prototype.getGlyphs=function(n,s,p){this.glyphManager.getGlyphs(s.stacks,p)},o.prototype.getResource=function(n,s,p){return u.makeRequest(s,p)},o})(u.Evented);mi.getSourceType=function(i){return Wi[i]},mi.setSourceType=function(i,o){Wi[i]=o},mi.registerForPluginStateChange=u.registerForPluginStateChange;var fr=u.createLayout([{name:"a_pos",type:"Int16",components:2}]),Vo=Bt(`#ifdef GL_ES
|
|
2
2
|
precision mediump float;
|
|
3
3
|
#else
|
|
4
4
|
#if !defined(lowp)
|
|
@@ -24,15 +24,15 @@ precision highp float;
|
|
|
24
24
|
#endif
|
|
25
25
|
#endif
|
|
26
26
|
vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
|
|
27
|
-
);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}`),
|
|
27
|
+
);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}`),Ll=Bt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
|
|
28
28
|
#ifdef OVERDRAW_INSPECTOR
|
|
29
29
|
gl_FragColor=vec4(1.0);
|
|
30
30
|
#endif
|
|
31
|
-
}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),
|
|
31
|
+
}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Ju=Bt(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
|
|
32
32
|
#ifdef OVERDRAW_INSPECTOR
|
|
33
33
|
gl_FragColor=vec4(1.0);
|
|
34
34
|
#endif
|
|
35
|
-
}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),
|
|
35
|
+
}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),Yu=Bt(`varying vec3 v_data;
|
|
36
36
|
#pragma mapbox: define highp vec4 color
|
|
37
37
|
#pragma mapbox: define mediump float radius
|
|
38
38
|
#pragma mapbox: define lowp float blur
|
|
@@ -68,7 +68,7 @@ void main(void) {
|
|
|
68
68
|
#pragma mapbox: initialize highp vec4 stroke_color
|
|
69
69
|
#pragma mapbox: initialize mediump float stroke_width
|
|
70
70
|
#pragma mapbox: initialize lowp float stroke_opacity
|
|
71
|
-
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),
|
|
71
|
+
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),Bs=Bt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Rs=Bt(`uniform highp float u_intensity;varying vec2 v_extrude;
|
|
72
72
|
#pragma mapbox: define highp float weight
|
|
73
73
|
#define GAUSS_COEF 0.3989422804014327
|
|
74
74
|
void main() {
|
|
@@ -85,11 +85,11 @@ const highp float ZERO=1.0/255.0/16.0;
|
|
|
85
85
|
void main(void) {
|
|
86
86
|
#pragma mapbox: initialize highp float weight
|
|
87
87
|
#pragma mapbox: initialize mediump float radius
|
|
88
|
-
vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),
|
|
88
|
+
vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),Fs=Bt(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
|
|
89
89
|
#ifdef OVERDRAW_INSPECTOR
|
|
90
90
|
gl_FragColor=vec4(0.0);
|
|
91
91
|
#endif
|
|
92
|
-
}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),
|
|
92
|
+
}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),Os=Bt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),Bl=Bt("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),Rl=Bt("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),$u=Bt(`#pragma mapbox: define highp vec4 color
|
|
93
93
|
#pragma mapbox: define lowp float opacity
|
|
94
94
|
void main() {
|
|
95
95
|
#pragma mapbox: initialize highp vec4 color
|
|
@@ -104,7 +104,7 @@ gl_FragColor=vec4(1.0);
|
|
|
104
104
|
void main() {
|
|
105
105
|
#pragma mapbox: initialize highp vec4 color
|
|
106
106
|
#pragma mapbox: initialize lowp float opacity
|
|
107
|
-
gl_Position=u_matrix*vec4(a_pos,0,1);}`),
|
|
107
|
+
gl_Position=u_matrix*vec4(a_pos,0,1);}`),la=Bt(`varying vec2 v_pos;
|
|
108
108
|
#pragma mapbox: define highp vec4 outline_color
|
|
109
109
|
#pragma mapbox: define lowp float opacity
|
|
110
110
|
void main() {
|
|
@@ -120,7 +120,7 @@ gl_FragColor=vec4(1.0);
|
|
|
120
120
|
void main() {
|
|
121
121
|
#pragma mapbox: initialize highp vec4 outline_color
|
|
122
122
|
#pragma mapbox: initialize lowp float opacity
|
|
123
|
-
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),
|
|
123
|
+
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),ua=Bt(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
|
|
124
124
|
#pragma mapbox: define lowp float opacity
|
|
125
125
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
126
126
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
@@ -144,7 +144,7 @@ void main() {
|
|
|
144
144
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
145
145
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
146
146
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
147
|
-
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),
|
|
147
|
+
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),Fl=Bt(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
|
148
148
|
#pragma mapbox: define lowp float opacity
|
|
149
149
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
150
150
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
@@ -168,7 +168,7 @@ void main() {
|
|
|
168
168
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
169
169
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
170
170
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
171
|
-
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),
|
|
171
|
+
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),jr=Bt(`varying vec4 v_color;void main() {gl_FragColor=v_color;
|
|
172
172
|
#ifdef OVERDRAW_INSPECTOR
|
|
173
173
|
gl_FragColor=vec4(1.0);
|
|
174
174
|
#endif
|
|
@@ -180,7 +180,7 @@ void main() {
|
|
|
180
180
|
#pragma mapbox: initialize highp float base
|
|
181
181
|
#pragma mapbox: initialize highp float height
|
|
182
182
|
#pragma mapbox: initialize highp vec4 color
|
|
183
|
-
vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),
|
|
183
|
+
vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),Vs=Bt(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
|
184
184
|
#pragma mapbox: define lowp float base
|
|
185
185
|
#pragma mapbox: define lowp float height
|
|
186
186
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
@@ -214,20 +214,20 @@ void main() {
|
|
|
214
214
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
215
215
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
|
|
216
216
|
? a_pos
|
|
217
|
-
: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),
|
|
217
|
+
: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),Un=Bt(`#ifdef GL_ES
|
|
218
218
|
precision highp float;
|
|
219
219
|
#endif
|
|
220
220
|
uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
|
|
221
221
|
#ifdef OVERDRAW_INSPECTOR
|
|
222
222
|
gl_FragColor=vec4(1.0);
|
|
223
223
|
#endif
|
|
224
|
-
}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),
|
|
224
|
+
}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),Nn=Bt(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;
|
|
225
225
|
#define PI 3.141592653589793
|
|
226
226
|
void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
|
|
227
227
|
#ifdef OVERDRAW_INSPECTOR
|
|
228
228
|
gl_FragColor=vec4(1.0);
|
|
229
229
|
#endif
|
|
230
|
-
}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),
|
|
230
|
+
}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),po=Bt(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
|
|
231
231
|
#pragma mapbox: define highp vec4 color
|
|
232
232
|
#pragma mapbox: define lowp float blur
|
|
233
233
|
#pragma mapbox: define lowp float opacity
|
|
@@ -255,7 +255,7 @@ void main() {
|
|
|
255
255
|
#pragma mapbox: initialize mediump float gapwidth
|
|
256
256
|
#pragma mapbox: initialize lowp float offset
|
|
257
257
|
#pragma mapbox: initialize mediump float width
|
|
258
|
-
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),
|
|
258
|
+
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),ho=Bt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
|
|
259
259
|
#pragma mapbox: define lowp float blur
|
|
260
260
|
#pragma mapbox: define lowp float opacity
|
|
261
261
|
void main() {
|
|
@@ -279,7 +279,7 @@ void main() {
|
|
|
279
279
|
#pragma mapbox: initialize mediump float gapwidth
|
|
280
280
|
#pragma mapbox: initialize lowp float offset
|
|
281
281
|
#pragma mapbox: initialize mediump float width
|
|
282
|
-
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),
|
|
282
|
+
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),jn=Bt(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
|
283
283
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
284
284
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
285
285
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
@@ -322,7 +322,7 @@ void main() {
|
|
|
322
322
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
323
323
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
324
324
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
325
|
-
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),
|
|
325
|
+
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),fo=Bt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
|
326
326
|
#pragma mapbox: define highp vec4 color
|
|
327
327
|
#pragma mapbox: define lowp float blur
|
|
328
328
|
#pragma mapbox: define lowp float opacity
|
|
@@ -357,11 +357,11 @@ void main() {
|
|
|
357
357
|
#pragma mapbox: initialize lowp float offset
|
|
358
358
|
#pragma mapbox: initialize mediump float width
|
|
359
359
|
#pragma mapbox: initialize lowp float floorwidth
|
|
360
|
-
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),
|
|
360
|
+
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),mo=Bt(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
|
|
361
361
|
#ifdef OVERDRAW_INSPECTOR
|
|
362
362
|
gl_FragColor=vec4(1.0);
|
|
363
363
|
#endif
|
|
364
|
-
}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),
|
|
364
|
+
}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),qn=Bt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
|
|
365
365
|
#pragma mapbox: define lowp float opacity
|
|
366
366
|
void main() {
|
|
367
367
|
#pragma mapbox: initialize lowp float opacity
|
|
@@ -375,7 +375,7 @@ void main() {
|
|
|
375
375
|
#pragma mapbox: initialize lowp float opacity
|
|
376
376
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
377
377
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
378
|
-
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`),
|
|
378
|
+
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`),Ol=Bt(`#define SDF_PX 8.0
|
|
379
379
|
uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
|
|
380
380
|
#pragma mapbox: define highp vec4 fill_color
|
|
381
381
|
#pragma mapbox: define highp vec4 halo_color
|
|
@@ -406,7 +406,7 @@ void main() {
|
|
|
406
406
|
#pragma mapbox: initialize lowp float halo_blur
|
|
407
407
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
408
408
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
409
|
-
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),
|
|
409
|
+
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),Vl=Bt(`#define SDF_PX 8.0
|
|
410
410
|
#define SDF 1.0
|
|
411
411
|
#define ICON 0.0
|
|
412
412
|
uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
|
|
@@ -443,66 +443,63 @@ void main() {
|
|
|
443
443
|
#pragma mapbox: initialize lowp float halo_blur
|
|
444
444
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
445
445
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
446
|
-
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`);function
|
|
447
|
-
#ifndef HAS_UNIFORM_u_`+
|
|
448
|
-
varying `+
|
|
446
|
+
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`);function Bt(i,o){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=o.match(/attribute ([\w]+) ([\w]+)/g),p=i.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),f=o.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),d=f?f.concat(p):p,y={};return{fragmentSource:i=i.replace(n,(function(_,S,P,z,M){return y[M]=!0,S==="define"?`
|
|
447
|
+
#ifndef HAS_UNIFORM_u_`+M+`
|
|
448
|
+
varying `+P+" "+z+" "+M+`;
|
|
449
449
|
#else
|
|
450
|
-
uniform `+
|
|
450
|
+
uniform `+P+" "+z+" u_"+M+`;
|
|
451
451
|
#endif
|
|
452
452
|
`:`
|
|
453
|
-
#ifdef HAS_UNIFORM_u_`+
|
|
454
|
-
`+
|
|
455
|
-
#endif
|
|
456
|
-
`})),vertexSource:o=o.replace(n,(function(
|
|
457
|
-
#ifndef HAS_UNIFORM_u_`+
|
|
458
|
-
uniform lowp float u_`+
|
|
459
|
-
attribute `+
|
|
460
|
-
varying `+
|
|
453
|
+
#ifdef HAS_UNIFORM_u_`+M+`
|
|
454
|
+
`+P+" "+z+" "+M+" = u_"+M+`;
|
|
455
|
+
#endif
|
|
456
|
+
`})),vertexSource:o=o.replace(n,(function(_,S,P,z,M){var U=z==="float"?"vec2":"vec4",O=M.match(/color/)?"color":U;return y[M]?S==="define"?`
|
|
457
|
+
#ifndef HAS_UNIFORM_u_`+M+`
|
|
458
|
+
uniform lowp float u_`+M+`_t;
|
|
459
|
+
attribute `+P+" "+U+" a_"+M+`;
|
|
460
|
+
varying `+P+" "+z+" "+M+`;
|
|
461
461
|
#else
|
|
462
|
-
uniform `+
|
|
462
|
+
uniform `+P+" "+z+" u_"+M+`;
|
|
463
463
|
#endif
|
|
464
|
-
`:
|
|
465
|
-
#ifndef HAS_UNIFORM_u_`+
|
|
466
|
-
`+
|
|
464
|
+
`:O==="vec4"?`
|
|
465
|
+
#ifndef HAS_UNIFORM_u_`+M+`
|
|
466
|
+
`+M+" = a_"+M+`;
|
|
467
467
|
#else
|
|
468
|
-
`+
|
|
468
|
+
`+P+" "+z+" "+M+" = u_"+M+`;
|
|
469
469
|
#endif
|
|
470
470
|
`:`
|
|
471
|
-
#ifndef HAS_UNIFORM_u_`+
|
|
472
|
-
`+
|
|
471
|
+
#ifndef HAS_UNIFORM_u_`+M+`
|
|
472
|
+
`+M+" = unpack_mix_"+O+"(a_"+M+", u_"+M+`_t);
|
|
473
473
|
#else
|
|
474
|
-
`+
|
|
474
|
+
`+P+" "+z+" "+M+" = u_"+M+`;
|
|
475
475
|
#endif
|
|
476
|
-
`:
|
|
477
|
-
#ifndef HAS_UNIFORM_u_`+
|
|
478
|
-
uniform lowp float u_`+
|
|
479
|
-
attribute `+
|
|
476
|
+
`:S==="define"?`
|
|
477
|
+
#ifndef HAS_UNIFORM_u_`+M+`
|
|
478
|
+
uniform lowp float u_`+M+`_t;
|
|
479
|
+
attribute `+P+" "+U+" a_"+M+`;
|
|
480
480
|
#else
|
|
481
|
-
uniform `+
|
|
481
|
+
uniform `+P+" "+z+" u_"+M+`;
|
|
482
482
|
#endif
|
|
483
|
-
`:
|
|
484
|
-
#ifndef HAS_UNIFORM_u_`+
|
|
485
|
-
`+
|
|
483
|
+
`:O==="vec4"?`
|
|
484
|
+
#ifndef HAS_UNIFORM_u_`+M+`
|
|
485
|
+
`+P+" "+z+" "+M+" = a_"+M+`;
|
|
486
486
|
#else
|
|
487
|
-
`+
|
|
487
|
+
`+P+" "+z+" "+M+" = u_"+M+`;
|
|
488
488
|
#endif
|
|
489
489
|
`:`
|
|
490
|
-
#ifndef HAS_UNIFORM_u_`+
|
|
491
|
-
`+
|
|
490
|
+
#ifndef HAS_UNIFORM_u_`+M+`
|
|
491
|
+
`+P+" "+z+" "+M+" = unpack_mix_"+O+"(a_"+M+", u_"+M+`_t);
|
|
492
492
|
#else
|
|
493
|
-
`+
|
|
494
|
-
#endif
|
|
495
|
-
`})),staticAttributes:s,staticUniforms:d}}var
|
|
496
|
-
`),
|
|
497
|
-
`),ue=d.createShader(d.FRAGMENT_SHADER);if(d.isContextLost())this.failedToCreate=!0;else{d.shaderSource(ue,Q),d.compileShader(ue),d.attachShader(this.program,ue);var me=d.createShader(d.VERTEX_SHADER);if(d.isContextLost())this.failedToCreate=!0;else{d.shaderSource(me,ne),d.compileShader(me),d.attachShader(this.program,me),this.attributes={};var pe={};this.numAttributes=A.length;for(var ve=0;ve<this.numAttributes;ve++)A[ve]&&(d.bindAttribLocation(this.program,ve,A[ve]),this.attributes[A[ve]]=ve);d.linkProgram(this.program),d.deleteShader(me),d.deleteShader(ue);for(var Te=0;Te<O.length;Te++){var ke=O[Te];if(ke&&!pe[ke]){var Ce=d.getUniformLocation(this.program,ke);Ce&&(pe[ke]=Ce)}}this.fixedUniforms=p(i,pe),this.binderUniforms=s?s.getUniforms(i,pe):[]}}};function _l(i,o,n){var s=1/yr(n,1,o.transform.tileZoom),p=Math.pow(2,n.tileID.overscaledZ),f=n.tileSize*Math.pow(2,o.transform.tileZoom)/p,d=f*(n.tileID.canonical.x+n.tileID.wrap*p),v=f*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,i.fromScale,i.toScale],u_fade:i.t,u_pixel_coord_upper:[d>>16,v>>16],u_pixel_coord_lower:[65535&d,65535&v]}}gl.prototype.draw=function(i,o,n,s,p,f,d,v,w,A,R,F,O,W,Z,ee){var N,Q=i.gl;if(!this.failedToCreate){for(var ne in i.program.set(this.program),i.setDepthMode(n),i.setStencilMode(s),i.setColorMode(p),i.setCullFace(f),this.fixedUniforms)this.fixedUniforms[ne].set(d[ne]);W&&W.setUniforms(i,this.binderUniforms,F,{zoom:O});for(var ue=(N={},N[Q.LINES]=2,N[Q.TRIANGLES]=3,N[Q.LINE_STRIP]=1,N)[o],me=0,pe=R.get();me<pe.length;me+=1){var ve=pe[me],Te=ve.vaos||(ve.vaos={});(Te[v]||(Te[v]=new ts)).bind(i,this,w,W?W.getPaintVertexBuffers():[],A,ve.vertexOffset,Z,ee),Q.drawElements(o,ve.primitiveLength*ue,Q.UNSIGNED_SHORT,ve.primitiveOffset*ue*2)}}};var xl=function(i,o,n,s){var p=o.style.light,f=p.properties.get("position"),d=[f.x,f.y,f.z],v=u.create$1();p.properties.get("anchor")==="viewport"&&u.fromRotation(v,-o.transform.angle),u.transformMat3(d,d,v);var w=p.properties.get("color");return{u_matrix:i,u_lightpos:d,u_lightintensity:p.properties.get("intensity"),u_lightcolor:[w.r,w.g,w.b],u_vertical_gradient:+n,u_opacity:s}},So=function(i,o,n,s,p,f,d){return u.extend(xl(i,o,n,s),_l(f,o,d),{u_height_factor:-Math.pow(2,p.overscaledZ)/d.tileSize/8})},Yn=function(i){return{u_matrix:i}},Io=function(i,o,n,s){return u.extend(Yn(i),_l(n,o,s))},bl=function(i,o){return{u_matrix:i,u_world:o}},wl=function(i,o,n,s,p){return u.extend(Io(i,o,n,s),{u_world:p})},cu=function(i,o,n,s){var p,f,d=i.transform;if(s.paint.get("circle-pitch-alignment")==="map"){var v=yr(n,1,d.zoom);p=!0,f=[v,v]}else p=!1,f=d.pixelsToGLUnits;return{u_camera_to_center_distance:d.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_matrix:i.translatePosMatrix(o.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+p,u_device_pixel_ratio:u.browser.devicePixelRatio,u_extrude_scale:f}},To=function(i,o,n){var s=yr(n,1,o.zoom),p=Math.pow(2,o.zoom-n.tileID.overscaledZ),f=n.tileID.overscaleFactor();return{u_matrix:i,u_camera_to_center_distance:o.cameraToCenterDistance,u_pixels_to_tile_units:s,u_extrude_scale:[o.pixelsToGLUnits[0]/(s*p),o.pixelsToGLUnits[1]/(s*p)],u_overscale_factor:f}},Sl=function(i,o,n){return{u_matrix:i,u_inv_matrix:o,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}},Ao=function(i,o,n){return n===void 0&&(n=1),{u_matrix:i,u_color:o,u_overlay:0,u_overlay_scale:n}},Eo=function(i){return{u_matrix:i}},Il=function(i,o,n,s){return{u_matrix:i,u_extrude_scale:yr(o,1,n),u_intensity:s}},ba=function(i,o,n){var s=i.transform;return{u_matrix:Tl(i,o,n),u_ratio:1/yr(o,1,s.zoom),u_device_pixel_ratio:u.browser.devicePixelRatio,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]]}},ur=function(i,o,n,s){return u.extend(ba(i,o,n),{u_image:0,u_image_height:s})},rs=function(i,o,n,s){var p=i.transform,f=Xo(o,p);return{u_matrix:Tl(i,o,n),u_texsize:o.imageAtlasTexture.size,u_ratio:1/yr(o,1,p.zoom),u_device_pixel_ratio:u.browser.devicePixelRatio,u_image:0,u_scale:[f,s.fromScale,s.toScale],u_fade:s.t,u_units_to_pixels:[1/p.pixelsToGLUnits[0],1/p.pixelsToGLUnits[1]]}},Fc=function(i,o,n,s,p){var f=i.lineAtlas,d=Xo(o,i.transform),v=n.layout.get("line-cap")==="round",w=f.getDash(s.from,v),A=f.getDash(s.to,v),R=w.width*p.fromScale,F=A.width*p.toScale;return u.extend(ba(i,o,n),{u_patternscale_a:[d/R,-w.height/2],u_patternscale_b:[d/F,-A.height/2],u_sdfgamma:f.width/(256*Math.min(R,F)*u.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:w.y,u_tex_y_b:A.y,u_mix:p.t})};function Xo(i,o){return 1/yr(i,1,o.tileZoom)}function Tl(i,o,n){return i.translatePosMatrix(o.tileID.posMatrix,o,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}var Oc=function(i,o,n,s,p){return{u_matrix:i,u_tl_parent:o,u_scale_parent:n,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.opacity*p.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:p.paint.get("raster-brightness-min"),u_brightness_high:p.paint.get("raster-brightness-max"),u_saturation_factor:(d=p.paint.get("raster-saturation"),d>0?1-1/(1.001-d):-d),u_contrast_factor:(f=p.paint.get("raster-contrast"),f>0?1/(1-f):1+f),u_spin_weights:Al(p.paint.get("raster-hue-rotate"))};var f,d};function Al(i){i*=Math.PI/180;var o=Math.sin(i),n=Math.cos(i);return[(2*n+1)/3,(-Math.sqrt(3)*o-n+1)/3,(Math.sqrt(3)*o-n+1)/3]}var is,Ko=function(i,o,n,s,p,f,d,v,w,A){var R=p.transform;return{u_is_size_zoom_constant:+(i==="constant"||i==="source"),u_is_size_feature_constant:+(i==="constant"||i==="camera"),u_size_t:o?o.uSizeT:0,u_size:o?o.uSize:0,u_camera_to_center_distance:R.cameraToCenterDistance,u_pitch:R.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:R.width/R.height,u_fade_change:p.options.fadeDuration?p.symbolFadeChange:1,u_matrix:f,u_label_plane_matrix:d,u_coord_matrix:v,u_is_text:+w,u_pitch_with_map:+s,u_texsize:A,u_texture:0}},wa=function(i,o,n,s,p,f,d,v,w,A,R){var F=p.transform;return u.extend(Ko(i,o,n,s,p,f,d,v,w,A),{u_gamma_scale:s?Math.cos(F._pitch)*F.cameraToCenterDistance:1,u_device_pixel_ratio:u.browser.devicePixelRatio,u_is_halo:1})},ns=function(i,o,n,s,p,f,d,v,w,A){return u.extend(wa(i,o,n,s,p,f,d,v,!0,w),{u_texsize_icon:A,u_texture_icon:1})},Sa=function(i,o,n){return{u_matrix:i,u_opacity:o,u_color:n}},Jo=function(i,o,n,s,p,f){return u.extend((function(d,v,w,A){var R=w.imageManager.getPattern(d.from.toString()),F=w.imageManager.getPattern(d.to.toString()),O=w.imageManager.getPixelSize(),W=O.width,Z=O.height,ee=Math.pow(2,A.tileID.overscaledZ),N=A.tileSize*Math.pow(2,w.transform.tileZoom)/ee,Q=N*(A.tileID.canonical.x+A.tileID.wrap*ee),ne=N*A.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:R.tl,u_pattern_br_a:R.br,u_pattern_tl_b:F.tl,u_pattern_br_b:F.br,u_texsize:[W,Z],u_mix:v.t,u_pattern_size_a:R.displaySize,u_pattern_size_b:F.displaySize,u_scale_a:v.fromScale,u_scale_b:v.toScale,u_tile_units_to_pixels:1/yr(A,1,w.transform.tileZoom),u_pixel_coord_upper:[Q>>16,ne>>16],u_pixel_coord_lower:[65535&Q,65535&ne]}})(s,f,n,p),{u_matrix:i,u_opacity:o})},El={fillExtrusion:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_lightpos:new u.Uniform3f(i,o.u_lightpos),u_lightintensity:new u.Uniform1f(i,o.u_lightintensity),u_lightcolor:new u.Uniform3f(i,o.u_lightcolor),u_vertical_gradient:new u.Uniform1f(i,o.u_vertical_gradient),u_opacity:new u.Uniform1f(i,o.u_opacity)}},fillExtrusionPattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_lightpos:new u.Uniform3f(i,o.u_lightpos),u_lightintensity:new u.Uniform1f(i,o.u_lightintensity),u_lightcolor:new u.Uniform3f(i,o.u_lightcolor),u_vertical_gradient:new u.Uniform1f(i,o.u_vertical_gradient),u_height_factor:new u.Uniform1f(i,o.u_height_factor),u_image:new u.Uniform1i(i,o.u_image),u_texsize:new u.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new u.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new u.Uniform3f(i,o.u_scale),u_fade:new u.Uniform1f(i,o.u_fade),u_opacity:new u.Uniform1f(i,o.u_opacity)}},fill:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix)}},fillPattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_image:new u.Uniform1i(i,o.u_image),u_texsize:new u.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new u.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new u.Uniform3f(i,o.u_scale),u_fade:new u.Uniform1f(i,o.u_fade)}},fillOutline:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_world:new u.Uniform2f(i,o.u_world)}},fillOutlinePattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_world:new u.Uniform2f(i,o.u_world),u_image:new u.Uniform1i(i,o.u_image),u_texsize:new u.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new u.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new u.Uniform3f(i,o.u_scale),u_fade:new u.Uniform1f(i,o.u_fade)}},circle:function(i,o){return{u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_scale_with_map:new u.Uniform1i(i,o.u_scale_with_map),u_pitch_with_map:new u.Uniform1i(i,o.u_pitch_with_map),u_extrude_scale:new u.Uniform2f(i,o.u_extrude_scale),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_matrix:new u.UniformMatrix4f(i,o.u_matrix)}},collisionBox:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_pixels_to_tile_units:new u.Uniform1f(i,o.u_pixels_to_tile_units),u_extrude_scale:new u.Uniform2f(i,o.u_extrude_scale),u_overscale_factor:new u.Uniform1f(i,o.u_overscale_factor)}},collisionCircle:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_inv_matrix:new u.UniformMatrix4f(i,o.u_inv_matrix),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_viewport_size:new u.Uniform2f(i,o.u_viewport_size)}},debug:function(i,o){return{u_color:new u.UniformColor(i,o.u_color),u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_overlay:new u.Uniform1i(i,o.u_overlay),u_overlay_scale:new u.Uniform1f(i,o.u_overlay_scale)}},clippingMask:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix)}},heatmap:function(i,o){return{u_extrude_scale:new u.Uniform1f(i,o.u_extrude_scale),u_intensity:new u.Uniform1f(i,o.u_intensity),u_matrix:new u.UniformMatrix4f(i,o.u_matrix)}},heatmapTexture:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_world:new u.Uniform2f(i,o.u_world),u_image:new u.Uniform1i(i,o.u_image),u_color_ramp:new u.Uniform1i(i,o.u_color_ramp),u_opacity:new u.Uniform1f(i,o.u_opacity)}},hillshade:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_image:new u.Uniform1i(i,o.u_image),u_latrange:new u.Uniform2f(i,o.u_latrange),u_light:new u.Uniform2f(i,o.u_light),u_shadow:new u.UniformColor(i,o.u_shadow),u_highlight:new u.UniformColor(i,o.u_highlight),u_accent:new u.UniformColor(i,o.u_accent)}},hillshadePrepare:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_image:new u.Uniform1i(i,o.u_image),u_dimension:new u.Uniform2f(i,o.u_dimension),u_zoom:new u.Uniform1f(i,o.u_zoom),u_unpack:new u.Uniform4f(i,o.u_unpack)}},line:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_ratio:new u.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(i,o.u_units_to_pixels)}},lineGradient:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_ratio:new u.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(i,o.u_units_to_pixels),u_image:new u.Uniform1i(i,o.u_image),u_image_height:new u.Uniform1f(i,o.u_image_height)}},linePattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_texsize:new u.Uniform2f(i,o.u_texsize),u_ratio:new u.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_image:new u.Uniform1i(i,o.u_image),u_units_to_pixels:new u.Uniform2f(i,o.u_units_to_pixels),u_scale:new u.Uniform3f(i,o.u_scale),u_fade:new u.Uniform1f(i,o.u_fade)}},lineSDF:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_ratio:new u.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(i,o.u_units_to_pixels),u_patternscale_a:new u.Uniform2f(i,o.u_patternscale_a),u_patternscale_b:new u.Uniform2f(i,o.u_patternscale_b),u_sdfgamma:new u.Uniform1f(i,o.u_sdfgamma),u_image:new u.Uniform1i(i,o.u_image),u_tex_y_a:new u.Uniform1f(i,o.u_tex_y_a),u_tex_y_b:new u.Uniform1f(i,o.u_tex_y_b),u_mix:new u.Uniform1f(i,o.u_mix)}},raster:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_tl_parent:new u.Uniform2f(i,o.u_tl_parent),u_scale_parent:new u.Uniform1f(i,o.u_scale_parent),u_buffer_scale:new u.Uniform1f(i,o.u_buffer_scale),u_fade_t:new u.Uniform1f(i,o.u_fade_t),u_opacity:new u.Uniform1f(i,o.u_opacity),u_image0:new u.Uniform1i(i,o.u_image0),u_image1:new u.Uniform1i(i,o.u_image1),u_brightness_low:new u.Uniform1f(i,o.u_brightness_low),u_brightness_high:new u.Uniform1f(i,o.u_brightness_high),u_saturation_factor:new u.Uniform1f(i,o.u_saturation_factor),u_contrast_factor:new u.Uniform1f(i,o.u_contrast_factor),u_spin_weights:new u.Uniform3f(i,o.u_spin_weights)}},symbolIcon:function(i,o){return{u_is_size_zoom_constant:new u.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new u.Uniform1f(i,o.u_size_t),u_size:new u.Uniform1f(i,o.u_size),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new u.Uniform1f(i,o.u_pitch),u_rotate_symbol:new u.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new u.Uniform1f(i,o.u_fade_change),u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new u.Uniform1i(i,o.u_is_text),u_pitch_with_map:new u.Uniform1i(i,o.u_pitch_with_map),u_texsize:new u.Uniform2f(i,o.u_texsize),u_texture:new u.Uniform1i(i,o.u_texture)}},symbolSDF:function(i,o){return{u_is_size_zoom_constant:new u.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new u.Uniform1f(i,o.u_size_t),u_size:new u.Uniform1f(i,o.u_size),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new u.Uniform1f(i,o.u_pitch),u_rotate_symbol:new u.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new u.Uniform1f(i,o.u_fade_change),u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new u.Uniform1i(i,o.u_is_text),u_pitch_with_map:new u.Uniform1i(i,o.u_pitch_with_map),u_texsize:new u.Uniform2f(i,o.u_texsize),u_texture:new u.Uniform1i(i,o.u_texture),u_gamma_scale:new u.Uniform1f(i,o.u_gamma_scale),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_is_halo:new u.Uniform1i(i,o.u_is_halo)}},symbolTextAndIcon:function(i,o){return{u_is_size_zoom_constant:new u.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new u.Uniform1f(i,o.u_size_t),u_size:new u.Uniform1f(i,o.u_size),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new u.Uniform1f(i,o.u_pitch),u_rotate_symbol:new u.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new u.Uniform1f(i,o.u_fade_change),u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new u.Uniform1i(i,o.u_is_text),u_pitch_with_map:new u.Uniform1i(i,o.u_pitch_with_map),u_texsize:new u.Uniform2f(i,o.u_texsize),u_texsize_icon:new u.Uniform2f(i,o.u_texsize_icon),u_texture:new u.Uniform1i(i,o.u_texture),u_texture_icon:new u.Uniform1i(i,o.u_texture_icon),u_gamma_scale:new u.Uniform1f(i,o.u_gamma_scale),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_is_halo:new u.Uniform1i(i,o.u_is_halo)}},background:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_opacity:new u.Uniform1f(i,o.u_opacity),u_color:new u.UniformColor(i,o.u_color)}},backgroundPattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_opacity:new u.Uniform1f(i,o.u_opacity),u_image:new u.Uniform1i(i,o.u_image),u_pattern_tl_a:new u.Uniform2f(i,o.u_pattern_tl_a),u_pattern_br_a:new u.Uniform2f(i,o.u_pattern_br_a),u_pattern_tl_b:new u.Uniform2f(i,o.u_pattern_tl_b),u_pattern_br_b:new u.Uniform2f(i,o.u_pattern_br_b),u_texsize:new u.Uniform2f(i,o.u_texsize),u_mix:new u.Uniform1f(i,o.u_mix),u_pattern_size_a:new u.Uniform2f(i,o.u_pattern_size_a),u_pattern_size_b:new u.Uniform2f(i,o.u_pattern_size_b),u_scale_a:new u.Uniform1f(i,o.u_scale_a),u_scale_b:new u.Uniform1f(i,o.u_scale_b),u_pixel_coord_upper:new u.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(i,o.u_pixel_coord_lower),u_tile_units_to_pixels:new u.Uniform1f(i,o.u_tile_units_to_pixels)}}};function Yo(i,o,n,s,p,f,d){for(var v=i.context,w=v.gl,A=i.useProgram("collisionBox"),R=[],F=0,O=0,W=0;W<s.length;W++){var Z=s[W],ee=o.getTile(Z),N=ee.getBucket(n);if(N){var Q=Z.posMatrix;p[0]===0&&p[1]===0||(Q=i.translatePosMatrix(Z.posMatrix,ee,p,f));var ne=d?N.textCollisionBox:N.iconCollisionBox,ue=N.collisionCircleArray;if(ue.length>0){var me=u.create(),pe=Q;u.mul(me,N.placementInvProjMatrix,i.transform.glCoordMatrix),u.mul(me,me,N.placementViewportMatrix),R.push({circleArray:ue,circleOffset:O,transform:pe,invTransform:me}),O=F+=ue.length/4}ne&&A.draw(v,w.LINES,V.disabled,$.disabled,i.colorModeForRenderPass(),ie.disabled,To(Q,i.transform,ee),n.id,ne.layoutVertexBuffer,ne.indexBuffer,ne.segments,null,i.transform.zoom,null,null,ne.collisionVertexBuffer)}}if(d&&R.length){var ve=i.useProgram("collisionCircle"),Te=new u.StructArrayLayout2f1f2i16;Te.resize(4*F),Te._trim();for(var ke=0,Ce=0,$e=R;Ce<$e.length;Ce+=1)for(var nt=$e[Ce],ut=0;ut<nt.circleArray.length/4;ut++){var st=4*ut,Ft=nt.circleArray[st+0],We=nt.circleArray[st+1],mt=nt.circleArray[st+2],xt=nt.circleArray[st+3];Te.emplace(ke++,Ft,We,mt,xt,0),Te.emplace(ke++,Ft,We,mt,xt,1),Te.emplace(ke++,Ft,We,mt,xt,2),Te.emplace(ke++,Ft,We,mt,xt,3)}(!is||is.length<2*F)&&(is=(function(Ir){var gi=2*Ir,si=new u.StructArrayLayout3ui6;si.resize(gi),si._trim();for(var wr=0;wr<gi;wr++){var Mr=6*wr;si.uint16[Mr+0]=4*wr+0,si.uint16[Mr+1]=4*wr+1,si.uint16[Mr+2]=4*wr+2,si.uint16[Mr+3]=4*wr+2,si.uint16[Mr+4]=4*wr+3,si.uint16[Mr+5]=4*wr+0}return si})(F));for(var dt=v.createIndexBuffer(is,!0),ft=v.createVertexBuffer(Te,u.collisionCircleLayout.members,!0),gt=0,ht=R;gt<ht.length;gt+=1){var ct=ht[gt],Jr=Sl(ct.transform,ct.invTransform,i.transform);ve.draw(v,w.TRIANGLES,V.disabled,$.disabled,i.colorModeForRenderPass(),ie.disabled,Jr,n.id,ft,dt,u.SegmentVector.simpleSegment(0,2*ct.circleOffset,ct.circleArray.length,ct.circleArray.length/2),null,i.transform.zoom,null,null,null)}ft.destroy(),dt.destroy()}}var vn=u.identity(new Float32Array(16));function Pl(i,o,n,s,p,f){var d=u.getAnchorAlignment(i),v=-(d.horizontalAlign-.5)*o,w=-(d.verticalAlign-.5)*n,A=u.evaluateVariableOffset(i,s);return new u.Point((v/p+A[0])*f,(w/p+A[1])*f)}function Cl(i,o,n,s,p,f,d,v,w,A,R){var F=i.text.placedSymbolArray,O=i.text.dynamicLayoutVertexArray,W=i.icon.dynamicLayoutVertexArray,Z={};O.clear();for(var ee=0;ee<F.length;ee++){var N=F.get(ee),Q=N.hidden||!N.crossTileID||i.allowVerticalPlacement&&!N.placedOrientation?null:s[N.crossTileID];if(Q){var ne=new u.Point(N.anchorX,N.anchorY),ue=zt(ne,n?v:d),me=$t(f.cameraToCenterDistance,ue.signedDistanceFromCamera),pe=p.evaluateSizeForFeature(i.textSizeData,A,N)*me/u.ONE_EM;n&&(pe*=i.tilePixelRatio/w);for(var ve=Pl(Q.anchor,Q.width,Q.height,Q.textOffset,Q.textBoxScale,pe),Te=n?zt(ne.add(ve),d).point:ue.point.add(o?ve.rotate(-f.angle):ve),ke=i.allowVerticalPlacement&&N.placedOrientation===u.WritingMode.vertical?Math.PI/2:0,Ce=0;Ce<N.numGlyphs;Ce++)u.addDynamicAttributes(O,Te,ke);R&&N.associatedIconIndex>=0&&(Z[N.associatedIconIndex]={shiftedAnchor:Te,angle:ke})}else Si(N.numGlyphs,O)}if(R){W.clear();for(var $e=i.icon.placedSymbolArray,nt=0;nt<$e.length;nt++){var ut=$e.get(nt);if(ut.hidden)Si(ut.numGlyphs,W);else{var st=Z[nt];if(st)for(var Ft=0;Ft<ut.numGlyphs;Ft++)u.addDynamicAttributes(W,st.shiftedAnchor,st.angle);else Si(ut.numGlyphs,W)}}i.icon.dynamicLayoutVertexBuffer.updateData(W)}i.text.dynamicLayoutVertexBuffer.updateData(O)}function kl(i,o,n){return n.iconsInText&&o?"symbolTextAndIcon":i?"symbolSDF":"symbolIcon"}function Po(i,o,n,s,p,f,d,v,w,A,R,F){for(var O=i.context,W=O.gl,Z=i.transform,ee=v==="map",N=w==="map",Q=ee&&n.layout.get("symbol-placement")!=="point",ne=ee&&!N&&!Q,ue=n.layout.get("symbol-sort-key").constantOr(1)!==void 0,me=!1,pe=i.depthModeForSublayer(0,V.ReadOnly),ve=n.layout.get("text-variable-anchor"),Te=[],ke=0,Ce=s;ke<Ce.length;ke+=1){var $e=Ce[ke],nt=o.getTile($e),ut=nt.getBucket(n);if(ut){var st=p?ut.text:ut.icon;if(st&&st.segments.get().length){var Ft=st.programConfigurations.get(n.id),We=p||ut.sdfIcons,mt=p?ut.textSizeData:ut.iconSizeData,xt=N||Z.pitch!==0,dt=i.useProgram(kl(We,p,ut),Ft),ft=u.evaluateSizeForZoom(mt,Z.zoom),gt=void 0,ht=[0,0],ct=void 0,Jr=void 0,Ir=null,gi=void 0;if(p)ct=nt.glyphAtlasTexture,Jr=W.LINEAR,gt=nt.glyphAtlasTexture.size,ut.iconsInText&&(ht=nt.imageAtlasTexture.size,Ir=nt.imageAtlasTexture,gi=xt||i.options.rotating||i.options.zooming||mt.kind==="composite"||mt.kind==="camera"?W.LINEAR:W.NEAREST);else{var si=n.layout.get("icon-size").constantOr(0)!==1||ut.iconsNeedLinear;ct=nt.imageAtlasTexture,Jr=We||i.options.rotating||i.options.zooming||si||xt?W.LINEAR:W.NEAREST,gt=nt.imageAtlasTexture.size}var wr=yr(nt,1,i.transform.zoom),Mr=Cr($e.posMatrix,N,ee,i.transform,wr),Wi=Qt($e.posMatrix,N,ee,i.transform,wr),Ei=ve&&ut.hasTextData(),no=n.layout.get("icon-text-fit")!=="none"&&Ei&&ut.hasIconData();Q&&ma(ut,$e.posMatrix,i,p,Mr,Wi,N,A);var Ri=i.translatePosMatrix($e.posMatrix,nt,f,d),wn=Q||p&&ve||no?vn:Mr,cn=i.translatePosMatrix(Wi,nt,f,d,!0),Ra=We&&n.paint.get(p?"text-halo-width":"icon-halo-width").constantOr(1)!==0,na={program:dt,buffers:st,uniformValues:We?ut.iconsInText?ns(mt.kind,ft,ne,N,i,Ri,wn,cn,gt,ht):wa(mt.kind,ft,ne,N,i,Ri,wn,cn,p,gt):Ko(mt.kind,ft,ne,N,i,Ri,wn,cn,p,gt),atlasTexture:ct,atlasTextureIcon:Ir,atlasInterpolation:Jr,atlasInterpolationIcon:gi,isSDF:We,hasHalo:Ra};if(ue&&ut.canOverlap){me=!0;for(var oo=0,oa=st.segments.get();oo<oa.length;oo+=1){var La=oa[oo];Te.push({segments:new u.SegmentVector([La]),sortKey:La.sortKey,state:na})}}else Te.push({segments:st.segments,sortKey:0,state:na})}}}me&&Te.sort((function(ao,Do){return ao.sortKey-Do.sortKey}));for(var Pn=0,Fa=Te;Pn<Fa.length;Pn+=1){var Cn=Fa[Pn],Yr=Cn.state;if(O.activeTexture.set(W.TEXTURE0),Yr.atlasTexture.bind(Yr.atlasInterpolation,W.CLAMP_TO_EDGE),Yr.atlasTextureIcon&&(O.activeTexture.set(W.TEXTURE1),Yr.atlasTextureIcon&&Yr.atlasTextureIcon.bind(Yr.atlasInterpolationIcon,W.CLAMP_TO_EDGE)),Yr.isSDF){var On=Yr.uniformValues;Yr.hasHalo&&(On.u_is_halo=1,Ia(Yr.buffers,Cn.segments,n,i,Yr.program,pe,R,F,On)),On.u_is_halo=0}Ia(Yr.buffers,Cn.segments,n,i,Yr.program,pe,R,F,Yr.uniformValues)}}function Ia(i,o,n,s,p,f,d,v,w){var A=s.context;p.draw(A,A.gl.TRIANGLES,f,d,v,ie.disabled,w,n.id,i.layoutVertexBuffer,i.indexBuffer,o,n.paint,s.transform.zoom,i.programConfigurations.get(n.id),i.dynamicLayoutVertexBuffer,i.opacityVertexBuffer)}function os(i,o,n,s,p,f,d){var v,w,A,R,F,O=i.context.gl,W=n.paint.get("fill-pattern"),Z=W&&W.constantOr(1),ee=n.getCrossfadeParameters();d?(w=Z&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",v=O.LINES):(w=Z?"fillPattern":"fill",v=O.TRIANGLES);for(var N=0,Q=s;N<Q.length;N+=1){var ne=Q[N],ue=o.getTile(ne);if(!Z||ue.patternsLoaded()){var me=ue.getBucket(n);if(me){var pe=me.programConfigurations.get(n.id),ve=i.useProgram(w,pe);Z&&(i.context.activeTexture.set(O.TEXTURE0),ue.imageAtlasTexture.bind(O.LINEAR,O.CLAMP_TO_EDGE),pe.updatePaintBuffers(ee));var Te=W.constantOr(null);if(Te&&ue.imageAtlas){var ke=ue.imageAtlas,Ce=ke.patternPositions[Te.to.toString()],$e=ke.patternPositions[Te.from.toString()];Ce&&$e&&pe.setConstantPatternPositions(Ce,$e)}var nt=i.translatePosMatrix(ne.posMatrix,ue,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(d){R=me.indexBuffer2,F=me.segments2;var ut=[O.drawingBufferWidth,O.drawingBufferHeight];A=w==="fillOutlinePattern"&&Z?wl(nt,i,ee,ue,ut):bl(nt,ut)}else R=me.indexBuffer,F=me.segments,A=Z?Io(nt,i,ee,ue):Yn(nt);ve.draw(i.context,v,p,i.stencilModeForClipping(ne),f,ie.disabled,A,n.id,me.layoutVertexBuffer,R,F,n.paint,i.transform.zoom,pe)}}}}function pu(i,o,n,s,p,f,d){for(var v=i.context,w=v.gl,A=n.paint.get("fill-extrusion-pattern"),R=A.constantOr(1),F=n.getCrossfadeParameters(),O=n.paint.get("fill-extrusion-opacity"),W=0,Z=s;W<Z.length;W+=1){var ee=Z[W],N=o.getTile(ee),Q=N.getBucket(n);if(Q){var ne=Q.programConfigurations.get(n.id),ue=i.useProgram(R?"fillExtrusionPattern":"fillExtrusion",ne);R&&(i.context.activeTexture.set(w.TEXTURE0),N.imageAtlasTexture.bind(w.LINEAR,w.CLAMP_TO_EDGE),ne.updatePaintBuffers(F));var me=A.constantOr(null);if(me&&N.imageAtlas){var pe=N.imageAtlas,ve=pe.patternPositions[me.to.toString()],Te=pe.patternPositions[me.from.toString()];ve&&Te&&ne.setConstantPatternPositions(ve,Te)}var ke=i.translatePosMatrix(ee.posMatrix,N,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),Ce=n.paint.get("fill-extrusion-vertical-gradient"),$e=R?So(ke,i,Ce,O,ee,F,N):xl(ke,i,Ce,O);ue.draw(v,v.gl.TRIANGLES,p,f,d,ie.backCCW,$e,n.id,Q.layoutVertexBuffer,Q.indexBuffer,Q.segments,n.paint,i.transform.zoom,ne)}}}function as(i,o,n,s,p,f){var d=i.context,v=d.gl,w=o.fbo;if(w){var A=i.useProgram("hillshade");d.activeTexture.set(v.TEXTURE0),v.bindTexture(v.TEXTURE_2D,w.colorAttachment.get());var R=(function(F,O,W){var Z=W.paint.get("hillshade-shadow-color"),ee=W.paint.get("hillshade-highlight-color"),N=W.paint.get("hillshade-accent-color"),Q=W.paint.get("hillshade-illumination-direction")*(Math.PI/180);W.paint.get("hillshade-illumination-anchor")==="viewport"&&(Q-=F.transform.angle);var ne,ue,me,pe=!F.options.moving;return{u_matrix:F.transform.calculatePosMatrix(O.tileID.toUnwrapped(),pe),u_image:0,u_latrange:(ne=O.tileID,ue=Math.pow(2,ne.canonical.z),me=ne.canonical.y,[new u.MercatorCoordinate(0,me/ue).toLngLat().lat,new u.MercatorCoordinate(0,(me+1)/ue).toLngLat().lat]),u_light:[W.paint.get("hillshade-exaggeration"),Q],u_shadow:Z,u_highlight:ee,u_accent:N}})(i,o,n);A.draw(d,v.TRIANGLES,s,p,f,ie.disabled,R,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}}function Vc(i,o,n,s,p,f){var d=i.context,v=d.gl,w=o.dem;if(w&&w.data){var A=w.dim,R=w.stride,F=w.getPixels();if(d.activeTexture.set(v.TEXTURE1),d.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||i.getTileTexture(R),o.demTexture){var O=o.demTexture;O.update(F,{premultiply:!1}),O.bind(v.NEAREST,v.CLAMP_TO_EDGE)}else o.demTexture=new u.Texture(d,F,v.RGBA,{premultiply:!1}),o.demTexture.bind(v.NEAREST,v.CLAMP_TO_EDGE);d.activeTexture.set(v.TEXTURE0);var W=o.fbo;if(!W){var Z=new u.Texture(d,{width:A,height:A,data:null},v.RGBA);Z.bind(v.LINEAR,v.CLAMP_TO_EDGE),(W=o.fbo=d.createFramebuffer(A,A,!0)).colorAttachment.set(Z.texture)}d.bindFramebuffer.set(W.framebuffer),d.viewport.set([0,0,A,A]),i.useProgram("hillshadePrepare").draw(d,v.TRIANGLES,s,p,f,ie.disabled,(function(ee,N){var Q=N.stride,ne=u.create();return u.ortho(ne,0,u.EXTENT,-u.EXTENT,0,0,1),u.translate(ne,ne,[0,-u.EXTENT,0]),{u_matrix:ne,u_image:1,u_dimension:[Q,Q],u_zoom:ee.overscaledZ,u_unpack:N.getUnpackVector()}})(o.tileID,w),n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments),o.needsHillshadePrepare=!1}}function ss(i,o,n,s,p){var f=s.paint.get("raster-fade-duration");if(f>0){var d=u.browser.now(),v=(d-i.timeAdded)/f,w=o?(d-o.timeAdded)/f:-1,A=n.getSource(),R=p.coveringZoomLevel({tileSize:A.tileSize,roundZoom:A.roundZoom}),F=!o||Math.abs(o.tileID.overscaledZ-R)>Math.abs(i.tileID.overscaledZ-R),O=F&&i.refreshedUponExpiration?1:u.clamp(F?v:1-w,0,1);return i.refreshedUponExpiration&&v>=1&&(i.refreshedUponExpiration=!1),o?{opacity:1,mix:1-O}:{opacity:O,mix:0}}return{opacity:1,mix:0}}var hu=new u.Color(1,0,0,1),Ml=new u.Color(0,1,0,1),Bl=new u.Color(0,0,1,1),us=new u.Color(1,0,1,1),fu=new u.Color(0,1,1,1);function du(i,o,n,s){Ta(i,0,o+n/2,i.transform.width,n,s)}function mu(i,o,n,s){Ta(i,o-n/2,0,n,i.transform.height,s)}function Ta(i,o,n,s,p,f){var d=i.context,v=d.gl;v.enable(v.SCISSOR_TEST),v.scissor(o*u.browser.devicePixelRatio,n*u.browser.devicePixelRatio,s*u.browser.devicePixelRatio,p*u.browser.devicePixelRatio),d.clear({color:f}),v.disable(v.SCISSOR_TEST)}function zl(i,o,n){var s=i.context,p=s.gl,f=n.posMatrix,d=i.useProgram("debug"),v=V.disabled,w=$.disabled,A=i.colorModeForRenderPass();s.activeTexture.set(p.TEXTURE0),i.emptyTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),d.draw(s,p.LINE_STRIP,v,w,A,ie.disabled,Ao(f,u.Color.red),"$debug",i.debugBuffer,i.tileBorderIndexBuffer,i.debugSegments);var R=o.getTileByID(n.key).latestRawTileData,F=Math.floor((R&&R.byteLength||0)/1024),O=o.getTile(n).tileSize,W=512/Math.min(O,512)*(n.overscaledZ/i.transform.zoom)*.5,Z=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(Z+=" => "+n.overscaledZ),(function(ee,N){ee.initDebugOverlayCanvas();var Q=ee.debugOverlayCanvas,ne=ee.context.gl,ue=ee.debugOverlayCanvas.getContext("2d");ue.clearRect(0,0,Q.width,Q.height),ue.shadowColor="white",ue.shadowBlur=2,ue.lineWidth=1.5,ue.strokeStyle="white",ue.textBaseline="top",ue.font="bold 36px Open Sans, sans-serif",ue.fillText(N,5,5),ue.strokeText(N,5,5),ee.debugOverlayTexture.update(Q),ee.debugOverlayTexture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE)})(i,Z+" "+F+"kb"),d.draw(s,p.TRIANGLES,v,w,re.alphaBlended,ie.disabled,Ao(f,u.Color.transparent,W),"$debug",i.debugBuffer,i.quadTriangleIndexBuffer,i.debugSegments)}var Co={symbol:function(i,o,n,s,p){if(i.renderPass==="translucent"){var f=$.disabled,d=i.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&(function(v,w,A,R,F,O,W){for(var Z=w.transform,ee=F==="map",N=O==="map",Q=0,ne=v;Q<ne.length;Q+=1){var ue=ne[Q],me=R.getTile(ue),pe=me.getBucket(A);if(pe&&pe.text&&pe.text.segments.get().length){var ve=u.evaluateSizeForZoom(pe.textSizeData,Z.zoom),Te=yr(me,1,w.transform.zoom),ke=Cr(ue.posMatrix,N,ee,w.transform,Te),Ce=A.layout.get("icon-text-fit")!=="none"&&pe.hasIconData();if(ve){var $e=Math.pow(2,Z.zoom-me.tileID.overscaledZ);Cl(pe,ee,N,W,u.symbolSize,Z,ke,ue.posMatrix,$e,ve,Ce)}}}})(s,i,n,o,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),p),n.paint.get("icon-opacity").constantOr(1)!==0&&Po(i,o,n,s,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),f,d),n.paint.get("text-opacity").constantOr(1)!==0&&Po(i,o,n,s,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),f,d),o.map.showCollisionBoxes&&(Yo(i,o,n,s,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),Yo(i,o,n,s,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(i,o,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("circle-opacity"),f=n.paint.get("circle-stroke-width"),d=n.paint.get("circle-stroke-opacity"),v=n.layout.get("circle-sort-key").constantOr(1)!==void 0;if(p.constantOr(1)!==0||f.constantOr(1)!==0&&d.constantOr(1)!==0){for(var w=i.context,A=w.gl,R=i.depthModeForSublayer(0,V.ReadOnly),F=$.disabled,O=i.colorModeForRenderPass(),W=[],Z=0;Z<s.length;Z++){var ee=s[Z],N=o.getTile(ee),Q=N.getBucket(n);if(Q){var ne=Q.programConfigurations.get(n.id),ue={programConfiguration:ne,program:i.useProgram("circle",ne),layoutVertexBuffer:Q.layoutVertexBuffer,indexBuffer:Q.indexBuffer,uniformValues:cu(i,ee,N,n)};if(v)for(var me=0,pe=Q.segments.get();me<pe.length;me+=1){var ve=pe[me];W.push({segments:new u.SegmentVector([ve]),sortKey:ve.sortKey,state:ue})}else W.push({segments:Q.segments,sortKey:0,state:ue})}}v&&W.sort((function(nt,ut){return nt.sortKey-ut.sortKey}));for(var Te=0,ke=W;Te<ke.length;Te+=1){var Ce=ke[Te],$e=Ce.state;$e.program.draw(w,A.TRIANGLES,R,F,O,ie.disabled,$e.uniformValues,n.id,$e.layoutVertexBuffer,$e.indexBuffer,Ce.segments,n.paint,i.transform.zoom,$e.programConfiguration)}}}},heatmap:function(i,o,n,s){if(n.paint.get("heatmap-opacity")!==0)if(i.renderPass==="offscreen"){var p=i.context,f=p.gl,d=$.disabled,v=new re([f.ONE,f.ONE],u.Color.transparent,[!0,!0,!0,!0]);(function(W,Z,ee){var N=W.gl;W.activeTexture.set(N.TEXTURE1),W.viewport.set([0,0,Z.width/4,Z.height/4]);var Q=ee.heatmapFbo;if(Q)N.bindTexture(N.TEXTURE_2D,Q.colorAttachment.get()),W.bindFramebuffer.set(Q.framebuffer);else{var ne=N.createTexture();N.bindTexture(N.TEXTURE_2D,ne),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_S,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_T,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_MIN_FILTER,N.LINEAR),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_MAG_FILTER,N.LINEAR),Q=ee.heatmapFbo=W.createFramebuffer(Z.width/4,Z.height/4,!1),(function(ue,me,pe,ve){var Te=ue.gl;Te.texImage2D(Te.TEXTURE_2D,0,Te.RGBA,me.width/4,me.height/4,0,Te.RGBA,ue.extRenderToTextureHalfFloat?ue.extTextureHalfFloat.HALF_FLOAT_OES:Te.UNSIGNED_BYTE,null),ve.colorAttachment.set(pe)})(W,Z,ne,Q)}})(p,i,n),p.clear({color:u.Color.transparent});for(var w=0;w<s.length;w++){var A=s[w];if(!o.hasRenderableParent(A)){var R=o.getTile(A),F=R.getBucket(n);if(F){var O=F.programConfigurations.get(n.id);i.useProgram("heatmap",O).draw(p,f.TRIANGLES,V.disabled,d,v,ie.disabled,Il(A.posMatrix,R,i.transform.zoom,n.paint.get("heatmap-intensity")),n.id,F.layoutVertexBuffer,F.indexBuffer,F.segments,n.paint,i.transform.zoom,O)}}}p.viewport.set([0,0,i.width,i.height])}else i.renderPass==="translucent"&&(i.context.setColorMode(i.colorModeForRenderPass()),(function(W,Z){var ee=W.context,N=ee.gl,Q=Z.heatmapFbo;if(Q){ee.activeTexture.set(N.TEXTURE0),N.bindTexture(N.TEXTURE_2D,Q.colorAttachment.get()),ee.activeTexture.set(N.TEXTURE1);var ne=Z.colorRampTexture;ne||(ne=Z.colorRampTexture=new u.Texture(ee,Z.colorRamp,N.RGBA)),ne.bind(N.LINEAR,N.CLAMP_TO_EDGE),W.useProgram("heatmapTexture").draw(ee,N.TRIANGLES,V.disabled,$.disabled,W.colorModeForRenderPass(),ie.disabled,(function(ue,me,pe,ve){var Te=u.create();u.ortho(Te,0,ue.width,ue.height,0,0,1);var ke=ue.context.gl;return{u_matrix:Te,u_world:[ke.drawingBufferWidth,ke.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:me.paint.get("heatmap-opacity")}})(W,Z),Z.id,W.viewportBuffer,W.quadTriangleIndexBuffer,W.viewportSegments,Z.paint,W.transform.zoom)}})(i,n))},line:function(i,o,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("line-opacity"),f=n.paint.get("line-width");if(p.constantOr(1)!==0&&f.constantOr(1)!==0)for(var d=i.depthModeForSublayer(0,V.ReadOnly),v=i.colorModeForRenderPass(),w=n.paint.get("line-dasharray"),A=n.paint.get("line-pattern"),R=A.constantOr(1),F=n.paint.get("line-gradient"),O=n.getCrossfadeParameters(),W=R?"linePattern":w?"lineSDF":F?"lineGradient":"line",Z=i.context,ee=Z.gl,N=!0,Q=0,ne=s;Q<ne.length;Q+=1){var ue=ne[Q],me=o.getTile(ue);if(!R||me.patternsLoaded()){var pe=me.getBucket(n);if(pe){var ve=pe.programConfigurations.get(n.id),Te=i.context.program.get(),ke=i.useProgram(W,ve),Ce=N||ke.program!==Te,$e=A.constantOr(null);if($e&&me.imageAtlas){var nt=me.imageAtlas,ut=nt.patternPositions[$e.to.toString()],st=nt.patternPositions[$e.from.toString()];ut&&st&&ve.setConstantPatternPositions(ut,st)}var Ft=R?rs(i,me,n,O):w?Fc(i,me,n,w,O):F?ur(i,me,n,pe.lineClipsArray.length):ba(i,me,n);if(R)Z.activeTexture.set(ee.TEXTURE0),me.imageAtlasTexture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE),ve.updatePaintBuffers(O);else if(w&&(Ce||i.lineAtlas.dirty))Z.activeTexture.set(ee.TEXTURE0),i.lineAtlas.bind(Z);else if(F){var We=pe.gradients[n.id],mt=We.texture;if(n.gradientVersion!==We.version){var xt=256;if(n.stepInterpolant){var dt=o.getSource().maxzoom,ft=ue.canonical.z===dt?Math.ceil(1<<i.transform.maxZoom-ue.canonical.z):1;xt=u.clamp(u.nextPowerOfTwo(pe.maxLineLength/u.EXTENT*1024*ft),256,Z.maxTextureSize)}We.gradient=u.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:xt,image:We.gradient||void 0,clips:pe.lineClipsArray}),We.texture?We.texture.update(We.gradient):We.texture=new u.Texture(Z,We.gradient,ee.RGBA),We.version=n.gradientVersion,mt=We.texture}Z.activeTexture.set(ee.TEXTURE0),mt.bind(n.stepInterpolant?ee.NEAREST:ee.LINEAR,ee.CLAMP_TO_EDGE)}ke.draw(Z,ee.TRIANGLES,d,i.stencilModeForClipping(ue),v,ie.disabled,Ft,n.id,pe.layoutVertexBuffer,pe.indexBuffer,pe.segments,n.paint,i.transform.zoom,ve,pe.layoutVertexBuffer2),N=!1}}}}},fill:function(i,o,n,s){var p=n.paint.get("fill-color"),f=n.paint.get("fill-opacity");if(f.constantOr(1)!==0){var d=i.colorModeForRenderPass(),v=n.paint.get("fill-pattern"),w=i.opaquePassEnabledForLayer()&&!v.constantOr(1)&&p.constantOr(u.Color.transparent).a===1&&f.constantOr(0)===1?"opaque":"translucent";if(i.renderPass===w){var A=i.depthModeForSublayer(1,i.renderPass==="opaque"?V.ReadWrite:V.ReadOnly);os(i,o,n,s,A,d,!1)}if(i.renderPass==="translucent"&&n.paint.get("fill-antialias")){var R=i.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,V.ReadOnly);os(i,o,n,s,R,d,!0)}}},"fill-extrusion":function(i,o,n,s){var p=n.paint.get("fill-extrusion-opacity");if(p!==0&&i.renderPass==="translucent"){var f=new V(i.context.gl.LEQUAL,V.ReadWrite,i.depthRangeFor3D);if(p!==1||n.paint.get("fill-extrusion-pattern").constantOr(1))pu(i,o,n,s,f,$.disabled,re.disabled),pu(i,o,n,s,f,i.stencilModeFor3D(),i.colorModeForRenderPass());else{var d=i.colorModeForRenderPass();pu(i,o,n,s,f,$.disabled,d)}}},hillshade:function(i,o,n,s){if(i.renderPass==="offscreen"||i.renderPass==="translucent"){for(var p=i.context,f=i.depthModeForSublayer(0,V.ReadOnly),d=i.colorModeForRenderPass(),v=i.renderPass==="translucent"?i.stencilConfigForOverlap(s):[{},s],w=v[0],A=0,R=v[1];A<R.length;A+=1){var F=R[A],O=o.getTile(F);O.needsHillshadePrepare&&i.renderPass==="offscreen"?Vc(i,O,n,f,$.disabled,d):i.renderPass==="translucent"&&as(i,O,n,f,w[F.overscaledZ],d)}p.viewport.set([0,0,i.width,i.height])}},raster:function(i,o,n,s){if(i.renderPass==="translucent"&&n.paint.get("raster-opacity")!==0&&s.length)for(var p=i.context,f=p.gl,d=o.getSource(),v=i.useProgram("raster"),w=i.colorModeForRenderPass(),A=d instanceof Xr?[{},s]:i.stencilConfigForOverlap(s),R=A[0],F=A[1],O=F[F.length-1].overscaledZ,W=!i.options.moving,Z=0,ee=F;Z<ee.length;Z+=1){var N=ee[Z],Q=i.depthModeForSublayer(N.overscaledZ-O,n.paint.get("raster-opacity")===1?V.ReadWrite:V.ReadOnly,f.LESS),ne=o.getTile(N),ue=i.transform.calculatePosMatrix(N.toUnwrapped(),W);ne.registerFadeDuration(n.paint.get("raster-fade-duration"));var me=o.findLoadedParent(N,0),pe=ss(ne,me,o,n,i.transform),ve=void 0,Te=void 0,ke=n.paint.get("raster-resampling")==="nearest"?f.NEAREST:f.LINEAR;p.activeTexture.set(f.TEXTURE0),ne.texture.bind(ke,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),p.activeTexture.set(f.TEXTURE1),me?(me.texture.bind(ke,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),ve=Math.pow(2,me.tileID.overscaledZ-ne.tileID.overscaledZ),Te=[ne.tileID.canonical.x*ve%1,ne.tileID.canonical.y*ve%1]):ne.texture.bind(ke,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST);var Ce=Oc(ue,Te||[0,0],ve||1,pe,n);d instanceof Xr?v.draw(p,f.TRIANGLES,Q,$.disabled,w,ie.disabled,Ce,n.id,d.boundsBuffer,i.quadTriangleIndexBuffer,d.boundsSegments):v.draw(p,f.TRIANGLES,Q,R[N.overscaledZ],w,ie.disabled,Ce,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}},background:function(i,o,n){var s=n.paint.get("background-color"),p=n.paint.get("background-opacity");if(p!==0){var f=i.context,d=f.gl,v=i.transform,w=v.tileSize,A=n.paint.get("background-pattern");if(!i.isPatternMissing(A)){var R=!A&&s.a===1&&p===1&&i.opaquePassEnabledForLayer()?"opaque":"translucent";if(i.renderPass===R){var F=$.disabled,O=i.depthModeForSublayer(0,R==="opaque"?V.ReadWrite:V.ReadOnly),W=i.colorModeForRenderPass(),Z=i.useProgram(A?"backgroundPattern":"background"),ee=v.coveringTiles({tileSize:w});A&&(f.activeTexture.set(d.TEXTURE0),i.imageManager.bind(i.context));for(var N=n.getCrossfadeParameters(),Q=0,ne=ee;Q<ne.length;Q+=1){var ue=ne[Q],me=i.transform.calculatePosMatrix(ue.toUnwrapped()),pe=A?Jo(me,p,i,A,{tileID:ue,tileSize:w},N):Sa(me,p,s);Z.draw(f,d.TRIANGLES,O,F,W,ie.disabled,pe,n.id,i.tileExtentBuffer,i.quadTriangleIndexBuffer,i.tileExtentSegments)}}}}},debug:function(i,o,n){for(var s=0;s<n.length;s++)zl(i,o,n[s])},custom:function(i,o,n){var s=i.context,p=n.implementation;if(i.renderPass==="offscreen"){var f=p.prerender;f&&(i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),f.call(p,s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState())}else if(i.renderPass==="translucent"){i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),s.setStencilMode($.disabled);var d=p.renderingMode==="3d"?new V(i.context.gl.LEQUAL,V.ReadWrite,i.depthRangeFor3D):i.depthModeForSublayer(0,V.ReadOnly);s.setDepthMode(d),p.render(s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState(),s.bindFramebuffer.set(null)}}},vr=function(i,o){this.context=new L(i),this.transform=o,this._tileTextures={},this.setup(),this.numSublayers=H.maxUnderzooming+H.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new $n,this.gpuTimers={}};vr.prototype.resize=function(i,o){if(this.width=i*u.browser.devicePixelRatio,this.height=o*u.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,s=this.style._order;n<s.length;n+=1)this.style._layers[s[n]].resize()},vr.prototype.setup=function(){var i=this.context,o=new u.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(u.EXTENT,0),o.emplaceBack(0,u.EXTENT),o.emplaceBack(u.EXTENT,u.EXTENT),this.tileExtentBuffer=i.createVertexBuffer(o,Vr.members),this.tileExtentSegments=u.SegmentVector.simpleSegment(0,0,4,2);var n=new u.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(u.EXTENT,0),n.emplaceBack(0,u.EXTENT),n.emplaceBack(u.EXTENT,u.EXTENT),this.debugBuffer=i.createVertexBuffer(n,Vr.members),this.debugSegments=u.SegmentVector.simpleSegment(0,0,4,5);var s=new u.StructArrayLayout4i8;s.emplaceBack(0,0,0,0),s.emplaceBack(u.EXTENT,0,u.EXTENT,0),s.emplaceBack(0,u.EXTENT,0,u.EXTENT),s.emplaceBack(u.EXTENT,u.EXTENT,u.EXTENT,u.EXTENT),this.rasterBoundsBuffer=i.createVertexBuffer(s,Lr.members),this.rasterBoundsSegments=u.SegmentVector.simpleSegment(0,0,4,2);var p=new u.StructArrayLayout2i4;p.emplaceBack(0,0),p.emplaceBack(1,0),p.emplaceBack(0,1),p.emplaceBack(1,1),this.viewportBuffer=i.createVertexBuffer(p,Vr.members),this.viewportSegments=u.SegmentVector.simpleSegment(0,0,4,2);var f=new u.StructArrayLayout1ui2;f.emplaceBack(0),f.emplaceBack(1),f.emplaceBack(3),f.emplaceBack(2),f.emplaceBack(0),this.tileBorderIndexBuffer=i.createIndexBuffer(f);var d=new u.StructArrayLayout3ui6;d.emplaceBack(0,1,2),d.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=i.createIndexBuffer(d),this.emptyTexture=new u.Texture(i,{width:1,height:1,data:new Uint8Array([0,0,0,0])},i.gl.RGBA);var v=this.context.gl;this.stencilClearMode=new $({func:v.ALWAYS,mask:0},0,255,v.ZERO,v.ZERO,v.ZERO)},vr.prototype.clearStencil=function(){var i=this.context,o=i.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=u.create();u.ortho(n,0,this.width,this.height,0,0,1),u.scale(n,n,[o.drawingBufferWidth,o.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(i,o.TRIANGLES,V.disabled,this.stencilClearMode,re.disabled,ie.disabled,Eo(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},vr.prototype._renderTileClippingMasks=function(i,o){if(this.currentStencilSource!==i.source&&i.isTileClipped()&&o&&o.length){this.currentStencilSource=i.source;var n=this.context,s=n.gl;this.nextStencilID+o.length>256&&this.clearStencil(),n.setColorMode(re.disabled),n.setDepthMode(V.disabled);var p=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var f=0,d=o;f<d.length;f+=1){var v=d[f],w=this._tileClippingMaskIDs[v.key]=this.nextStencilID++;p.draw(n,s.TRIANGLES,V.disabled,new $({func:s.ALWAYS,mask:0},w,255,s.KEEP,s.KEEP,s.REPLACE),re.disabled,ie.disabled,Eo(v.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},vr.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var i=this.nextStencilID++,o=this.context.gl;return new $({func:o.NOTEQUAL,mask:255},i,255,o.KEEP,o.KEEP,o.REPLACE)},vr.prototype.stencilModeForClipping=function(i){var o=this.context.gl;return new $({func:o.EQUAL,mask:255},this._tileClippingMaskIDs[i.key],0,o.KEEP,o.KEEP,o.REPLACE)},vr.prototype.stencilConfigForOverlap=function(i){var o,n=this.context.gl,s=i.sort((function(w,A){return A.overscaledZ-w.overscaledZ})),p=s[s.length-1].overscaledZ,f=s[0].overscaledZ-p+1;if(f>1){this.currentStencilSource=void 0,this.nextStencilID+f>256&&this.clearStencil();for(var d={},v=0;v<f;v++)d[v+p]=new $({func:n.GEQUAL,mask:255},v+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=f,[d,s]}return[(o={},o[p]=$.disabled,o),s]},vr.prototype.colorModeForRenderPass=function(){var i=this.context.gl;return this._showOverdrawInspector?new re([i.CONSTANT_COLOR,i.ONE],new u.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?re.unblended:re.alphaBlended},vr.prototype.depthModeForSublayer=function(i,o,n){if(!this.opaquePassEnabledForLayer())return V.disabled;var s=1-((1+this.currentLayer)*this.numSublayers+i)*this.depthEpsilon;return new V(n||this.context.gl.LEQUAL,o,[s,s])},vr.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},vr.prototype.render=function(i,o){var n=this;this.style=i,this.options=o,this.lineAtlas=i.lineAtlas,this.imageManager=i.imageManager,this.glyphManager=i.glyphManager,this.symbolFadeChange=i.placement.symbolFadeChange(u.browser.now()),this.imageManager.beginFrame();var s=this.style._order,p=this.style.sourceCaches;for(var f in p){var d=p[f];d.used&&d.prepare(this.context)}var v,w,A={},R={},F={};for(var O in p){var W=p[O];A[O]=W.getVisibleCoordinates(),R[O]=A[O].slice().reverse(),F[O]=W.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var Z=0;Z<s.length;Z++)if(this.style._layers[s[Z]].is3D()){this.opaquePassCutoff=Z;break}this.renderPass="offscreen";for(var ee=0,N=s;ee<N.length;ee+=1){var Q=this.style._layers[N[ee]];if(Q.hasOffscreenPass()&&!Q.isHidden(this.transform.zoom)){var ne=R[Q.source];(Q.type==="custom"||ne.length)&&this.renderLayer(this,p[Q.source],Q,ne)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:o.showOverdrawInspector?u.Color.black:u.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=o.showOverdrawInspector,this.depthRangeFor3D=[0,1-(i._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=s.length-1;this.currentLayer>=0;this.currentLayer--){var ue=this.style._layers[s[this.currentLayer]],me=p[ue.source],pe=A[ue.source];this._renderTileClippingMasks(ue,pe),this.renderLayer(this,me,ue,pe)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<s.length;this.currentLayer++){var ve=this.style._layers[s[this.currentLayer]],Te=p[ve.source],ke=(ve.type==="symbol"?F:R)[ve.source];this._renderTileClippingMasks(ve,A[ve.source]),this.renderLayer(this,Te,ve,ke)}this.options.showTileBoundaries&&(u.values(this.style._layers).forEach((function(Ce){Ce.source&&!Ce.isHidden(n.transform.zoom)&&(Ce.source!==(w&&w.id)&&(w=n.style.sourceCaches[Ce.source]),(!v||v.getSource().maxzoom<w.getSource().maxzoom)&&(v=w))})),v&&Co.debug(this,v,v.getVisibleCoordinates())),this.options.showPadding&&(function(Ce){var $e=Ce.transform.padding;du(Ce,Ce.transform.height-($e.top||0),3,hu),du(Ce,$e.bottom||0,3,Ml),mu(Ce,$e.left||0,3,Bl),mu(Ce,Ce.transform.width-($e.right||0),3,us);var nt=Ce.transform.centerPoint;(function(ut,st,Ft,We){Ta(ut,st-1,Ft-10,2,20,We),Ta(ut,st-10,Ft-1,20,2,We)})(Ce,nt.x,Ce.transform.height-nt.y,fu)})(this),this.context.setDefault()},vr.prototype.renderLayer=function(i,o,n,s){n.isHidden(this.transform.zoom)||(n.type==="background"||n.type==="custom"||s.length)&&(this.id=n.id,this.gpuTimingStart(n),Co[n.type](i,o,n,s,this.style.placement.variableOffsets),this.gpuTimingEnd())},vr.prototype.gpuTimingStart=function(i){if(this.options.gpuTiming){var o=this.context.extTimerQuery,n=this.gpuTimers[i.id];n||(n=this.gpuTimers[i.id]={calls:0,cpuTime:0,query:o.createQueryEXT()}),n.calls++,o.beginQueryEXT(o.TIME_ELAPSED_EXT,n.query)}},vr.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var i=this.context.extTimerQuery;i.endQueryEXT(i.TIME_ELAPSED_EXT)}},vr.prototype.collectGpuTimers=function(){var i=this.gpuTimers;return this.gpuTimers={},i},vr.prototype.queryGpuTimers=function(i){var o={};for(var n in i){var s=i[n],p=this.context.extTimerQuery,f=p.getQueryObjectEXT(s.query,p.QUERY_RESULT_EXT)/1e6;p.deleteQueryEXT(s.query),o[n]=f}return o},vr.prototype.translatePosMatrix=function(i,o,n,s,p){if(!n[0]&&!n[1])return i;var f=p?s==="map"?this.transform.angle:0:s==="viewport"?-this.transform.angle:0;if(f){var d=Math.sin(f),v=Math.cos(f);n=[n[0]*v-n[1]*d,n[0]*d+n[1]*v]}var w=[p?n[0]:yr(o,n[0],this.transform.zoom),p?n[1]:yr(o,n[1],this.transform.zoom),0],A=new Float32Array(16);return u.translate(A,i,w),A},vr.prototype.saveTileTexture=function(i){var o=this._tileTextures[i.size[0]];o?o.push(i):this._tileTextures[i.size[0]]=[i]},vr.prototype.getTileTexture=function(i){var o=this._tileTextures[i];return o&&o.length>0?o.pop():null},vr.prototype.isPatternMissing=function(i){if(!i)return!1;if(!i.from||!i.to)return!0;var o=this.imageManager.getPattern(i.from.toString()),n=this.imageManager.getPattern(i.to.toString());return!o||!n},vr.prototype.useProgram=function(i,o){this.cache=this.cache||{};var n=""+i+(o?o.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[n]||(this.cache[n]=new gl(this.context,i,Lc[i],o,El[i],this._showOverdrawInspector)),this.cache[n]},vr.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},vr.prototype.setBaseState=function(){var i=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(i.FUNC_ADD)},vr.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=u.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new u.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},vr.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var ls=function(i,o){this.points=i,this.planes=o};ls.fromInvProjectionMatrix=function(i,o,n){var s=Math.pow(2,n),p=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(d){return u.transformMat4([],d,i)})).map((function(d){return u.scale$1([],d,1/d[3]/o*s)})),f=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(d){var v=u.sub([],p[d[0]],p[d[1]]),w=u.sub([],p[d[2]],p[d[1]]),A=u.normalize([],u.cross([],v,w)),R=-u.dot(A,p[d[1]]);return A.concat(R)}));return new ls(p,f)};var ko=function(i,o){this.min=i,this.max=o,this.center=u.scale$2([],u.add([],this.min,this.max),.5)};ko.prototype.quadrant=function(i){for(var o=[i%2==0,i<2],n=u.clone$2(this.min),s=u.clone$2(this.max),p=0;p<o.length;p++)n[p]=o[p]?this.min[p]:this.center[p],s[p]=o[p]?this.center[p]:this.max[p];return s[2]=this.max[2],new ko(n,s)},ko.prototype.distanceX=function(i){return Math.max(Math.min(this.max[0],i[0]),this.min[0])-i[0]},ko.prototype.distanceY=function(i){return Math.max(Math.min(this.max[1],i[1]),this.min[1])-i[1]},ko.prototype.intersects=function(i){for(var o=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],n=!0,s=0;s<i.planes.length;s++){for(var p=i.planes[s],f=0,d=0;d<o.length;d++)f+=u.dot$1(p,o[d])>=0;if(f===0)return 0;f!==o.length&&(n=!1)}if(n)return 2;for(var v=0;v<3;v++){for(var w=Number.MAX_VALUE,A=-Number.MAX_VALUE,R=0;R<i.points.length;R++){var F=i.points[R][v]-this.min[v];w=Math.min(w,F),A=Math.max(A,F)}if(A<0||w>this.max[v]-this.min[v])return 0}return 1};var Qn=function(i,o,n,s){if(i===void 0&&(i=0),o===void 0&&(o=0),n===void 0&&(n=0),s===void 0&&(s=0),isNaN(i)||i<0||isNaN(o)||o<0||isNaN(n)||n<0||isNaN(s)||s<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=i,this.bottom=o,this.left=n,this.right=s};Qn.prototype.interpolate=function(i,o,n){return o.top!=null&&i.top!=null&&(this.top=u.number(i.top,o.top,n)),o.bottom!=null&&i.bottom!=null&&(this.bottom=u.number(i.bottom,o.bottom,n)),o.left!=null&&i.left!=null&&(this.left=u.number(i.left,o.left,n)),o.right!=null&&i.right!=null&&(this.right=u.number(i.right,o.right,n)),this},Qn.prototype.getCenter=function(i,o){var n=u.clamp((this.left+i-this.right)/2,0,i),s=u.clamp((this.top+o-this.bottom)/2,0,o);return new u.Point(n,s)},Qn.prototype.equals=function(i){return this.top===i.top&&this.bottom===i.bottom&&this.left===i.left&&this.right===i.right},Qn.prototype.clone=function(){return new Qn(this.top,this.bottom,this.left,this.right)},Qn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Dt=function(i,o,n,s,p){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=p===void 0||p,this._minZoom=i||0,this._maxZoom=o||22,this._minPitch=n??0,this._maxPitch=s??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new u.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Qn,this._posMatrixCache={},this._alignedPosMatrixCache={}},lr={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Dt.prototype.clone=function(){var i=new Dt(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return i.tileSize=this.tileSize,i.latRange=this.latRange,i.width=this.width,i.height=this.height,i._center=this._center,i.zoom=this.zoom,i.angle=this.angle,i._fov=this._fov,i._pitch=this._pitch,i._unmodified=this._unmodified,i._edgeInsets=this._edgeInsets.clone(),i._calcMatrices(),i},lr.minZoom.get=function(){return this._minZoom},lr.minZoom.set=function(i){this._minZoom!==i&&(this._minZoom=i,this.zoom=Math.max(this.zoom,i))},lr.maxZoom.get=function(){return this._maxZoom},lr.maxZoom.set=function(i){this._maxZoom!==i&&(this._maxZoom=i,this.zoom=Math.min(this.zoom,i))},lr.minPitch.get=function(){return this._minPitch},lr.minPitch.set=function(i){this._minPitch!==i&&(this._minPitch=i,this.pitch=Math.max(this.pitch,i))},lr.maxPitch.get=function(){return this._maxPitch},lr.maxPitch.set=function(i){this._maxPitch!==i&&(this._maxPitch=i,this.pitch=Math.min(this.pitch,i))},lr.renderWorldCopies.get=function(){return this._renderWorldCopies},lr.renderWorldCopies.set=function(i){i===void 0?i=!0:i===null&&(i=!1),this._renderWorldCopies=i},lr.worldSize.get=function(){return this.tileSize*this.scale},lr.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},lr.size.get=function(){return new u.Point(this.width,this.height)},lr.bearing.get=function(){return-this.angle/Math.PI*180},lr.bearing.set=function(i){var o=-u.wrap(i,-180,180)*Math.PI/180;this.angle!==o&&(this._unmodified=!1,this.angle=o,this._calcMatrices(),this.rotationMatrix=u.create$2(),u.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},lr.pitch.get=function(){return this._pitch/Math.PI*180},lr.pitch.set=function(i){var o=u.clamp(i,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==o&&(this._unmodified=!1,this._pitch=o,this._calcMatrices())},lr.fov.get=function(){return this._fov/Math.PI*180},lr.fov.set=function(i){i=Math.max(.01,Math.min(60,i)),this._fov!==i&&(this._unmodified=!1,this._fov=i/180*Math.PI,this._calcMatrices())},lr.zoom.get=function(){return this._zoom},lr.zoom.set=function(i){var o=Math.min(Math.max(i,this.minZoom),this.maxZoom);this._zoom!==o&&(this._unmodified=!1,this._zoom=o,this.scale=this.zoomScale(o),this.tileZoom=Math.floor(o),this.zoomFraction=o-this.tileZoom,this._constrain(),this._calcMatrices())},lr.center.get=function(){return this._center},lr.center.set=function(i){i.lat===this._center.lat&&i.lng===this._center.lng||(this._unmodified=!1,this._center=i,this._constrain(),this._calcMatrices())},lr.padding.get=function(){return this._edgeInsets.toJSON()},lr.padding.set=function(i){this._edgeInsets.equals(i)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,i,1),this._calcMatrices())},lr.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Dt.prototype.isPaddingEqual=function(i){return this._edgeInsets.equals(i)},Dt.prototype.interpolatePadding=function(i,o,n){this._unmodified=!1,this._edgeInsets.interpolate(i,o,n),this._constrain(),this._calcMatrices()},Dt.prototype.coveringZoomLevel=function(i){var o=(i.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/i.tileSize));return Math.max(0,o)},Dt.prototype.getVisibleUnwrappedCoordinates=function(i){var o=[new u.UnwrappedTileID(0,i)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new u.Point(0,0)),s=this.pointCoordinate(new u.Point(this.width,0)),p=this.pointCoordinate(new u.Point(this.width,this.height)),f=this.pointCoordinate(new u.Point(0,this.height)),d=Math.floor(Math.min(n.x,s.x,p.x,f.x)),v=Math.floor(Math.max(n.x,s.x,p.x,f.x)),w=d-1;w<=v+1;w++)w!==0&&o.push(new u.UnwrappedTileID(w,i));return o},Dt.prototype.coveringTiles=function(i){var o=this.coveringZoomLevel(i),n=o;if(i.minzoom!==void 0&&o<i.minzoom)return[];i.maxzoom!==void 0&&o>i.maxzoom&&(o=i.maxzoom);var s=u.MercatorCoordinate.fromLngLat(this.center),p=Math.pow(2,o),f=[p*s.x,p*s.y,0],d=ls.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,o),v=i.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(v=o);var w=function(Ce){return{aabb:new ko([Ce*p,0,0],[(Ce+1)*p,p,0]),zoom:0,x:0,y:0,wrap:Ce,fullyVisible:!1}},A=[],R=[],F=o,O=i.reparseOverscaled?n:o;if(this._renderWorldCopies)for(var W=1;W<=3;W++)A.push(w(-W)),A.push(w(W));for(A.push(w(0));A.length>0;){var Z=A.pop(),ee=Z.x,N=Z.y,Q=Z.fullyVisible;if(!Q){var ne=Z.aabb.intersects(d);if(ne===0)continue;Q=ne===2}var ue=Z.aabb.distanceX(f),me=Z.aabb.distanceY(f),pe=Math.max(Math.abs(ue),Math.abs(me));if(Z.zoom===F||pe>3+(1<<F-Z.zoom)-2&&Z.zoom>=v)R.push({tileID:new u.OverscaledTileID(Z.zoom===F?O:Z.zoom,Z.wrap,Z.zoom,ee,N),distanceSq:u.sqrLen([f[0]-.5-ee,f[1]-.5-N])});else for(var ve=0;ve<4;ve++){var Te=(ee<<1)+ve%2,ke=(N<<1)+(ve>>1);A.push({aabb:Z.aabb.quadrant(ve),zoom:Z.zoom+1,x:Te,y:ke,wrap:Z.wrap,fullyVisible:Q})}}return R.sort((function(Ce,$e){return Ce.distanceSq-$e.distanceSq})).map((function(Ce){return Ce.tileID}))},Dt.prototype.resize=function(i,o){this.width=i,this.height=o,this.pixelsToGLUnits=[2/i,-2/o],this._constrain(),this._calcMatrices()},lr.unmodified.get=function(){return this._unmodified},Dt.prototype.zoomScale=function(i){return Math.pow(2,i)},Dt.prototype.scaleZoom=function(i){return Math.log(i)/Math.LN2},Dt.prototype.project=function(i){var o=u.clamp(i.lat,-this.maxValidLatitude,this.maxValidLatitude);return new u.Point(u.mercatorXfromLng(i.lng)*this.worldSize,u.mercatorYfromLat(o)*this.worldSize)},Dt.prototype.unproject=function(i){return new u.MercatorCoordinate(i.x/this.worldSize,i.y/this.worldSize).toLngLat()},lr.point.get=function(){return this.project(this.center)},Dt.prototype.setLocationAtPoint=function(i,o){var n=this.pointCoordinate(o),s=this.pointCoordinate(this.centerPoint),p=this.locationCoordinate(i),f=new u.MercatorCoordinate(p.x-(n.x-s.x),p.y-(n.y-s.y));this.center=this.coordinateLocation(f),this._renderWorldCopies&&(this.center=this.center.wrap())},Dt.prototype.locationPoint=function(i){return this.coordinatePoint(this.locationCoordinate(i))},Dt.prototype.pointLocation=function(i){return this.coordinateLocation(this.pointCoordinate(i))},Dt.prototype.locationCoordinate=function(i){return u.MercatorCoordinate.fromLngLat(i)},Dt.prototype.coordinateLocation=function(i){return i.toLngLat()},Dt.prototype.pointCoordinate=function(i){var o=[i.x,i.y,0,1],n=[i.x,i.y,1,1];u.transformMat4(o,o,this.pixelMatrixInverse),u.transformMat4(n,n,this.pixelMatrixInverse);var s=o[3],p=n[3],f=o[1]/s,d=n[1]/p,v=o[2]/s,w=n[2]/p,A=v===w?0:(0-v)/(w-v);return new u.MercatorCoordinate(u.number(o[0]/s,n[0]/p,A)/this.worldSize,u.number(f,d,A)/this.worldSize)},Dt.prototype.coordinatePoint=function(i){var o=[i.x*this.worldSize,i.y*this.worldSize,0,1];return u.transformMat4(o,o,this.pixelMatrix),new u.Point(o[0]/o[3],o[1]/o[3])},Dt.prototype.getBounds=function(){return new u.LngLatBounds().extend(this.pointLocation(new u.Point(0,0))).extend(this.pointLocation(new u.Point(this.width,0))).extend(this.pointLocation(new u.Point(this.width,this.height))).extend(this.pointLocation(new u.Point(0,this.height)))},Dt.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new u.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Dt.prototype.setMaxBounds=function(i){i?(this.lngRange=[i.getWest(),i.getEast()],this.latRange=[i.getSouth(),i.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Dt.prototype.calculatePosMatrix=function(i,o){o===void 0&&(o=!1);var n=i.key,s=o?this._alignedPosMatrixCache:this._posMatrixCache;if(s[n])return s[n];var p=i.canonical,f=this.worldSize/this.zoomScale(p.z),d=p.x+Math.pow(2,p.z)*i.wrap,v=u.identity(new Float64Array(16));return u.translate(v,v,[d*f,p.y*f,0]),u.scale(v,v,[f/u.EXTENT,f/u.EXTENT,1]),u.multiply(v,o?this.alignedProjMatrix:this.projMatrix,v),s[n]=new Float32Array(v),s[n]},Dt.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Dt.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var i,o,n,s,p=-90,f=90,d=-180,v=180,w=this.size,A=this._unmodified;if(this.latRange){var R=this.latRange;p=u.mercatorYfromLat(R[1])*this.worldSize,i=(f=u.mercatorYfromLat(R[0])*this.worldSize)-p<w.y?w.y/(f-p):0}if(this.lngRange){var F=this.lngRange;d=u.mercatorXfromLng(F[0])*this.worldSize,o=(v=u.mercatorXfromLng(F[1])*this.worldSize)-d<w.x?w.x/(v-d):0}var O=this.point,W=Math.max(o||0,i||0);if(W)return this.center=this.unproject(new u.Point(o?(v+d)/2:O.x,i?(f+p)/2:O.y)),this.zoom+=this.scaleZoom(W),this._unmodified=A,void(this._constraining=!1);if(this.latRange){var Z=O.y,ee=w.y/2;Z-ee<p&&(s=p+ee),Z+ee>f&&(s=f-ee)}if(this.lngRange){var N=O.x,Q=w.x/2;N-Q<d&&(n=d+Q),N+Q>v&&(n=v-Q)}n===void 0&&s===void 0||(this.center=this.unproject(new u.Point(n!==void 0?n:O.x,s!==void 0?s:O.y))),this._unmodified=A,this._constraining=!1}},Dt.prototype._calcMatrices=function(){if(this.height){var i=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var o=Math.PI/2+this._pitch,n=this._fov*(.5+i.y/this.height),s=Math.sin(n)*this.cameraToCenterDistance/Math.sin(u.clamp(Math.PI-o-n,.01,Math.PI-.01)),p=this.point,f=p.x,d=p.y,v=1.01*(Math.cos(Math.PI/2-this._pitch)*s+this.cameraToCenterDistance),w=this.height/50,A=new Float64Array(16);u.perspective(A,this._fov,this.width/this.height,w,v),A[8]=2*-i.x/this.width,A[9]=2*i.y/this.height,u.scale(A,A,[1,-1,1]),u.translate(A,A,[0,0,-this.cameraToCenterDistance]),u.rotateX(A,A,this._pitch),u.rotateZ(A,A,this.angle),u.translate(A,A,[-f,-d,0]),this.mercatorMatrix=u.scale([],A,[this.worldSize,this.worldSize,this.worldSize]),u.scale(A,A,[1,1,u.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=A,this.invProjMatrix=u.invert([],this.projMatrix);var R=this.width%2/2,F=this.height%2/2,O=Math.cos(this.angle),W=Math.sin(this.angle),Z=f-Math.round(f)+O*R+W*F,ee=d-Math.round(d)+O*F+W*R,N=new Float64Array(A);if(u.translate(N,N,[Z>.5?Z-1:Z,ee>.5?ee-1:ee,0]),this.alignedProjMatrix=N,A=u.create(),u.scale(A,A,[this.width/2,-this.height/2,1]),u.translate(A,A,[1,-1,0]),this.labelPlaneMatrix=A,A=u.create(),u.scale(A,A,[1,-1,1]),u.translate(A,A,[-1,-1,0]),u.scale(A,A,[2/this.width,2/this.height,1]),this.glCoordMatrix=A,this.pixelMatrix=u.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(A=u.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=A,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Dt.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var i=this.pointCoordinate(new u.Point(0,0)),o=[i.x*this.worldSize,i.y*this.worldSize,0,1];return u.transformMat4(o,o,this.pixelMatrix)[3]/this.cameraToCenterDistance},Dt.prototype.getCameraPoint=function(){var i=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new u.Point(0,i))},Dt.prototype.getCameraQueryGeometry=function(i){var o=this.getCameraPoint();if(i.length===1)return[i[0],o];for(var n=o.x,s=o.y,p=o.x,f=o.y,d=0,v=i;d<v.length;d+=1){var w=v[d];n=Math.min(n,w.x),s=Math.min(s,w.y),p=Math.max(p,w.x),f=Math.max(f,w.y)}return[new u.Point(n,s),new u.Point(p,s),new u.Point(p,f),new u.Point(n,f),new u.Point(n,s)]},Object.defineProperties(Dt.prototype,lr);var Yi=function(i){var o,n,s,p;this._hashName=i&&encodeURIComponent(i),u.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(o=this._updateHashUnthrottled.bind(this),n=!1,s=null,p=function(){s=null,n&&(o(),s=setTimeout(p,300),n=!1)},function(){return n=!0,s||p(),s})};Yi.prototype.addTo=function(i){return this._map=i,u.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Yi.prototype.remove=function(){return u.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Yi.prototype.getHashString=function(i){var o=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,s=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),p=Math.pow(10,s),f=Math.round(o.lng*p)/p,d=Math.round(o.lat*p)/p,v=this._map.getBearing(),w=this._map.getPitch(),A="";if(A+=i?"/"+f+"/"+d+"/"+n:n+"/"+d+"/"+f,(v||w)&&(A+="/"+Math.round(10*v)/10),w&&(A+="/"+Math.round(w)),this._hashName){var R=this._hashName,F=!1,O=u.window.location.hash.slice(1).split("&").map((function(W){var Z=W.split("=")[0];return Z===R?(F=!0,Z+"="+A):W})).filter((function(W){return W}));return F||O.push(R+"="+A),"#"+O.join("&")}return"#"+A},Yi.prototype._getCurrentHash=function(){var i,o=this,n=u.window.location.hash.replace("#","");return this._hashName?(n.split("&").map((function(s){return s.split("=")})).forEach((function(s){s[0]===o._hashName&&(i=s)})),(i&&i[1]||"").split("/")):n.split("/")},Yi.prototype._onHashChange=function(){var i=this._getCurrentHash();if(i.length>=3&&!i.some((function(n){return isNaN(n)}))){var o=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(i[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+i[2],+i[1]],zoom:+i[0],bearing:o,pitch:+(i[4]||0)}),!0}return!1},Yi.prototype._updateHashUnthrottled=function(){var i=u.window.location.href.replace(/(#.+)?$/,this.getHashString());try{u.window.history.replaceState(u.window.history.state,null,i)}catch{}};var Aa={linearity:.3,easing:u.bezier(0,0,.3,1)},Qo=u.extend({deceleration:2500,maxSpeed:1400},Aa),Ea=u.extend({deceleration:20,maxSpeed:1400},Aa),qc=u.extend({deceleration:1e3,maxSpeed:360},Aa),Uc=u.extend({deceleration:1e3,maxSpeed:90},Aa),Pa=function(i){this._map=i,this.clear()};function Ca(i,o){(!i.duration||i.duration<o.duration)&&(i.duration=o.duration,i.easing=o.easing)}function Rn(i,o,n){var s=n.maxSpeed,p=n.linearity,f=n.deceleration,d=u.clamp(i*p/(o/1e3),-s,s),v=Math.abs(d)/(f*p);return{easing:n.easing,duration:1e3*v,amount:d*(v/2)}}Pa.prototype.clear=function(){this._inertiaBuffer=[]},Pa.prototype.record=function(i){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.browser.now(),settings:i})},Pa.prototype._drainInertiaBuffer=function(){for(var i=this._inertiaBuffer,o=u.browser.now();i.length>0&&o-i[0].time>160;)i.shift()},Pa.prototype._onMoveEnd=function(i){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var o={zoom:0,bearing:0,pitch:0,pan:new u.Point(0,0),pinchAround:void 0,around:void 0},n=0,s=this._inertiaBuffer;n<s.length;n+=1){var p=s[n].settings;o.zoom+=p.zoomDelta||0,o.bearing+=p.bearingDelta||0,o.pitch+=p.pitchDelta||0,p.panDelta&&o.pan._add(p.panDelta),p.around&&(o.around=p.around),p.pinchAround&&(o.pinchAround=p.pinchAround)}var f=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,d={};if(o.pan.mag()){var v=Rn(o.pan.mag(),f,u.extend({},Qo,i||{}));d.offset=o.pan.mult(v.amount/o.pan.mag()),d.center=this._map.transform.center,Ca(d,v)}if(o.zoom){var w=Rn(o.zoom,f,Ea);d.zoom=this._map.transform.zoom+w.amount,Ca(d,w)}if(o.bearing){var A=Rn(o.bearing,f,qc);d.bearing=this._map.transform.bearing+u.clamp(A.amount,-179,179),Ca(d,A)}if(o.pitch){var R=Rn(o.pitch,f,Uc);d.pitch=this._map.transform.pitch+R.amount,Ca(d,R)}if(d.zoom||d.bearing){var F=o.pinchAround===void 0?o.around:o.pinchAround;d.around=F?this._map.unproject(F):this._map.getCenter()}return this.clear(),u.extend(d,{noMoveStart:!0})}};var Gr=(function(i){function o(s,p,f,d){d===void 0&&(d={});var v=M.mousePos(p.getCanvasContainer(),f),w=p.unproject(v);i.call(this,s,u.extend({point:v,lngLat:w,originalEvent:f},d)),this._defaultPrevented=!1,this.target=p}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o})(u.Event),ka=(function(i){function o(s,p,f){var d=s==="touchend"?f.changedTouches:f.touches,v=M.touchPos(p.getCanvasContainer(),d),w=v.map((function(F){return p.unproject(F)})),A=v.reduce((function(F,O,W,Z){return F.add(O.div(Z.length))}),new u.Point(0,0)),R=p.unproject(A);i.call(this,s,{points:v,point:A,lngLats:w,lngLat:R,originalEvent:f}),this._defaultPrevented=!1}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o})(u.Event),Dl=(function(i){function o(s,p,f){i.call(this,s,{originalEvent:f}),this._defaultPrevented=!1}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o})(u.Event),qr=function(i,o){this._map=i,this._clickTolerance=o.clickTolerance};qr.prototype.reset=function(){delete this._mousedownPos},qr.prototype.wheel=function(i){return this._firePreventable(new Dl(i.type,this._map,i))},qr.prototype.mousedown=function(i,o){return this._mousedownPos=o,this._firePreventable(new Gr(i.type,this._map,i))},qr.prototype.mouseup=function(i){this._map.fire(new Gr(i.type,this._map,i))},qr.prototype.click=function(i,o){this._mousedownPos&&this._mousedownPos.dist(o)>=this._clickTolerance||this._map.fire(new Gr(i.type,this._map,i))},qr.prototype.dblclick=function(i){return this._firePreventable(new Gr(i.type,this._map,i))},qr.prototype.mouseover=function(i){this._map.fire(new Gr(i.type,this._map,i))},qr.prototype.mouseout=function(i){this._map.fire(new Gr(i.type,this._map,i))},qr.prototype.touchstart=function(i){return this._firePreventable(new ka(i.type,this._map,i))},qr.prototype.touchmove=function(i){this._map.fire(new ka(i.type,this._map,i))},qr.prototype.touchend=function(i){this._map.fire(new ka(i.type,this._map,i))},qr.prototype.touchcancel=function(i){this._map.fire(new ka(i.type,this._map,i))},qr.prototype._firePreventable=function(i){if(this._map.fire(i),i.defaultPrevented)return{}},qr.prototype.isEnabled=function(){return!0},qr.prototype.isActive=function(){return!1},qr.prototype.enable=function(){},qr.prototype.disable=function(){};var Xe=function(i){this._map=i};Xe.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Xe.prototype.mousemove=function(i){this._map.fire(new Gr(i.type,this._map,i))},Xe.prototype.mousedown=function(){this._delayContextMenu=!0},Xe.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Gr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Xe.prototype.contextmenu=function(i){this._delayContextMenu?this._contextMenuEvent=i:this._map.fire(new Gr(i.type,this._map,i)),this._map.listens("contextmenu")&&i.preventDefault()},Xe.prototype.isEnabled=function(){return!0},Xe.prototype.isActive=function(){return!1},Xe.prototype.enable=function(){},Xe.prototype.disable=function(){};var Ni=function(i,o){this._map=i,this._el=i.getCanvasContainer(),this._container=i.getContainer(),this._clickTolerance=o.clickTolerance||1};function cs(i,o){for(var n={},s=0;s<i.length;s++)n[i[s].identifier]=o[s];return n}Ni.prototype.isEnabled=function(){return!!this._enabled},Ni.prototype.isActive=function(){return!!this._active},Ni.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Ni.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Ni.prototype.mousedown=function(i,o){this.isEnabled()&&i.shiftKey&&i.button===0&&(M.disableDrag(),this._startPos=this._lastPos=o,this._active=!0)},Ni.prototype.mousemoveWindow=function(i,o){if(this._active){var n=o;if(!(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)){var s=this._startPos;this._lastPos=n,this._box||(this._box=M.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",i));var p=Math.min(s.x,n.x),f=Math.max(s.x,n.x),d=Math.min(s.y,n.y),v=Math.max(s.y,n.y);M.setTransform(this._box,"translate("+p+"px,"+d+"px)"),this._box.style.width=f-p+"px",this._box.style.height=v-d+"px"}}},Ni.prototype.mouseupWindow=function(i,o){var n=this;if(this._active&&i.button===0){var s=this._startPos,p=o;if(this.reset(),M.suppressClick(),s.x!==p.x||s.y!==p.y)return this._map.fire(new u.Event("boxzoomend",{originalEvent:i})),{cameraAnimation:function(f){return f.fitScreenCoordinates(s,p,n._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",i)}},Ni.prototype.keydown=function(i){this._active&&i.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",i))},Ni.prototype.blur=function(){this.reset()},Ni.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(M.remove(this._box),this._box=null),M.enableDrag(),delete this._startPos,delete this._lastPos},Ni.prototype._fireEvent=function(i,o){return this._map.fire(new u.Event(i,{originalEvent:o}))};var ea=function(i){this.reset(),this.numTouches=i.numTouches};ea.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},ea.prototype.touchstart=function(i,o,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=i.timeStamp),n.length===this.numTouches&&(this.centroid=(function(s){for(var p=new u.Point(0,0),f=0,d=s;f<d.length;f+=1)p._add(d[f]);return p.div(s.length)})(o),this.touches=cs(n,o)))},ea.prototype.touchmove=function(i,o,n){if(!this.aborted&&this.centroid){var s=cs(n,o);for(var p in this.touches){var f=s[p];(!f||f.dist(this.touches[p])>30)&&(this.aborted=!0)}}},ea.prototype.touchend=function(i,o,n){if((!this.centroid||i.timeStamp-this.startTime>500)&&(this.aborted=!0),n.length===0){var s=!this.aborted&&this.centroid;if(this.reset(),s)return s}};var gn=function(i){this.singleTap=new ea(i),this.numTaps=i.numTaps,this.reset()};gn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},gn.prototype.touchstart=function(i,o,n){this.singleTap.touchstart(i,o,n)},gn.prototype.touchmove=function(i,o,n){this.singleTap.touchmove(i,o,n)},gn.prototype.touchend=function(i,o,n){var s=this.singleTap.touchend(i,o,n);if(s){var p=i.timeStamp-this.lastTime<500,f=!this.lastTap||this.lastTap.dist(s)<30;if(p&&f||this.reset(),this.count++,this.lastTime=i.timeStamp,this.lastTap=s,this.count===this.numTaps)return this.reset(),s}};var ji=function(){this._zoomIn=new gn({numTouches:1,numTaps:2}),this._zoomOut=new gn({numTouches:2,numTaps:1}),this.reset()};ji.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},ji.prototype.touchstart=function(i,o,n){this._zoomIn.touchstart(i,o,n),this._zoomOut.touchstart(i,o,n)},ji.prototype.touchmove=function(i,o,n){this._zoomIn.touchmove(i,o,n),this._zoomOut.touchmove(i,o,n)},ji.prototype.touchend=function(i,o,n){var s=this,p=this._zoomIn.touchend(i,o,n),f=this._zoomOut.touchend(i,o,n);return p?(this._active=!0,i.preventDefault(),setTimeout((function(){return s.reset()}),0),{cameraAnimation:function(d){return d.easeTo({duration:300,zoom:d.getZoom()+1,around:d.unproject(p)},{originalEvent:i})}}):f?(this._active=!0,i.preventDefault(),setTimeout((function(){return s.reset()}),0),{cameraAnimation:function(d){return d.easeTo({duration:300,zoom:d.getZoom()-1,around:d.unproject(f)},{originalEvent:i})}}):void 0},ji.prototype.touchcancel=function(){this.reset()},ji.prototype.enable=function(){this._enabled=!0},ji.prototype.disable=function(){this._enabled=!1,this.reset()},ji.prototype.isEnabled=function(){return this._enabled},ji.prototype.isActive=function(){return this._active};var yu={0:1,2:2},Re=function(i){this.reset(),this._clickTolerance=i.clickTolerance||1};Re.prototype.blur=function(){this.reset()},Re.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Re.prototype._correctButton=function(i,o){return!1},Re.prototype._move=function(i,o){return{}},Re.prototype.mousedown=function(i,o){if(!this._lastPoint){var n=M.mouseButton(i);this._correctButton(i,n)&&(this._lastPoint=o,this._eventButton=n)}},Re.prototype.mousemoveWindow=function(i,o){var n=this._lastPoint;if(n){if(i.preventDefault(),(function(s,p){var f=yu[p];return s.buttons===void 0||(s.buttons&f)!==f})(i,this._eventButton))this.reset();else if(this._moved||!(o.dist(n)<this._clickTolerance))return this._moved=!0,this._lastPoint=o,this._move(n,o)}},Re.prototype.mouseupWindow=function(i){this._lastPoint&&M.mouseButton(i)===this._eventButton&&(this._moved&&M.suppressClick(),this.reset())},Re.prototype.enable=function(){this._enabled=!0},Re.prototype.disable=function(){this._enabled=!1,this.reset()},Re.prototype.isEnabled=function(){return this._enabled},Re.prototype.isActive=function(){return this._active};var vu=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.mousedown=function(n,s){i.prototype.mousedown.call(this,n,s),this._lastPoint&&(this._active=!0)},o.prototype._correctButton=function(n,s){return s===0&&!n.ctrlKey},o.prototype._move=function(n,s){return{around:s,panDelta:s.sub(n)}},o})(Re),ps=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},o.prototype._move=function(n,s){var p=.8*(s.x-n.x);if(p)return this._active=!0,{bearingDelta:p}},o.prototype.contextmenu=function(n){n.preventDefault()},o})(Re),gu=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},o.prototype._move=function(n,s){var p=-.5*(s.y-n.y);if(p)return this._active=!0,{pitchDelta:p}},o.prototype.contextmenu=function(n){n.preventDefault()},o})(Re),sn=function(i){this._minTouches=1,this._clickTolerance=i.clickTolerance||1,this.reset()};sn.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new u.Point(0,0)},sn.prototype.touchstart=function(i,o,n){return this._calculateTransform(i,o,n)},sn.prototype.touchmove=function(i,o,n){if(this._active&&!(n.length<this._minTouches))return i.preventDefault(),this._calculateTransform(i,o,n)},sn.prototype.touchend=function(i,o,n){this._calculateTransform(i,o,n),this._active&&n.length<this._minTouches&&this.reset()},sn.prototype.touchcancel=function(){this.reset()},sn.prototype._calculateTransform=function(i,o,n){n.length>0&&(this._active=!0);var s=cs(n,o),p=new u.Point(0,0),f=new u.Point(0,0),d=0;for(var v in s){var w=s[v],A=this._touches[v];A&&(p._add(w),f._add(w.sub(A)),d++,s[v]=w)}if(this._touches=s,!(d<this._minTouches)&&f.mag()){var R=f.div(d);if(this._sum._add(R),!(this._sum.mag()<this._clickTolerance))return{around:p.div(d),panDelta:R}}},sn.prototype.enable=function(){this._enabled=!0},sn.prototype.disable=function(){this._enabled=!1,this.reset()},sn.prototype.isEnabled=function(){return this._enabled},sn.prototype.isActive=function(){return this._active};var Gi=function(){this.reset()};function hs(i,o,n){for(var s=0;s<i.length;s++)if(i[s].identifier===n)return o[s]}function fs(i,o){return Math.log(i/o)/Math.LN2}Gi.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Gi.prototype._start=function(i){},Gi.prototype._move=function(i,o,n){return{}},Gi.prototype.touchstart=function(i,o,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([o[0],o[1]]))},Gi.prototype.touchmove=function(i,o,n){if(this._firstTwoTouches){i.preventDefault();var s=this._firstTwoTouches,p=s[1],f=hs(n,o,s[0]),d=hs(n,o,p);if(f&&d){var v=this._aroundCenter?null:f.add(d).div(2);return this._move([f,d],v,i)}}},Gi.prototype.touchend=function(i,o,n){if(this._firstTwoTouches){var s=this._firstTwoTouches,p=s[1],f=hs(n,o,s[0]),d=hs(n,o,p);f&&d||(this._active&&M.suppressClick(),this.reset())}},Gi.prototype.touchcancel=function(){this.reset()},Gi.prototype.enable=function(i){this._enabled=!0,this._aroundCenter=!!i&&i.around==="center"},Gi.prototype.disable=function(){this._enabled=!1,this.reset()},Gi.prototype.isEnabled=function(){return this._enabled},Gi.prototype.isActive=function(){return this._active};var $i=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),delete this._distance,delete this._startDistance},o.prototype._start=function(n){this._startDistance=this._distance=n[0].dist(n[1])},o.prototype._move=function(n,s){var p=this._distance;if(this._distance=n[0].dist(n[1]),this._active||!(Math.abs(fs(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:fs(this._distance,p),pinchAround:s}},o})(Gi);function Ln(i,o){return 180*i.angleWith(o)/Math.PI}var Rl=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},o.prototype._start=function(n){this._startVector=this._vector=n[0].sub(n[1]),this._minDiameter=n[0].dist(n[1])},o.prototype._move=function(n,s){var p=this._vector;if(this._vector=n[0].sub(n[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Ln(this._vector,p),pinchAround:s}},o.prototype._isBelowThreshold=function(n){this._minDiameter=Math.min(this._minDiameter,n.mag());var s=25/(Math.PI*this._minDiameter)*360,p=Ln(n,this._startVector);return Math.abs(p)<s},o})(Gi);function Ma(i){return Math.abs(i.y)>Math.abs(i.x)}var _u=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},o.prototype._start=function(n){this._lastPoints=n,Ma(n[0].sub(n[1]))&&(this._valid=!1)},o.prototype._move=function(n,s,p){var f=n[0].sub(this._lastPoints[0]),d=n[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(f,d,p.timeStamp),this._valid)return this._lastPoints=n,this._active=!0,{pitchDelta:(f.y+d.y)/2*-.5}},o.prototype.gestureBeginsVertically=function(n,s,p){if(this._valid!==void 0)return this._valid;var f=n.mag()>=2,d=s.mag()>=2;if(f||d){if(!f||!d)return this._firstMove===void 0&&(this._firstMove=p),p-this._firstMove<100&&void 0;var v=n.y>0==s.y>0;return Ma(n)&&Ma(s)&&v}},o})(Gi),xu={panStep:100,bearingStep:15,pitchStep:10},_n=function(){var i=xu;this._panStep=i.panStep,this._bearingStep=i.bearingStep,this._pitchStep=i.pitchStep,this._rotationDisabled=!1};function Qi(i){return i*(2-i)}_n.prototype.blur=function(){this.reset()},_n.prototype.reset=function(){this._active=!1},_n.prototype.keydown=function(i){var o=this;if(!(i.altKey||i.ctrlKey||i.metaKey)){var n=0,s=0,p=0,f=0,d=0;switch(i.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:i.shiftKey?s=-1:(i.preventDefault(),f=-1);break;case 39:i.shiftKey?s=1:(i.preventDefault(),f=1);break;case 38:i.shiftKey?p=1:(i.preventDefault(),d=-1);break;case 40:i.shiftKey?p=-1:(i.preventDefault(),d=1);break;default:return}return this._rotationDisabled&&(s=0,p=0),{cameraAnimation:function(v){var w=v.getZoom();v.easeTo({duration:300,easeId:"keyboardHandler",easing:Qi,zoom:n?Math.round(w)+n*(i.shiftKey?2:1):w,bearing:v.getBearing()+s*o._bearingStep,pitch:v.getPitch()+p*o._pitchStep,offset:[-f*o._panStep,-d*o._panStep],center:v.getCenter()},{originalEvent:i})}}}},_n.prototype.enable=function(){this._enabled=!0},_n.prototype.disable=function(){this._enabled=!1,this.reset()},_n.prototype.isEnabled=function(){return this._enabled},_n.prototype.isActive=function(){return this._active},_n.prototype.disableRotation=function(){this._rotationDisabled=!0},_n.prototype.enableRotation=function(){this._rotationDisabled=!1};var kt=function(i,o){this._map=i,this._el=i.getCanvasContainer(),this._handler=o,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,u.bindAll(["_onTimeout"],this)};kt.prototype.setZoomRate=function(i){this._defaultZoomRate=i},kt.prototype.setWheelZoomRate=function(i){this._wheelZoomRate=i},kt.prototype.isEnabled=function(){return!!this._enabled},kt.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},kt.prototype.isZooming=function(){return!!this._zooming},kt.prototype.enable=function(i){this.isEnabled()||(this._enabled=!0,this._aroundCenter=i&&i.around==="center")},kt.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},kt.prototype.wheel=function(i){if(this.isEnabled()){var o=i.deltaMode===u.window.WheelEvent.DOM_DELTA_LINE?40*i.deltaY:i.deltaY,n=u.browser.now(),s=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,o!==0&&o%4.000244140625==0?this._type="wheel":o!==0&&Math.abs(o)<4?this._type="trackpad":s>400?(this._type=null,this._lastValue=o,this._timeout=setTimeout(this._onTimeout,40,i)):this._type||(this._type=Math.abs(s*o)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,o+=this._lastValue)),i.shiftKey&&o&&(o/=4),this._type&&(this._lastWheelEvent=i,this._delta-=o,this._active||this._start(i)),i.preventDefault()}},kt.prototype._onTimeout=function(i){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)},kt.prototype._start=function(i){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var o=M.mousePos(this._el,i);this._around=u.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(o)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},kt.prototype.renderFrame=function(){var i=this;if(this._frameId&&(this._frameId=null,this.isActive())){var o=this._map.transform;if(this._delta!==0){var n=this._type==="wheel"&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,s=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&s!==0&&(s=1/s);var p=typeof this._targetZoom=="number"?o.zoomScale(this._targetZoom):o.scale;this._targetZoom=Math.min(o.maxZoom,Math.max(o.minZoom,o.scaleZoom(p*s))),this._type==="wheel"&&(this._startZoom=o.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var f,d=typeof this._targetZoom=="number"?this._targetZoom:o.zoom,v=this._startZoom,w=this._easing,A=!1;if(this._type==="wheel"&&v&&w){var R=Math.min((u.browser.now()-this._lastWheelEventTime)/200,1),F=w(R);f=u.number(v,d,F),R<1?this._frameId||(this._frameId=!0):A=!0}else f=d,A=!0;return this._active=!0,A&&(this._active=!1,this._finishTimeout=setTimeout((function(){i._zooming=!1,i._handler._triggerRenderFrame(),delete i._targetZoom,delete i._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!A,zoomDelta:f-o.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},kt.prototype._smoothOutEasing=function(i){var o=u.ease;if(this._prevEase){var n=this._prevEase,s=(u.browser.now()-n.start)/n.duration,p=n.easing(s+.01)-n.easing(s),f=.27/Math.sqrt(p*p+1e-4)*.01,d=Math.sqrt(.0729-f*f);o=u.bezier(f,d,.25,1)}return this._prevEase={start:u.browser.now(),duration:i,easing:o},o},kt.prototype.blur=function(){this.reset()},kt.prototype.reset=function(){this._active=!1};var Tn=function(i,o){this._clickZoom=i,this._tapZoom=o};Tn.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Tn.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Tn.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Tn.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var un=function(){this.reset()};un.prototype.reset=function(){this._active=!1},un.prototype.blur=function(){this.reset()},un.prototype.dblclick=function(i,o){return i.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(i.shiftKey?-1:1),around:n.unproject(o)},{originalEvent:i})}}},un.prototype.enable=function(){this._enabled=!0},un.prototype.disable=function(){this._enabled=!1,this.reset()},un.prototype.isEnabled=function(){return this._enabled},un.prototype.isActive=function(){return this._active};var yi=function(){this._tap=new gn({numTouches:1,numTaps:1}),this.reset()};yi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},yi.prototype.touchstart=function(i,o,n){this._swipePoint||(this._tapTime&&i.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=o[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(i,o,n))},yi.prototype.touchmove=function(i,o,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;var s=o[0],p=s.y-this._swipePoint.y;return this._swipePoint=s,i.preventDefault(),this._active=!0,{zoomDelta:p/128}}}else this._tap.touchmove(i,o,n)},yi.prototype.touchend=function(i,o,n){this._tapTime?this._swipePoint&&n.length===0&&this.reset():this._tap.touchend(i,o,n)&&(this._tapTime=i.timeStamp)},yi.prototype.touchcancel=function(){this.reset()},yi.prototype.enable=function(){this._enabled=!0},yi.prototype.disable=function(){this._enabled=!1,this.reset()},yi.prototype.isEnabled=function(){return this._enabled},yi.prototype.isActive=function(){return this._active};var Mo=function(i,o,n){this._el=i,this._mousePan=o,this._touchPan=n};Mo.prototype.enable=function(i){this._inertiaOptions=i||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Mo.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Mo.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Mo.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var eo=function(i,o,n){this._pitchWithRotate=i.pitchWithRotate,this._mouseRotate=o,this._mousePitch=n};eo.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},eo.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},eo.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},eo.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var xn=function(i,o,n,s){this._el=i,this._touchZoom=o,this._touchRotate=n,this._tapDragZoom=s,this._rotationDisabled=!1,this._enabled=!0};xn.prototype.enable=function(i){this._touchZoom.enable(i),this._rotationDisabled||this._touchRotate.enable(i),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},xn.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},xn.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},xn.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},xn.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},xn.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Ti=function(i){return i.zoom||i.drag||i.pitch||i.rotate},Ba=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o})(u.Event);function it(i){return i.panDelta&&i.panDelta.mag()||i.zoomDelta||i.bearingDelta||i.pitchDelta}var Ye=function(i,o){this._map=i,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Pa(i),this._bearingSnap=o.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(o),u.bindAll(["handleEvent","handleWindowEvent"],this);var n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[u.window.document,"mousemove",{capture:!0}],[u.window.document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[u.window,"blur",void 0]];for(var s=0,p=this._listeners;s<p.length;s+=1){var f=p[s],d=f[0];M.addEventListener(d,f[1],d===u.window.document?this.handleWindowEvent:this.handleEvent,f[2])}};Ye.prototype.destroy=function(){for(var i=0,o=this._listeners;i<o.length;i+=1){var n=o[i],s=n[0];M.removeEventListener(s,n[1],s===u.window.document?this.handleWindowEvent:this.handleEvent,n[2])}},Ye.prototype._addDefaultHandlers=function(i){var o=this._map,n=o.getCanvasContainer();this._add("mapEvent",new qr(o,i));var s=o.boxZoom=new Ni(o,i);this._add("boxZoom",s);var p=new ji,f=new un;o.doubleClickZoom=new Tn(f,p),this._add("tapZoom",p),this._add("clickZoom",f);var d=new yi;this._add("tapDragZoom",d);var v=o.touchPitch=new _u;this._add("touchPitch",v);var w=new ps(i),A=new gu(i);o.dragRotate=new eo(i,w,A),this._add("mouseRotate",w,["mousePitch"]),this._add("mousePitch",A,["mouseRotate"]);var R=new vu(i),F=new sn(i);o.dragPan=new Mo(n,R,F),this._add("mousePan",R),this._add("touchPan",F,["touchZoom","touchRotate"]);var O=new Rl,W=new $i;o.touchZoomRotate=new xn(n,W,O,d),this._add("touchRotate",O,["touchPan","touchZoom"]),this._add("touchZoom",W,["touchPan","touchRotate"]);var Z=o.scrollZoom=new kt(o,this);this._add("scrollZoom",Z,["mousePan"]);var ee=o.keyboard=new _n;this._add("keyboard",ee),this._add("blockableMapEvent",new Xe(o));for(var N=0,Q=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];N<Q.length;N+=1){var ne=Q[N];i.interactive&&i[ne]&&o[ne].enable(i[ne])}},Ye.prototype._add=function(i,o,n){this._handlers.push({handlerName:i,handler:o,allowed:n}),this._handlersById[i]=o},Ye.prototype.stop=function(i){if(!this._updatingCamera){for(var o=0,n=this._handlers;o<n.length;o+=1)n[o].handler.reset();this._inertia.clear(),this._fireEvents({},{},i),this._changes=[]}},Ye.prototype.isActive=function(){for(var i=0,o=this._handlers;i<o.length;i+=1)if(o[i].handler.isActive())return!0;return!1},Ye.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},Ye.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},Ye.prototype.isMoving=function(){return!!Ti(this._eventsInProgress)||this.isZooming()},Ye.prototype._blockedByActive=function(i,o,n){for(var s in i)if(s!==n&&(!o||o.indexOf(s)<0))return!0;return!1},Ye.prototype.handleWindowEvent=function(i){this.handleEvent(i,i.type+"Window")},Ye.prototype._getMapTouches=function(i){for(var o=[],n=0,s=i;n<s.length;n+=1){var p=s[n];this._el.contains(p.target)&&o.push(p)}return o},Ye.prototype.handleEvent=function(i,o){this._updatingCamera=!0;for(var n=i.type==="renderFrame"?void 0:i,s={needsRenderFrame:!1},p={},f={},d=i.touches?this._getMapTouches(i.touches):void 0,v=d?M.touchPos(this._el,d):M.mousePos(this._el,i),w=0,A=this._handlers;w<A.length;w+=1){var R=A[w],F=R.handlerName,O=R.handler,W=R.allowed;if(O.isEnabled()){var Z=void 0;this._blockedByActive(f,W,F)?O.reset():O[o||i.type]&&(Z=O[o||i.type](i,v,d),this.mergeHandlerResult(s,p,Z,F,n),Z&&Z.needsRenderFrame&&this._triggerRenderFrame()),(Z||O.isActive())&&(f[F]=O)}}var ee={};for(var N in this._previousActiveHandlers)f[N]||(ee[N]=n);this._previousActiveHandlers=f,(Object.keys(ee).length||it(s))&&(this._changes.push([s,p,ee]),this._triggerRenderFrame()),(Object.keys(f).length||it(s))&&this._map._stop(!0),this._updatingCamera=!1;var Q=s.cameraAnimation;Q&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],Q(this._map))},Ye.prototype.mergeHandlerResult=function(i,o,n,s,p){if(n){u.extend(i,n);var f={handlerName:s,originalEvent:n.originalEvent||p};n.zoomDelta!==void 0&&(o.zoom=f),n.panDelta!==void 0&&(o.drag=f),n.pitchDelta!==void 0&&(o.pitch=f),n.bearingDelta!==void 0&&(o.rotate=f)}},Ye.prototype._applyChanges=function(){for(var i={},o={},n={},s=0,p=this._changes;s<p.length;s+=1){var f=p[s],d=f[0],v=f[1],w=f[2];d.panDelta&&(i.panDelta=(i.panDelta||new u.Point(0,0))._add(d.panDelta)),d.zoomDelta&&(i.zoomDelta=(i.zoomDelta||0)+d.zoomDelta),d.bearingDelta&&(i.bearingDelta=(i.bearingDelta||0)+d.bearingDelta),d.pitchDelta&&(i.pitchDelta=(i.pitchDelta||0)+d.pitchDelta),d.around!==void 0&&(i.around=d.around),d.pinchAround!==void 0&&(i.pinchAround=d.pinchAround),d.noInertia&&(i.noInertia=d.noInertia),u.extend(o,v),u.extend(n,w)}this._updateMapTransform(i,o,n),this._changes=[]},Ye.prototype._updateMapTransform=function(i,o,n){var s=this._map,p=s.transform;if(!it(i))return this._fireEvents(o,n,!0);var f=i.panDelta,d=i.zoomDelta,v=i.bearingDelta,w=i.pitchDelta,A=i.around,R=i.pinchAround;R!==void 0&&(A=R),s._stop(!0),A=A||s.transform.centerPoint;var F=p.pointLocation(f?A.sub(f):A);v&&(p.bearing+=v),w&&(p.pitch+=w),d&&(p.zoom+=d),p.setLocationAtPoint(F,A),this._map._update(),i.noInertia||this._inertia.record(i),this._fireEvents(o,n,!0)},Ye.prototype._fireEvents=function(i,o,n){var s=this,p=Ti(this._eventsInProgress),f=Ti(i),d={};for(var v in i)this._eventsInProgress[v]||(d[v+"start"]=i[v].originalEvent),this._eventsInProgress[v]=i[v];for(var w in!p&&f&&this._fireEvent("movestart",f.originalEvent),d)this._fireEvent(w,d[w]);for(var A in f&&this._fireEvent("move",f.originalEvent),i)this._fireEvent(A,i[A].originalEvent);var R,F={};for(var O in this._eventsInProgress){var W=this._eventsInProgress[O],Z=W.handlerName,ee=W.originalEvent;this._handlersById[Z].isActive()||(delete this._eventsInProgress[O],F[O+"end"]=R=o[Z]||ee)}for(var N in F)this._fireEvent(N,F[N]);var Q=Ti(this._eventsInProgress);if(n&&(p||f)&&!Q){this._updatingCamera=!0;var ne=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ue=function(me){return me!==0&&-s._bearingSnap<me&&me<s._bearingSnap};ne?(ue(ne.bearing||this._map.getBearing())&&(ne.bearing=0),this._map.easeTo(ne,{originalEvent:R})):(this._map.fire(new u.Event("moveend",{originalEvent:R})),ue(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},Ye.prototype._fireEvent=function(i,o){this._map.fire(new u.Event(i,o?{originalEvent:o}:{}))},Ye.prototype._requestFrame=function(){var i=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(o){delete i._frameId,i.handleEvent(new Ba("renderFrame",{timeStamp:o})),i._applyChanges()}))},Ye.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var ds=(function(i){function o(n,s){i.call(this),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=s.bearingSnap,u.bindAll(["_renderFrameCallback"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getCenter=function(){return new u.LngLat(this.transform.center.lng,this.transform.center.lat)},o.prototype.setCenter=function(n,s){return this.jumpTo({center:n},s)},o.prototype.panBy=function(n,s,p){return n=u.Point.convert(n).mult(-1),this.panTo(this.transform.center,u.extend({offset:n},s),p)},o.prototype.panTo=function(n,s,p){return this.easeTo(u.extend({center:n},s),p)},o.prototype.getZoom=function(){return this.transform.zoom},o.prototype.setZoom=function(n,s){return this.jumpTo({zoom:n},s),this},o.prototype.zoomTo=function(n,s,p){return this.easeTo(u.extend({zoom:n},s),p)},o.prototype.zoomIn=function(n,s){return this.zoomTo(this.getZoom()+1,n,s),this},o.prototype.zoomOut=function(n,s){return this.zoomTo(this.getZoom()-1,n,s),this},o.prototype.getBearing=function(){return this.transform.bearing},o.prototype.setBearing=function(n,s){return this.jumpTo({bearing:n},s),this},o.prototype.getPadding=function(){return this.transform.padding},o.prototype.setPadding=function(n,s){return this.jumpTo({padding:n},s),this},o.prototype.rotateTo=function(n,s,p){return this.easeTo(u.extend({bearing:n},s),p)},o.prototype.resetNorth=function(n,s){return this.rotateTo(0,u.extend({duration:1e3},n),s),this},o.prototype.resetNorthPitch=function(n,s){return this.easeTo(u.extend({bearing:0,pitch:0,duration:1e3},n),s),this},o.prototype.snapToNorth=function(n,s){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(n,s):this},o.prototype.getPitch=function(){return this.transform.pitch},o.prototype.setPitch=function(n,s){return this.jumpTo({pitch:n},s),this},o.prototype.cameraForBounds=function(n,s){n=u.LngLatBounds.convert(n);var p=s&&s.bearing||0;return this._cameraForBoxAndBearing(n.getNorthWest(),n.getSouthEast(),p,s)},o.prototype._cameraForBoxAndBearing=function(n,s,p,f){var d={top:0,bottom:0,right:0,left:0};if(typeof(f=u.extend({padding:d,offset:[0,0],maxZoom:this.transform.maxZoom},f)).padding=="number"){var v=f.padding;f.padding={top:v,bottom:v,right:v,left:v}}f.padding=u.extend(d,f.padding);var w=this.transform,A=w.padding,R=w.project(u.LngLat.convert(n)),F=w.project(u.LngLat.convert(s)),O=R.rotate(-p*Math.PI/180),W=F.rotate(-p*Math.PI/180),Z=new u.Point(Math.max(O.x,W.x),Math.max(O.y,W.y)),ee=new u.Point(Math.min(O.x,W.x),Math.min(O.y,W.y)),N=Z.sub(ee),Q=(w.width-(A.left+A.right+f.padding.left+f.padding.right))/N.x,ne=(w.height-(A.top+A.bottom+f.padding.top+f.padding.bottom))/N.y;if(!(ne<0||Q<0)){var ue=Math.min(w.scaleZoom(w.scale*Math.min(Q,ne)),f.maxZoom),me=typeof f.offset.x=="number"?new u.Point(f.offset.x,f.offset.y):u.Point.convert(f.offset),pe=new u.Point((f.padding.left-f.padding.right)/2,(f.padding.top-f.padding.bottom)/2).rotate(p*Math.PI/180),ve=me.add(pe).mult(w.scale/w.zoomScale(ue));return{center:w.unproject(R.add(F).div(2).sub(ve)),zoom:ue,bearing:p}}u.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},o.prototype.fitBounds=function(n,s,p){return this._fitInternal(this.cameraForBounds(n,s),s,p)},o.prototype.fitScreenCoordinates=function(n,s,p,f,d){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(u.Point.convert(n)),this.transform.pointLocation(u.Point.convert(s)),p,f),f,d)},o.prototype._fitInternal=function(n,s,p){return n?(delete(s=u.extend(n,s)).padding,s.linear?this.easeTo(s,p):this.flyTo(s,p)):this},o.prototype.jumpTo=function(n,s){this.stop();var p=this.transform,f=!1,d=!1,v=!1;return"zoom"in n&&p.zoom!==+n.zoom&&(f=!0,p.zoom=+n.zoom),n.center!==void 0&&(p.center=u.LngLat.convert(n.center)),"bearing"in n&&p.bearing!==+n.bearing&&(d=!0,p.bearing=+n.bearing),"pitch"in n&&p.pitch!==+n.pitch&&(v=!0,p.pitch=+n.pitch),n.padding==null||p.isPaddingEqual(n.padding)||(p.padding=n.padding),this.fire(new u.Event("movestart",s)).fire(new u.Event("move",s)),f&&this.fire(new u.Event("zoomstart",s)).fire(new u.Event("zoom",s)).fire(new u.Event("zoomend",s)),d&&this.fire(new u.Event("rotatestart",s)).fire(new u.Event("rotate",s)).fire(new u.Event("rotateend",s)),v&&this.fire(new u.Event("pitchstart",s)).fire(new u.Event("pitch",s)).fire(new u.Event("pitchend",s)),this.fire(new u.Event("moveend",s))},o.prototype.easeTo=function(n,s){var p=this;this._stop(!1,n.easeId),((n=u.extend({offset:[0,0],duration:500,easing:u.ease},n)).animate===!1||!n.essential&&u.browser.prefersReducedMotion)&&(n.duration=0);var f=this.transform,d=this.getZoom(),v=this.getBearing(),w=this.getPitch(),A=this.getPadding(),R="zoom"in n?+n.zoom:d,F="bearing"in n?this._normalizeBearing(n.bearing,v):v,O="pitch"in n?+n.pitch:w,W="padding"in n?n.padding:f.padding,Z=u.Point.convert(n.offset),ee=f.centerPoint.add(Z),N=f.pointLocation(ee),Q=u.LngLat.convert(n.center||N);this._normalizeCenter(Q);var ne,ue,me=f.project(N),pe=f.project(Q).sub(me),ve=f.zoomScale(R-d);n.around&&(ne=u.LngLat.convert(n.around),ue=f.locationPoint(ne));var Te={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||R!==d,this._rotating=this._rotating||v!==F,this._pitching=this._pitching||O!==w,this._padding=!f.isPaddingEqual(W),this._easeId=n.easeId,this._prepareEase(s,n.noMoveStart,Te),this._ease((function(ke){if(p._zooming&&(f.zoom=u.number(d,R,ke)),p._rotating&&(f.bearing=u.number(v,F,ke)),p._pitching&&(f.pitch=u.number(w,O,ke)),p._padding&&(f.interpolatePadding(A,W,ke),ee=f.centerPoint.add(Z)),ne)f.setLocationAtPoint(ne,ue);else{var Ce=f.zoomScale(f.zoom-d),$e=R>d?Math.min(2,ve):Math.max(.5,ve),nt=Math.pow($e,1-ke),ut=f.unproject(me.add(pe.mult(ke*nt)).mult(Ce));f.setLocationAtPoint(f.renderWorldCopies?ut.wrap():ut,ee)}p._fireMoveEvents(s)}),(function(ke){p._afterEase(s,ke)}),n),this},o.prototype._prepareEase=function(n,s,p){p===void 0&&(p={}),this._moving=!0,s||p.moving||this.fire(new u.Event("movestart",n)),this._zooming&&!p.zooming&&this.fire(new u.Event("zoomstart",n)),this._rotating&&!p.rotating&&this.fire(new u.Event("rotatestart",n)),this._pitching&&!p.pitching&&this.fire(new u.Event("pitchstart",n))},o.prototype._fireMoveEvents=function(n){this.fire(new u.Event("move",n)),this._zooming&&this.fire(new u.Event("zoom",n)),this._rotating&&this.fire(new u.Event("rotate",n)),this._pitching&&this.fire(new u.Event("pitch",n))},o.prototype._afterEase=function(n,s){if(!this._easeId||!s||this._easeId!==s){delete this._easeId;var p=this._zooming,f=this._rotating,d=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,p&&this.fire(new u.Event("zoomend",n)),f&&this.fire(new u.Event("rotateend",n)),d&&this.fire(new u.Event("pitchend",n)),this.fire(new u.Event("moveend",n))}},o.prototype.flyTo=function(n,s){var p=this;if(!n.essential&&u.browser.prefersReducedMotion){var f=u.pick(n,["center","zoom","bearing","pitch","around"]);return this.jumpTo(f,s)}this.stop(),n=u.extend({offset:[0,0],speed:1.2,curve:1.42,easing:u.ease},n);var d=this.transform,v=this.getZoom(),w=this.getBearing(),A=this.getPitch(),R=this.getPadding(),F="zoom"in n?u.clamp(+n.zoom,d.minZoom,d.maxZoom):v,O="bearing"in n?this._normalizeBearing(n.bearing,w):w,W="pitch"in n?+n.pitch:A,Z="padding"in n?n.padding:d.padding,ee=d.zoomScale(F-v),N=u.Point.convert(n.offset),Q=d.centerPoint.add(N),ne=d.pointLocation(Q),ue=u.LngLat.convert(n.center||ne);this._normalizeCenter(ue);var me=d.project(ne),pe=d.project(ue).sub(me),ve=n.curve,Te=Math.max(d.width,d.height),ke=Te/ee,Ce=pe.mag();if("minZoom"in n){var $e=u.clamp(Math.min(n.minZoom,v,F),d.minZoom,d.maxZoom),nt=Te/d.zoomScale($e-v);ve=Math.sqrt(nt/Ce*2)}var ut=ve*ve;function st(ht){var ct=(ke*ke-Te*Te+(ht?-1:1)*ut*ut*Ce*Ce)/(2*(ht?ke:Te)*ut*Ce);return Math.log(Math.sqrt(ct*ct+1)-ct)}function Ft(ht){return(Math.exp(ht)-Math.exp(-ht))/2}function We(ht){return(Math.exp(ht)+Math.exp(-ht))/2}var mt=st(0),xt=function(ht){return We(mt)/We(mt+ve*ht)},dt=function(ht){return Te*((We(mt)*(Ft(ct=mt+ve*ht)/We(ct))-Ft(mt))/ut)/Ce;var ct},ft=(st(1)-mt)/ve;if(Math.abs(Ce)<1e-6||!isFinite(ft)){if(Math.abs(Te-ke)<1e-6)return this.easeTo(n,s);var gt=ke<Te?-1:1;ft=Math.abs(Math.log(ke/Te))/ve,dt=function(){return 0},xt=function(ht){return Math.exp(gt*ve*ht)}}return n.duration="duration"in n?+n.duration:1e3*ft/("screenSpeed"in n?+n.screenSpeed/ve:+n.speed),n.maxDuration&&n.duration>n.maxDuration&&(n.duration=0),this._zooming=!0,this._rotating=w!==O,this._pitching=W!==A,this._padding=!d.isPaddingEqual(Z),this._prepareEase(s,!1),this._ease((function(ht){var ct=ht*ft,Jr=1/xt(ct);d.zoom=ht===1?F:v+d.scaleZoom(Jr),p._rotating&&(d.bearing=u.number(w,O,ht)),p._pitching&&(d.pitch=u.number(A,W,ht)),p._padding&&(d.interpolatePadding(R,Z,ht),Q=d.centerPoint.add(N));var Ir=ht===1?ue:d.unproject(me.add(pe.mult(dt(ct))).mult(Jr));d.setLocationAtPoint(d.renderWorldCopies?Ir.wrap():Ir,Q),p._fireMoveEvents(s)}),(function(){return p._afterEase(s)}),n),this},o.prototype.isEasing=function(){return!!this._easeFrameId},o.prototype.stop=function(){return this._stop()},o.prototype._stop=function(n,s){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var p=this._onEaseEnd;delete this._onEaseEnd,p.call(this,s)}if(!n){var f=this.handlers;f&&f.stop(!1)}return this},o.prototype._ease=function(n,s,p){p.animate===!1||p.duration===0?(n(1),s()):(this._easeStart=u.browser.now(),this._easeOptions=p,this._onEaseFrame=n,this._onEaseEnd=s,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},o.prototype._renderFrameCallback=function(){var n=Math.min((u.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(n)),n<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},o.prototype._normalizeBearing=function(n,s){n=u.wrap(n,-180,180);var p=Math.abs(n-s);return Math.abs(n-360-s)<p&&(n-=360),Math.abs(n+360-s)<p&&(n+=360),n},o.prototype._normalizeCenter=function(n){var s=this.transform;if(s.renderWorldCopies&&!s.lngRange){var p=n.lng-s.center.lng;n.lng+=p>180?-360:p<-180?360:0}},o})(u.Evented),Ai=function(i){i===void 0&&(i={}),this.options=i,u.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Ai.prototype.getDefaultPosition=function(){return"bottom-right"},Ai.prototype.onAdd=function(i){var o=this.options&&this.options.compact;return this._map=i,this._container=M.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=M.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=M.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),o&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),o===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Ai.prototype.onRemove=function(){M.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Ai.prototype._setElementTitle=function(i,o){var n=this._map._getUIString("AttributionControl."+o);i.title=n,i.setAttribute("aria-label",n)},Ai.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Ai.prototype._updateEditLink=function(){var i=this._editLink;i||(i=this._editLink=this._container.querySelector(".mapbox-improve-map"));var o=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||u.config.ACCESS_TOKEN}];if(i){var n=o.reduce((function(s,p,f){return p.value&&(s+=p.key+"="+p.value+(f<o.length-1?"&":"")),s}),"?");i.href=u.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),i.rel="noopener nofollow",this._setElementTitle(i,"MapFeedback")}},Ai.prototype._updateData=function(i){!i||i.sourceDataType!=="metadata"&&i.sourceDataType!=="visibility"&&i.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())},Ai.prototype._updateAttributions=function(){if(this._map.style){var i=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?i=i.concat(this.options.customAttribution.map((function(v){return typeof v!="string"?"":v}))):typeof this.options.customAttribution=="string"&&i.push(this.options.customAttribution)),this._map.style.stylesheet){var o=this._map.style.stylesheet;this.styleOwner=o.owner,this.styleId=o.id}var n=this._map.style.sourceCaches;for(var s in n){var p=n[s];if(p.used){var f=p.getSource();f.attribution&&i.indexOf(f.attribution)<0&&i.push(f.attribution)}}i.sort((function(v,w){return v.length-w.length}));var d=(i=i.filter((function(v,w){for(var A=w+1;A<i.length;A++)if(i[A].indexOf(v)>=0)return!1;return!0}))).join(" | ");d!==this._attribHTML&&(this._attribHTML=d,i.length?(this._innerContainer.innerHTML=d,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Ai.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var bn=function(){u.bindAll(["_updateLogo"],this),u.bindAll(["_updateCompact"],this)};bn.prototype.onAdd=function(i){this._map=i,this._container=M.create("div","mapboxgl-ctrl");var o=M.create("a","mapboxgl-ctrl-logo");return o.target="_blank",o.rel="noopener nofollow",o.href="https://www.mapbox.com/",o.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),o.setAttribute("rel","noopener nofollow"),this._container.appendChild(o),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},bn.prototype.onRemove=function(){M.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},bn.prototype.getDefaultPosition=function(){return"bottom-left"},bn.prototype._updateLogo=function(i){i&&i.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},bn.prototype._logoRequired=function(){if(this._map.style){var i=this._map.style.sourceCaches;for(var o in i)if(i[o].getSource().mapbox_logo)return!0;return!1}},bn.prototype._updateCompact=function(){var i=this._container.children;if(i.length){var o=i[0];this._map.getCanvasContainer().offsetWidth<250?o.classList.add("mapboxgl-compact"):o.classList.remove("mapboxgl-compact")}};var vi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};vi.prototype.add=function(i){var o=++this._id;return this._queue.push({callback:i,id:o,cancelled:!1}),o},vi.prototype.remove=function(i){for(var o=this._currentlyRunning,n=0,s=o?this._queue.concat(o):this._queue;n<s.length;n+=1){var p=s[n];if(p.id===i)return void(p.cancelled=!0)}},vi.prototype.run=function(i){i===void 0&&(i=0);var o=this._currentlyRunning=this._queue;this._queue=[];for(var n=0,s=o;n<s.length;n+=1){var p=s[n];if(!p.cancelled&&(p.callback(i),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},vi.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var An={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},bu=u.window.HTMLImageElement,ms=u.window.HTMLElement,Xt=u.window.ImageBitmap,ai={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Ll=(function(i){function o(s){var p=this;if((s=u.extend({},ai,s)).minZoom!=null&&s.maxZoom!=null&&s.minZoom>s.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(s.minPitch!=null&&s.maxPitch!=null&&s.minPitch>s.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(s.minPitch!=null&&s.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(s.maxPitch!=null&&s.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var f=new Dt(s.minZoom,s.maxZoom,s.minPitch,s.maxPitch,s.renderWorldCopies);if(i.call(this,f,s),this._interactive=s.interactive,this._maxTileCacheSize=s.maxTileCacheSize,this._failIfMajorPerformanceCaveat=s.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=s.preserveDrawingBuffer,this._antialias=s.antialias,this._trackResize=s.trackResize,this._bearingSnap=s.bearingSnap,this._refreshExpiredTiles=s.refreshExpiredTiles,this._fadeDuration=s.fadeDuration,this._crossSourceCollisions=s.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=s.collectResourceTiming,this._renderTaskQueue=new vi,this._controls=[],this._mapId=u.uniqueId(),this._locale=u.extend({},An,s.locale),this._clickTolerance=s.clickTolerance,this._requestManager=new u.RequestManager(s.transformRequest,s.accessToken),typeof s.container=="string"){if(this._container=u.window.document.getElementById(s.container),!this._container)throw new Error("Container '"+s.container+"' not found.")}else{if(!(s.container instanceof ms))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=s.container}if(s.maxBounds&&this.setMaxBounds(s.maxBounds),u.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return p._update(!1)})),this.on("moveend",(function(){return p._update(!1)})),this.on("zoom",(function(){return p._update(!0)})),u.window!==void 0&&(u.window.addEventListener("online",this._onWindowOnline,!1),u.window.addEventListener("resize",this._onWindowResize,!1),u.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Ye(this,s),this._hash=s.hash&&new Yi(typeof s.hash=="string"&&s.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:s.center,zoom:s.zoom,bearing:s.bearing,pitch:s.pitch}),s.bounds&&(this.resize(),this.fitBounds(s.bounds,u.extend({},s.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=s.localIdeographFontFamily,s.style&&this.setStyle(s.style,{localIdeographFontFamily:s.localIdeographFontFamily}),s.attributionControl&&this.addControl(new Ai({customAttribution:s.customAttribution})),this.addControl(new bn,s.logoPosition),this.on("style.load",(function(){p.transform.unmodified&&p.jumpTo(p.style.stylesheet)})),this.on("data",(function(d){p._update(d.dataType==="style"),p.fire(new u.Event(d.dataType+"data",d))})),this.on("dataloading",(function(d){p.fire(new u.Event(d.dataType+"dataloading",d))}))}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return o.prototype._getMapId=function(){return this._mapId},o.prototype.addControl=function(s,p){if(p===void 0&&(p=s.getDefaultPosition?s.getDefaultPosition():"top-right"),!s||!s.onAdd)return this.fire(new u.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var f=s.onAdd(this);this._controls.push(s);var d=this._controlPositions[p];return p.indexOf("bottom")!==-1?d.insertBefore(f,d.firstChild):d.appendChild(f),this},o.prototype.removeControl=function(s){if(!s||!s.onRemove)return this.fire(new u.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var p=this._controls.indexOf(s);return p>-1&&this._controls.splice(p,1),s.onRemove(this),this},o.prototype.hasControl=function(s){return this._controls.indexOf(s)>-1},o.prototype.resize=function(s){var p=this._containerDimensions(),f=p[0],d=p[1];if(f===this.transform.width&&d===this.transform.height)return this;this._resizeCanvas(f,d),this.transform.resize(f,d),this.painter.resize(f,d);var v=!this._moving;return v&&this.fire(new u.Event("movestart",s)).fire(new u.Event("move",s)),this.fire(new u.Event("resize",s)),v&&this.fire(new u.Event("moveend",s)),this},o.prototype.getBounds=function(){return this.transform.getBounds()},o.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},o.prototype.setMaxBounds=function(s){return this.transform.setMaxBounds(u.LngLatBounds.convert(s)),this._update()},o.prototype.setMinZoom=function(s){if((s=s??-2)>=-2&&s<=this.transform.maxZoom)return this.transform.minZoom=s,this._update(),this.getZoom()<s&&this.setZoom(s),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},o.prototype.getMinZoom=function(){return this.transform.minZoom},o.prototype.setMaxZoom=function(s){if((s=s??22)>=this.transform.minZoom)return this.transform.maxZoom=s,this._update(),this.getZoom()>s&&this.setZoom(s),this;throw new Error("maxZoom must be greater than the current minZoom")},o.prototype.getMaxZoom=function(){return this.transform.maxZoom},o.prototype.setMinPitch=function(s){if((s=s??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(s>=0&&s<=this.transform.maxPitch)return this.transform.minPitch=s,this._update(),this.getPitch()<s&&this.setPitch(s),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},o.prototype.getMinPitch=function(){return this.transform.minPitch},o.prototype.setMaxPitch=function(s){if((s=s??60)>60)throw new Error("maxPitch must be less than or equal to 60");if(s>=this.transform.minPitch)return this.transform.maxPitch=s,this._update(),this.getPitch()>s&&this.setPitch(s),this;throw new Error("maxPitch must be greater than the current minPitch")},o.prototype.getMaxPitch=function(){return this.transform.maxPitch},o.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},o.prototype.setRenderWorldCopies=function(s){return this.transform.renderWorldCopies=s,this._update()},o.prototype.project=function(s){return this.transform.locationPoint(u.LngLat.convert(s))},o.prototype.unproject=function(s){return this.transform.pointLocation(u.Point.convert(s))},o.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},o.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},o.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},o.prototype._createDelegatedListener=function(s,p,f){var d,v=this;if(s==="mouseenter"||s==="mouseover"){var w=!1;return{layer:p,listener:f,delegates:{mousemove:function(R){var F=v.getLayer(p)?v.queryRenderedFeatures(R.point,{layers:[p]}):[];F.length?w||(w=!0,f.call(v,new Gr(s,v,R.originalEvent,{features:F}))):w=!1},mouseout:function(){w=!1}}}}if(s==="mouseleave"||s==="mouseout"){var A=!1;return{layer:p,listener:f,delegates:{mousemove:function(R){(v.getLayer(p)?v.queryRenderedFeatures(R.point,{layers:[p]}):[]).length?A=!0:A&&(A=!1,f.call(v,new Gr(s,v,R.originalEvent)))},mouseout:function(R){A&&(A=!1,f.call(v,new Gr(s,v,R.originalEvent)))}}}}return{layer:p,listener:f,delegates:(d={},d[s]=function(R){var F=v.getLayer(p)?v.queryRenderedFeatures(R.point,{layers:[p]}):[];F.length&&(R.features=F,f.call(v,R),delete R.features)},d)}},o.prototype.on=function(s,p,f){if(f===void 0)return i.prototype.on.call(this,s,p);var d=this._createDelegatedListener(s,p,f);for(var v in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[s]=this._delegatedListeners[s]||[],this._delegatedListeners[s].push(d),d.delegates)this.on(v,d.delegates[v]);return this},o.prototype.once=function(s,p,f){if(f===void 0)return i.prototype.once.call(this,s,p);var d=this._createDelegatedListener(s,p,f);for(var v in d.delegates)this.once(v,d.delegates[v]);return this},o.prototype.off=function(s,p,f){var d=this;return f===void 0?i.prototype.off.call(this,s,p):(this._delegatedListeners&&this._delegatedListeners[s]&&(function(v){for(var w=v[s],A=0;A<w.length;A++){var R=w[A];if(R.layer===p&&R.listener===f){for(var F in R.delegates)d.off(F,R.delegates[F]);return w.splice(A,1),d}}})(this._delegatedListeners),this)},o.prototype.queryRenderedFeatures=function(s,p){if(!this.style)return[];var f;if(p!==void 0||s===void 0||s instanceof u.Point||Array.isArray(s)||(p=s,s=void 0),p=p||{},(s=s||[[0,0],[this.transform.width,this.transform.height]])instanceof u.Point||typeof s[0]=="number")f=[u.Point.convert(s)];else{var d=u.Point.convert(s[0]),v=u.Point.convert(s[1]);f=[d,new u.Point(v.x,d.y),v,new u.Point(d.x,v.y),d]}return this.style.queryRenderedFeatures(f,p,this.transform)},o.prototype.querySourceFeatures=function(s,p){return this.style.querySourceFeatures(s,p)},o.prototype.setStyle=function(s,p){return(p=u.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},p)).diff!==!1&&p.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&s?(this._diffStyle(s,p),this):(this._localIdeographFontFamily=p.localIdeographFontFamily,this._updateStyle(s,p))},o.prototype._getUIString=function(s){var p=this._locale[s];if(p==null)throw new Error("Missing UI string '"+s+"'");return p},o.prototype._updateStyle=function(s,p){return this.style&&(this.style.setEventedParent(null),this.style._remove()),s?(this.style=new Ui(this,p||{}),this.style.setEventedParent(this,{style:this.style}),typeof s=="string"?this.style.loadURL(s):this.style.loadJSON(s),this):(delete this.style,this)},o.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Ui(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},o.prototype._diffStyle=function(s,p){var f=this;if(typeof s=="string"){var d=this._requestManager.normalizeStyleURL(s),v=this._requestManager.transformRequest(d,u.ResourceType.Style);u.getJSON(v,(function(w,A){w?f.fire(new u.ErrorEvent(w)):A&&f._updateDiff(A,p)}))}else typeof s=="object"&&this._updateDiff(s,p)},o.prototype._updateDiff=function(s,p){try{this.style.setState(s)&&this._update(!0)}catch(f){u.warnOnce("Unable to perform style diff: "+(f.message||f.error||f)+". Rebuilding the style from scratch."),this._updateStyle(s,p)}},o.prototype.getStyle=function(){if(this.style)return this.style.serialize()},o.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():u.warnOnce("There is no style added to the map.")},o.prototype.addSource=function(s,p){return this._lazyInitEmptyStyle(),this.style.addSource(s,p),this._update(!0)},o.prototype.isSourceLoaded=function(s){var p=this.style&&this.style.sourceCaches[s];if(p!==void 0)return p.loaded();this.fire(new u.ErrorEvent(new Error("There is no source with ID '"+s+"'")))},o.prototype.areTilesLoaded=function(){var s=this.style&&this.style.sourceCaches;for(var p in s){var f=s[p]._tiles;for(var d in f){var v=f[d];if(v.state!=="loaded"&&v.state!=="errored")return!1}}return!0},o.prototype.addSourceType=function(s,p,f){return this._lazyInitEmptyStyle(),this.style.addSourceType(s,p,f)},o.prototype.removeSource=function(s){return this.style.removeSource(s),this._update(!0)},o.prototype.getSource=function(s){return this.style.getSource(s)},o.prototype.addImage=function(s,p,f){f===void 0&&(f={});var d=f.pixelRatio;d===void 0&&(d=1);var v=f.sdf;v===void 0&&(v=!1);var w=f.stretchX,A=f.stretchY,R=f.content;if(this._lazyInitEmptyStyle(),p instanceof bu||Xt&&p instanceof Xt){var F=u.browser.getImageData(p);this.style.addImage(s,{data:new u.RGBAImage({width:F.width,height:F.height},F.data),pixelRatio:d,stretchX:w,stretchY:A,content:R,sdf:v,version:0})}else{if(p.width===void 0||p.height===void 0)return this.fire(new u.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var O=p;this.style.addImage(s,{data:new u.RGBAImage({width:p.width,height:p.height},new Uint8Array(p.data)),pixelRatio:d,stretchX:w,stretchY:A,content:R,sdf:v,version:0,userImage:O}),O.onAdd&&O.onAdd(this,s)}},o.prototype.updateImage=function(s,p){var f=this.style.getImage(s);if(!f)return this.fire(new u.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var d=p instanceof bu||Xt&&p instanceof Xt?u.browser.getImageData(p):p,v=d.width,w=d.height,A=d.data;return v===void 0||w===void 0?this.fire(new u.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):v!==f.data.width||w!==f.data.height?this.fire(new u.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(f.data.replace(A,!(p instanceof bu||Xt&&p instanceof Xt)),void this.style.updateImage(s,f))},o.prototype.hasImage=function(s){return s?!!this.style.getImage(s):(this.fire(new u.ErrorEvent(new Error("Missing required image id"))),!1)},o.prototype.removeImage=function(s){this.style.removeImage(s)},o.prototype.loadImage=function(s,p){u.getImage(this._requestManager.transformRequest(s,u.ResourceType.Image),p)},o.prototype.listImages=function(){return this.style.listImages()},o.prototype.addLayer=function(s,p){return this._lazyInitEmptyStyle(),this.style.addLayer(s,p),this._update(!0)},o.prototype.moveLayer=function(s,p){return this.style.moveLayer(s,p),this._update(!0)},o.prototype.removeLayer=function(s){return this.style.removeLayer(s),this._update(!0)},o.prototype.getLayer=function(s){return this.style.getLayer(s)},o.prototype.setLayerZoomRange=function(s,p,f){return this.style.setLayerZoomRange(s,p,f),this._update(!0)},o.prototype.setFilter=function(s,p,f){return f===void 0&&(f={}),this.style.setFilter(s,p,f),this._update(!0)},o.prototype.getFilter=function(s){return this.style.getFilter(s)},o.prototype.setPaintProperty=function(s,p,f,d){return d===void 0&&(d={}),this.style.setPaintProperty(s,p,f,d),this._update(!0)},o.prototype.getPaintProperty=function(s,p){return this.style.getPaintProperty(s,p)},o.prototype.setLayoutProperty=function(s,p,f,d){return d===void 0&&(d={}),this.style.setLayoutProperty(s,p,f,d),this._update(!0)},o.prototype.getLayoutProperty=function(s,p){return this.style.getLayoutProperty(s,p)},o.prototype.setLight=function(s,p){return p===void 0&&(p={}),this._lazyInitEmptyStyle(),this.style.setLight(s,p),this._update(!0)},o.prototype.getLight=function(){return this.style.getLight()},o.prototype.setFeatureState=function(s,p){return this.style.setFeatureState(s,p),this._update()},o.prototype.removeFeatureState=function(s,p){return this.style.removeFeatureState(s,p),this._update()},o.prototype.getFeatureState=function(s){return this.style.getFeatureState(s)},o.prototype.getContainer=function(){return this._container},o.prototype.getCanvasContainer=function(){return this._canvasContainer},o.prototype.getCanvas=function(){return this._canvas},o.prototype._containerDimensions=function(){var s=0,p=0;return this._container&&(s=this._container.clientWidth||400,p=this._container.clientHeight||300),[s,p]},o.prototype._detectMissingCSS=function(){u.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&u.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},o.prototype._setupContainer=function(){var s=this._container;s.classList.add("mapboxgl-map"),(this._missingCSSCanary=M.create("div","mapboxgl-canary",s)).style.visibility="hidden",this._detectMissingCSS();var p=this._canvasContainer=M.create("div","mapboxgl-canvas-container",s);this._interactive&&p.classList.add("mapboxgl-interactive"),this._canvas=M.create("canvas","mapboxgl-canvas",p),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var f=this._containerDimensions();this._resizeCanvas(f[0],f[1]);var d=this._controlContainer=M.create("div","mapboxgl-control-container",s),v=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(w){v[w]=M.create("div","mapboxgl-ctrl-"+w,d)})),this._container.addEventListener("scroll",this._onMapScroll,!1)},o.prototype._resizeCanvas=function(s,p){var f=u.browser.devicePixelRatio||1;this._canvas.width=f*s,this._canvas.height=f*p,this._canvas.style.width=s+"px",this._canvas.style.height=p+"px"},o.prototype._setupPainter=function(){var s=u.extend({},U.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),p=this._canvas.getContext("webgl",s)||this._canvas.getContext("experimental-webgl",s);p?(this.painter=new vr(p,this.transform),u.webpSupported.testSupport(p)):this.fire(new u.ErrorEvent(new Error("Failed to initialize WebGL")))},o.prototype._contextLost=function(s){s.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new u.Event("webglcontextlost",{originalEvent:s}))},o.prototype._contextRestored=function(s){this._setupPainter(),this.resize(),this._update(),this.fire(new u.Event("webglcontextrestored",{originalEvent:s}))},o.prototype._onMapScroll=function(s){if(s.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},o.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},o.prototype._update=function(s){return this.style?(this._styleDirty=this._styleDirty||s,this._sourcesDirty=!0,this.triggerRepaint(),this):this},o.prototype._requestRenderFrame=function(s){return this._update(),this._renderTaskQueue.add(s)},o.prototype._cancelRenderFrame=function(s){this._renderTaskQueue.remove(s)},o.prototype._render=function(s){var p,f=this,d=0,v=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(p=v.createQueryEXT(),v.beginQueryEXT(v.TIME_ELAPSED_EXT,p),d=u.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(s),!this._removed){var w=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var A=this.transform.zoom,R=u.browser.now();this.style.zoomHistory.update(A,R);var F=new u.EvaluationParameters(A,{now:R,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),O=F.crossFadingFactor();O===1&&O===this._crossFadingFactor||(w=!0,this._crossFadingFactor=O),this.style.update(F)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new u.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new u.Event("load"))),this.style&&(this.style.hasTransitions()||w)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var W=u.browser.now()-d;v.endQueryEXT(v.TIME_ELAPSED_EXT,p),setTimeout((function(){var N=v.getQueryObjectEXT(p,v.QUERY_RESULT_EXT)/1e6;v.deleteQueryEXT(p),f.fire(new u.Event("gpu-timing-frame",{cpuTime:W,gpuTime:N}))}),50)}if(this.listens("gpu-timing-layer")){var Z=this.painter.collectGpuTimers();setTimeout((function(){var N=f.painter.queryGpuTimers(Z);f.fire(new u.Event("gpu-timing-layer",{layerTimes:N}))}),50)}var ee=this._sourcesDirty||this._styleDirty||this._placementDirty;return ee||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new u.Event("idle")),!this._loaded||this._fullyLoaded||ee||(this._fullyLoaded=!0),this}},o.prototype.remove=function(){this._hash&&this._hash.remove();for(var s=0,p=this._controls;s<p.length;s+=1)p[s].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),u.window!==void 0&&(u.window.removeEventListener("resize",this._onWindowResize,!1),u.window.removeEventListener("orientationchange",this._onWindowResize,!1),u.window.removeEventListener("online",this._onWindowOnline,!1));var f=this.painter.context.gl.getExtension("WEBGL_lose_context");f&&f.loseContext(),Bo(this._canvasContainer),Bo(this._controlContainer),Bo(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new u.Event("remove"))},o.prototype.triggerRepaint=function(){var s=this;this.style&&!this._frame&&(this._frame=u.browser.frame((function(p){s._frame=null,s._render(p)})))},o.prototype._onWindowOnline=function(){this._update()},o.prototype._onWindowResize=function(s){this._trackResize&&this.resize({originalEvent:s})._update()},n.showTileBoundaries.get=function(){return!!this._showTileBoundaries},n.showTileBoundaries.set=function(s){this._showTileBoundaries!==s&&(this._showTileBoundaries=s,this._update())},n.showPadding.get=function(){return!!this._showPadding},n.showPadding.set=function(s){this._showPadding!==s&&(this._showPadding=s,this._update())},n.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},n.showCollisionBoxes.set=function(s){this._showCollisionBoxes!==s&&(this._showCollisionBoxes=s,s?this.style._generateCollisionBoxes():this._update())},n.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},n.showOverdrawInspector.set=function(s){this._showOverdrawInspector!==s&&(this._showOverdrawInspector=s,this._update())},n.repaint.get=function(){return!!this._repaint},n.repaint.set=function(s){this._repaint!==s&&(this._repaint=s,this.triggerRepaint())},n.vertices.get=function(){return!!this._vertices},n.vertices.set=function(s){this._vertices=s,this._update()},o.prototype._setCacheLimits=function(s,p){u.setCacheLimits(s,p)},n.version.get=function(){return u.version},Object.defineProperties(o.prototype,n),o})(ds);function Bo(i){i.parentNode&&i.parentNode.removeChild(i)}var wu={showCompass:!0,showZoom:!0,visualizePitch:!1},Fn=function(i){var o=this;this.options=u.extend({},wu,i),this._container=M.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(n){return n.preventDefault()})),this.options.showZoom&&(u.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(n){return o._map.zoomIn({},{originalEvent:n})})),M.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(n){return o._map.zoomOut({},{originalEvent:n})})),M.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(u.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(n){o.options.visualizePitch?o._map.resetNorthPitch({},{originalEvent:n}):o._map.resetNorth({},{originalEvent:n})})),this._compassIcon=M.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Fn.prototype._updateZoomButtons=function(){var i=this._map.getZoom(),o=i===this._map.getMaxZoom(),n=i===this._map.getMinZoom();this._zoomInButton.disabled=o,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",o.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())},Fn.prototype._rotateCompassArrow=function(){var i=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=i},Fn.prototype.onAdd=function(i){return this._map=i,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Zi(this._map,this._compass,this.options.visualizePitch)),this._container},Fn.prototype.onRemove=function(){M.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},Fn.prototype._createButton=function(i,o){var n=M.create("button",i,this._container);return n.type="button",n.addEventListener("click",o),n},Fn.prototype._setButtonTitle=function(i,o){var n=this._map._getUIString("NavigationControl."+o);i.title=n,i.setAttribute("aria-label",n)};var Zi=function(i,o,n){n===void 0&&(n=!1),this._clickTolerance=10,this.element=o,this.mouseRotate=new ps({clickTolerance:i.dragRotate._mouseRotate._clickTolerance}),this.map=i,n&&(this.mousePitch=new gu({clickTolerance:i.dragRotate._mousePitch._clickTolerance})),u.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),M.addEventListener(o,"mousedown",this.mousedown),M.addEventListener(o,"touchstart",this.touchstart,{passive:!1}),M.addEventListener(o,"touchmove",this.touchmove),M.addEventListener(o,"touchend",this.touchend),M.addEventListener(o,"touchcancel",this.reset)};function ta(i,o,n){if(i=new u.LngLat(i.lng,i.lat),o){var s=new u.LngLat(i.lng-360,i.lat),p=new u.LngLat(i.lng+360,i.lat),f=n.locationPoint(i).distSqr(o);n.locationPoint(s).distSqr(o)<f?i=s:n.locationPoint(p).distSqr(o)<f&&(i=p)}for(;Math.abs(i.lng-n.center.lng)>180;){var d=n.locationPoint(i);if(d.x>=0&&d.y>=0&&d.x<=n.width&&d.y<=n.height)break;i.lng>n.center.lng?i.lng-=360:i.lng+=360}return i}Zi.prototype.down=function(i,o){this.mouseRotate.mousedown(i,o),this.mousePitch&&this.mousePitch.mousedown(i,o),M.disableDrag()},Zi.prototype.move=function(i,o){var n=this.map,s=this.mouseRotate.mousemoveWindow(i,o);if(s&&s.bearingDelta&&n.setBearing(n.getBearing()+s.bearingDelta),this.mousePitch){var p=this.mousePitch.mousemoveWindow(i,o);p&&p.pitchDelta&&n.setPitch(n.getPitch()+p.pitchDelta)}},Zi.prototype.off=function(){var i=this.element;M.removeEventListener(i,"mousedown",this.mousedown),M.removeEventListener(i,"touchstart",this.touchstart,{passive:!1}),M.removeEventListener(i,"touchmove",this.touchmove),M.removeEventListener(i,"touchend",this.touchend),M.removeEventListener(i,"touchcancel",this.reset),this.offTemp()},Zi.prototype.offTemp=function(){M.enableDrag(),M.removeEventListener(u.window,"mousemove",this.mousemove),M.removeEventListener(u.window,"mouseup",this.mouseup)},Zi.prototype.mousedown=function(i){this.down(u.extend({},i,{ctrlKey:!0,preventDefault:function(){return i.preventDefault()}}),M.mousePos(this.element,i)),M.addEventListener(u.window,"mousemove",this.mousemove),M.addEventListener(u.window,"mouseup",this.mouseup)},Zi.prototype.mousemove=function(i){this.move(i,M.mousePos(this.element,i))},Zi.prototype.mouseup=function(i){this.mouseRotate.mouseupWindow(i),this.mousePitch&&this.mousePitch.mouseupWindow(i),this.offTemp()},Zi.prototype.touchstart=function(i){i.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=M.touchPos(this.element,i.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return i.preventDefault()}},this._startPos))},Zi.prototype.touchmove=function(i){i.targetTouches.length!==1?this.reset():(this._lastPos=M.touchPos(this.element,i.targetTouches)[0],this.move({preventDefault:function(){return i.preventDefault()}},this._lastPos))},Zi.prototype.touchend=function(i){i.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Zi.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var En={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function ys(i,o,n){var s=i.classList;for(var p in En)s.remove("mapboxgl-"+n+"-anchor-"+p);s.add("mapboxgl-"+n+"-anchor-"+o)}var ra,za=(function(i){function o(n,s){if(i.call(this),(n instanceof u.window.HTMLElement||s)&&(n=u.extend({element:n},s)),u.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&n.pitchAlignment!=="auto"?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=u.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=M.create("div"),this._element.setAttribute("aria-label","Map marker");var p=M.createNS("http://www.w3.org/2000/svg","svg");p.setAttributeNS(null,"display","block"),p.setAttributeNS(null,"height","41px"),p.setAttributeNS(null,"width","27px"),p.setAttributeNS(null,"viewBox","0 0 27 41");var f=M.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"stroke","none"),f.setAttributeNS(null,"stroke-width","1"),f.setAttributeNS(null,"fill","none"),f.setAttributeNS(null,"fill-rule","evenodd");var d=M.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"fill-rule","nonzero");var v=M.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(3.0, 29.0)"),v.setAttributeNS(null,"fill","#000000");for(var w=0,A=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];w<A.length;w+=1){var R=A[w],F=M.createNS("http://www.w3.org/2000/svg","ellipse");F.setAttributeNS(null,"opacity","0.04"),F.setAttributeNS(null,"cx","10.5"),F.setAttributeNS(null,"cy","5.80029008"),F.setAttributeNS(null,"rx",R.rx),F.setAttributeNS(null,"ry",R.ry),v.appendChild(F)}var O=M.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"fill",this._color);var W=M.createNS("http://www.w3.org/2000/svg","path");W.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),O.appendChild(W);var Z=M.createNS("http://www.w3.org/2000/svg","g");Z.setAttributeNS(null,"opacity","0.25"),Z.setAttributeNS(null,"fill","#000000");var ee=M.createNS("http://www.w3.org/2000/svg","path");ee.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),Z.appendChild(ee);var N=M.createNS("http://www.w3.org/2000/svg","g");N.setAttributeNS(null,"transform","translate(6.0, 7.0)"),N.setAttributeNS(null,"fill","#FFFFFF");var Q=M.createNS("http://www.w3.org/2000/svg","g");Q.setAttributeNS(null,"transform","translate(8.0, 8.0)");var ne=M.createNS("http://www.w3.org/2000/svg","circle");ne.setAttributeNS(null,"fill","#000000"),ne.setAttributeNS(null,"opacity","0.25"),ne.setAttributeNS(null,"cx","5.5"),ne.setAttributeNS(null,"cy","5.5"),ne.setAttributeNS(null,"r","5.4999962");var ue=M.createNS("http://www.w3.org/2000/svg","circle");ue.setAttributeNS(null,"fill","#FFFFFF"),ue.setAttributeNS(null,"cx","5.5"),ue.setAttributeNS(null,"cy","5.5"),ue.setAttributeNS(null,"r","5.4999962"),Q.appendChild(ne),Q.appendChild(ue),d.appendChild(v),d.appendChild(O),d.appendChild(Z),d.appendChild(N),d.appendChild(Q),p.appendChild(d),p.setAttributeNS(null,"height",41*this._scale+"px"),p.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(p),this._offset=u.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(me){me.preventDefault()})),this._element.addEventListener("mousedown",(function(me){me.preventDefault()})),ys(this._element,this._anchor,"marker"),this._popup=null}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.addTo=function(n){return this.remove(),this._map=n,n.getCanvasContainer().appendChild(this._element),n.on("move",this._update),n.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},o.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),M.remove(this._element),this._popup&&this._popup.remove(),this},o.prototype.getLngLat=function(){return this._lngLat},o.prototype.setLngLat=function(n){return this._lngLat=u.LngLat.convert(n),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},o.prototype.getElement=function(){return this._element},o.prototype.setPopup=function(n){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),n){if(!("offset"in n.options)){var s=Math.sqrt(Math.pow(13.5,2)/2);n.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[s,-1*(24.6+s)],"bottom-right":[-s,-1*(24.6+s)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=n,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},o.prototype._onKeyPress=function(n){var s=n.code,p=n.charCode||n.keyCode;s!=="Space"&&s!=="Enter"&&p!==32&&p!==13||this.togglePopup()},o.prototype._onMapClick=function(n){var s=n.originalEvent.target,p=this._element;this._popup&&(s===p||p.contains(s))&&this.togglePopup()},o.prototype.getPopup=function(){return this._popup},o.prototype.togglePopup=function(){var n=this._popup;return n?(n.isOpen()?n.remove():n.addTo(this._map),this):this},o.prototype._update=function(n){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=ta(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var s="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?s="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(s="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var p="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?p="rotateX(0deg)":this._pitchAlignment==="map"&&(p="rotateX("+this._map.getPitch()+"deg)"),n&&n.type!=="moveend"||(this._pos=this._pos.round()),M.setTransform(this._element,En[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+p+" "+s)}},o.prototype.getOffset=function(){return this._offset},o.prototype.setOffset=function(n){return this._offset=u.Point.convert(n),this._update(),this},o.prototype._onMove=function(n){if(!this._isDragging){var s=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new u.Event("dragstart"))),this.fire(new u.Event("drag")))},o.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new u.Event("dragend")),this._state="inactive"},o.prototype._addDragHandler=function(n){this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},o.prototype.setDraggable=function(n){return this._draggable=!!n,this._map&&(n?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},o.prototype.isDraggable=function(){return this._draggable},o.prototype.setRotation=function(n){return this._rotation=n||0,this._update(),this},o.prototype.getRotation=function(){return this._rotation},o.prototype.setRotationAlignment=function(n){return this._rotationAlignment=n||"auto",this._update(),this},o.prototype.getRotationAlignment=function(){return this._rotationAlignment},o.prototype.setPitchAlignment=function(n){return this._pitchAlignment=n&&n!=="auto"?n:this._rotationAlignment,this._update(),this},o.prototype.getPitchAlignment=function(){return this._pitchAlignment},o})(u.Evented),Su={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},ia=0,zo=!1,Iu=(function(i){function o(n){i.call(this),this.options=u.extend({},Su,n),u.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.onAdd=function(n){var s;return this._map=n,this._container=M.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),s=this._setupUI,ra!==void 0?s(ra):u.window.navigator.permissions!==void 0?u.window.navigator.permissions.query({name:"geolocation"}).then((function(p){s(ra=p.state!=="denied")})):s(ra=!!u.window.navigator.geolocation),this._container},o.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(u.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),M.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ia=0,zo=!1},o.prototype._isOutOfMapMaxBounds=function(n){var s=this._map.getMaxBounds(),p=n.coords;return s&&(p.longitude<s.getWest()||p.longitude>s.getEast()||p.latitude<s.getSouth()||p.latitude>s.getNorth())},o.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},o.prototype._onSuccess=function(n){if(this._map){if(this._isOutOfMapMaxBounds(n))return this._setErrorState(),this.fire(new u.Event("outofmaxbounds",n)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=n,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(n),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(n),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new u.Event("geolocate",n)),this._finish()}},o.prototype._updateCamera=function(n){var s=new u.LngLat(n.coords.longitude,n.coords.latitude),p=n.coords.accuracy,f=this._map.getBearing(),d=u.extend({bearing:f},this.options.fitBoundsOptions);this._map.fitBounds(s.toBounds(p),d,{geolocateSource:!0})},o.prototype._updateMarker=function(n){if(n){var s=new u.LngLat(n.coords.longitude,n.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=n.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},o.prototype._updateCircleRadius=function(){var n=this._map._container.clientHeight/2,s=this._map.unproject([0,n]),p=this._map.unproject([1,n]),f=s.distanceTo(p),d=Math.ceil(2*this._accuracy/f);this._circleElement.style.width=d+"px",this._circleElement.style.height=d+"px"},o.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},o.prototype._onError=function(n){if(this._map){if(this.options.trackUserLocation)if(n.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(n.code===3&&zo)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new u.Event("error",n)),this._finish()}},o.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},o.prototype._setupUI=function(n){var s=this;if(this._container.addEventListener("contextmenu",(function(d){return d.preventDefault()})),this._geolocateButton=M.create("button","mapboxgl-ctrl-geolocate",this._container),M.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",n===!1){u.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var p=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=p,this._geolocateButton.setAttribute("aria-label",p)}else{var f=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=f,this._geolocateButton.setAttribute("aria-label",f)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=M.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new za(this._dotElement),this._circleElement=M.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new za({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(d){d.geolocateSource||s._watchState!=="ACTIVE_LOCK"||d.originalEvent&&d.originalEvent.type==="resize"||(s._watchState="BACKGROUND",s._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),s._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),s.fire(new u.Event("trackuserlocationend")))}))},o.prototype.trigger=function(){if(!this._setup)return u.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new u.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ia--,zo=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new u.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new u.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){var n;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++ia>1?(n={maximumAge:6e5,timeout:0},zo=!0):(n=this.options.positionOptions,zo=!1),this._geolocationWatchID=u.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,n)}}else u.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},o.prototype._clearWatch=function(){u.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},o})(u.Evented),to={maxWidth:100,unit:"metric"},ro=function(i){this.options=u.extend({},to,i),u.bindAll(["_onMove","setUnit"],this)};function vs(i,o,n){var s=n&&n.maxWidth||100,p=i._container.clientHeight/2,f=i.unproject([0,p]),d=i.unproject([s,p]),v=f.distanceTo(d);if(n&&n.unit==="imperial"){var w=3.2808*v;w>5280?io(o,s,w/5280,i._getUIString("ScaleControl.Miles")):io(o,s,w,i._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?io(o,s,v/1852,i._getUIString("ScaleControl.NauticalMiles")):v>=1e3?io(o,s,v/1e3,i._getUIString("ScaleControl.Kilometers")):io(o,s,v,i._getUIString("ScaleControl.Meters"))}function io(i,o,n,s){var p,f,d,v=(p=n,(f=Math.pow(10,(""+Math.floor(p)).length-1))*(d=(d=p/f)>=10?10:d>=5?5:d>=3?3:d>=2?2:d>=1?1:(function(w){var A=Math.pow(10,Math.ceil(-Math.log(w)/Math.LN10));return Math.round(w*A)/A})(d)));i.style.width=o*(v/n)+"px",i.innerHTML=v+" "+s}ro.prototype.getDefaultPosition=function(){return"bottom-left"},ro.prototype._onMove=function(){vs(this._map,this._container,this.options)},ro.prototype.onAdd=function(i){return this._map=i,this._container=M.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",i.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},ro.prototype.onRemove=function(){M.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},ro.prototype.setUnit=function(i){this.options.unit=i,vs(this._map,this._container,this.options)};var ln=function(i){this._fullscreen=!1,i&&i.container&&(i.container instanceof u.window.HTMLElement?this._container=i.container:u.warnOnce("Full screen control 'container' must be a DOM element.")),u.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in u.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in u.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in u.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in u.window.document&&(this._fullscreenchange="MSFullscreenChange")};ln.prototype.onAdd=function(i){return this._map=i,this._container||(this._container=this._map.getContainer()),this._controlContainer=M.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",u.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},ln.prototype.onRemove=function(){M.remove(this._controlContainer),this._map=null,u.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},ln.prototype._checkFullscreenSupport=function(){return!!(u.window.document.fullscreenEnabled||u.window.document.mozFullScreenEnabled||u.window.document.msFullscreenEnabled||u.window.document.webkitFullscreenEnabled)},ln.prototype._setupUI=function(){var i=this._fullscreenButton=M.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);M.create("span","mapboxgl-ctrl-icon",i).setAttribute("aria-hidden",!0),i.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),u.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},ln.prototype._updateTitle=function(){var i=this._getTitle();this._fullscreenButton.setAttribute("aria-label",i),this._fullscreenButton.title=i},ln.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},ln.prototype._isFullscreen=function(){return this._fullscreen},ln.prototype._changeIcon=function(){(u.window.document.fullscreenElement||u.window.document.mozFullScreenElement||u.window.document.webkitFullscreenElement||u.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},ln.prototype._onClickFullscreen=function(){this._isFullscreen()?u.window.document.exitFullscreen?u.window.document.exitFullscreen():u.window.document.mozCancelFullScreen?u.window.document.mozCancelFullScreen():u.window.document.msExitFullscreen?u.window.document.msExitFullscreen():u.window.document.webkitCancelFullScreen&&u.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Tu={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Da=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Au=(function(i){function o(n){i.call(this),this.options=u.extend(Object.create(Tu),n),u.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.addTo=function(n){return this._map&&this.remove(),this._map=n,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new u.Event("open")),this},o.prototype.isOpen=function(){return!!this._map},o.prototype.remove=function(){return this._content&&M.remove(this._content),this._container&&(M.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new u.Event("close")),this},o.prototype.getLngLat=function(){return this._lngLat},o.prototype.setLngLat=function(n){return this._lngLat=u.LngLat.convert(n),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},o.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},o.prototype.getElement=function(){return this._container},o.prototype.setText=function(n){return this.setDOMContent(u.window.document.createTextNode(n))},o.prototype.setHTML=function(n){var s,p=u.window.document.createDocumentFragment(),f=u.window.document.createElement("body");for(f.innerHTML=n;s=f.firstChild;)p.appendChild(s);return this.setDOMContent(p)},o.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},o.prototype.setMaxWidth=function(n){return this.options.maxWidth=n,this._update(),this},o.prototype.setDOMContent=function(n){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=M.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(n),this._createCloseButton(),this._update(),this._focusFirstElement(),this},o.prototype.addClassName=function(n){this._container&&this._container.classList.add(n)},o.prototype.removeClassName=function(n){this._container&&this._container.classList.remove(n)},o.prototype.setOffset=function(n){return this.options.offset=n,this._update(),this},o.prototype.toggleClassName=function(n){if(this._container)return this._container.classList.toggle(n)},o.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=M.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},o.prototype._onMouseUp=function(n){this._update(n.point)},o.prototype._onMouseMove=function(n){this._update(n.point)},o.prototype._onDrag=function(n){this._update(n.point)},o.prototype._update=function(n){var s=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=M.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=M.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(F){return s._container.classList.add(F)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=ta(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||n)){var p=this._pos=this._trackPointer&&n?n:this._map.project(this._lngLat),f=this.options.anchor,d=(function F(O){if(O){if(typeof O=="number"){var W=Math.round(Math.sqrt(.5*Math.pow(O,2)));return{center:new u.Point(0,0),top:new u.Point(0,O),"top-left":new u.Point(W,W),"top-right":new u.Point(-W,W),bottom:new u.Point(0,-O),"bottom-left":new u.Point(W,-W),"bottom-right":new u.Point(-W,-W),left:new u.Point(O,0),right:new u.Point(-O,0)}}if(O instanceof u.Point||Array.isArray(O)){var Z=u.Point.convert(O);return{center:Z,top:Z,"top-left":Z,"top-right":Z,bottom:Z,"bottom-left":Z,"bottom-right":Z,left:Z,right:Z}}return{center:u.Point.convert(O.center||[0,0]),top:u.Point.convert(O.top||[0,0]),"top-left":u.Point.convert(O["top-left"]||[0,0]),"top-right":u.Point.convert(O["top-right"]||[0,0]),bottom:u.Point.convert(O.bottom||[0,0]),"bottom-left":u.Point.convert(O["bottom-left"]||[0,0]),"bottom-right":u.Point.convert(O["bottom-right"]||[0,0]),left:u.Point.convert(O.left||[0,0]),right:u.Point.convert(O.right||[0,0])}}return F(new u.Point(0,0))})(this.options.offset);if(!f){var v,w=this._container.offsetWidth,A=this._container.offsetHeight;v=p.y+d.bottom.y<A?["top"]:p.y>this._map.transform.height-A?["bottom"]:[],p.x<w/2?v.push("left"):p.x>this._map.transform.width-w/2&&v.push("right"),f=v.length===0?"bottom":v.join("-")}var R=p.add(d[f]).round();M.setTransform(this._container,En[f]+" translate("+R.x+"px,"+R.y+"px)"),ys(this._container,f,"popup")}},o.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var n=this._container.querySelector(Da);n&&n.focus()}},o.prototype._onClose=function(){this.remove()},o})(u.Evented),gs={version:u.version,supported:U,setRTLTextPlugin:u.setRTLTextPlugin,getRTLTextPluginStatus:u.getRTLTextPluginStatus,Map:Ll,NavigationControl:Fn,GeolocateControl:Iu,AttributionControl:Ai,ScaleControl:ro,FullscreenControl:ln,Popup:Au,Marker:za,Style:Ui,LngLat:u.LngLat,LngLatBounds:u.LngLatBounds,Point:u.Point,MercatorCoordinate:u.MercatorCoordinate,Evented:u.Evented,config:u.config,prewarm:function(){ge().acquire(ye)},clearPrewarmedResources:function(){var i=Je;i&&(i.isPreloaded()&&i.numActive()===1?(i.release(ye),Je=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()"))},get accessToken(){return u.config.ACCESS_TOKEN},set accessToken(i){u.config.ACCESS_TOKEN=i},get baseApiUrl(){return u.config.API_URL},set baseApiUrl(i){u.config.API_URL=i},get workerCount(){return Ae.workerCount},set workerCount(i){Ae.workerCount=i},get maxParallelImageRequests(){return u.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(i){u.config.MAX_PARALLEL_IMAGE_REQUESTS=i},clearStorage:function(i){u.clearTileCache(i)},workerUrl:""};return gs})),E}))})(wc)),wc.exports}var L0=R0();const fo=wt.getDefaultExportFromCjs(L0);var Yu={exports:{}},xp,Ly;function F0(){if(Ly)return xp;Ly=1,xp=_;var y={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"};function _(x){if(!x||!x.type)return null;var k=y[x.type];if(!k)return null;if(k==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:x}]};if(k==="feature")return{type:"FeatureCollection",features:[x]};if(k==="featurecollection")return x}return xp}function Sc(y){switch(y&&y.type||null){case"FeatureCollection":return y.features=y.features.reduce(function(_,x){return _.concat(Sc(x))},[]),y;case"Feature":return y.geometry?Sc(y.geometry).map(function(_){var x={type:"Feature",properties:JSON.parse(JSON.stringify(y.properties)),geometry:_};return y.id!==void 0&&(x.id=y.id),x}):[y];case"MultiPoint":return y.coordinates.map(function(_){return{type:"Point",coordinates:_}});case"MultiPolygon":return y.coordinates.map(function(_){return{type:"Polygon",coordinates:_}});case"MultiLineString":return y.coordinates.map(function(_){return{type:"LineString",coordinates:_}});case"GeometryCollection":return y.geometries.map(Sc).reduce(function(_,x){return _.concat(x)},[]);case"Point":case"Polygon":case"LineString":return[y]}}const O0=Object.freeze(Object.defineProperty({__proto__:null,default:Sc},Symbol.toStringTag,{value:"Module"})),V0=wt.getAugmentedNamespace(O0);var bp,Fy;function q0(){return Fy||(Fy=1,bp=function(_){return x(_);function x(k){return Array.isArray(k)&&k.length&&typeof k[0]=="number"?[k]:k.reduce(function(E,D){return Array.isArray(D)&&Array.isArray(D[0])?E.concat(x(D)):(E.push(D),E)},[])}}),bp}var wp,Oy;function U0(){if(Oy)return wp;Oy=1;var y=F0(),_=V0,x=q0();return _ instanceof Function||(_=_.default),wp=function(k){if(!k)return[];var E=_(y(k)),D=[];return E.features.forEach(function(u){u.geometry&&(D=D.concat(x(u.geometry.coordinates)))}),D},wp}var Sp,Vy;function Qu(){if(Vy)return Sp;Vy=1;var y=Function.prototype.toString,_=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,x,k;if(typeof _=="function"&&typeof Object.defineProperty=="function")try{x=Object.defineProperty({},"length",{get:function(){throw k}}),k={},_(function(){throw 42},null,x)}catch(Ue){Ue!==k&&(_=null)}else _=null;var E=/^\s*class\b/,D=function(fe){try{var Ke=y.call(fe);return E.test(Ke)}catch{return!1}},u=function(fe){try{return D(fe)?!1:(y.call(fe),!0)}catch{return!1}},U=Object.prototype.toString,M="[object Object]",Y="[object Function]",X="[object GeneratorFunction]",ae="[object HTMLAllCollection]",J="[object HTML document.all class]",Se="[object HTMLCollection]",be=typeof Symbol=="function"&&!!Symbol.toStringTag,De=!(0 in[,]),Ze=function(){return!1};if(typeof document=="object"){var He=document.all;U.call(He)===U.call(document.all)&&(Ze=function(fe){if((De||!fe)&&(typeof fe>"u"||typeof fe=="object"))try{var Ke=U.call(fe);return(Ke===ae||Ke===J||Ke===Se||Ke===M)&&fe("")==null}catch{}return!1})}return Sp=_?function(fe){if(Ze(fe))return!0;if(!fe||typeof fe!="function"&&typeof fe!="object")return!1;try{_(fe,null,x)}catch(Ke){if(Ke!==k)return!1}return!D(fe)&&u(fe)}:function(fe){if(Ze(fe))return!0;if(!fe||typeof fe!="function"&&typeof fe!="object")return!1;if(be)return u(fe);if(D(fe))return!1;var Ke=U.call(fe);return Ke!==Y&&Ke!==X&&!/^\[object HTML/.test(Ke)?!1:u(fe)},Sp}var Ip,qy;function Kd(){if(qy)return Ip;qy=1;var y=Qu(),_=Object.prototype.toString,x=Object.prototype.hasOwnProperty,k=function(M,Y,X){for(var ae=0,J=M.length;ae<J;ae++)x.call(M,ae)&&(X==null?Y(M[ae],ae,M):Y.call(X,M[ae],ae,M))},E=function(M,Y,X){for(var ae=0,J=M.length;ae<J;ae++)X==null?Y(M.charAt(ae),ae,M):Y.call(X,M.charAt(ae),ae,M)},D=function(M,Y,X){for(var ae in M)x.call(M,ae)&&(X==null?Y(M[ae],ae,M):Y.call(X,M[ae],ae,M))};function u(U){return _.call(U)==="[object Array]"}return Ip=function(M,Y,X){if(!y(Y))throw new TypeError("iterator must be a function");var ae;arguments.length>=3&&(ae=X),u(M)?k(M,Y,ae):typeof M=="string"?E(M,Y,ae):D(M,Y,ae)},Ip}var Tp,Uy;function mx(){return Uy||(Uy=1,Tp=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Tp}var Ap,Ny;function el(){if(Ny)return Ap;Ny=1;var y=mx(),_=typeof globalThis>"u"?wt.commonjsGlobal:globalThis;return Ap=function(){for(var k=[],E=0;E<y.length;E++)typeof _[y[E]]=="function"&&(k[k.length]=y[E]);return k},Ap}var Ep={exports:{}},Pp,jy;function Jd(){return jy||(jy=1,Pp=Object),Pp}var Cp,Gy;function N0(){return Gy||(Gy=1,Cp=Error),Cp}var kp,$y;function j0(){return $y||($y=1,kp=EvalError),kp}var Mp,Zy;function Yd(){return Zy||(Zy=1,Mp=RangeError),Mp}var Bp,Wy;function G0(){return Wy||(Wy=1,Bp=ReferenceError),Bp}var zp,Hy;function Nn(){return Hy||(Hy=1,zp=SyntaxError),zp}var Dp,Xy;function At(){return Xy||(Xy=1,Dp=TypeError),Dp}var Rp,Ky;function $0(){return Ky||(Ky=1,Rp=URIError),Rp}var Lp,Jy;function Ic(){return Jy||(Jy=1,Lp=Math.abs),Lp}var Fp,Yy;function Ha(){return Yy||(Yy=1,Fp=Math.floor),Fp}var Op,Qy;function Qd(){return Qy||(Qy=1,Op=Math.max),Op}var Vp,ev;function em(){return ev||(ev=1,Vp=Math.min),Vp}var qp,tv;function Xa(){return tv||(tv=1,qp=Math.pow),qp}var Up,rv;function Z0(){return rv||(rv=1,Up=Math.round),Up}var Np,iv;function Ka(){return iv||(iv=1,Np=Number.isNaN||function(_){return _!==_}),Np}var jp,nv;function W0(){if(nv)return jp;nv=1;var y=Ka();return jp=function(x){return y(x)||x===0?x:x<0?-1:1},jp}var Gp,ov;function H0(){return ov||(ov=1,Gp=Object.getOwnPropertyDescriptor),Gp}var $p,av;function No(){if(av)return $p;av=1;var y=H0();if(y)try{y([],"length")}catch{y=null}return $p=y,$p}var Zp,sv;function Xs(){if(sv)return Zp;sv=1;var y=Object.defineProperty||!1;if(y)try{y({},"a",{value:1})}catch{y=!1}return Zp=y,Zp}var Wp,uv;function tm(){return uv||(uv=1,Wp=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var _={},x=Symbol("test"),k=Object(x);if(typeof x=="string"||Object.prototype.toString.call(x)!=="[object Symbol]"||Object.prototype.toString.call(k)!=="[object Symbol]")return!1;var E=42;_[x]=E;for(var D in _)return!1;if(typeof Object.keys=="function"&&Object.keys(_).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(_).length!==0)return!1;var u=Object.getOwnPropertySymbols(_);if(u.length!==1||u[0]!==x||!Object.prototype.propertyIsEnumerable.call(_,x))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var U=Object.getOwnPropertyDescriptor(_,x);if(U.value!==E||U.enumerable!==!0)return!1}return!0}),Wp}var Hp,lv;function yx(){if(lv)return Hp;lv=1;var y=typeof Symbol<"u"&&Symbol,_=tm();return Hp=function(){return typeof y!="function"||typeof Symbol!="function"||typeof y("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_()},Hp}var Xp,cv;function vx(){return cv||(cv=1,Xp=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Xp}var Kp,pv;function gx(){if(pv)return Kp;pv=1;var y=Jd();return Kp=y.getPrototypeOf||null,Kp}var Jp,hv;function X0(){if(hv)return Jp;hv=1;var y="Function.prototype.bind called on incompatible ",_=Object.prototype.toString,x=Math.max,k="[object Function]",E=function(M,Y){for(var X=[],ae=0;ae<M.length;ae+=1)X[ae]=M[ae];for(var J=0;J<Y.length;J+=1)X[J+M.length]=Y[J];return X},D=function(M,Y){for(var X=[],ae=Y,J=0;ae<M.length;ae+=1,J+=1)X[J]=M[ae];return X},u=function(U,M){for(var Y="",X=0;X<U.length;X+=1)Y+=U[X],X+1<U.length&&(Y+=M);return Y};return Jp=function(M){var Y=this;if(typeof Y!="function"||_.apply(Y)!==k)throw new TypeError(y+Y);for(var X=D(arguments,1),ae,J=function(){if(this instanceof ae){var He=Y.apply(this,E(X,arguments));return Object(He)===He?He:this}return Y.apply(M,E(X,arguments))},Se=x(0,Y.length-X.length),be=[],De=0;De<Se;De++)be[De]="$"+De;if(ae=Function("binder","return function ("+u(be,",")+"){ return binder.apply(this,arguments); }")(J),Y.prototype){var Ze=function(){};Ze.prototype=Y.prototype,ae.prototype=new Ze,Ze.prototype=null}return ae},Jp}var Yp,fv;function tl(){if(fv)return Yp;fv=1;var y=X0();return Yp=Function.prototype.bind||y,Yp}var Qp,dv;function rm(){return dv||(dv=1,Qp=Function.prototype.call),Qp}var eh,mv;function im(){return mv||(mv=1,eh=Function.prototype.apply),eh}var th,yv;function K0(){return yv||(yv=1,th=typeof Reflect<"u"&&Reflect&&Reflect.apply),th}var rh,vv;function _x(){if(vv)return rh;vv=1;var y=tl(),_=im(),x=rm(),k=K0();return rh=k||y.call(x,_),rh}var ih,gv;function nm(){if(gv)return ih;gv=1;var y=tl(),_=At(),x=rm(),k=_x();return ih=function(D){if(D.length<1||typeof D[0]!="function")throw new _("a function is required");return k(y,x,D)},ih}var nh,_v;function J0(){if(_v)return nh;_v=1;var y=nm(),_=No(),x;try{x=[].__proto__===Array.prototype}catch(u){if(!u||typeof u!="object"||!("code"in u)||u.code!=="ERR_PROTO_ACCESS")throw u}var k=!!x&&_&&_(Object.prototype,"__proto__"),E=Object,D=E.getPrototypeOf;return nh=k&&typeof k.get=="function"?y([k.get]):typeof D=="function"?function(U){return D(U==null?U:E(U))}:!1,nh}var oh,xv;function Ja(){if(xv)return oh;xv=1;var y=vx(),_=gx(),x=J0();return oh=y?function(E){return y(E)}:_?function(E){if(!E||typeof E!="object"&&typeof E!="function")throw new TypeError("getProto: not an object");return _(E)}:x?function(E){return x(E)}:null,oh}var ah,bv;function xx(){if(bv)return ah;bv=1;const y=(async function(){}).constructor;return ah=()=>y,ah}var sh,wv;function bx(){if(wv)return sh;wv=1;const y=(function*(){}).constructor;return sh=()=>y,sh}var uh,Sv;function Y0(){if(Sv)return uh;Sv=1;const y=(async function*(){}).constructor;return uh=()=>y,uh}var lh,Iv;function jo(){if(Iv)return lh;Iv=1;var y=Function.prototype.call,_=Object.prototype.hasOwnProperty,x=tl();return lh=x.call(y,_),lh}var ch,Tv;function Er(){if(Tv)return ch;Tv=1;var y,_=Jd(),x=N0(),k=j0(),E=Yd(),D=G0(),u=Nn(),U=At(),M=$0(),Y=Ic(),X=Ha(),ae=Qd(),J=em(),Se=Xa(),be=Z0(),De=W0(),Ze=No(),He=Xs(),Ue=function(){throw new U},fe=Ze?(function(){try{return arguments.callee,Ue}catch{try{return Ze(arguments,"callee").get}catch{return Ue}}})():Ue,Ke=yx()(),Ne=Ja(),It=gx(),we=vx(),je=im(),Le=rm(),tt={},Mt=typeof Uint8Array>"u"||!Ne?y:Ne(Uint8Array),Wt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?y:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?y:ArrayBuffer,"%ArrayIteratorPrototype%":Ke&&Ne?Ne([][Symbol.iterator]()):y,"%AsyncFromSyncIteratorPrototype%":y,"%AsyncFunction%":tt,"%AsyncGenerator%":tt,"%AsyncGeneratorFunction%":tt,"%AsyncIteratorPrototype%":tt,"%Atomics%":typeof Atomics>"u"?y:Atomics,"%BigInt%":typeof BigInt>"u"?y:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?y:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?y:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?y:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":x,"%eval%":eval,"%EvalError%":k,"%Float16Array%":typeof Float16Array>"u"?y:Float16Array,"%Float32Array%":typeof Float32Array>"u"?y:Float32Array,"%Float64Array%":typeof Float64Array>"u"?y:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?y:FinalizationRegistry,"%Function%":Function,"%GeneratorFunction%":tt,"%Int8Array%":typeof Int8Array>"u"?y:Int8Array,"%Int16Array%":typeof Int16Array>"u"?y:Int16Array,"%Int32Array%":typeof Int32Array>"u"?y:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ke&&Ne?Ne(Ne([][Symbol.iterator]())):y,"%JSON%":typeof JSON=="object"?JSON:y,"%Map%":typeof Map>"u"?y:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ke||!Ne?y:Ne(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":_,"%Object.getOwnPropertyDescriptor%":Ze,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?y:Promise,"%Proxy%":typeof Proxy>"u"?y:Proxy,"%RangeError%":E,"%ReferenceError%":D,"%Reflect%":typeof Reflect>"u"?y:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?y:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ke||!Ne?y:Ne(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?y:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ke&&Ne?Ne(""[Symbol.iterator]()):y,"%Symbol%":Ke?Symbol:y,"%SyntaxError%":u,"%ThrowTypeError%":fe,"%TypedArray%":Mt,"%TypeError%":U,"%Uint8Array%":typeof Uint8Array>"u"?y:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?y:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?y:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?y:Uint32Array,"%URIError%":M,"%WeakMap%":typeof WeakMap>"u"?y:WeakMap,"%WeakRef%":typeof WeakRef>"u"?y:WeakRef,"%WeakSet%":typeof WeakSet>"u"?y:WeakSet,"%Function.prototype.call%":Le,"%Function.prototype.apply%":je,"%Object.defineProperty%":He,"%Object.getPrototypeOf%":It,"%Math.abs%":Y,"%Math.floor%":X,"%Math.max%":ae,"%Math.min%":J,"%Math.pow%":Se,"%Math.round%":be,"%Math.sign%":De,"%Reflect.getPrototypeOf%":we};if(Ne)try{null.error}catch(Nr){var St=Ne(Ne(Nr));Wt["%Error.prototype%"]=St}var Ut=xx(),Hr=bx(),Pr=Y0(),bi=function Nr(ar){var sr;if(ar==="%AsyncFunction%")sr=Ut()||void 0;else if(ar==="%GeneratorFunction%")sr=Hr()||void 0;else if(ar==="%AsyncGeneratorFunction%")sr=Pr()||void 0;else if(ar==="%AsyncGenerator%"){var lt=Nr("%AsyncGeneratorFunction%");lt&&(sr=lt.prototype)}else if(ar==="%AsyncIteratorPrototype%"){var mr=Nr("%AsyncGenerator%");mr&&Ne&&(sr=Ne(mr.prototype))}return Wt[ar]=sr,sr},or={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Rr=tl(),et=jo(),Lr=Rr.call(Le,Array.prototype.concat),Xr=Rr.call(je,Array.prototype.splice),Et=Rr.call(Le,String.prototype.replace),Fr=Rr.call(Le,String.prototype.slice),Mi=Rr.call(Le,RegExp.prototype.exec),pi=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Or=/\\(\\)?/g,Xi=function(ar){var sr=Fr(ar,0,1),lt=Fr(ar,-1);if(sr==="%"&<!=="%")throw new u("invalid intrinsic syntax, expected closing `%`");if(lt==="%"&&sr!=="%")throw new u("invalid intrinsic syntax, expected opening `%`");var mr=[];return Et(ar,pi,function(hr,jr,fr,br){mr[mr.length]=fr?Et(br,Or,"$1"):jr||hr}),mr},Nt=function(ar,sr){var lt=ar,mr;if(et(or,lt)&&(mr=or[lt],lt="%"+mr[0]+"%"),et(Wt,lt)){var hr=Wt[lt];if(hr===tt&&(hr=bi(lt)),typeof hr>"u"&&!sr)throw new U("intrinsic "+ar+" exists, but is not available. Please file an issue!");return{alias:mr,name:lt,value:hr}}throw new u("intrinsic "+ar+" does not exist!")};return ch=function(ar,sr){if(typeof ar!="string"||ar.length===0)throw new U("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof sr!="boolean")throw new U('"allowMissing" argument must be a boolean');if(Mi(/^%?[^%]*%?$/,ar)===null)throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var lt=Xi(ar),mr=lt.length>0?lt[0]:"",hr=Nt("%"+mr+"%",sr),jr=hr.name,fr=hr.value,br=!1,dn=hr.alias;dn&&(mr=dn[0],Xr(lt,Lr([0,1],dn)));for(var Kr=1,Bi=!0;Kr<lt.length;Kr+=1){var hi=lt[Kr],ti=Fr(hi,0,1),ri=Fr(hi,-1);if((ti==='"'||ti==="'"||ti==="`"||ri==='"'||ri==="'"||ri==="`")&&ti!==ri)throw new u("property names with quotes must have matching quotes");if((hi==="constructor"||!Bi)&&(br=!0),mr+="."+hi,jr="%"+mr+"%",et(Wt,jr))fr=Wt[jr];else if(fr!=null){if(!(hi in fr)){if(!sr)throw new U("base intrinsic for "+ar+" exists, but the property is not available.");return}if(Ze&&Kr+1>=lt.length){var Vi=Ze(fr,hi);Bi=!!Vi,Bi&&"get"in Vi&&!("originalValue"in Vi.get)?fr=Vi.get:fr=fr[hi]}else Bi=et(fr,hi),fr=fr[hi];Bi&&!br&&(Wt[jr]=fr)}}return fr},ch}var ph,Av;function om(){if(Av)return ph;Av=1;var y=Xs(),_=Nn(),x=At(),k=No();return ph=function(D,u,U){if(!D||typeof D!="object"&&typeof D!="function")throw new x("`obj` must be an object or a function`");if(typeof u!="string"&&typeof u!="symbol")throw new x("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new x("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new x("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new x("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new x("`loose`, if provided, must be a boolean");var M=arguments.length>3?arguments[3]:null,Y=arguments.length>4?arguments[4]:null,X=arguments.length>5?arguments[5]:null,ae=arguments.length>6?arguments[6]:!1,J=!!k&&k(D,u);if(y)y(D,u,{configurable:X===null&&J?J.configurable:!X,enumerable:M===null&&J?J.enumerable:!M,value:U,writable:Y===null&&J?J.writable:!Y});else if(ae||!M&&!Y&&!X)D[u]=U;else throw new _("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},ph}var hh,Ev;function rl(){if(Ev)return hh;Ev=1;var y=Xs(),_=function(){return!!y};return _.hasArrayLengthDefineBug=function(){if(!y)return null;try{return y([],"length",{value:1}).length!==1}catch{return!0}},hh=_,hh}var fh,Pv;function Q0(){if(Pv)return fh;Pv=1;var y=Er(),_=om(),x=rl()(),k=No(),E=At(),D=y("%Math.floor%");return fh=function(U,M){if(typeof U!="function")throw new E("`fn` is not a function");if(typeof M!="number"||M<0||M>4294967295||D(M)!==M)throw new E("`length` must be a positive 32-bit integer");var Y=arguments.length>2&&!!arguments[2],X=!0,ae=!0;if("length"in U&&k){var J=k(U,"length");J&&!J.configurable&&(X=!1),J&&!J.writable&&(ae=!1)}return(X||ae||!Y)&&(x?_(U,"length",M,!0,!0):_(U,"length",M)),U},fh}var dh,Cv;function e1(){if(Cv)return dh;Cv=1;var y=tl(),_=im(),x=_x();return dh=function(){return x(y,_,arguments)},dh}var kv;function ha(){return kv||(kv=1,(function(y){var _=Q0(),x=Xs(),k=nm(),E=e1();y.exports=function(u){var U=k(arguments),M=1+u.length-(arguments.length-1);return _(U,M>0?M:0,!0)},x?x(y.exports,"apply",{value:E}):y.exports.apply=E})(Ep)),Ep.exports}var mh,Mv;function pr(){if(Mv)return mh;Mv=1;var y=Er(),_=nm(),x=_([y("%String.prototype.indexOf%")]);return mh=function(E,D){var u=y(E,!!D);return typeof u=="function"&&x(E,".prototype.")>-1?_([u]):u},mh}var yh,Bv;function Go(){if(Bv)return yh;Bv=1;var y=tm();return yh=function(){return y()&&!!Symbol.toStringTag},yh}var vh,zv;function Ks(){if(zv)return vh;zv=1;var y=Kd(),_=el(),x=ha(),k=pr(),E=No(),D=Ja(),u=k("Object.prototype.toString"),U=Go()(),M=typeof globalThis>"u"?wt.commonjsGlobal:globalThis,Y=_(),X=k("String.prototype.slice"),ae=k("Array.prototype.indexOf",!0)||function(He,Ue){for(var fe=0;fe<He.length;fe+=1)if(He[fe]===Ue)return fe;return-1},J={__proto__:null};U&&E&&D?y(Y,function(Ze){var He=new M[Ze];if(Symbol.toStringTag in He&&D){var Ue=D(He),fe=E(Ue,Symbol.toStringTag);if(!fe&&Ue){var Ke=D(Ue);fe=E(Ke,Symbol.toStringTag)}if(fe&&fe.get){var Ne=x(fe.get);J["$"+Ze]=Ne}}}):y(Y,function(Ze){var He=new M[Ze],Ue=He.slice||He.set;if(Ue){var fe=x(Ue);J["$"+Ze]=fe}});function Se(Ze){var He=!1;return y(J,function(Ue,fe){if(!He)try{"$"+Ue(Ze)===fe&&(He=X(fe,1))}catch{}}),He}function be(Ze){var He=!1;return y(J,function(Ue,fe){if(!He)try{Ue(Ze),He=X(fe,1)}catch{}}),He}function De(Ze){return ae(Y,Ze)>-1}return vh=function(He){if(!He||typeof He!="object")return!1;if(!U){var Ue=X(u(He),8,-1);return De(Ue)?Ue:Ue!=="Object"?!1:be(He)}return E?Se(He):null},vh}var gh,Dv;function wx(){if(Dv)return gh;Dv=1;var y=Object.prototype.toString;return gh=function(x){var k=y.call(x),E=k==="[object Arguments]";return E||(E=k!=="[object Array]"&&x!==null&&typeof x=="object"&&typeof x.length=="number"&&x.length>=0&&y.call(x.callee)==="[object Function]"),E},gh}var _h,Rv;function t1(){if(Rv)return _h;Rv=1;var y;if(!Object.keys){var _=Object.prototype.hasOwnProperty,x=Object.prototype.toString,k=wx(),E=Object.prototype.propertyIsEnumerable,D=!E.call({toString:null},"toString"),u=E.call(function(){},"prototype"),U=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],M=function(J){var Se=J.constructor;return Se&&Se.prototype===J},Y={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},X=(function(){if(typeof window>"u")return!1;for(var J in window)try{if(!Y["$"+J]&&_.call(window,J)&&window[J]!==null&&typeof window[J]=="object")try{M(window[J])}catch{return!0}}catch{return!0}return!1})(),ae=function(J){if(typeof window>"u"||!X)return M(J);try{return M(J)}catch{return!1}};y=function(Se){var be=Se!==null&&typeof Se=="object",De=x.call(Se)==="[object Function]",Ze=k(Se),He=be&&x.call(Se)==="[object String]",Ue=[];if(!be&&!De&&!Ze)throw new TypeError("Object.keys called on a non-object");var fe=u&&De;if(He&&Se.length>0&&!_.call(Se,0))for(var Ke=0;Ke<Se.length;++Ke)Ue.push(String(Ke));if(Ze&&Se.length>0)for(var Ne=0;Ne<Se.length;++Ne)Ue.push(String(Ne));else for(var It in Se)!(fe&&It==="prototype")&&_.call(Se,It)&&Ue.push(String(It));if(D)for(var we=ae(Se),je=0;je<U.length;++je)!(we&&U[je]==="constructor")&&_.call(Se,U[je])&&Ue.push(U[je]);return Ue}}return _h=y,_h}var xh,Lv;function r1(){if(Lv)return xh;Lv=1;var y=Array.prototype.slice,_=wx(),x=Object.keys,k=x?function(u){return x(u)}:t1(),E=Object.keys;return k.shim=function(){if(Object.keys){var u=(function(){var U=Object.keys(arguments);return U&&U.length===arguments.length})(1,2);u||(Object.keys=function(M){return _(M)?E(y.call(M)):E(M)})}else Object.keys=k;return Object.keys||k},xh=k,xh}var bh,Fv;function am(){if(Fv)return bh;Fv=1;var y=r1(),_=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",x=Object.prototype.toString,k=Array.prototype.concat,E=om(),D=function(Y){return typeof Y=="function"&&x.call(Y)==="[object Function]"},u=rl()(),U=function(Y,X,ae,J){if(X in Y){if(J===!0){if(Y[X]===ae)return}else if(!D(J)||!J())return}u?E(Y,X,ae,!0):E(Y,X,ae)},M=function(Y,X){var ae=arguments.length>2?arguments[2]:{},J=y(X);_&&(J=k.call(J,Object.getOwnPropertySymbols(X)));for(var Se=0;Se<J.length;Se+=1)U(Y,J[Se],X[J[Se]],ae[J[Se]])};return M.supportsDescriptors=!!u,bh=M,bh}const i1={},n1=Object.freeze(Object.defineProperty({__proto__:null,default:i1},Symbol.toStringTag,{value:"Module"})),o1=wt.getAugmentedNamespace(n1);var wh,Ov;function sm(){if(Ov)return wh;Ov=1;var y=typeof Map=="function"&&Map.prototype,_=Object.getOwnPropertyDescriptor&&y?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,x=y&&_&&typeof _.get=="function"?_.get:null,k=y&&Map.prototype.forEach,E=typeof Set=="function"&&Set.prototype,D=Object.getOwnPropertyDescriptor&&E?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=E&&D&&typeof D.get=="function"?D.get:null,U=E&&Set.prototype.forEach,M=typeof WeakMap=="function"&&WeakMap.prototype,Y=M?WeakMap.prototype.has:null,X=typeof WeakSet=="function"&&WeakSet.prototype,ae=X?WeakSet.prototype.has:null,J=typeof WeakRef=="function"&&WeakRef.prototype,Se=J?WeakRef.prototype.deref:null,be=Boolean.prototype.valueOf,De=Object.prototype.toString,Ze=Function.prototype.toString,He=String.prototype.match,Ue=String.prototype.slice,fe=String.prototype.replace,Ke=String.prototype.toUpperCase,Ne=String.prototype.toLowerCase,It=RegExp.prototype.test,we=Array.prototype.concat,je=Array.prototype.join,Le=Array.prototype.slice,tt=Math.floor,Mt=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Wt=Object.getOwnPropertySymbols,St=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ut=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Hr=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ut||!0)?Symbol.toStringTag:null,Pr=Object.prototype.propertyIsEnumerable,bi=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(de){return de.__proto__}:null);function or(de,_e){if(de===1/0||de===-1/0||de!==de||de&&de>-1e3&&de<1e3||It.call(/e/,_e))return _e;var jt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof de=="number"){var tr=de<0?-tt(-de):tt(de);if(tr!==de){var Kt=String(tr),_t=Ue.call(_e,Kt.length+1);return fe.call(Kt,jt,"$&_")+"."+fe.call(fe.call(_t,/([0-9]{3})/g,"$&_"),/_$/,"")}}return fe.call(_e,jt,"$&_")}var Rr=o1,et=Rr.custom,Lr=mr(et)?et:null,Xr={__proto__:null,double:'"',single:"'"},Et={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};wh=function de(_e,jt,tr,Kt){var _t=jt||{};if(fr(_t,"quoteStyle")&&!fr(Xr,_t.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(fr(_t,"maxStringLength")&&(typeof _t.maxStringLength=="number"?_t.maxStringLength<0&&_t.maxStringLength!==1/0:_t.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var fi=fr(_t,"customInspect")?_t.customInspect:!0;if(typeof fi!="boolean"&&fi!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(fr(_t,"indent")&&_t.indent!==null&&_t.indent!==" "&&!(parseInt(_t.indent,10)===_t.indent&&_t.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(fr(_t,"numericSeparator")&&typeof _t.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var qi=_t.numericSeparator;if(typeof _e>"u")return"undefined";if(_e===null)return"null";if(typeof _e=="boolean")return _e?"true":"false";if(typeof _e=="string")return yo(_e,_t);if(typeof _e=="number"){if(_e===0)return 1/0/_e>0?"0":"-0";var ii=String(_e);return qi?or(_e,ii):ii}if(typeof _e=="bigint"){var Yt=String(_e)+"n";return qi?or(_e,Yt):Yt}var T=typeof _t.depth>"u"?5:_t.depth;if(typeof tr>"u"&&(tr=0),tr>=T&&T>0&&typeof _e=="object")return Or(_e)?"[Array]":"[Object]";var P=jn(_t,tr);if(typeof Kt>"u")Kt=[];else if(Kr(Kt,_e)>=0)return"[Circular]";function B(Me,yt,Fe){if(yt&&(Kt=Le.call(Kt),Kt.push(yt)),Fe){var Pt={depth:_t.depth};return fr(_t,"quoteStyle")&&(Pt.quoteStyle=_t.quoteStyle),de(Me,Pt,tr+1,Kt)}return de(Me,_t,tr+1,Kt)}if(typeof _e=="function"&&!Nt(_e)){var V=dn(_e),$=rn(_e,B);return"[Function"+(V?": "+V:" (anonymous)")+"]"+($.length>0?" { "+je.call($,", ")+" }":"")}if(mr(_e)){var re=Ut?fe.call(String(_e),/^(Symbol\(.*\))_[^)]*$/,"$1"):St.call(_e);return typeof _e=="object"&&!Ut?mn(re):re}if(Ki(_e)){for(var ie="<"+Ne.call(String(_e.nodeName)),L=_e.attributes||[],H=0;H<L.length;H++)ie+=" "+L[H].name+"="+Fr(Mi(L[H].value),"double",_t);return ie+=">",_e.childNodes&&_e.childNodes.length&&(ie+="..."),ie+="</"+Ne.call(String(_e.nodeName))+">",ie}if(Or(_e)){if(_e.length===0)return"[]";var se=rn(_e,B);return P&&!Zo(se)?"["+zn(se,P)+"]":"[ "+je.call(se,", ")+" ]"}if(Nr(_e)){var Ie=rn(_e,B);return!("cause"in Error.prototype)&&"cause"in _e&&!Pr.call(_e,"cause")?"{ ["+String(_e)+"] "+je.call(we.call("[cause]: "+B(_e.cause),Ie),", ")+" }":Ie.length===0?"["+String(_e)+"]":"{ ["+String(_e)+"] "+je.call(Ie,", ")+" }"}if(typeof _e=="object"&&fi){if(Lr&&typeof _e[Lr]=="function"&&Rr)return Rr(_e,{depth:T-tr});if(fi!=="symbol"&&typeof _e.inspect=="function")return _e.inspect()}if(Bi(_e)){var Ee=[];return k&&k.call(_e,function(Me,yt){Ee.push(B(yt,_e,!0)+" => "+B(Me,_e))}),Bn("Map",x.call(_e),Ee,P)}if(ri(_e)){var ye=[];return U&&U.call(_e,function(Me){ye.push(B(Me,_e))}),Bn("Set",u.call(_e),ye,P)}if(hi(_e))return Mn("WeakMap");if(Vi(_e))return Mn("WeakSet");if(ti(_e))return Mn("WeakRef");if(sr(_e))return mn(B(Number(_e)));if(hr(_e))return mn(B(Mt.call(_e)));if(lt(_e))return mn(be.call(_e));if(ar(_e))return mn(B(String(_e)));if(typeof window<"u"&&_e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&_e===globalThis||typeof wt.commonjsGlobal<"u"&&_e===wt.commonjsGlobal)return"{ [object globalThis] }";if(!Xi(_e)&&!Nt(_e)){var Ae=rn(_e,B),Je=bi?bi(_e)===Object.prototype:_e instanceof Object||_e.constructor===Object,Ge=_e instanceof Object?"":"null prototype",ge=!Je&&Hr&&Object(_e)===_e&&Hr in _e?Ue.call(br(_e),8,-1):Ge?"Object":"",Ve=Je||typeof _e.constructor!="function"?"":_e.constructor.name?_e.constructor.name+" ":"",Be=Ve+(ge||Ge?"["+je.call(we.call([],ge||[],Ge||[]),": ")+"] ":"");return Ae.length===0?Be+"{}":P?Be+"{"+zn(Ae,P)+"}":Be+"{ "+je.call(Ae,", ")+" }"}return String(_e)};function Fr(de,_e,jt){var tr=jt.quoteStyle||_e,Kt=Xr[tr];return Kt+de+Kt}function Mi(de){return fe.call(String(de),/"/g,""")}function pi(de){return!Hr||!(typeof de=="object"&&(Hr in de||typeof de[Hr]<"u"))}function Or(de){return br(de)==="[object Array]"&&pi(de)}function Xi(de){return br(de)==="[object Date]"&&pi(de)}function Nt(de){return br(de)==="[object RegExp]"&&pi(de)}function Nr(de){return br(de)==="[object Error]"&&pi(de)}function ar(de){return br(de)==="[object String]"&&pi(de)}function sr(de){return br(de)==="[object Number]"&&pi(de)}function lt(de){return br(de)==="[object Boolean]"&&pi(de)}function mr(de){if(Ut)return de&&typeof de=="object"&&de instanceof Symbol;if(typeof de=="symbol")return!0;if(!de||typeof de!="object"||!St)return!1;try{return St.call(de),!0}catch{}return!1}function hr(de){if(!de||typeof de!="object"||!Mt)return!1;try{return Mt.call(de),!0}catch{}return!1}var jr=Object.prototype.hasOwnProperty||function(de){return de in this};function fr(de,_e){return jr.call(de,_e)}function br(de){return De.call(de)}function dn(de){if(de.name)return de.name;var _e=He.call(Ze.call(de),/^function\s*([\w$]+)/);return _e?_e[1]:null}function Kr(de,_e){if(de.indexOf)return de.indexOf(_e);for(var jt=0,tr=de.length;jt<tr;jt++)if(de[jt]===_e)return jt;return-1}function Bi(de){if(!x||!de||typeof de!="object")return!1;try{x.call(de);try{u.call(de)}catch{return!0}return de instanceof Map}catch{}return!1}function hi(de){if(!Y||!de||typeof de!="object")return!1;try{Y.call(de,Y);try{ae.call(de,ae)}catch{return!0}return de instanceof WeakMap}catch{}return!1}function ti(de){if(!Se||!de||typeof de!="object")return!1;try{return Se.call(de),!0}catch{}return!1}function ri(de){if(!u||!de||typeof de!="object")return!1;try{u.call(de);try{x.call(de)}catch{return!0}return de instanceof Set}catch{}return!1}function Vi(de){if(!ae||!de||typeof de!="object")return!1;try{ae.call(de,ae);try{Y.call(de,Y)}catch{return!0}return de instanceof WeakSet}catch{}return!1}function Ki(de){return!de||typeof de!="object"?!1:typeof HTMLElement<"u"&&de instanceof HTMLElement?!0:typeof de.nodeName=="string"&&typeof de.getAttribute=="function"}function yo(de,_e){if(de.length>_e.maxStringLength){var jt=de.length-_e.maxStringLength,tr="... "+jt+" more character"+(jt>1?"s":"");return yo(Ue.call(de,0,_e.maxStringLength),_e)+tr}var Kt=Et[_e.quoteStyle||"single"];Kt.lastIndex=0;var _t=fe.call(fe.call(de,Kt,"\\$1"),/[\x00-\x1f]/g,$o);return Fr(_t,"single",_e)}function $o(de){var _e=de.charCodeAt(0),jt={8:"b",9:"t",10:"n",12:"f",13:"r"}[_e];return jt?"\\"+jt:"\\x"+(_e<16?"0":"")+Ke.call(_e.toString(16))}function mn(de){return"Object("+de+")"}function Mn(de){return de+" { ? }"}function Bn(de,_e,jt,tr){var Kt=tr?zn(jt,tr):je.call(jt,", ");return de+" ("+_e+") {"+Kt+"}"}function Zo(de){for(var _e=0;_e<de.length;_e++)if(Kr(de[_e],`
|
|
498
|
-
|
|
499
|
-
`+_e.prev+_e.base;return jt+je.call(de,","+jt)+`
|
|
500
|
-
`+_e.prev}function rn(de,_e){var jt=Or(de),tr=[];if(jt){tr.length=de.length;for(var Kt=0;Kt<de.length;Kt++)tr[Kt]=fr(de,Kt)?_e(de[Kt],de):""}var _t=typeof Wt=="function"?Wt(de):[],fi;if(Ut){fi={};for(var qi=0;qi<_t.length;qi++)fi["$"+_t[qi]]=_t[qi]}for(var ii in de)fr(de,ii)&&(jt&&String(Number(ii))===ii&&ii<de.length||Ut&&fi["$"+ii]instanceof Symbol||(It.call(/[^\w$]/,ii)?tr.push(_e(ii,de)+": "+_e(de[ii],de)):tr.push(ii+": "+_e(de[ii],de))));if(typeof Wt=="function")for(var Yt=0;Yt<_t.length;Yt++)Pr.call(de,_t[Yt])&&tr.push("["+_e(_t[Yt])+"]: "+_e(de[_t[Yt]],de));return tr}return wh}var Sh,Vv;function Tc(){return Vv||(Vv=1,Sh=function(_){return typeof _=="string"||typeof _=="symbol"}),Sh}var Ih,qv;function fa(){return qv||(qv=1,Ih=function(_){return!!_&&(typeof _=="function"||typeof _=="object")}),Ih}var Th,Uv;function a1(){if(Uv)return Th;Uv=1;var y=At(),_=sm(),x=Tc(),k=fa();return Th=function(D,u){if(!k(D))throw new y("Assertion failed: Type(O) is not Object");if(!x(u))throw new y("Assertion failed: P is not a Property Key, got "+_(u));return D[u]},Th}var Ah,Nv;function mo(){if(Nv)return Ah;Nv=1;var y=Ka();return Ah=function(x){return(typeof x=="number"||typeof x=="bigint")&&!y(x)&&x!==1/0&&x!==-1/0},Ah}var Eh,jv;function Ac(){if(jv)return Eh;jv=1;var y=Ic(),_=Ha(),x=Ka(),k=mo();return Eh=function(D){if(typeof D!="number"||x(D)||!k(D))return!1;var u=y(D);return _(u)===u},Eh}var Ph,Gv;function Js(){if(Gv)return Ph;Gv=1;var y=ha(),_=pr(),x=Er(),k=x("%ArrayBuffer%",!0),E=_("ArrayBuffer.prototype.byteLength",!0),D=_("Object.prototype.toString"),u=!!k&&!E&&new k(0).slice,U=!!u&&y(u);return Ph=E||U?function(Y){if(!Y||typeof Y!="object")return!1;try{return E?E(Y):U(Y,0),!0}catch{return!1}}:k?function(Y){return D(Y)==="[object ArrayBuffer]"}:function(Y){return!1},Ph}var Ch,$v;function Sx(){if($v)return Ch;$v=1;var y=pr(),_=y("ArrayBuffer.prototype.byteLength",!0),x=Js();return Ch=function(E){return x(E)?_?_(E):E.byteLength:NaN},Ch}var kh,Zv;function il(){if(Zv)return kh;Zv=1;var y=pr(),_=y("SharedArrayBuffer.prototype.byteLength",!0);return kh=_?function(k){if(!k||typeof k!="object")return!1;try{return _(k),!0}catch{return!1}}:function(k){return!1},kh}var Mh,Wv;function Ys(){if(Wv)return Mh;Wv=1;var y=At(),_=Sx(),x=el()(),k=pr(),E=Js(),D=il(),u=k("SharedArrayBuffer.prototype.byteLength",!0);return Mh=function(M){var Y=D(M);if(!E(M)&&!Y)throw new y("Assertion failed: `arrayBuffer` must be an Object with an [[ArrayBufferData]] internal slot");if((Y?u:_)(M)===0)try{new wt.commonjsGlobal[x[0]](M)}catch(X){return!!X&&X.name==="TypeError"}return!1},Mh}var Bh,Hv;function Ix(){if(Hv)return Bh;Hv=1;var y=At(),_=jo(),x=fa(),k=Tc();return Bh=function(D,u){if(!x(D))throw new y("Assertion failed: `O` must be an Object");if(!k(u))throw new y("Assertion failed: `P` must be a Property Key");return _(D,u)},Bh}var zh,Xv;function Tx(){if(Xv)return zh;Xv=1;var y=Er(),_=y("%Array%"),x=!_.isArray&&pr()("Object.prototype.toString");return zh=_.isArray||function(E){return x(E)==="[object Array]"},zh}var Dh,Kv;function um(){return Kv||(Kv=1,Dh=Tx()),Dh}var Rh,Jv;function Ax(){return Jv||(Jv=1,Rh=function(_){return _==="BIGUINT64"||_==="BIGINT64"}),Rh}var Lh,Yv;function s1(){return Yv||(Yv=1,Lh=function(_){return _==="UINT8"||_==="UINT8C"||_==="UINT16"||_==="UINT32"||_==="BIGUINT64"}),Lh}var Fh,Qv;function u1(){if(Qv)return Fh;Qv=1;var y=Xa();return Fh=function(x){var k=x[3]&128?-1:1,E=(x[3]&127)<<1|x[2]>>7,D=(x[2]&127)<<16|x[1]<<8|x[0];return E===0&&D===0?k===1?0:-0:E===255&&D===0?k===1?1/0:-1/0:E===255&&D!==0?NaN:(E-=127,E===-127?k*D*y(2,-149):k*(1+D*y(2,-23))*y(2,E))},Fh}var Oh,eg;function l1(){if(eg)return Oh;eg=1;var y=Xa();return Oh=function(x){var k=x[7]&128?-1:1,E=(x[7]&127)<<4|(x[6]&240)>>4,D=(x[6]&15)*281474976710656+x[5]*1099511627776+x[4]*4294967296+x[3]*16777216+x[2]*65536+x[1]*256+x[0];return E===0&&D===0?k*0:E===2047&&D!==0?NaN:E===2047&&D===0?k*(1/0):(E-=1023,E===-1023?k*D*5e-324:k*(1+D/4503599627370496)*y(2,E))},Oh}var Vh,tg;function c1(){if(tg)return Vh;tg=1;var y=Er(),_=Xa(),x=y("%Number%"),k=y("%BigInt%",!0);return Vh=function(D,u,U,M){for(var Y=M?k:x,X=Y(0),ae=0;ae<D.length;ae++)X+=Y(D[ae]*_(2,8*ae));if(!U){var J=u*8;D[u-1]&128&&(X-=Y(_(2,J)))}return X},Vh}var qh,rg;function p1(){return rg||(rg=1,qh=function(_,x){for(var k=0;k<_.length;k+=1)if(!x(_[k],k,_))return!1;return!0}),qh}var Uh,ig;function h1(){return ig||(ig=1,Uh=function(_){return typeof _=="number"&&_>=0&&_<=255&&(_|0)===_}),Uh}var Nh,ng;function Qs(){return ng||(ng=1,Nh={__proto__:null,name:{__proto__:null,$Int8Array:"INT8",$Uint8Array:"UINT8",$Uint8ClampedArray:"UINT8C",$Int16Array:"INT16",$Uint16Array:"UINT16",$Int32Array:"INT32",$Uint32Array:"UINT32",$BigInt64Array:"BIGINT64",$BigUint64Array:"BIGUINT64",$Float32Array:"FLOAT32",$Float64Array:"FLOAT64"},size:{__proto__:null,$INT8:1,$UINT8:1,$UINT8C:1,$INT16:2,$UINT16:2,$INT32:4,$UINT32:4,$BIGINT64:8,$BIGUINT64:8,$FLOAT32:4,$FLOAT64:8},choices:'"INT8", "UINT8", "UINT8C", "INT16", "UINT16", "INT32", "UINT32", "BIGINT64", "BIGUINT64", "FLOAT32", or "FLOAT64"'}),Nh}var jh,og;function f1(){if(og)return jh;og=1;var y=Er(),_=pr(),x=Yd(),k=Nn(),E=At(),D=y("%BigInt%",!0),u=Ix(),U=um(),M=Ax(),Y=s1(),X=u1(),ae=l1(),J=c1(),Se=p1(),be=h1(),De=_("Array.prototype.reverse"),Ze=_("Array.prototype.slice"),He=Qs();return jh=function(fe,Ke,Ne){if(!u(He.size,"$"+fe))throw new E("Assertion failed: `type` must be a TypedArray element type");if(!U(Ke)||!Se(Ke,be))throw new E("Assertion failed: `rawBytes` must be an Array of bytes");if(typeof Ne!="boolean")throw new E("Assertion failed: `isLittleEndian` must be a Boolean");var It=He.size["$"+fe];if(Ke.length!==It)throw new x("Assertion failed: `rawBytes` must have a length of "+It+" for type "+fe);var we=M(fe);if(we&&!D)throw new k("this environment does not support BigInts");return Ke=Ze(Ke,0,It),Ne||De(Ke),fe==="FLOAT32"?X(Ke):fe==="FLOAT64"?ae(Ke):J(Ke,It,Y(fe),we)},jh}var Gh,ag;function Ex(){if(ag)return Gh;ag=1;var y={}.toString;return Gh=Array.isArray||function(_){return y.call(_)=="[object Array]"},Gh}var $h,sg;function d1(){if(sg)return $h;sg=1;var y=Er(),_=y("%Array.prototype.concat%"),x=ha(),k=pr(),E=k("Array.prototype.slice"),D=tm()(),u=D&&Symbol.isConcatSpreadable,U=[],M=u?x.apply(_,U):null,Y=u?Ex():null;return $h=u?function(ae){for(var J=0;J<arguments.length;J+=1){var Se=arguments[J];if(Se&&typeof Se=="object"&&typeof Se[u]=="boolean"){U[u]||(U[u]=!0);var be=Y(Se)?E(Se):[Se];be[u]=!0,arguments[J]=be}}return M(arguments)}:x(_,U),$h}var Zh,ug;function eu(){if(ug)return Zh;ug=1;var y=Ks();return Zh=function(x){return!!y(x)},Zh}var Wh,lg;function nl(){if(lg)return Wh;lg=1;var y=At(),_=pr(),x=_("TypedArray.prototype.buffer",!0),k=eu();return Wh=x||function(D){if(!k(D))throw new y("Not a Typed Array");return D.buffer},Wh}var Hh,cg;function Px(){if(cg)return Hh;cg=1;var y=Er(),_=y("%Uint8Array%",!0),x=y("%Uint32Array%",!0),k=nl(),E=x&&new x([305419896]),D=E&&new _(k(E));return Hh=D?D[0]===120?"little":D[0]===18?"big":D[0]===52?"mixed":"unknown":"indeterminate",Hh}var Xh,pg;function m1(){if(pg)return Xh;pg=1;var y=Er(),_=Nn(),x=At(),k=pr(),E=Ac(),D=y("%Uint8Array%",!0),u=k("Array.prototype.slice"),U=Ys(),M=f1(),Y=Js(),X=il(),ae=d1(),J=Qs(),Se=Px();return Xh=function(De,Ze,He,Ue,fe){var Ke=X(De);if(!Y(De)&&!Ke)throw new x("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!E(Ze))throw new x("Assertion failed: `byteIndex` must be an integer");if(typeof He!="string"||typeof J.size["$"+He]!="number")throw new x("Assertion failed: `type` must be one of "+J.choices);if(typeof Ue!="boolean")throw new x("Assertion failed: `isTypedArray` must be a boolean");if(fe!=="SEQ-CST"&&fe!=="UNORDERED")throw new x("Assertion failed: `order` must be either `SEQ-CST` or `UNORDERED`");if(arguments.length>5&&typeof arguments[5]!="boolean")throw new x("Assertion failed: `isLittleEndian` must be a boolean, if present");if(U(De))throw new x("Assertion failed: `arrayBuffer` is detached");if(Ze<0)throw new x("Assertion failed: `byteIndex` must be non-negative");var Ne=J.size["$"+He];if(!Ne)throw new x("Assertion failed: `type` must be one of "+J.choices);var It;if(Ke)throw new _("SharedArrayBuffer is not supported by this implementation");It=u(new D(De,Ze),0,Ne);var we=arguments.length>5?arguments[5]:Se==="little",je=we?u(ae([0,0,0,0,0,0,0,0],It),-Ne):u(ae(It,[0,0,0,0,0,0,0,0]),0,Ne);return M(He,je,we)},Xh}var Kh,hg;function Cx(){if(hg)return Kh;hg=1;var y=Ka();return Kh=function(x,k){return x===k?x===0?1/x===1/k:!0:y(x)&&y(k)},Kh}var Jh,fg;function y1(){if(fg)return Jh;fg=1;var y=At(),_=fa(),x=Tc(),k=Cx(),E=(function(){try{return delete[].length,!0}catch{return!1}})();return Jh=function(u,U,M,Y){if(!_(u))throw new y("Assertion failed: `O` must be an Object");if(!x(U))throw new y("Assertion failed: `P` must be a Property Key");if(typeof Y!="boolean")throw new y("Assertion failed: `Throw` must be a Boolean");if(Y){if(u[U]=M,E&&!k(u[U],M))throw new y("Attempted to assign to readonly property.");return!0}try{return u[U]=M,E?k(u[U],M):!0}catch{return!1}},Jh}var Yh,dg;function v1(){if(dg)return Yh;dg=1;var y=Er(),_=y("%BigInt%",!0),x=At(),k=Nn();return Yh=function(D){if(typeof D!="string")throw new x("`argument` must be a string");if(!_)throw new k("BigInts are not supported in this environment");try{return _(D)}catch{return}},Yh}var Qh,mg;function kx(){if(mg)return Qh;mg=1;var y=pr(),_=y("Date.prototype.getDay"),x=function(U){try{return _(U),!0}catch{return!1}},k=y("Object.prototype.toString"),E="[object Date]",D=Go()();return Qh=function(U){return typeof U!="object"||U===null?!1:D?x(U):k(U)===E},Qh}var yc={exports:{}},ef,yg;function Mx(){if(yg)return ef;yg=1;var y=pr(),_=Go()(),x=jo(),k=No(),E;if(_){var D=y("RegExp.prototype.exec"),u={},U=function(){throw u},M={toString:U,valueOf:U};typeof Symbol.toPrimitive=="symbol"&&(M[Symbol.toPrimitive]=U),E=function(J){if(!J||typeof J!="object")return!1;var Se=k(J,"lastIndex"),be=Se&&x(Se,"value");if(!be)return!1;try{D(J,M)}catch(De){return De===u}}}else{var Y=y("Object.prototype.toString"),X="[object RegExp]";E=function(J){return!J||typeof J!="object"&&typeof J!="function"?!1:Y(J)===X}}return ef=E,ef}var tf,vg;function ol(){if(vg)return tf;vg=1;var y=pr(),_=Mx(),x=y("RegExp.prototype.exec"),k=At();return tf=function(D){if(!_(D))throw new k("`regex` must be a RegExp");return function(U){return x(D,U)!==null}},tf}var gg;function Bx(){if(gg)return yc.exports;gg=1;var y=pr(),_=y("Object.prototype.toString"),x=yx()(),k=ol();if(x){var E=y("Symbol.prototype.toString"),D=k(/^Symbol\(.*\)$/),u=function(M){return typeof M.valueOf()!="symbol"?!1:D(E(M))};yc.exports=function(M){if(typeof M=="symbol")return!0;if(!M||typeof M!="object"||_(M)!=="[object Symbol]")return!1;try{return u(M)}catch{return!1}}}else yc.exports=function(M){return!1};return yc.exports}var rf,_g;function g1(){return _g||(_g=1,rf=function(_){return _===null||typeof _!="function"&&typeof _!="object"}),rf}var nf,xg;function zx(){return xg||(xg=1,nf=function(_){return typeof _=="string"||typeof _=="symbol"}),nf}var of,bg;function _1(){if(bg)return of;bg=1;var y=At(),_=sm(),x=zx();return of=function(E,D){if(!x(D))throw new y("Assertion failed: P is not a Property Key, got "+_(D));return E[D]},of}var af,wg;function x1(){if(wg)return af;wg=1;var y=At(),_=Qu(),x=sm(),k=_1(),E=zx();return af=function(u,U){if(!E(U))throw new y("Assertion failed: P is not a Property Key");var M=k(u,U);if(M!=null){if(!_(M))throw new y(x(U)+" is not a function: "+x(M));return M}},af}var sf,Sg;function b1(){if(Sg)return sf;Sg=1;var y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol",_=Qu(),x=kx(),k=Bx(),E=At(),D=g1();function u(M,Y){if(typeof M>"u"||M===null)throw new E("Cannot call method on "+M);if(typeof Y!="string"||Y!=="number"&&Y!=="string")throw new E('hint must be "string" or "number"');var X=Y==="string"?["toString","valueOf"]:["valueOf","toString"],ae,J,Se;for(Se=0;Se<X.length;++Se)if(ae=M[X[Se]],_(ae)&&(J=ae.call(M),D(J)))return J;throw new E("No default value")}var U=x1();return sf=function(Y){if(D(Y))return Y;var X="default";arguments.length>1&&(arguments[1]===String?X="string":arguments[1]===Number&&(X="number"));var ae;if(y&&(Symbol.toPrimitive?ae=U(Y,Symbol.toPrimitive):k(Y)&&(ae=Symbol.prototype.valueOf)),typeof ae<"u"){var J=ae.call(Y,X);if(D(J))return J;throw new E("unable to convert exotic object to primitive")}return X==="default"&&(x(Y)||k(Y))&&(X="string"),u(Y,X==="default"?"number":X)},sf}var uf,Ig;function Dx(){if(Ig)return uf;Ig=1;var y=b1();return uf=function(x){return arguments.length>1?y(x,arguments[1]):y(x)},uf}var lf,Tg;function Rx(){if(Tg)return lf;Tg=1;var y=Er(),_=y("%BigInt%",!0),x=y("%Number%"),k=At(),E=Nn(),D=v1(),u=Dx();return lf=function(M){if(!_)throw new E("BigInts are not supported in this environment");var Y=u(M,x);if(Y==null)throw new k("Cannot convert null or undefined to a BigInt");if(typeof Y=="boolean")return _(Y?1:0);if(typeof Y=="number")throw new k("Cannot convert a Number value to a BigInt");if(typeof Y=="string"){var X=D(Y);if(typeof X>"u")throw new k("Failed to parse String to BigInt");return X}if(typeof Y=="symbol")throw new k("Cannot convert a Symbol value to a BigInt");if(typeof Y!="bigint")throw new E("Assertion failed: unknown primitive type");return Y},lf}var cf,Ag;function Lx(){if(Ag)return cf;Ag=1;var y=Er(),_=y("%BigInt%",!0),x=Yd(),k=At(),E=_&&_(0);return cf=function(u,U){if(typeof u!="bigint"||typeof U!="bigint")throw new k("Assertion failed: `n` and `d` arguments must be BigInts");if(U===E)throw new x("Division by zero");return u===E?E:u%U},cf}var pf,Eg;function Fx(){return Eg||(Eg=1,pf=function(_,x,k){var E=_(x,k);return E>=0?E:E+k}),pf}var hf,Pg;function w1(){if(Pg)return hf;Pg=1;var y=Er(),_=y("%BigInt%",!0),x=Xa(),k=Rx(),E=Lx(),D=Fx(),u=_&&BigInt(x(2,32))*BigInt(x(2,31)),U=_&&BigInt(x(2,32))*BigInt(x(2,32));return hf=function(Y){var X=k(Y),ae=D(E,X,U);return ae>=u?ae-U:ae},hf}var ff,Cg;function S1(){if(Cg)return ff;Cg=1;var y=Er(),_=y("%BigInt%",!0),x=Xa(),k=Rx(),E=Lx(),D=Fx(),u=_&&BigInt(x(2,32))*BigInt(x(2,32));return ff=function(M){var Y=k(M),X=D(E,Y,u);return X},ff}var df,kg;function I1(){if(kg)return df;kg=1;var y=Ha();return df=function(x,k){var E=x%k;return y(E>=0?E:E+k)},df}var mf,Mg;function T1(){return Mg||(Mg=1,mf=I1()),mf}var yf,Bg;function tu(){if(Bg)return yf;Bg=1;var y=T1();return yf=function(x,k){return y(x,k)},yf}var vf,zg;function A1(){return zg||(zg=1,vf=function(_){return _===null||typeof _!="function"&&typeof _!="object"}),vf}var gf,Dg;function Ox(){if(Dg)return gf;Dg=1;var y=At();return gf=function(x){if(x==null)throw new y(arguments.length>0&&arguments[1]||"Cannot call method on "+x);return x},gf}var _f,Rg;function E1(){if(Rg)return _f;Rg=1;var y=Er(),_=y("%String%"),x=At();return _f=function(E){if(typeof E=="symbol")throw new x("Cannot convert a Symbol value to a string");return _(E)},_f}var xf,Lg;function Vx(){if(Lg)return xf;Lg=1;var y=Ox(),_=E1(),x=pr(),k=ol(),E=x("String.prototype.replace"),D=x("String.prototype.charAt"),u=x("String.prototype.slice"),U=/^\s$/.test(""),M=U?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,Y=k(U?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]$/);return xf=function(){for(var ae=E(_(y(this)),M,""),J=ae.length;J>0&&Y(D(ae,J-1));)J-=1;return u(ae,0,J)},xf}var bf,Fg;function qx(){if(Fg)return bf;Fg=1;var y=Vx(),_="",x="";return bf=function(){return String.prototype.trim&&_.trim()===_&&x.trim()===x&&("_"+x).trim()==="_"+x&&(x+"_").trim()===x+"_"?String.prototype.trim:y},bf}var wf,Og;function P1(){if(Og)return wf;Og=1;var y=rl()(),_=om(),x=qx();return wf=function(){var E=x();return String.prototype.trim!==E&&(y?_(String.prototype,"trim",E,!0):_(String.prototype,"trim",E)),E},wf}var Sf,Vg;function C1(){if(Vg)return Sf;Vg=1;var y=ha(),_=am(),x=Ox(),k=Vx(),E=qx(),D=P1(),u=y(E()),U=function(Y){return x(Y),u(Y)};return _(U,{getPolyfill:E,implementation:k,shim:D}),Sf=U,Sf}var If,qg;function k1(){if(qg)return If;qg=1;var y=Er(),_=y("%RegExp%"),x=At(),k=y("%parseInt%"),E=pr(),D=ol(),u=E("String.prototype.slice"),U=D(/^0b[01]+$/i),M=D(/^0o[0-7]+$/i),Y=D(/^[-+]0x[0-9a-f]+$/i),X=["
","",""].join(""),ae=new _("["+X+"]","g"),J=D(ae),Se=C1();return If=function be(De){if(typeof De!="string")throw new x("Assertion failed: `argument` is not a String");if(U(De))return+k(u(De,2),2);if(M(De))return+k(u(De,2),8);if(J(De)||Y(De))return NaN;var Ze=Se(De);return Ze!==De?be(Ze):+De},If}var Tf,Ug;function da(){if(Ug)return Tf;Ug=1;var y=Er(),_=At(),x=y("%Number%"),k=A1(),E=Dx(),D=k1();return Tf=function(U){var M=k(U)?U:E(U,x);if(typeof M=="symbol")throw new _("Cannot convert a Symbol value to a number");if(typeof M=="bigint")throw new _("Conversion from 'BigInt' to 'number' is not allowed.");return typeof M=="string"?D(M):+M},Tf}var Af,Ng;function lm(){if(Ng)return Af;Ng=1;var y=Ha();return Af=function(x){return typeof x=="bigint"?x:y(x)},Af}var Ef,jg;function Ya(){if(jg)return Ef;jg=1;var y=lm(),_=At();return Ef=function(k){if(typeof k!="number"&&typeof k!="bigint")throw new _("argument must be a Number or a BigInt");var E=k<0?-y(-k):y(k);return E===0?0:E},Ef}var Pf,Gg;function M1(){if(Gg)return Pf;Gg=1;var y=tu(),_=da(),x=Ya(),k=mo(),E=65536;return Pf=function(u){var U=_(u);if(!k(U)||U===0)return 0;var M=x(U),Y=y(M,E);return Y>=32768?Y-E:Y},Pf}var Cf,$g;function B1(){if($g)return Cf;$g=1;var y=tu(),_=da(),x=Ya(),k=mo(),E=2147483648,D=4294967296;return Cf=function(U){var M=_(U);if(!k(M)||M===0)return 0;var Y=x(M),X=y(Y,D),ae=X>=E?X-D:X;return ae===0?0:ae},Cf}var kf,Zg;function z1(){if(Zg)return kf;Zg=1;var y=tu(),_=da(),x=Ya(),k=mo();return kf=function(D){var u=_(D);if(!k(u)||u===0)return 0;var U=x(u),M=y(U,256);return M>=128?M-256:M},kf}var Mf,Wg;function D1(){if(Wg)return Mf;Wg=1;var y=tu(),_=da(),x=Ya(),k=mo(),E=65536;return Mf=function(u){var U=_(u);if(!k(U)||U===0)return 0;var M=x(U),Y=y(M,E);return Y===0?0:Y},Mf}var Bf,Hg;function R1(){if(Hg)return Bf;Hg=1;var y=tu(),_=da(),x=Ya(),k=mo(),E=4294967296;return Bf=function(u){var U=_(u);if(!k(U)||U===0)return 0;var M=x(U),Y=y(M,E);return Y===0?0:Y},Bf}var zf,Xg;function L1(){if(Xg)return zf;Xg=1;var y=mo(),_=tu(),x=da(),k=Ya();return zf=function(D){var u=x(D);if(!y(u)||u===0)return 0;var U=k(u),M=_(U,256);return M},zf}var Df,Kg;function F1(){if(Kg)return Df;Kg=1;var y=At(),_=Qd(),x=em();return Df=function(E,D,u){if(typeof E!="number"||typeof D!="number"||typeof u!="number"||!(D<=u))throw new y("Assertion failed: all three arguments must be MVs, and `lower` must be `<= upper`");return x(_(D,E),u)},Df}var Rf,Jg;function O1(){if(Jg)return Rf;Jg=1;var y=F1(),_=da(),x=lm(),k=Ka();return Rf=function(D){var u=_(D);if(k(u))return 0;var U=y(u,0,255),M=x(U);return U<M+.5?M:U>M+.5?M+1:M%2===0?M:M+1},Rf}var Lf,Yg;function Ux(){return Yg||(Yg=1,Lf=function(_){return _===0&&1/_===-1/0}),Lf}var Ff,Qg;function V1(){if(Qg)return Ff;Qg=1;var y=Ic(),_=Ha(),x=Xa(),k=mo(),E=Ka(),D=Ux(),u=34028234663852886e22;return Ff=function(M,Y){if(E(M))return Y?[0,0,192,127]:[127,192,0,0];var X;if(M===0)return X=D(M)?128:0,Y?[0,0,0,X]:[X,0,0,0];if(y(M)>u||!k(M))return X=M<0?255:127,Y?[0,0,128,X]:[X,128,0,0];var ae=M<0?1:0;M=y(M);for(var J=0;M>=2;)J+=1,M/=2;for(;M<1;)J-=1,M*=2;var Se=M-1;Se*=x(2,23)+.5,Se=_(Se),J+=127,J<<=23;var be=ae<<31|J|Se,De=be&255;be>>=8;var Ze=be&255;be>>=8;var He=be&255;be>>=8;var Ue=be&255;return Y?[De,Ze,He,Ue]:[Ue,He,Ze,De]},Ff}var Of,e_;function q1(){if(e_)return Of;e_=1;var y=1075,_=54;return Of=function(k){var E="";if(k===0)return E;for(var D=y,u,U=0;U<y;U+=1)if(u=k*2,u>=1?(k=u-1,E+="1",D===y&&(D=U)):(k=u,E+="0"),u===1||U-D>_)return E;return E},Of}var Vf,t_;function U1(){if(t_)return Vf;t_=1;var y=Ha();return Vf=function(x){for(var k="",E;x>0;)E=x/2,x=y(E),E===x?k="0"+k:k="1"+k;return k},Vf}var qf,r_;function N1(){return r_||(r_=1,qf=Number.isNaN||function(_){return _!==_}),qf}var Uf,i_;function j1(){if(i_)return Uf;i_=1;var y=Er(),_=y("%parseInt%"),x=Ic(),k=Ha(),E=mo(),D=Ux(),u=pr(),U=u("String.prototype.indexOf"),M=u("String.prototype.slice"),Y=q1(),X=U1(),ae=N1(),J=1023,Se="11111111111",be="00000000000",De=be+be+be+be+"0000000";return Uf=function(He,Ue){var fe=He<0||D(He)?"1":"0",Ke,Ne;if(ae(He))Ke=Se,Ne="1"+De;else if(!E(He))Ke=Se,Ne="0"+De;else if(He===0)Ke=be,Ne="0"+De;else{He=x(He);var It=k(He),we=X(It),je=Y(He-It),Le;if(we)Ke=we.length-1;else{var tt=U(je,"1");tt>-1&&(Le=tt+1),Ke=-Le}Ne=we+je,Ke<0?(Ke<=-J&&(Le=J-1),Ne=M(Ne,Le)):Ne=M(Ne,1),Ke=M(be+X(Ke+J),-11),Ne=M(Ne+De+"0",0,52)}for(var Mt=fe+Ke+Ne,Wt=[],St=0;St<8;St++){var Ut=Ue?8-St-1:St;Wt[Ut]=_(M(Mt,St*8,(St+1)*8),2)}return Wt},Uf}var Nf,n_;function G1(){if(n_)return Nf;n_=1;var y=Er(),_=y("%Number%"),x=y("%BigInt%",!0);return Nf=function(E,D,u){var U=typeof E=="bigint"?x:_;E<0&&(E>>>=0);for(var M=[],Y=0;Y<D;Y++)M[u?Y:D-1-Y]=_(E&U(255)),E>>=U(8);return M},Nf}var jf,o_;function $1(){if(o_)return jf;o_=1;var y=At(),_=Ix(),x=w1(),k=S1(),E=M1(),D=B1(),u=z1(),U=D1(),M=R1(),Y=L1(),X=O1(),ae=V1(),J=j1(),Se=G1(),be=Qs(),De={__proto__:null,$INT8:u,$UINT8:Y,$UINT8C:X,$INT16:E,$UINT16:U,$INT32:D,$UINT32:M,$BIGINT64:x,$BIGUINT64:k};return jf=function(He,Ue,fe){if(typeof He!="string"||!_(be.size,"$"+He))throw new y("Assertion failed: `type` must be a TypedArray element type");if(typeof Ue!="number"&&typeof Ue!="bigint")throw new y("Assertion failed: `value` must be a Number or a BigInt");if(typeof fe!="boolean")throw new y("Assertion failed: `isLittleEndian` must be a Boolean");if(He==="FLOAT32")return ae(Ue,fe);if(He==="FLOAT64")return J(Ue,fe);var Ke=be.size["$"+He],Ne=De["$"+He],It=Ne(Ue);return Se(It,Ke,fe)},jf}var Gf,a_;function Z1(){return a_||(a_=1,Gf=function(_,x){for(var k=0;k<_.length;k+=1)x(_[k],k,_)}),Gf}var $f,s_;function W1(){if(s_)return $f;s_=1;var y=Er(),_=Nn(),x=At(),k=Ac(),E=y("%Uint8Array%",!0),D=Ax(),u=Ys(),U=$1(),M=Js(),Y=il(),X=jo(),ae=Qs(),J=Px(),Se=Z1();return $f=function(De,Ze,He,Ue,fe,Ke){var Ne=Y(De);if(!M(De)&&!Ne)throw new x("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!k(Ze)||Ze<0)throw new x("Assertion failed: `byteIndex` must be a non-negative integer");if(typeof He!="string"||!X(ae.size,"$"+He))throw new x("Assertion failed: `type` must be one of "+ae.choices);if(typeof Ue!="number"&&typeof Ue!="bigint")throw new x("Assertion failed: `value` must be a Number or a BigInt");if(typeof fe!="boolean")throw new x("Assertion failed: `isTypedArray` must be a boolean");if(Ke!=="SEQ-CST"&&Ke!=="UNORDERED"&&Ke!=="INIT")throw new x('Assertion failed: `order` must be `"SEQ-CST"`, `"UNORDERED"`, or `"INIT"`');if(arguments.length>6&&typeof arguments[6]!="boolean")throw new x("Assertion failed: `isLittleEndian` must be a boolean, if present");if(u(De))throw new x("Assertion failed: ArrayBuffer is detached");if(D(He)?typeof Ue!="bigint":typeof Ue!="number")throw new x("Assertion failed: `value` must be a BigInt if type is ~BIGINT64~ or ~BIGUINT64~, otherwise a Number");var It=ae.size["$"+He],we=arguments.length>6?arguments[6]:J==="little",je=U(He,Ue,we);if(Ne)throw new _("SharedArrayBuffer is not supported by this implementation");var Le=new E(De,Ze,It);Se(je,function(tt,Mt){Le[Mt]=tt})},$f}var Zf,u_;function H1(){if(u_)return Zf;u_=1;var y=da(),_=Ya(),x=Ka(),k=mo();return Zf=function(D){var u=y(D);return x(u)||u===0?0:k(u)?_(u):u},Zf}var Wf,l_;function X1(){if(l_)return Wf;l_=1;var y=Er(),_=y("%String%"),x=At();return Wf=function(E){if(typeof E=="symbol")throw new x("Cannot convert a Symbol value to a string");return _(E)},Wf}var Hf,c_;function cm(){if(c_)return Hf;c_=1;var y=Nn(),_=At(),x=Ac(),k=Ks(),E=Qs();return Hf=function(u){var U=k(u);if(!U)throw new _("Assertion failed: `O` must be a TypedArray");var M=E.size["$"+E.name["$"+U]];if(!x(M)||M<0)throw new y("Assertion failed: Unknown TypedArray type `"+U+"`");return M},Hf}var Xf,p_;function K1(){if(p_)return Xf;p_=1;var y=Nn(),_=At(),x=Ks(),k=Qs();return Xf=function(D){var u=x(D);if(!u)throw new _("Assertion failed: `O` must be a TypedArray");var U=k.name["$"+u];if(typeof U!="string")throw new y("Assertion failed: Unknown TypedArray type `"+u+"`");return U},Xf}var vc={exports:{}},Kf,h_;function J1(){return h_||(h_=1,Kf=Er()),Kf}var Jf,f_;function pm(){if(f_)return Jf;f_=1;var y=At(),_=jo(),x={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};return Jf=function(E){if(!E||typeof E!="object")return!1;for(var D in E)if(_(E,D)&&!x[D])return!1;var u=_(E,"[[Value]]")||_(E,"[[Writable]]"),U=_(E,"[[Get]]")||_(E,"[[Set]]");if(u&&U)throw new y("Property Descriptors may not be both accessor and data descriptors");return!0},Jf}var Yf,d_;function Y1(){if(d_)return Yf;d_=1;var y=rl(),_=Xs(),x=y.hasArrayLengthDefineBug(),k=x&&Tx(),E=pr(),D=E("Object.prototype.propertyIsEnumerable");return Yf=function(U,M,Y,X,ae,J){if(!_){if(!U(J)||!J["[[Configurable]]"]||!J["[[Writable]]"]||ae in X&&D(X,ae)!==!!J["[[Enumerable]]"])return!1;var Se=J["[[Value]]"];return X[ae]=Se,M(X[ae],Se)}return x&&ae==="length"&&"[[Value]]"in J&&k(X)&&X.length!==J["[[Value]]"]?(X.length=J["[[Value]]"],X.length===J["[[Value]]"]):(_(X,ae,Y(J)),!0)},Yf}var Qf,m_;function Q1(){return m_||(m_=1,Qf=function(_){if(typeof _>"u")return _;var x={};return"[[Value]]"in _&&(x.value=_["[[Value]]"]),"[[Writable]]"in _&&(x.writable=!!_["[[Writable]]"]),"[[Get]]"in _&&(x.get=_["[[Get]]"]),"[[Set]]"in _&&(x.set=_["[[Set]]"]),"[[Enumerable]]"in _&&(x.enumerable=!!_["[[Enumerable]]"]),"[[Configurable]]"in _&&(x.configurable=!!_["[[Configurable]]"]),x}),Qf}var ed,y_;function ew(){if(y_)return ed;y_=1;var y=At(),_=pm(),x=Q1();return ed=function(E){if(typeof E<"u"&&!_(E))throw new y("Assertion failed: `Desc` must be a Property Descriptor");return x(E)},ed}var td,v_;function tw(){if(v_)return td;v_=1;var y=At(),_=jo(),x=pm();return td=function(E){if(typeof E>"u")return!1;if(!x(E))throw new y("Assertion failed: `Desc` must be a Property Descriptor");return!(!_(E,"[[Value]]")&&!_(E,"[[Writable]]"))},td}var rd,g_;function Nx(){return g_||(g_=1,rd=Qu()),rd}var id,__;function rw(){return __||(__=1,id=function(_){return!!_}),id}var nd,x_;function iw(){if(x_)return nd;x_=1;var y=jo(),_=At(),x=fa(),k=Nx(),E=rw();return nd=function(u){if(!x(u))throw new _("ToPropertyDescriptor requires an object");var U={};if(y(u,"enumerable")&&(U["[[Enumerable]]"]=E(u.enumerable)),y(u,"configurable")&&(U["[[Configurable]]"]=E(u.configurable)),y(u,"value")&&(U["[[Value]]"]=u.value),y(u,"writable")&&(U["[[Writable]]"]=E(u.writable)),y(u,"get")){var M=u.get;if(typeof M<"u"&&!k(M))throw new _("getter must be a function");U["[[Get]]"]=M}if(y(u,"set")){var Y=u.set;if(typeof Y<"u"&&!k(Y))throw new _("setter must be a function");U["[[Set]]"]=Y}if((y(U,"[[Get]]")||y(U,"[[Set]]"))&&(y(U,"[[Value]]")||y(U,"[[Writable]]")))throw new _("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return U},nd}var od,b_;function nw(){if(b_)return od;b_=1;var y=At(),_=fa(),x=pm(),k=Y1(),E=ew(),D=tw(),u=Tc(),U=Cx(),M=iw();return od=function(X,ae,J){if(!_(X))throw new y("Assertion failed: Type(O) is not Object");if(!u(ae))throw new y("Assertion failed: P is not a Property Key");var Se=x(J)?J:M(J);if(!x(Se))throw new y("Assertion failed: Desc is not a valid Property Descriptor");return k(D,U,E,X,ae,Se)},od}var w_;function jx(){if(w_)return vc.exports;w_=1;var y=J1(),_=y("%Reflect.construct%",!0),x=nw();try{x({},"",{"[[Get]]":function(){}})}catch{x=null}if(x&&_){var k={},E={};x(E,"length",{"[[Get]]":function(){throw k},"[[Enumerable]]":!0}),vc.exports=function(u){try{_(u,E)}catch(U){return U===k}}}else vc.exports=function(u){return typeof u=="function"&&!!u.prototype};return vc.exports}var ad,S_;function ow(){if(S_)return ad;S_=1;var y=Er(),_=y("%Symbol.species%",!0),x=At(),k=fa(),E=jx();return ad=function(u,U){if(!k(u))throw new x("Assertion failed: Type(O) is not Object");var M=u.constructor;if(typeof M>"u")return U;if(!k(M))throw new x("O.constructor is not an Object");var Y=_?M[_]:void 0;if(Y==null)return U;if(E(Y))return Y;throw new x("no constructor found")},ad}var sd,I_;function Gx(){if(I_)return sd;I_=1;var y=At(),_=pr(),x=_("%ArrayBuffer.prototype.resizable%",!0),k=_("%SharedArrayBuffer.prototype.growable%",!0),E=Js(),D=il();return sd=function(U){var M=E(U),Y=D(U);if(!M&&!Y)throw new y("Assertion failed: `arrayBuffer` must be an ArrayBuffer or SharedArrayBuffer");return M&&x?!x(U):Y&&k?!k(U):!0},sd}var ud,T_;function aw(){return T_||(T_=1,ud=Ac()),ud}var ld,A_;function $x(){if(A_)return ld;A_=1;var y=jo(),_=eu(),x=aw();return ld=function(E){return!!E&&typeof E=="object"&&y(E,"[[Object]]")&&y(E,"[[CachedBufferByteLength]]")&&(x(E["[[CachedBufferByteLength]]"])&&E["[[CachedBufferByteLength]]"]>=0||E["[[CachedBufferByteLength]]"]==="DETACHED")&&_(E["[[Object]]"])},ld}var cd,E_;function sw(){return E_||(E_=1,cd=fa()),cd}var pd,P_;function uw(){if(P_)return pd;P_=1;var y=pr(),_=y("String.prototype.valueOf"),x=function(U){try{return _(U),!0}catch{return!1}},k=y("Object.prototype.toString"),E="[object String]",D=Go()();return pd=function(U){return typeof U=="string"?!0:!U||typeof U!="object"?!1:D?x(U):k(U)===E},pd}var hd,C_;function lw(){if(C_)return hd;C_=1;var y=pr(),_=y("Number.prototype.toString"),x=function(U){try{return _(U),!0}catch{return!1}},k=y("Object.prototype.toString"),E="[object Number]",D=Go()();return hd=function(U){return typeof U=="number"?!0:!U||typeof U!="object"?!1:D?x(U):k(U)===E},hd}var fd,k_;function cw(){if(k_)return fd;k_=1;var y=pr(),_=y("Boolean.prototype.toString"),x=y("Object.prototype.toString"),k=function(U){try{return _(U),!0}catch{return!1}},E="[object Boolean]",D=Go()();return fd=function(U){return typeof U=="boolean"?!0:U===null||typeof U!="object"?!1:D?k(U):x(U)===E},fd}var gc={exports:{}},dd,M_;function pw(){if(M_)return dd;M_=1;var y=typeof BigInt<"u"&&BigInt;return dd=function(){return typeof y=="function"&&typeof BigInt=="function"&&typeof y(42)=="bigint"&&typeof BigInt(42)=="bigint"},dd}var B_;function hw(){if(B_)return gc.exports;B_=1;var y=pw()();if(y){var _=BigInt.prototype.valueOf,x=function(E){try{return _.call(E),!0}catch{}return!1};gc.exports=function(E){return E===null||typeof E>"u"||typeof E=="boolean"||typeof E=="string"||typeof E=="number"||typeof E=="symbol"||typeof E=="function"?!1:typeof E=="bigint"?!0:x(E)}}else gc.exports=function(E){return!1};return gc.exports}var md,z_;function fw(){if(z_)return md;z_=1;var y=uw(),_=lw(),x=cw(),k=Bx(),E=hw();return md=function(u){if(u==null||typeof u!="object"&&typeof u!="function")return null;if(y(u))return"String";if(_(u))return"Number";if(x(u))return"Boolean";if(k(u))return"Symbol";if(E(u))return"BigInt"},md}var yd,D_;function dw(){if(D_)return yd;D_=1;var y=typeof Map=="function"&&Map.prototype?Map:null,_=typeof Set=="function"&&Set.prototype?Set:null,x;y||(x=function(u){return!1});var k=y?Map.prototype.has:null,E=_?Set.prototype.has:null;return!x&&!k&&(x=function(u){return!1}),yd=x||function(u){if(!u||typeof u!="object")return!1;try{if(k.call(u),E)try{E.call(u)}catch{return!0}return u instanceof y}catch{}return!1},yd}var vd,R_;function mw(){if(R_)return vd;R_=1;var y=typeof Map=="function"&&Map.prototype?Map:null,_=typeof Set=="function"&&Set.prototype?Set:null,x;_||(x=function(u){return!1});var k=y?Map.prototype.has:null,E=_?Set.prototype.has:null;return!x&&!E&&(x=function(u){return!1}),vd=x||function(u){if(!u||typeof u!="object")return!1;try{if(E.call(u),k)try{k.call(u)}catch{return!0}return u instanceof _}catch{}return!1},vd}var gd,L_;function yw(){if(L_)return gd;L_=1;var y=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,_=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,x;y||(x=function(u){return!1});var k=y?y.prototype.has:null,E=_?_.prototype.has:null;return!x&&!k&&(x=function(u){return!1}),gd=x||function(u){if(!u||typeof u!="object")return!1;try{if(k.call(u,k),E)try{E.call(u,E)}catch{return!0}return u instanceof y}catch{}return!1},gd}var _c={exports:{}},F_;function vw(){if(F_)return _c.exports;F_=1;var y=Er(),_=pr(),x=y("%WeakSet%",!0),k=_("WeakSet.prototype.has",!0);if(k){var E=_("WeakMap.prototype.has",!0);_c.exports=function(u){if(!u||typeof u!="object")return!1;try{if(k(u,k),E)try{E(u,E)}catch{return!0}return u instanceof x}catch{}return!1}}else _c.exports=function(u){return!1};return _c.exports}var _d,O_;function gw(){if(O_)return _d;O_=1;var y=dw(),_=mw(),x=yw(),k=vw();return _d=function(D){if(D&&typeof D=="object"){if(y(D))return"Map";if(_(D))return"Set";if(x(D))return"WeakMap";if(k(D))return"WeakSet"}return!1},_d}var xd,V_;function _w(){if(V_)return xd;V_=1;var y=pr(),_=y("WeakRef.prototype.deref",!0);return xd=typeof WeakRef>"u"?function(k){return!1}:function(k){if(!k||typeof k!="object")return!1;try{return _(k),!0}catch{return!1}},xd}var bd,q_;function xw(){if(q_)return bd;q_=1;var y=pr(),_=y("FinalizationRegistry.prototype.register",!0);return bd=_?function(k){if(!k||typeof k!="object")return!1;try{return _(k,{},null),!0}catch{return!1}}:function(k){return!1},bd}var Ws={exports:{}},wd,U_;function Zx(){if(U_)return wd;U_=1;var y=function(){return typeof(function(){}).name=="string"},_=Object.getOwnPropertyDescriptor;if(_)try{_([],"length")}catch{_=null}y.functionsHaveConfigurableNames=function(){if(!y()||!_)return!1;var E=_(function(){},"name");return!!E&&!!E.configurable};var x=Function.prototype.bind;return y.boundFunctionsHaveNames=function(){return y()&&typeof x=="function"&&(function(){}).bind().name!==""},wd=y,wd}var Sd,N_;function bw(){if(N_)return Sd;N_=1;var y=pr(),_=y("Object.prototype.toString"),x=!(0 in[,]),k="[object Object]",E="[object HTMLAllCollection]",D=function(){return!1};if(typeof document=="object"){var u=document.all;_(u)===_(document.all)&&(D=(function(M){if((x||!M)&&(typeof M>"u"||typeof M=="object"))try{var Y=_(M);return(Y===E||Y===k)&&M("")==null}catch{}return!1}))}return Sd=D,Sd}var Id,j_;function Wx(){if(j_)return Id;j_=1;var y=Qu(),_=jo(),x=Zx()(),k=At(),E=pr(),D=bw(),u=E("Function.prototype.toString"),U=E("String.prototype.match"),M=/^class /,Y=function(Se){if(y(Se)||typeof Se!="function")return!1;try{var be=U(u(Se),M);return!!be}catch{}return!1},X=/\s*function\s+([^(\s]*)\s*/,ae=Function.prototype;return Id=function(){if(D(this)||!Y(this)&&!y(this))throw new k("Function.prototype.name sham getter called on non-function");if(x&&_(this,"name"))return this.name;if(this===ae)return"";var Se=u(this),be=U(Se,X),De=be&&be[1];return De},Id}var Td,G_;function Hx(){if(G_)return Td;G_=1;var y=Wx();return Td=function(){return y},Td}var Ad,$_;function ww(){if($_)return Ad;$_=1;var y=rl()(),_=Zx()(),x=At(),k=Hx(),E=Xs();return Ad=function(){var u=k();if(_)return u;if(!y||!E)throw new x("Shimming Function.prototype.name support requires ES5 property descriptor support.");var U=Function.prototype;return E(U,"name",{configurable:!0,enumerable:!1,get:function(){var M=u.call(this);return this!==U&&E(this,"name",{configurable:!0,enumerable:!1,value:M,writable:!1}),M}}),u},Ad}var Z_;function Sw(){if(Z_)return Ws.exports;Z_=1;var y=ha(),_=Wx(),x=Hx(),k=ww(),E=y(_);return Ws.exports=E,Ws.exports.getPolyfill=x,Ws.exports.implementation=_,Ws.exports.shim=k,Ws.exports}var Ed,W_;function Iw(){if(W_)return Ed;W_=1;var y=pr(),_=ol(),x=_(/^\s*(?:function)?\*/),k=Go()(),E=Ja(),D=y("Object.prototype.toString"),u=y("Function.prototype.toString"),U=bx();return Ed=function(Y){if(typeof Y!="function")return!1;if(x(u(Y)))return!0;if(!k){var X=D(Y);return X==="[object GeneratorFunction]"}if(!E)return!1;var ae=U();return ae&&E(Y)===ae.prototype},Ed}var Pd,H_;function Tw(){if(H_)return Pd;H_=1;var y=pr(),_=ol(),x=y("Object.prototype.toString"),k=y("Function.prototype.toString"),E=_(/^\s*async(?:\s+function(?:\s+|\()|\s*\()/),D=Go()(),u=Ja(),U=xx();return Pd=function(Y){if(typeof Y!="function")return!1;if(E(k(Y)))return!0;if(!D){var X=x(Y);return X==="[object AsyncFunction]"}if(!u)return!1;var ae=U();return ae&&ae.prototype===u(Y)},Pd}var Cd,X_;function Aw(){if(X_)return Cd;X_=1;var y=fw(),_=gw(),x=Ks(),k=Ex(),E=kx(),D=Mx(),u=_w(),U=xw(),M=Sw(),Y=Iw(),X=Tw(),ae=pr(),J=Go()(),Se=J&&Symbol.toStringTag,be=Object,De=ae("Promise.prototype.then",!0),Ze=function(fe){if(!fe||typeof fe!="object"||!De)return!1;try{return De(fe,null,function(){}),!0}catch{}return!1},He=function(fe){return!!fe&&fe!=="BigInt"&&fe!=="Boolean"&&fe!=="Null"&&fe!=="Number"&&fe!=="String"&&fe!=="Symbol"&&fe!=="Undefined"&&fe!=="Math"&&fe!=="JSON"&&fe!=="Reflect"&&fe!=="Atomics"&&fe!=="Map"&&fe!=="Set"&&fe!=="WeakMap"&&fe!=="WeakSet"&&fe!=="BigInt64Array"&&fe!=="BigUint64Array"&&fe!=="Float32Array"&&fe!=="Float64Array"&&fe!=="Int16Array"&&fe!=="Int32Array"&&fe!=="Int8Array"&&fe!=="Uint16Array"&&fe!=="Uint32Array"&&fe!=="Uint8Array"&&fe!=="Uint8ClampedArray"&&fe!=="Array"&&fe!=="Date"&&fe!=="FinalizationRegistry"&&fe!=="Promise"&&fe!=="RegExp"&&fe!=="WeakRef"&&fe!=="Function"&&fe!=="GeneratorFunction"&&fe!=="AsyncFunction"};return Cd=function(fe){if(fe==null)return fe;var Ke=y(be(fe))||_(fe)||x(fe);if(Ke)return Ke;if(k(fe))return"Array";if(E(fe))return"Date";if(D(fe))return"RegExp";if(u(fe))return"WeakRef";if(U(fe))return"FinalizationRegistry";if(typeof fe=="function")return Y(fe)?"GeneratorFunction":X(fe)?"AsyncFunction":"Function";if(Ze(fe))return"Promise";if(Se&&Se in fe){var Ne=fe[Se];if(He(Ne))return Ne}if(typeof fe.constructor=="function"){var It=M(fe.constructor);if(He(It))return It}return"Object"},Cd}var kd,K_;function Ew(){if(K_)return kd;K_=1;var y=Er(),_=Nx(),x=sw(),k=Aw(),E=At(),D=Ja(),u=Jd();return kd=function(M){if(!x(M))throw new E("Reflect.getPrototypeOf called on non-object");if(D)return D(M);var Y=k(M);if(Y){var X=y("%"+Y+".prototype%",!0);if(X)return X}return _(M.constructor)?M.constructor.prototype:M instanceof Object?u.prototype:null},kd}var Md,J_;function Xx(){if(J_)return Md;J_=1;var y=Ew(),_=Ja();return Md=function(){return typeof Reflect=="object"&&Reflect&&Reflect.getPrototypeOf?Reflect.getPrototypeOf:_?function(E){return _(E)}:y},Md}var Bd,Y_;function hm(){if(Y_)return Bd;Y_=1;var y=Kd(),_=ha(),x=Xx()(),k=el()(),E={__proto__:null},D=No(),u=Object.defineProperty;if(D){var U=function(X){return X.byteOffset};y(k,function(X){if(typeof wt.commonjsGlobal[X]=="function"||typeof wt.commonjsGlobal[X]=="object"){var ae=wt.commonjsGlobal[X].prototype,J=D(ae,"byteOffset");if(!J){var Se=x(ae);J=D(Se,"byteOffset")}if(J&&J.get)E[X]=_(J.get);else if(u){var be=new wt.commonjsGlobal[X](2);J=D(be,"byteOffset"),J&&J.configurable&&u(be,"length",{value:3}),be.length===2&&(E[X]=U)}}})}var M=function(ae){var J;return y(E,function(Se){if(typeof J!="number")try{var be=Se(ae);typeof be=="number"&&(J=be)}catch{}}),J},Y=eu();return Bd=function(ae){return Y(ae)?M(ae):!1},Bd}var zd,Q_;function Kx(){if(Q_)return zd;Q_=1;var y=ha(),_=Kd(),x=No(),k=eu(),E=mx(),D=Xx()(),u={__proto__:null},U=Object.defineProperty;if(x){var M=function(X){return X.length};_(E,function(X){var ae=wt.commonjsGlobal[X];if(typeof ae=="function"||typeof ae=="object"){var J=ae.prototype,Se=x(J,"length");if(!Se){var be=D(J);Se=x(be,"length")}if(Se&&Se.get)u["$"+X]=y(Se.get);else if(U){var De=new wt.commonjsGlobal[X](2);Se=x(De,"length"),Se&&Se.configurable&&U(De,"length",{value:3}),De.length===2&&(u["$"+X]=M)}}})}var Y=function(ae){var J;return _(u,function(Se){if(typeof J!="number")try{var be=Se(ae);typeof be=="number"&&(J=be)}catch{}}),J};return zd=function(ae){return k(ae)?Y(ae):!1},zd}var Dd,ex;function fm(){if(ex)return Dd;ex=1;var y=At(),_=Ys(),x=Gx(),k=cm(),E=$x(),D=nl(),u=hm(),U=Kx();return Dd=function(Y){if(!E(Y))throw new y("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");var X=Y["[[Object]]"],ae=Y["[[CachedBufferByteLength]]"];if(_(D(X))&&ae!=="DETACHED")throw new y("Assertion failed: typed array is detached only if the byte length is ~DETACHED~");if(ae==="DETACHED")return!0;var J=u(X),Se=x(D(X)),be,De=Se?U(X):"AUTO";if(De==="AUTO")be=ae;else{var Ze=k(X);be=J+De*Ze}return J>ae||be>ae},Dd}var Rd,tx;function Pw(){if(tx)return Rd;tx=1;var y=At(),_=lm(),x=Gx(),k=fm(),E=cm(),D=$x(),u=nl(),U=hm(),M=Kx();return Rd=function(X){if(!D(X))throw new y("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");if(k(X))throw new y("Assertion failed: `taRecord` is out of bounds");var ae=X["[[Object]]"],J=x(u(ae)),Se=J?M(ae):"AUTO";if(Se!=="AUTO")return Se;if(J)throw new y("Assertion failed: array buffer is not fixed length");var be=U(ae),De=E(ae),Ze=X["[[CachedBufferByteLength]]"];if(Ze==="DETACHED")throw new y("Assertion failed: typed array is detached");return _((Ze-be)/De)},Rd}var Ld,rx;function Cw(){if(rx)return Ld;rx=1;var y=At(),_=Ys(),x=Js(),k=il(),E=Sx(),D=pr(),u=D("SharedArrayBuffer.prototype.byteLength",!0);return Ld=function(M,Y){var X=k(M);if(!x(M)&&!X)throw new y("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(Y!=="SEQ-CST"&&Y!=="UNORDERED")throw new y("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(_(M))throw new y("Assertion failed: `arrayBuffer` must not be detached");return X?u(M):E(M)},Ld}var Fd,ix;function kw(){if(ix)return Fd;ix=1;var y=At(),_=Cw(),x=Ys(),k=eu(),E=nl();return Fd=function(u,U){if(!k(u))throw new y("Assertion failed: `obj` must be a Typed Array");if(U!=="SEQ-CST"&&U!=="UNORDERED")throw new y("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");var M=E(u),Y=x(M)?"DETACHED":_(M,U);return{"[[Object]]":u,"[[CachedBufferByteLength]]":Y}},Fd}var Od,nx;function Jx(){if(nx)return Od;nx=1;var y=At(),_=fa(),x=fm(),k=kw(),E=eu();return Od=function(u,U){if(U!=="SEQ-CST"&&U!=="UNORDERED")throw new y("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(!_(u))throw new y("Assertion failed: `O` must be an Object");if(!E(u))throw new y("Assertion failed: `O` must be a Typed Array");var M=k(u,U);if(x(M))throw new y("`O` must be in-bounds and backed by a non-detached buffer");return M},Od}var Vd,ox;function Mw(){if(ox)return Vd;ox=1;var y=Nn(),_=At(),x=um(),k=jx(),E=fm(),D=Pw(),u=Jx(),U=el()();return Vd=function(Y,X){if(!k(Y))throw new _("Assertion failed: `constructor` must be a constructor");if(!x(X))throw new _("Assertion failed: `argumentList` must be a List");if(U.length===0)throw new y("Assertion failed: Typed Arrays are not supported in this environment");var ae;X.length===0?ae=new Y:X.length===1?ae=new Y(X[0]):X.length===2?ae=new Y(X[0],X[1]):ae=new Y(X[0],X[1],X[2]);var J=u(ae,"SEQ-CST");if(X.length===1&&typeof X[0]=="number"){if(E(J))throw new _("new Typed Array is out of bounds");var Se=D(J);if(Se<X[0])throw new _("`argumentList[0]` must be <= `newTypedArray.length`")}return ae},Vd}var qd,ax;function Bw(){if(ax)return qd;ax=1;var y=Er(),_={__proto__:null,$Int8Array:y("%Int8Array%",!0),$Uint8Array:y("%Uint8Array%",!0),$Uint8ClampedArray:y("%Uint8ClampedArray%",!0),$Int16Array:y("%Int16Array%",!0),$Uint16Array:y("%Uint16Array%",!0),$Int32Array:y("%Int32Array%",!0),$Uint32Array:y("%Uint32Array%",!0),$BigInt64Array:y("%BigInt64Array%",!0),$BigUint64Array:y("%BigUint64Array%",!0),$Float16Array:y("%Float16Array%",!0),$Float32Array:y("%Float32Array%",!0),$Float64Array:y("%Float64Array%",!0)};return qd=function(k){return _["$"+k]},qd}var Ud,sx;function zw(){if(sx)return Ud;sx=1;var y=Nn(),_=At(),x=Ks(),k=el()(),E=um(),D=ow(),u=Mw(),U=Bw();return Ud=function(Y,X){if(k.length===0)throw new y("Assertion failed: Typed Arrays are not supported in this environment");var ae=x(Y);if(!ae)throw new _("Assertion failed: exemplar must be a TypedArray");if(!E(X))throw new _("Assertion failed: `argumentList` must be a List");var J=U(ae);if(typeof J!="function")throw new y("Assertion failed: `constructor` of `exemplar` ("+ae+") must exist. Please report this!");var Se=D(Y,J);return u(Se,X)},Ud}var Nd,ux;function Yx(){if(ux)return Nd;ux=1;var y=At(),_=a1(),x=m1(),k=Ys(),E=Qd(),D=em(),u=y1(),U=W1(),M=H1(),Y=X1(),X=cm(),ae=K1(),J=zw(),Se=Jx(),be=nl(),De=hm();return Nd=function(He,Ue){var fe=this;Se(fe,"SEQ-CST");var Ke=fe.length,Ne=M(He),It;Ne===-1/0?It=0:Ne<0?It=E(Ke+Ne,0):It=D(Ne,Ke);var we=typeof Ue>"u"?Ke:M(Ue),je;we===-1/0?je=0:we<0?je=E(Ke+we,0):je=D(we,Ke);var Le=E(je-It,0),tt=J(fe,[Le]);if(Le>0){if(k(be(fe)))throw new y("Cannot use a Typed Array with an underlying ArrayBuffer that is detached");var Mt=ae(fe),Wt=ae(tt);if(Mt===Wt)for(var St=be(fe),Ut=be(tt),Hr=X(fe),Pr=De(fe),bi=It*Hr+Pr,or=De(tt),Rr=or+Le*Hr;or<Rr;){var et=x(St,bi,"UINT8",!0,"UNORDERED");U(Ut,or,"UINT8",et,!0,"UNORDERED"),bi+=1,or+=1}else for(var Lr=0;It<je;){var Xr=Y(It),Et=_(fe,Xr);u(tt,Y(Lr),Et,!0),It+=1,Lr+=1}}return tt},Nd}var jd,lx;function Qx(){if(lx)return jd;lx=1;var y=Yx();return jd=function(){return typeof Uint8Array=="function"&&Uint8Array.prototype.slice||y},jd}var Gd,cx;function Dw(){if(cx)return Gd;cx=1;var y=am(),_=Ja(),x=Qx();return Gd=function(){if(typeof Uint8Array=="function"){var E=x(),D=_(Uint8Array.prototype);y(D,{slice:E},{slice:function(){return D.slice!==E}})}return E},Gd}var $d,px;function Rw(){if(px)return $d;px=1;var y=am(),_=ha(),x=Yx(),k=Qx(),E=Dw(),D=_(k());return y(D,{getPolyfill:k,implementation:x,shim:E}),$d=D,$d}var Zd,hx;function Lw(){if(hx)return Zd;hx=1;var y=Ks(),_=Rw(),x=No();function k(we){return Object.prototype.toString.call(we)}function E(we){return k(we)==="[object Date]"}function D(we){return k(we)==="[object RegExp]"}function u(we){return k(we)==="[object Error]"}function U(we){return k(we)==="[object Boolean]"}function M(we){return k(we)==="[object Number]"}function Y(we){return k(we)==="[object String]"}var X=Array.isArray||function(je){return Object.prototype.toString.call(je)==="[object Array]"};function ae(we,je){if(we.forEach)return we.forEach(je);for(var Le=0;Le<we.length;Le++)je(we[Le],Le,we)}var J=Object.keys||function(je){var Le=[];for(var tt in je)Le[Le.length]=tt;return Le},Se=Object.prototype.propertyIsEnumerable,be=Object.getOwnPropertySymbols;function De(we){var je=J(we);if(be)for(var Le=be(we),tt=0;tt<Le.length;tt++)Se.call(we,Le[tt])&&(je[je.length]=Le[tt]);return je}var Ze=Object.prototype.hasOwnProperty||function(we,je){return je in we};function He(we,je){if(typeof x!="function")return!0;var Le=x(we,je);return!Le||!Le.writable}function Ue(we,je){if(typeof we=="object"&&we!==null){var Le;if(X(we))Le=[];else if(E(we))Le=new Date(we.getTime?we.getTime():we);else if(D(we))Le=new RegExp(we);else if(u(we))Le={message:we.message};else if(U(we)||M(we)||Y(we))Le=Object(we);else{var tt=y(we);if(tt)return _(we);if(Object.create&&Object.getPrototypeOf)Le=Object.create(Object.getPrototypeOf(we));else if(we.constructor===Object)Le={};else{var Mt=we.constructor&&we.constructor.prototype||we.__proto__||{},Wt=function(){};Wt.prototype=Mt,Le=new Wt}}var St=je.includeSymbols?De:J;return ae(St(we),function(Ut){Le[Ut]=we[Ut]}),Le}return we}var fe={__proto__:null};function Ke(we,je){var Le=[],tt=[],Mt=!0,Wt=arguments.length>2?arguments[2]:fe,St=Wt.includeSymbols?De:J,Ut=!!Wt.immutable;return(function Hr(Pr){var bi=Ut?Ue(Pr,Wt):Pr,or={__proto__:null},Rr=!0,et={node:bi,node_:Pr,path:[].concat(Le),parent:tt[tt.length-1],parents:tt,key:Le[Le.length-1],removedKeys:{__proto__:null},isRoot:Le.length===0,level:Le.length,circular:null,update:function(Et,Fr){et.isRoot||(et.parent.node[et.key]=Et),et.node=Et,Fr&&(Rr=!1)},delete:function(Et){delete et.parent.node[et.key],et.parent.removedKeys[et.key]=!0,Et&&(Rr=!1)},remove:function(Et){X(et.parent.node)?(et.parent.node.splice(et.key,1),et.parent.removedKeys[et.key]=!0,Et&&(Rr=!1)):et.delete(Et)},keys:null,before:function(Et){or.before=Et},after:function(Et){or.after=Et},pre:function(Et){or.pre=Et},post:function(Et){or.post=Et},stop:function(){Mt=!1},block:function(){Rr=!1}};if(!Mt)return et;function Lr(){if(typeof et.node=="object"&&et.node!==null){(!et.keys||et.node_!==et.node)&&(et.keys=St(et.node)),et.isLeaf=et.keys.length===0;for(var Et=0;Et<tt.length;Et++)if(tt[Et].node_===Pr){et.circular=tt[Et];break}}else et.isLeaf=!0,et.keys=null;et.notLeaf=!et.isLeaf,et.notRoot=!et.isRoot}Lr();var Xr=je.call(et,et.node);return Xr!==void 0&&et.update&&et.update(Xr),or.before&&or.before.call(et,et.node),Rr&&(typeof et.node=="object"&&et.node!==null&&!et.circular&&(tt[tt.length]=et,Lr(),ae(et.keys,function(Et,Fr){var Mi=Fr-1 in et.removedKeys;Mi&&(Et=et.keys[Fr-1]),Le[Le.length]=Et,or.pre&&or.pre.call(et,et.node[Et],Et);var pi=Hr(et.node[Et]);Ut&&Ze.call(et.node,Et)&&!He(et.node,Et)&&!Mi&&(et.node[Et]=pi.node),pi.isLast=Fr===et.keys.length-1,pi.isFirst=Fr===0,or.post&&or.post.call(et,pi),Le.pop()}),tt.pop()),or.after&&or.after.call(et,et.node)),et})(we).node}function Ne(we){this.options=arguments.length>1?arguments[1]:fe,this.value=we}Ne.prototype.get=function(we){for(var je=this.value,Le=0;je&&Le<we.length;Le++){var tt=we[Le];if(!Ze.call(je,tt)||!this.options.includeSymbols&&typeof tt=="symbol")return;je=je[tt]}return je},Ne.prototype.has=function(we){var je=this.value;if(!je&&we.length>0)return!1;for(var Le=0;je&&Le<we.length;Le++){var tt=we[Le];if(!Ze.call(je,tt)||!this.options.includeSymbols&&typeof tt=="symbol")return!1;je=je[tt]}return!0},Ne.prototype.set=function(we,je){for(var Le=this.value,tt=0;tt<we.length-1;tt++){var Mt=we[tt];Ze.call(Le,Mt)||(Le[Mt]={}),Le=Le[Mt]}return Le[we[tt]]=je,je},Ne.prototype.map=function(we){return Ke(this.value,we,{__proto__:null,immutable:!0,includeSymbols:!!this.options.includeSymbols})},Ne.prototype.forEach=function(we){return this.value=Ke(this.value,we,this.options),this.value},Ne.prototype.reduce=function(we,je){var Le=arguments.length===1,tt=Le?this.value:je;return this.forEach(function(Mt){(!this.isRoot||!Le)&&(tt=we.call(this,tt,Mt))}),tt},Ne.prototype.paths=function(){var we=[];return this.forEach(function(){we[we.length]=this.path}),we},Ne.prototype.nodes=function(){var we=[];return this.forEach(function(){we[we.length]=this.node}),we},Ne.prototype.clone=function(){var we=[],je=[],Le=this.options;return y(this.value)?_(this.value):(function tt(Mt){for(var Wt=0;Wt<we.length;Wt++)if(we[Wt]===Mt)return je[Wt];if(typeof Mt=="object"&&Mt!==null){var St=Ue(Mt,Le);we[we.length]=Mt,je[je.length]=St;var Ut=Le.includeSymbols?De:J;return ae(Ut(Mt),function(Hr){St[Hr]=tt(Mt[Hr])}),we.pop(),je.pop(),St}return Mt})(this.value)};function It(we){var je=arguments.length>1?arguments[1]:fe;return new Ne(we,je)}return ae(De(Ne.prototype),function(we){It[we]=function(je){var Le=[].slice.call(arguments,1),tt=new Ne(je);return tt[we].apply(tt,Le)}}),Zd=It,Zd}var Wd,fx;function Fw(){if(fx)return Wd;fx=1,Wd=y;function y(_){if(!(this instanceof y))return new y(_);this._bbox=_||[1/0,1/0,-1/0,-1/0],this._valid=!!_}return y.prototype.include=function(_){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],_[0]),this._bbox[1]=Math.min(this._bbox[1],_[1]),this._bbox[2]=Math.max(this._bbox[2],_[0]),this._bbox[3]=Math.max(this._bbox[3],_[1]),this},y.prototype.equals=function(_){var x;return _ instanceof y?x=_.bbox():x=_,this._bbox[0]==x[0]&&this._bbox[1]==x[1]&&this._bbox[2]==x[2]&&this._bbox[3]==x[3]},y.prototype.center=function(_){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},y.prototype.union=function(_){this._valid=!0;var x;return _ instanceof y?x=_.bbox():x=_,this._bbox[0]=Math.min(this._bbox[0],x[0]),this._bbox[1]=Math.min(this._bbox[1],x[1]),this._bbox[2]=Math.max(this._bbox[2],x[2]),this._bbox[3]=Math.max(this._bbox[3],x[3]),this},y.prototype.bbox=function(){return this._valid?this._bbox:null},y.prototype.contains=function(_){if(!_)return this._fastContains();if(!this._valid)return null;var x=_[0],k=_[1];return this._bbox[0]<=x&&this._bbox[1]<=k&&this._bbox[2]>=x&&this._bbox[3]>=k},y.prototype.intersect=function(_){if(!this._valid)return null;var x;return _ instanceof y?x=_.bbox():x=_,!(this._bbox[0]>x[2]||this._bbox[2]<x[0]||this._bbox[3]<x[1]||this._bbox[1]>x[3])},y.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var _="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",_)},y.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null},Wd}var dx;function Ow(){if(dx)return Yu.exports;dx=1;var y=U0(),_=Lw(),x=Fw(),k={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},E=Object.keys(k);Yu.exports=function(u){return D(u).bbox()},Yu.exports.polygon=function(u){return D(u).polygon()},Yu.exports.bboxify=function(u){return _(u).map(function(U){if(U){var M=E.some(function(Y){return U[Y]?k[Y].indexOf(U.type)!==-1:!1});M&&(U.bbox=D(U).bbox(),this.update(U))}})};function D(u){for(var U=x(),M=y(u),Y=0;Y<M.length;Y++)U.include(M[Y]);return U}return Yu.exports}var Vw=Ow();const qw=wt.getDefaultExportFromCjs(Vw),Uw={methods:{getIconDetails(y){const _={};switch(y){case"cities":_.name="fa-regular fa-city";break;case"towns":_.name="fa-regular fa-house-chimney-window";break;case"islands":_.name="fa-regular fa-ship";break;case"regions":_.name="fa-regular fa-map-location-dot";break;case"national-parks":_.name="fa-kit fa-vs-icon-national-park";break;case"acco":_.name="fa-regular fa-bed";break;case"acti":_.name="fa-regular fa-person-walking";break;case"attr":_.name="fa-regular fa-camera";break;case"even":_.name="fa-regular fa-ticket";break;case"cate":_.name="fa-regular fa-utensils";break;case"reta":_.name="fa-regular fa-bag-shopping";break;case"featured":_.name="fa-solid fa-star";break;case"twnv":_.name="";break;case"vics":_.name="fa-kit fa-vs-icentre-information";break;case"outlander-castle":_.name="fa-regular fa-chess-rook";break;case"outlander-church-abbey":_.name="fa-regular fa-church";break;case"outlander-city-town-village":_.name="fa-regular fa-city";break;case"outlander-heritage":_.name="fa-regular fa-landmark";break;case"outlander-landscape-park":_.name="fa-regular fa-mountain";break;case"outlander-palace-house":_.name="fa-regular fa-crown";break;case"distilleries":_.name="fa-kit fa-vs-distillery";break;case"itinerary-stop":_.name="";break}return _}}},Nw={name:"VsMapMarkerIcon",status:"prototype",release:"0.0.1",components:{VsIcon:wt.VsIcon},mixins:[Uw],props:{id:{type:String,required:!0},isHovered:{type:Boolean,default:!1},number:{type:String,default:""},isMapMarker:{type:Boolean,default:!1}},computed:{mapMarkerType(){let y="fa-solid fa-location-pin";return this.id==="twnv"&&(y="fa-solid fa-location-dot"),y},parentClasses(){return this.isMapMarker?"vs-map-marker-icon--map-marker":""},markerClasses(){return[`vs-map-marker-icon__marker--${this.id}`,this.isHovered?"vs-map-marker-icon__marker--outline":""]}}},jw={key:0,class:"vs-map-marker-icon__count"};function Gw(y,_,x,k,E,D){const u=q.resolveComponent("VsIcon");return q.openBlock(),q.createElementBlock("div",{"data-test":"vs-map-marker-icon",class:q.normalizeClass(["vs-map-marker-icon",D.parentClasses])},[q.createVNode(u,{icon:D.mapMarkerType,class:q.normalizeClass(["vs-map-marker-icon__marker",D.markerClasses]),size:"xl"},null,8,["icon","class"]),x.number?(q.openBlock(),q.createElementBlock("span",jw,[_[0]||(_[0]=q.createElementVNode("span",{class:"visually-hidden"}," Stop ",-1)),q.createTextVNode(" "+q.toDisplayString(x.number),1)])):(q.openBlock(),q.createBlock(u,{key:1,class:"vs-map-marker-icon__icon",icon:y.getIconDetails(x.id).name,size:"xs"},null,8,["icon"]))],2)}const Ec=wt._export_sfc(Nw,[["render",Gw]]);let Za=null;const $w={name:"VsMapMarker",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:Ec},props:{feature:{type:Object,required:!0},mapId:{type:String,required:!0},hasPopups:{type:Boolean,required:!0},selectedPlace:{type:String,default:null}},emits:["showDetail","setCategory"],setup(){Za=Sn()},computed:{isActive(){return!!(this.activePlace&&this.activePlace.properties&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties&&this.highlightedPlace.properties.id===this.feature.properties.id)},...pa.mapState(Sn,{highlightedPlace(y){return y.getHoveredStop(this.mapId)},activePlace(y){return y.getActivePlace(this.mapId)?y.getActivePlace(this.mapId):""},activeSubcat(y){return y.selectedSubCategory}}),getMarkerIcon(){let y;return this.feature.properties.type!==""?y=this.feature.properties.type:this.activeSubcat!==null?y=this.activeSubcat:y="featured",y==="null"&&(y=""),y}},watch:{isActive(){return this.activePlace&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties.id===this.feature.properties.id?!0:(this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&Za.setActiveMarkerPos(this.feature.geometry.coordinates),!1)},activePlace(){this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&Za.setActiveMarkerPos(this.feature.geometry.coordinates)}},mounted(){this.hasPopups&&document.body.addEventListener("click",this.handleClickEvent)},beforeUnmount(){document.body.removeEventListener("click",this.handleClickEvent)},methods:{markerClick(){Za.setActiveMarkerPos(this.feature.geometry.coordinates),Za.setActivePlace({mapId:this.mapId,activeFeature:this.feature}),this.$emit("showDetail",this.feature),this.$emit("setCategory",this.feature.properties.type)},handleHover(y){Za.setHoveredPlace({mapId:this.mapId,hoveredFeature:y})},handleClickEvent(y){const _=document.getElementsByClassName("mapboxgl-canvas");y.target===_[0]&&Za.setActivePlace({mapId:this.mapId,activeFeature:null})}}},Zw=["aria-label"];function Ww(y,_,x,k,E,D){const u=q.resolveComponent("VsMapMarkerIcon");return q.openBlock(),q.createElementBlock("button",{type:"button",class:q.normalizeClass(["vs-map-marker",D.isActive?"vs-map-marker--active":""]),"data-test":"vs-map-marker",onClick:_[0]||(_[0]=(...U)=>D.markerClick&&D.markerClick(...U)),onKeydown:_[1]||(_[1]=q.withKeys((...U)=>D.markerClick&&D.markerClick(...U),["enter"])),onMouseover:_[2]||(_[2]=U=>D.handleHover(x.feature)),onMouseleave:_[3]||(_[3]=U=>D.handleHover("")),onFocusin:_[4]||(_[4]=U=>D.handleHover(x.feature)),onFocusout:_[5]||(_[5]=U=>D.handleHover("")),"aria-label":D.getMarkerIcon},[q.createVNode(u,{id:D.getMarkerIcon,"is-map-marker":!0,number:x.feature.properties.stopCount?x.feature.properties.stopCount:""},null,8,["id","number"])],42,Zw)}const eb=wt._export_sfc($w,[["render",Ww]]);let Hs=null;const Hw={name:"VsMap",status:"deprecated",release:"0.0.1",components:{VsWarning:wt.VsWarning,VsLoading:wt.VsLoading},props:{overviewMapLatitude:{type:String,default:"57.81"},overviewMapLongitude:{type:String,default:"-5.51748"},overviewMapZoom:{type:String,default:"5"},mapId:{type:String,required:!0},isVisible:{type:Boolean,required:!0},places:{type:Array,required:!0},filters:{type:Array,default(){return[]}},fitToMarkers:{type:Boolean,default:!1},showPolygons:{type:Boolean,default:!1},selectedItem:{type:Object,default:null},boundsData:{type:Object,default:()=>{}},showInfoMessage:{type:Boolean,default:null},resetZoom:{type:Boolean,default:!1},showMarkerPopups:{type:Boolean,default:!0},loadBrandingImmediately:{type:Boolean,default:!1}},emits:["map-ready","setCategory","showDetail","zoom-reset"],setup(){Hs=Sn()},data(){return{isDesktop:!1,geojsonData:{type:"FeatureCollection",features:[]},polygons:{type:"FeatureCollection",features:[]},multiPolygons:[],mapbox:{map:null,bounds:null,rotation:0,config:{container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",pitchWithRotate:!1,dragRotate:!1}},markers:[],popup:null,hoveredStateId:null,activeStateId:null,showMapMessage:!0,isLoading:!0,showZoomMessage:null}},computed:{getZoom(){return this.mapbox.map?this.mapbox.map.getZoom():null},...pa.mapState(Sn,{activeMarkerPostion(y){return this.mapbox.map?y.activeMarkerPos:null},highlightedPlace(y){return this.mapbox.map?y.getHoveredStop(this.mapId):null},activePlace(y){return this.mapbox.map?y.getActivePlace(this.mapId):null}})},watch:{isVisible(y){y&&this.mapbox.map!==null&&setTimeout(()=>{this.mapbox.map.resize()},20)},places:{handler(){this.geojsonData.features=[],this.initialiseMapFeatures(),this.initialiseMapMarkers()},deep:!0},showPolygons(y){y===!0?this.showMapPolygons():this.hideMapPolygons()},highlightedPlace(y){y&&(y.length===0?this.removeHoveredPolygon():y.geometry.type!=="Point"&&this.addHoveredPolygon(y))},selectedItem(y){if(y&&y.geometry.type!=="Point"){let _=[];_=this.polygons.features.filter(x=>x.properties.id===y.properties.id),_.length>0&&this.addActivePolygon(y)}y||this.removeActivePolygon()},activeMarkerPostion(y){this.checkPointIsVisible(y)||this.centreMapOnPoint(y)},showInfoMessage(y){y?this.showMapMessage=!0:this.showMapMessage=!1},resetZoom(y){y&&(this.mapbox.map.fitBounds(this.calculateBoundingBox()),this.$emit("zoom-reset"),this.showInfoMessage&&(this.showMapMessage=!0))}},mounted(){Hs.addMapInstance({id:this.mapId,filters:this.filters,places:this.places,activePins:this.places}),this.lazyloadMapComponent(),this.isTablet=window.innerWidth>=768,window.addEventListener("resize",this.onResize),this.loadBrandingImmediately?Dy.init({div:this.mapId}):window.addEventListener("DOMContentLoaded",()=>{Dy.init({div:this.mapId})})},methods:{addMap(){const y=this.calculateBoundingBox();this.mapbox.config.container=this.$refs.mapbox,this.mapbox.map=new fo.Map({container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",bounds:y,maxZoom:18,minZoom:4,trackResize:!0}),this.mapbox.map.scrollZoom.disable(),this.mapbox.map.on("rotate",()=>{this.mapbox.rotation=this.mapbox.map.transform.angle}),this.mapbox.map.resize(),this.mapbox.map.on("load",()=>{this.addMapPolygons(),this.showMapMessage=!1,this.isLoading=!1,this.$emit("map-ready",!0),this.mapbox.map.boxZoom.enable()}),this.mapbox.map.on("zoomend",()=>{this.mapbox.map.getZoom()===4?(this.showZoomMessage="too-far",this.showMapMessage=!0):this.mapbox.map.getZoom()===18?(this.showZoomMessage="too-close",this.showMapMessage=!0):this.showInfoMessage||(this.showZoomMessage=null,this.showMapMessage=!1)})},addMapControls(){const y=new fo.NavigationControl;this.mapbox.map.addControl(y,"top-right"),this.mapbox.map.addControl(new fo.FullscreenControl)},initialiseMapFeatures(){this.places.map(y=>{if(typeof y.geometry<"u"){const _=this.getCoordinateArray(y);return this.getMapFeatures(y,_)}return y.latitude&&y.longitude?this.getItineraryMapFeatures(y):!1})},getCoordinateArray(y){return y.geometry.type==="Polygon"?[y.geometry.coordinates[0]]:y.geometry.type==="MultiPolygon"?[y.geometry.coordinates]:[y.geometry.coordinates[0],y.geometry.coordinates[1]]},getMapFeatures(y,_){return this.geojsonData.features.push({type:"Feature",geometry:{type:y.geometry.type,coordinates:_},properties:{title:y.properties.title,imageSrc:y.image,type:typeof y.properties.category<"u"?y.properties.category.id:"",id:y.properties.id},id:y.properties.id})},getItineraryMapFeatures(y){const _=this._uid;return this.geojsonData.features.push({type:"Feature",geometry:{type:"Point",coordinates:[parseFloat(y.longitude),parseFloat(y.latitude)]},properties:{title:y.title,imageSrc:y.imageSrc,type:"itinerary-stop",stopCount:y.stopCount,id:_},id:_})},initialiseMapMarkers(){let y=0;this.initialLoad&&(y=1e3),setTimeout(()=>{if(this.markers!==null){for(let _=this.markers.length-1;_>=0;_--)this.markers[_].remove();this.markers=[]}this.geojsonData.features.forEach(_=>{_.geometry.type==="Point"&&this.createMapMarker(_)})},y)},createMapMarker(y){const _=q.h(eb,{feature:y,mapId:this.mapId,hasPopups:this.showMarkerPopups,onShowDetail:E=>{this.$emit("showDetail",E)},onSetCategory:E=>{this.$emit("setCategory",E)}}),x=document.createElement("div");this.$refs.mapboxOuter.appendChild(x),q.render(_,x),y&&this.showMarkerPopups&&this.addMapPopup(y);const k=new fo.Marker(x.children[0]).setLngLat(y.geometry.coordinates).setPopup(this.popup).addTo(this.mapbox.map);this.setupMarkerListeners(k),this.markers.push(k),x.remove()},hideMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","none"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","none")},showMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","visible"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","visible")},addMapPolygons(){this.geojsonData.features.forEach(y=>{y.geometry.type==="Polygon"?this.polygons.features.includes(y.properties.id)||this.polygons.features.push(y):y.geometry.type==="MultiPolygon"&&(this.polygons.features.includes(y.properties.id)||this.multiPolygons.push(y))}),this.multiPolygons.forEach(y=>{const _=y.properties;y.geometry.coordinates[0].forEach(x=>{this.polygons.features.push({geometry:{type:"Polygon",coordinates:x},id:_.id,properties:{id:_.id,imageSrc:_.imageSrc,title:_.title,type:_.type},type:"Feature"})})}),this.polygons.features.length>0&&(this.mapbox.map.addSource("regions",{type:"geojson",data:this.polygons,promoteId:"id"}),this.mapbox.map.addLayer({id:"regionFills",type:"fill",source:"regions",layout:{},paint:{"fill-color":["case",["==",["feature-state","interaction-state"],"hover"],"rgba(168,48,140,0.5)",["==",["feature-state","interaction-state"],"active"],"rgba(168,48,140,0.5)","rgba(25,200,197,0.6)"],"fill-opacity":.8}}),this.mapbox.map.addLayer({id:"regionBorders",type:"line",source:"regions",layout:{},paint:{"line-color":"#fff","line-width":1}}),this.hideMapPolygons(),this.mapbox.map.on("mousemove","regionFills",y=>{y.features.length>0&&(this.addMapPopup(y),this.removeHoveredPolygon(),this.addHoveredPolygon(y.features[0]))}),this.mapbox.map.on("mouseleave","regionFills",y=>{this.removeMapPopup(y),this.removeHoveredPolygon()}),this.mapbox.map.on("click","regionFills",y=>{this.removeActivePolygon(),this.addActivePolygon(y.features[0]),this.addMapPopup(y.features[0])}))},removeActivePolygon(){this.mapbox.map.style._layers.regionFills&&(this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":""}),this.activeStateId=null)},addActivePolygon(y){this.activeStateId=y.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":"active"}),Hs.setActivePlace({mapId:this.mapId,activeFeature:y}),this.$emit("showDetail",y),this.$emit("setCategory","regions")},removeHoveredPolygon(){if(this.hoveredStateId){let y="";this.hoveredStateId===this.activeStateId&&(y="active"),this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":y})}Hs.setHoveredPlace({mapId:this.mapId,hoveredFeature:""}),this.hoveredStateId=null},addHoveredPolygon(y){this.hoveredStateId=y.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":"hover"}),this.addMapPopup(y),Hs.setHoveredPlace({mapId:this.mapId,hoveredFeature:y})},addMapPopup(y){let _="";y.features?_=y.features[0]:_=y;const x=this.getCoordinates(_),k=this.getPopupHtml(_);_.properties.id&&(this.removeMapPopup(y),this.popup=new fo.Popup({closeButton:!1,offset:{top:[0,20],bottom:[0,-40],left:[30,-20],right:[-30,-20]}}).setLngLat(x).setHTML(k).addTo(this.mapbox.map))},removeMapPopup(y){this.popup&&(this.popup.remove(),this.popup=null),y._popup&&y._popup.remove()},getCoordinates(y){return y.geometry.type==="Polygon"?this.findFeatureCentre(y.geometry.coordinates):y.geometry.type==="MultiPolygon"?this.findFeatureCentre(y.geometry.coordinates[0]):y.geometry.coordinates},findFeatureCentre(y){const _=[],x=[];return y[0].forEach(k=>{_.push(k[1]),x.push(k[0])}),{lat:(Math.min(..._)+Math.max(..._))/2,lng:(Math.min(...x)+Math.max(...x))/2}},getPopupHtml(y){return y.properties.imageSrc&&y.properties.stopCount?`
|
|
501
|
-
<img class="vs-map__popup-image" src="${y.properties.imageSrc}" />
|
|
493
|
+
`+P+" "+z+" "+M+" = u_"+M+`;
|
|
494
|
+
#endif
|
|
495
|
+
`})),staticAttributes:s,staticUniforms:d}}var Qu=Object.freeze({__proto__:null,prelude:Vo,background:Ll,backgroundPattern:Ju,circle:Yu,clippingMask:Bs,heatmap:Rs,heatmapTexture:Fs,collisionBox:Os,collisionCircle:Bl,debug:Rl,fill:$u,fillOutline:la,fillOutlinePattern:ua,fillPattern:Fl,fillExtrusion:jr,fillExtrusionPattern:Vs,hillshadePrepare:Un,hillshade:Nn,line:po,lineGradient:ho,linePattern:jn,lineSDF:fo,raster:mo,symbolIcon:qn,symbolSDF:Ol,symbolTextAndIcon:Vl}),Va=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function Ul(i){for(var o=[],n=0;n<i.length;n++)if(i[n]!==null){var s=i[n].split(" ");o.push(s.pop())}return o}Va.prototype.bind=function(i,o,n,s,p,f,d,y){this.context=i;for(var _=this.boundPaintVertexBuffers.length!==s.length,S=0;!_&&S<s.length;S++)this.boundPaintVertexBuffers[S]!==s[S]&&(_=!0);i.extVertexArrayObject&&this.vao&&this.boundProgram===o&&this.boundLayoutVertexBuffer===n&&!_&&this.boundIndexBuffer===p&&this.boundVertexOffset===f&&this.boundDynamicVertexBuffer===d&&this.boundDynamicVertexBuffer2===y?(i.bindVertexArrayOES.set(this.vao),d&&d.bind(),p&&p.dynamicDraw&&p.bind(),y&&y.bind()):this.freshBind(o,n,s,p,f,d,y)},Va.prototype.freshBind=function(i,o,n,s,p,f,d){var y,_=i.numAttributes,S=this.context,P=S.gl;if(S.extVertexArrayObject)this.vao&&this.destroy(),this.vao=S.extVertexArrayObject.createVertexArrayOES(),S.bindVertexArrayOES.set(this.vao),y=0,this.boundProgram=i,this.boundLayoutVertexBuffer=o,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=s,this.boundVertexOffset=p,this.boundDynamicVertexBuffer=f,this.boundDynamicVertexBuffer2=d;else{y=S.currentNumAttributes||0;for(var z=_;z<y;z++)P.disableVertexAttribArray(z)}o.enableAttributes(P,i);for(var M=0,U=n;M<U.length;M+=1)U[M].enableAttributes(P,i);f&&f.enableAttributes(P,i),d&&d.enableAttributes(P,i),o.bind(),o.setVertexAttribPointers(P,i,p);for(var O=0,Z=n;O<Z.length;O+=1){var B=Z[O];B.bind(),B.setVertexAttribPointers(P,i,p)}f&&(f.bind(),f.setVertexAttribPointers(P,i,p)),s&&s.bind(),d&&(d.bind(),d.setVertexAttribPointers(P,i,p)),S.currentNumAttributes=_},Va.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var Nl=function(i,o,n,s,p,f){var d=i.gl;this.program=d.createProgram();for(var y=Ul(n.staticAttributes),_=s?s.getBinderAttributes():[],S=y.concat(_),P=n.staticUniforms?Ul(n.staticUniforms):[],z=s?s.getBinderUniforms():[],M=[],U=0,O=P.concat(z);U<O.length;U+=1){var Z=O[U];M.indexOf(Z)<0&&M.push(Z)}var B=s?s.defines():[];f&&B.push("#define OVERDRAW_INSPECTOR;");var q=B.concat(Vo.fragmentSource,n.fragmentSource).join(`
|
|
496
|
+
`),X=B.concat(Vo.vertexSource,n.vertexSource).join(`
|
|
497
|
+
`),Y=d.createShader(d.FRAGMENT_SHADER);if(d.isContextLost())this.failedToCreate=!0;else{d.shaderSource(Y,q),d.compileShader(Y),d.attachShader(this.program,Y);var ne=d.createShader(d.VERTEX_SHADER);if(d.isContextLost())this.failedToCreate=!0;else{d.shaderSource(ne,X),d.compileShader(ne),d.attachShader(this.program,ne),this.attributes={};var re={};this.numAttributes=S.length;for(var oe=0;oe<this.numAttributes;oe++)S[oe]&&(d.bindAttribLocation(this.program,oe,S[oe]),this.attributes[S[oe]]=oe);d.linkProgram(this.program),d.deleteShader(ne),d.deleteShader(Y);for(var he=0;he<M.length;he++){var xe=M[he];if(xe&&!re[xe]){var ve=d.getUniformLocation(this.program,xe);ve&&(re[xe]=ve)}}this.fixedUniforms=p(i,re),this.binderUniforms=s?s.getUniforms(i,re):[]}}};function jl(i,o,n){var s=1/qt(n,1,o.transform.tileZoom),p=Math.pow(2,n.tileID.overscaledZ),f=n.tileSize*Math.pow(2,o.transform.tileZoom)/p,d=f*(n.tileID.canonical.x+n.tileID.wrap*p),y=f*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,i.fromScale,i.toScale],u_fade:i.t,u_pixel_coord_upper:[d>>16,y>>16],u_pixel_coord_lower:[65535&d,65535&y]}}Nl.prototype.draw=function(i,o,n,s,p,f,d,y,_,S,P,z,M,U,O,Z){var B,q=i.gl;if(!this.failedToCreate){for(var X in i.program.set(this.program),i.setDepthMode(n),i.setStencilMode(s),i.setColorMode(p),i.setCullFace(f),this.fixedUniforms)this.fixedUniforms[X].set(d[X]);U&&U.setUniforms(i,this.binderUniforms,z,{zoom:M});for(var Y=(B={},B[q.LINES]=2,B[q.TRIANGLES]=3,B[q.LINE_STRIP]=1,B)[o],ne=0,re=P.get();ne<re.length;ne+=1){var oe=re[ne],he=oe.vaos||(oe.vaos={});(he[y]||(he[y]=new Va)).bind(i,this,_,U?U.getPaintVertexBuffers():[],S,oe.vertexOffset,O,Z),q.drawElements(o,oe.primitiveLength*Y,q.UNSIGNED_SHORT,oe.primitiveOffset*Y*2)}}};var ql=function(i,o,n,s){var p=o.style.light,f=p.properties.get("position"),d=[f.x,f.y,f.z],y=u.create$1();p.properties.get("anchor")==="viewport"&&u.fromRotation(y,-o.transform.angle),u.transformMat3(d,d,y);var _=p.properties.get("color");return{u_matrix:i,u_lightpos:d,u_lightintensity:p.properties.get("intensity"),u_lightcolor:[_.r,_.g,_.b],u_vertical_gradient:+n,u_opacity:s}},yo=function(i,o,n,s,p,f,d){return u.extend(ql(i,o,n,s),jl(f,o,d),{u_height_factor:-Math.pow(2,p.overscaledZ)/d.tileSize/8})},Zn=function(i){return{u_matrix:i}},go=function(i,o,n,s){return u.extend(Zn(i),jl(n,o,s))},Zl=function(i,o){return{u_matrix:i,u_world:o}},Gl=function(i,o,n,s,p){return u.extend(go(i,o,n,s),{u_world:p})},Us=function(i,o,n,s){var p,f,d=i.transform;if(s.paint.get("circle-pitch-alignment")==="map"){var y=qt(n,1,d.zoom);p=!0,f=[y,y]}else p=!1,f=d.pixelsToGLUnits;return{u_camera_to_center_distance:d.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_matrix:i.translatePosMatrix(o.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+p,u_device_pixel_ratio:u.browser.devicePixelRatio,u_extrude_scale:f}},vo=function(i,o,n){var s=qt(n,1,o.zoom),p=Math.pow(2,o.zoom-n.tileID.overscaledZ),f=n.tileID.overscaleFactor();return{u_matrix:i,u_camera_to_center_distance:o.cameraToCenterDistance,u_pixels_to_tile_units:s,u_extrude_scale:[o.pixelsToGLUnits[0]/(s*p),o.pixelsToGLUnits[1]/(s*p)],u_overscale_factor:f}},Wl=function(i,o,n){return{u_matrix:i,u_inv_matrix:o,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}},_o=function(i,o,n){return n===void 0&&(n=1),{u_matrix:i,u_color:o,u_overlay:0,u_overlay_scale:n}},xo=function(i){return{u_matrix:i}},Xl=function(i,o,n,s){return{u_matrix:i,u_extrude_scale:qt(o,1,n),u_intensity:s}},ca=function(i,o,n){var s=i.transform;return{u_matrix:Hl(i,o,n),u_ratio:1/qt(o,1,s.zoom),u_device_pixel_ratio:u.browser.devicePixelRatio,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]]}},Ot=function(i,o,n,s){return u.extend(ca(i,o,n),{u_image:0,u_image_height:s})},Ua=function(i,o,n,s){var p=i.transform,f=Uo(o,p);return{u_matrix:Hl(i,o,n),u_texsize:o.imageAtlasTexture.size,u_ratio:1/qt(o,1,p.zoom),u_device_pixel_ratio:u.browser.devicePixelRatio,u_image:0,u_scale:[f,s.fromScale,s.toScale],u_fade:s.t,u_units_to_pixels:[1/p.pixelsToGLUnits[0],1/p.pixelsToGLUnits[1]]}},ec=function(i,o,n,s,p){var f=i.lineAtlas,d=Uo(o,i.transform),y=n.layout.get("line-cap")==="round",_=f.getDash(s.from,y),S=f.getDash(s.to,y),P=_.width*p.fromScale,z=S.width*p.toScale;return u.extend(ca(i,o,n),{u_patternscale_a:[d/P,-_.height/2],u_patternscale_b:[d/z,-S.height/2],u_sdfgamma:f.width/(256*Math.min(P,z)*u.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:_.y,u_tex_y_b:S.y,u_mix:p.t})};function Uo(i,o){return 1/qt(i,1,o.tileZoom)}function Hl(i,o,n){return i.translatePosMatrix(o.tileID.posMatrix,o,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}var tc=function(i,o,n,s,p){return{u_matrix:i,u_tl_parent:o,u_scale_parent:n,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.opacity*p.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:p.paint.get("raster-brightness-min"),u_brightness_high:p.paint.get("raster-brightness-max"),u_saturation_factor:(d=p.paint.get("raster-saturation"),d>0?1-1/(1.001-d):-d),u_contrast_factor:(f=p.paint.get("raster-contrast"),f>0?1/(1-f):1+f),u_spin_weights:Kl(p.paint.get("raster-hue-rotate"))};var f,d};function Kl(i){i*=Math.PI/180;var o=Math.sin(i),n=Math.cos(i);return[(2*n+1)/3,(-Math.sqrt(3)*o-n+1)/3,(Math.sqrt(3)*o-n+1)/3]}var Na,No=function(i,o,n,s,p,f,d,y,_,S){var P=p.transform;return{u_is_size_zoom_constant:+(i==="constant"||i==="source"),u_is_size_feature_constant:+(i==="constant"||i==="camera"),u_size_t:o?o.uSizeT:0,u_size:o?o.uSize:0,u_camera_to_center_distance:P.cameraToCenterDistance,u_pitch:P.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:P.width/P.height,u_fade_change:p.options.fadeDuration?p.symbolFadeChange:1,u_matrix:f,u_label_plane_matrix:d,u_coord_matrix:y,u_is_text:+_,u_pitch_with_map:+s,u_texsize:S,u_texture:0}},pa=function(i,o,n,s,p,f,d,y,_,S,P){var z=p.transform;return u.extend(No(i,o,n,s,p,f,d,y,_,S),{u_gamma_scale:s?Math.cos(z._pitch)*z.cameraToCenterDistance:1,u_device_pixel_ratio:u.browser.devicePixelRatio,u_is_halo:1})},ja=function(i,o,n,s,p,f,d,y,_,S){return u.extend(pa(i,o,n,s,p,f,d,y,!0,_),{u_texsize_icon:S,u_texture_icon:1})},ha=function(i,o,n){return{u_matrix:i,u_opacity:o,u_color:n}},jo=function(i,o,n,s,p,f){return u.extend((function(d,y,_,S){var P=_.imageManager.getPattern(d.from.toString()),z=_.imageManager.getPattern(d.to.toString()),M=_.imageManager.getPixelSize(),U=M.width,O=M.height,Z=Math.pow(2,S.tileID.overscaledZ),B=S.tileSize*Math.pow(2,_.transform.tileZoom)/Z,q=B*(S.tileID.canonical.x+S.tileID.wrap*Z),X=B*S.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:P.tl,u_pattern_br_a:P.br,u_pattern_tl_b:z.tl,u_pattern_br_b:z.br,u_texsize:[U,O],u_mix:y.t,u_pattern_size_a:P.displaySize,u_pattern_size_b:z.displaySize,u_scale_a:y.fromScale,u_scale_b:y.toScale,u_tile_units_to_pixels:1/qt(S,1,_.transform.tileZoom),u_pixel_coord_upper:[q>>16,X>>16],u_pixel_coord_lower:[65535&q,65535&X]}})(s,f,n,p),{u_matrix:i,u_opacity:o})},Jl={fillExtrusion:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_lightpos:new u.Uniform3f(i,o.u_lightpos),u_lightintensity:new u.Uniform1f(i,o.u_lightintensity),u_lightcolor:new u.Uniform3f(i,o.u_lightcolor),u_vertical_gradient:new u.Uniform1f(i,o.u_vertical_gradient),u_opacity:new u.Uniform1f(i,o.u_opacity)}},fillExtrusionPattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_lightpos:new u.Uniform3f(i,o.u_lightpos),u_lightintensity:new u.Uniform1f(i,o.u_lightintensity),u_lightcolor:new u.Uniform3f(i,o.u_lightcolor),u_vertical_gradient:new u.Uniform1f(i,o.u_vertical_gradient),u_height_factor:new u.Uniform1f(i,o.u_height_factor),u_image:new u.Uniform1i(i,o.u_image),u_texsize:new u.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new u.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new u.Uniform3f(i,o.u_scale),u_fade:new u.Uniform1f(i,o.u_fade),u_opacity:new u.Uniform1f(i,o.u_opacity)}},fill:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix)}},fillPattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_image:new u.Uniform1i(i,o.u_image),u_texsize:new u.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new u.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new u.Uniform3f(i,o.u_scale),u_fade:new u.Uniform1f(i,o.u_fade)}},fillOutline:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_world:new u.Uniform2f(i,o.u_world)}},fillOutlinePattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_world:new u.Uniform2f(i,o.u_world),u_image:new u.Uniform1i(i,o.u_image),u_texsize:new u.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new u.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new u.Uniform3f(i,o.u_scale),u_fade:new u.Uniform1f(i,o.u_fade)}},circle:function(i,o){return{u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_scale_with_map:new u.Uniform1i(i,o.u_scale_with_map),u_pitch_with_map:new u.Uniform1i(i,o.u_pitch_with_map),u_extrude_scale:new u.Uniform2f(i,o.u_extrude_scale),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_matrix:new u.UniformMatrix4f(i,o.u_matrix)}},collisionBox:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_pixels_to_tile_units:new u.Uniform1f(i,o.u_pixels_to_tile_units),u_extrude_scale:new u.Uniform2f(i,o.u_extrude_scale),u_overscale_factor:new u.Uniform1f(i,o.u_overscale_factor)}},collisionCircle:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_inv_matrix:new u.UniformMatrix4f(i,o.u_inv_matrix),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_viewport_size:new u.Uniform2f(i,o.u_viewport_size)}},debug:function(i,o){return{u_color:new u.UniformColor(i,o.u_color),u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_overlay:new u.Uniform1i(i,o.u_overlay),u_overlay_scale:new u.Uniform1f(i,o.u_overlay_scale)}},clippingMask:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix)}},heatmap:function(i,o){return{u_extrude_scale:new u.Uniform1f(i,o.u_extrude_scale),u_intensity:new u.Uniform1f(i,o.u_intensity),u_matrix:new u.UniformMatrix4f(i,o.u_matrix)}},heatmapTexture:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_world:new u.Uniform2f(i,o.u_world),u_image:new u.Uniform1i(i,o.u_image),u_color_ramp:new u.Uniform1i(i,o.u_color_ramp),u_opacity:new u.Uniform1f(i,o.u_opacity)}},hillshade:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_image:new u.Uniform1i(i,o.u_image),u_latrange:new u.Uniform2f(i,o.u_latrange),u_light:new u.Uniform2f(i,o.u_light),u_shadow:new u.UniformColor(i,o.u_shadow),u_highlight:new u.UniformColor(i,o.u_highlight),u_accent:new u.UniformColor(i,o.u_accent)}},hillshadePrepare:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_image:new u.Uniform1i(i,o.u_image),u_dimension:new u.Uniform2f(i,o.u_dimension),u_zoom:new u.Uniform1f(i,o.u_zoom),u_unpack:new u.Uniform4f(i,o.u_unpack)}},line:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_ratio:new u.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(i,o.u_units_to_pixels)}},lineGradient:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_ratio:new u.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(i,o.u_units_to_pixels),u_image:new u.Uniform1i(i,o.u_image),u_image_height:new u.Uniform1f(i,o.u_image_height)}},linePattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_texsize:new u.Uniform2f(i,o.u_texsize),u_ratio:new u.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_image:new u.Uniform1i(i,o.u_image),u_units_to_pixels:new u.Uniform2f(i,o.u_units_to_pixels),u_scale:new u.Uniform3f(i,o.u_scale),u_fade:new u.Uniform1f(i,o.u_fade)}},lineSDF:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_ratio:new u.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(i,o.u_units_to_pixels),u_patternscale_a:new u.Uniform2f(i,o.u_patternscale_a),u_patternscale_b:new u.Uniform2f(i,o.u_patternscale_b),u_sdfgamma:new u.Uniform1f(i,o.u_sdfgamma),u_image:new u.Uniform1i(i,o.u_image),u_tex_y_a:new u.Uniform1f(i,o.u_tex_y_a),u_tex_y_b:new u.Uniform1f(i,o.u_tex_y_b),u_mix:new u.Uniform1f(i,o.u_mix)}},raster:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_tl_parent:new u.Uniform2f(i,o.u_tl_parent),u_scale_parent:new u.Uniform1f(i,o.u_scale_parent),u_buffer_scale:new u.Uniform1f(i,o.u_buffer_scale),u_fade_t:new u.Uniform1f(i,o.u_fade_t),u_opacity:new u.Uniform1f(i,o.u_opacity),u_image0:new u.Uniform1i(i,o.u_image0),u_image1:new u.Uniform1i(i,o.u_image1),u_brightness_low:new u.Uniform1f(i,o.u_brightness_low),u_brightness_high:new u.Uniform1f(i,o.u_brightness_high),u_saturation_factor:new u.Uniform1f(i,o.u_saturation_factor),u_contrast_factor:new u.Uniform1f(i,o.u_contrast_factor),u_spin_weights:new u.Uniform3f(i,o.u_spin_weights)}},symbolIcon:function(i,o){return{u_is_size_zoom_constant:new u.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new u.Uniform1f(i,o.u_size_t),u_size:new u.Uniform1f(i,o.u_size),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new u.Uniform1f(i,o.u_pitch),u_rotate_symbol:new u.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new u.Uniform1f(i,o.u_fade_change),u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new u.Uniform1i(i,o.u_is_text),u_pitch_with_map:new u.Uniform1i(i,o.u_pitch_with_map),u_texsize:new u.Uniform2f(i,o.u_texsize),u_texture:new u.Uniform1i(i,o.u_texture)}},symbolSDF:function(i,o){return{u_is_size_zoom_constant:new u.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new u.Uniform1f(i,o.u_size_t),u_size:new u.Uniform1f(i,o.u_size),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new u.Uniform1f(i,o.u_pitch),u_rotate_symbol:new u.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new u.Uniform1f(i,o.u_fade_change),u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new u.Uniform1i(i,o.u_is_text),u_pitch_with_map:new u.Uniform1i(i,o.u_pitch_with_map),u_texsize:new u.Uniform2f(i,o.u_texsize),u_texture:new u.Uniform1i(i,o.u_texture),u_gamma_scale:new u.Uniform1f(i,o.u_gamma_scale),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_is_halo:new u.Uniform1i(i,o.u_is_halo)}},symbolTextAndIcon:function(i,o){return{u_is_size_zoom_constant:new u.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new u.Uniform1f(i,o.u_size_t),u_size:new u.Uniform1f(i,o.u_size),u_camera_to_center_distance:new u.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new u.Uniform1f(i,o.u_pitch),u_rotate_symbol:new u.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new u.Uniform1f(i,o.u_fade_change),u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new u.Uniform1i(i,o.u_is_text),u_pitch_with_map:new u.Uniform1i(i,o.u_pitch_with_map),u_texsize:new u.Uniform2f(i,o.u_texsize),u_texsize_icon:new u.Uniform2f(i,o.u_texsize_icon),u_texture:new u.Uniform1i(i,o.u_texture),u_texture_icon:new u.Uniform1i(i,o.u_texture_icon),u_gamma_scale:new u.Uniform1f(i,o.u_gamma_scale),u_device_pixel_ratio:new u.Uniform1f(i,o.u_device_pixel_ratio),u_is_halo:new u.Uniform1i(i,o.u_is_halo)}},background:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_opacity:new u.Uniform1f(i,o.u_opacity),u_color:new u.UniformColor(i,o.u_color)}},backgroundPattern:function(i,o){return{u_matrix:new u.UniformMatrix4f(i,o.u_matrix),u_opacity:new u.Uniform1f(i,o.u_opacity),u_image:new u.Uniform1i(i,o.u_image),u_pattern_tl_a:new u.Uniform2f(i,o.u_pattern_tl_a),u_pattern_br_a:new u.Uniform2f(i,o.u_pattern_br_a),u_pattern_tl_b:new u.Uniform2f(i,o.u_pattern_tl_b),u_pattern_br_b:new u.Uniform2f(i,o.u_pattern_br_b),u_texsize:new u.Uniform2f(i,o.u_texsize),u_mix:new u.Uniform1f(i,o.u_mix),u_pattern_size_a:new u.Uniform2f(i,o.u_pattern_size_a),u_pattern_size_b:new u.Uniform2f(i,o.u_pattern_size_b),u_scale_a:new u.Uniform1f(i,o.u_scale_a),u_scale_b:new u.Uniform1f(i,o.u_scale_b),u_pixel_coord_upper:new u.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(i,o.u_pixel_coord_lower),u_tile_units_to_pixels:new u.Uniform1f(i,o.u_tile_units_to_pixels)}}};function qo(i,o,n,s,p,f,d){for(var y=i.context,_=y.gl,S=i.useProgram("collisionBox"),P=[],z=0,M=0,U=0;U<s.length;U++){var O=s[U],Z=o.getTile(O),B=Z.getBucket(n);if(B){var q=O.posMatrix;p[0]===0&&p[1]===0||(q=i.translatePosMatrix(O.posMatrix,Z,p,f));var X=d?B.textCollisionBox:B.iconCollisionBox,Y=B.collisionCircleArray;if(Y.length>0){var ne=u.create(),re=q;u.mul(ne,B.placementInvProjMatrix,i.transform.glCoordMatrix),u.mul(ne,ne,B.placementViewportMatrix),P.push({circleArray:Y,circleOffset:M,transform:re,invTransform:ne}),M=z+=Y.length/4}X&&S.draw(y,_.LINES,L.disabled,V.disabled,i.colorModeForRenderPass(),H.disabled,vo(q,i.transform,Z),n.id,X.layoutVertexBuffer,X.indexBuffer,X.segments,null,i.transform.zoom,null,null,X.collisionVertexBuffer)}}if(d&&P.length){var oe=i.useProgram("collisionCircle"),he=new u.StructArrayLayout2f1f2i16;he.resize(4*z),he._trim();for(var xe=0,ve=0,Ae=P;ve<Ae.length;ve+=1)for(var Ne=Ae[ve],He=0;He<Ne.circleArray.length/4;He++){var Xe=4*He,bt=Ne.circleArray[Xe+0],ze=Ne.circleArray[Xe+1],tt=Ne.circleArray[Xe+2],at=Ne.circleArray[Xe+3];he.emplace(xe++,bt,ze,tt,at,0),he.emplace(xe++,bt,ze,tt,at,1),he.emplace(xe++,bt,ze,tt,at,2),he.emplace(xe++,bt,ze,tt,at,3)}(!Na||Na.length<2*z)&&(Na=(function(Qt){var Wr=2*Qt,Rr=new u.StructArrayLayout3ui6;Rr.resize(Wr),Rr._trim();for(var Yt=0;Yt<Wr;Yt++){var sr=6*Yt;Rr.uint16[sr+0]=4*Yt+0,Rr.uint16[sr+1]=4*Yt+1,Rr.uint16[sr+2]=4*Yt+2,Rr.uint16[sr+3]=4*Yt+2,Rr.uint16[sr+4]=4*Yt+3,Rr.uint16[sr+5]=4*Yt+0}return Rr})(z));for(var Qe=y.createIndexBuffer(Na,!0),$e=y.createVertexBuffer(he,u.collisionCircleLayout.members,!0),nt=0,Ye=P;nt<Ye.length;nt+=1){var Ke=Ye[nt],kr=Wl(Ke.transform,Ke.invTransform,i.transform);oe.draw(y,_.TRIANGLES,L.disabled,V.disabled,i.colorModeForRenderPass(),H.disabled,kr,n.id,$e,Qe,u.SegmentVector.simpleSegment(0,2*Ke.circleOffset,Ke.circleArray.length,Ke.circleArray.length/2),null,i.transform.zoom,null,null,null)}$e.destroy(),Qe.destroy()}}var Hi=u.identity(new Float32Array(16));function Yl(i,o,n,s,p,f){var d=u.getAnchorAlignment(i),y=-(d.horizontalAlign-.5)*o,_=-(d.verticalAlign-.5)*n,S=u.evaluateVariableOffset(i,s);return new u.Point((y/p+S[0])*f,(_/p+S[1])*f)}function $l(i,o,n,s,p,f,d,y,_,S,P){var z=i.text.placedSymbolArray,M=i.text.dynamicLayoutVertexArray,U=i.icon.dynamicLayoutVertexArray,O={};M.clear();for(var Z=0;Z<z.length;Z++){var B=z.get(Z),q=B.hidden||!B.crossTileID||i.allowVerticalPlacement&&!B.placedOrientation?null:s[B.crossTileID];if(q){var X=new u.Point(B.anchorX,B.anchorY),Y=yt(X,n?y:d),ne=Tt(f.cameraToCenterDistance,Y.signedDistanceFromCamera),re=p.evaluateSizeForFeature(i.textSizeData,S,B)*ne/u.ONE_EM;n&&(re*=i.tilePixelRatio/_);for(var oe=Yl(q.anchor,q.width,q.height,q.textOffset,q.textBoxScale,re),he=n?yt(X.add(oe),d).point:Y.point.add(o?oe.rotate(-f.angle):oe),xe=i.allowVerticalPlacement&&B.placedOrientation===u.WritingMode.vertical?Math.PI/2:0,ve=0;ve<B.numGlyphs;ve++)u.addDynamicAttributes(M,he,xe);P&&B.associatedIconIndex>=0&&(O[B.associatedIconIndex]={shiftedAnchor:he,angle:xe})}else Yr(B.numGlyphs,M)}if(P){U.clear();for(var Ae=i.icon.placedSymbolArray,Ne=0;Ne<Ae.length;Ne++){var He=Ae.get(Ne);if(He.hidden)Yr(He.numGlyphs,U);else{var Xe=O[Ne];if(Xe)for(var bt=0;bt<He.numGlyphs;bt++)u.addDynamicAttributes(U,Xe.shiftedAnchor,Xe.angle);else Yr(He.numGlyphs,U)}}i.icon.dynamicLayoutVertexBuffer.updateData(U)}i.text.dynamicLayoutVertexBuffer.updateData(M)}function Ql(i,o,n){return n.iconsInText&&o?"symbolTextAndIcon":i?"symbolSDF":"symbolIcon"}function bo(i,o,n,s,p,f,d,y,_,S,P,z){for(var M=i.context,U=M.gl,O=i.transform,Z=y==="map",B=_==="map",q=Z&&n.layout.get("symbol-placement")!=="point",X=Z&&!B&&!q,Y=n.layout.get("symbol-sort-key").constantOr(1)!==void 0,ne=!1,re=i.depthModeForSublayer(0,L.ReadOnly),oe=n.layout.get("text-variable-anchor"),he=[],xe=0,ve=s;xe<ve.length;xe+=1){var Ae=ve[xe],Ne=o.getTile(Ae),He=Ne.getBucket(n);if(He){var Xe=p?He.text:He.icon;if(Xe&&Xe.segments.get().length){var bt=Xe.programConfigurations.get(n.id),ze=p||He.sdfIcons,tt=p?He.textSizeData:He.iconSizeData,at=B||O.pitch!==0,Qe=i.useProgram(Ql(ze,p,He),bt),$e=u.evaluateSizeForZoom(tt,O.zoom),nt=void 0,Ye=[0,0],Ke=void 0,kr=void 0,Qt=null,Wr=void 0;if(p)Ke=Ne.glyphAtlasTexture,kr=U.LINEAR,nt=Ne.glyphAtlasTexture.size,He.iconsInText&&(Ye=Ne.imageAtlasTexture.size,Qt=Ne.imageAtlasTexture,Wr=at||i.options.rotating||i.options.zooming||tt.kind==="composite"||tt.kind==="camera"?U.LINEAR:U.NEAREST);else{var Rr=n.layout.get("icon-size").constantOr(0)!==1||He.iconsNeedLinear;Ke=Ne.imageAtlasTexture,kr=ze||i.options.rotating||i.options.zooming||Rr||at?U.LINEAR:U.NEAREST,nt=Ne.imageAtlasTexture.size}var Yt=qt(Ne,1,i.transform.zoom),sr=or(Ae.posMatrix,B,Z,i.transform,Yt),bi=Mt(Ae.posMatrix,B,Z,i.transform,Yt),ti=oe&&He.hasTextData(),Jn=n.layout.get("icon-text-fit")!=="none"&&ti&&He.hasIconData();q&&na(He,Ae.posMatrix,i,p,sr,bi,B,S);var ui=i.translatePosMatrix(Ae.posMatrix,Ne,f,d),Qi=q||p&&oe||Jn?Hi:sr,Ui=i.translatePosMatrix(bi,Ne,f,d,!0),Ia=ze&&n.paint.get(p?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Ko={program:Qe,buffers:Xe,uniformValues:ze?He.iconsInText?ja(tt.kind,$e,X,B,i,ui,Qi,Ui,nt,Ye):pa(tt.kind,$e,X,B,i,ui,Qi,Ui,p,nt):No(tt.kind,$e,X,B,i,ui,Qi,Ui,p,nt),atlasTexture:Ke,atlasTextureIcon:Qt,atlasInterpolation:kr,atlasInterpolationIcon:Wr,isSDF:ze,hasHalo:Ia};if(Y&&He.canOverlap){ne=!0;for(var Yn=0,Jo=Xe.segments.get();Yn<Jo.length;Yn+=1){var Ea=Jo[Yn];he.push({segments:new u.SegmentVector([Ea]),sortKey:Ea.sortKey,state:Ko})}}else he.push({segments:Xe.segments,sortKey:0,state:Ko})}}}ne&&he.sort((function($n,ko){return $n.sortKey-ko.sortKey}));for(var hn=0,Ta=he;hn<Ta.length;hn+=1){var fn=Ta[hn],Cr=fn.state;if(M.activeTexture.set(U.TEXTURE0),Cr.atlasTexture.bind(Cr.atlasInterpolation,U.CLAMP_TO_EDGE),Cr.atlasTextureIcon&&(M.activeTexture.set(U.TEXTURE1),Cr.atlasTextureIcon&&Cr.atlasTextureIcon.bind(Cr.atlasInterpolationIcon,U.CLAMP_TO_EDGE)),Cr.isSDF){var En=Cr.uniformValues;Cr.hasHalo&&(En.u_is_halo=1,fa(Cr.buffers,fn.segments,n,i,Cr.program,re,P,z,En)),En.u_is_halo=0}fa(Cr.buffers,fn.segments,n,i,Cr.program,re,P,z,Cr.uniformValues)}}function fa(i,o,n,s,p,f,d,y,_){var S=s.context;p.draw(S,S.gl.TRIANGLES,f,d,y,H.disabled,_,n.id,i.layoutVertexBuffer,i.indexBuffer,o,n.paint,s.transform.zoom,i.programConfigurations.get(n.id),i.dynamicLayoutVertexBuffer,i.opacityVertexBuffer)}function qa(i,o,n,s,p,f,d){var y,_,S,P,z,M=i.context.gl,U=n.paint.get("fill-pattern"),O=U&&U.constantOr(1),Z=n.getCrossfadeParameters();d?(_=O&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",y=M.LINES):(_=O?"fillPattern":"fill",y=M.TRIANGLES);for(var B=0,q=s;B<q.length;B+=1){var X=q[B],Y=o.getTile(X);if(!O||Y.patternsLoaded()){var ne=Y.getBucket(n);if(ne){var re=ne.programConfigurations.get(n.id),oe=i.useProgram(_,re);O&&(i.context.activeTexture.set(M.TEXTURE0),Y.imageAtlasTexture.bind(M.LINEAR,M.CLAMP_TO_EDGE),re.updatePaintBuffers(Z));var he=U.constantOr(null);if(he&&Y.imageAtlas){var xe=Y.imageAtlas,ve=xe.patternPositions[he.to.toString()],Ae=xe.patternPositions[he.from.toString()];ve&&Ae&&re.setConstantPatternPositions(ve,Ae)}var Ne=i.translatePosMatrix(X.posMatrix,Y,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(d){P=ne.indexBuffer2,z=ne.segments2;var He=[M.drawingBufferWidth,M.drawingBufferHeight];S=_==="fillOutlinePattern"&&O?Gl(Ne,i,Z,Y,He):Zl(Ne,He)}else P=ne.indexBuffer,z=ne.segments,S=O?go(Ne,i,Z,Y):Zn(Ne);oe.draw(i.context,y,p,i.stencilModeForClipping(X),f,H.disabled,S,n.id,ne.layoutVertexBuffer,P,z,n.paint,i.transform.zoom,re)}}}}function Ns(i,o,n,s,p,f,d){for(var y=i.context,_=y.gl,S=n.paint.get("fill-extrusion-pattern"),P=S.constantOr(1),z=n.getCrossfadeParameters(),M=n.paint.get("fill-extrusion-opacity"),U=0,O=s;U<O.length;U+=1){var Z=O[U],B=o.getTile(Z),q=B.getBucket(n);if(q){var X=q.programConfigurations.get(n.id),Y=i.useProgram(P?"fillExtrusionPattern":"fillExtrusion",X);P&&(i.context.activeTexture.set(_.TEXTURE0),B.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),X.updatePaintBuffers(z));var ne=S.constantOr(null);if(ne&&B.imageAtlas){var re=B.imageAtlas,oe=re.patternPositions[ne.to.toString()],he=re.patternPositions[ne.from.toString()];oe&&he&&X.setConstantPatternPositions(oe,he)}var xe=i.translatePosMatrix(Z.posMatrix,B,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),ve=n.paint.get("fill-extrusion-vertical-gradient"),Ae=P?yo(xe,i,ve,M,Z,z,B):ql(xe,i,ve,M);Y.draw(y,y.gl.TRIANGLES,p,f,d,H.backCCW,Ae,n.id,q.layoutVertexBuffer,q.indexBuffer,q.segments,n.paint,i.transform.zoom,X)}}}function Za(i,o,n,s,p,f){var d=i.context,y=d.gl,_=o.fbo;if(_){var S=i.useProgram("hillshade");d.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,_.colorAttachment.get());var P=(function(z,M,U){var O=U.paint.get("hillshade-shadow-color"),Z=U.paint.get("hillshade-highlight-color"),B=U.paint.get("hillshade-accent-color"),q=U.paint.get("hillshade-illumination-direction")*(Math.PI/180);U.paint.get("hillshade-illumination-anchor")==="viewport"&&(q-=z.transform.angle);var X,Y,ne,re=!z.options.moving;return{u_matrix:z.transform.calculatePosMatrix(M.tileID.toUnwrapped(),re),u_image:0,u_latrange:(X=M.tileID,Y=Math.pow(2,X.canonical.z),ne=X.canonical.y,[new u.MercatorCoordinate(0,ne/Y).toLngLat().lat,new u.MercatorCoordinate(0,(ne+1)/Y).toLngLat().lat]),u_light:[U.paint.get("hillshade-exaggeration"),q],u_shadow:O,u_highlight:Z,u_accent:B}})(i,o,n);S.draw(d,y.TRIANGLES,s,p,f,H.disabled,P,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}}function rc(i,o,n,s,p,f){var d=i.context,y=d.gl,_=o.dem;if(_&&_.data){var S=_.dim,P=_.stride,z=_.getPixels();if(d.activeTexture.set(y.TEXTURE1),d.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||i.getTileTexture(P),o.demTexture){var M=o.demTexture;M.update(z,{premultiply:!1}),M.bind(y.NEAREST,y.CLAMP_TO_EDGE)}else o.demTexture=new u.Texture(d,z,y.RGBA,{premultiply:!1}),o.demTexture.bind(y.NEAREST,y.CLAMP_TO_EDGE);d.activeTexture.set(y.TEXTURE0);var U=o.fbo;if(!U){var O=new u.Texture(d,{width:S,height:S,data:null},y.RGBA);O.bind(y.LINEAR,y.CLAMP_TO_EDGE),(U=o.fbo=d.createFramebuffer(S,S,!0)).colorAttachment.set(O.texture)}d.bindFramebuffer.set(U.framebuffer),d.viewport.set([0,0,S,S]),i.useProgram("hillshadePrepare").draw(d,y.TRIANGLES,s,p,f,H.disabled,(function(Z,B){var q=B.stride,X=u.create();return u.ortho(X,0,u.EXTENT,-u.EXTENT,0,0,1),u.translate(X,X,[0,-u.EXTENT,0]),{u_matrix:X,u_image:1,u_dimension:[q,q],u_zoom:Z.overscaledZ,u_unpack:B.getUnpackVector()}})(o.tileID,_),n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments),o.needsHillshadePrepare=!1}}function Ga(i,o,n,s,p){var f=s.paint.get("raster-fade-duration");if(f>0){var d=u.browser.now(),y=(d-i.timeAdded)/f,_=o?(d-o.timeAdded)/f:-1,S=n.getSource(),P=p.coveringZoomLevel({tileSize:S.tileSize,roundZoom:S.roundZoom}),z=!o||Math.abs(o.tileID.overscaledZ-P)>Math.abs(i.tileID.overscaledZ-P),M=z&&i.refreshedUponExpiration?1:u.clamp(z?y:1-_,0,1);return i.refreshedUponExpiration&&y>=1&&(i.refreshedUponExpiration=!1),o?{opacity:1,mix:1-M}:{opacity:M,mix:0}}return{opacity:1,mix:0}}var js=new u.Color(1,0,0,1),eu=new u.Color(0,1,0,1),tu=new u.Color(0,0,1,1),Wa=new u.Color(1,0,1,1),qs=new u.Color(0,1,1,1);function Zs(i,o,n,s){da(i,0,o+n/2,i.transform.width,n,s)}function Gs(i,o,n,s){da(i,o-n/2,0,n,i.transform.height,s)}function da(i,o,n,s,p,f){var d=i.context,y=d.gl;y.enable(y.SCISSOR_TEST),y.scissor(o*u.browser.devicePixelRatio,n*u.browser.devicePixelRatio,s*u.browser.devicePixelRatio,p*u.browser.devicePixelRatio),d.clear({color:f}),y.disable(y.SCISSOR_TEST)}function ru(i,o,n){var s=i.context,p=s.gl,f=n.posMatrix,d=i.useProgram("debug"),y=L.disabled,_=V.disabled,S=i.colorModeForRenderPass();s.activeTexture.set(p.TEXTURE0),i.emptyTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),d.draw(s,p.LINE_STRIP,y,_,S,H.disabled,_o(f,u.Color.red),"$debug",i.debugBuffer,i.tileBorderIndexBuffer,i.debugSegments);var P=o.getTileByID(n.key).latestRawTileData,z=Math.floor((P&&P.byteLength||0)/1024),M=o.getTile(n).tileSize,U=512/Math.min(M,512)*(n.overscaledZ/i.transform.zoom)*.5,O=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(O+=" => "+n.overscaledZ),(function(Z,B){Z.initDebugOverlayCanvas();var q=Z.debugOverlayCanvas,X=Z.context.gl,Y=Z.debugOverlayCanvas.getContext("2d");Y.clearRect(0,0,q.width,q.height),Y.shadowColor="white",Y.shadowBlur=2,Y.lineWidth=1.5,Y.strokeStyle="white",Y.textBaseline="top",Y.font="bold 36px Open Sans, sans-serif",Y.fillText(B,5,5),Y.strokeText(B,5,5),Z.debugOverlayTexture.update(q),Z.debugOverlayTexture.bind(X.LINEAR,X.CLAMP_TO_EDGE)})(i,O+" "+z+"kb"),d.draw(s,p.TRIANGLES,y,_,W.alphaBlended,H.disabled,_o(f,u.Color.transparent,U),"$debug",i.debugBuffer,i.quadTriangleIndexBuffer,i.debugSegments)}var wo={symbol:function(i,o,n,s,p){if(i.renderPass==="translucent"){var f=V.disabled,d=i.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&(function(y,_,S,P,z,M,U){for(var O=_.transform,Z=z==="map",B=M==="map",q=0,X=y;q<X.length;q+=1){var Y=X[q],ne=P.getTile(Y),re=ne.getBucket(S);if(re&&re.text&&re.text.segments.get().length){var oe=u.evaluateSizeForZoom(re.textSizeData,O.zoom),he=qt(ne,1,_.transform.zoom),xe=or(Y.posMatrix,B,Z,_.transform,he),ve=S.layout.get("icon-text-fit")!=="none"&&re.hasIconData();if(oe){var Ae=Math.pow(2,O.zoom-ne.tileID.overscaledZ);$l(re,Z,B,U,u.symbolSize,O,xe,Y.posMatrix,Ae,oe,ve)}}}})(s,i,n,o,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),p),n.paint.get("icon-opacity").constantOr(1)!==0&&bo(i,o,n,s,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),f,d),n.paint.get("text-opacity").constantOr(1)!==0&&bo(i,o,n,s,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),f,d),o.map.showCollisionBoxes&&(qo(i,o,n,s,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),qo(i,o,n,s,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(i,o,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("circle-opacity"),f=n.paint.get("circle-stroke-width"),d=n.paint.get("circle-stroke-opacity"),y=n.layout.get("circle-sort-key").constantOr(1)!==void 0;if(p.constantOr(1)!==0||f.constantOr(1)!==0&&d.constantOr(1)!==0){for(var _=i.context,S=_.gl,P=i.depthModeForSublayer(0,L.ReadOnly),z=V.disabled,M=i.colorModeForRenderPass(),U=[],O=0;O<s.length;O++){var Z=s[O],B=o.getTile(Z),q=B.getBucket(n);if(q){var X=q.programConfigurations.get(n.id),Y={programConfiguration:X,program:i.useProgram("circle",X),layoutVertexBuffer:q.layoutVertexBuffer,indexBuffer:q.indexBuffer,uniformValues:Us(i,Z,B,n)};if(y)for(var ne=0,re=q.segments.get();ne<re.length;ne+=1){var oe=re[ne];U.push({segments:new u.SegmentVector([oe]),sortKey:oe.sortKey,state:Y})}else U.push({segments:q.segments,sortKey:0,state:Y})}}y&&U.sort((function(Ne,He){return Ne.sortKey-He.sortKey}));for(var he=0,xe=U;he<xe.length;he+=1){var ve=xe[he],Ae=ve.state;Ae.program.draw(_,S.TRIANGLES,P,z,M,H.disabled,Ae.uniformValues,n.id,Ae.layoutVertexBuffer,Ae.indexBuffer,ve.segments,n.paint,i.transform.zoom,Ae.programConfiguration)}}}},heatmap:function(i,o,n,s){if(n.paint.get("heatmap-opacity")!==0)if(i.renderPass==="offscreen"){var p=i.context,f=p.gl,d=V.disabled,y=new W([f.ONE,f.ONE],u.Color.transparent,[!0,!0,!0,!0]);(function(U,O,Z){var B=U.gl;U.activeTexture.set(B.TEXTURE1),U.viewport.set([0,0,O.width/4,O.height/4]);var q=Z.heatmapFbo;if(q)B.bindTexture(B.TEXTURE_2D,q.colorAttachment.get()),U.bindFramebuffer.set(q.framebuffer);else{var X=B.createTexture();B.bindTexture(B.TEXTURE_2D,X),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_S,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_T,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MIN_FILTER,B.LINEAR),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MAG_FILTER,B.LINEAR),q=Z.heatmapFbo=U.createFramebuffer(O.width/4,O.height/4,!1),(function(Y,ne,re,oe){var he=Y.gl;he.texImage2D(he.TEXTURE_2D,0,he.RGBA,ne.width/4,ne.height/4,0,he.RGBA,Y.extRenderToTextureHalfFloat?Y.extTextureHalfFloat.HALF_FLOAT_OES:he.UNSIGNED_BYTE,null),oe.colorAttachment.set(re)})(U,O,X,q)}})(p,i,n),p.clear({color:u.Color.transparent});for(var _=0;_<s.length;_++){var S=s[_];if(!o.hasRenderableParent(S)){var P=o.getTile(S),z=P.getBucket(n);if(z){var M=z.programConfigurations.get(n.id);i.useProgram("heatmap",M).draw(p,f.TRIANGLES,L.disabled,d,y,H.disabled,Xl(S.posMatrix,P,i.transform.zoom,n.paint.get("heatmap-intensity")),n.id,z.layoutVertexBuffer,z.indexBuffer,z.segments,n.paint,i.transform.zoom,M)}}}p.viewport.set([0,0,i.width,i.height])}else i.renderPass==="translucent"&&(i.context.setColorMode(i.colorModeForRenderPass()),(function(U,O){var Z=U.context,B=Z.gl,q=O.heatmapFbo;if(q){Z.activeTexture.set(B.TEXTURE0),B.bindTexture(B.TEXTURE_2D,q.colorAttachment.get()),Z.activeTexture.set(B.TEXTURE1);var X=O.colorRampTexture;X||(X=O.colorRampTexture=new u.Texture(Z,O.colorRamp,B.RGBA)),X.bind(B.LINEAR,B.CLAMP_TO_EDGE),U.useProgram("heatmapTexture").draw(Z,B.TRIANGLES,L.disabled,V.disabled,U.colorModeForRenderPass(),H.disabled,(function(Y,ne,re,oe){var he=u.create();u.ortho(he,0,Y.width,Y.height,0,0,1);var xe=Y.context.gl;return{u_matrix:he,u_world:[xe.drawingBufferWidth,xe.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:ne.paint.get("heatmap-opacity")}})(U,O),O.id,U.viewportBuffer,U.quadTriangleIndexBuffer,U.viewportSegments,O.paint,U.transform.zoom)}})(i,n))},line:function(i,o,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("line-opacity"),f=n.paint.get("line-width");if(p.constantOr(1)!==0&&f.constantOr(1)!==0)for(var d=i.depthModeForSublayer(0,L.ReadOnly),y=i.colorModeForRenderPass(),_=n.paint.get("line-dasharray"),S=n.paint.get("line-pattern"),P=S.constantOr(1),z=n.paint.get("line-gradient"),M=n.getCrossfadeParameters(),U=P?"linePattern":_?"lineSDF":z?"lineGradient":"line",O=i.context,Z=O.gl,B=!0,q=0,X=s;q<X.length;q+=1){var Y=X[q],ne=o.getTile(Y);if(!P||ne.patternsLoaded()){var re=ne.getBucket(n);if(re){var oe=re.programConfigurations.get(n.id),he=i.context.program.get(),xe=i.useProgram(U,oe),ve=B||xe.program!==he,Ae=S.constantOr(null);if(Ae&&ne.imageAtlas){var Ne=ne.imageAtlas,He=Ne.patternPositions[Ae.to.toString()],Xe=Ne.patternPositions[Ae.from.toString()];He&&Xe&&oe.setConstantPatternPositions(He,Xe)}var bt=P?Ua(i,ne,n,M):_?ec(i,ne,n,_,M):z?Ot(i,ne,n,re.lineClipsArray.length):ca(i,ne,n);if(P)O.activeTexture.set(Z.TEXTURE0),ne.imageAtlasTexture.bind(Z.LINEAR,Z.CLAMP_TO_EDGE),oe.updatePaintBuffers(M);else if(_&&(ve||i.lineAtlas.dirty))O.activeTexture.set(Z.TEXTURE0),i.lineAtlas.bind(O);else if(z){var ze=re.gradients[n.id],tt=ze.texture;if(n.gradientVersion!==ze.version){var at=256;if(n.stepInterpolant){var Qe=o.getSource().maxzoom,$e=Y.canonical.z===Qe?Math.ceil(1<<i.transform.maxZoom-Y.canonical.z):1;at=u.clamp(u.nextPowerOfTwo(re.maxLineLength/u.EXTENT*1024*$e),256,O.maxTextureSize)}ze.gradient=u.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:at,image:ze.gradient||void 0,clips:re.lineClipsArray}),ze.texture?ze.texture.update(ze.gradient):ze.texture=new u.Texture(O,ze.gradient,Z.RGBA),ze.version=n.gradientVersion,tt=ze.texture}O.activeTexture.set(Z.TEXTURE0),tt.bind(n.stepInterpolant?Z.NEAREST:Z.LINEAR,Z.CLAMP_TO_EDGE)}xe.draw(O,Z.TRIANGLES,d,i.stencilModeForClipping(Y),y,H.disabled,bt,n.id,re.layoutVertexBuffer,re.indexBuffer,re.segments,n.paint,i.transform.zoom,oe,re.layoutVertexBuffer2),B=!1}}}}},fill:function(i,o,n,s){var p=n.paint.get("fill-color"),f=n.paint.get("fill-opacity");if(f.constantOr(1)!==0){var d=i.colorModeForRenderPass(),y=n.paint.get("fill-pattern"),_=i.opaquePassEnabledForLayer()&&!y.constantOr(1)&&p.constantOr(u.Color.transparent).a===1&&f.constantOr(0)===1?"opaque":"translucent";if(i.renderPass===_){var S=i.depthModeForSublayer(1,i.renderPass==="opaque"?L.ReadWrite:L.ReadOnly);qa(i,o,n,s,S,d,!1)}if(i.renderPass==="translucent"&&n.paint.get("fill-antialias")){var P=i.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,L.ReadOnly);qa(i,o,n,s,P,d,!0)}}},"fill-extrusion":function(i,o,n,s){var p=n.paint.get("fill-extrusion-opacity");if(p!==0&&i.renderPass==="translucent"){var f=new L(i.context.gl.LEQUAL,L.ReadWrite,i.depthRangeFor3D);if(p!==1||n.paint.get("fill-extrusion-pattern").constantOr(1))Ns(i,o,n,s,f,V.disabled,W.disabled),Ns(i,o,n,s,f,i.stencilModeFor3D(),i.colorModeForRenderPass());else{var d=i.colorModeForRenderPass();Ns(i,o,n,s,f,V.disabled,d)}}},hillshade:function(i,o,n,s){if(i.renderPass==="offscreen"||i.renderPass==="translucent"){for(var p=i.context,f=i.depthModeForSublayer(0,L.ReadOnly),d=i.colorModeForRenderPass(),y=i.renderPass==="translucent"?i.stencilConfigForOverlap(s):[{},s],_=y[0],S=0,P=y[1];S<P.length;S+=1){var z=P[S],M=o.getTile(z);M.needsHillshadePrepare&&i.renderPass==="offscreen"?rc(i,M,n,f,V.disabled,d):i.renderPass==="translucent"&&Za(i,M,n,f,_[z.overscaledZ],d)}p.viewport.set([0,0,i.width,i.height])}},raster:function(i,o,n,s){if(i.renderPass==="translucent"&&n.paint.get("raster-opacity")!==0&&s.length)for(var p=i.context,f=p.gl,d=o.getSource(),y=i.useProgram("raster"),_=i.colorModeForRenderPass(),S=d instanceof Di?[{},s]:i.stencilConfigForOverlap(s),P=S[0],z=S[1],M=z[z.length-1].overscaledZ,U=!i.options.moving,O=0,Z=z;O<Z.length;O+=1){var B=Z[O],q=i.depthModeForSublayer(B.overscaledZ-M,n.paint.get("raster-opacity")===1?L.ReadWrite:L.ReadOnly,f.LESS),X=o.getTile(B),Y=i.transform.calculatePosMatrix(B.toUnwrapped(),U);X.registerFadeDuration(n.paint.get("raster-fade-duration"));var ne=o.findLoadedParent(B,0),re=Ga(X,ne,o,n,i.transform),oe=void 0,he=void 0,xe=n.paint.get("raster-resampling")==="nearest"?f.NEAREST:f.LINEAR;p.activeTexture.set(f.TEXTURE0),X.texture.bind(xe,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),p.activeTexture.set(f.TEXTURE1),ne?(ne.texture.bind(xe,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),oe=Math.pow(2,ne.tileID.overscaledZ-X.tileID.overscaledZ),he=[X.tileID.canonical.x*oe%1,X.tileID.canonical.y*oe%1]):X.texture.bind(xe,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST);var ve=tc(Y,he||[0,0],oe||1,re,n);d instanceof Di?y.draw(p,f.TRIANGLES,q,V.disabled,_,H.disabled,ve,n.id,d.boundsBuffer,i.quadTriangleIndexBuffer,d.boundsSegments):y.draw(p,f.TRIANGLES,q,P[B.overscaledZ],_,H.disabled,ve,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}},background:function(i,o,n){var s=n.paint.get("background-color"),p=n.paint.get("background-opacity");if(p!==0){var f=i.context,d=f.gl,y=i.transform,_=y.tileSize,S=n.paint.get("background-pattern");if(!i.isPatternMissing(S)){var P=!S&&s.a===1&&p===1&&i.opaquePassEnabledForLayer()?"opaque":"translucent";if(i.renderPass===P){var z=V.disabled,M=i.depthModeForSublayer(0,P==="opaque"?L.ReadWrite:L.ReadOnly),U=i.colorModeForRenderPass(),O=i.useProgram(S?"backgroundPattern":"background"),Z=y.coveringTiles({tileSize:_});S&&(f.activeTexture.set(d.TEXTURE0),i.imageManager.bind(i.context));for(var B=n.getCrossfadeParameters(),q=0,X=Z;q<X.length;q+=1){var Y=X[q],ne=i.transform.calculatePosMatrix(Y.toUnwrapped()),re=S?jo(ne,p,i,S,{tileID:Y,tileSize:_},B):ha(ne,p,s);O.draw(f,d.TRIANGLES,M,z,U,H.disabled,re,n.id,i.tileExtentBuffer,i.quadTriangleIndexBuffer,i.tileExtentSegments)}}}}},debug:function(i,o,n){for(var s=0;s<n.length;s++)ru(i,o,n[s])},custom:function(i,o,n){var s=i.context,p=n.implementation;if(i.renderPass==="offscreen"){var f=p.prerender;f&&(i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),f.call(p,s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState())}else if(i.renderPass==="translucent"){i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),s.setStencilMode(V.disabled);var d=p.renderingMode==="3d"?new L(i.context.gl.LEQUAL,L.ReadWrite,i.depthRangeFor3D):i.depthModeForSublayer(0,L.ReadOnly);s.setDepthMode(d),p.render(s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState(),s.bindFramebuffer.set(null)}}},Zt=function(i,o){this.context=new A(i),this.transform=o,this._tileTextures={},this.setup(),this.numSublayers=N.maxUnderzooming+N.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Fn,this.gpuTimers={}};Zt.prototype.resize=function(i,o){if(this.width=i*u.browser.devicePixelRatio,this.height=o*u.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,s=this.style._order;n<s.length;n+=1)this.style._layers[s[n]].resize()},Zt.prototype.setup=function(){var i=this.context,o=new u.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(u.EXTENT,0),o.emplaceBack(0,u.EXTENT),o.emplaceBack(u.EXTENT,u.EXTENT),this.tileExtentBuffer=i.createVertexBuffer(o,fr.members),this.tileExtentSegments=u.SegmentVector.simpleSegment(0,0,4,2);var n=new u.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(u.EXTENT,0),n.emplaceBack(0,u.EXTENT),n.emplaceBack(u.EXTENT,u.EXTENT),this.debugBuffer=i.createVertexBuffer(n,fr.members),this.debugSegments=u.SegmentVector.simpleSegment(0,0,4,5);var s=new u.StructArrayLayout4i8;s.emplaceBack(0,0,0,0),s.emplaceBack(u.EXTENT,0,u.EXTENT,0),s.emplaceBack(0,u.EXTENT,0,u.EXTENT),s.emplaceBack(u.EXTENT,u.EXTENT,u.EXTENT,u.EXTENT),this.rasterBoundsBuffer=i.createVertexBuffer(s,oi.members),this.rasterBoundsSegments=u.SegmentVector.simpleSegment(0,0,4,2);var p=new u.StructArrayLayout2i4;p.emplaceBack(0,0),p.emplaceBack(1,0),p.emplaceBack(0,1),p.emplaceBack(1,1),this.viewportBuffer=i.createVertexBuffer(p,fr.members),this.viewportSegments=u.SegmentVector.simpleSegment(0,0,4,2);var f=new u.StructArrayLayout1ui2;f.emplaceBack(0),f.emplaceBack(1),f.emplaceBack(3),f.emplaceBack(2),f.emplaceBack(0),this.tileBorderIndexBuffer=i.createIndexBuffer(f);var d=new u.StructArrayLayout3ui6;d.emplaceBack(0,1,2),d.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=i.createIndexBuffer(d),this.emptyTexture=new u.Texture(i,{width:1,height:1,data:new Uint8Array([0,0,0,0])},i.gl.RGBA);var y=this.context.gl;this.stencilClearMode=new V({func:y.ALWAYS,mask:0},0,255,y.ZERO,y.ZERO,y.ZERO)},Zt.prototype.clearStencil=function(){var i=this.context,o=i.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=u.create();u.ortho(n,0,this.width,this.height,0,0,1),u.scale(n,n,[o.drawingBufferWidth,o.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(i,o.TRIANGLES,L.disabled,this.stencilClearMode,W.disabled,H.disabled,xo(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Zt.prototype._renderTileClippingMasks=function(i,o){if(this.currentStencilSource!==i.source&&i.isTileClipped()&&o&&o.length){this.currentStencilSource=i.source;var n=this.context,s=n.gl;this.nextStencilID+o.length>256&&this.clearStencil(),n.setColorMode(W.disabled),n.setDepthMode(L.disabled);var p=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var f=0,d=o;f<d.length;f+=1){var y=d[f],_=this._tileClippingMaskIDs[y.key]=this.nextStencilID++;p.draw(n,s.TRIANGLES,L.disabled,new V({func:s.ALWAYS,mask:0},_,255,s.KEEP,s.KEEP,s.REPLACE),W.disabled,H.disabled,xo(y.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},Zt.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var i=this.nextStencilID++,o=this.context.gl;return new V({func:o.NOTEQUAL,mask:255},i,255,o.KEEP,o.KEEP,o.REPLACE)},Zt.prototype.stencilModeForClipping=function(i){var o=this.context.gl;return new V({func:o.EQUAL,mask:255},this._tileClippingMaskIDs[i.key],0,o.KEEP,o.KEEP,o.REPLACE)},Zt.prototype.stencilConfigForOverlap=function(i){var o,n=this.context.gl,s=i.sort((function(_,S){return S.overscaledZ-_.overscaledZ})),p=s[s.length-1].overscaledZ,f=s[0].overscaledZ-p+1;if(f>1){this.currentStencilSource=void 0,this.nextStencilID+f>256&&this.clearStencil();for(var d={},y=0;y<f;y++)d[y+p]=new V({func:n.GEQUAL,mask:255},y+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=f,[d,s]}return[(o={},o[p]=V.disabled,o),s]},Zt.prototype.colorModeForRenderPass=function(){var i=this.context.gl;return this._showOverdrawInspector?new W([i.CONSTANT_COLOR,i.ONE],new u.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?W.unblended:W.alphaBlended},Zt.prototype.depthModeForSublayer=function(i,o,n){if(!this.opaquePassEnabledForLayer())return L.disabled;var s=1-((1+this.currentLayer)*this.numSublayers+i)*this.depthEpsilon;return new L(n||this.context.gl.LEQUAL,o,[s,s])},Zt.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},Zt.prototype.render=function(i,o){var n=this;this.style=i,this.options=o,this.lineAtlas=i.lineAtlas,this.imageManager=i.imageManager,this.glyphManager=i.glyphManager,this.symbolFadeChange=i.placement.symbolFadeChange(u.browser.now()),this.imageManager.beginFrame();var s=this.style._order,p=this.style.sourceCaches;for(var f in p){var d=p[f];d.used&&d.prepare(this.context)}var y,_,S={},P={},z={};for(var M in p){var U=p[M];S[M]=U.getVisibleCoordinates(),P[M]=S[M].slice().reverse(),z[M]=U.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var O=0;O<s.length;O++)if(this.style._layers[s[O]].is3D()){this.opaquePassCutoff=O;break}this.renderPass="offscreen";for(var Z=0,B=s;Z<B.length;Z+=1){var q=this.style._layers[B[Z]];if(q.hasOffscreenPass()&&!q.isHidden(this.transform.zoom)){var X=P[q.source];(q.type==="custom"||X.length)&&this.renderLayer(this,p[q.source],q,X)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:o.showOverdrawInspector?u.Color.black:u.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=o.showOverdrawInspector,this.depthRangeFor3D=[0,1-(i._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=s.length-1;this.currentLayer>=0;this.currentLayer--){var Y=this.style._layers[s[this.currentLayer]],ne=p[Y.source],re=S[Y.source];this._renderTileClippingMasks(Y,re),this.renderLayer(this,ne,Y,re)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<s.length;this.currentLayer++){var oe=this.style._layers[s[this.currentLayer]],he=p[oe.source],xe=(oe.type==="symbol"?z:P)[oe.source];this._renderTileClippingMasks(oe,S[oe.source]),this.renderLayer(this,he,oe,xe)}this.options.showTileBoundaries&&(u.values(this.style._layers).forEach((function(ve){ve.source&&!ve.isHidden(n.transform.zoom)&&(ve.source!==(_&&_.id)&&(_=n.style.sourceCaches[ve.source]),(!y||y.getSource().maxzoom<_.getSource().maxzoom)&&(y=_))})),y&&wo.debug(this,y,y.getVisibleCoordinates())),this.options.showPadding&&(function(ve){var Ae=ve.transform.padding;Zs(ve,ve.transform.height-(Ae.top||0),3,js),Zs(ve,Ae.bottom||0,3,eu),Gs(ve,Ae.left||0,3,tu),Gs(ve,ve.transform.width-(Ae.right||0),3,Wa);var Ne=ve.transform.centerPoint;(function(He,Xe,bt,ze){da(He,Xe-1,bt-10,2,20,ze),da(He,Xe-10,bt-1,20,2,ze)})(ve,Ne.x,ve.transform.height-Ne.y,qs)})(this),this.context.setDefault()},Zt.prototype.renderLayer=function(i,o,n,s){n.isHidden(this.transform.zoom)||(n.type==="background"||n.type==="custom"||s.length)&&(this.id=n.id,this.gpuTimingStart(n),wo[n.type](i,o,n,s,this.style.placement.variableOffsets),this.gpuTimingEnd())},Zt.prototype.gpuTimingStart=function(i){if(this.options.gpuTiming){var o=this.context.extTimerQuery,n=this.gpuTimers[i.id];n||(n=this.gpuTimers[i.id]={calls:0,cpuTime:0,query:o.createQueryEXT()}),n.calls++,o.beginQueryEXT(o.TIME_ELAPSED_EXT,n.query)}},Zt.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var i=this.context.extTimerQuery;i.endQueryEXT(i.TIME_ELAPSED_EXT)}},Zt.prototype.collectGpuTimers=function(){var i=this.gpuTimers;return this.gpuTimers={},i},Zt.prototype.queryGpuTimers=function(i){var o={};for(var n in i){var s=i[n],p=this.context.extTimerQuery,f=p.getQueryObjectEXT(s.query,p.QUERY_RESULT_EXT)/1e6;p.deleteQueryEXT(s.query),o[n]=f}return o},Zt.prototype.translatePosMatrix=function(i,o,n,s,p){if(!n[0]&&!n[1])return i;var f=p?s==="map"?this.transform.angle:0:s==="viewport"?-this.transform.angle:0;if(f){var d=Math.sin(f),y=Math.cos(f);n=[n[0]*y-n[1]*d,n[0]*d+n[1]*y]}var _=[p?n[0]:qt(o,n[0],this.transform.zoom),p?n[1]:qt(o,n[1],this.transform.zoom),0],S=new Float32Array(16);return u.translate(S,i,_),S},Zt.prototype.saveTileTexture=function(i){var o=this._tileTextures[i.size[0]];o?o.push(i):this._tileTextures[i.size[0]]=[i]},Zt.prototype.getTileTexture=function(i){var o=this._tileTextures[i];return o&&o.length>0?o.pop():null},Zt.prototype.isPatternMissing=function(i){if(!i)return!1;if(!i.from||!i.to)return!0;var o=this.imageManager.getPattern(i.from.toString()),n=this.imageManager.getPattern(i.to.toString());return!o||!n},Zt.prototype.useProgram=function(i,o){this.cache=this.cache||{};var n=""+i+(o?o.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[n]||(this.cache[n]=new Nl(this.context,i,Qu[i],o,Jl[i],this._showOverdrawInspector)),this.cache[n]},Zt.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Zt.prototype.setBaseState=function(){var i=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(i.FUNC_ADD)},Zt.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=u.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new u.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},Zt.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Xa=function(i,o){this.points=i,this.planes=o};Xa.fromInvProjectionMatrix=function(i,o,n){var s=Math.pow(2,n),p=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(d){return u.transformMat4([],d,i)})).map((function(d){return u.scale$1([],d,1/d[3]/o*s)})),f=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(d){var y=u.sub([],p[d[0]],p[d[1]]),_=u.sub([],p[d[2]],p[d[1]]),S=u.normalize([],u.cross([],y,_)),P=-u.dot(S,p[d[1]]);return S.concat(P)}));return new Xa(p,f)};var So=function(i,o){this.min=i,this.max=o,this.center=u.scale$2([],u.add([],this.min,this.max),.5)};So.prototype.quadrant=function(i){for(var o=[i%2==0,i<2],n=u.clone$2(this.min),s=u.clone$2(this.max),p=0;p<o.length;p++)n[p]=o[p]?this.min[p]:this.center[p],s[p]=o[p]?this.center[p]:this.max[p];return s[2]=this.max[2],new So(n,s)},So.prototype.distanceX=function(i){return Math.max(Math.min(this.max[0],i[0]),this.min[0])-i[0]},So.prototype.distanceY=function(i){return Math.max(Math.min(this.max[1],i[1]),this.min[1])-i[1]},So.prototype.intersects=function(i){for(var o=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],n=!0,s=0;s<i.planes.length;s++){for(var p=i.planes[s],f=0,d=0;d<o.length;d++)f+=u.dot$1(p,o[d])>=0;if(f===0)return 0;f!==o.length&&(n=!1)}if(n)return 2;for(var y=0;y<3;y++){for(var _=Number.MAX_VALUE,S=-Number.MAX_VALUE,P=0;P<i.points.length;P++){var z=i.points[P][y]-this.min[y];_=Math.min(_,z),S=Math.max(S,z)}if(S<0||_>this.max[y]-this.min[y])return 0}return 1};var Gn=function(i,o,n,s){if(i===void 0&&(i=0),o===void 0&&(o=0),n===void 0&&(n=0),s===void 0&&(s=0),isNaN(i)||i<0||isNaN(o)||o<0||isNaN(n)||n<0||isNaN(s)||s<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=i,this.bottom=o,this.left=n,this.right=s};Gn.prototype.interpolate=function(i,o,n){return o.top!=null&&i.top!=null&&(this.top=u.number(i.top,o.top,n)),o.bottom!=null&&i.bottom!=null&&(this.bottom=u.number(i.bottom,o.bottom,n)),o.left!=null&&i.left!=null&&(this.left=u.number(i.left,o.left,n)),o.right!=null&&i.right!=null&&(this.right=u.number(i.right,o.right,n)),this},Gn.prototype.getCenter=function(i,o){var n=u.clamp((this.left+i-this.right)/2,0,i),s=u.clamp((this.top+o-this.bottom)/2,0,o);return new u.Point(n,s)},Gn.prototype.equals=function(i){return this.top===i.top&&this.bottom===i.bottom&&this.left===i.left&&this.right===i.right},Gn.prototype.clone=function(){return new Gn(this.top,this.bottom,this.left,this.right)},Gn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var vt=function(i,o,n,s,p){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=p===void 0||p,this._minZoom=i||0,this._maxZoom=o||22,this._minPitch=n??0,this._maxPitch=s??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new u.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Gn,this._posMatrixCache={},this._alignedPosMatrixCache={}},Vt={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};vt.prototype.clone=function(){var i=new vt(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return i.tileSize=this.tileSize,i.latRange=this.latRange,i.width=this.width,i.height=this.height,i._center=this._center,i.zoom=this.zoom,i.angle=this.angle,i._fov=this._fov,i._pitch=this._pitch,i._unmodified=this._unmodified,i._edgeInsets=this._edgeInsets.clone(),i._calcMatrices(),i},Vt.minZoom.get=function(){return this._minZoom},Vt.minZoom.set=function(i){this._minZoom!==i&&(this._minZoom=i,this.zoom=Math.max(this.zoom,i))},Vt.maxZoom.get=function(){return this._maxZoom},Vt.maxZoom.set=function(i){this._maxZoom!==i&&(this._maxZoom=i,this.zoom=Math.min(this.zoom,i))},Vt.minPitch.get=function(){return this._minPitch},Vt.minPitch.set=function(i){this._minPitch!==i&&(this._minPitch=i,this.pitch=Math.max(this.pitch,i))},Vt.maxPitch.get=function(){return this._maxPitch},Vt.maxPitch.set=function(i){this._maxPitch!==i&&(this._maxPitch=i,this.pitch=Math.min(this.pitch,i))},Vt.renderWorldCopies.get=function(){return this._renderWorldCopies},Vt.renderWorldCopies.set=function(i){i===void 0?i=!0:i===null&&(i=!1),this._renderWorldCopies=i},Vt.worldSize.get=function(){return this.tileSize*this.scale},Vt.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Vt.size.get=function(){return new u.Point(this.width,this.height)},Vt.bearing.get=function(){return-this.angle/Math.PI*180},Vt.bearing.set=function(i){var o=-u.wrap(i,-180,180)*Math.PI/180;this.angle!==o&&(this._unmodified=!1,this.angle=o,this._calcMatrices(),this.rotationMatrix=u.create$2(),u.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Vt.pitch.get=function(){return this._pitch/Math.PI*180},Vt.pitch.set=function(i){var o=u.clamp(i,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==o&&(this._unmodified=!1,this._pitch=o,this._calcMatrices())},Vt.fov.get=function(){return this._fov/Math.PI*180},Vt.fov.set=function(i){i=Math.max(.01,Math.min(60,i)),this._fov!==i&&(this._unmodified=!1,this._fov=i/180*Math.PI,this._calcMatrices())},Vt.zoom.get=function(){return this._zoom},Vt.zoom.set=function(i){var o=Math.min(Math.max(i,this.minZoom),this.maxZoom);this._zoom!==o&&(this._unmodified=!1,this._zoom=o,this.scale=this.zoomScale(o),this.tileZoom=Math.floor(o),this.zoomFraction=o-this.tileZoom,this._constrain(),this._calcMatrices())},Vt.center.get=function(){return this._center},Vt.center.set=function(i){i.lat===this._center.lat&&i.lng===this._center.lng||(this._unmodified=!1,this._center=i,this._constrain(),this._calcMatrices())},Vt.padding.get=function(){return this._edgeInsets.toJSON()},Vt.padding.set=function(i){this._edgeInsets.equals(i)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,i,1),this._calcMatrices())},Vt.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},vt.prototype.isPaddingEqual=function(i){return this._edgeInsets.equals(i)},vt.prototype.interpolatePadding=function(i,o,n){this._unmodified=!1,this._edgeInsets.interpolate(i,o,n),this._constrain(),this._calcMatrices()},vt.prototype.coveringZoomLevel=function(i){var o=(i.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/i.tileSize));return Math.max(0,o)},vt.prototype.getVisibleUnwrappedCoordinates=function(i){var o=[new u.UnwrappedTileID(0,i)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new u.Point(0,0)),s=this.pointCoordinate(new u.Point(this.width,0)),p=this.pointCoordinate(new u.Point(this.width,this.height)),f=this.pointCoordinate(new u.Point(0,this.height)),d=Math.floor(Math.min(n.x,s.x,p.x,f.x)),y=Math.floor(Math.max(n.x,s.x,p.x,f.x)),_=d-1;_<=y+1;_++)_!==0&&o.push(new u.UnwrappedTileID(_,i));return o},vt.prototype.coveringTiles=function(i){var o=this.coveringZoomLevel(i),n=o;if(i.minzoom!==void 0&&o<i.minzoom)return[];i.maxzoom!==void 0&&o>i.maxzoom&&(o=i.maxzoom);var s=u.MercatorCoordinate.fromLngLat(this.center),p=Math.pow(2,o),f=[p*s.x,p*s.y,0],d=Xa.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,o),y=i.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(y=o);var _=function(ve){return{aabb:new So([ve*p,0,0],[(ve+1)*p,p,0]),zoom:0,x:0,y:0,wrap:ve,fullyVisible:!1}},S=[],P=[],z=o,M=i.reparseOverscaled?n:o;if(this._renderWorldCopies)for(var U=1;U<=3;U++)S.push(_(-U)),S.push(_(U));for(S.push(_(0));S.length>0;){var O=S.pop(),Z=O.x,B=O.y,q=O.fullyVisible;if(!q){var X=O.aabb.intersects(d);if(X===0)continue;q=X===2}var Y=O.aabb.distanceX(f),ne=O.aabb.distanceY(f),re=Math.max(Math.abs(Y),Math.abs(ne));if(O.zoom===z||re>3+(1<<z-O.zoom)-2&&O.zoom>=y)P.push({tileID:new u.OverscaledTileID(O.zoom===z?M:O.zoom,O.wrap,O.zoom,Z,B),distanceSq:u.sqrLen([f[0]-.5-Z,f[1]-.5-B])});else for(var oe=0;oe<4;oe++){var he=(Z<<1)+oe%2,xe=(B<<1)+(oe>>1);S.push({aabb:O.aabb.quadrant(oe),zoom:O.zoom+1,x:he,y:xe,wrap:O.wrap,fullyVisible:q})}}return P.sort((function(ve,Ae){return ve.distanceSq-Ae.distanceSq})).map((function(ve){return ve.tileID}))},vt.prototype.resize=function(i,o){this.width=i,this.height=o,this.pixelsToGLUnits=[2/i,-2/o],this._constrain(),this._calcMatrices()},Vt.unmodified.get=function(){return this._unmodified},vt.prototype.zoomScale=function(i){return Math.pow(2,i)},vt.prototype.scaleZoom=function(i){return Math.log(i)/Math.LN2},vt.prototype.project=function(i){var o=u.clamp(i.lat,-this.maxValidLatitude,this.maxValidLatitude);return new u.Point(u.mercatorXfromLng(i.lng)*this.worldSize,u.mercatorYfromLat(o)*this.worldSize)},vt.prototype.unproject=function(i){return new u.MercatorCoordinate(i.x/this.worldSize,i.y/this.worldSize).toLngLat()},Vt.point.get=function(){return this.project(this.center)},vt.prototype.setLocationAtPoint=function(i,o){var n=this.pointCoordinate(o),s=this.pointCoordinate(this.centerPoint),p=this.locationCoordinate(i),f=new u.MercatorCoordinate(p.x-(n.x-s.x),p.y-(n.y-s.y));this.center=this.coordinateLocation(f),this._renderWorldCopies&&(this.center=this.center.wrap())},vt.prototype.locationPoint=function(i){return this.coordinatePoint(this.locationCoordinate(i))},vt.prototype.pointLocation=function(i){return this.coordinateLocation(this.pointCoordinate(i))},vt.prototype.locationCoordinate=function(i){return u.MercatorCoordinate.fromLngLat(i)},vt.prototype.coordinateLocation=function(i){return i.toLngLat()},vt.prototype.pointCoordinate=function(i){var o=[i.x,i.y,0,1],n=[i.x,i.y,1,1];u.transformMat4(o,o,this.pixelMatrixInverse),u.transformMat4(n,n,this.pixelMatrixInverse);var s=o[3],p=n[3],f=o[1]/s,d=n[1]/p,y=o[2]/s,_=n[2]/p,S=y===_?0:(0-y)/(_-y);return new u.MercatorCoordinate(u.number(o[0]/s,n[0]/p,S)/this.worldSize,u.number(f,d,S)/this.worldSize)},vt.prototype.coordinatePoint=function(i){var o=[i.x*this.worldSize,i.y*this.worldSize,0,1];return u.transformMat4(o,o,this.pixelMatrix),new u.Point(o[0]/o[3],o[1]/o[3])},vt.prototype.getBounds=function(){return new u.LngLatBounds().extend(this.pointLocation(new u.Point(0,0))).extend(this.pointLocation(new u.Point(this.width,0))).extend(this.pointLocation(new u.Point(this.width,this.height))).extend(this.pointLocation(new u.Point(0,this.height)))},vt.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new u.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},vt.prototype.setMaxBounds=function(i){i?(this.lngRange=[i.getWest(),i.getEast()],this.latRange=[i.getSouth(),i.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},vt.prototype.calculatePosMatrix=function(i,o){o===void 0&&(o=!1);var n=i.key,s=o?this._alignedPosMatrixCache:this._posMatrixCache;if(s[n])return s[n];var p=i.canonical,f=this.worldSize/this.zoomScale(p.z),d=p.x+Math.pow(2,p.z)*i.wrap,y=u.identity(new Float64Array(16));return u.translate(y,y,[d*f,p.y*f,0]),u.scale(y,y,[f/u.EXTENT,f/u.EXTENT,1]),u.multiply(y,o?this.alignedProjMatrix:this.projMatrix,y),s[n]=new Float32Array(y),s[n]},vt.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},vt.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var i,o,n,s,p=-90,f=90,d=-180,y=180,_=this.size,S=this._unmodified;if(this.latRange){var P=this.latRange;p=u.mercatorYfromLat(P[1])*this.worldSize,i=(f=u.mercatorYfromLat(P[0])*this.worldSize)-p<_.y?_.y/(f-p):0}if(this.lngRange){var z=this.lngRange;d=u.mercatorXfromLng(z[0])*this.worldSize,o=(y=u.mercatorXfromLng(z[1])*this.worldSize)-d<_.x?_.x/(y-d):0}var M=this.point,U=Math.max(o||0,i||0);if(U)return this.center=this.unproject(new u.Point(o?(y+d)/2:M.x,i?(f+p)/2:M.y)),this.zoom+=this.scaleZoom(U),this._unmodified=S,void(this._constraining=!1);if(this.latRange){var O=M.y,Z=_.y/2;O-Z<p&&(s=p+Z),O+Z>f&&(s=f-Z)}if(this.lngRange){var B=M.x,q=_.x/2;B-q<d&&(n=d+q),B+q>y&&(n=y-q)}n===void 0&&s===void 0||(this.center=this.unproject(new u.Point(n!==void 0?n:M.x,s!==void 0?s:M.y))),this._unmodified=S,this._constraining=!1}},vt.prototype._calcMatrices=function(){if(this.height){var i=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var o=Math.PI/2+this._pitch,n=this._fov*(.5+i.y/this.height),s=Math.sin(n)*this.cameraToCenterDistance/Math.sin(u.clamp(Math.PI-o-n,.01,Math.PI-.01)),p=this.point,f=p.x,d=p.y,y=1.01*(Math.cos(Math.PI/2-this._pitch)*s+this.cameraToCenterDistance),_=this.height/50,S=new Float64Array(16);u.perspective(S,this._fov,this.width/this.height,_,y),S[8]=2*-i.x/this.width,S[9]=2*i.y/this.height,u.scale(S,S,[1,-1,1]),u.translate(S,S,[0,0,-this.cameraToCenterDistance]),u.rotateX(S,S,this._pitch),u.rotateZ(S,S,this.angle),u.translate(S,S,[-f,-d,0]),this.mercatorMatrix=u.scale([],S,[this.worldSize,this.worldSize,this.worldSize]),u.scale(S,S,[1,1,u.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=S,this.invProjMatrix=u.invert([],this.projMatrix);var P=this.width%2/2,z=this.height%2/2,M=Math.cos(this.angle),U=Math.sin(this.angle),O=f-Math.round(f)+M*P+U*z,Z=d-Math.round(d)+M*z+U*P,B=new Float64Array(S);if(u.translate(B,B,[O>.5?O-1:O,Z>.5?Z-1:Z,0]),this.alignedProjMatrix=B,S=u.create(),u.scale(S,S,[this.width/2,-this.height/2,1]),u.translate(S,S,[1,-1,0]),this.labelPlaneMatrix=S,S=u.create(),u.scale(S,S,[1,-1,1]),u.translate(S,S,[-1,-1,0]),u.scale(S,S,[2/this.width,2/this.height,1]),this.glCoordMatrix=S,this.pixelMatrix=u.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(S=u.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=S,this._posMatrixCache={},this._alignedPosMatrixCache={}}},vt.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var i=this.pointCoordinate(new u.Point(0,0)),o=[i.x*this.worldSize,i.y*this.worldSize,0,1];return u.transformMat4(o,o,this.pixelMatrix)[3]/this.cameraToCenterDistance},vt.prototype.getCameraPoint=function(){var i=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new u.Point(0,i))},vt.prototype.getCameraQueryGeometry=function(i){var o=this.getCameraPoint();if(i.length===1)return[i[0],o];for(var n=o.x,s=o.y,p=o.x,f=o.y,d=0,y=i;d<y.length;d+=1){var _=y[d];n=Math.min(n,_.x),s=Math.min(s,_.y),p=Math.max(p,_.x),f=Math.max(f,_.y)}return[new u.Point(n,s),new u.Point(p,s),new u.Point(p,f),new u.Point(n,f),new u.Point(n,s)]},Object.defineProperties(vt.prototype,Vt);var Ci=function(i){var o,n,s,p;this._hashName=i&&encodeURIComponent(i),u.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(o=this._updateHashUnthrottled.bind(this),n=!1,s=null,p=function(){s=null,n&&(o(),s=setTimeout(p,300),n=!1)},function(){return n=!0,s||p(),s})};Ci.prototype.addTo=function(i){return this._map=i,u.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Ci.prototype.remove=function(){return u.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Ci.prototype.getHashString=function(i){var o=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,s=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),p=Math.pow(10,s),f=Math.round(o.lng*p)/p,d=Math.round(o.lat*p)/p,y=this._map.getBearing(),_=this._map.getPitch(),S="";if(S+=i?"/"+f+"/"+d+"/"+n:n+"/"+d+"/"+f,(y||_)&&(S+="/"+Math.round(10*y)/10),_&&(S+="/"+Math.round(_)),this._hashName){var P=this._hashName,z=!1,M=u.window.location.hash.slice(1).split("&").map((function(U){var O=U.split("=")[0];return O===P?(z=!0,O+"="+S):U})).filter((function(U){return U}));return z||M.push(P+"="+S),"#"+M.join("&")}return"#"+S},Ci.prototype._getCurrentHash=function(){var i,o=this,n=u.window.location.hash.replace("#","");return this._hashName?(n.split("&").map((function(s){return s.split("=")})).forEach((function(s){s[0]===o._hashName&&(i=s)})),(i&&i[1]||"").split("/")):n.split("/")},Ci.prototype._onHashChange=function(){var i=this._getCurrentHash();if(i.length>=3&&!i.some((function(n){return isNaN(n)}))){var o=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(i[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+i[2],+i[1]],zoom:+i[0],bearing:o,pitch:+(i[4]||0)}),!0}return!1},Ci.prototype._updateHashUnthrottled=function(){var i=u.window.location.href.replace(/(#.+)?$/,this.getHashString());try{u.window.history.replaceState(u.window.history.state,null,i)}catch{}};var ma={linearity:.3,easing:u.bezier(0,0,.3,1)},Zo=u.extend({deceleration:2500,maxSpeed:1400},ma),ya=u.extend({deceleration:20,maxSpeed:1400},ma),ic=u.extend({deceleration:1e3,maxSpeed:360},ma),nc=u.extend({deceleration:1e3,maxSpeed:90},ma),ga=function(i){this._map=i,this.clear()};function va(i,o){(!i.duration||i.duration<o.duration)&&(i.duration=o.duration,i.easing=o.easing)}function wn(i,o,n){var s=n.maxSpeed,p=n.linearity,f=n.deceleration,d=u.clamp(i*p/(o/1e3),-s,s),y=Math.abs(d)/(f*p);return{easing:n.easing,duration:1e3*y,amount:d*(y/2)}}ga.prototype.clear=function(){this._inertiaBuffer=[]},ga.prototype.record=function(i){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.browser.now(),settings:i})},ga.prototype._drainInertiaBuffer=function(){for(var i=this._inertiaBuffer,o=u.browser.now();i.length>0&&o-i[0].time>160;)i.shift()},ga.prototype._onMoveEnd=function(i){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var o={zoom:0,bearing:0,pitch:0,pan:new u.Point(0,0),pinchAround:void 0,around:void 0},n=0,s=this._inertiaBuffer;n<s.length;n+=1){var p=s[n].settings;o.zoom+=p.zoomDelta||0,o.bearing+=p.bearingDelta||0,o.pitch+=p.pitchDelta||0,p.panDelta&&o.pan._add(p.panDelta),p.around&&(o.around=p.around),p.pinchAround&&(o.pinchAround=p.pinchAround)}var f=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,d={};if(o.pan.mag()){var y=wn(o.pan.mag(),f,u.extend({},Zo,i||{}));d.offset=o.pan.mult(y.amount/o.pan.mag()),d.center=this._map.transform.center,va(d,y)}if(o.zoom){var _=wn(o.zoom,f,ya);d.zoom=this._map.transform.zoom+_.amount,va(d,_)}if(o.bearing){var S=wn(o.bearing,f,ic);d.bearing=this._map.transform.bearing+u.clamp(S.amount,-179,179),va(d,S)}if(o.pitch){var P=wn(o.pitch,f,nc);d.pitch=this._map.transform.pitch+P.amount,va(d,P)}if(d.zoom||d.bearing){var z=o.pinchAround===void 0?o.around:o.pinchAround;d.around=z?this._map.unproject(z):this._map.getCenter()}return this.clear(),u.extend(d,{noMoveStart:!0})}};var _r=(function(i){function o(s,p,f,d){d===void 0&&(d={});var y=pe.mousePos(p.getCanvasContainer(),f),_=p.unproject(y);i.call(this,s,u.extend({point:y,lngLat:_,originalEvent:f},d)),this._defaultPrevented=!1,this.target=p}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o})(u.Event),_a=(function(i){function o(s,p,f){var d=s==="touchend"?f.changedTouches:f.touches,y=pe.touchPos(p.getCanvasContainer(),d),_=y.map((function(z){return p.unproject(z)})),S=y.reduce((function(z,M,U,O){return z.add(M.div(O.length))}),new u.Point(0,0)),P=p.unproject(S);i.call(this,s,{points:y,point:S,lngLats:_,lngLat:P,originalEvent:f}),this._defaultPrevented=!1}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o})(u.Event),iu=(function(i){function o(s,p,f){i.call(this,s,{originalEvent:f}),this._defaultPrevented=!1}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o})(u.Event),dr=function(i,o){this._map=i,this._clickTolerance=o.clickTolerance};dr.prototype.reset=function(){delete this._mousedownPos},dr.prototype.wheel=function(i){return this._firePreventable(new iu(i.type,this._map,i))},dr.prototype.mousedown=function(i,o){return this._mousedownPos=o,this._firePreventable(new _r(i.type,this._map,i))},dr.prototype.mouseup=function(i){this._map.fire(new _r(i.type,this._map,i))},dr.prototype.click=function(i,o){this._mousedownPos&&this._mousedownPos.dist(o)>=this._clickTolerance||this._map.fire(new _r(i.type,this._map,i))},dr.prototype.dblclick=function(i){return this._firePreventable(new _r(i.type,this._map,i))},dr.prototype.mouseover=function(i){this._map.fire(new _r(i.type,this._map,i))},dr.prototype.mouseout=function(i){this._map.fire(new _r(i.type,this._map,i))},dr.prototype.touchstart=function(i){return this._firePreventable(new _a(i.type,this._map,i))},dr.prototype.touchmove=function(i){this._map.fire(new _a(i.type,this._map,i))},dr.prototype.touchend=function(i){this._map.fire(new _a(i.type,this._map,i))},dr.prototype.touchcancel=function(i){this._map.fire(new _a(i.type,this._map,i))},dr.prototype._firePreventable=function(i){if(this._map.fire(i),i.defaultPrevented)return{}},dr.prototype.isEnabled=function(){return!0},dr.prototype.isActive=function(){return!1},dr.prototype.enable=function(){},dr.prototype.disable=function(){};var De=function(i){this._map=i};De.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},De.prototype.mousemove=function(i){this._map.fire(new _r(i.type,this._map,i))},De.prototype.mousedown=function(){this._delayContextMenu=!0},De.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new _r("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},De.prototype.contextmenu=function(i){this._delayContextMenu?this._contextMenuEvent=i:this._map.fire(new _r(i.type,this._map,i)),this._map.listens("contextmenu")&&i.preventDefault()},De.prototype.isEnabled=function(){return!0},De.prototype.isActive=function(){return!1},De.prototype.enable=function(){},De.prototype.disable=function(){};var yi=function(i,o){this._map=i,this._el=i.getCanvasContainer(),this._container=i.getContainer(),this._clickTolerance=o.clickTolerance||1};function Ha(i,o){for(var n={},s=0;s<i.length;s++)n[i[s].identifier]=o[s];return n}yi.prototype.isEnabled=function(){return!!this._enabled},yi.prototype.isActive=function(){return!!this._active},yi.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},yi.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},yi.prototype.mousedown=function(i,o){this.isEnabled()&&i.shiftKey&&i.button===0&&(pe.disableDrag(),this._startPos=this._lastPos=o,this._active=!0)},yi.prototype.mousemoveWindow=function(i,o){if(this._active){var n=o;if(!(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)){var s=this._startPos;this._lastPos=n,this._box||(this._box=pe.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",i));var p=Math.min(s.x,n.x),f=Math.max(s.x,n.x),d=Math.min(s.y,n.y),y=Math.max(s.y,n.y);pe.setTransform(this._box,"translate("+p+"px,"+d+"px)"),this._box.style.width=f-p+"px",this._box.style.height=y-d+"px"}}},yi.prototype.mouseupWindow=function(i,o){var n=this;if(this._active&&i.button===0){var s=this._startPos,p=o;if(this.reset(),pe.suppressClick(),s.x!==p.x||s.y!==p.y)return this._map.fire(new u.Event("boxzoomend",{originalEvent:i})),{cameraAnimation:function(f){return f.fitScreenCoordinates(s,p,n._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",i)}},yi.prototype.keydown=function(i){this._active&&i.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",i))},yi.prototype.blur=function(){this.reset()},yi.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(pe.remove(this._box),this._box=null),pe.enableDrag(),delete this._startPos,delete this._lastPos},yi.prototype._fireEvent=function(i,o){return this._map.fire(new u.Event(i,{originalEvent:o}))};var Go=function(i){this.reset(),this.numTouches=i.numTouches};Go.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Go.prototype.touchstart=function(i,o,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=i.timeStamp),n.length===this.numTouches&&(this.centroid=(function(s){for(var p=new u.Point(0,0),f=0,d=s;f<d.length;f+=1)p._add(d[f]);return p.div(s.length)})(o),this.touches=Ha(n,o)))},Go.prototype.touchmove=function(i,o,n){if(!this.aborted&&this.centroid){var s=Ha(n,o);for(var p in this.touches){var f=s[p];(!f||f.dist(this.touches[p])>30)&&(this.aborted=!0)}}},Go.prototype.touchend=function(i,o,n){if((!this.centroid||i.timeStamp-this.startTime>500)&&(this.aborted=!0),n.length===0){var s=!this.aborted&&this.centroid;if(this.reset(),s)return s}};var Ki=function(i){this.singleTap=new Go(i),this.numTaps=i.numTaps,this.reset()};Ki.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Ki.prototype.touchstart=function(i,o,n){this.singleTap.touchstart(i,o,n)},Ki.prototype.touchmove=function(i,o,n){this.singleTap.touchmove(i,o,n)},Ki.prototype.touchend=function(i,o,n){var s=this.singleTap.touchend(i,o,n);if(s){var p=i.timeStamp-this.lastTime<500,f=!this.lastTap||this.lastTap.dist(s)<30;if(p&&f||this.reset(),this.count++,this.lastTime=i.timeStamp,this.lastTap=s,this.count===this.numTaps)return this.reset(),s}};var gi=function(){this._zoomIn=new Ki({numTouches:1,numTaps:2}),this._zoomOut=new Ki({numTouches:2,numTaps:1}),this.reset()};gi.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},gi.prototype.touchstart=function(i,o,n){this._zoomIn.touchstart(i,o,n),this._zoomOut.touchstart(i,o,n)},gi.prototype.touchmove=function(i,o,n){this._zoomIn.touchmove(i,o,n),this._zoomOut.touchmove(i,o,n)},gi.prototype.touchend=function(i,o,n){var s=this,p=this._zoomIn.touchend(i,o,n),f=this._zoomOut.touchend(i,o,n);return p?(this._active=!0,i.preventDefault(),setTimeout((function(){return s.reset()}),0),{cameraAnimation:function(d){return d.easeTo({duration:300,zoom:d.getZoom()+1,around:d.unproject(p)},{originalEvent:i})}}):f?(this._active=!0,i.preventDefault(),setTimeout((function(){return s.reset()}),0),{cameraAnimation:function(d){return d.easeTo({duration:300,zoom:d.getZoom()-1,around:d.unproject(f)},{originalEvent:i})}}):void 0},gi.prototype.touchcancel=function(){this.reset()},gi.prototype.enable=function(){this._enabled=!0},gi.prototype.disable=function(){this._enabled=!1,this.reset()},gi.prototype.isEnabled=function(){return this._enabled},gi.prototype.isActive=function(){return this._active};var Ws={0:1,2:2},Se=function(i){this.reset(),this._clickTolerance=i.clickTolerance||1};Se.prototype.blur=function(){this.reset()},Se.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Se.prototype._correctButton=function(i,o){return!1},Se.prototype._move=function(i,o){return{}},Se.prototype.mousedown=function(i,o){if(!this._lastPoint){var n=pe.mouseButton(i);this._correctButton(i,n)&&(this._lastPoint=o,this._eventButton=n)}},Se.prototype.mousemoveWindow=function(i,o){var n=this._lastPoint;if(n){if(i.preventDefault(),(function(s,p){var f=Ws[p];return s.buttons===void 0||(s.buttons&f)!==f})(i,this._eventButton))this.reset();else if(this._moved||!(o.dist(n)<this._clickTolerance))return this._moved=!0,this._lastPoint=o,this._move(n,o)}},Se.prototype.mouseupWindow=function(i){this._lastPoint&&pe.mouseButton(i)===this._eventButton&&(this._moved&&pe.suppressClick(),this.reset())},Se.prototype.enable=function(){this._enabled=!0},Se.prototype.disable=function(){this._enabled=!1,this.reset()},Se.prototype.isEnabled=function(){return this._enabled},Se.prototype.isActive=function(){return this._active};var Xs=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.mousedown=function(n,s){i.prototype.mousedown.call(this,n,s),this._lastPoint&&(this._active=!0)},o.prototype._correctButton=function(n,s){return s===0&&!n.ctrlKey},o.prototype._move=function(n,s){return{around:s,panDelta:s.sub(n)}},o})(Se),Ka=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},o.prototype._move=function(n,s){var p=.8*(s.x-n.x);if(p)return this._active=!0,{bearingDelta:p}},o.prototype.contextmenu=function(n){n.preventDefault()},o})(Se),Hs=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},o.prototype._move=function(n,s){var p=-.5*(s.y-n.y);if(p)return this._active=!0,{pitchDelta:p}},o.prototype.contextmenu=function(n){n.preventDefault()},o})(Se),Fi=function(i){this._minTouches=1,this._clickTolerance=i.clickTolerance||1,this.reset()};Fi.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new u.Point(0,0)},Fi.prototype.touchstart=function(i,o,n){return this._calculateTransform(i,o,n)},Fi.prototype.touchmove=function(i,o,n){if(this._active&&!(n.length<this._minTouches))return i.preventDefault(),this._calculateTransform(i,o,n)},Fi.prototype.touchend=function(i,o,n){this._calculateTransform(i,o,n),this._active&&n.length<this._minTouches&&this.reset()},Fi.prototype.touchcancel=function(){this.reset()},Fi.prototype._calculateTransform=function(i,o,n){n.length>0&&(this._active=!0);var s=Ha(n,o),p=new u.Point(0,0),f=new u.Point(0,0),d=0;for(var y in s){var _=s[y],S=this._touches[y];S&&(p._add(_),f._add(_.sub(S)),d++,s[y]=_)}if(this._touches=s,!(d<this._minTouches)&&f.mag()){var P=f.div(d);if(this._sum._add(P),!(this._sum.mag()<this._clickTolerance))return{around:p.div(d),panDelta:P}}},Fi.prototype.enable=function(){this._enabled=!0},Fi.prototype.disable=function(){this._enabled=!1,this.reset()},Fi.prototype.isEnabled=function(){return this._enabled},Fi.prototype.isActive=function(){return this._active};var vi=function(){this.reset()};function Ja(i,o,n){for(var s=0;s<i.length;s++)if(i[s].identifier===n)return o[s]}function Ya(i,o){return Math.log(i/o)/Math.LN2}vi.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},vi.prototype._start=function(i){},vi.prototype._move=function(i,o,n){return{}},vi.prototype.touchstart=function(i,o,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([o[0],o[1]]))},vi.prototype.touchmove=function(i,o,n){if(this._firstTwoTouches){i.preventDefault();var s=this._firstTwoTouches,p=s[1],f=Ja(n,o,s[0]),d=Ja(n,o,p);if(f&&d){var y=this._aroundCenter?null:f.add(d).div(2);return this._move([f,d],y,i)}}},vi.prototype.touchend=function(i,o,n){if(this._firstTwoTouches){var s=this._firstTwoTouches,p=s[1],f=Ja(n,o,s[0]),d=Ja(n,o,p);f&&d||(this._active&&pe.suppressClick(),this.reset())}},vi.prototype.touchcancel=function(){this.reset()},vi.prototype.enable=function(i){this._enabled=!0,this._aroundCenter=!!i&&i.around==="center"},vi.prototype.disable=function(){this._enabled=!1,this.reset()},vi.prototype.isEnabled=function(){return this._enabled},vi.prototype.isActive=function(){return this._active};var _i=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),delete this._distance,delete this._startDistance},o.prototype._start=function(n){this._startDistance=this._distance=n[0].dist(n[1])},o.prototype._move=function(n,s){var p=this._distance;if(this._distance=n[0].dist(n[1]),this._active||!(Math.abs(Ya(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Ya(this._distance,p),pinchAround:s}},o})(vi);function Sn(i,o){return 180*i.angleWith(o)/Math.PI}var nu=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},o.prototype._start=function(n){this._startVector=this._vector=n[0].sub(n[1]),this._minDiameter=n[0].dist(n[1])},o.prototype._move=function(n,s){var p=this._vector;if(this._vector=n[0].sub(n[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Sn(this._vector,p),pinchAround:s}},o.prototype._isBelowThreshold=function(n){this._minDiameter=Math.min(this._minDiameter,n.mag());var s=25/(Math.PI*this._minDiameter)*360,p=Sn(n,this._startVector);return Math.abs(p)<s},o})(vi);function xa(i){return Math.abs(i.y)>Math.abs(i.x)}var Ks=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},o.prototype._start=function(n){this._lastPoints=n,xa(n[0].sub(n[1]))&&(this._valid=!1)},o.prototype._move=function(n,s,p){var f=n[0].sub(this._lastPoints[0]),d=n[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(f,d,p.timeStamp),this._valid)return this._lastPoints=n,this._active=!0,{pitchDelta:(f.y+d.y)/2*-.5}},o.prototype.gestureBeginsVertically=function(n,s,p){if(this._valid!==void 0)return this._valid;var f=n.mag()>=2,d=s.mag()>=2;if(f||d){if(!f||!d)return this._firstMove===void 0&&(this._firstMove=p),p-this._firstMove<100&&void 0;var y=n.y>0==s.y>0;return xa(n)&&xa(s)&&y}},o})(vi),Js={panStep:100,bearingStep:15,pitchStep:10},Ji=function(){var i=Js;this._panStep=i.panStep,this._bearingStep=i.bearingStep,this._pitchStep=i.pitchStep,this._rotationDisabled=!1};function Pi(i){return i*(2-i)}Ji.prototype.blur=function(){this.reset()},Ji.prototype.reset=function(){this._active=!1},Ji.prototype.keydown=function(i){var o=this;if(!(i.altKey||i.ctrlKey||i.metaKey)){var n=0,s=0,p=0,f=0,d=0;switch(i.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:i.shiftKey?s=-1:(i.preventDefault(),f=-1);break;case 39:i.shiftKey?s=1:(i.preventDefault(),f=1);break;case 38:i.shiftKey?p=1:(i.preventDefault(),d=-1);break;case 40:i.shiftKey?p=-1:(i.preventDefault(),d=1);break;default:return}return this._rotationDisabled&&(s=0,p=0),{cameraAnimation:function(y){var _=y.getZoom();y.easeTo({duration:300,easeId:"keyboardHandler",easing:Pi,zoom:n?Math.round(_)+n*(i.shiftKey?2:1):_,bearing:y.getBearing()+s*o._bearingStep,pitch:y.getPitch()+p*o._pitchStep,offset:[-f*o._panStep,-d*o._panStep],center:y.getCenter()},{originalEvent:i})}}}},Ji.prototype.enable=function(){this._enabled=!0},Ji.prototype.disable=function(){this._enabled=!1,this.reset()},Ji.prototype.isEnabled=function(){return this._enabled},Ji.prototype.isActive=function(){return this._active},Ji.prototype.disableRotation=function(){this._rotationDisabled=!0},Ji.prototype.enableRotation=function(){this._rotationDisabled=!1};var ht=function(i,o){this._map=i,this._el=i.getCanvasContainer(),this._handler=o,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,u.bindAll(["_onTimeout"],this)};ht.prototype.setZoomRate=function(i){this._defaultZoomRate=i},ht.prototype.setWheelZoomRate=function(i){this._wheelZoomRate=i},ht.prototype.isEnabled=function(){return!!this._enabled},ht.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},ht.prototype.isZooming=function(){return!!this._zooming},ht.prototype.enable=function(i){this.isEnabled()||(this._enabled=!0,this._aroundCenter=i&&i.around==="center")},ht.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ht.prototype.wheel=function(i){if(this.isEnabled()){var o=i.deltaMode===u.window.WheelEvent.DOM_DELTA_LINE?40*i.deltaY:i.deltaY,n=u.browser.now(),s=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,o!==0&&o%4.000244140625==0?this._type="wheel":o!==0&&Math.abs(o)<4?this._type="trackpad":s>400?(this._type=null,this._lastValue=o,this._timeout=setTimeout(this._onTimeout,40,i)):this._type||(this._type=Math.abs(s*o)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,o+=this._lastValue)),i.shiftKey&&o&&(o/=4),this._type&&(this._lastWheelEvent=i,this._delta-=o,this._active||this._start(i)),i.preventDefault()}},ht.prototype._onTimeout=function(i){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)},ht.prototype._start=function(i){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var o=pe.mousePos(this._el,i);this._around=u.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(o)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},ht.prototype.renderFrame=function(){var i=this;if(this._frameId&&(this._frameId=null,this.isActive())){var o=this._map.transform;if(this._delta!==0){var n=this._type==="wheel"&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,s=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&s!==0&&(s=1/s);var p=typeof this._targetZoom=="number"?o.zoomScale(this._targetZoom):o.scale;this._targetZoom=Math.min(o.maxZoom,Math.max(o.minZoom,o.scaleZoom(p*s))),this._type==="wheel"&&(this._startZoom=o.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var f,d=typeof this._targetZoom=="number"?this._targetZoom:o.zoom,y=this._startZoom,_=this._easing,S=!1;if(this._type==="wheel"&&y&&_){var P=Math.min((u.browser.now()-this._lastWheelEventTime)/200,1),z=_(P);f=u.number(y,d,z),P<1?this._frameId||(this._frameId=!0):S=!0}else f=d,S=!0;return this._active=!0,S&&(this._active=!1,this._finishTimeout=setTimeout((function(){i._zooming=!1,i._handler._triggerRenderFrame(),delete i._targetZoom,delete i._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!S,zoomDelta:f-o.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},ht.prototype._smoothOutEasing=function(i){var o=u.ease;if(this._prevEase){var n=this._prevEase,s=(u.browser.now()-n.start)/n.duration,p=n.easing(s+.01)-n.easing(s),f=.27/Math.sqrt(p*p+1e-4)*.01,d=Math.sqrt(.0729-f*f);o=u.bezier(f,d,.25,1)}return this._prevEase={start:u.browser.now(),duration:i,easing:o},o},ht.prototype.blur=function(){this.reset()},ht.prototype.reset=function(){this._active=!1};var un=function(i,o){this._clickZoom=i,this._tapZoom=o};un.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},un.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},un.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},un.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var Oi=function(){this.reset()};Oi.prototype.reset=function(){this._active=!1},Oi.prototype.blur=function(){this.reset()},Oi.prototype.dblclick=function(i,o){return i.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(i.shiftKey?-1:1),around:n.unproject(o)},{originalEvent:i})}}},Oi.prototype.enable=function(){this._enabled=!0},Oi.prototype.disable=function(){this._enabled=!1,this.reset()},Oi.prototype.isEnabled=function(){return this._enabled},Oi.prototype.isActive=function(){return this._active};var qr=function(){this._tap=new Ki({numTouches:1,numTaps:1}),this.reset()};qr.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},qr.prototype.touchstart=function(i,o,n){this._swipePoint||(this._tapTime&&i.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=o[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(i,o,n))},qr.prototype.touchmove=function(i,o,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;var s=o[0],p=s.y-this._swipePoint.y;return this._swipePoint=s,i.preventDefault(),this._active=!0,{zoomDelta:p/128}}}else this._tap.touchmove(i,o,n)},qr.prototype.touchend=function(i,o,n){this._tapTime?this._swipePoint&&n.length===0&&this.reset():this._tap.touchend(i,o,n)&&(this._tapTime=i.timeStamp)},qr.prototype.touchcancel=function(){this.reset()},qr.prototype.enable=function(){this._enabled=!0},qr.prototype.disable=function(){this._enabled=!1,this.reset()},qr.prototype.isEnabled=function(){return this._enabled},qr.prototype.isActive=function(){return this._active};var Io=function(i,o,n){this._el=i,this._mousePan=o,this._touchPan=n};Io.prototype.enable=function(i){this._inertiaOptions=i||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Io.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Io.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Io.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Wn=function(i,o,n){this._pitchWithRotate=i.pitchWithRotate,this._mouseRotate=o,this._mousePitch=n};Wn.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Wn.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Wn.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Wn.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Yi=function(i,o,n,s){this._el=i,this._touchZoom=o,this._touchRotate=n,this._tapDragZoom=s,this._rotationDisabled=!1,this._enabled=!0};Yi.prototype.enable=function(i){this._touchZoom.enable(i),this._rotationDisabled||this._touchRotate.enable(i),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Yi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Yi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Yi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Yi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Yi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Qr=function(i){return i.zoom||i.drag||i.pitch||i.rotate},ba=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o})(u.Event);function Ue(i){return i.panDelta&&i.panDelta.mag()||i.zoomDelta||i.bearingDelta||i.pitchDelta}var Re=function(i,o){this._map=i,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ga(i),this._bearingSnap=o.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(o),u.bindAll(["handleEvent","handleWindowEvent"],this);var n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[u.window.document,"mousemove",{capture:!0}],[u.window.document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[u.window,"blur",void 0]];for(var s=0,p=this._listeners;s<p.length;s+=1){var f=p[s],d=f[0];pe.addEventListener(d,f[1],d===u.window.document?this.handleWindowEvent:this.handleEvent,f[2])}};Re.prototype.destroy=function(){for(var i=0,o=this._listeners;i<o.length;i+=1){var n=o[i],s=n[0];pe.removeEventListener(s,n[1],s===u.window.document?this.handleWindowEvent:this.handleEvent,n[2])}},Re.prototype._addDefaultHandlers=function(i){var o=this._map,n=o.getCanvasContainer();this._add("mapEvent",new dr(o,i));var s=o.boxZoom=new yi(o,i);this._add("boxZoom",s);var p=new gi,f=new Oi;o.doubleClickZoom=new un(f,p),this._add("tapZoom",p),this._add("clickZoom",f);var d=new qr;this._add("tapDragZoom",d);var y=o.touchPitch=new Ks;this._add("touchPitch",y);var _=new Ka(i),S=new Hs(i);o.dragRotate=new Wn(i,_,S),this._add("mouseRotate",_,["mousePitch"]),this._add("mousePitch",S,["mouseRotate"]);var P=new Xs(i),z=new Fi(i);o.dragPan=new Io(n,P,z),this._add("mousePan",P),this._add("touchPan",z,["touchZoom","touchRotate"]);var M=new nu,U=new _i;o.touchZoomRotate=new Yi(n,U,M,d),this._add("touchRotate",M,["touchPan","touchZoom"]),this._add("touchZoom",U,["touchPan","touchRotate"]);var O=o.scrollZoom=new ht(o,this);this._add("scrollZoom",O,["mousePan"]);var Z=o.keyboard=new Ji;this._add("keyboard",Z),this._add("blockableMapEvent",new De(o));for(var B=0,q=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];B<q.length;B+=1){var X=q[B];i.interactive&&i[X]&&o[X].enable(i[X])}},Re.prototype._add=function(i,o,n){this._handlers.push({handlerName:i,handler:o,allowed:n}),this._handlersById[i]=o},Re.prototype.stop=function(i){if(!this._updatingCamera){for(var o=0,n=this._handlers;o<n.length;o+=1)n[o].handler.reset();this._inertia.clear(),this._fireEvents({},{},i),this._changes=[]}},Re.prototype.isActive=function(){for(var i=0,o=this._handlers;i<o.length;i+=1)if(o[i].handler.isActive())return!0;return!1},Re.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},Re.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},Re.prototype.isMoving=function(){return!!Qr(this._eventsInProgress)||this.isZooming()},Re.prototype._blockedByActive=function(i,o,n){for(var s in i)if(s!==n&&(!o||o.indexOf(s)<0))return!0;return!1},Re.prototype.handleWindowEvent=function(i){this.handleEvent(i,i.type+"Window")},Re.prototype._getMapTouches=function(i){for(var o=[],n=0,s=i;n<s.length;n+=1){var p=s[n];this._el.contains(p.target)&&o.push(p)}return o},Re.prototype.handleEvent=function(i,o){this._updatingCamera=!0;for(var n=i.type==="renderFrame"?void 0:i,s={needsRenderFrame:!1},p={},f={},d=i.touches?this._getMapTouches(i.touches):void 0,y=d?pe.touchPos(this._el,d):pe.mousePos(this._el,i),_=0,S=this._handlers;_<S.length;_+=1){var P=S[_],z=P.handlerName,M=P.handler,U=P.allowed;if(M.isEnabled()){var O=void 0;this._blockedByActive(f,U,z)?M.reset():M[o||i.type]&&(O=M[o||i.type](i,y,d),this.mergeHandlerResult(s,p,O,z,n),O&&O.needsRenderFrame&&this._triggerRenderFrame()),(O||M.isActive())&&(f[z]=M)}}var Z={};for(var B in this._previousActiveHandlers)f[B]||(Z[B]=n);this._previousActiveHandlers=f,(Object.keys(Z).length||Ue(s))&&(this._changes.push([s,p,Z]),this._triggerRenderFrame()),(Object.keys(f).length||Ue(s))&&this._map._stop(!0),this._updatingCamera=!1;var q=s.cameraAnimation;q&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],q(this._map))},Re.prototype.mergeHandlerResult=function(i,o,n,s,p){if(n){u.extend(i,n);var f={handlerName:s,originalEvent:n.originalEvent||p};n.zoomDelta!==void 0&&(o.zoom=f),n.panDelta!==void 0&&(o.drag=f),n.pitchDelta!==void 0&&(o.pitch=f),n.bearingDelta!==void 0&&(o.rotate=f)}},Re.prototype._applyChanges=function(){for(var i={},o={},n={},s=0,p=this._changes;s<p.length;s+=1){var f=p[s],d=f[0],y=f[1],_=f[2];d.panDelta&&(i.panDelta=(i.panDelta||new u.Point(0,0))._add(d.panDelta)),d.zoomDelta&&(i.zoomDelta=(i.zoomDelta||0)+d.zoomDelta),d.bearingDelta&&(i.bearingDelta=(i.bearingDelta||0)+d.bearingDelta),d.pitchDelta&&(i.pitchDelta=(i.pitchDelta||0)+d.pitchDelta),d.around!==void 0&&(i.around=d.around),d.pinchAround!==void 0&&(i.pinchAround=d.pinchAround),d.noInertia&&(i.noInertia=d.noInertia),u.extend(o,y),u.extend(n,_)}this._updateMapTransform(i,o,n),this._changes=[]},Re.prototype._updateMapTransform=function(i,o,n){var s=this._map,p=s.transform;if(!Ue(i))return this._fireEvents(o,n,!0);var f=i.panDelta,d=i.zoomDelta,y=i.bearingDelta,_=i.pitchDelta,S=i.around,P=i.pinchAround;P!==void 0&&(S=P),s._stop(!0),S=S||s.transform.centerPoint;var z=p.pointLocation(f?S.sub(f):S);y&&(p.bearing+=y),_&&(p.pitch+=_),d&&(p.zoom+=d),p.setLocationAtPoint(z,S),this._map._update(),i.noInertia||this._inertia.record(i),this._fireEvents(o,n,!0)},Re.prototype._fireEvents=function(i,o,n){var s=this,p=Qr(this._eventsInProgress),f=Qr(i),d={};for(var y in i)this._eventsInProgress[y]||(d[y+"start"]=i[y].originalEvent),this._eventsInProgress[y]=i[y];for(var _ in!p&&f&&this._fireEvent("movestart",f.originalEvent),d)this._fireEvent(_,d[_]);for(var S in f&&this._fireEvent("move",f.originalEvent),i)this._fireEvent(S,i[S].originalEvent);var P,z={};for(var M in this._eventsInProgress){var U=this._eventsInProgress[M],O=U.handlerName,Z=U.originalEvent;this._handlersById[O].isActive()||(delete this._eventsInProgress[M],z[M+"end"]=P=o[O]||Z)}for(var B in z)this._fireEvent(B,z[B]);var q=Qr(this._eventsInProgress);if(n&&(p||f)&&!q){this._updatingCamera=!0;var X=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Y=function(ne){return ne!==0&&-s._bearingSnap<ne&&ne<s._bearingSnap};X?(Y(X.bearing||this._map.getBearing())&&(X.bearing=0),this._map.easeTo(X,{originalEvent:P})):(this._map.fire(new u.Event("moveend",{originalEvent:P})),Y(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},Re.prototype._fireEvent=function(i,o){this._map.fire(new u.Event(i,o?{originalEvent:o}:{}))},Re.prototype._requestFrame=function(){var i=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(o){delete i._frameId,i.handleEvent(new ba("renderFrame",{timeStamp:o})),i._applyChanges()}))},Re.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var $a=(function(i){function o(n,s){i.call(this),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=s.bearingSnap,u.bindAll(["_renderFrameCallback"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getCenter=function(){return new u.LngLat(this.transform.center.lng,this.transform.center.lat)},o.prototype.setCenter=function(n,s){return this.jumpTo({center:n},s)},o.prototype.panBy=function(n,s,p){return n=u.Point.convert(n).mult(-1),this.panTo(this.transform.center,u.extend({offset:n},s),p)},o.prototype.panTo=function(n,s,p){return this.easeTo(u.extend({center:n},s),p)},o.prototype.getZoom=function(){return this.transform.zoom},o.prototype.setZoom=function(n,s){return this.jumpTo({zoom:n},s),this},o.prototype.zoomTo=function(n,s,p){return this.easeTo(u.extend({zoom:n},s),p)},o.prototype.zoomIn=function(n,s){return this.zoomTo(this.getZoom()+1,n,s),this},o.prototype.zoomOut=function(n,s){return this.zoomTo(this.getZoom()-1,n,s),this},o.prototype.getBearing=function(){return this.transform.bearing},o.prototype.setBearing=function(n,s){return this.jumpTo({bearing:n},s),this},o.prototype.getPadding=function(){return this.transform.padding},o.prototype.setPadding=function(n,s){return this.jumpTo({padding:n},s),this},o.prototype.rotateTo=function(n,s,p){return this.easeTo(u.extend({bearing:n},s),p)},o.prototype.resetNorth=function(n,s){return this.rotateTo(0,u.extend({duration:1e3},n),s),this},o.prototype.resetNorthPitch=function(n,s){return this.easeTo(u.extend({bearing:0,pitch:0,duration:1e3},n),s),this},o.prototype.snapToNorth=function(n,s){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(n,s):this},o.prototype.getPitch=function(){return this.transform.pitch},o.prototype.setPitch=function(n,s){return this.jumpTo({pitch:n},s),this},o.prototype.cameraForBounds=function(n,s){n=u.LngLatBounds.convert(n);var p=s&&s.bearing||0;return this._cameraForBoxAndBearing(n.getNorthWest(),n.getSouthEast(),p,s)},o.prototype._cameraForBoxAndBearing=function(n,s,p,f){var d={top:0,bottom:0,right:0,left:0};if(typeof(f=u.extend({padding:d,offset:[0,0],maxZoom:this.transform.maxZoom},f)).padding=="number"){var y=f.padding;f.padding={top:y,bottom:y,right:y,left:y}}f.padding=u.extend(d,f.padding);var _=this.transform,S=_.padding,P=_.project(u.LngLat.convert(n)),z=_.project(u.LngLat.convert(s)),M=P.rotate(-p*Math.PI/180),U=z.rotate(-p*Math.PI/180),O=new u.Point(Math.max(M.x,U.x),Math.max(M.y,U.y)),Z=new u.Point(Math.min(M.x,U.x),Math.min(M.y,U.y)),B=O.sub(Z),q=(_.width-(S.left+S.right+f.padding.left+f.padding.right))/B.x,X=(_.height-(S.top+S.bottom+f.padding.top+f.padding.bottom))/B.y;if(!(X<0||q<0)){var Y=Math.min(_.scaleZoom(_.scale*Math.min(q,X)),f.maxZoom),ne=typeof f.offset.x=="number"?new u.Point(f.offset.x,f.offset.y):u.Point.convert(f.offset),re=new u.Point((f.padding.left-f.padding.right)/2,(f.padding.top-f.padding.bottom)/2).rotate(p*Math.PI/180),oe=ne.add(re).mult(_.scale/_.zoomScale(Y));return{center:_.unproject(P.add(z).div(2).sub(oe)),zoom:Y,bearing:p}}u.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},o.prototype.fitBounds=function(n,s,p){return this._fitInternal(this.cameraForBounds(n,s),s,p)},o.prototype.fitScreenCoordinates=function(n,s,p,f,d){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(u.Point.convert(n)),this.transform.pointLocation(u.Point.convert(s)),p,f),f,d)},o.prototype._fitInternal=function(n,s,p){return n?(delete(s=u.extend(n,s)).padding,s.linear?this.easeTo(s,p):this.flyTo(s,p)):this},o.prototype.jumpTo=function(n,s){this.stop();var p=this.transform,f=!1,d=!1,y=!1;return"zoom"in n&&p.zoom!==+n.zoom&&(f=!0,p.zoom=+n.zoom),n.center!==void 0&&(p.center=u.LngLat.convert(n.center)),"bearing"in n&&p.bearing!==+n.bearing&&(d=!0,p.bearing=+n.bearing),"pitch"in n&&p.pitch!==+n.pitch&&(y=!0,p.pitch=+n.pitch),n.padding==null||p.isPaddingEqual(n.padding)||(p.padding=n.padding),this.fire(new u.Event("movestart",s)).fire(new u.Event("move",s)),f&&this.fire(new u.Event("zoomstart",s)).fire(new u.Event("zoom",s)).fire(new u.Event("zoomend",s)),d&&this.fire(new u.Event("rotatestart",s)).fire(new u.Event("rotate",s)).fire(new u.Event("rotateend",s)),y&&this.fire(new u.Event("pitchstart",s)).fire(new u.Event("pitch",s)).fire(new u.Event("pitchend",s)),this.fire(new u.Event("moveend",s))},o.prototype.easeTo=function(n,s){var p=this;this._stop(!1,n.easeId),((n=u.extend({offset:[0,0],duration:500,easing:u.ease},n)).animate===!1||!n.essential&&u.browser.prefersReducedMotion)&&(n.duration=0);var f=this.transform,d=this.getZoom(),y=this.getBearing(),_=this.getPitch(),S=this.getPadding(),P="zoom"in n?+n.zoom:d,z="bearing"in n?this._normalizeBearing(n.bearing,y):y,M="pitch"in n?+n.pitch:_,U="padding"in n?n.padding:f.padding,O=u.Point.convert(n.offset),Z=f.centerPoint.add(O),B=f.pointLocation(Z),q=u.LngLat.convert(n.center||B);this._normalizeCenter(q);var X,Y,ne=f.project(B),re=f.project(q).sub(ne),oe=f.zoomScale(P-d);n.around&&(X=u.LngLat.convert(n.around),Y=f.locationPoint(X));var he={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||P!==d,this._rotating=this._rotating||y!==z,this._pitching=this._pitching||M!==_,this._padding=!f.isPaddingEqual(U),this._easeId=n.easeId,this._prepareEase(s,n.noMoveStart,he),this._ease((function(xe){if(p._zooming&&(f.zoom=u.number(d,P,xe)),p._rotating&&(f.bearing=u.number(y,z,xe)),p._pitching&&(f.pitch=u.number(_,M,xe)),p._padding&&(f.interpolatePadding(S,U,xe),Z=f.centerPoint.add(O)),X)f.setLocationAtPoint(X,Y);else{var ve=f.zoomScale(f.zoom-d),Ae=P>d?Math.min(2,oe):Math.max(.5,oe),Ne=Math.pow(Ae,1-xe),He=f.unproject(ne.add(re.mult(xe*Ne)).mult(ve));f.setLocationAtPoint(f.renderWorldCopies?He.wrap():He,Z)}p._fireMoveEvents(s)}),(function(xe){p._afterEase(s,xe)}),n),this},o.prototype._prepareEase=function(n,s,p){p===void 0&&(p={}),this._moving=!0,s||p.moving||this.fire(new u.Event("movestart",n)),this._zooming&&!p.zooming&&this.fire(new u.Event("zoomstart",n)),this._rotating&&!p.rotating&&this.fire(new u.Event("rotatestart",n)),this._pitching&&!p.pitching&&this.fire(new u.Event("pitchstart",n))},o.prototype._fireMoveEvents=function(n){this.fire(new u.Event("move",n)),this._zooming&&this.fire(new u.Event("zoom",n)),this._rotating&&this.fire(new u.Event("rotate",n)),this._pitching&&this.fire(new u.Event("pitch",n))},o.prototype._afterEase=function(n,s){if(!this._easeId||!s||this._easeId!==s){delete this._easeId;var p=this._zooming,f=this._rotating,d=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,p&&this.fire(new u.Event("zoomend",n)),f&&this.fire(new u.Event("rotateend",n)),d&&this.fire(new u.Event("pitchend",n)),this.fire(new u.Event("moveend",n))}},o.prototype.flyTo=function(n,s){var p=this;if(!n.essential&&u.browser.prefersReducedMotion){var f=u.pick(n,["center","zoom","bearing","pitch","around"]);return this.jumpTo(f,s)}this.stop(),n=u.extend({offset:[0,0],speed:1.2,curve:1.42,easing:u.ease},n);var d=this.transform,y=this.getZoom(),_=this.getBearing(),S=this.getPitch(),P=this.getPadding(),z="zoom"in n?u.clamp(+n.zoom,d.minZoom,d.maxZoom):y,M="bearing"in n?this._normalizeBearing(n.bearing,_):_,U="pitch"in n?+n.pitch:S,O="padding"in n?n.padding:d.padding,Z=d.zoomScale(z-y),B=u.Point.convert(n.offset),q=d.centerPoint.add(B),X=d.pointLocation(q),Y=u.LngLat.convert(n.center||X);this._normalizeCenter(Y);var ne=d.project(X),re=d.project(Y).sub(ne),oe=n.curve,he=Math.max(d.width,d.height),xe=he/Z,ve=re.mag();if("minZoom"in n){var Ae=u.clamp(Math.min(n.minZoom,y,z),d.minZoom,d.maxZoom),Ne=he/d.zoomScale(Ae-y);oe=Math.sqrt(Ne/ve*2)}var He=oe*oe;function Xe(Ye){var Ke=(xe*xe-he*he+(Ye?-1:1)*He*He*ve*ve)/(2*(Ye?xe:he)*He*ve);return Math.log(Math.sqrt(Ke*Ke+1)-Ke)}function bt(Ye){return(Math.exp(Ye)-Math.exp(-Ye))/2}function ze(Ye){return(Math.exp(Ye)+Math.exp(-Ye))/2}var tt=Xe(0),at=function(Ye){return ze(tt)/ze(tt+oe*Ye)},Qe=function(Ye){return he*((ze(tt)*(bt(Ke=tt+oe*Ye)/ze(Ke))-bt(tt))/He)/ve;var Ke},$e=(Xe(1)-tt)/oe;if(Math.abs(ve)<1e-6||!isFinite($e)){if(Math.abs(he-xe)<1e-6)return this.easeTo(n,s);var nt=xe<he?-1:1;$e=Math.abs(Math.log(xe/he))/oe,Qe=function(){return 0},at=function(Ye){return Math.exp(nt*oe*Ye)}}return n.duration="duration"in n?+n.duration:1e3*$e/("screenSpeed"in n?+n.screenSpeed/oe:+n.speed),n.maxDuration&&n.duration>n.maxDuration&&(n.duration=0),this._zooming=!0,this._rotating=_!==M,this._pitching=U!==S,this._padding=!d.isPaddingEqual(O),this._prepareEase(s,!1),this._ease((function(Ye){var Ke=Ye*$e,kr=1/at(Ke);d.zoom=Ye===1?z:y+d.scaleZoom(kr),p._rotating&&(d.bearing=u.number(_,M,Ye)),p._pitching&&(d.pitch=u.number(S,U,Ye)),p._padding&&(d.interpolatePadding(P,O,Ye),q=d.centerPoint.add(B));var Qt=Ye===1?Y:d.unproject(ne.add(re.mult(Qe(Ke))).mult(kr));d.setLocationAtPoint(d.renderWorldCopies?Qt.wrap():Qt,q),p._fireMoveEvents(s)}),(function(){return p._afterEase(s)}),n),this},o.prototype.isEasing=function(){return!!this._easeFrameId},o.prototype.stop=function(){return this._stop()},o.prototype._stop=function(n,s){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var p=this._onEaseEnd;delete this._onEaseEnd,p.call(this,s)}if(!n){var f=this.handlers;f&&f.stop(!1)}return this},o.prototype._ease=function(n,s,p){p.animate===!1||p.duration===0?(n(1),s()):(this._easeStart=u.browser.now(),this._easeOptions=p,this._onEaseFrame=n,this._onEaseEnd=s,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},o.prototype._renderFrameCallback=function(){var n=Math.min((u.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(n)),n<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},o.prototype._normalizeBearing=function(n,s){n=u.wrap(n,-180,180);var p=Math.abs(n-s);return Math.abs(n-360-s)<p&&(n-=360),Math.abs(n+360-s)<p&&(n+=360),n},o.prototype._normalizeCenter=function(n){var s=this.transform;if(s.renderWorldCopies&&!s.lngRange){var p=n.lng-s.center.lng;n.lng+=p>180?-360:p<-180?360:0}},o})(u.Evented),ei=function(i){i===void 0&&(i={}),this.options=i,u.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};ei.prototype.getDefaultPosition=function(){return"bottom-right"},ei.prototype.onAdd=function(i){var o=this.options&&this.options.compact;return this._map=i,this._container=pe.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=pe.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=pe.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),o&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),o===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},ei.prototype.onRemove=function(){pe.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},ei.prototype._setElementTitle=function(i,o){var n=this._map._getUIString("AttributionControl."+o);i.title=n,i.setAttribute("aria-label",n)},ei.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},ei.prototype._updateEditLink=function(){var i=this._editLink;i||(i=this._editLink=this._container.querySelector(".mapbox-improve-map"));var o=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||u.config.ACCESS_TOKEN}];if(i){var n=o.reduce((function(s,p,f){return p.value&&(s+=p.key+"="+p.value+(f<o.length-1?"&":"")),s}),"?");i.href=u.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),i.rel="noopener nofollow",this._setElementTitle(i,"MapFeedback")}},ei.prototype._updateData=function(i){!i||i.sourceDataType!=="metadata"&&i.sourceDataType!=="visibility"&&i.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())},ei.prototype._updateAttributions=function(){if(this._map.style){var i=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?i=i.concat(this.options.customAttribution.map((function(y){return typeof y!="string"?"":y}))):typeof this.options.customAttribution=="string"&&i.push(this.options.customAttribution)),this._map.style.stylesheet){var o=this._map.style.stylesheet;this.styleOwner=o.owner,this.styleId=o.id}var n=this._map.style.sourceCaches;for(var s in n){var p=n[s];if(p.used){var f=p.getSource();f.attribution&&i.indexOf(f.attribution)<0&&i.push(f.attribution)}}i.sort((function(y,_){return y.length-_.length}));var d=(i=i.filter((function(y,_){for(var S=_+1;S<i.length;S++)if(i[S].indexOf(y)>=0)return!1;return!0}))).join(" | ");d!==this._attribHTML&&(this._attribHTML=d,i.length?(this._innerContainer.innerHTML=d,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},ei.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var $i=function(){u.bindAll(["_updateLogo"],this),u.bindAll(["_updateCompact"],this)};$i.prototype.onAdd=function(i){this._map=i,this._container=pe.create("div","mapboxgl-ctrl");var o=pe.create("a","mapboxgl-ctrl-logo");return o.target="_blank",o.rel="noopener nofollow",o.href="https://www.mapbox.com/",o.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),o.setAttribute("rel","noopener nofollow"),this._container.appendChild(o),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},$i.prototype.onRemove=function(){pe.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},$i.prototype.getDefaultPosition=function(){return"bottom-left"},$i.prototype._updateLogo=function(i){i&&i.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},$i.prototype._logoRequired=function(){if(this._map.style){var i=this._map.style.sourceCaches;for(var o in i)if(i[o].getSource().mapbox_logo)return!0;return!1}},$i.prototype._updateCompact=function(){var i=this._container.children;if(i.length){var o=i[0];this._map.getCanvasContainer().offsetWidth<250?o.classList.add("mapboxgl-compact"):o.classList.remove("mapboxgl-compact")}};var Zr=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Zr.prototype.add=function(i){var o=++this._id;return this._queue.push({callback:i,id:o,cancelled:!1}),o},Zr.prototype.remove=function(i){for(var o=this._currentlyRunning,n=0,s=o?this._queue.concat(o):this._queue;n<s.length;n+=1){var p=s[n];if(p.id===i)return void(p.cancelled=!0)}},Zr.prototype.run=function(i){i===void 0&&(i=0);var o=this._currentlyRunning=this._queue;this._queue=[];for(var n=0,s=o;n<s.length;n+=1){var p=s[n];if(!p.cancelled&&(p.callback(i),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Zr.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var cn={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},Ys=u.window.HTMLImageElement,Qa=u.window.HTMLElement,At=u.window.ImageBitmap,Br={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},ou=(function(i){function o(s){var p=this;if((s=u.extend({},Br,s)).minZoom!=null&&s.maxZoom!=null&&s.minZoom>s.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(s.minPitch!=null&&s.maxPitch!=null&&s.minPitch>s.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(s.minPitch!=null&&s.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(s.maxPitch!=null&&s.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var f=new vt(s.minZoom,s.maxZoom,s.minPitch,s.maxPitch,s.renderWorldCopies);if(i.call(this,f,s),this._interactive=s.interactive,this._maxTileCacheSize=s.maxTileCacheSize,this._failIfMajorPerformanceCaveat=s.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=s.preserveDrawingBuffer,this._antialias=s.antialias,this._trackResize=s.trackResize,this._bearingSnap=s.bearingSnap,this._refreshExpiredTiles=s.refreshExpiredTiles,this._fadeDuration=s.fadeDuration,this._crossSourceCollisions=s.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=s.collectResourceTiming,this._renderTaskQueue=new Zr,this._controls=[],this._mapId=u.uniqueId(),this._locale=u.extend({},cn,s.locale),this._clickTolerance=s.clickTolerance,this._requestManager=new u.RequestManager(s.transformRequest,s.accessToken),typeof s.container=="string"){if(this._container=u.window.document.getElementById(s.container),!this._container)throw new Error("Container '"+s.container+"' not found.")}else{if(!(s.container instanceof Qa))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=s.container}if(s.maxBounds&&this.setMaxBounds(s.maxBounds),u.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return p._update(!1)})),this.on("moveend",(function(){return p._update(!1)})),this.on("zoom",(function(){return p._update(!0)})),u.window!==void 0&&(u.window.addEventListener("online",this._onWindowOnline,!1),u.window.addEventListener("resize",this._onWindowResize,!1),u.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Re(this,s),this._hash=s.hash&&new Ci(typeof s.hash=="string"&&s.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:s.center,zoom:s.zoom,bearing:s.bearing,pitch:s.pitch}),s.bounds&&(this.resize(),this.fitBounds(s.bounds,u.extend({},s.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=s.localIdeographFontFamily,s.style&&this.setStyle(s.style,{localIdeographFontFamily:s.localIdeographFontFamily}),s.attributionControl&&this.addControl(new ei({customAttribution:s.customAttribution})),this.addControl(new $i,s.logoPosition),this.on("style.load",(function(){p.transform.unmodified&&p.jumpTo(p.style.stylesheet)})),this.on("data",(function(d){p._update(d.dataType==="style"),p.fire(new u.Event(d.dataType+"data",d))})),this.on("dataloading",(function(d){p.fire(new u.Event(d.dataType+"dataloading",d))}))}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return o.prototype._getMapId=function(){return this._mapId},o.prototype.addControl=function(s,p){if(p===void 0&&(p=s.getDefaultPosition?s.getDefaultPosition():"top-right"),!s||!s.onAdd)return this.fire(new u.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var f=s.onAdd(this);this._controls.push(s);var d=this._controlPositions[p];return p.indexOf("bottom")!==-1?d.insertBefore(f,d.firstChild):d.appendChild(f),this},o.prototype.removeControl=function(s){if(!s||!s.onRemove)return this.fire(new u.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var p=this._controls.indexOf(s);return p>-1&&this._controls.splice(p,1),s.onRemove(this),this},o.prototype.hasControl=function(s){return this._controls.indexOf(s)>-1},o.prototype.resize=function(s){var p=this._containerDimensions(),f=p[0],d=p[1];if(f===this.transform.width&&d===this.transform.height)return this;this._resizeCanvas(f,d),this.transform.resize(f,d),this.painter.resize(f,d);var y=!this._moving;return y&&this.fire(new u.Event("movestart",s)).fire(new u.Event("move",s)),this.fire(new u.Event("resize",s)),y&&this.fire(new u.Event("moveend",s)),this},o.prototype.getBounds=function(){return this.transform.getBounds()},o.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},o.prototype.setMaxBounds=function(s){return this.transform.setMaxBounds(u.LngLatBounds.convert(s)),this._update()},o.prototype.setMinZoom=function(s){if((s=s??-2)>=-2&&s<=this.transform.maxZoom)return this.transform.minZoom=s,this._update(),this.getZoom()<s&&this.setZoom(s),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},o.prototype.getMinZoom=function(){return this.transform.minZoom},o.prototype.setMaxZoom=function(s){if((s=s??22)>=this.transform.minZoom)return this.transform.maxZoom=s,this._update(),this.getZoom()>s&&this.setZoom(s),this;throw new Error("maxZoom must be greater than the current minZoom")},o.prototype.getMaxZoom=function(){return this.transform.maxZoom},o.prototype.setMinPitch=function(s){if((s=s??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(s>=0&&s<=this.transform.maxPitch)return this.transform.minPitch=s,this._update(),this.getPitch()<s&&this.setPitch(s),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},o.prototype.getMinPitch=function(){return this.transform.minPitch},o.prototype.setMaxPitch=function(s){if((s=s??60)>60)throw new Error("maxPitch must be less than or equal to 60");if(s>=this.transform.minPitch)return this.transform.maxPitch=s,this._update(),this.getPitch()>s&&this.setPitch(s),this;throw new Error("maxPitch must be greater than the current minPitch")},o.prototype.getMaxPitch=function(){return this.transform.maxPitch},o.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},o.prototype.setRenderWorldCopies=function(s){return this.transform.renderWorldCopies=s,this._update()},o.prototype.project=function(s){return this.transform.locationPoint(u.LngLat.convert(s))},o.prototype.unproject=function(s){return this.transform.pointLocation(u.Point.convert(s))},o.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},o.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},o.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},o.prototype._createDelegatedListener=function(s,p,f){var d,y=this;if(s==="mouseenter"||s==="mouseover"){var _=!1;return{layer:p,listener:f,delegates:{mousemove:function(P){var z=y.getLayer(p)?y.queryRenderedFeatures(P.point,{layers:[p]}):[];z.length?_||(_=!0,f.call(y,new _r(s,y,P.originalEvent,{features:z}))):_=!1},mouseout:function(){_=!1}}}}if(s==="mouseleave"||s==="mouseout"){var S=!1;return{layer:p,listener:f,delegates:{mousemove:function(P){(y.getLayer(p)?y.queryRenderedFeatures(P.point,{layers:[p]}):[]).length?S=!0:S&&(S=!1,f.call(y,new _r(s,y,P.originalEvent)))},mouseout:function(P){S&&(S=!1,f.call(y,new _r(s,y,P.originalEvent)))}}}}return{layer:p,listener:f,delegates:(d={},d[s]=function(P){var z=y.getLayer(p)?y.queryRenderedFeatures(P.point,{layers:[p]}):[];z.length&&(P.features=z,f.call(y,P),delete P.features)},d)}},o.prototype.on=function(s,p,f){if(f===void 0)return i.prototype.on.call(this,s,p);var d=this._createDelegatedListener(s,p,f);for(var y in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[s]=this._delegatedListeners[s]||[],this._delegatedListeners[s].push(d),d.delegates)this.on(y,d.delegates[y]);return this},o.prototype.once=function(s,p,f){if(f===void 0)return i.prototype.once.call(this,s,p);var d=this._createDelegatedListener(s,p,f);for(var y in d.delegates)this.once(y,d.delegates[y]);return this},o.prototype.off=function(s,p,f){var d=this;return f===void 0?i.prototype.off.call(this,s,p):(this._delegatedListeners&&this._delegatedListeners[s]&&(function(y){for(var _=y[s],S=0;S<_.length;S++){var P=_[S];if(P.layer===p&&P.listener===f){for(var z in P.delegates)d.off(z,P.delegates[z]);return _.splice(S,1),d}}})(this._delegatedListeners),this)},o.prototype.queryRenderedFeatures=function(s,p){if(!this.style)return[];var f;if(p!==void 0||s===void 0||s instanceof u.Point||Array.isArray(s)||(p=s,s=void 0),p=p||{},(s=s||[[0,0],[this.transform.width,this.transform.height]])instanceof u.Point||typeof s[0]=="number")f=[u.Point.convert(s)];else{var d=u.Point.convert(s[0]),y=u.Point.convert(s[1]);f=[d,new u.Point(y.x,d.y),y,new u.Point(d.x,y.y),d]}return this.style.queryRenderedFeatures(f,p,this.transform)},o.prototype.querySourceFeatures=function(s,p){return this.style.querySourceFeatures(s,p)},o.prototype.setStyle=function(s,p){return(p=u.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},p)).diff!==!1&&p.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&s?(this._diffStyle(s,p),this):(this._localIdeographFontFamily=p.localIdeographFontFamily,this._updateStyle(s,p))},o.prototype._getUIString=function(s){var p=this._locale[s];if(p==null)throw new Error("Missing UI string '"+s+"'");return p},o.prototype._updateStyle=function(s,p){return this.style&&(this.style.setEventedParent(null),this.style._remove()),s?(this.style=new mi(this,p||{}),this.style.setEventedParent(this,{style:this.style}),typeof s=="string"?this.style.loadURL(s):this.style.loadJSON(s),this):(delete this.style,this)},o.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new mi(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},o.prototype._diffStyle=function(s,p){var f=this;if(typeof s=="string"){var d=this._requestManager.normalizeStyleURL(s),y=this._requestManager.transformRequest(d,u.ResourceType.Style);u.getJSON(y,(function(_,S){_?f.fire(new u.ErrorEvent(_)):S&&f._updateDiff(S,p)}))}else typeof s=="object"&&this._updateDiff(s,p)},o.prototype._updateDiff=function(s,p){try{this.style.setState(s)&&this._update(!0)}catch(f){u.warnOnce("Unable to perform style diff: "+(f.message||f.error||f)+". Rebuilding the style from scratch."),this._updateStyle(s,p)}},o.prototype.getStyle=function(){if(this.style)return this.style.serialize()},o.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():u.warnOnce("There is no style added to the map.")},o.prototype.addSource=function(s,p){return this._lazyInitEmptyStyle(),this.style.addSource(s,p),this._update(!0)},o.prototype.isSourceLoaded=function(s){var p=this.style&&this.style.sourceCaches[s];if(p!==void 0)return p.loaded();this.fire(new u.ErrorEvent(new Error("There is no source with ID '"+s+"'")))},o.prototype.areTilesLoaded=function(){var s=this.style&&this.style.sourceCaches;for(var p in s){var f=s[p]._tiles;for(var d in f){var y=f[d];if(y.state!=="loaded"&&y.state!=="errored")return!1}}return!0},o.prototype.addSourceType=function(s,p,f){return this._lazyInitEmptyStyle(),this.style.addSourceType(s,p,f)},o.prototype.removeSource=function(s){return this.style.removeSource(s),this._update(!0)},o.prototype.getSource=function(s){return this.style.getSource(s)},o.prototype.addImage=function(s,p,f){f===void 0&&(f={});var d=f.pixelRatio;d===void 0&&(d=1);var y=f.sdf;y===void 0&&(y=!1);var _=f.stretchX,S=f.stretchY,P=f.content;if(this._lazyInitEmptyStyle(),p instanceof Ys||At&&p instanceof At){var z=u.browser.getImageData(p);this.style.addImage(s,{data:new u.RGBAImage({width:z.width,height:z.height},z.data),pixelRatio:d,stretchX:_,stretchY:S,content:P,sdf:y,version:0})}else{if(p.width===void 0||p.height===void 0)return this.fire(new u.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var M=p;this.style.addImage(s,{data:new u.RGBAImage({width:p.width,height:p.height},new Uint8Array(p.data)),pixelRatio:d,stretchX:_,stretchY:S,content:P,sdf:y,version:0,userImage:M}),M.onAdd&&M.onAdd(this,s)}},o.prototype.updateImage=function(s,p){var f=this.style.getImage(s);if(!f)return this.fire(new u.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var d=p instanceof Ys||At&&p instanceof At?u.browser.getImageData(p):p,y=d.width,_=d.height,S=d.data;return y===void 0||_===void 0?this.fire(new u.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):y!==f.data.width||_!==f.data.height?this.fire(new u.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(f.data.replace(S,!(p instanceof Ys||At&&p instanceof At)),void this.style.updateImage(s,f))},o.prototype.hasImage=function(s){return s?!!this.style.getImage(s):(this.fire(new u.ErrorEvent(new Error("Missing required image id"))),!1)},o.prototype.removeImage=function(s){this.style.removeImage(s)},o.prototype.loadImage=function(s,p){u.getImage(this._requestManager.transformRequest(s,u.ResourceType.Image),p)},o.prototype.listImages=function(){return this.style.listImages()},o.prototype.addLayer=function(s,p){return this._lazyInitEmptyStyle(),this.style.addLayer(s,p),this._update(!0)},o.prototype.moveLayer=function(s,p){return this.style.moveLayer(s,p),this._update(!0)},o.prototype.removeLayer=function(s){return this.style.removeLayer(s),this._update(!0)},o.prototype.getLayer=function(s){return this.style.getLayer(s)},o.prototype.setLayerZoomRange=function(s,p,f){return this.style.setLayerZoomRange(s,p,f),this._update(!0)},o.prototype.setFilter=function(s,p,f){return f===void 0&&(f={}),this.style.setFilter(s,p,f),this._update(!0)},o.prototype.getFilter=function(s){return this.style.getFilter(s)},o.prototype.setPaintProperty=function(s,p,f,d){return d===void 0&&(d={}),this.style.setPaintProperty(s,p,f,d),this._update(!0)},o.prototype.getPaintProperty=function(s,p){return this.style.getPaintProperty(s,p)},o.prototype.setLayoutProperty=function(s,p,f,d){return d===void 0&&(d={}),this.style.setLayoutProperty(s,p,f,d),this._update(!0)},o.prototype.getLayoutProperty=function(s,p){return this.style.getLayoutProperty(s,p)},o.prototype.setLight=function(s,p){return p===void 0&&(p={}),this._lazyInitEmptyStyle(),this.style.setLight(s,p),this._update(!0)},o.prototype.getLight=function(){return this.style.getLight()},o.prototype.setFeatureState=function(s,p){return this.style.setFeatureState(s,p),this._update()},o.prototype.removeFeatureState=function(s,p){return this.style.removeFeatureState(s,p),this._update()},o.prototype.getFeatureState=function(s){return this.style.getFeatureState(s)},o.prototype.getContainer=function(){return this._container},o.prototype.getCanvasContainer=function(){return this._canvasContainer},o.prototype.getCanvas=function(){return this._canvas},o.prototype._containerDimensions=function(){var s=0,p=0;return this._container&&(s=this._container.clientWidth||400,p=this._container.clientHeight||300),[s,p]},o.prototype._detectMissingCSS=function(){u.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&u.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},o.prototype._setupContainer=function(){var s=this._container;s.classList.add("mapboxgl-map"),(this._missingCSSCanary=pe.create("div","mapboxgl-canary",s)).style.visibility="hidden",this._detectMissingCSS();var p=this._canvasContainer=pe.create("div","mapboxgl-canvas-container",s);this._interactive&&p.classList.add("mapboxgl-interactive"),this._canvas=pe.create("canvas","mapboxgl-canvas",p),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var f=this._containerDimensions();this._resizeCanvas(f[0],f[1]);var d=this._controlContainer=pe.create("div","mapboxgl-control-container",s),y=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(_){y[_]=pe.create("div","mapboxgl-ctrl-"+_,d)})),this._container.addEventListener("scroll",this._onMapScroll,!1)},o.prototype._resizeCanvas=function(s,p){var f=u.browser.devicePixelRatio||1;this._canvas.width=f*s,this._canvas.height=f*p,this._canvas.style.width=s+"px",this._canvas.style.height=p+"px"},o.prototype._setupPainter=function(){var s=u.extend({},ot.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),p=this._canvas.getContext("webgl",s)||this._canvas.getContext("experimental-webgl",s);p?(this.painter=new Zt(p,this.transform),u.webpSupported.testSupport(p)):this.fire(new u.ErrorEvent(new Error("Failed to initialize WebGL")))},o.prototype._contextLost=function(s){s.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new u.Event("webglcontextlost",{originalEvent:s}))},o.prototype._contextRestored=function(s){this._setupPainter(),this.resize(),this._update(),this.fire(new u.Event("webglcontextrestored",{originalEvent:s}))},o.prototype._onMapScroll=function(s){if(s.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},o.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},o.prototype._update=function(s){return this.style?(this._styleDirty=this._styleDirty||s,this._sourcesDirty=!0,this.triggerRepaint(),this):this},o.prototype._requestRenderFrame=function(s){return this._update(),this._renderTaskQueue.add(s)},o.prototype._cancelRenderFrame=function(s){this._renderTaskQueue.remove(s)},o.prototype._render=function(s){var p,f=this,d=0,y=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(p=y.createQueryEXT(),y.beginQueryEXT(y.TIME_ELAPSED_EXT,p),d=u.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(s),!this._removed){var _=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var S=this.transform.zoom,P=u.browser.now();this.style.zoomHistory.update(S,P);var z=new u.EvaluationParameters(S,{now:P,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),M=z.crossFadingFactor();M===1&&M===this._crossFadingFactor||(_=!0,this._crossFadingFactor=M),this.style.update(z)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new u.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new u.Event("load"))),this.style&&(this.style.hasTransitions()||_)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var U=u.browser.now()-d;y.endQueryEXT(y.TIME_ELAPSED_EXT,p),setTimeout((function(){var B=y.getQueryObjectEXT(p,y.QUERY_RESULT_EXT)/1e6;y.deleteQueryEXT(p),f.fire(new u.Event("gpu-timing-frame",{cpuTime:U,gpuTime:B}))}),50)}if(this.listens("gpu-timing-layer")){var O=this.painter.collectGpuTimers();setTimeout((function(){var B=f.painter.queryGpuTimers(O);f.fire(new u.Event("gpu-timing-layer",{layerTimes:B}))}),50)}var Z=this._sourcesDirty||this._styleDirty||this._placementDirty;return Z||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new u.Event("idle")),!this._loaded||this._fullyLoaded||Z||(this._fullyLoaded=!0),this}},o.prototype.remove=function(){this._hash&&this._hash.remove();for(var s=0,p=this._controls;s<p.length;s+=1)p[s].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),u.window!==void 0&&(u.window.removeEventListener("resize",this._onWindowResize,!1),u.window.removeEventListener("orientationchange",this._onWindowResize,!1),u.window.removeEventListener("online",this._onWindowOnline,!1));var f=this.painter.context.gl.getExtension("WEBGL_lose_context");f&&f.loseContext(),Eo(this._canvasContainer),Eo(this._controlContainer),Eo(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new u.Event("remove"))},o.prototype.triggerRepaint=function(){var s=this;this.style&&!this._frame&&(this._frame=u.browser.frame((function(p){s._frame=null,s._render(p)})))},o.prototype._onWindowOnline=function(){this._update()},o.prototype._onWindowResize=function(s){this._trackResize&&this.resize({originalEvent:s})._update()},n.showTileBoundaries.get=function(){return!!this._showTileBoundaries},n.showTileBoundaries.set=function(s){this._showTileBoundaries!==s&&(this._showTileBoundaries=s,this._update())},n.showPadding.get=function(){return!!this._showPadding},n.showPadding.set=function(s){this._showPadding!==s&&(this._showPadding=s,this._update())},n.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},n.showCollisionBoxes.set=function(s){this._showCollisionBoxes!==s&&(this._showCollisionBoxes=s,s?this.style._generateCollisionBoxes():this._update())},n.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},n.showOverdrawInspector.set=function(s){this._showOverdrawInspector!==s&&(this._showOverdrawInspector=s,this._update())},n.repaint.get=function(){return!!this._repaint},n.repaint.set=function(s){this._repaint!==s&&(this._repaint=s,this.triggerRepaint())},n.vertices.get=function(){return!!this._vertices},n.vertices.set=function(s){this._vertices=s,this._update()},o.prototype._setCacheLimits=function(s,p){u.setCacheLimits(s,p)},n.version.get=function(){return u.version},Object.defineProperties(o.prototype,n),o})($a);function Eo(i){i.parentNode&&i.parentNode.removeChild(i)}var $s={showCompass:!0,showZoom:!0,visualizePitch:!1},In=function(i){var o=this;this.options=u.extend({},$s,i),this._container=pe.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(n){return n.preventDefault()})),this.options.showZoom&&(u.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(n){return o._map.zoomIn({},{originalEvent:n})})),pe.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(n){return o._map.zoomOut({},{originalEvent:n})})),pe.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(u.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(n){o.options.visualizePitch?o._map.resetNorthPitch({},{originalEvent:n}):o._map.resetNorth({},{originalEvent:n})})),this._compassIcon=pe.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};In.prototype._updateZoomButtons=function(){var i=this._map.getZoom(),o=i===this._map.getMaxZoom(),n=i===this._map.getMinZoom();this._zoomInButton.disabled=o,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",o.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())},In.prototype._rotateCompassArrow=function(){var i=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=i},In.prototype.onAdd=function(i){return this._map=i,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new xi(this._map,this._compass,this.options.visualizePitch)),this._container},In.prototype.onRemove=function(){pe.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},In.prototype._createButton=function(i,o){var n=pe.create("button",i,this._container);return n.type="button",n.addEventListener("click",o),n},In.prototype._setButtonTitle=function(i,o){var n=this._map._getUIString("NavigationControl."+o);i.title=n,i.setAttribute("aria-label",n)};var xi=function(i,o,n){n===void 0&&(n=!1),this._clickTolerance=10,this.element=o,this.mouseRotate=new Ka({clickTolerance:i.dragRotate._mouseRotate._clickTolerance}),this.map=i,n&&(this.mousePitch=new Hs({clickTolerance:i.dragRotate._mousePitch._clickTolerance})),u.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),pe.addEventListener(o,"mousedown",this.mousedown),pe.addEventListener(o,"touchstart",this.touchstart,{passive:!1}),pe.addEventListener(o,"touchmove",this.touchmove),pe.addEventListener(o,"touchend",this.touchend),pe.addEventListener(o,"touchcancel",this.reset)};function Wo(i,o,n){if(i=new u.LngLat(i.lng,i.lat),o){var s=new u.LngLat(i.lng-360,i.lat),p=new u.LngLat(i.lng+360,i.lat),f=n.locationPoint(i).distSqr(o);n.locationPoint(s).distSqr(o)<f?i=s:n.locationPoint(p).distSqr(o)<f&&(i=p)}for(;Math.abs(i.lng-n.center.lng)>180;){var d=n.locationPoint(i);if(d.x>=0&&d.y>=0&&d.x<=n.width&&d.y<=n.height)break;i.lng>n.center.lng?i.lng-=360:i.lng+=360}return i}xi.prototype.down=function(i,o){this.mouseRotate.mousedown(i,o),this.mousePitch&&this.mousePitch.mousedown(i,o),pe.disableDrag()},xi.prototype.move=function(i,o){var n=this.map,s=this.mouseRotate.mousemoveWindow(i,o);if(s&&s.bearingDelta&&n.setBearing(n.getBearing()+s.bearingDelta),this.mousePitch){var p=this.mousePitch.mousemoveWindow(i,o);p&&p.pitchDelta&&n.setPitch(n.getPitch()+p.pitchDelta)}},xi.prototype.off=function(){var i=this.element;pe.removeEventListener(i,"mousedown",this.mousedown),pe.removeEventListener(i,"touchstart",this.touchstart,{passive:!1}),pe.removeEventListener(i,"touchmove",this.touchmove),pe.removeEventListener(i,"touchend",this.touchend),pe.removeEventListener(i,"touchcancel",this.reset),this.offTemp()},xi.prototype.offTemp=function(){pe.enableDrag(),pe.removeEventListener(u.window,"mousemove",this.mousemove),pe.removeEventListener(u.window,"mouseup",this.mouseup)},xi.prototype.mousedown=function(i){this.down(u.extend({},i,{ctrlKey:!0,preventDefault:function(){return i.preventDefault()}}),pe.mousePos(this.element,i)),pe.addEventListener(u.window,"mousemove",this.mousemove),pe.addEventListener(u.window,"mouseup",this.mouseup)},xi.prototype.mousemove=function(i){this.move(i,pe.mousePos(this.element,i))},xi.prototype.mouseup=function(i){this.mouseRotate.mouseupWindow(i),this.mousePitch&&this.mousePitch.mouseupWindow(i),this.offTemp()},xi.prototype.touchstart=function(i){i.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=pe.touchPos(this.element,i.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return i.preventDefault()}},this._startPos))},xi.prototype.touchmove=function(i){i.targetTouches.length!==1?this.reset():(this._lastPos=pe.touchPos(this.element,i.targetTouches)[0],this.move({preventDefault:function(){return i.preventDefault()}},this._lastPos))},xi.prototype.touchend=function(i){i.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},xi.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var pn={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function es(i,o,n){var s=i.classList;for(var p in pn)s.remove("mapboxgl-"+n+"-anchor-"+p);s.add("mapboxgl-"+n+"-anchor-"+o)}var Xo,wa=(function(i){function o(n,s){if(i.call(this),(n instanceof u.window.HTMLElement||s)&&(n=u.extend({element:n},s)),u.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&n.pitchAlignment!=="auto"?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=u.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=pe.create("div"),this._element.setAttribute("aria-label","Map marker");var p=pe.createNS("http://www.w3.org/2000/svg","svg");p.setAttributeNS(null,"display","block"),p.setAttributeNS(null,"height","41px"),p.setAttributeNS(null,"width","27px"),p.setAttributeNS(null,"viewBox","0 0 27 41");var f=pe.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"stroke","none"),f.setAttributeNS(null,"stroke-width","1"),f.setAttributeNS(null,"fill","none"),f.setAttributeNS(null,"fill-rule","evenodd");var d=pe.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"fill-rule","nonzero");var y=pe.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(3.0, 29.0)"),y.setAttributeNS(null,"fill","#000000");for(var _=0,S=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];_<S.length;_+=1){var P=S[_],z=pe.createNS("http://www.w3.org/2000/svg","ellipse");z.setAttributeNS(null,"opacity","0.04"),z.setAttributeNS(null,"cx","10.5"),z.setAttributeNS(null,"cy","5.80029008"),z.setAttributeNS(null,"rx",P.rx),z.setAttributeNS(null,"ry",P.ry),y.appendChild(z)}var M=pe.createNS("http://www.w3.org/2000/svg","g");M.setAttributeNS(null,"fill",this._color);var U=pe.createNS("http://www.w3.org/2000/svg","path");U.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),M.appendChild(U);var O=pe.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"opacity","0.25"),O.setAttributeNS(null,"fill","#000000");var Z=pe.createNS("http://www.w3.org/2000/svg","path");Z.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),O.appendChild(Z);var B=pe.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"transform","translate(6.0, 7.0)"),B.setAttributeNS(null,"fill","#FFFFFF");var q=pe.createNS("http://www.w3.org/2000/svg","g");q.setAttributeNS(null,"transform","translate(8.0, 8.0)");var X=pe.createNS("http://www.w3.org/2000/svg","circle");X.setAttributeNS(null,"fill","#000000"),X.setAttributeNS(null,"opacity","0.25"),X.setAttributeNS(null,"cx","5.5"),X.setAttributeNS(null,"cy","5.5"),X.setAttributeNS(null,"r","5.4999962");var Y=pe.createNS("http://www.w3.org/2000/svg","circle");Y.setAttributeNS(null,"fill","#FFFFFF"),Y.setAttributeNS(null,"cx","5.5"),Y.setAttributeNS(null,"cy","5.5"),Y.setAttributeNS(null,"r","5.4999962"),q.appendChild(X),q.appendChild(Y),d.appendChild(y),d.appendChild(M),d.appendChild(O),d.appendChild(B),d.appendChild(q),p.appendChild(d),p.setAttributeNS(null,"height",41*this._scale+"px"),p.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(p),this._offset=u.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(ne){ne.preventDefault()})),this._element.addEventListener("mousedown",(function(ne){ne.preventDefault()})),es(this._element,this._anchor,"marker"),this._popup=null}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.addTo=function(n){return this.remove(),this._map=n,n.getCanvasContainer().appendChild(this._element),n.on("move",this._update),n.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},o.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),pe.remove(this._element),this._popup&&this._popup.remove(),this},o.prototype.getLngLat=function(){return this._lngLat},o.prototype.setLngLat=function(n){return this._lngLat=u.LngLat.convert(n),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},o.prototype.getElement=function(){return this._element},o.prototype.setPopup=function(n){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),n){if(!("offset"in n.options)){var s=Math.sqrt(Math.pow(13.5,2)/2);n.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[s,-1*(24.6+s)],"bottom-right":[-s,-1*(24.6+s)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=n,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},o.prototype._onKeyPress=function(n){var s=n.code,p=n.charCode||n.keyCode;s!=="Space"&&s!=="Enter"&&p!==32&&p!==13||this.togglePopup()},o.prototype._onMapClick=function(n){var s=n.originalEvent.target,p=this._element;this._popup&&(s===p||p.contains(s))&&this.togglePopup()},o.prototype.getPopup=function(){return this._popup},o.prototype.togglePopup=function(){var n=this._popup;return n?(n.isOpen()?n.remove():n.addTo(this._map),this):this},o.prototype._update=function(n){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Wo(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var s="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?s="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(s="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var p="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?p="rotateX(0deg)":this._pitchAlignment==="map"&&(p="rotateX("+this._map.getPitch()+"deg)"),n&&n.type!=="moveend"||(this._pos=this._pos.round()),pe.setTransform(this._element,pn[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+p+" "+s)}},o.prototype.getOffset=function(){return this._offset},o.prototype.setOffset=function(n){return this._offset=u.Point.convert(n),this._update(),this},o.prototype._onMove=function(n){if(!this._isDragging){var s=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new u.Event("dragstart"))),this.fire(new u.Event("drag")))},o.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new u.Event("dragend")),this._state="inactive"},o.prototype._addDragHandler=function(n){this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},o.prototype.setDraggable=function(n){return this._draggable=!!n,this._map&&(n?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},o.prototype.isDraggable=function(){return this._draggable},o.prototype.setRotation=function(n){return this._rotation=n||0,this._update(),this},o.prototype.getRotation=function(){return this._rotation},o.prototype.setRotationAlignment=function(n){return this._rotationAlignment=n||"auto",this._update(),this},o.prototype.getRotationAlignment=function(){return this._rotationAlignment},o.prototype.setPitchAlignment=function(n){return this._pitchAlignment=n&&n!=="auto"?n:this._rotationAlignment,this._update(),this},o.prototype.getPitchAlignment=function(){return this._pitchAlignment},o})(u.Evented),Qs={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Ho=0,To=!1,el=(function(i){function o(n){i.call(this),this.options=u.extend({},Qs,n),u.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.onAdd=function(n){var s;return this._map=n,this._container=pe.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),s=this._setupUI,Xo!==void 0?s(Xo):u.window.navigator.permissions!==void 0?u.window.navigator.permissions.query({name:"geolocation"}).then((function(p){s(Xo=p.state!=="denied")})):s(Xo=!!u.window.navigator.geolocation),this._container},o.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(u.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),pe.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Ho=0,To=!1},o.prototype._isOutOfMapMaxBounds=function(n){var s=this._map.getMaxBounds(),p=n.coords;return s&&(p.longitude<s.getWest()||p.longitude>s.getEast()||p.latitude<s.getSouth()||p.latitude>s.getNorth())},o.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},o.prototype._onSuccess=function(n){if(this._map){if(this._isOutOfMapMaxBounds(n))return this._setErrorState(),this.fire(new u.Event("outofmaxbounds",n)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=n,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(n),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(n),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new u.Event("geolocate",n)),this._finish()}},o.prototype._updateCamera=function(n){var s=new u.LngLat(n.coords.longitude,n.coords.latitude),p=n.coords.accuracy,f=this._map.getBearing(),d=u.extend({bearing:f},this.options.fitBoundsOptions);this._map.fitBounds(s.toBounds(p),d,{geolocateSource:!0})},o.prototype._updateMarker=function(n){if(n){var s=new u.LngLat(n.coords.longitude,n.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=n.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},o.prototype._updateCircleRadius=function(){var n=this._map._container.clientHeight/2,s=this._map.unproject([0,n]),p=this._map.unproject([1,n]),f=s.distanceTo(p),d=Math.ceil(2*this._accuracy/f);this._circleElement.style.width=d+"px",this._circleElement.style.height=d+"px"},o.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},o.prototype._onError=function(n){if(this._map){if(this.options.trackUserLocation)if(n.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(n.code===3&&To)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new u.Event("error",n)),this._finish()}},o.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},o.prototype._setupUI=function(n){var s=this;if(this._container.addEventListener("contextmenu",(function(d){return d.preventDefault()})),this._geolocateButton=pe.create("button","mapboxgl-ctrl-geolocate",this._container),pe.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",n===!1){u.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var p=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=p,this._geolocateButton.setAttribute("aria-label",p)}else{var f=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=f,this._geolocateButton.setAttribute("aria-label",f)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=pe.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new wa(this._dotElement),this._circleElement=pe.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new wa({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(d){d.geolocateSource||s._watchState!=="ACTIVE_LOCK"||d.originalEvent&&d.originalEvent.type==="resize"||(s._watchState="BACKGROUND",s._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),s._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),s.fire(new u.Event("trackuserlocationend")))}))},o.prototype.trigger=function(){if(!this._setup)return u.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new u.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Ho--,To=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new u.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new u.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){var n;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Ho>1?(n={maximumAge:6e5,timeout:0},To=!0):(n=this.options.positionOptions,To=!1),this._geolocationWatchID=u.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,n)}}else u.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},o.prototype._clearWatch=function(){u.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},o})(u.Evented),Xn={maxWidth:100,unit:"metric"},Hn=function(i){this.options=u.extend({},Xn,i),u.bindAll(["_onMove","setUnit"],this)};function ts(i,o,n){var s=n&&n.maxWidth||100,p=i._container.clientHeight/2,f=i.unproject([0,p]),d=i.unproject([s,p]),y=f.distanceTo(d);if(n&&n.unit==="imperial"){var _=3.2808*y;_>5280?Kn(o,s,_/5280,i._getUIString("ScaleControl.Miles")):Kn(o,s,_,i._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?Kn(o,s,y/1852,i._getUIString("ScaleControl.NauticalMiles")):y>=1e3?Kn(o,s,y/1e3,i._getUIString("ScaleControl.Kilometers")):Kn(o,s,y,i._getUIString("ScaleControl.Meters"))}function Kn(i,o,n,s){var p,f,d,y=(p=n,(f=Math.pow(10,(""+Math.floor(p)).length-1))*(d=(d=p/f)>=10?10:d>=5?5:d>=3?3:d>=2?2:d>=1?1:(function(_){var S=Math.pow(10,Math.ceil(-Math.log(_)/Math.LN10));return Math.round(_*S)/S})(d)));i.style.width=o*(y/n)+"px",i.innerHTML=y+" "+s}Hn.prototype.getDefaultPosition=function(){return"bottom-left"},Hn.prototype._onMove=function(){ts(this._map,this._container,this.options)},Hn.prototype.onAdd=function(i){return this._map=i,this._container=pe.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",i.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Hn.prototype.onRemove=function(){pe.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Hn.prototype.setUnit=function(i){this.options.unit=i,ts(this._map,this._container,this.options)};var Vi=function(i){this._fullscreen=!1,i&&i.container&&(i.container instanceof u.window.HTMLElement?this._container=i.container:u.warnOnce("Full screen control 'container' must be a DOM element.")),u.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in u.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in u.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in u.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in u.window.document&&(this._fullscreenchange="MSFullscreenChange")};Vi.prototype.onAdd=function(i){return this._map=i,this._container||(this._container=this._map.getContainer()),this._controlContainer=pe.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",u.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Vi.prototype.onRemove=function(){pe.remove(this._controlContainer),this._map=null,u.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Vi.prototype._checkFullscreenSupport=function(){return!!(u.window.document.fullscreenEnabled||u.window.document.mozFullScreenEnabled||u.window.document.msFullscreenEnabled||u.window.document.webkitFullscreenEnabled)},Vi.prototype._setupUI=function(){var i=this._fullscreenButton=pe.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);pe.create("span","mapboxgl-ctrl-icon",i).setAttribute("aria-hidden",!0),i.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),u.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Vi.prototype._updateTitle=function(){var i=this._getTitle();this._fullscreenButton.setAttribute("aria-label",i),this._fullscreenButton.title=i},Vi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Vi.prototype._isFullscreen=function(){return this._fullscreen},Vi.prototype._changeIcon=function(){(u.window.document.fullscreenElement||u.window.document.mozFullScreenElement||u.window.document.webkitFullscreenElement||u.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Vi.prototype._onClickFullscreen=function(){this._isFullscreen()?u.window.document.exitFullscreen?u.window.document.exitFullscreen():u.window.document.mozCancelFullScreen?u.window.document.mozCancelFullScreen():u.window.document.msExitFullscreen?u.window.document.msExitFullscreen():u.window.document.webkitCancelFullScreen&&u.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var tl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Sa=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),rl=(function(i){function o(n){i.call(this),this.options=u.extend(Object.create(tl),n),u.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.addTo=function(n){return this._map&&this.remove(),this._map=n,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new u.Event("open")),this},o.prototype.isOpen=function(){return!!this._map},o.prototype.remove=function(){return this._content&&pe.remove(this._content),this._container&&(pe.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new u.Event("close")),this},o.prototype.getLngLat=function(){return this._lngLat},o.prototype.setLngLat=function(n){return this._lngLat=u.LngLat.convert(n),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},o.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},o.prototype.getElement=function(){return this._container},o.prototype.setText=function(n){return this.setDOMContent(u.window.document.createTextNode(n))},o.prototype.setHTML=function(n){var s,p=u.window.document.createDocumentFragment(),f=u.window.document.createElement("body");for(f.innerHTML=n;s=f.firstChild;)p.appendChild(s);return this.setDOMContent(p)},o.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},o.prototype.setMaxWidth=function(n){return this.options.maxWidth=n,this._update(),this},o.prototype.setDOMContent=function(n){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=pe.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(n),this._createCloseButton(),this._update(),this._focusFirstElement(),this},o.prototype.addClassName=function(n){this._container&&this._container.classList.add(n)},o.prototype.removeClassName=function(n){this._container&&this._container.classList.remove(n)},o.prototype.setOffset=function(n){return this.options.offset=n,this._update(),this},o.prototype.toggleClassName=function(n){if(this._container)return this._container.classList.toggle(n)},o.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=pe.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},o.prototype._onMouseUp=function(n){this._update(n.point)},o.prototype._onMouseMove=function(n){this._update(n.point)},o.prototype._onDrag=function(n){this._update(n.point)},o.prototype._update=function(n){var s=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=pe.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=pe.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(z){return s._container.classList.add(z)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Wo(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||n)){var p=this._pos=this._trackPointer&&n?n:this._map.project(this._lngLat),f=this.options.anchor,d=(function z(M){if(M){if(typeof M=="number"){var U=Math.round(Math.sqrt(.5*Math.pow(M,2)));return{center:new u.Point(0,0),top:new u.Point(0,M),"top-left":new u.Point(U,U),"top-right":new u.Point(-U,U),bottom:new u.Point(0,-M),"bottom-left":new u.Point(U,-U),"bottom-right":new u.Point(-U,-U),left:new u.Point(M,0),right:new u.Point(-M,0)}}if(M instanceof u.Point||Array.isArray(M)){var O=u.Point.convert(M);return{center:O,top:O,"top-left":O,"top-right":O,bottom:O,"bottom-left":O,"bottom-right":O,left:O,right:O}}return{center:u.Point.convert(M.center||[0,0]),top:u.Point.convert(M.top||[0,0]),"top-left":u.Point.convert(M["top-left"]||[0,0]),"top-right":u.Point.convert(M["top-right"]||[0,0]),bottom:u.Point.convert(M.bottom||[0,0]),"bottom-left":u.Point.convert(M["bottom-left"]||[0,0]),"bottom-right":u.Point.convert(M["bottom-right"]||[0,0]),left:u.Point.convert(M.left||[0,0]),right:u.Point.convert(M.right||[0,0])}}return z(new u.Point(0,0))})(this.options.offset);if(!f){var y,_=this._container.offsetWidth,S=this._container.offsetHeight;y=p.y+d.bottom.y<S?["top"]:p.y>this._map.transform.height-S?["bottom"]:[],p.x<_/2?y.push("left"):p.x>this._map.transform.width-_/2&&y.push("right"),f=y.length===0?"bottom":y.join("-")}var P=p.add(d[f]).round();pe.setTransform(this._container,pn[f]+" translate("+P.x+"px,"+P.y+"px)"),es(this._container,f,"popup")}},o.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var n=this._container.querySelector(Sa);n&&n.focus()}},o.prototype._onClose=function(){this.remove()},o})(u.Evented),rs={version:u.version,supported:ot,setRTLTextPlugin:u.setRTLTextPlugin,getRTLTextPluginStatus:u.getRTLTextPluginStatus,Map:ou,NavigationControl:In,GeolocateControl:el,AttributionControl:ei,ScaleControl:Hn,FullscreenControl:Vi,Popup:rl,Marker:wa,Style:mi,LngLat:u.LngLat,LngLatBounds:u.LngLatBounds,Point:u.Point,MercatorCoordinate:u.MercatorCoordinate,Evented:u.Evented,config:u.config,prewarm:function(){se().acquire(ae)},clearPrewarmedResources:function(){var i=Be;i&&(i.isPreloaded()&&i.numActive()===1?(i.release(ae),Be=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()"))},get accessToken(){return u.config.ACCESS_TOKEN},set accessToken(i){u.config.ACCESS_TOKEN=i},get baseApiUrl(){return u.config.API_URL},set baseApiUrl(i){u.config.API_URL=i},get workerCount(){return de.workerCount},set workerCount(i){de.workerCount=i},get maxParallelImageRequests(){return u.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(i){u.config.MAX_PARALLEL_IMAGE_REQUESTS=i},clearStorage:function(i){u.clearTileCache(i)},workerUrl:""};return rs})),Le}))})(ju)),ju.exports}var ed=Qf();const oo=Ct.getDefaultExportFromCjs(ed);var Cl={exports:{}},Fc,ph;function td(){if(ph)return Fc;ph=1,Fc=K;var T={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"};function K(ee){if(!ee||!ee.type)return null;var qe=T[ee.type];if(!qe)return null;if(qe==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:ee}]};if(qe==="feature")return{type:"FeatureCollection",features:[ee]};if(qe==="featurecollection")return ee}return Fc}function qu(T){switch(T&&T.type||null){case"FeatureCollection":return T.features=T.features.reduce(function(K,ee){return K.concat(qu(ee))},[]),T;case"Feature":return T.geometry?qu(T.geometry).map(function(K){var ee={type:"Feature",properties:JSON.parse(JSON.stringify(T.properties)),geometry:K};return T.id!==void 0&&(ee.id=T.id),ee}):[T];case"MultiPoint":return T.coordinates.map(function(K){return{type:"Point",coordinates:K}});case"MultiPolygon":return T.coordinates.map(function(K){return{type:"Polygon",coordinates:K}});case"MultiLineString":return T.coordinates.map(function(K){return{type:"LineString",coordinates:K}});case"GeometryCollection":return T.geometries.map(qu).reduce(function(K,ee){return K.concat(ee)},[]);case"Point":case"Polygon":case"LineString":return[T]}}const rd=Object.freeze(Object.defineProperty({__proto__:null,default:qu},Symbol.toStringTag,{value:"Module"})),id=Ct.getAugmentedNamespace(rd);var Oc,hh;function nd(){return hh||(hh=1,Oc=function(K){return ee(K);function ee(qe){return Array.isArray(qe)&&qe.length&&typeof qe[0]=="number"?[qe]:qe.reduce(function(Le,me){return Array.isArray(me)&&Array.isArray(me[0])?Le.concat(ee(me)):(Le.push(me),Le)},[])}}),Oc}var Vc,fh;function od(){if(fh)return Vc;fh=1;var T=td(),K=id,ee=nd();return K instanceof Function||(K=K.default),Vc=function(qe){if(!qe)return[];var Le=K(T(qe)),me=[];return Le.features.forEach(function(u){u.geometry&&(me=me.concat(ee(u.geometry.coordinates)))}),me},Vc}var Vu,dh;function ad(){if(dh)return Vu;dh=1;function T(ue,_e){(_e==null||_e>ue.length)&&(_e=ue.length);for(var le=0,We=new Array(_e);le<_e;le++)We[le]=ue[le];return We}function K(ue){if(Array.isArray(ue))return ue}function ee(ue,_e){if(!(ue instanceof _e))throw new TypeError("Cannot call a class as a function")}function qe(ue,_e){for(var le=0;le<_e.length;le++){var We=_e[le];We.enumerable=We.enumerable||!1,We.configurable=!0,"value"in We&&(We.writable=!0),Object.defineProperty(ue,We.key,We)}}function Le(ue,_e,le){return _e&&qe(ue.prototype,_e),ue}function me(ue,_e){return _e!=null&&typeof Symbol<"u"&&_e[Symbol.hasInstance]?!!_e[Symbol.hasInstance](ue):ue instanceof _e}function u(ue,_e){var le=ue==null?null:typeof Symbol<"u"&&ue[Symbol.iterator]||ue["@@iterator"];if(le!=null){var We=[],et=!0,ut=!1,Ft,Nt;try{for(le=le.call(ue);!(et=(Ft=le.next()).done)&&(We.push(Ft.value),!(_e&&We.length===_e));et=!0);}catch(Er){ut=!0,Nt=Er}finally{try{!et&&le.return!=null&&le.return()}finally{if(ut)throw Nt}}return We}}function ot(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pe(ue,_e){return K(ue)||u(ue,_e)||Ze(ue,_e)||ot()}function dt(ue){"@swc/helpers - typeof";return ue&&typeof Symbol<"u"&&ue.constructor===Symbol?"symbol":typeof ue}function Ze(ue,_e){if(ue){if(typeof ue=="string")return T(ue,_e);var le=Object.prototype.toString.call(ue).slice(8,-1);if(le==="Object"&&ue.constructor&&(le=ue.constructor.name),le==="Map"||le==="Set")return Array.from(le);if(le==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(le))return T(ue,_e)}}var yr=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,Zi=Object.getOwnPropertyNames,rt=Object.prototype.hasOwnProperty,rr=function(ue){throw TypeError(ue)},gr=function(ue,_e){for(var le in _e)yr(ue,le,{get:_e[le],enumerable:!0})},ao=function(ue,_e,le,We){if(_e&&(typeof _e>"u"?"undefined":dt(_e))==="object"||typeof _e=="function"){var et=!0,ut=!1,Ft=void 0;try{for(var Nt=function(){var ir=Jt.value;!rt.call(ue,ir)&&ir!==le&&yr(ue,ir,{get:function(){return _e[ir]},enumerable:!(We=Ce(_e,ir))||We.enumerable})},Er=Zi(_e)[Symbol.iterator](),Jt;!(et=(Jt=Er.next()).done);et=!0)Nt()}catch(ir){ut=!0,Ft=ir}finally{try{!et&&Er.return!=null&&Er.return()}finally{if(ut)throw Ft}}}return ue},Sr=function(ue){return ao(yr({},"__esModule",{value:!0}),ue)},so=function(ue,_e,le){return _e.has(ue)||rr("Cannot "+le)},pr=function(ue,_e,le){return so(ue,_e,"read from private field"),le?le.call(ue):_e.get(ue)},Mi=function(ue,_e,le){return _e.has(ue)?rr("Cannot add the same private member more than once"):me(_e,WeakSet)?_e.add(ue):_e.set(ue,le)},tn=function(ue,_e,le,We){return so(ue,_e,"write to private field"),_e.set(ue,le),le},mn={};gr(mn,{default:function(){return Ei}}),Vu=Sr(mn);var fi=function(ue){return Object.prototype.toString.call(ue)},zr=function(ue){return ArrayBuffer.isView(ue)&&!me(ue,DataView)},Gi=function(ue){return fi(ue)==="[object Date]"},Si=function(ue){return fi(ue)==="[object RegExp]"},Pn=function(ue){return fi(ue)==="[object Error]"},Ht=function(ue){return fi(ue)==="[object Boolean]"},Kr=function(ue){return fi(ue)==="[object Number]"},Bo=function(ue){return fi(ue)==="[object String]"},di=Array.isArray,An=Object.getOwnPropertyDescriptor,zn=Object.prototype.propertyIsEnumerable,Ro=Object.getOwnPropertySymbols,Ii=Object.prototype.hasOwnProperty;function oi(ue){for(var _e=Object.keys(ue),le=Ro(ue),We=0;We<le.length;We++)zn.call(ue,le[We])&&_e.push(le[We]);return _e}function Di(ue,_e){var le;return!(!((le=An(ue,_e))===null||le===void 0)&&le.writable)}function rn(ue,_e){if((typeof ue>"u"?"undefined":dt(ue))==="object"&&ue!==null){var le;if(di(ue))le=[];else if(Gi(ue))le=new Date(ue.getTime?ue.getTime():ue);else if(Si(ue))le=new RegExp(ue);else if(Pn(ue))le={message:ue.message};else if(Ht(ue)||Kr(ue)||Bo(ue))le=Object(ue);else{if(zr(ue))return ue.slice();le=Object.create(Object.getPrototypeOf(ue))}var We=_e.includeSymbols?oi:Object.keys,et=!0,ut=!1,Ft=void 0;try{for(var Nt=We(ue)[Symbol.iterator](),Er;!(et=(Er=Nt.next()).done);et=!0){var Jt=Er.value;le[Jt]=ue[Jt]}}catch(ir){ut=!0,Ft=ir}finally{try{!et&&Nt.return!=null&&Nt.return()}finally{if(ut)throw Ft}}return le}return ue}var nn={includeSymbols:!1,immutable:!1};function Wi(ue,_e){var le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nn,We=[],et=[],ut=!0,Ft=le.includeSymbols?oi:Object.keys,Nt=!!le.immutable;return(function Er(Jt){var ir=Nt?rn(Jt,le):Jt,hr={},vr=!0,Ve={node:ir,node_:Jt,path:[].concat(We),parent:et[et.length-1],parents:et,key:We[We.length-1],isRoot:We.length===0,level:We.length,circular:void 0,isLeaf:!1,notLeaf:!0,notRoot:!0,isFirst:!1,isLast:!1,update:function(Mr){var vn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Ve.isRoot||(Ve.parent.node[Ve.key]=Mr),Ve.node=Mr,vn&&(vr=!1)},delete:function(Mr){delete Ve.parent.node[Ve.key],Mr&&(vr=!1)},remove:function(Mr){di(Ve.parent.node)?Ve.parent.node.splice(Ve.key,1):delete Ve.parent.node[Ve.key],Mr&&(vr=!1)},keys:null,before:function(Mr){hr.before=Mr},after:function(Mr){hr.after=Mr},pre:function(Mr){hr.pre=Mr},post:function(Mr){hr.post=Mr},stop:function(){ut=!1},block:function(){vr=!1}};if(!ut)return Ve;function Ti(){if(dt(Ve.node)==="object"&&Ve.node!==null){(!Ve.keys||Ve.node_!==Ve.node)&&(Ve.keys=Ft(Ve.node)),Ve.isLeaf=Ve.keys.length===0;for(var Tr=0;Tr<et.length;Tr++)if(et[Tr].node_===Jt){Ve.circular=et[Tr];break}}else Ve.isLeaf=!0,Ve.keys=null;Ve.notLeaf=!Ve.isLeaf,Ve.notRoot=!Ve.isRoot}Ti();var Gr=_e.call(Ve,Ve.node);if(Gr!==void 0&&Ve.update&&Ve.update(Gr),hr.before&&hr.before.call(Ve,Ve.node),!vr)return Ve;if(dt(Ve.node)==="object"&&Ve.node!==null&&!Ve.circular){et.push(Ve),Ti();var on,Mn=!0,Dn=!1,Ln=void 0;try{for(var an=Object.entries((on=Ve.keys)!==null&&on!==void 0?on:[])[Symbol.iterator](),lo;!(Mn=(lo=an.next()).done);Mn=!0){var yn=pe(lo.value,2),Bn=yn[0],ai=yn[1],gn;We.push(ai),hr.pre&&hr.pre.call(Ve,Ve.node[ai],ai);var sn=Er(Ve.node[ai]);Nt&&Ii.call(Ve.node,ai)&&!Di(Ve.node,ai)&&(Ve.node[ai]=sn.node),sn.isLast=!((gn=Ve.keys)===null||gn===void 0)&&gn.length?+Bn===Ve.keys.length-1:!1,sn.isFirst=+Bn==0,hr.post&&hr.post.call(Ve,sn),We.pop()}}catch(Tr){Dn=!0,Ln=Tr}finally{try{!Mn&&an.return!=null&&an.return()}finally{if(Dn)throw Ln}}et.pop()}return hr.after&&hr.after.call(Ve,Ve.node),Ve})(ue).node}var Ur,Kt,Ir=(function(){function ue(_e){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nn;ee(this,ue),Mi(this,Ur),Mi(this,Kt),tn(this,Ur,_e),tn(this,Kt,le)}return Le(ue,[{key:"get",value:function(le){for(var We=pr(this,Ur),et=0;We&&et<le.length;et++){var ut=le[et];if(!Ii.call(We,ut)||!pr(this,Kt).includeSymbols&&(typeof ut>"u"?"undefined":dt(ut))==="symbol")return;We=We[ut]}return We}},{key:"has",value:function(le){for(var We=pr(this,Ur),et=0;We&&et<le.length;et++){var ut=le[et];if(!Ii.call(We,ut)||!pr(this,Kt).includeSymbols&&(typeof ut>"u"?"undefined":dt(ut))==="symbol")return!1;We=We[ut]}return!0}},{key:"set",value:function(le,We){var et=pr(this,Ur),ut=0;for(ut=0;ut<le.length-1;ut++){var Ft=le[ut];Ii.call(et,Ft)||(et[Ft]={}),et=et[Ft]}return et[le[ut]]=We,We}},{key:"map",value:function(le){return Wi(pr(this,Ur),le,{immutable:!0,includeSymbols:!!pr(this,Kt).includeSymbols})}},{key:"forEach",value:function(le){return tn(this,Ur,Wi(pr(this,Ur),le,pr(this,Kt))),pr(this,Ur)}},{key:"reduce",value:function(le,We){var et=arguments.length===1,ut=et?pr(this,Ur):We;return this.forEach(function(Ft){(!this.isRoot||!et)&&(ut=le.call(this,ut,Ft))}),ut}},{key:"paths",value:function(){var le=[];return this.forEach(function(){le.push(this.path)}),le}},{key:"nodes",value:function(){var le=[];return this.forEach(function(){le.push(this.node)}),le}},{key:"clone",value:function(){var le=[],We=[],et=pr(this,Kt);return zr(pr(this,Ur))?pr(this,Ur).slice():(function ut(Ft){for(var Nt=0;Nt<le.length;Nt++)if(le[Nt]===Ft)return We[Nt];if((typeof Ft>"u"?"undefined":dt(Ft))==="object"&&Ft!==null){var Er=rn(Ft,et);le.push(Ft),We.push(Er);var Jt=et.includeSymbols?oi:Object.keys,ir=!0,hr=!1,vr=void 0;try{for(var Ve=Jt(Ft)[Symbol.iterator](),Ti;!(ir=(Ti=Ve.next()).done);ir=!0){var Gr=Ti.value;Er[Gr]=ut(Ft[Gr])}}catch(on){hr=!0,vr=on}finally{try{!ir&&Ve.return!=null&&Ve.return()}finally{if(hr)throw vr}}return le.pop(),We.pop(),Er}return Ft})(pr(this,Ur))}}]),ue})();Ur=new WeakMap,Kt=new WeakMap;var mt=function(ue,_e){return new Ir(ue,_e)};mt.get=function(ue,_e,le){return new Ir(ue,le).get(_e)},mt.set=function(ue,_e,le,We){return new Ir(ue,We).set(_e,le)},mt.has=function(ue,_e,le){return new Ir(ue,le).has(_e)},mt.map=function(ue,_e,le){return new Ir(ue,le).map(_e)},mt.forEach=function(ue,_e,le){return new Ir(ue,le).forEach(_e)},mt.reduce=function(ue,_e,le,We){return new Ir(ue,We).reduce(_e,le)},mt.paths=function(ue,_e){return new Ir(ue,_e).paths()},mt.nodes=function(ue,_e){return new Ir(ue,_e).nodes()},mt.clone=function(ue,_e){return new Ir(ue,_e).clone()};var Ei=mt;return Vu=Ei,Vu}var Uc,mh;function sd(){if(mh)return Uc;mh=1,Uc=T;function T(K){if(!(this instanceof T))return new T(K);this._bbox=K||[1/0,1/0,-1/0,-1/0],this._valid=!!K}return T.prototype.include=function(K){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],K[0]),this._bbox[1]=Math.min(this._bbox[1],K[1]),this._bbox[2]=Math.max(this._bbox[2],K[0]),this._bbox[3]=Math.max(this._bbox[3],K[1]),this},T.prototype.equals=function(K){var ee;return K instanceof T?ee=K.bbox():ee=K,this._bbox[0]==ee[0]&&this._bbox[1]==ee[1]&&this._bbox[2]==ee[2]&&this._bbox[3]==ee[3]},T.prototype.center=function(K){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},T.prototype.union=function(K){this._valid=!0;var ee;return K instanceof T?ee=K.bbox():ee=K,this._bbox[0]=Math.min(this._bbox[0],ee[0]),this._bbox[1]=Math.min(this._bbox[1],ee[1]),this._bbox[2]=Math.max(this._bbox[2],ee[2]),this._bbox[3]=Math.max(this._bbox[3],ee[3]),this},T.prototype.bbox=function(){return this._valid?this._bbox:null},T.prototype.contains=function(K){if(!K)return this._fastContains();if(!this._valid)return null;var ee=K[0],qe=K[1];return this._bbox[0]<=ee&&this._bbox[1]<=qe&&this._bbox[2]>=ee&&this._bbox[3]>=qe},T.prototype.intersect=function(K){if(!this._valid)return null;var ee;return K instanceof T?ee=K.bbox():ee=K,!(this._bbox[0]>ee[2]||this._bbox[2]<ee[0]||this._bbox[3]<ee[1]||this._bbox[1]>ee[3])},T.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var K="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",K)},T.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null},Uc}var yh;function ld(){if(yh)return Cl.exports;yh=1;var T=od(),K=ad(),ee=sd(),qe={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},Le=Object.keys(qe);Cl.exports=function(u){return me(u).bbox()},Cl.exports.polygon=function(u){return me(u).polygon()},Cl.exports.bboxify=function(u){return K(u).map(function(ot){if(ot){var pe=Le.some(function(dt){return ot[dt]?qe[dt].indexOf(ot.type)!==-1:!1});pe&&(ot.bbox=me(ot).bbox(),this.update(ot))}})};function me(u){for(var ot=ee(),pe=T(u),dt=0;dt<pe.length;dt++)ot.include(pe[dt]);return ot}return Cl.exports}var ud=ld();const cd=Ct.getDefaultExportFromCjs(ud),pd={methods:{getIconDetails(T){const K={};switch(T){case"cities":K.name="fa-regular fa-city";break;case"towns":K.name="fa-regular fa-house-chimney-window";break;case"islands":K.name="fa-regular fa-ship";break;case"regions":K.name="fa-regular fa-map-location-dot";break;case"national-parks":K.name="fa-kit fa-vs-icon-national-park";break;case"acco":K.name="fa-regular fa-bed";break;case"acti":K.name="fa-regular fa-person-walking";break;case"attr":K.name="fa-regular fa-camera";break;case"even":K.name="fa-regular fa-ticket";break;case"cate":K.name="fa-regular fa-utensils";break;case"reta":K.name="fa-regular fa-bag-shopping";break;case"featured":K.name="fa-solid fa-star";break;case"twnv":K.name="";break;case"vics":K.name="fa-kit fa-vs-icentre-information";break;case"outlander-castle":K.name="fa-regular fa-chess-rook";break;case"outlander-church-abbey":K.name="fa-regular fa-church";break;case"outlander-city-town-village":K.name="fa-regular fa-city";break;case"outlander-heritage":K.name="fa-regular fa-landmark";break;case"outlander-landscape-park":K.name="fa-regular fa-mountain";break;case"outlander-palace-house":K.name="fa-regular fa-crown";break;case"distilleries":K.name="fa-kit fa-vs-distillery";break;case"itinerary-stop":K.name="";break}return K}}},hd={name:"VsMapMarkerIcon",status:"prototype",release:"0.0.1",components:{VsIcon:Ct.VsIcon},mixins:[pd],props:{id:{type:String,required:!0},isHovered:{type:Boolean,default:!1},number:{type:String,default:""},isMapMarker:{type:Boolean,default:!1}},computed:{mapMarkerType(){let T="fa-solid fa-location-pin";return this.id==="twnv"&&(T="fa-solid fa-location-dot"),T},parentClasses(){return this.isMapMarker?"vs-map-marker-icon--map-marker":""},markerClasses(){return[`vs-map-marker-icon__marker--${this.id}`,this.isHovered?"vs-map-marker-icon__marker--outline":""]}}},fd={key:0,class:"vs-map-marker-icon__count"};function dd(T,K,ee,qe,Le,me){const u=D.resolveComponent("VsIcon");return D.openBlock(),D.createElementBlock("div",{"data-test":"vs-map-marker-icon",class:D.normalizeClass(["vs-map-marker-icon",me.parentClasses])},[D.createVNode(u,{icon:me.mapMarkerType,class:D.normalizeClass(["vs-map-marker-icon__marker",me.markerClasses]),size:"xl"},null,8,["icon","class"]),ee.number?(D.openBlock(),D.createElementBlock("span",fd,[K[0]||(K[0]=D.createElementVNode("span",{class:"visually-hidden"}," Stop ",-1)),D.createTextVNode(" "+D.toDisplayString(ee.number),1)])):(D.openBlock(),D.createBlock(u,{key:1,class:"vs-map-marker-icon__icon",icon:T.getIconDetails(ee.id).name,size:"xs"},null,8,["icon"]))],2)}const Zu=Ct._export_sfc(hd,[["render",dd]]);let Ba=null;const md={name:"VsMapMarker",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:Zu},props:{feature:{type:Object,required:!0},mapId:{type:String,required:!0},hasPopups:{type:Boolean,required:!0},selectedPlace:{type:String,default:null}},emits:["showDetail","setCategory"],setup(){Ba=en()},computed:{isActive(){return!!(this.activePlace&&this.activePlace.properties&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties&&this.highlightedPlace.properties.id===this.feature.properties.id)},...ra.mapState(en,{highlightedPlace(T){return T.getHoveredStop(this.mapId)},activePlace(T){return T.getActivePlace(this.mapId)?T.getActivePlace(this.mapId):""},activeSubcat(T){return T.selectedSubCategory}}),getMarkerIcon(){let T;return this.feature.properties.type!==""?T=this.feature.properties.type:this.activeSubcat!==null?T=this.activeSubcat:T="featured",T==="null"&&(T=""),T}},watch:{isActive(){return this.activePlace&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties.id===this.feature.properties.id?!0:(this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&Ba.setActiveMarkerPos(this.feature.geometry.coordinates),!1)},activePlace(){this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&Ba.setActiveMarkerPos(this.feature.geometry.coordinates)}},mounted(){this.hasPopups&&document.body.addEventListener("click",this.handleClickEvent)},beforeUnmount(){document.body.removeEventListener("click",this.handleClickEvent)},methods:{markerClick(){Ba.setActiveMarkerPos(this.feature.geometry.coordinates),Ba.setActivePlace({mapId:this.mapId,activeFeature:this.feature}),this.$emit("showDetail",this.feature),this.$emit("setCategory",this.feature.properties.type)},handleHover(T){Ba.setHoveredPlace({mapId:this.mapId,hoveredFeature:T})},handleClickEvent(T){const K=document.getElementsByClassName("mapboxgl-canvas");T.target===K[0]&&Ba.setActivePlace({mapId:this.mapId,activeFeature:null})}}},yd=["aria-label"];function gd(T,K,ee,qe,Le,me){const u=D.resolveComponent("VsMapMarkerIcon");return D.openBlock(),D.createElementBlock("button",{type:"button",class:D.normalizeClass(["vs-map-marker",me.isActive?"vs-map-marker--active":""]),"data-test":"vs-map-marker",onClick:K[0]||(K[0]=(...ot)=>me.markerClick&&me.markerClick(...ot)),onKeydown:K[1]||(K[1]=D.withKeys((...ot)=>me.markerClick&&me.markerClick(...ot),["enter"])),onMouseover:K[2]||(K[2]=ot=>me.handleHover(ee.feature)),onMouseleave:K[3]||(K[3]=ot=>me.handleHover("")),onFocusin:K[4]||(K[4]=ot=>me.handleHover(ee.feature)),onFocusout:K[5]||(K[5]=ot=>me.handleHover("")),"aria-label":me.getMarkerIcon},[D.createVNode(u,{id:me.getMarkerIcon,"is-map-marker":!0,number:ee.feature.properties.stopCount?ee.feature.properties.stopCount:""},null,8,["id","number"])],42,yd)}const gh=Ct._export_sfc(md,[["render",gd]]);let zs=null;const vd={name:"VsMap",status:"deprecated",release:"0.0.1",components:{VsWarning:Ct.VsWarning,VsLoading:Ct.VsLoading},props:{overviewMapLatitude:{type:String,default:"57.81"},overviewMapLongitude:{type:String,default:"-5.51748"},overviewMapZoom:{type:String,default:"5"},mapId:{type:String,required:!0},isVisible:{type:Boolean,required:!0},places:{type:Array,required:!0},filters:{type:Array,default(){return[]}},fitToMarkers:{type:Boolean,default:!1},showPolygons:{type:Boolean,default:!1},selectedItem:{type:Object,default:null},boundsData:{type:Object,default:()=>{}},showInfoMessage:{type:Boolean,default:null},resetZoom:{type:Boolean,default:!1},showMarkerPopups:{type:Boolean,default:!0},loadBrandingImmediately:{type:Boolean,default:!1}},emits:["map-ready","setCategory","showDetail","zoom-reset"],setup(){zs=en()},data(){return{isDesktop:!1,geojsonData:{type:"FeatureCollection",features:[]},polygons:{type:"FeatureCollection",features:[]},multiPolygons:[],mapbox:{map:null,bounds:null,rotation:0,config:{container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",pitchWithRotate:!1,dragRotate:!1}},markers:[],popup:null,hoveredStateId:null,activeStateId:null,showMapMessage:!0,isLoading:!0,showZoomMessage:null}},computed:{getZoom(){return this.mapbox.map?this.mapbox.map.getZoom():null},...ra.mapState(en,{activeMarkerPostion(T){return this.mapbox.map?T.activeMarkerPos:null},highlightedPlace(T){return this.mapbox.map?T.getHoveredStop(this.mapId):null},activePlace(T){return this.mapbox.map?T.getActivePlace(this.mapId):null}})},watch:{isVisible(T){T&&this.mapbox.map!==null&&setTimeout(()=>{this.mapbox.map.resize()},20)},places:{handler(){this.geojsonData.features=[],this.initialiseMapFeatures(),this.initialiseMapMarkers()},deep:!0},showPolygons(T){T===!0?this.showMapPolygons():this.hideMapPolygons()},highlightedPlace(T){T&&(T.length===0?this.removeHoveredPolygon():T.geometry.type!=="Point"&&this.addHoveredPolygon(T))},selectedItem(T){if(T&&T.geometry.type!=="Point"){let K=[];K=this.polygons.features.filter(ee=>ee.properties.id===T.properties.id),K.length>0&&this.addActivePolygon(T)}T||this.removeActivePolygon()},activeMarkerPostion(T){this.checkPointIsVisible(T)||this.centreMapOnPoint(T)},showInfoMessage(T){T?this.showMapMessage=!0:this.showMapMessage=!1},resetZoom(T){T&&(this.mapbox.map.fitBounds(this.calculateBoundingBox()),this.$emit("zoom-reset"),this.showInfoMessage&&(this.showMapMessage=!0))}},mounted(){zs.addMapInstance({id:this.mapId,filters:this.filters,places:this.places,activePins:this.places}),this.lazyloadMapComponent(),this.isTablet=window.innerWidth>=768,window.addEventListener("resize",this.onResize),this.loadBrandingImmediately?uh.init({div:this.mapId}):window.addEventListener("DOMContentLoaded",()=>{uh.init({div:this.mapId})})},methods:{addMap(){const T=this.calculateBoundingBox();this.mapbox.config.container=this.$refs.mapbox,this.mapbox.map=new oo.Map({container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",bounds:T,maxZoom:18,minZoom:4,trackResize:!0}),this.mapbox.map.scrollZoom.disable(),this.mapbox.map.on("rotate",()=>{this.mapbox.rotation=this.mapbox.map.transform.angle}),this.mapbox.map.resize(),this.mapbox.map.on("load",()=>{this.addMapPolygons(),this.showMapMessage=!1,this.isLoading=!1,this.$emit("map-ready",!0),this.mapbox.map.boxZoom.enable()}),this.mapbox.map.on("zoomend",()=>{this.mapbox.map.getZoom()===4?(this.showZoomMessage="too-far",this.showMapMessage=!0):this.mapbox.map.getZoom()===18?(this.showZoomMessage="too-close",this.showMapMessage=!0):this.showInfoMessage||(this.showZoomMessage=null,this.showMapMessage=!1)})},addMapControls(){const T=new oo.NavigationControl;this.mapbox.map.addControl(T,"top-right"),this.mapbox.map.addControl(new oo.FullscreenControl)},initialiseMapFeatures(){this.places.map(T=>{if(typeof T.geometry<"u"){const K=this.getCoordinateArray(T);return this.getMapFeatures(T,K)}return T.latitude&&T.longitude?this.getItineraryMapFeatures(T):!1})},getCoordinateArray(T){return T.geometry.type==="Polygon"?[T.geometry.coordinates[0]]:T.geometry.type==="MultiPolygon"?[T.geometry.coordinates]:[T.geometry.coordinates[0],T.geometry.coordinates[1]]},getMapFeatures(T,K){return this.geojsonData.features.push({type:"Feature",geometry:{type:T.geometry.type,coordinates:K},properties:{title:T.properties.title,imageSrc:T.image,type:typeof T.properties.category<"u"?T.properties.category.id:"",id:T.properties.id},id:T.properties.id})},getItineraryMapFeatures(T){const K=this._uid;return this.geojsonData.features.push({type:"Feature",geometry:{type:"Point",coordinates:[parseFloat(T.longitude),parseFloat(T.latitude)]},properties:{title:T.title,imageSrc:T.imageSrc,type:"itinerary-stop",stopCount:T.stopCount,id:K},id:K})},initialiseMapMarkers(){let T=0;this.initialLoad&&(T=1e3),setTimeout(()=>{if(this.markers!==null){for(let K=this.markers.length-1;K>=0;K--)this.markers[K].remove();this.markers=[]}this.geojsonData.features.forEach(K=>{K.geometry.type==="Point"&&this.createMapMarker(K)})},T)},createMapMarker(T){const K=D.h(gh,{feature:T,mapId:this.mapId,hasPopups:this.showMarkerPopups,onShowDetail:Le=>{this.$emit("showDetail",Le)},onSetCategory:Le=>{this.$emit("setCategory",Le)}}),ee=document.createElement("div");this.$refs.mapboxOuter.appendChild(ee),D.render(K,ee),T&&this.showMarkerPopups&&this.addMapPopup(T);const qe=new oo.Marker(ee.children[0]).setLngLat(T.geometry.coordinates).setPopup(this.popup).addTo(this.mapbox.map);this.setupMarkerListeners(qe),this.markers.push(qe),ee.remove()},hideMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","none"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","none")},showMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","visible"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","visible")},addMapPolygons(){this.geojsonData.features.forEach(T=>{T.geometry.type==="Polygon"?this.polygons.features.includes(T.properties.id)||this.polygons.features.push(T):T.geometry.type==="MultiPolygon"&&(this.polygons.features.includes(T.properties.id)||this.multiPolygons.push(T))}),this.multiPolygons.forEach(T=>{const K=T.properties;T.geometry.coordinates[0].forEach(ee=>{this.polygons.features.push({geometry:{type:"Polygon",coordinates:ee},id:K.id,properties:{id:K.id,imageSrc:K.imageSrc,title:K.title,type:K.type},type:"Feature"})})}),this.polygons.features.length>0&&(this.mapbox.map.addSource("regions",{type:"geojson",data:this.polygons,promoteId:"id"}),this.mapbox.map.addLayer({id:"regionFills",type:"fill",source:"regions",layout:{},paint:{"fill-color":["case",["==",["feature-state","interaction-state"],"hover"],"rgba(168,48,140,0.5)",["==",["feature-state","interaction-state"],"active"],"rgba(168,48,140,0.5)","rgba(25,200,197,0.6)"],"fill-opacity":.8}}),this.mapbox.map.addLayer({id:"regionBorders",type:"line",source:"regions",layout:{},paint:{"line-color":"#fff","line-width":1}}),this.hideMapPolygons(),this.mapbox.map.on("mousemove","regionFills",T=>{T.features.length>0&&(this.addMapPopup(T),this.removeHoveredPolygon(),this.addHoveredPolygon(T.features[0]))}),this.mapbox.map.on("mouseleave","regionFills",T=>{this.removeMapPopup(T),this.removeHoveredPolygon()}),this.mapbox.map.on("click","regionFills",T=>{this.removeActivePolygon(),this.addActivePolygon(T.features[0]),this.addMapPopup(T.features[0])}))},removeActivePolygon(){this.mapbox.map.style._layers.regionFills&&(this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":""}),this.activeStateId=null)},addActivePolygon(T){this.activeStateId=T.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":"active"}),zs.setActivePlace({mapId:this.mapId,activeFeature:T}),this.$emit("showDetail",T),this.$emit("setCategory","regions")},removeHoveredPolygon(){if(this.hoveredStateId){let T="";this.hoveredStateId===this.activeStateId&&(T="active"),this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":T})}zs.setHoveredPlace({mapId:this.mapId,hoveredFeature:""}),this.hoveredStateId=null},addHoveredPolygon(T){this.hoveredStateId=T.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":"hover"}),this.addMapPopup(T),zs.setHoveredPlace({mapId:this.mapId,hoveredFeature:T})},addMapPopup(T){let K="";T.features?K=T.features[0]:K=T;const ee=this.getCoordinates(K),qe=this.getPopupHtml(K);K.properties.id&&(this.removeMapPopup(T),this.popup=new oo.Popup({closeButton:!1,offset:{top:[0,20],bottom:[0,-40],left:[30,-20],right:[-30,-20]}}).setLngLat(ee).setHTML(qe).addTo(this.mapbox.map))},removeMapPopup(T){this.popup&&(this.popup.remove(),this.popup=null),T._popup&&T._popup.remove()},getCoordinates(T){return T.geometry.type==="Polygon"?this.findFeatureCentre(T.geometry.coordinates):T.geometry.type==="MultiPolygon"?this.findFeatureCentre(T.geometry.coordinates[0]):T.geometry.coordinates},findFeatureCentre(T){const K=[],ee=[];return T[0].forEach(qe=>{K.push(qe[1]),ee.push(qe[0])}),{lat:(Math.min(...K)+Math.max(...K))/2,lng:(Math.min(...ee)+Math.max(...ee))/2}},getPopupHtml(T){return T.properties.imageSrc&&T.properties.stopCount?`
|
|
498
|
+
<img class="vs-map__popup-image" src="${T.properties.imageSrc}" />
|
|
502
499
|
<div>
|
|
503
|
-
<h4 class="vs-map__popup-subtitle">Stop ${
|
|
504
|
-
<p class="vs-map__popup-title">${
|
|
500
|
+
<h4 class="vs-map__popup-subtitle">Stop ${T.properties.stopCount}</h4>
|
|
501
|
+
<p class="vs-map__popup-title">${T.properties.title}</p>
|
|
505
502
|
</div>
|
|
506
503
|
`:`
|
|
507
|
-
<p class="vs-map__popup-title">${
|
|
508
|
-
`},setupMarkerListeners(y){document.body.addEventListener("keyup",x=>{(x.key==="Escape"||x.key==="Tab")&&(this.removeMapPopup(y),this.showMarkerPopups&&Hs.setActivePlace({mapId:this.mapId,activeFeature:null}))}),y.getElement().addEventListener("keyup",x=>{x.key==="Enter"&&(y._popup.isOpen()||y._popup.addTo(this.mapbox.map))})},fitToBounds(){this.mapbox.map.fitBounds(qw(this.geojsonData),{padding:{top:100,bottom:100,left:100,right:100}})},initialiseMapComponent(){this.addMap(),this.addMapControls(),this.places.length&&this.initialiseMapFeatures(),this.geojsonData.features.length&&(this.initialiseMapMarkers(),this.fitToMarkers&&this.fitToBounds())},lazyloadMapComponent(){if(fo.supported({failIfMajorPerformanceCaveat:!0}),!("IntersectionObserver"in window)){this.initialiseMapComponent();return}this.observer=new IntersectionObserver(y=>{y[0].intersectionRatio>0&&(this.observer.unobserve(this.$el),this.initialiseMapComponent())}),this.observer.observe(this.$el)},onResize(){this.isTablet=window.innerWidth>=768},getBoundsFromPolygon(){const y=this.boundsData.coordinates[0];return y.reduce((_,x)=>_.extend(x),new fo.LngLatBounds(y[0],y[0]))},checkPointIsVisible(){return this.mapbox.map.getBounds().contains(this.activeMarkerPostion)},centreMapOnPoint(y){this.mapbox.map.flyTo({center:y})},calculateBoundingBox(){let y;if(typeof this.boundsData>"u"||this.boundsData.type==="undefined")y=[[-7.555827,54.608836],[-.778285,60.880894]];else if(this.boundsData.type==="bounds"){const _=new fo.LngLat(this.boundsData.coordinates[1][0],this.boundsData.coordinates[1][1]),x=new fo.LngLat(this.boundsData.coordinates[0][0],this.boundsData.coordinates[0][1]);y=new fo.LngLatBounds(_,x)}else this.boundsData.type==="Polygon"?y=this.getBoundsFromPolygon():y=[[-7.555827,54.608836],[-.778285,60.880894]];return y}}},Xw={class:"vs-map","data-test":"vs-map"},Kw={class:"vs-map__message-box"},Jw={class:"vs-map__message-text"},Yw={ref:"mapboxOuter",class:"vs-map__map-outer"},Qw=["id"];function e2(y,_,x,k,E,D){const u=q.resolveComponent("VsLoading"),U=q.resolveComponent("VsWarning");return q.openBlock(),q.createElementBlock("div",Xw,[E.showMapMessage?(q.openBlock(),q.createElementBlock("div",{key:0,class:q.normalizeClass(["vs-map__message",E.showZoomMessage?"":"vs-map__message--with-overlay"]),"data-test":"vs-map__message"},[q.createElementVNode("div",Kw,[E.isLoading?(q.openBlock(),q.createBlock(u,{key:0,class:"vs-map__loading"})):q.createCommentVNode("",!0),q.createElementVNode("p",Jw,[E.isLoading?q.renderSlot(y.$slots,"map-loading-text",{},void 0,void 0,0):x.showInfoMessage?q.renderSlot(y.$slots,"info-message",{},void 0,void 0,1):E.showZoomMessage==="too-close"?q.renderSlot(y.$slots,"zoom-too-close",{},void 0,void 0,2):E.showZoomMessage==="too-far"?q.renderSlot(y.$slots,"zoom-too-far",{},void 0,void 0,3):q.createCommentVNode("",!0)])])],2)):q.createCommentVNode("",!0),q.createElementVNode("div",Yw,[q.createElementVNode("div",{id:x.mapId,class:"vs-map__map",ref:"mapbox"},null,8,Qw)],512),q.createVNode(U,{class:"vs-map__no-js"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"no-js")]),_:3})])}const tb=wt._export_sfc(Hw,[["render",e2]]),t2={name:"VsMapWithSidebarCategories",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:Ec,VsIcon:wt.VsIcon},props:{categoryName:{type:String,required:!0},type:{type:String,required:!0},hasSubCat:{type:Boolean,default:!1}},data(){return{isHovered:!1}},methods:{selectCategory(y){this.hasSubCat?this.$parent.$emit("set-subcategory",y):(this.$parent.$emit("set-category",y),this.$parent.$emit("set-stage",1))}}},r2={class:"vs-main-map-category","data-test":"vs-main-map-category"};function i2(y,_,x,k,E,D){const u=q.resolveComponent("VsMapMarkerIcon"),U=q.resolveComponent("VsIcon");return q.openBlock(),q.createElementBlock("div",r2,[q.createElementVNode("button",{type:"button",class:q.normalizeClass(["vs-main-map-category__button",`vs-main-map-category__button--${x.type}`]),"data-test":"vs-main-map-category__button",onClick:_[0]||(_[0]=M=>D.selectCategory(x.type)),onMouseover:_[1]||(_[1]=M=>E.isHovered=!0),onMouseout:_[2]||(_[2]=M=>E.isHovered=!1),onFocusin:_[3]||(_[3]=M=>E.isHovered=!0),onFocusout:_[4]||(_[4]=M=>E.isHovered=!1)},[q.createElementVNode("div",null,[q.createVNode(u,{class:"vs-main-map-category__icon",id:x.type,"is-hovered":E.isHovered},null,8,["id","is-hovered"]),q.createTextVNode(" "+q.toDisplayString(x.categoryName),1)]),q.createVNode(U,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xs",class:"vs-main-map-category__icon align-self-center me-0"})],34)])}const n2=wt._export_sfc(t2,[["render",i2]]);let xc=null;const o2={name:"VsMapWithSidebarSubCategories",status:"prototype",release:"0.0.1",components:{BFormGroup:wt.BFormGroup_default,BFormCheckboxGroup:wt.BFormCheckboxGroup_default,BFormCheckbox:wt.BFormCheckbox_default,VsMapMarkerIcon:Ec},props:{data:{type:Array,required:!0},selectedSubCategory:{type:String,required:!0}},data(){return{selected:[]}},computed:{activeSubcatFilters(){return xc?xc.activeSubcatFilters:null},...pa.mapState(Sn,{activeSubcatFilters(y){return y.activeSubcatFilters}})},mounted(){xc=Sn(),this.selected=this.activeSubcatFilters,this.emitter&&(this.emitter.on("clearSelectedSubcats",()=>{this.selected=[]}),this.emitter.on("submitCheckboxData",()=>{this.checkboxesChangeSubmit()}));const y=document.getElementsByClassName("vs-main-map-subcategory")[0];y&&y.querySelectorAll('input[type="checkbox"]')[0].focus()},beforeUnmount(){this.emitter&&this.emitter.off("submitCheckboxData")},methods:{checkboxesChangeSubmit(){xc.setActiveSubcatFilters(this.selected),this.$parent.$emit("subcategories-filtered",this.selected)},emitChange(){this.emitter&&this.emitter.emit("checkboxes-selected",this.selected)}}},a2={class:"vs-main-map-subcategory","data-test":"vs-main-map-subcategory"};function s2(y,_,x,k,E,D){const u=q.resolveComponent("VsMapMarkerIcon"),U=q.resolveComponent("BFormCheckbox"),M=q.resolveComponent("BFormCheckboxGroup"),Y=q.resolveComponent("BFormGroup");return q.openBlock(),q.createElementBlock("div",a2,[q.createVNode(Y,null,{default:q.withCtx(()=>[q.createVNode(M,{id:"checkbox-group-1",modelValue:E.selected,"onUpdate:modelValue":_[0]||(_[0]=X=>E.selected=X),name:x.data.name},{default:q.withCtx(()=>[(q.openBlock(!0),q.createElementBlock(q.Fragment,null,q.renderList(x.data,X=>(q.openBlock(),q.createBlock(U,{key:X.id,value:X.id,onChange:D.emitChange},{default:q.withCtx(()=>[q.createVNode(u,{class:"vs-main-map-subcategory__icon",id:x.selectedSubCategory},null,8,["id"]),q.createTextVNode(" "+q.toDisplayString(X.name),1)]),_:2},1032,["value","onChange"]))),128))]),_:1},8,["modelValue","name"])]),_:1})])}const u2=wt._export_sfc(o2,[["render",s2]]);let Hd=null;const l2={name:"VsMapWithSidebarListItem",status:"prototype",release:"0.0.1",components:{VsImg:wt.VsImg,VsIcon:wt.VsIcon},inject:["mapId"],props:{itemData:{type:Object,required:!0},fromEndpoint:{type:Boolean,default:!1},focussed:{type:Boolean,default:!1}},data(){return{formattedData:{}}},computed:{isActive(){return!!(this.highlightedPlace&&this.formattedData&&this.highlightedPlace.properties.id===this.formattedData.properties.id)},...pa.mapState(Sn,{highlightedPlace(y){return y.getHoveredStop(this.mapId)}})},created(){this.fromEndpoint?this.formatApiData():this.formattedData=this.itemData},mounted(){Hd=Sn(),this.focussed&&this.$refs.btn.focus()},methods:{showItemDetail(y){Hd.setActivePlace({mapId:this.mapId,activeFeature:y}),this.$parent.$emit("show-item-detail",y),this.$parent.$emit("set-stage",2)},itemHover(y){Hd.setHoveredPlace({mapId:this.mapId,hoveredFeature:y})},formatApiData(){this.formattedData={geometry:{coordinates:[this.itemData.longitude,this.itemData.latitude],type:"Point"},properties:{category:this.itemData.category[0],description:this.itemData.description,id:this.itemData.id,image:typeof this.itemData.images<"u"?this.itemData.images[0].mediaUrl:"",title:this.itemData.name,link:{label:this.itemData.website.label,link:this.itemData.website.link,type:this.itemData.website.type}},type:"Point"}}}},c2={class:"vs-map-with-sidebar-list-item__img-container"},p2={class:"vs-map-with-sidebar-list-item__text"};function h2(y,_,x,k,E,D){const u=q.resolveComponent("VsImg"),U=q.resolveComponent("VsIcon");return q.openBlock(),q.createElementBlock("button",{type:"button",class:q.normalizeClass(["vs-map-with-sidebar-list-item",D.isActive?"vs-map-with-sidebar-list-item--hovered":""]),"data-test":"vs-map-with-sidebar-list-item",onClick:_[0]||(_[0]=M=>D.showItemDetail(E.formattedData)),onKeyup:_[1]||(_[1]=q.withKeys(M=>D.showItemDetail(E.formattedData),["enter"])),onMouseover:_[2]||(_[2]=M=>D.itemHover(E.formattedData)),onMouseleave:_[3]||(_[3]=M=>D.itemHover("")),onFocusin:_[4]||(_[4]=M=>D.itemHover(E.formattedData)),onFocusout:_[5]||(_[5]=M=>D.itemHover("")),ref:"btn"},[q.createElementVNode("div",c2,[typeof E.formattedData.properties.image<"u"?(q.openBlock(),q.createBlock(u,{key:0,src:E.formattedData.properties.image,class:"vs-map-with-sidebar-list-item__img"},null,8,["src"])):q.createCommentVNode("",!0)]),q.createElementVNode("span",p2,q.toDisplayString(E.formattedData.properties.title),1),q.createVNode(U,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xxs",class:"vs-map-with-sidebar-list-item__icon"})],34)}const f2=wt._export_sfc(l2,[["render",h2]]),d2={name:"VsMapWithSidebarDetail",status:"prototype",release:"0.0.1",components:{VsImg:wt.VsImg,VsHeading:wt.VsHeading},props:{contentData:{type:Object,required:!0},headingLevel:{type:String,default:"3"}},computed:{showTitle(){return typeof this.contentData.properties.title<"u"||typeof this.contentData.properties.placeTitle<"u"}}},m2={class:"vs-map-with-sidebar-detail","data-test":"vs-map-with-sidebar-detail"},y2={key:2,"data-test":"vs-map-with-sidebar-detail__address",class:"vs-map-with-sidebar-detail__address"},v2={key:3,class:"mt-100"},g2=["innerHTML"];function _2(y,_,x,k,E,D){const u=q.resolveComponent("VsImg"),U=q.resolveComponent("VsHeading");return q.openBlock(),q.createElementBlock("div",m2,[typeof x.contentData.properties.image<"u"?(q.openBlock(),q.createBlock(u,{key:0,src:x.contentData.properties.image,class:"vs-map-with-sidebar-detail__image mb-125 mb-lg-075"},null,8,["src"])):q.createCommentVNode("",!0),D.showTitle?(q.openBlock(),q.createBlock(U,{key:1,level:x.headingLevel,"heading-style":"heading-xxs",class:"vs-map-with-sidebar-detail__heading mt-0","data-test":"vs-map-with-sidebar-detail__heading"},{default:q.withCtx(()=>[typeof x.contentData.properties.placeTitle<"u"?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createTextVNode(q.toDisplayString(x.contentData.properties.placeTitle),1)],64)):(q.openBlock(),q.createElementBlock(q.Fragment,{key:1},[q.createTextVNode(q.toDisplayString(x.contentData.properties.title),1)],64))]),_:1},8,["level"])):q.createCommentVNode("",!0),typeof x.contentData.properties.address<"u"?(q.openBlock(),q.createElementBlock("p",y2,q.toDisplayString(x.contentData.properties.address.shortAddress),1)):q.createCommentVNode("",!0),x.contentData.properties.subtitle?(q.openBlock(),q.createElementBlock("p",v2,q.toDisplayString(x.contentData.properties.subtitle),1)):q.createCommentVNode("",!0),q.createElementVNode("div",{"data-test":"vs-map-with-sidebar-detail__description",class:"vs-map-with-sidebar-detail__description mb-150",innerHTML:x.contentData.properties.description},null,8,g2)])}const x2=wt._export_sfc(d2,[["render",_2]]),b2={name:"VsMapWithSidebarButtons",status:"prototype",release:"0.0.1",components:{VsButton:wt.VsButton},inject:["filtersAppliedText","clearFiltersText"],props:{contentData:{type:Object,required:!0},filterCount:{type:Number,default:null}},emits:["clear-filters"],computed:{websiteDataExists(){return typeof this.contentData.properties.website<"u"&&this.contentData.properties.website.link!==this.contentData.properties.link.link}},methods:{filtersClick(){this.$parent.$emit("set-stage",0)},clearFiltersClick(){this.$emit("clear-filters")}}};function w2(y,_,x,k,E,D){const u=q.resolveComponent("VsButton");return q.openBlock(),q.createElementBlock("div",{class:q.normalizeClass(["vs-map-with-sidebar-buttons",x.filterCount!==null?"vs-map-with-sidebar-buttons--filters":""]),"data-test":"vs-map-with-sidebar-buttons"},[x.filterCount!==null?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createVNode(u,{class:"vs-map-with-sidebar-buttons__clear-filters","data-test":"vs-map-with-sidebar-buttons__clear-filters",variant:"secondary",size:"sm",onClick:D.clearFiltersClick},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.clearFiltersText),1)]),_:1},8,["onClick"]),q.createVNode(u,{class:"vs-map-with-sidebar-buttons__filters","data-test":"vs-map-with-sidebar-buttons__filters",variant:"secondary",icon:"vs-icon-control-filters",size:"sm",onClick:D.filtersClick},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(x.filterCount)+" "+q.toDisplayString(D.filtersAppliedText),1)]),_:1},8,["onClick"])],64)):(q.openBlock(),q.createElementBlock(q.Fragment,{key:1},[q.createVNode(u,{href:x.contentData.properties.link.link,"data-test":"vs-map-with-sidebar-buttons__discover",class:"mb-050"},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(x.contentData.properties.link.label),1)]),_:1},8,["href"]),D.websiteDataExists?(q.openBlock(),q.createBlock(u,{key:0,href:x.contentData.properties.website.link,target:"_blank",rel:"noopener noreferrer","data-test":"vs-map-with-sidebar-buttons__website",variant:"secondary"},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(x.contentData.properties.website.label),1)]),_:1},8,["href"])):q.createCommentVNode("",!0)],64))],2)}const S2=wt._export_sfc(b2,[["render",w2]]),I2={name:"VsMapWithSidebarControls",status:"prototype",release:"0.0.1",components:{VsButton:wt.VsButton},inject:["clearSelectionText","applyFiltersText"],data(){return{isDisabled:!0}},computed:{...pa.mapState(Sn,{getSubcatFilters(y){return y.activeSubcatFilters}})},mounted(){this.disableSubmitButton()},methods:{clearSelection(){this.emitter&&this.emitter.emit("clearSelectedSubcats"),this.isDisabled=!0},submitCheckboxes(){this.emitter&&this.emitter.emit("submitCheckboxData")},disableSubmitButton(){this.emitter&&this.emitter.on("checkboxes-selected",y=>{y.length>0?this.isDisabled=!1:this.isDisabled=!0}),this.getSubcatFilters.length>0&&(this.isDisabled=!1)}}},T2={class:"vs-main-map-controls","data-test":"vs-main-map-controls"};function A2(y,_,x,k,E,D){const u=q.resolveComponent("VsButton");return q.openBlock(),q.createElementBlock("div",T2,[q.createVNode(u,{class:"vs-main-map-controls__clear-selection","data-test":"vs-main-map-subcategory__clear-selection",size:"sm",variant:"secondary",onClick:D.clearSelection,onKeyup:q.withKeys(D.clearSelection,["enter"])},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.clearSelectionText),1)]),_:1},8,["onClick","onKeyup"]),q.createVNode(u,{class:"vs-main-map-controls__apply-filters","data-test":"vs-main-map-subcategory__apply-filters",size:"sm",onKeypress:q.withKeys(D.submitCheckboxes,["enter"]),onClick:D.submitCheckboxes,"aria-disabled":E.isDisabled,disabled:E.isDisabled},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.applyFiltersText),1)]),_:1},8,["onKeypress","onClick","aria-disabled","disabled"])])}const E2=wt._export_sfc(I2,[["render",A2]]);let Xd=null;const P2={name:"VsMapWithSidebarPanel",status:"prototype",release:"0.0.1",components:{VsButton:wt.VsButton,VsMapWithSidebarCategory:n2,VsMapWithSidebarSubcategory:u2,VsHeading:wt.VsHeading,VsMapWithSidebarListItem:f2,VsMapWithSidebarDetail:x2,VsMapWithSidebarButtons:S2,VsMapWithSidebarControls:E2},inject:["filters","filtersWithLocations","placesData","regions","mapId","focussedListItem"],props:{categoryHeading:{type:String,default:""},headingLevel:{type:String,default:"2"},selectedCategory:{type:String,default:""},selectedSubcategory:{type:String,default:null},currentStage:{type:Number,required:!0},selectedItem:{type:Object,default:null},hovered:{type:String,default:""},subcategoryLocations:{type:Array,default:null},currentEndpointData:{type:Array,default:()=>[]},panelStatus:{type:String,default:null},panelMessage:{type:String,default:null},totalPins:{type:Number,default:0},currentListItemFocus:{type:Number,default:0}},emits:["close-panel","load-more-places","set-stage","set-subcategory"],data(){return{placesLoaded:1}},computed:{currentHeading(){let y="";if(this.selectedSubcategory!==null)y=this.selectedSubcategoryData[0].label;else switch(this.currentStage){case 0:y=this.categoryHeading;break;case 1:case 2:y=this.currentFilter.label;break}return y},currentData(){return this.selectedCategory==="regions"?this.regions:this.placesData},panelClasses(){let y="";return this.currentStage===2&&(y+=" vs-map-with-sidebar-panel--small-padding"),y},headerClasses(){return this.currentStage===1?"vs-map-with-sidebar-panel__header-section--with-spacer":this.currentStage===2?"vs-map-with-sidebar-panel__header-section--overlapped":""},currentFilter(){let y="";return this.filters.forEach(_=>{_.id===this.selectedCategory&&(y=_)}),y},currentPlaceData(){let y=this.placesData;return this.selectedCategory==="regions"&&(y=this.regions),this.currentEndpointData.length>0?this.refineEndpointData(this.currentEndpointData):y.filter(_=>typeof _.properties<"u"&&this.selectedItem?_.properties.id===this.selectedItem.properties.id:!1)},selectedSubcategoryData(){return this.selectedSubcategory?this.filters.filter(_=>_.id===this.selectedSubcategory):[]},...pa.mapState(Sn,{subCatFilterCount(y){return y.activeSubcatFilters.length}}),detailHeadingLevel(){return(parseInt(this.headingLevel,10)+1).toString()},showLoadMore(){return!(this.subcategoryLocations.length>=this.totalPins||this.subcategoryLocations.length===0)}},watch:{currentFilter(){this.placesLoaded=1}},mounted(){Xd=Sn()},methods:{closePanel(){this.$emit("close-panel"),window.innerWidth>=1292&&this.currentStage===2&&this.$emit("set-subcategory",null)},stageBack(){if(this.selectedSubcategory&&this.currentStage===0)this.$emit("set-subcategory",null);else if(this.selectedSubcategory!==null&&this.subcategoryLocations===null)this.setStage(0);else{const y=this.currentStage-1;this.setStage(y)}},resetPanel(){Xd.setSelectedSubcat(null),this.setStage(0)},setStage(y){y===0&&(this.placesLoaded=1),this.$emit("set-stage",y)},subCatExists(y){return typeof y.subCategory<"u"&&y.subCategory.length>0},refineEndpointData(y){const _=[{isEndpoint:!0,properties:{category:y[0].category[0].id,id:y[0].id,image:y[0].images[0].mediaUrl,placeTitle:y[0].name,description:y[0].description,link:{label:y[0].productLink.label,link:y[0].productLink.link,type:y[0].productLink.type},website:{label:y[0].website.label,link:y[0].website.link,type:y[0].website.type},address:{shortAddress:""}}}];return typeof y[0].address<"u"&&(_[0].properties.address.shortAddress=y[0].address.shortAddress),_},clearSubCatFilters(){Xd.setActiveSubcatFilters([]),this.setStage(0)},loadMorePlaces(){this.placesLoaded+=1,this.$emit("load-more-places",this.placesLoaded)}}},C2={class:"vs-map-with-sidebar-panel__buttons d-lg-none"},k2={key:0,class:"vs-map-with-sidebar-panel__back"},M2={key:1,class:"vs-map-with-sidebar-panel__back"},B2={class:"vs-map-with-sidebar-panel__close"},z2={key:0,class:"vs-map-with-sidebar-panel__back d-none d-lg-block"},D2={key:2,class:"vs-map-with-sidebar-panel__bottom-message"},R2={class:"vs-map-with-sidebar-panel__list-container"},L2={key:3,class:"vs-map-with-sidebar-panel__overlay"},F2={key:0,class:"vs-map-with-sidebar-panel__overlay-box"},O2={class:"vs-map-with-sidebar-panel__overlay-text"};function V2(y,_,x,k,E,D){const u=q.resolveComponent("VsButton"),U=q.resolveComponent("VsHeading"),M=q.resolveComponent("VsMapWithSidebarSubcategory"),Y=q.resolveComponent("VsMapWithSidebarControls"),X=q.resolveComponent("VsMapWithSidebarCategory"),ae=q.resolveComponent("VsMapWithSidebarListItem"),J=q.resolveComponent("VsMapWithSidebarButtons"),Se=q.resolveComponent("VsMapWithSidebarDetail");return q.openBlock(),q.createElementBlock("section",{"data-test":"vs-map-with-sidebar-panel",class:q.normalizeClass(["vs-map-with-sidebar-panel",D.panelClasses])},[q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar-panel__header-section",D.headerClasses])},[q.createElementVNode("div",C2,[x.currentStage>1||x.selectedSubcategory?(q.openBlock(),q.createElementBlock("div",k2,[q.createVNode(u,{class:"vs-map-with-sidebar-panel_menu",icon:"vs-icon-control-menu",size:"sm",onClick:D.stageBack,"data-test":"vs-map-with-sidebar__menu-toggle",variant:"secondary"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"menu-btn-text")]),_:3},8,["onClick"])])):q.createCommentVNode("",!0),x.currentStage===1||x.selectedSubcategory?(q.openBlock(),q.createElementBlock("div",M2,[q.createVNode(u,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:D.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"back-btn-text")]),_:3},8,["onClick"])])):q.createCommentVNode("",!0),q.createElementVNode("div",B2,[q.createVNode(u,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:D.closePanel,"data-test":"vs-map-with-sidebar-panel--btn-close"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"close-side-panel-text")]),_:3},8,["onClick"])])]),x.currentStage>0||x.selectedSubcategory?(q.openBlock(),q.createElementBlock("div",z2,[q.createVNode(u,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:D.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"back-btn-text")]),_:3},8,["onClick"])])):q.createCommentVNode("",!0),D.currentHeading!==""?(q.openBlock(),q.createBlock(U,{key:1,level:x.headingLevel,"heading-style":x.currentStage===0?"heading-m":"heading-xs",class:q.normalizeClass(["vs-map-with-sidebar-panel__heading text-center mt-200 mt-lg-0",x.currentStage===2?"d-none d-lg-block":""]),"data-test":"vs-map-with-sidebar-panel__heading"},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.currentHeading),1)]),_:1},8,["level","heading-style","class"])):q.createCommentVNode("",!0),q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar-panel__reset",x.currentStage<2?"d-lg-none":""])},[q.createVNode(u,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:D.resetPanel,"data-test":"vs-map-with-sidebar-panel--btn-reset"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"reset-side-panel-text")]),_:3},8,["onClick"])],2)],2),x.currentStage===0?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[x.selectedSubcategory!==null?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createVNode(M,{data:D.selectedSubcategoryData[0].subCategory,"selected-sub-category":x.selectedSubcategory},null,8,["data","selected-sub-category"]),q.createVNode(Y)],64)):(q.openBlock(!0),q.createElementBlock(q.Fragment,{key:1},q.renderList(D.filtersWithLocations,be=>(q.openBlock(),q.createBlock(X,{key:be.id,"category-name":be.label,type:be.id,"has-sub-cat":D.subCatExists(be)},null,8,["category-name","type","has-sub-cat"]))),128)),x.panelMessage!==null?(q.openBlock(),q.createElementBlock("div",D2,[q.createElementVNode("p",null,q.toDisplayString(x.panelMessage),1)])):q.createCommentVNode("",!0)],64)):q.createCommentVNode("",!0),x.currentStage===1?(q.openBlock(),q.createElementBlock(q.Fragment,{key:1},[x.selectedSubcategory!==null?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createElementVNode("div",R2,[(q.openBlock(!0),q.createElementBlock(q.Fragment,null,q.renderList(x.subcategoryLocations,(be,De)=>(q.openBlock(),q.createBlock(ae,{key:be.id,"item-data":be,"from-endpoint":!0,focussed:De===x.currentListItemFocus,onShowItemDetail:Ze=>y.showDetail(be)},null,8,["item-data","focussed","onShowItemDetail"]))),128)),D.showLoadMore?(q.openBlock(),q.createBlock(u,{key:0,class:"vs-map-with-sidebar-panel__load-more","data-test":"vs-map-with-sidebar-panel__load-more",onClick:_[0]||(_[0]=be=>D.loadMorePlaces()),onKeyup:_[1]||(_[1]=q.withKeys(be=>D.loadMorePlaces(),["enter"]))},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"load-more-text")]),_:3})):q.createCommentVNode("",!0)]),q.createVNode(J,{"content-data":{},"filter-count":y.subCatFilterCount,onClearFilters:D.clearSubCatFilters},null,8,["filter-count","onClearFilters"])],64)):(q.openBlock(!0),q.createElementBlock(q.Fragment,{key:1},q.renderList(D.currentData,be=>(q.openBlock(),q.createElementBlock("div",{key:be.id},[typeof be.properties<"u"&&be.properties.category.id===x.selectedCategory?(q.openBlock(),q.createBlock(ae,{key:0,"item-data":be,onShowItemDetail:De=>y.showDetail(be)},null,8,["item-data","onShowItemDetail"])):q.createCommentVNode("",!0)]))),128))],64)):q.createCommentVNode("",!0),x.currentStage===2?(q.openBlock(),q.createElementBlock(q.Fragment,{key:2},[q.createVNode(Se,{"heading-level":D.detailHeadingLevel,"content-data":D.currentPlaceData[0]},null,8,["heading-level","content-data"]),q.createVNode(J,{"content-data":D.currentPlaceData[0]},null,8,["content-data"])],64)):q.createCommentVNode("",!0),x.panelStatus!==null?(q.openBlock(),q.createElementBlock("div",L2,[y.$slots["panel-loading-message"]&&x.panelStatus!=="map-loading"?(q.openBlock(),q.createElementBlock("div",F2,[q.createElementVNode("p",O2,[q.renderSlot(y.$slots,"panel-loading-message")])])):q.createCommentVNode("",!0)])):q.createCommentVNode("",!0)],2)}const q2=wt._export_sfc(P2,[["render",V2]]);let bc=null;const U2={name:"VsMapWithSidebar",status:"deprecated",release:"0.0.1",components:{VsContainer:wt.VsContainer,VsRow:wt.VsRow,VsCol:wt.VsCol,VsMap:tb,VsButton:wt.VsButton,VsMapWithSidebarPanel:q2,VsButtonToggleGroup:wt.VsButtonToggleGroup,VsWarning:wt.VsWarning},provide(){return{filters:this.filters,filtersWithLocations:this.filtersWithLocations,placesData:this.placesData,mapId:this.mapId,regions:this.regionsData,clearSelectionText:this.clearSelectionText,applyFiltersText:this.applyFiltersText,subCatList:this.subCatList,filtersAppliedText:this.filtersAppliedText,clearFiltersText:this.clearFiltersText,focussedListItem:this.focussedListItem}},props:{categoryHeading:{type:String,default:""},filters:{type:Array,required:!0},placesData:{type:Array,required:!0},mapId:{type:String,required:!0},mainHeadingExists:{type:Boolean,default:!1},initialSelected:{type:String,default:""},toggleData:{type:Array,default:()=>[]},buttonsLabel:{type:String,default:""},clearSelectionText:{type:String,required:!0},applyFiltersText:{type:String,required:!0},detailsEndpoint:{type:String,default:""},regionBounds:{type:Object,default:()=>{}},clearFiltersText:{type:String,required:!0},filtersAppliedText:{type:String,required:!0},placeId:{type:String,default:null},mapFilterMessage:{type:String,required:!0},mapNoResultsMessage:{type:String,required:!0},panelMessage:{type:String,default:null},loadBrandingImmediately:{type:Boolean,default:!1}},data(){return{panelVisible:!1,selectedCategory:"",filterCategories:this.filters,selectedItem:null,activePins:this.placesData,currentlyHovered:"",showRegions:!1,regions:[],subCatList:null,selectedToggle:"",currentEndpointData:[],mapStatus:"",panelStatus:"map-loading",mapReady:!1,showPanelMessage:null,currentPanelEndpointFilters:"",totalEndpointPins:0,focussedListItem:0,resetZoom:!1,currentStage:0,selectedSubCategory:null}},computed:{mapDisplayClass(){return this.panelVisible?"d-none d-lg-block":""},panelDisplayClass(){return this.panelVisible?"":"d-none d-lg-block"},regionsData(){return this.placesData.filter(y=>y.geometry.type==="Polygon"||y.geometry.type==="MultiPolygon")},...pa.mapState(Sn,{subCatActiveFilters(y){return y.activeSubcatFilters}}),infoMessage(){let y="";switch(this.mapStatus){case"no-results":y=this.mapNoResultsMessage;break;case"filter-results":y=this.mapFilterMessage;break}return y},existingCategories(){return this.placesData?[...new Set(this.placesData.map(y=>y.properties.category.id))]:[]},filtersWithLocations(){return this.filters.filter(y=>!!(this.existingCategories.includes(y.id)||y.subCategory&&y.subCategory.length))},togglesWithLocations(){return this.existingCategories.indexOf("vics")===-1?this.toggleData.filter(y=>y.value!=="icentres"):this.toggleData}},watch:{selectedSubCategory(y){y===null&&(this.mapStatus="",this.resetZoom=!0)}},mounted(){bc=Sn(),this.selectedToggle=this.initialSelected,this.emitter&&this.emitter.on("clearSelectedSubcats",()=>{this.resetZoom=!0})},methods:{openMenu(){this.setStage(0),this.openPanel()},closePanel(){this.panelVisible=!1},openPanel(){this.panelVisible=!0},showDetail(y){document.fullscreenElement&&document.exitFullscreen(),this.selectedItem=y,this.setStage(2),this.openPanel(),this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory)},setCategory(y){this.selectedCategory=y,this.selectedSubCategory===null&&this.filterPlaces(y)},setSubCategory(y){bc.setSelectedSubcat(y),this.selectedSubCategory=y,y!==null?(this.getSubcatMarkerData(),this.selectedCategory=y):(bc.setActiveSubcatFilters([]),this.showAllPlaces())},filterSubCategories(y){let _="";y.forEach(x=>{const k=`&cat=${x}`;_+=k}),this.currentPanelEndpointFilters=_,this.getSubcatMarkerData(_),this.getSubcatPanelData(_,0)},getSubcatMarkerData(y){const _=this.filters.filter(x=>x.id===this.selectedSubCategory);if(_.length>0){let x=_[0].pinsEndpoint;typeof y<"u"&&(x+=y),this.activePins=[],typeof y>"u"?(this.activePins=[],this.mapStatus="filter-results"):wt.axios.get(x).then(k=>{this.totalEndpointPins=k.data.features.length,this.totalEndpointPins===0?this.mapStatus="no-results":(k.data.features.forEach(E=>{const D=E;D.properties.apiData=!0,this.activePins.push(D)}),this.mapStatus="")})}},getSubcatPanelData(y,_){let k=this.filters.filter(E=>E.id===this.selectedSubCategory)[0].listProductsEndPoint;typeof y<"u"&&(k+=y),_!==0&&(k+=`${y}&page=${_}`),this.panelStatus="loading-data",wt.axios.get(k).then(E=>{typeof E.data.data.products<"u"?(this.setStage(1),_===0?(this.subCatList=E.data.data.products,this.focussedListItem=0):(this.focussedListItem=_*24,this.subCatList=this.subCatList.concat(E.data.data.products))):this.mapStatus="no-results",this.panelStatus=null})},setStage(y){if(y===2&&this.detailsEndpoint!==""&&this.selectedSubCategory!==null){const _=`${this.detailsEndpoint}${this.selectedItem.properties.id}`;wt.axios.get(_).then(x=>{const k=[];k.push(x.data.data),this.currentEndpointData=k,this.currentStage=y})}else this.currentStage=y,this.currentStage===0?(this.currentEndpointData=[],this.selectedSubCategory===null?(this.resetZoom=!0,this.showAllPlaces(),this.mapStatus=""):this.getSubcatMarkerData(),this.selectedToggle="places"):this.currentStage===1&&this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory);y!==2&&(bc.setActivePlace({mapId:this.mapId,activeFeature:""}),this.selectedItem=null)},filterPlaces(y){if(y==="regions")this.showRegions=!0,this.activePins=[],this.selectedToggle="regions";else{this.showRegions=!1,this.selectedToggle="places";const _=this.placesData.filter(x=>typeof x.properties<"u"?x.properties.category.id===y:!1);this.activePins=_}},loadMorePlaces(y){this.getSubcatPanelData(this.currentPanelEndpointFilters,y)},showAllPlaces(){this.activePins=this.placesData,this.showRegions=!1},onToggleChanged(y){y==="regions"?(this.setCategory("regions"),this.setStage(1)):y==="icentres"?(this.setCategory("vics"),this.setStage(1)):y==="places-regional"?(this.setCategory("twnv"),this.setStage(1)):(this.showAllPlaces(),this.setStage(0))},setMapReady(y){this.mapReady=y,y?this.panelStatus=null:this.panelStatus="loading"},categoryHasData(y){return this.existingCategories.indexOf(y)!==-1}}};function N2(y,_,x,k,E,D){const u=q.resolveComponent("VsMapWithSidebarPanel"),U=q.resolveComponent("VsButton"),M=q.resolveComponent("VsMap"),Y=q.resolveComponent("VsButtonToggleGroup"),X=q.resolveComponent("VsWarning"),ae=q.resolveComponent("VsCol"),J=q.resolveComponent("VsRow"),Se=q.resolveComponent("VsContainer");return q.openBlock(),q.createBlock(Se,{"data-test":"vs-map-with-sidebar"},{default:q.withCtx(()=>[q.createVNode(J,null,{default:q.withCtx(()=>[q.createVNode(ae,null,{default:q.withCtx(()=>[q.createElementVNode("div",{class:"vs-map-with-sidebar",ref:x.mapId},[q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar__side-panel",D.panelDisplayClass]),"data-test":"vs-map-with-sidebar__side-panel"},[q.createVNode(u,{"category-heading":x.categoryHeading,"selected-category":E.selectedCategory,"selected-subcategory":E.selectedSubCategory,"current-stage":E.currentStage,"selected-item":E.selectedItem,"heading-level":x.mainHeadingExists?"3":"2","subcategory-locations":E.subCatList,"current-endpoint-data":E.currentEndpointData,"panel-status":E.panelStatus,"panel-message":E.currentStage===0?x.panelMessage:null,"total-pins":E.totalEndpointPins,"current-list-item-focus":E.focussedListItem,onSetCategory:D.setCategory,onSetSubcategory:D.setSubCategory,onSubcategoriesFiltered:D.filterSubCategories,onSetStage:D.setStage,onClosePanel:D.closePanel,onShowItemDetail:D.showDetail,onFilterPlaces:D.filterPlaces,onLoadMorePlaces:D.loadMorePlaces},{closePanelText:q.withCtx(()=>[q.renderSlot(y.$slots,"close-side-panel-text")]),"reset-side-panel-text":q.withCtx(()=>[q.renderSlot(y.$slots,"reset-side-panel-text")]),"menu-btn-text":q.withCtx(()=>[q.renderSlot(y.$slots,"menu-btn-text")]),"panel-loading-message":q.withCtx(()=>[q.renderSlot(y.$slots,"panel-loading-message")]),"load-more-text":q.withCtx(()=>[q.renderSlot(y.$slots,"load-more-text")]),_:3},8,["category-heading","selected-category","selected-subcategory","current-stage","selected-item","heading-level","subcategory-locations","current-endpoint-data","panel-status","panel-message","total-pins","current-list-item-focus","onSetCategory","onSetSubcategory","onSubcategoriesFiltered","onSetStage","onClosePanel","onShowItemDetail","onFilterPlaces","onLoadMorePlaces"])],2),q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar__map",D.mapDisplayClass])},[q.createVNode(U,{class:"vs-map-with-sidebar__map-toggle",icon:"vs-icon-control-menu",size:"sm",onClick:D.openMenu,"data-test":"vs-map-with-sidebar__map-toggle",variant:"secondary"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"open-side-panel-text")]),_:3},8,["onClick"]),q.createVNode(M,{"is-visible":!E.panelVisible,labels:{},filters:D.filtersWithLocations,places:E.activePins,"selected-item":E.selectedItem,"map-id":x.mapId,"show-polygons":E.showRegions,"show-info-message":E.mapStatus!=="",onShowDetail:D.showDetail,onSetCategory:D.setCategory,onMapReady:D.setMapReady,onZoomReset:_[0]||(_[0]=be=>E.resetZoom=!1),"bounds-data":x.regionBounds,"reset-zoom":E.resetZoom,"show-marker-popups":!1,"load-branding-immediately":x.loadBrandingImmediately},{"map-loading-text":q.withCtx(()=>[q.renderSlot(y.$slots,"map-loading-text")]),"info-message":q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.infoMessage),1)]),"zoom-too-close":q.withCtx(()=>[q.renderSlot(y.$slots,"zoom-too-close")]),"zoom-too-far":q.withCtx(()=>[q.renderSlot(y.$slots,"zoom-too-far")]),"no-js":q.withCtx(()=>[q.renderSlot(y.$slots,"no-js")]),_:3},8,["is-visible","filters","places","selected-item","map-id","show-polygons","show-info-message","onShowDetail","onSetCategory","onMapReady","bounds-data","reset-zoom","load-branding-immediately"]),D.togglesWithLocations.length>1?(q.openBlock(),q.createBlock(Y,{key:0,"data-test":"vs-map-with-sidebar__map-toggle-group","initial-selected":E.selectedToggle,options:D.togglesWithLocations,"buttons-label":x.buttonsLabel,onToggleChanged:D.onToggleChanged},null,8,["initial-selected","options","buttons-label","onToggleChanged"])):q.createCommentVNode("",!0)],2)],512),q.createVNode(X,{class:"vs-map-with-sidebar__no-js"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"no-js")]),_:3})]),_:3})]),_:3})]),_:3})}const j2=wt._export_sfc(U2,[["render",N2]]);exports.VsMap=tb;exports.VsMapMarker=eb;exports.VsMapMarkerIcon=Ec;exports.VsMapWithSidebar=j2;
|
|
504
|
+
<p class="vs-map__popup-title">${T.properties.title}</p>
|
|
505
|
+
`},setupMarkerListeners(T){document.body.addEventListener("keyup",ee=>{(ee.key==="Escape"||ee.key==="Tab")&&(this.removeMapPopup(T),this.showMarkerPopups&&zs.setActivePlace({mapId:this.mapId,activeFeature:null}))}),T.getElement().addEventListener("keyup",ee=>{ee.key==="Enter"&&(T._popup.isOpen()||T._popup.addTo(this.mapbox.map))})},fitToBounds(){this.mapbox.map.fitBounds(cd(this.geojsonData),{padding:{top:100,bottom:100,left:100,right:100}})},initialiseMapComponent(){this.addMap(),this.addMapControls(),this.places.length&&this.initialiseMapFeatures(),this.geojsonData.features.length&&(this.initialiseMapMarkers(),this.fitToMarkers&&this.fitToBounds())},lazyloadMapComponent(){if(oo.supported({failIfMajorPerformanceCaveat:!0}),!("IntersectionObserver"in window)){this.initialiseMapComponent();return}this.observer=new IntersectionObserver(T=>{T[0].intersectionRatio>0&&(this.observer.unobserve(this.$el),this.initialiseMapComponent())}),this.observer.observe(this.$el)},onResize(){this.isTablet=window.innerWidth>=768},getBoundsFromPolygon(){const T=this.boundsData.coordinates[0];return T.reduce((K,ee)=>K.extend(ee),new oo.LngLatBounds(T[0],T[0]))},checkPointIsVisible(){return this.mapbox.map.getBounds().contains(this.activeMarkerPostion)},centreMapOnPoint(T){this.mapbox.map.flyTo({center:T})},calculateBoundingBox(){let T;if(typeof this.boundsData>"u"||this.boundsData.type==="undefined")T=[[-7.555827,54.608836],[-.778285,60.880894]];else if(this.boundsData.type==="bounds"){const K=new oo.LngLat(this.boundsData.coordinates[1][0],this.boundsData.coordinates[1][1]),ee=new oo.LngLat(this.boundsData.coordinates[0][0],this.boundsData.coordinates[0][1]);T=new oo.LngLatBounds(K,ee)}else this.boundsData.type==="Polygon"?T=this.getBoundsFromPolygon():T=[[-7.555827,54.608836],[-.778285,60.880894]];return T}}},_d={class:"vs-map","data-test":"vs-map"},xd={class:"vs-map__message-box"},bd={class:"vs-map__message-text"},wd={ref:"mapboxOuter",class:"vs-map__map-outer"},Sd=["id"];function Id(T,K,ee,qe,Le,me){const u=D.resolveComponent("VsLoading"),ot=D.resolveComponent("VsWarning");return D.openBlock(),D.createElementBlock("div",_d,[Le.showMapMessage?(D.openBlock(),D.createElementBlock("div",{key:0,class:D.normalizeClass(["vs-map__message",Le.showZoomMessage?"":"vs-map__message--with-overlay"]),"data-test":"vs-map__message"},[D.createElementVNode("div",xd,[Le.isLoading?(D.openBlock(),D.createBlock(u,{key:0,class:"vs-map__loading"})):D.createCommentVNode("",!0),D.createElementVNode("p",bd,[Le.isLoading?D.renderSlot(T.$slots,"map-loading-text",{},void 0,void 0,0):ee.showInfoMessage?D.renderSlot(T.$slots,"info-message",{},void 0,void 0,1):Le.showZoomMessage==="too-close"?D.renderSlot(T.$slots,"zoom-too-close",{},void 0,void 0,2):Le.showZoomMessage==="too-far"?D.renderSlot(T.$slots,"zoom-too-far",{},void 0,void 0,3):D.createCommentVNode("",!0)])])],2)):D.createCommentVNode("",!0),D.createElementVNode("div",wd,[D.createElementVNode("div",{id:ee.mapId,class:"vs-map__map",ref:"mapbox"},null,8,Sd)],512),D.createVNode(ot,{class:"vs-map__no-js"},{default:D.withCtx(()=>[D.renderSlot(T.$slots,"no-js")]),_:3})])}const vh=Ct._export_sfc(vd,[["render",Id]]),Ed={name:"VsMapWithSidebarCategories",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:Zu,VsIcon:Ct.VsIcon},props:{categoryName:{type:String,required:!0},type:{type:String,required:!0},hasSubCat:{type:Boolean,default:!1}},data(){return{isHovered:!1}},methods:{selectCategory(T){this.hasSubCat?this.$parent.$emit("set-subcategory",T):(this.$parent.$emit("set-category",T),this.$parent.$emit("set-stage",1))}}},Td={class:"vs-main-map-category","data-test":"vs-main-map-category"};function kd(T,K,ee,qe,Le,me){const u=D.resolveComponent("VsMapMarkerIcon"),ot=D.resolveComponent("VsIcon");return D.openBlock(),D.createElementBlock("div",Td,[D.createElementVNode("button",{type:"button",class:D.normalizeClass(["vs-main-map-category__button",`vs-main-map-category__button--${ee.type}`]),"data-test":"vs-main-map-category__button",onClick:K[0]||(K[0]=pe=>me.selectCategory(ee.type)),onMouseover:K[1]||(K[1]=pe=>Le.isHovered=!0),onMouseout:K[2]||(K[2]=pe=>Le.isHovered=!1),onFocusin:K[3]||(K[3]=pe=>Le.isHovered=!0),onFocusout:K[4]||(K[4]=pe=>Le.isHovered=!1)},[D.createElementVNode("div",null,[D.createVNode(u,{class:"vs-main-map-category__icon",id:ee.type,"is-hovered":Le.isHovered},null,8,["id","is-hovered"]),D.createTextVNode(" "+D.toDisplayString(ee.categoryName),1)]),D.createVNode(ot,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xs",class:"vs-main-map-category__icon align-self-center me-0"})],34)])}const Cd=Ct._export_sfc(Ed,[["render",kd]]);let Uu=null;const Pd={name:"VsMapWithSidebarSubCategories",status:"prototype",release:"0.0.1",components:{BFormGroup:Ct.BFormGroup_default,BFormCheckboxGroup:Ct.BFormCheckboxGroup_default,BFormCheckbox:Ct.BFormCheckbox_default,VsMapMarkerIcon:Zu},props:{data:{type:Array,required:!0},selectedSubCategory:{type:String,required:!0}},data(){return{selected:[]}},computed:{activeSubcatFilters(){return Uu?Uu.activeSubcatFilters:null},...ra.mapState(en,{activeSubcatFilters(T){return T.activeSubcatFilters}})},mounted(){Uu=en(),this.selected=this.activeSubcatFilters,this.emitter&&(this.emitter.on("clearSelectedSubcats",()=>{this.selected=[]}),this.emitter.on("submitCheckboxData",()=>{this.checkboxesChangeSubmit()}));const T=document.getElementsByClassName("vs-main-map-subcategory")[0];T&&T.querySelectorAll('input[type="checkbox"]')[0].focus()},beforeUnmount(){this.emitter&&this.emitter.off("submitCheckboxData")},methods:{checkboxesChangeSubmit(){Uu.setActiveSubcatFilters(this.selected),this.$parent.$emit("subcategories-filtered",this.selected)},emitChange(){this.emitter&&this.emitter.emit("checkboxes-selected",this.selected)}}},Ad={class:"vs-main-map-subcategory","data-test":"vs-main-map-subcategory"};function zd(T,K,ee,qe,Le,me){const u=D.resolveComponent("VsMapMarkerIcon"),ot=D.resolveComponent("BFormCheckbox"),pe=D.resolveComponent("BFormCheckboxGroup"),dt=D.resolveComponent("BFormGroup");return D.openBlock(),D.createElementBlock("div",Ad,[D.createVNode(dt,null,{default:D.withCtx(()=>[D.createVNode(pe,{id:"checkbox-group-1",modelValue:Le.selected,"onUpdate:modelValue":K[0]||(K[0]=Ze=>Le.selected=Ze),name:ee.data.name},{default:D.withCtx(()=>[(D.openBlock(!0),D.createElementBlock(D.Fragment,null,D.renderList(ee.data,Ze=>(D.openBlock(),D.createBlock(ot,{key:Ze.id,value:Ze.id,onChange:me.emitChange},{default:D.withCtx(()=>[D.createVNode(u,{class:"vs-main-map-subcategory__icon",id:ee.selectedSubCategory},null,8,["id"]),D.createTextVNode(" "+D.toDisplayString(Ze.name),1)]),_:2},1032,["value","onChange"]))),128))]),_:1},8,["modelValue","name"])]),_:1})])}const Md=Ct._export_sfc(Pd,[["render",zd]]);let Nc=null;const Dd={name:"VsMapWithSidebarListItem",status:"prototype",release:"0.0.1",components:{VsImg:Ct.VsImg,VsIcon:Ct.VsIcon},inject:["mapId"],props:{itemData:{type:Object,required:!0},fromEndpoint:{type:Boolean,default:!1},focussed:{type:Boolean,default:!1}},data(){return{formattedData:{}}},computed:{isActive(){return!!(this.highlightedPlace&&this.formattedData&&this.highlightedPlace.properties.id===this.formattedData.properties.id)},...ra.mapState(en,{highlightedPlace(T){return T.getHoveredStop(this.mapId)}})},created(){this.fromEndpoint?this.formatApiData():this.formattedData=this.itemData},mounted(){Nc=en(),this.focussed&&this.$refs.btn.focus()},methods:{showItemDetail(T){Nc.setActivePlace({mapId:this.mapId,activeFeature:T}),this.$parent.$emit("show-item-detail",T),this.$parent.$emit("set-stage",2)},itemHover(T){Nc.setHoveredPlace({mapId:this.mapId,hoveredFeature:T})},formatApiData(){this.formattedData={geometry:{coordinates:[this.itemData.longitude,this.itemData.latitude],type:"Point"},properties:{category:this.itemData.category[0],description:this.itemData.description,id:this.itemData.id,image:typeof this.itemData.images<"u"?this.itemData.images[0].mediaUrl:"",title:this.itemData.name,link:{label:this.itemData.website.label,link:this.itemData.website.link,type:this.itemData.website.type}},type:"Point"}}}},Ld={class:"vs-map-with-sidebar-list-item__img-container"},Bd={class:"vs-map-with-sidebar-list-item__text"};function Rd(T,K,ee,qe,Le,me){const u=D.resolveComponent("VsImg"),ot=D.resolveComponent("VsIcon");return D.openBlock(),D.createElementBlock("button",{type:"button",class:D.normalizeClass(["vs-map-with-sidebar-list-item",me.isActive?"vs-map-with-sidebar-list-item--hovered":""]),"data-test":"vs-map-with-sidebar-list-item",onClick:K[0]||(K[0]=pe=>me.showItemDetail(Le.formattedData)),onKeyup:K[1]||(K[1]=D.withKeys(pe=>me.showItemDetail(Le.formattedData),["enter"])),onMouseover:K[2]||(K[2]=pe=>me.itemHover(Le.formattedData)),onMouseleave:K[3]||(K[3]=pe=>me.itemHover("")),onFocusin:K[4]||(K[4]=pe=>me.itemHover(Le.formattedData)),onFocusout:K[5]||(K[5]=pe=>me.itemHover("")),ref:"btn"},[D.createElementVNode("div",Ld,[typeof Le.formattedData.properties.image<"u"?(D.openBlock(),D.createBlock(u,{key:0,src:Le.formattedData.properties.image,class:"vs-map-with-sidebar-list-item__img"},null,8,["src"])):D.createCommentVNode("",!0)]),D.createElementVNode("span",Bd,D.toDisplayString(Le.formattedData.properties.title),1),D.createVNode(ot,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xxs",class:"vs-map-with-sidebar-list-item__icon"})],34)}const Fd=Ct._export_sfc(Dd,[["render",Rd]]),Od={name:"VsMapWithSidebarDetail",status:"prototype",release:"0.0.1",components:{VsImg:Ct.VsImg,VsHeading:Ct.VsHeading},props:{contentData:{type:Object,required:!0},headingLevel:{type:String,default:"3"}},computed:{showTitle(){return typeof this.contentData.properties.title<"u"||typeof this.contentData.properties.placeTitle<"u"}}},Vd={class:"vs-map-with-sidebar-detail","data-test":"vs-map-with-sidebar-detail"},Ud={key:2,"data-test":"vs-map-with-sidebar-detail__address",class:"vs-map-with-sidebar-detail__address"},Nd={key:3,class:"mt-100"},jd=["innerHTML"];function qd(T,K,ee,qe,Le,me){const u=D.resolveComponent("VsImg"),ot=D.resolveComponent("VsHeading");return D.openBlock(),D.createElementBlock("div",Vd,[typeof ee.contentData.properties.image<"u"?(D.openBlock(),D.createBlock(u,{key:0,src:ee.contentData.properties.image,class:"vs-map-with-sidebar-detail__image mb-125 mb-lg-075"},null,8,["src"])):D.createCommentVNode("",!0),me.showTitle?(D.openBlock(),D.createBlock(ot,{key:1,level:ee.headingLevel,"heading-style":"heading-xxs",class:"vs-map-with-sidebar-detail__heading mt-0","data-test":"vs-map-with-sidebar-detail__heading"},{default:D.withCtx(()=>[typeof ee.contentData.properties.placeTitle<"u"?(D.openBlock(),D.createElementBlock(D.Fragment,{key:0},[D.createTextVNode(D.toDisplayString(ee.contentData.properties.placeTitle),1)],64)):(D.openBlock(),D.createElementBlock(D.Fragment,{key:1},[D.createTextVNode(D.toDisplayString(ee.contentData.properties.title),1)],64))]),_:1},8,["level"])):D.createCommentVNode("",!0),typeof ee.contentData.properties.address<"u"?(D.openBlock(),D.createElementBlock("p",Ud,D.toDisplayString(ee.contentData.properties.address.shortAddress),1)):D.createCommentVNode("",!0),ee.contentData.properties.subtitle?(D.openBlock(),D.createElementBlock("p",Nd,D.toDisplayString(ee.contentData.properties.subtitle),1)):D.createCommentVNode("",!0),D.createElementVNode("div",{"data-test":"vs-map-with-sidebar-detail__description",class:"vs-map-with-sidebar-detail__description mb-150",innerHTML:ee.contentData.properties.description},null,8,jd)])}const Zd=Ct._export_sfc(Od,[["render",qd]]),Gd={name:"VsMapWithSidebarButtons",status:"prototype",release:"0.0.1",components:{VsButton:Ct.VsButton},inject:["filtersAppliedText","clearFiltersText"],props:{contentData:{type:Object,required:!0},filterCount:{type:Number,default:null}},emits:["clear-filters"],computed:{websiteDataExists(){return typeof this.contentData.properties.website<"u"&&this.contentData.properties.website.link!==this.contentData.properties.link.link}},methods:{filtersClick(){this.$parent.$emit("set-stage",0)},clearFiltersClick(){this.$emit("clear-filters")}}};function Wd(T,K,ee,qe,Le,me){const u=D.resolveComponent("VsButton");return D.openBlock(),D.createElementBlock("div",{class:D.normalizeClass(["vs-map-with-sidebar-buttons",ee.filterCount!==null?"vs-map-with-sidebar-buttons--filters":""]),"data-test":"vs-map-with-sidebar-buttons"},[ee.filterCount!==null?(D.openBlock(),D.createElementBlock(D.Fragment,{key:0},[D.createVNode(u,{class:"vs-map-with-sidebar-buttons__clear-filters","data-test":"vs-map-with-sidebar-buttons__clear-filters",variant:"secondary",size:"sm",onClick:me.clearFiltersClick},{default:D.withCtx(()=>[D.createTextVNode(D.toDisplayString(me.clearFiltersText),1)]),_:1},8,["onClick"]),D.createVNode(u,{class:"vs-map-with-sidebar-buttons__filters","data-test":"vs-map-with-sidebar-buttons__filters",variant:"secondary",icon:"vs-icon-control-filters",size:"sm",onClick:me.filtersClick},{default:D.withCtx(()=>[D.createTextVNode(D.toDisplayString(ee.filterCount)+" "+D.toDisplayString(me.filtersAppliedText),1)]),_:1},8,["onClick"])],64)):(D.openBlock(),D.createElementBlock(D.Fragment,{key:1},[D.createVNode(u,{href:ee.contentData.properties.link.link,"data-test":"vs-map-with-sidebar-buttons__discover",class:"mb-050"},{default:D.withCtx(()=>[D.createTextVNode(D.toDisplayString(ee.contentData.properties.link.label),1)]),_:1},8,["href"]),me.websiteDataExists?(D.openBlock(),D.createBlock(u,{key:0,href:ee.contentData.properties.website.link,target:"_blank",rel:"noopener noreferrer","data-test":"vs-map-with-sidebar-buttons__website",variant:"secondary"},{default:D.withCtx(()=>[D.createTextVNode(D.toDisplayString(ee.contentData.properties.website.label),1)]),_:1},8,["href"])):D.createCommentVNode("",!0)],64))],2)}const Xd=Ct._export_sfc(Gd,[["render",Wd]]),Hd={name:"VsMapWithSidebarControls",status:"prototype",release:"0.0.1",components:{VsButton:Ct.VsButton},inject:["clearSelectionText","applyFiltersText"],data(){return{isDisabled:!0}},computed:{...ra.mapState(en,{getSubcatFilters(T){return T.activeSubcatFilters}})},mounted(){this.disableSubmitButton()},methods:{clearSelection(){this.emitter&&this.emitter.emit("clearSelectedSubcats"),this.isDisabled=!0},submitCheckboxes(){this.emitter&&this.emitter.emit("submitCheckboxData")},disableSubmitButton(){this.emitter&&this.emitter.on("checkboxes-selected",T=>{T.length>0?this.isDisabled=!1:this.isDisabled=!0}),this.getSubcatFilters.length>0&&(this.isDisabled=!1)}}},Kd={class:"vs-main-map-controls","data-test":"vs-main-map-controls"};function Jd(T,K,ee,qe,Le,me){const u=D.resolveComponent("VsButton");return D.openBlock(),D.createElementBlock("div",Kd,[D.createVNode(u,{class:"vs-main-map-controls__clear-selection","data-test":"vs-main-map-subcategory__clear-selection",size:"sm",variant:"secondary",onClick:me.clearSelection,onKeyup:D.withKeys(me.clearSelection,["enter"])},{default:D.withCtx(()=>[D.createTextVNode(D.toDisplayString(me.clearSelectionText),1)]),_:1},8,["onClick","onKeyup"]),D.createVNode(u,{class:"vs-main-map-controls__apply-filters","data-test":"vs-main-map-subcategory__apply-filters",size:"sm",onKeypress:D.withKeys(me.submitCheckboxes,["enter"]),onClick:me.submitCheckboxes,"aria-disabled":Le.isDisabled,disabled:Le.isDisabled},{default:D.withCtx(()=>[D.createTextVNode(D.toDisplayString(me.applyFiltersText),1)]),_:1},8,["onKeypress","onClick","aria-disabled","disabled"])])}const Yd=Ct._export_sfc(Hd,[["render",Jd]]);let jc=null;const $d={name:"VsMapWithSidebarPanel",status:"prototype",release:"0.0.1",components:{VsButton:Ct.VsButton,VsMapWithSidebarCategory:Cd,VsMapWithSidebarSubcategory:Md,VsHeading:Ct.VsHeading,VsMapWithSidebarListItem:Fd,VsMapWithSidebarDetail:Zd,VsMapWithSidebarButtons:Xd,VsMapWithSidebarControls:Yd},inject:["filters","filtersWithLocations","placesData","regions","mapId","focussedListItem"],props:{categoryHeading:{type:String,default:""},headingLevel:{type:String,default:"2"},selectedCategory:{type:String,default:""},selectedSubcategory:{type:String,default:null},currentStage:{type:Number,required:!0},selectedItem:{type:Object,default:null},hovered:{type:String,default:""},subcategoryLocations:{type:Array,default:null},currentEndpointData:{type:Array,default:()=>[]},panelStatus:{type:String,default:null},panelMessage:{type:String,default:null},totalPins:{type:Number,default:0},currentListItemFocus:{type:Number,default:0}},emits:["close-panel","load-more-places","set-stage","set-subcategory"],data(){return{placesLoaded:1}},computed:{currentHeading(){let T="";if(this.selectedSubcategory!==null)T=this.selectedSubcategoryData[0].label;else switch(this.currentStage){case 0:T=this.categoryHeading;break;case 1:case 2:T=this.currentFilter.label;break}return T},currentData(){return this.selectedCategory==="regions"?this.regions:this.placesData},panelClasses(){let T="";return this.currentStage===2&&(T+=" vs-map-with-sidebar-panel--small-padding"),T},headerClasses(){return this.currentStage===1?"vs-map-with-sidebar-panel__header-section--with-spacer":this.currentStage===2?"vs-map-with-sidebar-panel__header-section--overlapped":""},currentFilter(){let T="";return this.filters.forEach(K=>{K.id===this.selectedCategory&&(T=K)}),T},currentPlaceData(){let T=this.placesData;return this.selectedCategory==="regions"&&(T=this.regions),this.currentEndpointData.length>0?this.refineEndpointData(this.currentEndpointData):T.filter(K=>typeof K.properties<"u"&&this.selectedItem?K.properties.id===this.selectedItem.properties.id:!1)},selectedSubcategoryData(){return this.selectedSubcategory?this.filters.filter(K=>K.id===this.selectedSubcategory):[]},...ra.mapState(en,{subCatFilterCount(T){return T.activeSubcatFilters.length}}),detailHeadingLevel(){return(parseInt(this.headingLevel,10)+1).toString()},showLoadMore(){return!(this.subcategoryLocations.length>=this.totalPins||this.subcategoryLocations.length===0)}},watch:{currentFilter(){this.placesLoaded=1}},mounted(){jc=en()},methods:{closePanel(){this.$emit("close-panel"),window.innerWidth>=1292&&this.currentStage===2&&this.$emit("set-subcategory",null)},stageBack(){if(this.selectedSubcategory&&this.currentStage===0)this.$emit("set-subcategory",null);else if(this.selectedSubcategory!==null&&this.subcategoryLocations===null)this.setStage(0);else{const T=this.currentStage-1;this.setStage(T)}},resetPanel(){jc.setSelectedSubcat(null),this.setStage(0)},setStage(T){T===0&&(this.placesLoaded=1),this.$emit("set-stage",T)},subCatExists(T){return typeof T.subCategory<"u"&&T.subCategory.length>0},refineEndpointData(T){const K=[{isEndpoint:!0,properties:{category:T[0].category[0].id,id:T[0].id,image:T[0].images[0].mediaUrl,placeTitle:T[0].name,description:T[0].description,link:{label:T[0].productLink.label,link:T[0].productLink.link,type:T[0].productLink.type},website:{label:T[0].website.label,link:T[0].website.link,type:T[0].website.type},address:{shortAddress:""}}}];return typeof T[0].address<"u"&&(K[0].properties.address.shortAddress=T[0].address.shortAddress),K},clearSubCatFilters(){jc.setActiveSubcatFilters([]),this.setStage(0)},loadMorePlaces(){this.placesLoaded+=1,this.$emit("load-more-places",this.placesLoaded)}}},Qd={class:"vs-map-with-sidebar-panel__buttons d-lg-none"},em={key:0,class:"vs-map-with-sidebar-panel__back"},tm={key:1,class:"vs-map-with-sidebar-panel__back"},rm={class:"vs-map-with-sidebar-panel__close"},im={key:0,class:"vs-map-with-sidebar-panel__back d-none d-lg-block"},nm={key:2,class:"vs-map-with-sidebar-panel__bottom-message"},om={class:"vs-map-with-sidebar-panel__list-container"},am={key:3,class:"vs-map-with-sidebar-panel__overlay"},sm={key:0,class:"vs-map-with-sidebar-panel__overlay-box"},lm={class:"vs-map-with-sidebar-panel__overlay-text"};function um(T,K,ee,qe,Le,me){const u=D.resolveComponent("VsButton"),ot=D.resolveComponent("VsHeading"),pe=D.resolveComponent("VsMapWithSidebarSubcategory"),dt=D.resolveComponent("VsMapWithSidebarControls"),Ze=D.resolveComponent("VsMapWithSidebarCategory"),yr=D.resolveComponent("VsMapWithSidebarListItem"),Ce=D.resolveComponent("VsMapWithSidebarButtons"),Zi=D.resolveComponent("VsMapWithSidebarDetail");return D.openBlock(),D.createElementBlock("section",{"data-test":"vs-map-with-sidebar-panel",class:D.normalizeClass(["vs-map-with-sidebar-panel",me.panelClasses])},[D.createElementVNode("div",{class:D.normalizeClass(["vs-map-with-sidebar-panel__header-section",me.headerClasses])},[D.createElementVNode("div",Qd,[ee.currentStage>1||ee.selectedSubcategory?(D.openBlock(),D.createElementBlock("div",em,[D.createVNode(u,{class:"vs-map-with-sidebar-panel_menu",icon:"vs-icon-control-menu",size:"sm",onClick:me.stageBack,"data-test":"vs-map-with-sidebar__menu-toggle",variant:"secondary"},{default:D.withCtx(()=>[D.renderSlot(T.$slots,"menu-btn-text")]),_:3},8,["onClick"])])):D.createCommentVNode("",!0),ee.currentStage===1||ee.selectedSubcategory?(D.openBlock(),D.createElementBlock("div",tm,[D.createVNode(u,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:me.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:D.withCtx(()=>[D.renderSlot(T.$slots,"back-btn-text")]),_:3},8,["onClick"])])):D.createCommentVNode("",!0),D.createElementVNode("div",rm,[D.createVNode(u,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:me.closePanel,"data-test":"vs-map-with-sidebar-panel--btn-close"},{default:D.withCtx(()=>[D.renderSlot(T.$slots,"close-side-panel-text")]),_:3},8,["onClick"])])]),ee.currentStage>0||ee.selectedSubcategory?(D.openBlock(),D.createElementBlock("div",im,[D.createVNode(u,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:me.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:D.withCtx(()=>[D.renderSlot(T.$slots,"back-btn-text")]),_:3},8,["onClick"])])):D.createCommentVNode("",!0),me.currentHeading!==""?(D.openBlock(),D.createBlock(ot,{key:1,level:ee.headingLevel,"heading-style":ee.currentStage===0?"heading-m":"heading-xs",class:D.normalizeClass(["vs-map-with-sidebar-panel__heading text-center mt-200 mt-lg-0",ee.currentStage===2?"d-none d-lg-block":""]),"data-test":"vs-map-with-sidebar-panel__heading"},{default:D.withCtx(()=>[D.createTextVNode(D.toDisplayString(me.currentHeading),1)]),_:1},8,["level","heading-style","class"])):D.createCommentVNode("",!0),D.createElementVNode("div",{class:D.normalizeClass(["vs-map-with-sidebar-panel__reset",ee.currentStage<2?"d-lg-none":""])},[D.createVNode(u,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:me.resetPanel,"data-test":"vs-map-with-sidebar-panel--btn-reset"},{default:D.withCtx(()=>[D.renderSlot(T.$slots,"reset-side-panel-text")]),_:3},8,["onClick"])],2)],2),ee.currentStage===0?(D.openBlock(),D.createElementBlock(D.Fragment,{key:0},[ee.selectedSubcategory!==null?(D.openBlock(),D.createElementBlock(D.Fragment,{key:0},[D.createVNode(pe,{data:me.selectedSubcategoryData[0].subCategory,"selected-sub-category":ee.selectedSubcategory},null,8,["data","selected-sub-category"]),D.createVNode(dt)],64)):(D.openBlock(!0),D.createElementBlock(D.Fragment,{key:1},D.renderList(me.filtersWithLocations,rt=>(D.openBlock(),D.createBlock(Ze,{key:rt.id,"category-name":rt.label,type:rt.id,"has-sub-cat":me.subCatExists(rt)},null,8,["category-name","type","has-sub-cat"]))),128)),ee.panelMessage!==null?(D.openBlock(),D.createElementBlock("div",nm,[D.createElementVNode("p",null,D.toDisplayString(ee.panelMessage),1)])):D.createCommentVNode("",!0)],64)):D.createCommentVNode("",!0),ee.currentStage===1?(D.openBlock(),D.createElementBlock(D.Fragment,{key:1},[ee.selectedSubcategory!==null?(D.openBlock(),D.createElementBlock(D.Fragment,{key:0},[D.createElementVNode("div",om,[(D.openBlock(!0),D.createElementBlock(D.Fragment,null,D.renderList(ee.subcategoryLocations,(rt,rr)=>(D.openBlock(),D.createBlock(yr,{key:rt.id,"item-data":rt,"from-endpoint":!0,focussed:rr===ee.currentListItemFocus,onShowItemDetail:gr=>T.showDetail(rt)},null,8,["item-data","focussed","onShowItemDetail"]))),128)),me.showLoadMore?(D.openBlock(),D.createBlock(u,{key:0,class:"vs-map-with-sidebar-panel__load-more","data-test":"vs-map-with-sidebar-panel__load-more",onClick:K[0]||(K[0]=rt=>me.loadMorePlaces()),onKeyup:K[1]||(K[1]=D.withKeys(rt=>me.loadMorePlaces(),["enter"]))},{default:D.withCtx(()=>[D.renderSlot(T.$slots,"load-more-text")]),_:3})):D.createCommentVNode("",!0)]),D.createVNode(Ce,{"content-data":{},"filter-count":T.subCatFilterCount,onClearFilters:me.clearSubCatFilters},null,8,["filter-count","onClearFilters"])],64)):(D.openBlock(!0),D.createElementBlock(D.Fragment,{key:1},D.renderList(me.currentData,rt=>(D.openBlock(),D.createElementBlock("div",{key:rt.id},[typeof rt.properties<"u"&&rt.properties.category.id===ee.selectedCategory?(D.openBlock(),D.createBlock(yr,{key:0,"item-data":rt,onShowItemDetail:rr=>T.showDetail(rt)},null,8,["item-data","onShowItemDetail"])):D.createCommentVNode("",!0)]))),128))],64)):D.createCommentVNode("",!0),ee.currentStage===2?(D.openBlock(),D.createElementBlock(D.Fragment,{key:2},[D.createVNode(Zi,{"heading-level":me.detailHeadingLevel,"content-data":me.currentPlaceData[0]},null,8,["heading-level","content-data"]),D.createVNode(Ce,{"content-data":me.currentPlaceData[0]},null,8,["content-data"])],64)):D.createCommentVNode("",!0),ee.panelStatus!==null?(D.openBlock(),D.createElementBlock("div",am,[T.$slots["panel-loading-message"]&&ee.panelStatus!=="map-loading"?(D.openBlock(),D.createElementBlock("div",sm,[D.createElementVNode("p",lm,[D.renderSlot(T.$slots,"panel-loading-message")])])):D.createCommentVNode("",!0)])):D.createCommentVNode("",!0)],2)}const cm=Ct._export_sfc($d,[["render",um]]);let Nu=null;const pm={name:"VsMapWithSidebar",status:"deprecated",release:"0.0.1",components:{VsContainer:Ct.VsContainer,VsRow:Ct.VsRow,VsCol:Ct.VsCol,VsMap:vh,VsButton:Ct.VsButton,VsMapWithSidebarPanel:cm,VsButtonToggleGroup:Ct.VsButtonToggleGroup,VsWarning:Ct.VsWarning},provide(){return{filters:this.filters,filtersWithLocations:this.filtersWithLocations,placesData:this.placesData,mapId:this.mapId,regions:this.regionsData,clearSelectionText:this.clearSelectionText,applyFiltersText:this.applyFiltersText,subCatList:this.subCatList,filtersAppliedText:this.filtersAppliedText,clearFiltersText:this.clearFiltersText,focussedListItem:this.focussedListItem}},props:{categoryHeading:{type:String,default:""},filters:{type:Array,required:!0},placesData:{type:Array,required:!0},mapId:{type:String,required:!0},mainHeadingExists:{type:Boolean,default:!1},initialSelected:{type:String,default:""},toggleData:{type:Array,default:()=>[]},buttonsLabel:{type:String,default:""},clearSelectionText:{type:String,required:!0},applyFiltersText:{type:String,required:!0},detailsEndpoint:{type:String,default:""},regionBounds:{type:Object,default:()=>{}},clearFiltersText:{type:String,required:!0},filtersAppliedText:{type:String,required:!0},placeId:{type:String,default:null},mapFilterMessage:{type:String,required:!0},mapNoResultsMessage:{type:String,required:!0},panelMessage:{type:String,default:null},loadBrandingImmediately:{type:Boolean,default:!1}},data(){return{panelVisible:!1,selectedCategory:"",filterCategories:this.filters,selectedItem:null,activePins:this.placesData,currentlyHovered:"",showRegions:!1,regions:[],subCatList:null,selectedToggle:"",currentEndpointData:[],mapStatus:"",panelStatus:"map-loading",mapReady:!1,showPanelMessage:null,currentPanelEndpointFilters:"",totalEndpointPins:0,focussedListItem:0,resetZoom:!1,currentStage:0,selectedSubCategory:null}},computed:{mapDisplayClass(){return this.panelVisible?"d-none d-lg-block":""},panelDisplayClass(){return this.panelVisible?"":"d-none d-lg-block"},regionsData(){return this.placesData.filter(T=>T.geometry.type==="Polygon"||T.geometry.type==="MultiPolygon")},...ra.mapState(en,{subCatActiveFilters(T){return T.activeSubcatFilters}}),infoMessage(){let T="";switch(this.mapStatus){case"no-results":T=this.mapNoResultsMessage;break;case"filter-results":T=this.mapFilterMessage;break}return T},existingCategories(){return this.placesData?[...new Set(this.placesData.map(T=>T.properties.category.id))]:[]},filtersWithLocations(){return this.filters.filter(T=>!!(this.existingCategories.includes(T.id)||T.subCategory&&T.subCategory.length))},togglesWithLocations(){return this.existingCategories.indexOf("vics")===-1?this.toggleData.filter(T=>T.value!=="icentres"):this.toggleData}},watch:{selectedSubCategory(T){T===null&&(this.mapStatus="",this.resetZoom=!0)}},mounted(){Nu=en(),this.selectedToggle=this.initialSelected,this.emitter&&this.emitter.on("clearSelectedSubcats",()=>{this.resetZoom=!0})},methods:{openMenu(){this.setStage(0),this.openPanel()},closePanel(){this.panelVisible=!1},openPanel(){this.panelVisible=!0},showDetail(T){document.fullscreenElement&&document.exitFullscreen(),this.selectedItem=T,this.setStage(2),this.openPanel(),this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory)},setCategory(T){this.selectedCategory=T,this.selectedSubCategory===null&&this.filterPlaces(T)},setSubCategory(T){Nu.setSelectedSubcat(T),this.selectedSubCategory=T,T!==null?(this.getSubcatMarkerData(),this.selectedCategory=T):(Nu.setActiveSubcatFilters([]),this.showAllPlaces())},filterSubCategories(T){let K="";T.forEach(ee=>{const qe=`&cat=${ee}`;K+=qe}),this.currentPanelEndpointFilters=K,this.getSubcatMarkerData(K),this.getSubcatPanelData(K,0)},getSubcatMarkerData(T){const K=this.filters.filter(ee=>ee.id===this.selectedSubCategory);if(K.length>0){let ee=K[0].pinsEndpoint;typeof T<"u"&&(ee+=T),this.activePins=[],typeof T>"u"?(this.activePins=[],this.mapStatus="filter-results"):Ct.axios.get(ee).then(qe=>{this.totalEndpointPins=qe.data.features.length,this.totalEndpointPins===0?this.mapStatus="no-results":(qe.data.features.forEach(Le=>{const me=Le;me.properties.apiData=!0,this.activePins.push(me)}),this.mapStatus="")})}},getSubcatPanelData(T,K){let qe=this.filters.filter(Le=>Le.id===this.selectedSubCategory)[0].listProductsEndPoint;typeof T<"u"&&(qe+=T),K!==0&&(qe+=`${T}&page=${K}`),this.panelStatus="loading-data",Ct.axios.get(qe).then(Le=>{typeof Le.data.data.products<"u"?(this.setStage(1),K===0?(this.subCatList=Le.data.data.products,this.focussedListItem=0):(this.focussedListItem=K*24,this.subCatList=this.subCatList.concat(Le.data.data.products))):this.mapStatus="no-results",this.panelStatus=null})},setStage(T){if(T===2&&this.detailsEndpoint!==""&&this.selectedSubCategory!==null){const K=`${this.detailsEndpoint}${this.selectedItem.properties.id}`;Ct.axios.get(K).then(ee=>{const qe=[];qe.push(ee.data.data),this.currentEndpointData=qe,this.currentStage=T})}else this.currentStage=T,this.currentStage===0?(this.currentEndpointData=[],this.selectedSubCategory===null?(this.resetZoom=!0,this.showAllPlaces(),this.mapStatus=""):this.getSubcatMarkerData(),this.selectedToggle="places"):this.currentStage===1&&this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory);T!==2&&(Nu.setActivePlace({mapId:this.mapId,activeFeature:""}),this.selectedItem=null)},filterPlaces(T){if(T==="regions")this.showRegions=!0,this.activePins=[],this.selectedToggle="regions";else{this.showRegions=!1,this.selectedToggle="places";const K=this.placesData.filter(ee=>typeof ee.properties<"u"?ee.properties.category.id===T:!1);this.activePins=K}},loadMorePlaces(T){this.getSubcatPanelData(this.currentPanelEndpointFilters,T)},showAllPlaces(){this.activePins=this.placesData,this.showRegions=!1},onToggleChanged(T){T==="regions"?(this.setCategory("regions"),this.setStage(1)):T==="icentres"?(this.setCategory("vics"),this.setStage(1)):T==="places-regional"?(this.setCategory("twnv"),this.setStage(1)):(this.showAllPlaces(),this.setStage(0))},setMapReady(T){this.mapReady=T,T?this.panelStatus=null:this.panelStatus="loading"},categoryHasData(T){return this.existingCategories.indexOf(T)!==-1}}};function hm(T,K,ee,qe,Le,me){const u=D.resolveComponent("VsMapWithSidebarPanel"),ot=D.resolveComponent("VsButton"),pe=D.resolveComponent("VsMap"),dt=D.resolveComponent("VsButtonToggleGroup"),Ze=D.resolveComponent("VsWarning"),yr=D.resolveComponent("VsCol"),Ce=D.resolveComponent("VsRow"),Zi=D.resolveComponent("VsContainer");return D.openBlock(),D.createBlock(Zi,{"data-test":"vs-map-with-sidebar"},{default:D.withCtx(()=>[D.createVNode(Ce,null,{default:D.withCtx(()=>[D.createVNode(yr,null,{default:D.withCtx(()=>[D.createElementVNode("div",{class:"vs-map-with-sidebar",ref:ee.mapId},[D.createElementVNode("div",{class:D.normalizeClass(["vs-map-with-sidebar__side-panel",me.panelDisplayClass]),"data-test":"vs-map-with-sidebar__side-panel"},[D.createVNode(u,{"category-heading":ee.categoryHeading,"selected-category":Le.selectedCategory,"selected-subcategory":Le.selectedSubCategory,"current-stage":Le.currentStage,"selected-item":Le.selectedItem,"heading-level":ee.mainHeadingExists?"3":"2","subcategory-locations":Le.subCatList,"current-endpoint-data":Le.currentEndpointData,"panel-status":Le.panelStatus,"panel-message":Le.currentStage===0?ee.panelMessage:null,"total-pins":Le.totalEndpointPins,"current-list-item-focus":Le.focussedListItem,onSetCategory:me.setCategory,onSetSubcategory:me.setSubCategory,onSubcategoriesFiltered:me.filterSubCategories,onSetStage:me.setStage,onClosePanel:me.closePanel,onShowItemDetail:me.showDetail,onFilterPlaces:me.filterPlaces,onLoadMorePlaces:me.loadMorePlaces},{closePanelText:D.withCtx(()=>[D.renderSlot(T.$slots,"close-side-panel-text")]),"reset-side-panel-text":D.withCtx(()=>[D.renderSlot(T.$slots,"reset-side-panel-text")]),"menu-btn-text":D.withCtx(()=>[D.renderSlot(T.$slots,"menu-btn-text")]),"panel-loading-message":D.withCtx(()=>[D.renderSlot(T.$slots,"panel-loading-message")]),"load-more-text":D.withCtx(()=>[D.renderSlot(T.$slots,"load-more-text")]),_:3},8,["category-heading","selected-category","selected-subcategory","current-stage","selected-item","heading-level","subcategory-locations","current-endpoint-data","panel-status","panel-message","total-pins","current-list-item-focus","onSetCategory","onSetSubcategory","onSubcategoriesFiltered","onSetStage","onClosePanel","onShowItemDetail","onFilterPlaces","onLoadMorePlaces"])],2),D.createElementVNode("div",{class:D.normalizeClass(["vs-map-with-sidebar__map",me.mapDisplayClass])},[D.createVNode(ot,{class:"vs-map-with-sidebar__map-toggle",icon:"vs-icon-control-menu",size:"sm",onClick:me.openMenu,"data-test":"vs-map-with-sidebar__map-toggle",variant:"secondary"},{default:D.withCtx(()=>[D.renderSlot(T.$slots,"open-side-panel-text")]),_:3},8,["onClick"]),D.createVNode(pe,{"is-visible":!Le.panelVisible,labels:{},filters:me.filtersWithLocations,places:Le.activePins,"selected-item":Le.selectedItem,"map-id":ee.mapId,"show-polygons":Le.showRegions,"show-info-message":Le.mapStatus!=="",onShowDetail:me.showDetail,onSetCategory:me.setCategory,onMapReady:me.setMapReady,onZoomReset:K[0]||(K[0]=rt=>Le.resetZoom=!1),"bounds-data":ee.regionBounds,"reset-zoom":Le.resetZoom,"show-marker-popups":!1,"load-branding-immediately":ee.loadBrandingImmediately},{"map-loading-text":D.withCtx(()=>[D.renderSlot(T.$slots,"map-loading-text")]),"info-message":D.withCtx(()=>[D.createTextVNode(D.toDisplayString(me.infoMessage),1)]),"zoom-too-close":D.withCtx(()=>[D.renderSlot(T.$slots,"zoom-too-close")]),"zoom-too-far":D.withCtx(()=>[D.renderSlot(T.$slots,"zoom-too-far")]),"no-js":D.withCtx(()=>[D.renderSlot(T.$slots,"no-js")]),_:3},8,["is-visible","filters","places","selected-item","map-id","show-polygons","show-info-message","onShowDetail","onSetCategory","onMapReady","bounds-data","reset-zoom","load-branding-immediately"]),me.togglesWithLocations.length>1?(D.openBlock(),D.createBlock(dt,{key:0,"data-test":"vs-map-with-sidebar__map-toggle-group","initial-selected":Le.selectedToggle,options:me.togglesWithLocations,"buttons-label":ee.buttonsLabel,onToggleChanged:me.onToggleChanged},null,8,["initial-selected","options","buttons-label","onToggleChanged"])):D.createCommentVNode("",!0)],2)],512),D.createVNode(Ze,{class:"vs-map-with-sidebar__no-js"},{default:D.withCtx(()=>[D.renderSlot(T.$slots,"no-js")]),_:3})]),_:3})]),_:3})]),_:3})}const fm=Ct._export_sfc(pm,[["render",hm]]);exports.VsMap=vh;exports.VsMapMarker=gh;exports.VsMapMarkerIcon=Zu;exports.VsMapWithSidebar=fm;
|