StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
StackGenVis/frontend/node_modules/mapbox-gl/dist/mapbox-gl-csp.js

2 lines
619 KiB

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).mapboxgl=e()}(this,(function(){"use strict";function t(t,e){return t(e={exports:{}},e.exports),e.exports}var e=t((function(t){function e(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&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 t,e,r=new Blob([""],{type:"text/javascript"}),i=URL.createObjectURL(r);try{e=new Worker(i),t=!0}catch(e){t=!1}e&&e.terminate();return URL.revokeObjectURL(i),t}()&&"Uint8ClampedArray"in window&&ArrayBuffer.isView&&function(t){void 0===r[t]&&(r[t]=function(t){var r=document.createElement("canvas"),i=Object.create(e.webGLContextAttributes);return i.failIfMajorPerformanceCaveat=t,r.probablySupportsContext?r.probablySupportsContext("webgl",i)||r.probablySupportsContext("experimental-webgl",i):r.supportsContext?r.supportsContext("webgl",i)||r.supportsContext("experimental-webgl",i):r.getContext("webgl",i)||r.getContext("experimental-webgl",i)}(t));return r[t]}(t&&t.failIfMajorPerformanceCaveat))}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e);var r={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),r=i;function i(t,e,r,i){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=r,this.p2y=i}i.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},i.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},i.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},i.prototype.solveCurveX=function(t,e){var r,i,n,o,a;for(void 0===e&&(e=1e-6),n=t,a=0;a<8;a++){if(o=this.sampleCurveX(n)-t,Math.abs(o)<e)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=o/s}if((n=t)<(r=0))return r;if(n>(i=1))return i;for(;r<i;){if(o=this.sampleCurveX(n),Math.abs(o-t)<e)return n;t>o?r=n:i=n,n=.5*(i-r)+r}return n},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var n=o;function o(t,e){this.x=t,this.y=e}function a(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!a(t[r],e[r]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var i in t)if(!a(t[i],e[i]))return!1;return!0}return t===e}function s(t,e,i,n){var o=new r(t,e,i,n);return function(t){return o.solve(t)}}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),o=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var u=s(.25,.1,.25,1);function l(t,e,r){return Math.min(r,Math.max(e,t))}function p(t,e,r){var i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n}function c(t,e,r){if(!t.length)return r(null,[]);var i=t.length,n=new Array(t.length),o=null;t.forEach((function(t,a){e(t,(function(t,e){t&&(o=t),n[a]=e,0==--i&&r(o,n)}))}))}function h(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,n=e;i<n.length;i+=1){var o=n[i];for(var a in o)t[a]=o[a]}return t}function f(t,e){for(var r={},i=0;i<e.length;i++){var n=e[i];n in t&&(r[n]=t[n])}return r}var d=1;function m(){return d++}function y(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function _(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function v(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function g(t,e){return-1!==t.indexOf(e,t.length-e.length)}function x(t,e,r){var i={};for(var n in t)i[n]=e.call(r||this,t[n],n,t);return i}function b(t,e,r){var i={};for(var n in t)e.call(r||this,t[n],n,t)&&(i[n]=t[n]);return i}function w(t){return Array.isArray(t)?t.map(w):"object"==typeof t&&t?x(t,w):t}var S={};function A(t){S[t]||("undefined"!=typeof console&&console.warn(t),S[t]=!0)}function T(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function I(t){for(var e=0,r=0,i=t.length,n=i-1,o=void 0,a=void 0;r<i;n=r++)o=t[r],e+=((a=t[n]).x-o.x)*(o.y+a.y);return e}function z(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,i,n){var o=i||n;return e[r]=!o||o.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}function k(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var E,C,P=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),M=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,D=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,L={now:P,frame:function(t){var e=M(t);return{cancel:function(){return D(e)}}},getImageData:function(t){var e=self.document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(0,0,t.width,t.height)},resolveURL:function(t){return E||(E=self.document.createElement("a")),E.href=t,E.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==C&&(C=self.matchMedia("(prefers-reduced-motion: reduce)")),C.matches)}},B={create:function(t,e,r){var i=self.document.createElement(t);return void 0!==e&&(i.className=e),r&&r.appendChild(i),i},createNS:function(t,e){return self.document.createElementNS(t,e)}},R=self.document.documentElement.style;function F(t){if(!R)return t[0];for(var e=0;e<t.length;e++)if(t[e]in R)return t[e];return t[0]}var O,V=F(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);B.disableDrag=function(){R&&V&&(O=R[V],R[V]="none")},B.enableDrag=function(){R&&V&&(R[V]=O)};var U=F(["transform","WebkitTransform"]);B.setTransform=function(t,e){t.style[U]=e};var N=!1;try{var j=Object.defineProperty({},"passive",{get:function(){N=!0}});self.addEventListener("test",j,j),self.removeEventListener("test",j,j)}catch(t){N=!1}B.addEventListener=function(t,e,r,i){void 0===i&&(i={}),"passive"in i&&N?t.addEventListener(e,r,i):t.addEventListener(e,r,i.capture)},B.removeEventListener=function(t,e,r,i){void 0===i&&(i={}),"passive"in i&&N?t.removeEventListener(e,r,i):t.removeEventListener(e,r,i.capture)};var q=function(t){t.preventDefault(),t.stopPropagation(),self.removeEventListener("click",q,!0)};B.suppressClick=function(){self.addEventListener("click",q,!0),self.setTimeout((function(){self.removeEventListener("click",q,!0)}),0)},B.mousePos=function(t,e){var r=t.getBoundingClientRect(),i=self.TouchEvent&&e instanceof self.TouchEvent?e.touches[0]:e;return new n(i.clientX-r.left-t.clientLeft,i.clientY-r.top-t.clientTop)},B.touchPos=function(t,e){for(var r=t.getBoundingClientRect(),i=[],o="touchend"===e.type?e.changedTouches:e.touches,a=0;a<o.length;a++)i.push(new n(o[a].clientX-r.left-t.clientLeft,o[a].clientY-r.top-t.clientTop));return i},B.mouseButton=function(t){return void 0!==self.InstallTrigger&&2===t.button&&t.ctrlKey&&self.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:t.button},B.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var Z,G,W={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"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},K={supported:!1,testSupport:function(t){if(H||!G)return;X?J(t):Z=t}},H=!1,X=!1;function J(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,G),t.isContextLost())return;K.supported=!0}catch(t){}t.deleteTexture(e),H=!0}self.document&&((G=self.document.createElement("img")).onload=function(){Z&&J(Z),Z=null,X=!0},G.onerror=function(){H=!0,Z=null},G.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var Y="01";var Q=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function $(t){return 0===t.indexOf("mapbox:")}Q.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",Y,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},Q.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},Q.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},Q.prototype.normalizeStyleURL=function(t,e){if(!$(t))return t;var r=it(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},Q.prototype.normalizeGlyphsURL=function(t,e){if(!$(t))return t;var r=it(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},Q.prototype.normalizeSourceURL=function(t,e){if(!$(t))return t;var r=it(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},Q.prototype.normalizeSpriteURL=function(t,e,r,i){var n=it(t);return $(t)?(n.path="/styles/v1"+n.path+"/sprite"+e+r,this._makeAPIURL(n,this._customAccessToken||i)):(n.path+=""+e+r,nt(n))},Q.prototype.normalizeTileURL=function(t,e,r){if(this._isSkuTokenExpired()&&this._createSkuToken(),!e||!$(e))return t;var i=it(t),n=L.devicePixelRatio>=2||512===r?"@2x":"",o=K.supported?".webp":"$1";return i.path=i.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+o),i.path=i.path.replace(/^.+\/v4\//,"/"),i.path="/v4"+i.path,W.REQUIRE_ACCESS_TOKEN&&(W.ACCESS_TOKEN||this._customAccessToken)&&this._skuToken&&i.params.push("sku="+this._skuToken),this._makeAPIURL(i,this._customAccessToken)},Q.prototype.canonicalizeTileURL=function(t){var e=it(t);if(!e.path.match(/(^\/v4\/)/)||!e.path.match(/\.[\w]+$/))return t;var r="mapbox://tiles/";r+=e.path.replace("/v4/","");var i=e.params.filter((function(t){return!t.match(/^access_token=/)}));return i.length&&(r+="?"+i.join("&")),r},Q.prototype.canonicalizeTileset=function(t,e){if(!$(e))return t.tiles||[];for(var r=[],i=0,n=t.tiles;i<n.length;i+=1){var o=n[i],a=this.canonicalizeTileURL(o);r.push(a)}return r},Q.prototype._makeAPIURL=function(t,e){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",i=it(W.API_URL);if(t.protocol=i.protocol,t.authority=i.authority,"/"!==i.path&&(t.path=""+i.path+t.path),!W.REQUIRE_ACCESS_TOKEN)return nt(t);if(!(e=e||W.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),nt(t)};var tt=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function et(t){return tt.test(t)}var rt=/^(\w+):\/\/([^\/?]*)(\/[^?]+)?\??(.+)?/;function it(t){var e=t.match(rt);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function nt(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function ot(t){if(!t)return null;var e,r=t.split(".");if(!r||3!==r.length)return null;try{return JSON.parse((e=r[1],decodeURIComponent(self.atob(e).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(t){return null}}var at=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};at.prototype.getStorageKey=function(t){var e,r=ot(W.ACCESS_TOKEN),i="";return r&&r.u?(e=r.u,i=self.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))})))):i=W.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+i:"mapbox.eventData:"+i},at.prototype.fetchEventData=function(){var t=k("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var i=self.localStorage.getItem(e);i&&(this.eventData=JSON.parse(i));var n=self.localStorage.getItem(r);n&&(this.anonId=n)}catch(t){A("Unable to read from LocalStorage")}},at.prototype.saveEventData=function(){var t=k("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{self.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){A("Unable to write to LocalStorage")}},at.prototype.processRequests=function(t){},at.prototype.postEvent=function(t,e,r,i){var n=this;if(W.EVENTS_URL){var o=it(W.EVENTS_URL);o.params.push("access_token="+(i||W.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.3.2",skuId:Y,userId:this.anonId},s=e?h(a,e):a,u={url:nt(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=Ct(u,(function(t){n.pendingRequest=null,r(t),n.saveEventData(),n.processRequests(i)}))}},at.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var st,ut=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,i){this.skuToken=r,(W.EVENTS_URL&&i||W.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return $(t)||et(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},i)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),i=r.id,n=r.timestamp;i&&this.success[i]||(this.anonId||this.fetchEventData(),_(this.anonId)||(this.anonId=y()),this.postEvent(n,{skuToken:this.skuToken},(function(t){t||i&&(e.success[i]=!0)}),t))}},e}(at),lt=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){W.EVENTS_URL&&W.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return $(t)||et(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=ot(W.ACCESS_TOKEN),i=r?r.u:W.ACCESS_TOKEN,n=i!==this.eventData.tokenU;_(this.anonId)||(this.anonId=y(),n=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;n=n||u>=1||u<-1||a.getDate()!==s.getDate()}else n=!0;if(!n)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=i)}),t)}},e}(at)),pt=lt.postTurnstileEvent.bind(lt),ct=new ut,ht=ct.postMapLoadEvent.bind(ct),ft="mapbox-tiles",dt=500,mt=50,yt=42e4;function _t(t,e,r){if(self.caches){var i={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return i.headers.set(e,t)}));var n=z(e.headers.get("Cache-Control")||"");if(!n["no-store"])n["max-age"]&&i.headers.set("Expires",new Date(r+1e3*n["max-age"]).toUTCString()),new Date(i.headers.get("Expires")).getTime()-r<yt||function(t,e){if(void 0===st)try{new Response(new ReadableStream),st=!0}catch(t){st=!1}st?e(t.body):t.blob().then(e)}(e,(function(e){var r=new self.Response(e,i);self.caches.open(ft).then((function(e){return e.put(vt(t.url),r)})).catch((function(t){return A(t.message)}))}))}}function vt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}function gt(t,e){if(!self.caches)return e(null);var r=vt(t.url);self.caches.open(ft).then((function(t){t.match(r).then((function(i){var n=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")),r=z(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(i);t.delete(r),n&&t.put(r,i.clone()),e(null,i,n)})).catch(e)})).catch(e)}var xt=1/0;function bt(t){++xt>mt&&(t.getActor().send("enforceCacheSizeLimit",dt),xt=0)}var wt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(wt);var St=function(t){function e(e,r,i){401===r&&et(i)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=i,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error);function At(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}var Tt=At()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};function It(t,e){var r,i=new self.AbortController,n=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:Tt(),signal:i.signal}),o=!1,a=!1,s=(r=n.url).indexOf("sku=")>0&&et(r);"json"===t.type&&n.headers.set("Accept","application/json");var u=function(r,i,o){if(!a){if(r&&"SecurityError"!==r.message&&A(r),i&&o)return l(i);var u=Date.now();self.fetch(n).then((function(r){if(r.ok){var i=s?r.clone():null;return l(r,i,u)}return e(new St(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},l=function(r,i,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){a||(i&&s&&_t(n,i,s),o=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){return e(new Error(t.message))}))};return s?gt(n,u):u(null,null),{cancel:function(){a=!0,o||i.abort()}}}var zt=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(Tt())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return It(t,e);if(At()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e)}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var i in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(i,t.headers[i]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var i=r.response;if("json"===t.type)try{i=JSON.parse(r.response)}catch(t){return e(t)}e(null,i,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new St(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},kt=function(t,e){return zt(h(t,{type:"json"}),e)},Et=function(t,e){return zt(h(t,{type:"arrayBuffer"}),e)},Ct=function(t,e){return zt(h(t,{method:"POST"}),e)};var Pt,Mt;Pt=[],Mt=0;var Dt=function(t,e){if(Mt>=W.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return Pt.push(r),r}Mt++;var i=!1,n=function(){if(!i)for(i=!0,Mt--;Pt.length&&Mt<W.MAX_PARALLEL_IMAGE_REQUESTS;){var t=Pt.shift(),e=t.requestParameters,r=t.callback;t.cancelled||(t.cancel=Dt(e,r).cancel)}},o=Et(t,(function(t,r,i,o){if(n(),t)e(t);else if(r){var a=new self.Image,s=self.URL||self.webkitURL;a.onload=function(){e(null,a),s.revokeObjectURL(a.src)},a.onerror=function(){return e(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 u=new self.Blob([new Uint8Array(r)],{type:"image/png"});a.cacheControl=i,a.expires=o,a.src=r.byteLength?s.createObjectURL(u):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}}));return{cancel:function(){o.cancel(),n()}}};function Lt(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function Bt(t,e,r){if(r&&r[t]){var i=r[t].indexOf(e);-1!==i&&r[t].splice(i,1)}}var Rt=function(t,e){void 0===e&&(e={}),h(this,e),this.type=t},Ft=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",h({error:e},r))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Rt),Ot=function(){};Ot.prototype.on=function(t,e){return this._listeners=this._listeners||{},Lt(t,e,this._listeners),this},Ot.prototype.off=function(t,e){return Bt(t,e,this._listeners),Bt(t,e,this._oneTimeListeners),this},Ot.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},Lt(t,e,this._oneTimeListeners),this},Ot.prototype.fire=function(t,e){"string"==typeof t&&(t=new Rt(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var i=0,n=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];i<n.length;i+=1){n[i].call(this,t)}for(var o=0,a=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];o<a.length;o+=1){var s=a[o];Bt(r,s,this._oneTimeListeners),s.call(this,t)}var u=this._eventedParent;u&&(h(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),u.fire(t))}else t instanceof Ft&&console.error(t.error);return this},Ot.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Ot.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Vt={$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"},"*":{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"},"*":{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"},"*":{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},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1}},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:"string",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"},{"!":"text-variable-anchor"}],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":{}}},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:22,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},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:"string",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:"string",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:"string",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:"string",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"}}},Ut=function(t,e,r,i){this.message=(t?t+": ":"")+r,i&&(this.identifier=i),null!=e&&e.__line__&&(this.line=e.__line__)};function Nt(t){var e=t.key,r=t.value;return r?[new Ut(e,r,"constants have been deprecated as of v8")]:[]}function jt(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,n=e;i<n.length;i+=1){var o=n[i];for(var a in o)t[a]=o[a]}return t}function qt(t){return t instanceof Number||t instanceof String||t instanceof Boolean}function Zt(t){return qt(t)?t.valueOf():t}function Gt(t){if(Array.isArray(t))return t.map(Gt);if(t instanceof Object&&!qt(t)){var e={};for(var r in t)e[r]=Gt(t[r]);return e}return Zt(t)}var Wt=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),Kt=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,i=e;r<i.length;r+=1){var n=i[r],o=n[0],a=n[1];this.bindings[o]=a}};Kt.prototype.concat=function(t){return new Kt(this,t)},Kt.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Kt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Ht={kind:"null"},Xt={kind:"number"},Jt={kind:"string"},Yt={kind:"boolean"},Qt={kind:"color"},$t={kind:"object"},te={kind:"value"},ee={kind:"collator"},re={kind:"formatted"};function ie(t,e){return{kind:"array",itemType:t,N:e}}function ne(t){if("array"===t.kind){var e=ne(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var oe=[Ht,Xt,Jt,Yt,Qt,re,$t,ie(te)];function ae(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!ae(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,i=oe;r<i.length;r+=1){if(!ae(i[r],e))return null}}return"Expected "+ne(t)+" but found "+ne(e)+" instead."}var se=t((function(t,e){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 i(t){return(t=Math.round(t))<0?0:t>255?255:t}function n(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100*255):i(parseInt(t))}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100):n(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,n=t.replace(/ /g,"").toLowerCase();if(n in r)return r[n].slice();if("#"===n[0])return 4===n.length?(e=parseInt(n.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===n.length&&(e=parseInt(n.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=n.indexOf("("),l=n.indexOf(")");if(-1!==u&&l+1===n.length){var p=n.substr(0,u),c=n.substr(u+1,l-(u+1)).split(","),h=1;switch(p){case"rgba":if(4!==c.length)return null;h=a(c.pop());case"rgb":return 3!==c.length?null:[o(c[0]),o(c[1]),o(c[2]),h];case"hsla":if(4!==c.length)return null;h=a(c.pop());case"hsl":if(3!==c.length)return null;var f=(parseFloat(c[0])%360+360)%360/360,d=a(c[1]),m=a(c[2]),y=m<=.5?m*(d+1):m+d-m*d,_=2*m-y;return[i(255*s(_,y,f+1/3)),i(255*s(_,y,f)),i(255*s(_,y,f-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,ue=function(t,e,r,i){void 0===i&&(i=1),this.r=t,this.g=e,this.b=r,this.a=i};ue.parse=function(t){if(t){if(t instanceof ue)return t;if("string"==typeof t){var e=se(t);if(e)return new ue(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},ue.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],i=t[2],n=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(i)+","+n+")"},ue.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,i=this.a;return 0===i?[0,0,0,0]:[255*t/i,255*e/i,255*r/i,i]},ue.black=new ue(0,0,0,1),ue.white=new ue(1,1,1,1),ue.transparent=new ue(0,0,0,0),ue.red=new ue(1,0,0,1);var le=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};le.prototype.compare=function(t,e){return this.collator.compare(t,e)},le.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var pe=function(t,e,r,i){this.text=t,this.scale=e,this.fontStack=r,this.textColor=i},ce=function(t){this.sections=t};function he(t,e,r,i){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:"Invalid rgba value ["+[t,e,r,i].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof i?[t,e,r,i]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function fe(t){if(null===t)return Ht;if("string"==typeof t)return Jt;if("boolean"==typeof t)return Yt;if("number"==typeof t)return Xt;if(t instanceof ue)return Qt;if(t instanceof le)return ee;if(t instanceof ce)return re;if(Array.isArray(t)){for(var e,r=t.length,i=0,n=t;i<n.length;i+=1){var o=fe(n[i]);if(e){if(e===o)continue;e=te;break}e=o}return ie(e||te,r)}return $t}function de(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof ue||t instanceof ce?t.toString():JSON.stringify(t)}ce.fromString=function(t){return new ce([new pe(t,null,null,null)])},ce.prototype.toString=function(){return this.sections.map((function(t){return t.text})).join("")},ce.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var i=r[e];t.push(i.text);var n={};i.fontStack&&(n["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(n["font-scale"]=i.scale),i.textColor&&(n["text-color"]=["rgba"].concat(i.textColor.toArray())),t.push(n)}return t};var me=function(t,e){this.type=t,this.value=e};me.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!function t(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof ue)return!0;if(e instanceof le)return!0;if(e instanceof ce)return!0;if(Array.isArray(e)){for(var r=0,i=e;r<i.length;r+=1){if(!t(i[r]))return!1}return!0}if("object"==typeof e){for(var n in e)if(!t(e[n]))return!1;return!0}return!1}(t[1]))return e.error("invalid value");var r=t[1],i=fe(r),n=e.expectedType;return"array"!==i.kind||0!==i.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(i=n),new me(i,r)},me.prototype.evaluate=function(){return this.value},me.prototype.eachChild=function(){},me.prototype.possibleOutputs=function(){return[this.value]},me.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof ue?["rgba"].concat(this.value.toArray()):this.value instanceof ce?this.value.serialize():this.value};var ye=function(t){this.name="ExpressionEvaluationError",this.message=t};ye.prototype.toJSON=function(){return this.message};var _e={string:Jt,number:Xt,boolean:Yt,object:$t},ve=function(t,e){this.type=t,this.args=e};ve.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,i=1,n=t[0];if("array"===n){var o,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in _e)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=_e[s],i++}else o=te;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],i++}r=ie(o,a)}else r=_e[n];for(var u=[];i<t.length;i++){var l=e.parse(t[i],i,te);if(!l)return null;u.push(l)}return new ve(r,u)},ve.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!ae(this.type,fe(r)))return r;if(e===this.args.length-1)throw new ye("Expected value to be of type "+ne(this.type)+", but found "+ne(fe(r))+" instead.")}return null},ve.prototype.eachChild=function(t){this.args.forEach(t)},ve.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},ve.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var i=t.N;("number"==typeof i||this.args.length>1)&&e.push(i)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var ge=function(t){this.type=re,this.sections=t};ge.parse=function(t,e){if(t.length<3)return e.error("Expected at least two arguments.");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");for(var r=[],i=1;i<t.length-1;i+=2){var n=e.parse(t[i],1,te);if(!n)return null;var o=n.type.kind;if("string"!==o&&"value"!==o&&"null"!==o)return e.error("Formatted text type must be 'string', 'value', or 'null'.");var a=t[i+1];if("object"!=typeof a||Array.isArray(a))return e.error("Format options argument must be an object.");var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Xt)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,ie(Jt))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,Qt)))return null;r.push({text:n,scale:s,font:u,textColor:l})}return new ge(r)},ge.prototype.evaluate=function(t){return new ce(this.sections.map((function(e){return new pe(de(e.text.evaluate(t)),e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},ge.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var i=r[e];t(i.text),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor)}},ge.prototype.possibleOutputs=function(){return[void 0]},ge.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var i=r[e];t.push(i.text.serialize());var n={};i.scale&&(n["font-scale"]=i.scale.serialize()),i.font&&(n["text-font"]=i.font.serialize()),i.textColor&&(n["text-color"]=i.textColor.serialize()),t.push(n)}return t};var xe={"to-boolean":Yt,"to-color":Qt,"to-number":Xt,"to-string":Jt},be=function(t,e){this.type=t,this.args=e};be.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var i=xe[r],n=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,te);if(!a)return null;n.push(a)}return new be(i,n)},be.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,i=0,n=this.args;i<n.length;i+=1){if(r=null,(e=n[i].evaluate(t))instanceof ue)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":he(e[0],e[1],e[2],e[3])))return new ue(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ye(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s<u.length;s+=1){if(null===(a=u[s].evaluate(t)))return 0;var l=Number(a);if(!isNaN(l))return l}throw new ye("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?ce.fromString(de(this.args[0].evaluate(t))):de(this.args[0].evaluate(t))},be.prototype.eachChild=function(t){this.args.forEach(t)},be.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},be.prototype.serialize=function(){if("formatted"===this.type.kind)return new ge([{text:this.args[0],scale:null,font:null,textColor:null}]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var we=["Unknown","Point","LineString","Polygon"],Se=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={}};Se.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Se.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?we[this.feature.type]:this.feature.type:null},Se.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Se.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=ue.parse(t)),e};var Ae=function(t,e,r,i){this.name=t,this.type=e,this._evaluate=r,this.args=i};Ae.prototype.evaluate=function(t){return this._evaluate(t,this.args)},Ae.prototype.eachChild=function(t){this.args.forEach(t)},Ae.prototype.possibleOutputs=function(){return[void 0]},Ae.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},Ae.parse=function(t,e){var r,i=t[0],n=Ae.definitions[i];if(!n)return e.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=a.filter((function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1})),u=null,l=0,p=s;l<p.length;l+=1){var c=p[l],h=c[0],f=c[1];u=new Ce(e.registry,e.path,null,e.scope);for(var d=[],m=!1,y=1;y<t.length;y++){var _=t[y],v=Array.isArray(h)?h[y-1]:h.type,g=u.parse(_,1+d.length,v);if(!g){m=!0;break}d.push(g)}if(!m)if(Array.isArray(h)&&h.length!==d.length)u.error("Expected "+h.length+" arguments, but found "+d.length+" instead.");else{for(var x=0;x<d.length;x++){var b=Array.isArray(h)?h[x]:h.type,w=d[x];u.concat(x+1).checkSubtype(b,w.type)}if(0===u.errors.length)return new Ae(i,o,f,d)}}if(1===s.length)(r=e.errors).push.apply(r,u.errors);else{for(var S=(s.length?s:a).map((function(t){var e,r=t[0];return e=r,Array.isArray(e)?"("+e.map(ne).join(", ")+")":"("+ne(e.type)+"...)"})).join(" | "),A=[],T=1;T<t.length;T++){var I=e.parse(t[T],1+A.length);if(!I)return null;A.push(ne(I.type))}e.error("Expected arguments of type "+S+", but found ("+A.join(", ")+") instead.")}return null},Ae.register=function(t,e){for(var r in Ae.definitions=e,e)t[r]=Ae};var Te=function(t,e,r){this.type=ee,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};function Ie(t){if(t instanceof Ae){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}var e=!0;return t.eachChild((function(t){e&&!Ie(t)&&(e=!1)})),e}function ze(t){if(t instanceof Ae&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!ze(t)&&(e=!1)})),e}function ke(t,e){if(t instanceof Ae&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!ke(t,e)&&(r=!1)})),r}Te.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var i=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Yt);if(!i)return null;var n=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Yt);if(!n)return null;var o=null;return r.locale&&!(o=e.parse(r.locale,1,Jt))?null:new Te(i,n,o)},Te.prototype.evaluate=function(t){return new le(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Te.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},Te.prototype.possibleOutputs=function(){return[void 0]},Te.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var Ee=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Ee.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new Ee(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Ee.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Ee.prototype.eachChild=function(){},Ee.prototype.possibleOutputs=function(){return[void 0]},Ee.prototype.serialize=function(){return["var",this.name]};var Ce=function(t,e,r,i,n){void 0===e&&(e=[]),void 0===i&&(i=new Kt),void 0===n&&(n=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=i,this.errors=n,this.expectedType=r};function Pe(t,e){for(var r,i,n=t.length-1,o=0,a=n,s=0;o<=a;)if(r=t[s=Math.floor((o+a)/2)],i=t[s+1],r<=e){if(s===n||e<i)return s;o=s+1}else{if(!(r>e))throw new ye("Input is not a number.");a=s-1}return 0}Ce.prototype.parse=function(t,e,r,i,n){return void 0===n&&(n={}),e?this.concat(e,r,i)._parse(t,n):this._parse(t,n)},Ce.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new ve(e,[t]):"coerce"===r?new be(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var i=t[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found "+typeof i+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[i];if(n){var o=n.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof me)&&function t(e){if(e instanceof Ee)return t(e.boundExpression);if(e instanceof Ae&&"error"===e.name)return!1;if(e instanceof Te)return!1;var r=e instanceof be||e instanceof ve;var i=!0;e.eachChild((function(e){i=r?i&&t(e):i&&e instanceof me}));if(!i)return!1;return Ie(e)&&ke(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new Se;try{o=new me(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Ce.prototype.concat=function(t,e,r){var i="number"==typeof t?this.path.concat(t):this.path,n=r?this.scope.concat(r):this.scope;return new Ce(this.registry,i,e||null,n,this.errors)},Ce.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var i=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Wt(i,t))},Ce.prototype.checkSubtype=function(t,e){var r=ae(t,e);return r&&this.error(r),r};var Me=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var i=0,n=r;i<n.length;i+=1){var o=n[i],a=o[0],s=o[1];this.labels.push(a),this.outputs.push(s)}};function De(t,e,r){return t*(1-r)+e*r}Me.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,Xt);if(!r)return null;var i=[],n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var o=1;o<t.length;o+=2){var a=1===o?-1/0:t[o],s=t[o+1],u=o,l=o+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(i.length&&i[i.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var p=e.parse(s,l,n);if(!p)return null;n=n||p.type,i.push([a,p])}return new Me(n,r,i)},Me.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;return i>=e[n-1]?r[n-1].evaluate(t):r[Pe(e,i)].evaluate(t)},Me.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1){t(r[e])}},Me.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()})))},Me.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Le=Object.freeze({number:De,color:function(t,e,r){return new ue(De(t.r,e.r,r),De(t.g,e.g,r),De(t.b,e.b,r),De(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,i){return De(t,e[i],r)}))}}),Be=.95047,Re=1,Fe=1.08883,Oe=4/29,Ve=6/29,Ue=3*Ve*Ve,Ne=Ve*Ve*Ve,je=Math.PI/180,qe=180/Math.PI;function Ze(t){return t>Ne?Math.pow(t,1/3):t/Ue+Oe}function Ge(t){return t>Ve?t*t*t:Ue*(t-Oe)}function We(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ke(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function He(t){var e=Ke(t.r),r=Ke(t.g),i=Ke(t.b),n=Ze((.4124564*e+.3575761*r+.1804375*i)/Be),o=Ze((.2126729*e+.7151522*r+.072175*i)/Re);return{l:116*o-16,a:500*(n-o),b:200*(o-Ze((.0193339*e+.119192*r+.9503041*i)/Fe)),alpha:t.a}}function Xe(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=Re*Ge(e),r=Be*Ge(r),i=Fe*Ge(i),new ue(We(3.2404542*r-1.5371385*e-.4985314*i),We(-.969266*r+1.8760108*e+.041556*i),We(.0556434*r-.2040259*e+1.0572252*i),t.alpha)}function Je(t,e,r){var i=e-t;return t+r*(i>180||i<-180?i-360*Math.round(i/360):i)}var Ye={forward:He,reverse:Xe,interpolate:function(t,e,r){return{l:De(t.l,e.l,r),a:De(t.a,e.a,r),b:De(t.b,e.b,r),alpha:De(t.alpha,e.alpha,r)}}},Qe={forward:function(t){var e=He(t),r=e.l,i=e.a,n=e.b,o=Math.atan2(n,i)*qe;return{h:o<0?o+360:o,c:Math.sqrt(i*i+n*n),l:r,alpha:t.a}},reverse:function(t){var e=t.h*je,r=t.c;return Xe({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:Je(t.h,e.h,r),c:De(t.c,e.c,r),l:De(t.l,e.l,r),alpha:De(t.alpha,e.alpha,r)}}},$e=Object.freeze({lab:Ye,hcl:Qe}),tr=function(t,e,r,i,n){this.type=t,this.operator=e,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(var o=0,a=n;o<a.length;o+=1){var s=a[o],u=s[0],l=s[1];this.labels.push(u),this.outputs.push(l)}};function er(t,e,r,i){var n=i-r,o=t-r;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}tr.interpolationFactor=function(t,e,i,n){var o=0;if("exponential"===t.name)o=er(e,t.base,i,n);else if("linear"===t.name)o=er(e,1,i,n);else if("cubic-bezier"===t.name){var a=t.controlPoints;o=new r(a[0],a[1],a[2],a[3]).solve(er(e,1,i,n))}return o},tr.parse=function(t,e){var r=t[0],i=t[1],n=t[2],o=t.slice(3);if(!Array.isArray(i)||0===i.length)return e.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){var a=i[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:a}}else{if("cubic-bezier"!==i[0])return e.error("Unknown interpolation type "+String(i[0]),1,0);var s=i.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(n=e.parse(n,2,Xt)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=Qt:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var p=0;p<o.length;p+=2){var c=o[p],h=o[p+1],f=p+3,d=p+4;if("number"!=typeof c)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(u.length&&u[u.length-1][0]>=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var m=e.parse(h,d,l);if(!m)return null;l=l||m.type,u.push([c,m])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new tr(l,r,i,n,u):e.error("Type "+ne(l)+" is not interpolatable.")},tr.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;if(i>=e[n-1])return r[n-1].evaluate(t);var o=Pe(e,i),a=e[o],s=e[o+1],u=tr.interpolationFactor(this.interpolation,i,a,s),l=r[o].evaluate(t),p=r[o+1].evaluate(t);return"interpolate"===this.operator?Le[this.type.kind.toLowerCase()](l,p,u):"interpolate-hcl"===this.operator?Qe.reverse(Qe.interpolate(Qe.forward(l),Qe.forward(p),u)):Ye.reverse(Ye.interpolate(Ye.forward(l),Ye.forward(p),u))},tr.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1){t(r[e])}},tr.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()})))},tr.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var rr=function(t,e){this.type=t,this.args=e};rr.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,i=e.expectedType;i&&"value"!==i.kind&&(r=i);for(var n=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=a[o],u=e.parse(s,1+n.length,r,void 0,{typeAnnotation:"omit"});if(!u)return null;r=r||u.type,n.push(u)}var l=i&&n.some((function(t){return ae(i,t.type)}));return new rr(l?te:r,n)},rr.prototype.evaluate=function(t){for(var e=null,r=0,i=this.args;r<i.length;r+=1){if(null!==(e=i[r].evaluate(t)))break}return e},rr.prototype.eachChild=function(t){this.args.forEach(t)},rr.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},rr.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ir=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};ir.prototype.evaluate=function(t){return this.result.evaluate(t)},ir.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1){t(r[e][1])}t(this.result)},ir.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],i=1;i<t.length-1;i+=2){var n=t[i];if("string"!=typeof n)return e.error("Expected string, but found "+typeof n+" instead.",i);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",i);var o=e.parse(t[i+1],i+1);if(!o)return null;r.push([n,o])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return a?new ir(r,a):null},ir.prototype.possibleOutputs=function(){return this.result.possibleOutputs()},ir.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var i=r[e],n=i[0],o=i[1];t.push(n,o.serialize())}return t.push(this.result.serialize()),t};var nr=function(t,e,r){this.type=t,this.index=e,this.input=r};nr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Xt),i=e.parse(t[2],2,ie(e.expectedType||te));if(!r||!i)return null;var n=i.type;return new nr(n.itemType,r,i)},nr.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new ye("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new ye("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ye("Array index must be an integer, but found "+e+" instead.");return r[e]},nr.prototype.eachChild=function(t){t(this.index),t(this.input)},nr.prototype.possibleOutputs=function(){return[void 0]},nr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var or=function(t,e,r,i,n,o){this.inputType=t,this.type=e,this.input=r,this.cases=i,this.outputs=n,this.otherwise=o};or.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var n={},o=[],a=2;a<t.length-1;a+=2){var s=t[a],u=t[a+1];Array.isArray(s)||(s=[s]);var l=e.concat(a);if(0===s.length)return l.error("Expected at least one branch label.");for(var p=0,c=s;p<c.length;p+=1){var h=c[p];if("number"!=typeof h&&"string"!=typeof h)return l.error("Branch labels must be numbers or strings.");if("number"==typeof h&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,fe(h)))return null}else r=fe(h);if(void 0!==n[String(h)])return l.error("Branch labels must be unique.");n[String(h)]=o.length}var f=e.parse(u,a,i);if(!f)return null;i=i||f.type,o.push(f)}var d=e.parse(t[1],1,te);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,i);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new or(r,i,d,n,o,m):null},or.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(fe(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},or.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},or.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},or.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],i={},n=0,o=Object.keys(this.cases).sort();n<o.length;n+=1){var a=o[n];void 0===(c=i[this.cases[a]])?(i[this.cases[a]]=r.length,r.push([this.cases[a],[a]])):r[c][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},u=0,l=r;u<l.length;u+=1){var p=l[u],c=p[0],h=p[1];1===h.length?e.push(s(h[0])):e.push(h.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var ar=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};function sr(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function ur(t,e,r,i){return 0===i.compare(e,r)}function lr(t,e,r){var i="=="!==t&&"!="!==t;return function(){function n(t,e,r){this.type=Yt,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return n.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],o=e.parse(t[1],1,te);if(!o)return null;if(!sr(r,o.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+ne(o.type)+"'.");var a=e.parse(t[2],2,te);if(!a)return null;if(!sr(r,a.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+ne(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+ne(o.type)+"' and '"+ne(a.type)+"'.");i&&("value"===o.type.kind&&"value"!==a.type.kind?o=new ve(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new ve(o.type,[a])));var s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,ee)))return null}return new n(o,a,s)},n.prototype.evaluate=function(n){var o=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(i&&this.hasUntypedArgument){var s=fe(o),u=fe(a);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new ye('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+u.kind+") instead.")}if(this.collator&&!i&&this.hasUntypedArgument){var l=fe(o),p=fe(a);if("string"!==l.kind||"string"!==p.kind)return e(n,o,a)}return this.collator?r(n,o,a,this.collator.evaluate(n)):e(n,o,a)},n.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},n.prototype.possibleOutputs=function(){return[!0,!1]},n.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},n}()}ar.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var i=[],n=1;n<t.length-1;n+=2){var o=e.parse(t[n],n,Yt);if(!o)return null;var a=e.parse(t[n+1],n+1,r);if(!a)return null;i.push([o,a]),r=r||a.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new ar(r,i,s):null},ar.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],n=i[0],o=i[1];if(n.evaluate(t))return o.evaluate(t)}return this.otherwise.evaluate(t)},ar.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],n=i[0],o=i[1];t(n),t(o)}t(this.otherwise)},ar.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.branches.map((function(t){t[0];return t[1].possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},ar.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var pr=lr("==",(function(t,e,r){return e===r}),ur),cr=lr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,i){return!ur(0,e,r,i)})),hr=lr("<",(function(t,e,r){return e<r}),(function(t,e,r,i){return i.compare(e,r)<0})),fr=lr(">",(function(t,e,r){return e>r}),(function(t,e,r,i){return i.compare(e,r)>0})),dr=lr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,i){return i.compare(e,r)<=0})),mr=lr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,i){return i.compare(e,r)>=0})),yr=function(t,e,r,i,n){this.type=Jt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=n};yr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Xt);if(!r)return null;var i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");var n=null;if(i.locale&&!(n=e.parse(i.locale,1,Jt)))return null;var o=null;if(i.currency&&!(o=e.parse(i.currency,1,Jt)))return null;var a=null;if(i["min-fraction-digits"]&&!(a=e.parse(i["min-fraction-digits"],1,Xt)))return null;var s=null;return i["max-fraction-digits"]&&!(s=e.parse(i["max-fraction-digits"],1,Xt))?null:new yr(r,n,o,a,s)},yr.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},yr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},yr.prototype.possibleOutputs=function(){return[void 0]},yr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var _r=function(t){this.type=Xt,this.input=t};_r.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+ne(r.type)+" instead."):new _r(r):null},_r.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ye("Expected value to be of type string or array, but found "+ne(fe(e))+" instead.")},_r.prototype.eachChild=function(t){t(this.input)},_r.prototype.possibleOutputs=function(){return[void 0]},_r.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var vr={"==":pr,"!=":cr,">":fr,"<":hr,">=":mr,"<=":dr,array:ve,at:nr,boolean:ve,case:ar,coalesce:rr,collator:Te,format:ge,interpolate:tr,"interpolate-hcl":tr,"interpolate-lab":tr,length:_r,let:ir,literal:me,match:or,number:ve,"number-format":yr,object:ve,step:Me,string:ve,"to-boolean":be,"to-color":be,"to-number":be,"to-string":be,var:Ee};function gr(t,e){var r=e[0],i=e[1],n=e[2],o=e[3];r=r.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);var a=o?o.evaluate(t):1,s=he(r,i,n,a);if(s)throw new ye(s);return new ue(r/255*a,i/255*a,n/255*a,a)}function xr(t,e){return t in e}function br(t,e){var r=e[t];return void 0===r?null:r}function wr(t){return{type:t}}function Sr(t){return{result:"success",value:t}}function Ar(t){return{result:"error",value:t}}function Tr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Ir(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function zr(t){return!!t.expression&&t.expression.interpolated}function kr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Er(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Cr(t){return t}function Pr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Mr(t,e,r,i,n){return Pr(typeof r===n?i[r]:void 0,t.default,e.default)}function Dr(t,e,r){if("number"!==kr(r))return Pr(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var n=Pe(t.stops.map((function(t){return t[0]})),r);return t.stops[n][1]}function Lr(t,e,r){var i=void 0!==t.base?t.base:1;if("number"!==kr(r))return Pr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var o=Pe(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,i){var n=i-r,o=t-r;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}(r,i,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=Le[e.type]||Cr;if(t.colorSpace&&"rgb"!==t.colorSpace){var p=$e[t.colorSpace];l=function(t,e){return p.reverse(p.interpolate(p.forward(t),p.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),i=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==i)return l(r,i,a)}}:l(s,u,a)}function Br(t,e,r){return"color"===e.type?r=ue.parse(r):"formatted"===e.type?r=ce.fromString(r.toString()):kr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Pr(r,t.default,e.default)}Ae.register(vr,{error:[{kind:"error"},[Jt],function(t,e){var r=e[0];throw new ye(r.evaluate(t))}],typeof:[Jt,[te],function(t,e){return ne(fe(e[0].evaluate(t)))}],"to-rgba":[ie(Xt,4),[Qt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Qt,[Xt,Xt,Xt],gr],rgba:[Qt,[Xt,Xt,Xt,Xt],gr],has:{type:Yt,overloads:[[[Jt],function(t,e){return xr(e[0].evaluate(t),t.properties())}],[[Jt,$t],function(t,e){var r=e[0],i=e[1];return xr(r.evaluate(t),i.evaluate(t))}]]},get:{type:te,overloads:[[[Jt],function(t,e){return br(e[0].evaluate(t),t.properties())}],[[Jt,$t],function(t,e){var r=e[0],i=e[1];return br(r.evaluate(t),i.evaluate(t))}]]},"feature-state":[te,[Jt],function(t,e){return br(e[0].evaluate(t),t.featureState||{})}],properties:[$t,[],function(t){return t.properties()}],"geometry-type":[Jt,[],function(t){return t.geometryType()}],id:[te,[],function(t){return t.id()}],zoom:[Xt,[],function(t){return t.globals.zoom}],"heatmap-density":[Xt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Xt,[],function(t){return t.globals.lineProgress||0}],accumulated:[te,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Xt,wr(Xt),function(t,e){for(var r=0,i=0,n=e;i<n.length;i+=1){r+=n[i].evaluate(t)}return r}],"*":[Xt,wr(Xt),function(t,e){for(var r=1,i=0,n=e;i<n.length;i+=1){r*=n[i].evaluate(t)}return r}],"-":{type:Xt,overloads:[[[Xt,Xt],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)-i.evaluate(t)}],[[Xt],function(t,e){return-e[0].evaluate(t)}]]},"/":[Xt,[Xt,Xt],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)/i.evaluate(t)}],"%":[Xt,[Xt,Xt],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)%i.evaluate(t)}],ln2:[Xt,[],function(){return Math.LN2}],pi:[Xt,[],function(){return Math.PI}],e:[Xt,[],function(){return Math.E}],"^":[Xt,[Xt,Xt],function(t,e){var r=e[0],i=e[1];return Math.pow(r.evaluate(t),i.evaluate(t))}],sqrt:[Xt,[Xt],function(t,e){var r=e[0];return Math.sqrt(r.evaluate(t))}],log10:[Xt,[Xt],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN10}],ln:[Xt,[Xt],function(t,e){var r=e[0];return Math.log(r.evaluate(t))}],log2:[Xt,[Xt],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN2}],sin:[Xt,[Xt],function(t,e){var r=e[0];return Math.sin(r.evaluate(t))}],cos:[Xt,[Xt],function(t,e){var r=e[0];return Math.cos(r.evaluate(t))}],tan:[Xt,[Xt],function(t,e){var r=e[0];return Math.tan(r.evaluate(t))}],asin:[Xt,[Xt],function(t,e){var r=e[0];return Math.asin(r.evaluate(t))}],acos:[Xt,[Xt],function(t,e){var r=e[0];return Math.acos(r.evaluate(t))}],atan:[Xt,[Xt],function(t,e){var r=e[0];return Math.atan(r.evaluate(t))}],min:[Xt,wr(Xt),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Xt,wr(Xt),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Xt,[Xt],function(t,e){var r=e[0];return Math.abs(r.evaluate(t))}],round:[Xt,[Xt],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Xt,[Xt],function(t,e){var r=e[0];return Math.floor(r.evaluate(t))}],ceil:[Xt,[Xt],function(t,e){var r=e[0];return Math.ceil(r.evaluate(t))}],"filter-==":[Yt,[Jt,te],function(t,e){var r=e[0],i=e[1];return t.properties()[r.value]===i.value}],"filter-id-==":[Yt,[te],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[Yt,[Jt],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[Yt,[Jt,te],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n<o}],"filter-id-<":[Yt,[te],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i<n}],"filter->":[Yt,[Jt,te],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n>o}],"filter-id->":[Yt,[te],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i>n}],"filter-<=":[Yt,[Jt,te],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[Yt,[te],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i<=n}],"filter->=":[Yt,[Jt,te],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[Yt,[te],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i>=n}],"filter-has":[Yt,[te],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Yt,[],function(t){return null!==t.id()}],"filter-type-in":[Yt,[ie(Jt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Yt,[ie(te)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Yt,[Jt,ie(te)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Yt,[Jt,ie(te)],function(t,e){var r=e[0],i=e[1];return function(t,e,r,i){for(;r<=i;){var n=r+i>>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}(t.properties()[r.value],i.value,0,i.value.length-1)}],all:{type:Yt,overloads:[[[Yt,Yt],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)&&i.evaluate(t)}],[wr(Yt),function(t,e){for(var r=0,i=e;r<i.length;r+=1){if(!i[r].evaluate(t))return!1}return!0}]]},any:{type:Yt,overloads:[[[Yt,Yt],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)||i.evaluate(t)}],[wr(Yt),function(t,e){for(var r=0,i=e;r<i.length;r+=1){if(i[r].evaluate(t))return!0}return!1}]]},"!":[Yt,[Yt],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Yt,[Jt],function(t,e){var r=e[0],i=t.globals&&t.globals.isSupportedScript;return!i||i(r.evaluate(t))}],upcase:[Jt,[Jt],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Jt,[Jt],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Jt,wr(te),function(t,e){return e.map((function(e){return de(e.evaluate(t))})).join("")}],"resolved-locale":[Jt,[ee],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Rr=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new Se,this._defaultValue=e?function(t){return"color"===t.type&&Er(t.default)?new ue(0,0,0,0):"color"===t.type?ue.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function Fr(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in vr}function Or(t,e){var r=new Ce(vr,[],e?function(t){var e={color:Qt,string:Jt,number:Xt,enum:Jt,boolean:Yt,formatted:re};if("array"===t.type)return ie(e[t.value]||te,t.length);return e[t.type]}(e):void 0),i=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?Sr(new Rr(i,e)):Ar(r.errors)}Rr.prototype.evaluateWithoutErrorHandling=function(t,e,r,i){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.formattedSection=i,this.expression.evaluate(this._evaluator)},Rr.prototype.evaluate=function(t,e,r,i){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.formattedSection=i||null;try{var n=this.expression.evaluate(this._evaluator);if(null==n)return this._defaultValue;if(this._enumValues&&!(n in this._enumValues))throw new ye("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(n)+" instead.");return n}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Vr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!ze(e.expression)};Vr.prototype.evaluateWithoutErrorHandling=function(t,e,r,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i)},Vr.prototype.evaluate=function(t,e,r,i){return this._styleExpression.evaluate(t,e,r,i)};var Ur=function(t,e,r,i){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!ze(e.expression),this.interpolationType=i};function Nr(t,e){if("error"===(t=Or(t,e)).result)return t;var r=t.value.expression,i=Ie(r);if(!i&&!Tr(e))return Ar([new Wt("","data expressions not supported")]);var n=ke(r,["zoom"]);if(!n&&!Ir(e))return Ar([new Wt("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof ir)r=t(e.result);else if(e instanceof rr)for(var i=0,n=e.args;i<n.length;i+=1){var o=n[i];if(r=t(o))break}else(e instanceof Me||e instanceof tr)&&e.input instanceof Ae&&"zoom"===e.input.name&&(r=e);if(r instanceof Wt)return r;e.eachChild((function(e){var i=t(e);i instanceof Wt?r=i:!r&&i?r=new Wt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&i&&r!==i&&(r=new Wt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}));return r}(r);if(!o&&!n)return Ar([new Wt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof Wt)return Ar([o]);if(o instanceof tr&&!zr(e))return Ar([new Wt("",'"interpolate" expressions cannot be used with this property')]);if(!o)return Sr(new Vr(i?"constant":"source",t.value));var a=o instanceof tr?o.interpolation:void 0;return Sr(new Ur(i?"camera":"composite",t.value,o.labels,a))}Ur.prototype.evaluateWithoutErrorHandling=function(t,e,r,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i)},Ur.prototype.evaluate=function(t,e,r,i){return this._styleExpression.evaluate(t,e,r,i)},Ur.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?tr.interpolationFactor(this.interpolationType,t,e,r):0};var jr=function(t,e){this._parameters=t,this._specification=e,jt(this,function t(e,r){var i,n,o,a="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],u=s||void 0!==e.property,l=s||!u,p=e.type||(zr(r)?"exponential":"interval");if(a&&((e=jt({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],ue.parse(t[1])]}))),e.default?e.default=ue.parse(e.default):e.default=ue.parse(r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!$e[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===p)i=Lr;else if("interval"===p)i=Dr;else if("categorical"===p){i=Mr,n=Object.create(null);for(var c=0,h=e.stops;c<h.length;c+=1){var f=h[c];n[f[0]]=f[1]}o=typeof e.stops[0][0]}else{if("identity"!==p)throw new Error('Unknown function type "'+p+'"');i=Br}if(s){for(var d={},m=[],y=0;y<e.stops.length;y++){var _=e.stops[y],v=_[0].zoom;void 0===d[v]&&(d[v]={zoom:v,type:e.type,property:e.property,default:e.default,stops:[]},m.push(v)),d[v].stops.push([_[0].value,_[1]])}for(var g=[],x=0,b=m;x<b.length;x+=1){var w=b[x];g.push([d[w].zoom,t(d[w],r)])}var S={name:"linear"};return{kind:"composite",interpolationType:S,interpolationFactor:tr.interpolationFactor.bind(void 0,S),zoomStops:g.map((function(t){return t[0]})),evaluate:function(t,i){var n=t.zoom;return Lr({stops:g,base:e.base},r,n).evaluate(n,i)}}}if(l){var A="exponential"===p?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:A,interpolationFactor:tr.interpolationFactor.bind(void 0,A),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){var a=t.zoom;return i(e,r,a,n,o)}}}return{kind:"source",evaluate:function(t,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?Pr(e.default,r.default):i(e,r,s,n,o)}}}(this._parameters,this._specification))};function qr(t){var e=t.key,r=t.value,i=t.valueSpec||{},n=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],u=kr(r);if("object"!==u)return[new Ut(e,r,"object expected, "+u+" found")];for(var l in r){var p=l.split(".")[0],c=i[p]||i["*"],h=void 0;if(n[p])h=n[p];else if(i[p])h=fi;else if(n["*"])h=n["*"];else{if(!i["*"]){s.push(new Ut(e,r[l],'unknown property "'+l+'"'));continue}h=fi}s=s.concat(h({key:(e?e+".":e)+l,value:r[l],valueSpec:c,style:o,styleSpec:a,object:r,objectKey:l},r))}for(var f in i)n[f]||i[f].required&&void 0===i[f].default&&void 0===r[f]&&s.push(new Ut(e,r,'missing required property "'+f+'"'));return s}function Zr(t){var e=t.value,r=t.valueSpec,i=t.style,n=t.styleSpec,o=t.key,a=t.arrayElementValidator||fi;if("array"!==kr(e))return[new Ut(o,e,"array expected, "+kr(e)+" found")];if(r.length&&e.length!==r.length)return[new Ut(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new Ut(o,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};n.$version<7&&(s.function=r.function),"object"===kr(r.value)&&(s=r.value);for(var u=[],l=0;l<e.length;l++)u=u.concat(a({array:e,arrayIndex:l,value:e[l],valueSpec:s,style:i,styleSpec:n,key:o+"["+l+"]"}));return u}function Gr(t){var e=t.key,r=t.value,i=t.valueSpec,n=kr(r);return"number"!==n?[new Ut(e,r,"number expected, "+n+" found")]:"minimum"in i&&r<i.minimum?[new Ut(e,r,r+" is less than the minimum value "+i.minimum)]:"maximum"in i&&r>i.maximum?[new Ut(e,r,r+" is greater than the maximum value "+i.maximum)]:[]}function Wr(t){var e,r,i,n=t.valueSpec,o=Zt(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===kr(t.value.stops)&&"array"===kr(t.value.stops[0])&&"object"===kr(t.value.stops[0][0]),p=qr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new Ut(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;e=e.concat(Zr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===kr(r)&&0===r.length&&e.push(new Ut(t.key,r,"array must have at least one stop"));return e},default:function(t){return fi({key:t.key,value:t.value,valueSpec:n,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&p.push(new Ut(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||p.push(new Ut(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!zr(t.valueSpec)&&p.push(new Ut(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Tr(t.valueSpec)?p.push(new Ut(t.key,t.value,"property functions not supported")):s&&!Ir(t.valueSpec)&&p.push(new Ut(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||p.push(new Ut(t.key,t.value,'"property" property is required')),p;function c(t){var e=[],o=t.value,s=t.key;if("array"!==kr(o))return[new Ut(s,o,"array expected, "+kr(o)+" found")];if(2!==o.length)return[new Ut(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==kr(o[0]))return[new Ut(s,o,"object expected, "+kr(o[0])+" found")];if(void 0===o[0].zoom)return[new Ut(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new Ut(s,o,"object stop key must have value")];if(i&&i>Zt(o[0].zoom))return[new Ut(s,o[0].zoom,"stop zoom values must appear in ascending order")];Zt(o[0].zoom)!==i&&(i=Zt(o[0].zoom),r=void 0,a={}),e=e.concat(qr({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Gr,value:h}}))}else e=e.concat(h({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Fr(Gt(o[1]))?e.concat([new Ut(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(fi({key:s+"[1]",value:o[1],valueSpec:n,style:t.style,styleSpec:t.styleSpec}))}function h(t,i){var s=kr(t.value),u=Zt(t.value),l=null!==t.value?t.value:i;if(e){if(s!==e)return[new Ut(t.key,l,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Ut(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var p="number expected, "+s+" found";return Tr(n)&&void 0===o&&(p+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ut(t.key,l,p)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==r&&u<r?[new Ut(t.key,l,"stop domain values must appear in ascending order")]:(r=u,"categorical"===o&&u in a?[new Ut(t.key,l,"stop domain values must be unique")]:(a[u]=!0,[])):[new Ut(t.key,l,"integer expected, found "+u)]}}function Kr(t){var e=("property"===t.expressionContext?Nr:Or)(Gt(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new Ut(""+t.key+e.key,t.value,e.message)}));var r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&-1!==r.possibleOutputs().indexOf(void 0))return[new Ut(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!ze(r))return[new Ut(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!ze(r))return[new Ut(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!ke(r,["zoom","feature-state"]))return[new Ut(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Ie(r))return[new Ut(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Hr(t){var e=t.key,r=t.value,i=t.valueSpec,n=[];return Array.isArray(i.values)?-1===i.values.indexOf(Zt(r))&&n.push(new Ut(e,r,"expected one of ["+i.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(i.values).indexOf(Zt(r))&&n.push(new Ut(e,r,"expected one of ["+Object.keys(i.values).join(", ")+"], "+JSON.stringify(r)+" found")),n}function Xr(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var i=r[e];if(!Xr(i)&&"boolean"!=typeof i)return!1}return!0;default:return!0}}jr.deserialize=function(t){return new jr(t._parameters,t._specification)},jr.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var Jr={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Yr(t){if(null==t)return function(){return!0};Xr(t)||(t=$r(t));var e=Or(t,Jr);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return function(t,r){return e.value.evaluate(t,r)}}function Qr(t,e){return t<e?-1:t>e?1:0}function $r(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?ti(t[1],t[2],"=="):"!="===r?ii(ti(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?ti(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map($r))):"all"===r?["all"].concat(t.slice(1).map($r)):"none"===r?["all"].concat(t.slice(1).map($r).map(ii)):"in"===r?ei(t[1],t.slice(2)):"!in"===r?ii(ei(t[1],t.slice(2))):"has"===r?ri(t[1]):"!has"!==r||ii(ri(t[1]))}function ti(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function ei(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(Qr)]]:["filter-in-small",t,["literal",e]]}}function ri(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function ii(t){return["!",t]}function ni(t){return Xr(Gt(t.value))?Kr(jt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value;var i=e.key;if("array"!==kr(r))return[new Ut(i,r,"array expected, "+kr(r)+" found")];var n=e.styleSpec;var o;var a=[];if(r.length<1)return[new Ut(i,r,"filter array must have at least 1 element")];a=a.concat(Hr({key:i+"[0]",value:r[0],valueSpec:n.filter_operator,style:e.style,styleSpec:e.styleSpec}));switch(Zt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Zt(r[1])&&a.push(new Ut(i,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new Ut(i,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(o=kr(r[1]))&&a.push(new Ut(i+"[1]",r[1],"string expected, "+o+" found"));for(var s=2;s<r.length;s++)o=kr(r[s]),"$type"===Zt(r[1])?a=a.concat(Hr({key:i+"["+s+"]",value:r[s],valueSpec:n.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==o&&"number"!==o&&"boolean"!==o&&a.push(new Ut(i+"["+s+"]",r[s],"string, number, or boolean expected, "+o+" found"));break;case"any":case"all":case"none":for(var u=1;u<r.length;u++)a=a.concat(t({key:i+"["+u+"]",value:r[u],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":o=kr(r[1]),2!==r.length?a.push(new Ut(i,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==o&&a.push(new Ut(i+"[1]",r[1],"string expected, "+o+" found"))}return a}(t)}function oi(t,e){var r=t.key,i=t.style,n=t.styleSpec,o=t.value,a=t.objectKey,s=n[e+"_"+t.layerType];if(!s)return[];var u=a.match(/^(.*)-transition$/);if("paint"===e&&u&&s[u[1]]&&s[u[1]].transition)return fi({key:r,value:o,valueSpec:n.transition,style:i,styleSpec:n});var l,p=t.valueSpec||s[a];if(!p)return[new Ut(r,o,'unknown property "'+a+'"')];if("string"===kr(o)&&Tr(p)&&!p.tokens&&(l=/^{([^}]+)}$/.exec(o)))return[new Ut(r,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(l[1])+" }`.")];var c=[];return"symbol"===t.layerType&&("text-field"===a&&i&&!i.glyphs&&c.push(new Ut(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Er(Gt(o))&&"identity"===Zt(o.type)&&c.push(new Ut(r,o,'"text-font" does not support identity functions'))),c.concat(fi({key:t.key,value:o,valueSpec:p,style:i,styleSpec:n,expressionContext:"property",propertyType:e,propertyKey:a}))}function ai(t){return oi(t,"paint")}function si(t){return oi(t,"layout")}function ui(t){var e=[],r=t.value,i=t.key,n=t.style,o=t.styleSpec;r.type||r.ref||e.push(new Ut(i,r,'either "type" or "ref" is required'));var a,s=Zt(r.type),u=Zt(r.ref);if(r.id)for(var l=Zt(r.id),p=0;p<t.arrayIndex;p++){var c=n.layers[p];Zt(c.id)===l&&e.push(new Ut(i,r.id,'duplicate layer id "'+r.id+'", previously used at line '+c.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(t){t in r&&e.push(new Ut(i,r[t],'"'+t+'" is prohibited for ref layers'))})),n.layers.forEach((function(t){Zt(t.id)===u&&(a=t)})),a?a.ref?e.push(new Ut(i,r.ref,"ref cannot reference another ref layer")):s=Zt(a.type):e.push(new Ut(i,r.ref,'ref layer "'+u+'" not found'));else if("background"!==s)if(r.source){var h=n.sources&&n.sources[r.source],f=h&&Zt(h.type);h?"vector"===f&&"raster"===s?e.push(new Ut(i,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new Ut(i,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==f||r["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new Ut(i,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===f&&h.lineMetrics||e.push(new Ut(i,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Ut(i,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new Ut(i,r.source,'source "'+r.source+'" not found'))}else e.push(new Ut(i,r,'missing required property "source"'));return e=e.concat(qr({key:i,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return fi({key:i+".type",value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:ni,layout:function(t){return qr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return si(jt({layerType:s},t))}}})},paint:function(t){return qr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return ai(jt({layerType:s},t))}}})}}}))}function li(t){var e=t.value,r=t.key,i=t.styleSpec,n=t.style;if(!e.type)return[new Ut(r,e,'"type" is required')];var o,a=Zt(e.type);switch(a){case"vector":case"raster":case"raster-dem":return o=qr({key:r,value:e,valueSpec:i["source_"+a.replace("-","_")],style:t.style,styleSpec:i});case"geojson":if(o=qr({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i}),e.cluster)for(var s in e.clusterProperties){var u=e.clusterProperties[s],l=u[0],p=u[1],c="string"==typeof l?[l,["accumulated"],["get",s]]:l;o.push.apply(o,Kr({key:r+"."+s+".map",value:p,expressionContext:"cluster-map"})),o.push.apply(o,Kr({key:r+"."+s+".reduce",value:c,expressionContext:"cluster-reduce"}))}return o;case"video":return qr({key:r,value:e,valueSpec:i.source_video,style:n,styleSpec:i});case"image":return qr({key:r,value:e,valueSpec:i.source_image,style:n,styleSpec:i});case"canvas":return[new Ut(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Hr({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,styleSpec:i})}}function pi(t){var e=t.value,r=t.styleSpec,i=r.light,n=t.style,o=[],a=kr(e);if(void 0===e)return o;if("object"!==a)return o=o.concat([new Ut("light",e,"object expected, "+a+" found")]);for(var s in e){var u=s.match(/^(.*)-transition$/);o=u&&i[u[1]]&&i[u[1]].transition?o.concat(fi({key:s,value:e[s],valueSpec:r.transition,style:n,styleSpec:r})):i[s]?o.concat(fi({key:s,value:e[s],valueSpec:i[s],style:n,styleSpec:r})):o.concat([new Ut(s,e[s],'unknown property "'+s+'"')])}return o}function ci(t){var e=t.value,r=t.key,i=kr(e);return"string"!==i?[new Ut(r,e,"string expected, "+i+" found")]:[]}var hi={"*":function(){return[]},array:Zr,boolean:function(t){var e=t.value,r=t.key,i=kr(e);return"boolean"!==i?[new Ut(r,e,"boolean expected, "+i+" found")]:[]},number:Gr,color:function(t){var e=t.key,r=t.value,i=kr(r);return"string"!==i?[new Ut(e,r,"color expected, "+i+" found")]:null===se(r)?[new Ut(e,r,'color expected, "'+r+'" found')]:[]},constants:Nt,enum:Hr,filter:ni,function:Wr,layer:ui,object:qr,source:li,light:pi,string:ci,formatted:function(t){return 0===ci(t).length?[]:Kr(t)}};function fi(t){var e=t.value,r=t.valueSpec,i=t.styleSpec;return r.expression&&Er(Zt(e))?Wr(t):r.expression&&Fr(Gt(e))?Kr(t):r.type&&hi[r.type]?hi[r.type](t):qr(jt({},t,{valueSpec:r.type?i[r.type]:r}))}function di(t){var e=t.value,r=t.key,i=ci(t);return i.length?i:(-1===e.indexOf("{fontstack}")&&i.push(new Ut(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&i.push(new Ut(r,e,'"glyphs" url must include a "{range}" token')),i)}function mi(t,e){e=e||Vt;var r=[];return r=r.concat(fi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:di,"*":function(){return[]}}})),t.constants&&(r=r.concat(Nt({key:"constants",value:t.constants,style:t,styleSpec:e}))),yi(r)}function yi(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function _i(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return yi(t.apply(this,e))}}mi.source=_i(li),mi.light=_i(pi),mi.layer=_i(ui),mi.filter=_i(ni),mi.paintProperty=_i(ai),mi.layoutProperty=_i(si);var vi=mi,gi=vi.light,xi=vi.paintProperty,bi=vi.layoutProperty;function wi(t,e){var r=!1;if(e&&e.length)for(var i=0,n=e;i<n.length;i+=1){var o=n[i];t.fire(new Ft(new Error(o.message))),r=!0}return r}var Si=Ti,Ai=3;function Ti(t,e,r){var i=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var n=new Int32Array(this.arrayBuffer);t=n[0],e=n[1],r=n[2],this.d=e+2*r;for(var o=0;o<this.d*this.d;o++){var a=n[Ai+o],s=n[Ai+o+1];i.push(a===s?null:n.subarray(a,s))}var u=n[Ai+i.length],l=n[Ai+i.length+1];this.keys=n.subarray(u,l),this.bboxes=n.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var p=0;p<this.d*this.d;p++)i.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var c=r/e*t;this.min=-c,this.max=t+c}Ti.prototype.insert=function(t,e,r,i,n){this._forEachCell(e,r,i,n,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)},Ti.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Ti.prototype._insertCell=function(t,e,r,i,n,o){this.cells[n].push(o)},Ti.prototype.query=function(t,e,r,i,n){var o=this.min,a=this.max;if(t<=o&&e<=o&&a<=r&&a<=i&&!n)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,r,i,this._queryCell,s,{},n),s},Ti.prototype._queryCell=function(t,e,r,i,n,o,a,s){var u=this.cells[n];if(null!==u)for(var l=this.keys,p=this.bboxes,c=0;c<u.length;c++){var h=u[c];if(void 0===a[h]){var f=4*h;(s?s(p[f+0],p[f+1],p[f+2],p[f+3]):t<=p[f+2]&&e<=p[f+3]&&r>=p[f+0]&&i>=p[f+1])?(a[h]=!0,o.push(l[h])):a[h]=!1}}},Ti.prototype._forEachCell=function(t,e,r,i,n,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),p=this._convertToCellCoord(r),c=this._convertToCellCoord(i),h=u;h<=p;h++)for(var f=l;f<=c;f++){var d=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&n.call(this,t,e,r,i,d,o,a,s))return}},Ti.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Ti.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Ti.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=Ai+this.cells.length+1+1,r=0,i=0;i<this.cells.length;i++)r+=this.cells[i].length;var n=new Int32Array(e+r+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;for(var o=e,a=0;a<t.length;a++){var s=t[a];n[Ai+a]=o,n.set(s,o),o+=s.length}return n[Ai+t.length]=o,n.set(this.keys,o),o+=this.keys.length,n[Ai+t.length+1]=o,n.set(this.bboxes,o),o+=this.bboxes.length,n.buffer};var Ii=self.ImageData,zi={};function ki(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),zi[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(var Ei in ki("Object",Object),Si.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},Si.deserialize=function(t){return new Si(t.buffer)},ki("Grid",Si),ki("Color",ue),ki("Error",Error),ki("StylePropertyFunction",jr),ki("StyleExpression",Rr,{omit:["_evaluator"]}),ki("ZoomDependentExpression",Ur),ki("ZoomConstantExpression",Vr),ki("CompoundExpression",Ae,{omit:["_evaluate"]}),vr)vr[Ei]._classRegistryKey||ki("Expression_"+Ei,vr[Ei]);function Ci(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(t instanceof ArrayBuffer)return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof Ii)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var i=[],n=0,o=t;n<o.length;n+=1){var a=o[n];i.push(Ci(a,e))}return i}if("object"==typeof t){var s=t.constructor,u=s._classRegistryKey;if(!u)throw new Error("can't serialize object of unregistered class");var l=s.serialize?s.serialize(t,e):{};if(!s.serialize){for(var p in t)if(t.hasOwnProperty(p)&&!(zi[u].omit.indexOf(p)>=0)){var c=t[p];l[p]=zi[u].shallow.indexOf(p)>=0?c:Ci(c,e)}t instanceof Error&&(l.message=t.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==u&&(l.$name=u),l}throw new Error("can't serialize object of type "+typeof t)}function Pi(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof Ii)return t;if(Array.isArray(t))return t.map(Pi);if("object"==typeof t){var e=t.$name||"Object",r=zi[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var i=Object.create(r.prototype),n=0,o=Object.keys(t);n<o.length;n+=1){var a=o[n];if("$name"!==a){var s=t[a];i[a]=zi[e].shallow.indexOf(a)>=0?s:Pi(s)}}return i}throw new Error("can't deserialize object of type "+typeof t)}var Mi=function(){this.first=!0};Mi.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))};var Di={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Li(t){for(var e=0,r=t;e<r.length;e+=1){if(Bi(r[e].charCodeAt(0)))return!0}return!1}function Bi(t){return 746===t||747===t||!(t<4352)&&(!!Di["Bopomofo Extended"](t)||(!!Di.Bopomofo(t)||(!(!Di["CJK Compatibility Forms"](t)||t>=65097&&t<=65103)||(!!Di["CJK Compatibility Ideographs"](t)||(!!Di["CJK Compatibility"](t)||(!!Di["CJK Radicals Supplement"](t)||(!!Di["CJK Strokes"](t)||(!(!Di["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||(!!Di["CJK Unified Ideographs Extension A"](t)||(!!Di["CJK Unified Ideographs"](t)||(!!Di["Enclosed CJK Letters and Months"](t)||(!!Di["Hangul Compatibility Jamo"](t)||(!!Di["Hangul Jamo Extended-A"](t)||(!!Di["Hangul Jamo Extended-B"](t)||(!!Di["Hangul Jamo"](t)||(!!Di["Hangul Syllables"](t)||(!!Di.Hiragana(t)||(!!Di["Ideographic Description Characters"](t)||(!!Di.Kanbun(t)||(!!Di["Kangxi Radicals"](t)||(!!Di["Katakana Phonetic Extensions"](t)||(!(!Di.Katakana(t)||12540===t)||(!(!Di["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||(!(!Di["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(!!Di["Unified Canadian Aboriginal Syllabics"](t)||(!!Di["Unified Canadian Aboriginal Syllabics Extended"](t)||(!!Di["Vertical Forms"](t)||(!!Di["Yijing Hexagram Symbols"](t)||(!!Di["Yi Syllables"](t)||!!Di["Yi Radicals"](t))))))))))))))))))))))))))))))}function Ri(t,e){return!(!e&&(t>=1424&&t<=2303||Di["Arabic Presentation Forms-A"](t)||Di["Arabic Presentation Forms-B"](t)))&&!(t>=2304&&t<=3583||t>=3840&&t<=4255||Di.Khmer(t))}var Fi,Oi=!1,Vi=null,Ui=!1,Ni=new Ot,ji={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Ui||null!=ji.applyArabicShaping}},qi=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Mi,this.transition={})};qi.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,i=t;r<i.length;r+=1){if(!Ri(i[r].charCodeAt(0),e))return!1}return!0}(t,ji.isLoaded())},qi.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},qi.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Zi=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Er(t))return new jr(t,e);if(Fr(t)){var r=Nr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var i=t;return"string"==typeof t&&"color"===e.type&&(i=ue.parse(t)),{kind:"constant",evaluate:function(){return i}}}(void 0===e?t.specification.default:e,t.specification)};Zi.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Zi.prototype.possiblyEvaluate=function(t){return this.property.possiblyEvaluate(this,t)};var Gi=function(t){this.property=t,this.value=new Zi(t,void 0)};Gi.prototype.transitioned=function(t,e){return new Ki(this.property,this.value,e,h({},t.transition,this.transition),t.now)},Gi.prototype.untransitioned=function(){return new Ki(this.property,this.value,null,{},0)};var Wi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Wi.prototype.getValue=function(t){return w(this._values[t].value.value)},Wi.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Gi(this._values[t].property)),this._values[t].value=new Zi(this._values[t].property,null===e?void 0:w(e))},Wi.prototype.getTransition=function(t){return w(this._values[t].transition)},Wi.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Gi(this._values[t].property)),this._values[t].transition=w(e)||void 0},Wi.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e],n=this.getValue(i);void 0!==n&&(t[i]=n);var o=this.getTransition(i);void 0!==o&&(t[i+"-transition"]=o)}return t},Wi.prototype.transitioned=function(t,e){for(var r=new Hi(this._properties),i=0,n=Object.keys(this._values);i<n.length;i+=1){var o=n[i];r._values[o]=this._values[o].transitioned(t,e._values[o])}return r},Wi.prototype.untransitioned=function(){for(var t=new Hi(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e];t._values[i]=this._values[i].untransitioned()}return t};var Ki=function(t,e,r,i,n){this.property=t,this.value=e,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=r)};Ki.prototype.possiblyEvaluate=function(t){var e=t.now||0,r=this.value.possiblyEvaluate(t),i=this.prior;if(i){if(e>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(e<this.begin)return i.possiblyEvaluate(t);var n=(e-this.begin)/(this.end-this.begin);return this.property.interpolate(i.possiblyEvaluate(t),r,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(n))}return r};var Hi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Hi.prototype.possiblyEvaluate=function(t){for(var e=new Yi(this._properties),r=0,i=Object.keys(this._values);r<i.length;r+=1){var n=i[r];e._values[n]=this._values[n].possiblyEvaluate(t)}return e},Hi.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1){var r=e[t];if(this._values[r].prior)return!0}return!1};var Xi=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};Xi.prototype.getValue=function(t){return w(this._values[t].value)},Xi.prototype.setValue=function(t,e){this._values[t]=new Zi(this._values[t].property,null===e?void 0:w(e))},Xi.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e],n=this.getValue(i);void 0!==n&&(t[i]=n)}return t},Xi.prototype.possiblyEvaluate=function(t){for(var e=new Yi(this._properties),r=0,i=Object.keys(this._values);r<i.length;r+=1){var n=i[r];e._values[n]=this._values[n].possiblyEvaluate(t)}return e};var Ji=function(t,e,r){this.property=t,this.value=e,this.parameters=r};Ji.prototype.isConstant=function(){return"constant"===this.value.kind},Ji.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Ji.prototype.evaluate=function(t,e){return this.property.evaluate(this.value,this.parameters,t,e)};var Yi=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Yi.prototype.get=function(t){return this._values[t]};var Qi=function(t){this.specification=t};Qi.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},Qi.prototype.interpolate=function(t,e,r){var i=Le[this.specification.type];return i?i(t,e,r):t};var $i=function(t,e){this.specification=t,this.overrides=e};$i.prototype.possiblyEvaluate=function(t,e){return"constant"===t.expression.kind||"camera"===t.expression.kind?new Ji(this,{kind:"constant",value:t.expression.evaluate(e)},e):new Ji(this,t.expression,e)},$i.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Ji(this,{kind:"constant",value:void 0},t.parameters);var i=Le[this.specification.type];return i?new Ji(this,{kind:"constant",value:i(t.value.value,e.value.value,r)},t.parameters):t},$i.prototype.evaluate=function(t,e,r,i){return"constant"===t.kind?t.value:t.evaluate(e,r,i)};var tn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(t,e){if(void 0===t.value)return new Ji(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var r=t.expression.evaluate(e),i=this._calculate(r,r,r,e);return new Ji(this,{kind:"constant",value:i},e)}if("camera"===t.expression.kind){var n=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Ji(this,{kind:"constant",value:n},e)}return new Ji(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,i){if("source"===t.kind){var n=t.evaluate(e,r,i);return this._calculate(n,n,n,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,i),t.evaluate({zoom:Math.floor(e.zoom)},r,i),t.evaluate({zoom:Math.floor(e.zoom)+1},r,i),e):t.value},e.prototype._calculate=function(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}($i),en=function(t){this.specification=t};en.prototype.possiblyEvaluate=function(t,e){if(void 0!==t.value){if("constant"===t.expression.kind){var r=t.expression.evaluate(e);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate(new qi(Math.floor(e.zoom-1),e)),t.expression.evaluate(new qi(Math.floor(e.zoom),e)),t.expression.evaluate(new qi(Math.floor(e.zoom+1),e)),e)}},en.prototype._calculate=function(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},en.prototype.interpolate=function(t){return t};var rn=function(t){this.specification=t};rn.prototype.possiblyEvaluate=function(t,e){return!!t.expression.evaluate(e)},rn.prototype.interpolate=function(){return!1};var nn=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var i=this.defaultPropertyValues[e]=new Zi(r,void 0),n=this.defaultTransitionablePropertyValues[e]=new Gi(r);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}};ki("DataDrivenProperty",$i),ki("DataConstantProperty",Qi),ki("CrossFadedDataDrivenProperty",tn),ki("CrossFadedProperty",en),ki("ColorRampProperty",rn);var on=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter=function(){return!0},"custom"!==e.type&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new Xi(r.layout)),r.paint)){for(var i in this._transitionablePaint=new Wi(r.paint),e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(var n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var i="layers."+this.id+".layout."+t;if(this._validate(bi,i,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return g(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var i="layers."+this.id+".paint."+t;if(this._validate(xi,i,t,e,r))return!1}if(g(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var n=this._transitionablePaint._values[t],o="cross-faded-data-driven"===n.property.specification["property-type"],a=n.value.isDataDriven(),s=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var u=this._transitionablePaint._values[t].value;return u.isDataDriven()||a||o||this._handleOverridablePaintPropertyUpdate(t,s,u)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||(!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility)},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t)),this.paint=this._transitioningPaint.possiblyEvaluate(t)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),b(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,i,n){return void 0===n&&(n={}),(!n||!1!==n.validate)&&wi(this,t.call(vi,{key:e,layerType:this.type,objectKey:r,value:i,styleSpec:Vt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof Ji&&Tr(e.property.specification)&&(("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent))return!0}return!1},e}(Ot),an={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},sn=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},un=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function ln(t,e){void 0===e&&(e=1);var r=0,i=0;return{members:t.map((function(t){var n,o=(n=t.type,an[n].BYTES_PER_ELEMENT),a=r=pn(r,Math.max(e,o)),s=t.components||1;return i=Math.max(i,o),r+=o*s,{name:t.name,type:t.type,components:s,offset:a}})),size:pn(r,Math.max(i,e)),alignment:e}}function pn(t,e){return Math.ceil(t/e)*e}un.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},un.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},un.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},un.prototype.clear=function(){this.length=0},un.prototype.resize=function(t){this.reserve(t),this.length=t},un.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},un.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var cn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var i=2*t;return this.int16[i+0]=e,this.int16[i+1]=r,t},e}(un);cn.prototype.bytesPerElement=4,ki("StructArrayLayout2i4",cn);var hn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,n){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,t},e}(un);hn.prototype.bytesPerElement=8,ki("StructArrayLayout4i8",hn);var fn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n,o)},e.prototype.emplace=function(t,e,r,i,n,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(un);fn.prototype.bytesPerElement=12,ki("StructArrayLayout2i4i12",fn);var dn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n,o)},e.prototype.emplace=function(t,e,r,i,n,o,a){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[u+4]=i,this.uint8[u+5]=n,this.uint8[u+6]=o,this.uint8[u+7]=a,t},e}(un);dn.prototype.bytesPerElement=8,ki("StructArrayLayout2i4ub8",dn);var mn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o,a,s){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,i,n,o,a,s)},e.prototype.emplace=function(t,e,r,i,n,o,a,s,u){var l=8*t;return this.uint16[l+0]=e,this.uint16[l+1]=r,this.uint16[l+2]=i,this.uint16[l+3]=n,this.uint16[l+4]=o,this.uint16[l+5]=a,this.uint16[l+6]=s,this.uint16[l+7]=u,t},e}(un);mn.prototype.bytesPerElement=16,ki("StructArrayLayout8ui16",mn);var yn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o,a,s){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,i,n,o,a,s)},e.prototype.emplace=function(t,e,r,i,n,o,a,s,u){var l=8*t;return this.int16[l+0]=e,this.int16[l+1]=r,this.int16[l+2]=i,this.int16[l+3]=n,this.uint16[l+4]=o,this.uint16[l+5]=a,this.uint16[l+6]=s,this.uint16[l+7]=u,t},e}(un);yn.prototype.bytesPerElement=16,ki("StructArrayLayout4i4ui16",yn);var _n=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,t},e}(un);_n.prototype.bytesPerElement=12,ki("StructArrayLayout3f12",_n);var vn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(un);vn.prototype.bytesPerElement=4,ki("StructArrayLayout1ul4",vn);var gn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.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)},e.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,u,l,p){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,i,n,o,a,s,u,l,p)},e.prototype.emplace=function(t,e,r,i,n,o,a,s,u,l,p,c){var h=12*t,f=6*t;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=i,this.int16[h+3]=n,this.int16[h+4]=o,this.int16[h+5]=a,this.uint32[f+3]=s,this.uint16[h+8]=u,this.uint16[h+9]=l,this.int16[h+10]=p,this.int16[h+11]=c,t},e}(un);gn.prototype.bytesPerElement=24,ki("StructArrayLayout6i1ul2ui2i24",gn);var xn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n,o)},e.prototype.emplace=function(t,e,r,i,n,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(un);xn.prototype.bytesPerElement=12,ki("StructArrayLayout2i2i2i12",xn);var bn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,n){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=i,this.float32[a+2]=n,t},e}(un);bn.prototype.bytesPerElement=12,ki("StructArrayLayout2ub2f12",bn);var wn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.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)},e.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,u,l,p,c,h,f,d,m){var y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,i,n,o,a,s,u,l,p,c,h,f,d,m)},e.prototype.emplace=function(t,e,r,i,n,o,a,s,u,l,p,c,h,f,d,m,y){var _=22*t,v=11*t,g=44*t;return this.int16[_+0]=e,this.int16[_+1]=r,this.uint16[_+2]=i,this.uint16[_+3]=n,this.uint32[v+2]=o,this.uint32[v+3]=a,this.uint32[v+4]=s,this.uint16[_+10]=u,this.uint16[_+11]=l,this.uint16[_+12]=p,this.float32[v+7]=c,this.float32[v+8]=h,this.uint8[g+36]=f,this.uint8[g+37]=d,this.uint8[g+38]=m,this.uint32[v+10]=y,t},e}(un);wn.prototype.bytesPerElement=44,ki("StructArrayLayout2i2ui3ul3ui2f3ub1ul44",wn);var Sn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.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)},e.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,u,l,p,c,h,f,d,m,y,_,v,g){var x=this.length;return this.resize(x+1),this.emplace(x,t,e,r,i,n,o,a,s,u,l,p,c,h,f,d,m,y,_,v,g)},e.prototype.emplace=function(t,e,r,i,n,o,a,s,u,l,p,c,h,f,d,m,y,_,v,g,x){var b=24*t,w=12*t;return this.int16[b+0]=e,this.int16[b+1]=r,this.int16[b+2]=i,this.int16[b+3]=n,this.int16[b+4]=o,this.int16[b+5]=a,this.uint16[b+6]=s,this.uint16[b+7]=u,this.uint16[b+8]=l,this.uint16[b+9]=p,this.uint16[b+10]=c,this.uint16[b+11]=h,this.uint16[b+12]=f,this.uint16[b+13]=d,this.uint16[b+14]=m,this.uint16[b+15]=y,this.uint16[b+16]=_,this.uint32[w+9]=v,this.float32[w+10]=g,this.float32[w+11]=x,t},e}(un);Sn.prototype.bytesPerElement=48,ki("StructArrayLayout6i11ui1ul2f48",Sn);var An=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(un);An.prototype.bytesPerElement=4,ki("StructArrayLayout1f4",An);var Tn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,t},e}(un);Tn.prototype.bytesPerElement=6,ki("StructArrayLayout3i6",Tn);var In=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=2*t,o=4*t;return this.uint32[n+0]=e,this.uint16[o+2]=r,this.uint16[o+3]=i,t},e}(un);In.prototype.bytesPerElement=8,ki("StructArrayLayout1ul2ui8",In);var zn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,this.uint16[n+2]=i,t},e}(un);zn.prototype.bytesPerElement=6,ki("StructArrayLayout3ui6",zn);var kn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var i=2*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,t},e}(un);kn.prototype.bytesPerElement=4,ki("StructArrayLayout2ui4",kn);var En=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(un);En.prototype.bytesPerElement=2,ki("StructArrayLayout1ui2",En);var Cn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var i=2*t;return this.float32[i+0]=e,this.float32[i+1]=r,t},e}(un);Cn.prototype.bytesPerElement=8,ki("StructArrayLayout2f8",Cn);var Pn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,n){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=i,this.float32[o+3]=n,t},e}(un);Pn.prototype.bytesPerElement=16,ki("StructArrayLayout4f16",Pn);var Mn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;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},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.radius.get=function(){return this._structArray.int16[this._pos2+10]},r.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},r.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},r.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},r.anchorPoint.get=function(){return new n(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(sn);Mn.prototype.size=24;var Dn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Mn(this,t)},e}(gn);ki("CollisionBoxArray",Dn);var Ln=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;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}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},Object.defineProperties(e.prototype,r),e}(sn);Ln.prototype.size=44;var Bn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Ln(this,t)},e}(wn);ki("PlacedSymbolArray",Bn);var Rn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},radialTextOffset:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.rightJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+2]=t},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.centerJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+3]=t},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.leftJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+4]=t},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.verticalPlacedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+5]=t},r.key.get=function(){return this._structArray.uint16[this._pos2+6]},r.key.set=function(t){this._structArray.uint16[this._pos2+6]=t},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+7]},r.textBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+7]=t},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.verticalTextBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.iconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.featureIndex.set=function(t){this._structArray.uint16[this._pos2+13]=t},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+14]},r.numHorizontalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+14]=t},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+15]},r.numVerticalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+15]=t},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+16]},r.numIconVertices.set=function(t){this._structArray.uint16[this._pos2+16]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+9]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+9]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+10]},r.textBoxScale.set=function(t){this._structArray.float32[this._pos4+10]=t},r.radialTextOffset.get=function(){return this._structArray.float32[this._pos4+11]},r.radialTextOffset.set=function(t){this._structArray.float32[this._pos4+11]=t},Object.defineProperties(e.prototype,r),e}(sn);Rn.prototype.size=48;var Fn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Rn(this,t)},e}(Sn);ki("SymbolInstanceArray",Fn);var On=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={offsetX:{configurable:!0}};return r.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},r.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t},Object.defineProperties(e.prototype,r),e}(sn);On.prototype.size=4;var Vn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e.prototype.get=function(t){return new On(this,t)},e}(An);ki("GlyphOffsetArray",Vn);var Un=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return r.x.get=function(){return this._structArray.int16[this._pos2+0]},r.x.set=function(t){this._structArray.int16[this._pos2+0]=t},r.y.get=function(){return this._structArray.int16[this._pos2+1]},r.y.set=function(t){this._structArray.int16[this._pos2+1]=t},r.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},r.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t},Object.defineProperties(e.prototype,r),e}(sn);Un.prototype.size=6;var Nn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e.prototype.get=function(t){return new Un(this,t)},e}(Tn);ki("SymbolLineVertexArray",Nn);var jn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,r),e}(sn);jn.prototype.size=8;var qn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new jn(this,t)},e}(In);ki("FeatureIndexArray",qn);var Zn=ln([{name:"a_pos",components:2,type:"Int16"}],4).members,Gn=function(t){void 0===t&&(t=[]),this.segments=t};function Wn(t,e){return 256*(t=l(Math.floor(t),0,255))+(e=l(Math.floor(e),0,255))}Gn.prototype.prepareSegment=function(t,e,r,i){var n=this.segments[this.segments.length-1];return t>Gn.MAX_VERTEX_ARRAY_LENGTH&&A("Max vertices per segment is "+Gn.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!n||n.vertexLength+t>Gn.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==i)&&(n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==i&&(n.sortKey=i),this.segments.push(n)),n},Gn.prototype.get=function(){return this.segments},Gn.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var i in r.vaos)r.vaos[i].destroy()}},Gn.simpleSegment=function(t,e,r,i){return new Gn([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:i,vaos:{},sortKey:0}])},Gn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ki("SegmentVector",Gn);var Kn=function(){this.ids=[],this.positions=[],this.indexed=!1};function Hn(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}Kn.prototype.add=function(t,e,r,i){this.ids.push(t),this.positions.push(e,r,i)},Kn.prototype.getPositions=function(t){for(var e=0,r=this.ids.length-1;e<r;){var i=e+r>>1;this.ids[i]>=t?r=i:e=i+1}for(var n=[];this.ids[e]===t;){var o=this.positions[3*e],a=this.positions[3*e+1],s=this.positions[3*e+2];n.push({index:o,start:a,end:s}),e++}return n},Kn.serialize=function(t,e){var r=new Float64Array(t.ids),i=new Uint32Array(t.positions);return function t(e,r,i,n){if(i>=n)return;var o=e[i+n>>1];var a=i-1;var s=n+1;for(;;){do{a++}while(e[a]<o);do{s--}while(e[s]>o);if(a>=s)break;Hn(e,a,s),Hn(r,3*a,3*s),Hn(r,3*a+1,3*s+1),Hn(r,3*a+2,3*s+2)}t(e,r,i,s);t(e,r,s+1,n)}(r,i,0,r.length-1),e.push(r.buffer,i.buffer),{ids:r,positions:i}},Kn.deserialize=function(t){var e=new Kn;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e},ki("FeaturePositionMap",Kn);var Xn=function(t,e){this.gl=t.gl,this.location=e},Jn=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(Xn),Yn=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(Xn),Qn=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(Xn),$n=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(Xn),to=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(Xn),eo=function(t){function e(e,r){t.call(this,e,r),this.current=ue.transparent}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(Xn),ro=new Float32Array(16),io=function(t){function e(e,r){t.call(this,e,r),this.current=ro}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(Xn);function no(t){return[Wn(255*t.r,255*t.g),Wn(255*t.b,255*t.a)]}var oo=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=r,this.maxValue=-1/0};oo.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},oo.prototype.setConstantPatternPositions=function(){},oo.prototype.populatePaintArray=function(){},oo.prototype.updatePaintArray=function(){},oo.prototype.upload=function(){},oo.prototype.destroy=function(){},oo.prototype.setUniforms=function(t,e,r,i){e.set(i.constantOr(this.value))},oo.prototype.getBinding=function(t,e){return"color"===this.type?new eo(t,e):new Yn(t,e)},oo.serialize=function(t){var e=t.value,r=t.names,i=t.type;return{value:Ci(e),names:r,type:i}},oo.deserialize=function(t){var e=t.value,r=t.names,i=t.type;return new oo(Pi(e),r,i)};var ao=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=r,this.maxValue=-1/0,this.patternPositions={patternTo:null,patternFrom:null}};ao.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},ao.prototype.populatePaintArray=function(){},ao.prototype.updatePaintArray=function(){},ao.prototype.upload=function(){},ao.prototype.destroy=function(){},ao.prototype.setConstantPatternPositions=function(t,e){this.patternPositions.patternTo=t.tlbr,this.patternPositions.patternFrom=e.tlbr},ao.prototype.setUniforms=function(t,e,r,i,n){var o=this.patternPositions;"u_pattern_to"===n&&o.patternTo&&e.set(o.patternTo),"u_pattern_from"===n&&o.patternFrom&&e.set(o.patternFrom)},ao.prototype.getBinding=function(t,e){return new to(t,e)};var so=function(t,e,r,i){this.expression=t,this.names=e,this.type=r,this.uniformNames=this.names.map((function(t){return"a_"+t})),this.maxValue=-1/0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new i};so.prototype.defines=function(){return[]},so.prototype.setConstantPatternPositions=function(){},so.prototype.populatePaintArray=function(t,e,r,i){var n=this.paintVertexArray,o=n.length;n.reserve(t);var a=this.expression.evaluate(new qi(0),e,{},i);if("color"===this.type)for(var s=no(a),u=o;u<t;u++)n.emplaceBack(s[0],s[1]);else{for(var l=o;l<t;l++)n.emplaceBack(a);this.maxValue=Math.max(this.maxValue,a)}},so.prototype.updatePaintArray=function(t,e,r,i){var n=this.paintVertexArray,o=this.expression.evaluate({zoom:0},r,i);if("color"===this.type)for(var a=no(o),s=t;s<e;s++)n.emplace(s,a[0],a[1]);else{for(var u=t;u<e;u++)n.emplace(u,o);this.maxValue=Math.max(this.maxValue,o)}},so.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},so.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},so.prototype.setUniforms=function(t,e){e.set(0)},so.prototype.getBinding=function(t,e){return new Yn(t,e)};var uo=function(t,e,r,i,n,o){this.expression=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t+"_t"})),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=-1/0;var a=o;this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new a};uo.prototype.defines=function(){return[]},uo.prototype.setConstantPatternPositions=function(){},uo.prototype.populatePaintArray=function(t,e,r,i){var n=this.paintVertexArray,o=n.length;n.reserve(t);var a=this.expression.evaluate(new qi(this.zoom),e,{},i),s=this.expression.evaluate(new qi(this.zoom+1),e,{},i);if("color"===this.type)for(var u=no(a),l=no(s),p=o;p<t;p++)n.emplaceBack(u[0],u[1],l[0],l[1]);else{for(var c=o;c<t;c++)n.emplaceBack(a,s);this.maxValue=Math.max(this.maxValue,a,s)}},uo.prototype.updatePaintArray=function(t,e,r,i){var n=this.paintVertexArray,o=this.expression.evaluate({zoom:this.zoom},r,i),a=this.expression.evaluate({zoom:this.zoom+1},r,i);if("color"===this.type)for(var s=no(o),u=no(a),l=t;l<e;l++)n.emplace(l,s[0],s[1],u[0],u[1]);else{for(var p=t;p<e;p++)n.emplace(p,o,a);this.maxValue=Math.max(this.maxValue,o,a)}},uo.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},uo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},uo.prototype.interpolationFactor=function(t){return this.useIntegerZoom?this.expression.interpolationFactor(Math.floor(t),this.zoom,this.zoom+1):this.expression.interpolationFactor(t,this.zoom,this.zoom+1)},uo.prototype.setUniforms=function(t,e,r){e.set(this.interpolationFactor(r.zoom))},uo.prototype.getBinding=function(t,e){return new Yn(t,e)};var lo=function(t,e,r,i,n,o,a){this.expression=t,this.names=e,this.type=r,this.uniformNames=this.names.map((function(t){return"u_"+t+"_t"})),this.useIntegerZoom=i,this.zoom=n,this.maxValue=-1/0,this.layerId=a,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Uint16",components:4,offset:0}})),this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o};lo.prototype.defines=function(){return[]},lo.prototype.setConstantPatternPositions=function(){},lo.prototype.populatePaintArray=function(t,e,r){var i=this.zoomInPaintVertexArray,n=this.zoomOutPaintVertexArray,o=this.layerId,a=i.length;if(i.reserve(t),n.reserve(t),r&&e.patterns&&e.patterns[o]){var s=e.patterns[o],u=s.min,l=s.mid,p=s.max,c=r[u],h=r[l],f=r[p];if(!c||!h||!f)return;for(var d=a;d<t;d++)i.emplaceBack(h.tl[0],h.tl[1],h.br[0],h.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1]),n.emplaceBack(h.tl[0],h.tl[1],h.br[0],h.br[1],f.tl[0],f.tl[1],f.br[0],f.br[1])}},lo.prototype.updatePaintArray=function(t,e,r,i,n){var o=this.zoomInPaintVertexArray,a=this.zoomOutPaintVertexArray,s=this.layerId;if(n&&r.patterns&&r.patterns[s]){var u=r.patterns[s],l=u.min,p=u.mid,c=u.max,h=n[l],f=n[p],d=n[c];if(!h||!f||!d)return;for(var m=t;m<e;m++)o.emplace(m,f.tl[0],f.tl[1],f.br[0],f.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1]),a.emplace(m,f.tl[0],f.tl[1],f.br[0],f.br[1],d.tl[0],d.tl[1],d.br[0],d.br[1])}},lo.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},lo.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()},lo.prototype.setUniforms=function(t,e){e.set(0)},lo.prototype.getBinding=function(t,e){return new Yn(t,e)};var po=function(){this.binders={},this.cacheKey="",this._buffers=[],this._featureMap=new Kn,this._bufferOffset=0};po.createDynamic=function(t,e,r){var i=new po,n=[];for(var o in t.paint._values)if(r(o)){var a=t.paint.get(o);if(a instanceof Ji&&Tr(a.property.specification)){var s=ho(o,t.type),u=a.property.specification.type,l=a.property.useIntegerZoom;if("cross-faded"===a.property.specification["property-type"]||"cross-faded-data-driven"===a.property.specification["property-type"])if("constant"===a.value.kind)i.binders[o]=new ao(a.value.value,s,u),n.push("/u_"+o);else{var p=fo(o,u,"source");i.binders[o]=new lo(a.value,s,u,l,e,p,t.id),n.push("/a_"+o)}else if("constant"===a.value.kind)i.binders[o]=new oo(a.value.value,s,u),n.push("/u_"+o);else if("source"===a.value.kind){var c=fo(o,u,"source");i.binders[o]=new so(a.value,s,u,c),n.push("/a_"+o)}else{var h=fo(o,u,"composite");i.binders[o]=new uo(a.value,s,u,l,e,h),n.push("/z_"+o)}}}return i.cacheKey=n.sort().join(""),i},po.prototype.populatePaintArrays=function(t,e,r,i,n){for(var o in this.binders){this.binders[o].populatePaintArray(t,e,i,n)}void 0!==e.id&&this._featureMap.add(+e.id,r,this._bufferOffset,t),this._bufferOffset=t},po.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){this.binders[r].setConstantPatternPositions(t,e)}},po.prototype.updatePaintArrays=function(t,e,r,i){var n=!1;for(var o in t)for(var a=0,s=this._featureMap.getPositions(+o);a<s.length;a+=1){var u=s[a],l=e.feature(u.index);for(var p in this.binders){var c=this.binders[p];if(!(c instanceof oo||c instanceof ao)&&!0===c.expression.isStateDependent){var h=r.paint.get(p);c.expression=h.value,c.updatePaintArray(u.start,u.end,l,t[o],i),n=!0}}}return n},po.prototype.defines=function(){var t=[];for(var e in this.binders)t.push.apply(t,this.binders[e].defines());return t},po.prototype.getPaintVertexBuffers=function(){return this._buffers},po.prototype.getUniforms=function(t,e){var r=[];for(var i in this.binders)for(var n=this.binders[i],o=0,a=n.uniformNames;o<a.length;o+=1){var s=a[o];if(e[s]){var u=n.getBinding(t,e[s]);r.push({name:s,property:i,binding:u})}}return r},po.prototype.setUniforms=function(t,e,r,i){for(var n=0,o=e;n<o.length;n+=1){var a=o[n],s=a.name,u=a.property,l=a.binding;this.binders[u].setUniforms(t,l,i,r.get(u),s)}},po.prototype.updatePatternPaintBuffers=function(t){var e=[];for(var r in this.binders){var i=this.binders[r];if(i instanceof lo){var n=2===t.fromScale?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer;n&&e.push(n)}else(i instanceof so||i instanceof uo)&&i.paintVertexBuffer&&e.push(i.paintVertexBuffer)}this._buffers=e},po.prototype.upload=function(t){for(var e in this.binders)this.binders[e].upload(t);var r=[];for(var i in this.binders){var n=this.binders[i];(n instanceof so||n instanceof uo)&&n.paintVertexBuffer&&r.push(n.paintVertexBuffer)}this._buffers=r},po.prototype.destroy=function(){for(var t in this.binders)this.binders[t].destroy()};var co=function(t,e,r,i){void 0===i&&(i=function(){return!0}),this.programConfigurations={};for(var n=0,o=e;n<o.length;n+=1){var a=o[n];this.programConfigurations[a.id]=po.createDynamic(a,r,i),this.programConfigurations[a.id].layoutAttributes=t}this.needsUpload=!1};function ho(t,e){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"],"fill-pattern":["pattern_to","pattern_from"],"fill-extrusion-pattern":["pattern_to","pattern_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function fo(t,e,r){var i={color:{source:Cn,composite:Pn},number:{source:An,composite:Cn}},n=function(t){return{"line-pattern":{source:mn,composite:mn},"fill-pattern":{source:mn,composite:mn},"fill-extrusion-pattern":{source:mn,composite:mn}}[t]}(t);return n&&n[r]||i[e][r]}co.prototype.populatePaintArrays=function(t,e,r,i,n){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(t,e,r,i,n);this.needsUpload=!0},co.prototype.updatePaintArrays=function(t,e,r,i){for(var n=0,o=r;n<o.length;n+=1){var a=o[n];this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,e,a,i)||this.needsUpload}},co.prototype.get=function(t){return this.programConfigurations[t]},co.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},co.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},ki("ConstantBinder",oo),ki("CrossFadedConstantBinder",ao),ki("SourceExpressionBinder",so),ki("CrossFadedCompositeBinder",lo),ki("CompositeExpressionBinder",uo),ki("ProgramConfiguration",po,{omit:["_buffers"]}),ki("ProgramConfigurationSet",co);var mo=8192;var yo,_o=(yo=15,{min:-1*Math.pow(2,yo-1),max:Math.pow(2,yo-1)-1});function vo(t){for(var e=mo/t.extent,r=t.loadGeometry(),i=0;i<r.length;i++)for(var n=r[i],o=0;o<n.length;o++){var a=n[o];a.x=Math.round(a.x*e),a.y=Math.round(a.y*e),(a.x<_o.min||a.x>_o.max||a.y<_o.min||a.y>_o.max)&&(A("Geometry exceeds allowed extent, reduce your vector tile buffer size"),a.x=l(a.x,_o.min,_o.max),a.y=l(a.y,_o.min,_o.max))}return r}function go(t,e,r,i,n){t.emplaceBack(2*e+(i+1)/2,2*r+(n+1)/2)}var xo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new cn,this.indexArray=new zn,this.segments=new Gn,this.programConfigurations=new co(Zn,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function bo(t,e){for(var r=0;r<t.length;r++)if(Co(e,t[r]))return!0;for(var i=0;i<e.length;i++)if(Co(t,e[i]))return!0;return!!To(t,e)}function wo(t,e,r){return!!Co(t,e)||!!zo(e,t,r)}function So(t,e){if(1===t.length)return Eo(e,t[0]);for(var r=0;r<e.length;r++)for(var i=e[r],n=0;n<i.length;n++)if(Co(t,i[n]))return!0;for(var o=0;o<t.length;o++)if(Eo(e,t[o]))return!0;for(var a=0;a<e.length;a++)if(To(t,e[a]))return!0;return!1}function Ao(t,e,r){if(t.length>1){if(To(t,e))return!0;for(var i=0;i<e.length;i++)if(zo(e[i],t,r))return!0}for(var n=0;n<t.length;n++)if(zo(t[n],e,r))return!0;return!1}function To(t,e){if(0===t.length||0===e.length)return!1;for(var r=0;r<t.length-1;r++)for(var i=t[r],n=t[r+1],o=0;o<e.length-1;o++){if(Io(i,n,e[o],e[o+1]))return!0}return!1}function Io(t,e,r,i){return T(t,r,i)!==T(e,r,i)&&T(t,e,r)!==T(t,e,i)}function zo(t,e,r){var i=r*r;if(1===e.length)return t.distSqr(e[0])<i;for(var n=1;n<e.length;n++){if(ko(t,e[n-1],e[n])<i)return!0}return!1}function ko(t,e,r){var i=e.distSqr(r);if(0===i)return t.distSqr(e);var n=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/i;return n<0?t.distSqr(e):n>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(n)._add(e))}function Eo(t,e){for(var r,i,n,o=!1,a=0;a<t.length;a++)for(var s=0,u=(r=t[a]).length-1;s<r.length;u=s++)i=r[s],n=r[u],i.y>e.y!=n.y>e.y&&e.x<(n.x-i.x)*(e.y-i.y)/(n.y-i.y)+i.x&&(o=!o);return o}function Co(t,e){for(var r=!1,i=0,n=t.length-1;i<t.length;n=i++){var o=t[i],a=t[n];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function Po(t,e,r){var i=r[0],n=r[2];if(t.x<i.x&&e.x<i.x||t.x>n.x&&e.x>n.x||t.y<i.y&&e.y<i.y||t.y>n.y&&e.y>n.y)return!1;var o=T(t,e,r[0]);return o!==T(t,e,r[1])||o!==T(t,e,r[2])||o!==T(t,e,r[3])}function Mo(t,e,r){var i=e.paint.get(t).value;return"constant"===i.kind?i.value:r.programConfigurations.get(e.id).binders[t].maxValue}function Do(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Lo(t,e,r,i,o){if(!e[0]&&!e[1])return t;var a=n.convert(e)._mult(o);"viewport"===r&&a._rotate(-i);for(var s=[],u=0;u<t.length;u++){var l=t[u];s.push(l.sub(a))}return s}xo.prototype.populate=function(t,e){var r=this.layers[0],i=[],n=null;"circle"===r.type&&(n=r.layout.get("circle-sort-key"));for(var o=0,a=t;o<a.length;o+=1){var s=a[o],u=s.feature,l=s.index,p=s.sourceLayerIndex;if(this.layers[0]._featureFilter(new qi(this.zoom),u)){var c=vo(u),h=n?n.evaluate(u,{}):void 0,f={id:u.id,properties:u.properties,type:u.type,sourceLayerIndex:p,index:l,geometry:c,patterns:{},sortKey:h};i.push(f)}}n&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var d=0,m=i;d<m.length;d+=1){var y=m[d],_=y,v=_.geometry,g=_.index,x=_.sourceLayerIndex,b=t[g].feature;this.addFeature(y,v,g),e.featureIndex.insert(b,v,g,x,this.index)}},xo.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},xo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},xo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},xo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Zn),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},xo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},xo.prototype.addFeature=function(t,e,r){for(var i=0,n=e;i<n.length;i+=1)for(var o=0,a=n[i];o<a.length;o+=1){var s=a[o],u=s.x,l=s.y;if(!(u<0||u>=mo||l<0||l>=mo)){var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),c=p.vertexLength;go(this.layoutVertexArray,u,l,-1,-1),go(this.layoutVertexArray,u,l,1,-1),go(this.layoutVertexArray,u,l,1,1),go(this.layoutVertexArray,u,l,-1,1),this.indexArray.emplaceBack(c,c+1,c+2),this.indexArray.emplaceBack(c,c+3,c+2),p.vertexLength+=4,p.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{})},ki("CircleBucket",xo,{omit:["layers"]});var Bo=new nn({"circle-sort-key":new $i(Vt.layout_circle["circle-sort-key"])}),Ro={paint:new nn({"circle-radius":new $i(Vt.paint_circle["circle-radius"]),"circle-color":new $i(Vt.paint_circle["circle-color"]),"circle-blur":new $i(Vt.paint_circle["circle-blur"]),"circle-opacity":new $i(Vt.paint_circle["circle-opacity"]),"circle-translate":new Qi(Vt.paint_circle["circle-translate"]),"circle-translate-anchor":new Qi(Vt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Qi(Vt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Qi(Vt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new $i(Vt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new $i(Vt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new $i(Vt.paint_circle["circle-stroke-opacity"])}),layout:Bo},Fo="undefined"!=typeof Float32Array?Float32Array:Array;function Oo(){var t=new Fo(16);return Fo!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Vo(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Uo(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],p=e[7],c=e[8],h=e[9],f=e[10],d=e[11],m=e[12],y=e[13],_=e[14],v=e[15],g=r[0],x=r[1],b=r[2],w=r[3];return t[0]=g*i+x*s+b*c+w*m,t[1]=g*n+x*u+b*h+w*y,t[2]=g*o+x*l+b*f+w*_,t[3]=g*a+x*p+b*d+w*v,g=r[4],x=r[5],b=r[6],w=r[7],t[4]=g*i+x*s+b*c+w*m,t[5]=g*n+x*u+b*h+w*y,t[6]=g*o+x*l+b*f+w*_,t[7]=g*a+x*p+b*d+w*v,g=r[8],x=r[9],b=r[10],w=r[11],t[8]=g*i+x*s+b*c+w*m,t[9]=g*n+x*u+b*h+w*y,t[10]=g*o+x*l+b*f+w*_,t[11]=g*a+x*p+b*d+w*v,g=r[12],x=r[13],b=r[14],w=r[15],t[12]=g*i+x*s+b*c+w*m,t[13]=g*n+x*u+b*h+w*y,t[14]=g*o+x*l+b*f+w*_,t[15]=g*a+x*p+b*d+w*v,t}function No(t,e,r){var i,n,o,a,s,u,l,p,c,h,f,d,m=r[0],y=r[1],_=r[2];return e===t?(t[12]=e[0]*m+e[4]*y+e[8]*_+e[12],t[13]=e[1]*m+e[5]*y+e[9]*_+e[13],t[14]=e[2]*m+e[6]*y+e[10]*_+e[14],t[15]=e[3]*m+e[7]*y+e[11]*_+e[15]):(i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],p=e[7],c=e[8],h=e[9],f=e[10],d=e[11],t[0]=i,t[1]=n,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l,t[7]=p,t[8]=c,t[9]=h,t[10]=f,t[11]=d,t[12]=i*m+s*y+c*_+e[12],t[13]=n*m+u*y+h*_+e[13],t[14]=o*m+l*y+f*_+e[14],t[15]=a*m+p*y+d*_+e[15]),t}function jo(t,e,r){var i=r[0],n=r[1],o=r[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function qo(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],p=e[5],c=e[6],h=e[7];return e!==t&&(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[0]=o*n+l*i,t[1]=a*n+p*i,t[2]=s*n+c*i,t[3]=u*n+h*i,t[4]=l*n-o*i,t[5]=p*n-a*i,t[6]=c*n-s*i,t[7]=h*n-u*i,t}function Zo(t,e,r,i,n,o,a){var s=1/(e-r),u=1/(i-n),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*s,t[13]=(n+i)*u,t[14]=(a+o)*l,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var Go,Wo;Go=new Fo(3),Fo!=Float32Array&&(Go[0]=0,Go[1]=0,Go[2]=0),Wo=Go;function Ko(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*o+r[12]*a,t[1]=r[1]*i+r[5]*n+r[9]*o+r[13]*a,t[2]=r[2]*i+r[6]*n+r[10]*o+r[14]*a,t[3]=r[3]*i+r[7]*n+r[11]*o+r[15]*a,t}!function(){var t=function(){var t=new Fo(4);return Fo!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}();var Ho=function(t){function e(e){t.call(this,e,Ro)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new xo(t)},e.prototype.queryRadius=function(t){var e=t;return Mo("circle-radius",this,e)+Mo("circle-stroke-width",this,e)+Do(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,o,a,s){for(var u=Lo(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),l=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),p="map"===this.paint.get("circle-pitch-alignment"),c=p?u:function(t,e){return t.map((function(t){return Xo(t,e)}))}(u,s),h=p?l*a:l,f=0,d=i;f<d.length;f+=1)for(var m=0,y=d[f];m<y.length;m+=1){var _=y[m],v=p?_:Xo(_,s),g=h,x=Ko([],[_.x,_.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?g*=x[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(g*=o.cameraToCenterDistance/x[3]),wo(c,v,g))return!0}return!1},e}(on);function Xo(t,e){var r=Ko([],[t.x,t.y,0,1],e);return new n(r[0]/r[3],r[1]/r[3])}var Jo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(xo);function Yo(t,e,r,i){var n=e.width,o=e.height;if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==n*o*r)throw new RangeError("mismatched image size")}else i=new Uint8Array(n*o*r);return t.width=n,t.height=o,t.data=i,t}function Qo(t,e,r){var i=e.width,n=e.height;if(i!==t.width||n!==t.height){var o=Yo({},{width:i,height:n},r);$o(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,i),height:Math.min(t.height,n)},r),t.width=i,t.height=n,t.data=o.data}}function $o(t,e,r,i,n,o){if(0===n.width||0===n.height)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u<n.height;u++)for(var l=((r.y+u)*t.width+r.x)*o,p=((i.y+u)*e.width+i.x)*o,c=0;c<n.width*o;c++)s[p+c]=a[l+c];return e}ki("HeatmapBucket",Jo,{omit:["layers"]});var ta=function(t,e){Yo(this,t,1,e)};ta.prototype.resize=function(t){Qo(this,t,1)},ta.prototype.clone=function(){return new ta({width:this.width,height:this.height},new Uint8Array(this.data))},ta.copy=function(t,e,r,i,n){$o(t,e,r,i,n,1)};var ea=function(t,e){Yo(this,t,4,e)};ea.prototype.resize=function(t){Qo(this,t,4)},ea.prototype.replace=function(t,e){e?this.data.set(t):t instanceof Uint8ClampedArray?this.data=new Uint8Array(t.buffer):this.data=t},ea.prototype.clone=function(){return new ea({width:this.width,height:this.height},new Uint8Array(this.data))},ea.copy=function(t,e,r,i,n){$o(t,e,r,i,n,4)},ki("AlphaImage",ta),ki("RGBAImage",ea);var ra={paint:new nn({"heatmap-radius":new $i(Vt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new $i(Vt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Qi(Vt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new rn(Vt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Qi(Vt.paint_heatmap["heatmap-opacity"])})};function ia(t,e){for(var r=new Uint8Array(1024),i={},n=0,o=0;n<256;n++,o+=4){i[e]=n/255;var a=t.evaluate(i);r[o+0]=Math.floor(255*a.r/a.a),r[o+1]=Math.floor(255*a.g/a.a),r[o+2]=Math.floor(255*a.b/a.a),r[o+3]=Math.floor(255*a.a)}return new ea({width:256,height:1},r)}var na=function(t){function e(e){t.call(this,e,ra),this._updateColorRamp()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Jo(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){var t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=ia(t,"heatmapDensity"),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(on),oa={paint:new nn({"hillshade-illumination-direction":new Qi(Vt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Qi(Vt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Qi(Vt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Qi(Vt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Qi(Vt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Qi(Vt.paint_hillshade["hillshade-accent-color"])})},aa=function(t){function e(e){t.call(this,e,oa)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(on),sa=ln([{name:"a_pos",components:2,type:"Int16"}],4).members,ua=pa,la=pa;function pa(t,e,r){r=r||2;var i,n,o,a,s,u,l,p=e&&e.length,c=p?e[0]*r:t.length,h=ca(t,0,c,r,!0),f=[];if(!h||h.next===h.prev)return f;if(p&&(h=function(t,e,r,i){var n,o,a,s,u,l=[];for(n=0,o=e.length;n<o;n++)a=e[n]*i,s=n<o-1?e[n+1]*i:t.length,(u=ca(t,a,s,i,!1))===u.next&&(u.steiner=!0),l.push(wa(u));for(l.sort(va),n=0;n<l.length;n++)ga(l[n],r),r=ha(r,r.next);return r}(t,e,h,r)),t.length>80*r){i=o=t[0],n=a=t[1];for(var d=r;d<c;d+=r)(s=t[d])<i&&(i=s),(u=t[d+1])<n&&(n=u),s>o&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-i,a-n))?1/l:0}return fa(h,f,r,i,n,l),f}function ca(t,e,r,i,n){var o,a;if(n===Ba(t,e,r,i)>0)for(o=e;o<r;o+=i)a=Ma(o,t[o],t[o+1],a);else for(o=r-i;o>=e;o-=i)a=Ma(o,t[o],t[o+1],a);return a&&Ia(a,a.next)&&(Da(a),a=a.next),a}function ha(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!Ia(i,i.next)&&0!==Ta(i.prev,i,i.next))i=i.next;else{if(Da(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function fa(t,e,r,i,n,o,a){if(t){!a&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=ba(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,r,i,n,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,i=r,s=0,e=0;e<l&&(s++,i=i.nextZ);e++);for(u=l;s>0||u>0&&i;)0!==s&&(0===u||!i||r.z<=i.z)?(n=r,r=r.nextZ,s--):(n=i,i=i.nextZ,u--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,l*=2}while(a>1)}(n)}(t,i,n,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?ma(t,i,n,o):da(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Da(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?fa(t=ya(ha(t),e,r),e,r,i,n,o,2):2===a&&_a(t,e,r,i,n,o):fa(ha(t),e,r,i,n,o,1);break}}}function da(t){var e=t.prev,r=t,i=t.next;if(Ta(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(Sa(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&Ta(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function ma(t,e,r,i){var n=t.prev,o=t,a=t.next;if(Ta(n,o,a)>=0)return!1;for(var s=n.x<o.x?n.x<a.x?n.x:a.x:o.x<a.x?o.x:a.x,u=n.y<o.y?n.y<a.y?n.y:a.y:o.y<a.y?o.y:a.y,l=n.x>o.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,p=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,c=ba(s,u,e,r,i),h=ba(l,p,e,r,i),f=t.prevZ,d=t.nextZ;f&&f.z>=c&&d&&d.z<=h;){if(f!==t.prev&&f!==t.next&&Sa(n.x,n.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Ta(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,d!==t.prev&&d!==t.next&&Sa(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Ta(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;f&&f.z>=c;){if(f!==t.prev&&f!==t.next&&Sa(n.x,n.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Ta(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;d&&d.z<=h;){if(d!==t.prev&&d!==t.next&&Sa(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Ta(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function ya(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!Ia(n,o)&&za(n,i,i.next,o)&&Ca(n,o)&&Ca(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),Da(i),Da(i.next),i=t=o),i=i.next}while(i!==t);return ha(i)}function _a(t,e,r,i,n,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Aa(a,s)){var u=Pa(a,s);return a=ha(a,a.next),u=ha(u,u.next),fa(a,e,r,i,n,o),void fa(u,e,r,i,n,o)}s=s.next}a=a.next}while(a!==t)}function va(t,e){return t.x-e.x}function ga(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&s>a){if(a=s,s===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!r)return null;if(n===a)return r;var u,l=r,p=r.x,c=r.y,h=1/0;i=r;do{n>=i.x&&i.x>=p&&n!==i.x&&Sa(o<c?n:a,o,p,c,o<c?a:n,o,i.x,i.y)&&(u=Math.abs(o-i.y)/(n-i.x),Ca(i,t)&&(u<h||u===h&&(i.x>r.x||i.x===r.x&&xa(r,i)))&&(r=i,h=u)),i=i.next}while(i!==l);return r}(t,e)){var r=Pa(e,t);ha(r,r.next)}}function xa(t,e){return Ta(t.prev,t,e.prev)<0&&Ta(e.next,t,t.next)<0}function ba(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function wa(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function Sa(t,e,r,i,n,o,a,s){return(n-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(i-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(n-a)*(i-s)>=0}function Aa(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&za(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Ca(t,e)&&Ca(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&(Ta(t.prev,t,e.prev)||Ta(t,e.prev,e))||Ia(t,e)&&Ta(t.prev,t,t.next)>0&&Ta(e.prev,e,e.next)>0)}function Ta(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ia(t,e){return t.x===e.x&&t.y===e.y}function za(t,e,r,i){var n=Ea(Ta(t,e,r)),o=Ea(Ta(t,e,i)),a=Ea(Ta(r,i,t)),s=Ea(Ta(r,i,e));return n!==o&&a!==s||(!(0!==n||!ka(t,r,e))||(!(0!==o||!ka(t,i,e))||(!(0!==a||!ka(r,t,i))||!(0!==s||!ka(r,e,i)))))}function ka(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Ea(t){return t>0?1:t<0?-1:0}function Ca(t,e){return Ta(t.prev,t,t.next)<0?Ta(t,e,t.next)>=0&&Ta(t,t.prev,e)>=0:Ta(t,e,t.prev)<0||Ta(t,t.next,e)<0}function Pa(t,e){var r=new La(t.i,t.x,t.y),i=new La(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function Ma(t,e,r,i){var n=new La(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function Da(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function La(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ba(t,e,r,i){for(var n=0,o=e,a=r-i;o<r;o+=i)n+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return n}function Ra(t,e,r,i,n){!function t(e,r,i,n,o){for(;n>i;){if(n-i>600){var a=n-i+1,s=r-i+1,u=Math.log(a),l=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1),c=Math.max(i,Math.floor(r-s*l/a+p)),h=Math.min(n,Math.floor(r+(a-s)*l/a+p));t(e,r,c,h,o)}var f=e[r],d=i,m=n;for(Fa(e,i,r),o(e[n],f)>0&&Fa(e,i,n);d<m;){for(Fa(e,d,m),d++,m--;o(e[d],f)<0;)d++;for(;o(e[m],f)>0;)m--}0===o(e[i],f)?Fa(e,i,m):Fa(e,++m,n),m<=r&&(i=m+1),r<=m&&(n=m-1)}}(t,e,r||0,i||t.length-1,n||Oa)}function Fa(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function Oa(t,e){return t<e?-1:t>e?1:0}function Va(t,e){var r=t.length;if(r<=1)return[t];for(var i,n,o=[],a=0;a<r;a++){var s=I(t[a]);0!==s&&(t[a].area=Math.abs(s),void 0===n&&(n=s<0),n===s<0?(i&&o.push(i),i=[t[a]]):i.push(t[a]))}if(i&&o.push(i),e>1)for(var u=0;u<o.length;u++)o[u].length<=e||(Ra(o[u],e,1,o[u].length-1,Ua),o[u]=o[u].slice(0,e));return o}function Ua(t,e){return e.area-t.area}function Na(t,e,r){for(var i=r.patternDependencies,n=!1,o=0,a=e;o<a.length;o+=1){var s=a[o].paint.get(t+"-pattern");s.isConstant()||(n=!0);var u=s.constantOr(null);u&&(n=!0,i[u.to]=!0,i[u.from]=!0)}return n}function ja(t,e,r,i,n){for(var o=n.patternDependencies,a=0,s=e;a<s.length;a+=1){var u=s[a],l=u.paint.get(t+"-pattern").value;if("constant"!==l.kind){var p=l.evaluate({zoom:i-1},r,{}),c=l.evaluate({zoom:i},r,{}),h=l.evaluate({zoom:i+1},r,{});o[p]=!0,o[c]=!0,o[h]=!0,r.patterns[u.id]={min:p,mid:c,max:h}}}return r}pa.deviation=function(t,e,r,i){var n=e&&e.length,o=n?e[0]*r:t.length,a=Math.abs(Ba(t,0,o,r));if(n)for(var s=0,u=e.length;s<u;s++){var l=e[s]*r,p=s<u-1?e[s+1]*r:t.length;a-=Math.abs(Ba(t,l,p,r))}var c=0;for(s=0;s<i.length;s+=3){var h=i[s]*r,f=i[s+1]*r,d=i[s+2]*r;c+=Math.abs((t[h]-t[d])*(t[f+1]-t[h+1])-(t[h]-t[f])*(t[d+1]-t[h+1]))}return 0===a&&0===c?0:Math.abs((c-a)/a)},pa.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,n=0;n<t.length;n++){for(var o=0;o<t[n].length;o++)for(var a=0;a<e;a++)r.vertices.push(t[n][o][a]);n>0&&(i+=t[n-1].length,r.holes.push(i))}return r},ua.default=la;var qa=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new cn,this.indexArray=new zn,this.indexArray2=new kn,this.programConfigurations=new co(sa,t.layers,t.zoom),this.segments=new Gn,this.segments2=new Gn,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};qa.prototype.populate=function(t,e){this.hasPattern=Na("fill",this.layers,e);for(var r=this.layers[0].layout.get("fill-sort-key"),i=[],n=0,o=t;n<o.length;n+=1){var a=o[n],s=a.feature,u=a.index,l=a.sourceLayerIndex;if(this.layers[0]._featureFilter(new qi(this.zoom),s)){var p=vo(s),c=r?r.evaluate(s,{}):void 0,h={id:s.id,properties:s.properties,type:s.type,sourceLayerIndex:l,index:u,geometry:p,patterns:{},sortKey:c};i.push(h)}}r&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var f=0,d=i;f<d.length;f+=1){var m=d[f],y=m,_=y.geometry,v=y.index,g=y.sourceLayerIndex;if(this.hasPattern){var x=ja("fill",this.layers,m,this.zoom,e);this.patternFeatures.push(x)}else this.addFeature(m,_,v,{});var b=t[v].feature;e.featureIndex.insert(b,_,v,g,this.index)}},qa.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},qa.prototype.addFeatures=function(t,e){for(var r=0,i=this.patternFeatures;r<i.length;r+=1){var n=i[r];this.addFeature(n,n.geometry,n.index,e)}},qa.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},qa.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},qa.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,sa),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},qa.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},qa.prototype.addFeature=function(t,e,r,i){for(var n=0,o=Va(e,500);n<o.length;n+=1){for(var a=o[n],s=0,u=0,l=a;u<l.length;u+=1){s+=l[u].length}for(var p=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray),c=p.vertexLength,h=[],f=[],d=0,m=a;d<m.length;d+=1){var y=m[d];if(0!==y.length){y!==a[0]&&f.push(h.length/2);var _=this.segments2.prepareSegment(y.length,this.layoutVertexArray,this.indexArray2),v=_.vertexLength;this.layoutVertexArray.emplaceBack(y[0].x,y[0].y),this.indexArray2.emplaceBack(v+y.length-1,v),h.push(y[0].x),h.push(y[0].y);for(var g=1;g<y.length;g++)this.layoutVertexArray.emplaceBack(y[g].x,y[g].y),this.indexArray2.emplaceBack(v+g-1,v+g),h.push(y[g].x),h.push(y[g].y);_.vertexLength+=y.length,_.primitiveLength+=y.length}}for(var x=ua(h,f),b=0;b<x.length;b+=3)this.indexArray.emplaceBack(c+x[b],c+x[b+1],c+x[b+2]);p.vertexLength+=s,p.primitiveLength+=x.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i)},ki("FillBucket",qa,{omit:["layers","patternFeatures"]});var Za=new nn({"fill-sort-key":new $i(Vt.layout_fill["fill-sort-key"])}),Ga={paint:new nn({"fill-antialias":new Qi(Vt.paint_fill["fill-antialias"]),"fill-opacity":new $i(Vt.paint_fill["fill-opacity"]),"fill-color":new $i(Vt.paint_fill["fill-color"]),"fill-outline-color":new $i(Vt.paint_fill["fill-outline-color"]),"fill-translate":new Qi(Vt.paint_fill["fill-translate"]),"fill-translate-anchor":new Qi(Vt.paint_fill["fill-translate-anchor"]),"fill-pattern":new tn(Vt.paint_fill["fill-pattern"])}),layout:Za},Wa=function(t){function e(e){t.call(this,e,Ga)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e);var r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new qa(t)},e.prototype.queryRadius=function(){return Do(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,o,a){return So(Lo(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),i)},e.prototype.isTileClipped=function(){return!0},e}(on),Ka=ln([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Ha=Xa;function Xa(t,e,r,i,n){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n,t.readFields(Ja,this,e)}function Ja(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){var r=t.readVarint()+t.pos;for(;t.pos<r;){var i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function Ya(t){for(var e,r,i=0,n=0,o=t.length,a=o-1;n<o;a=n++)e=t[n],i+=((r=t[a]).x-e.x)*(e.y+r.y);return i}Xa.types=["Unknown","Point","LineString","Polygon"],Xa.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,i=1,o=0,a=0,s=0,u=[];t.pos<r;){if(o<=0){var l=t.readVarint();i=7&l,o=l>>3}if(o--,1===i||2===i)a+=t.readSVarint(),s+=t.readSVarint(),1===i&&(e&&u.push(e),e=[]),e.push(new n(a,s));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&u.push(e),u},Xa.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,i=0,n=0,o=0,a=1/0,s=-1/0,u=1/0,l=-1/0;t.pos<e;){if(i<=0){var p=t.readVarint();r=7&p,i=p>>3}if(i--,1===r||2===r)(n+=t.readSVarint())<a&&(a=n),n>s&&(s=n),(o+=t.readSVarint())<u&&(u=o),o>l&&(l=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},Xa.prototype.toGeoJSON=function(t,e,r){var i,n,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=Xa.types[this.type];function p(t){for(var e=0;e<t.length;e++){var r=t[e],i=180-360*(r.y+s)/o;t[e]=[360*(r.x+a)/o-180,360/Math.PI*Math.atan(Math.exp(i*Math.PI/180))-90]}}switch(this.type){case 1:var c=[];for(i=0;i<u.length;i++)c[i]=u[i][0];p(u=c);break;case 2:for(i=0;i<u.length;i++)p(u[i]);break;case 3:for(u=function(t){var e=t.length;if(e<=1)return[t];for(var r,i,n=[],o=0;o<e;o++){var a=Ya(t[o]);0!==a&&(void 0===i&&(i=a<0),i===a<0?(r&&n.push(r),r=[t[o]]):r.push(t[o]))}r&&n.push(r);return n}(u),i=0;i<u.length;i++)for(n=0;n<u[i].length;n++)p(u[i][n])}1===u.length?u=u[0]:l="Multi"+l;var h={type:"Feature",geometry:{type:l,coordinates:u},properties:this.properties};return"id"in this&&(h.id=this.id),h};var Qa=$a;function $a(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(ts,this,e),this.length=this._features.length}function ts(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){var e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){var i=t.readVarint()>>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}(r))}function es(t,e,r){if(3===t){var i=new Qa(r,r.readVarint()+r.pos);i.length&&(e[i.name]=i)}}$a.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Ha(this._pbf,e,this.extent,this._keys,this._values)};var rs={VectorTile:function(t,e){this.layers=t.readFields(es,{},e)},VectorTileFeature:Ha,VectorTileLayer:Qa},is=rs.VectorTileFeature.types,ns=Math.pow(2,13);function os(t,e,r,i,n,o,a,s){t.emplaceBack(e,r,2*Math.floor(i*ns)+a,n*ns*2,o*ns*2,Math.round(s))}var as=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new fn,this.indexArray=new zn,this.programConfigurations=new co(Ka,t.layers,t.zoom),this.segments=new Gn,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function ss(t,e){return t.x===e.x&&(t.x<0||t.x>mo)||t.y===e.y&&(t.y<0||t.y>mo)}function us(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>mo}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>mo}))}as.prototype.populate=function(t,e){this.features=[],this.hasPattern=Na("fill-extrusion",this.layers,e);for(var r=0,i=t;r<i.length;r+=1){var n=i[r],o=n.feature,a=n.index,s=n.sourceLayerIndex;if(this.layers[0]._featureFilter(new qi(this.zoom),o)){var u=vo(o),l={sourceLayerIndex:s,index:a,geometry:u,properties:o.properties,type:o.type,patterns:{}};void 0!==o.id&&(l.id=o.id),this.hasPattern?this.features.push(ja("fill-extrusion",this.layers,l,this.zoom,e)):this.addFeature(l,u,a,{}),e.featureIndex.insert(o,u,a,s,this.index,!0)}}},as.prototype.addFeatures=function(t,e){for(var r=0,i=this.features;r<i.length;r+=1){var n=i[r],o=n.geometry;this.addFeature(n,o,n.index,e)}},as.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},as.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},as.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},as.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ka),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},as.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},as.prototype.addFeature=function(t,e,r,i){for(var n=0,o=Va(e,500);n<o.length;n+=1){for(var a=o[n],s=0,u=0,l=a;u<l.length;u+=1){s+=l[u].length}for(var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),c=0,h=a;c<h.length;c+=1){var f=h[c];if(0!==f.length&&!us(f))for(var d=0,m=0;m<f.length;m++){var y=f[m];if(m>=1){var _=f[m-1];if(!ss(y,_)){p.vertexLength+4>Gn.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var v=y.sub(_)._perp()._unit(),g=_.dist(y);d+g>32768&&(d=0),os(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,0,d),os(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,1,d),d+=g,os(this.layoutVertexArray,_.x,_.y,v.x,v.y,0,0,d),os(this.layoutVertexArray,_.x,_.y,v.x,v.y,0,1,d);var x=p.vertexLength;this.indexArray.emplaceBack(x,x+2,x+1),this.indexArray.emplaceBack(x+1,x+2,x+3),p.vertexLength+=4,p.primitiveLength+=2}}}}if(p.vertexLength+s>Gn.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray)),"Polygon"===is[t.type]){for(var b=[],w=[],S=p.vertexLength,A=0,T=a;A<T.length;A+=1){var I=T[A];if(0!==I.length){I!==a[0]&&w.push(b.length/2);for(var z=0;z<I.length;z++){var k=I[z];os(this.layoutVertexArray,k.x,k.y,0,0,1,1,0),b.push(k.x),b.push(k.y)}}}for(var E=ua(b,w),C=0;C<E.length;C+=3)this.indexArray.emplaceBack(S+E[C],S+E[C+2],S+E[C+1]);p.primitiveLength+=E.length/3,p.vertexLength+=s}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i)},ki("FillExtrusionBucket",as,{omit:["layers","features"]});var ls={paint:new nn({"fill-extrusion-opacity":new Qi(Vt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new $i(Vt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Qi(Vt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Qi(Vt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new tn(Vt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new $i(Vt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new $i(Vt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Qi(Vt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},ps=function(t){function e(e){t.call(this,e,ls)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new as(t)},e.prototype.queryRadius=function(){return Do(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,r,i,o,a,s,u){var l=Lo(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),p=this.paint.get("fill-extrusion-height").evaluate(e,r),c=this.paint.get("fill-extrusion-base").evaluate(e,r),h=function(t,e,r,i){for(var o=[],a=0,s=t;a<s.length;a+=1){var u=s[a],l=[u.x,u.y,i,1];Ko(l,l,e),o.push(new n(l[0]/l[3],l[1]/l[3]))}return o}(l,u,0,0),f=function(t,e,r,i){for(var o=[],a=[],s=i[8]*e,u=i[9]*e,l=i[10]*e,p=i[11]*e,c=i[8]*r,h=i[9]*r,f=i[10]*r,d=i[11]*r,m=0,y=t;m<y.length;m+=1){for(var _=y[m],v=[],g=[],x=0,b=_;x<b.length;x+=1){var w=b[x],S=w.x,A=w.y,T=i[0]*S+i[4]*A+i[12],I=i[1]*S+i[5]*A+i[13],z=i[2]*S+i[6]*A+i[14],k=i[3]*S+i[7]*A+i[15],E=z+l,C=k+p,P=T+c,M=I+h,D=z+f,L=k+d,B=new n((T+s)/C,(I+u)/C);B.z=E/C,v.push(B);var R=new n(P/L,M/L);R.z=D/L,g.push(R)}o.push(v),a.push(g)}return[o,a]}(i,c,p,u);return function(t,e,r){var i=1/0;So(r,e)&&(i=hs(r,e[0]));for(var n=0;n<e.length;n++)for(var o=e[n],a=t[n],s=0;s<o.length-1;s++){var u=o[s],l=o[s+1],p=a[s],c=a[s+1],h=[u,l,c,p,u];bo(r,h)&&(i=Math.min(i,hs(r,h)))}return i!==1/0&&i}(f[0],f[1],h)},e}(on);function cs(t,e){return t.x*e.x+t.y*e.y}function hs(t,e){if(1===t.length){var r=e[0],i=e[1],n=e[3],o=t[0],a=i.sub(r),s=n.sub(r),u=o.sub(r),l=cs(a,a),p=cs(a,s),c=cs(s,s),h=cs(u,a),f=cs(u,s),d=l*c-p*p,m=(c*h-p*f)/d,y=(l*f-p*h)/d,_=1-m-y;return r.z*_+i.z*m+n.z*y}for(var v=1/0,g=0,x=e;g<x.length;g+=1){var b=x[g];v=Math.min(v,b.z)}return v}var fs=ln([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,ds=rs.VectorTileFeature.types,ms=Math.cos(Math.PI/180*37.5),ys=Math.pow(2,14)/.5,_s=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new dn,this.indexArray=new zn,this.programConfigurations=new co(fs,t.layers,t.zoom),this.segments=new Gn,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};_s.prototype.populate=function(t,e){this.hasPattern=Na("line",this.layers,e);for(var r=this.layers[0].layout.get("line-sort-key"),i=[],n=0,o=t;n<o.length;n+=1){var a=o[n],s=a.feature,u=a.index,l=a.sourceLayerIndex;if(this.layers[0]._featureFilter(new qi(this.zoom),s)){var p=vo(s),c=r?r.evaluate(s,{}):void 0,h={id:s.id,properties:s.properties,type:s.type,sourceLayerIndex:l,index:u,geometry:p,patterns:{},sortKey:c};i.push(h)}}r&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var f=0,d=i;f<d.length;f+=1){var m=d[f],y=m,_=y.geometry,v=y.index,g=y.sourceLayerIndex;if(this.hasPattern){var x=ja("line",this.layers,m,this.zoom,e);this.patternFeatures.push(x)}else this.addFeature(m,_,v,{});var b=t[v].feature;e.featureIndex.insert(b,_,v,g,this.index)}},_s.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},_s.prototype.addFeatures=function(t,e){for(var r=0,i=this.patternFeatures;r<i.length;r+=1){var n=i[r];this.addFeature(n,n.geometry,n.index,e)}},_s.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},_s.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},_s.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,fs),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},_s.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},_s.prototype.addFeature=function(t,e,r,i){for(var n=this.layers[0].layout,o=n.get("line-join").evaluate(t,{}),a=n.get("line-cap"),s=n.get("line-miter-limit"),u=n.get("line-round-limit"),l=0,p=e;l<p.length;l+=1){var c=p[l];this.addLine(c,t,o,a,s,u,r,i)}},_s.prototype.addLine=function(t,e,r,i,n,o,a,s){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")){this.clipStart=+e.properties.mapbox_clip_start,this.clipEnd=+e.properties.mapbox_clip_end;for(var u=0;u<t.length-1;u++)this.totalDistance+=t[u].dist(t[u+1])}for(var l="Polygon"===ds[e.type],p=t.length;p>=2&&t[p-1].equals(t[p-2]);)p--;for(var c=0;c<p-1&&t[c].equals(t[c+1]);)c++;if(!(p<(l?3:2))){"bevel"===r&&(n=1.05);var h,f=mo/(512*this.overscaling)*15,d=this.segments.prepareSegment(10*p,this.layoutVertexArray,this.indexArray),m=void 0,y=void 0,_=void 0,v=void 0;this.e1=this.e2=-1,l&&(h=t[p-2],v=t[c].sub(h)._unit()._perp());for(var g=c;g<p;g++)if(!(y=l&&g===p-1?t[c+1]:t[g+1])||!t[g].equals(y)){v&&(_=v),h&&(m=h),h=t[g],v=y?y.sub(h)._unit()._perp():_;var x=(_=_||v).add(v);0===x.x&&0===x.y||x._unit();var b=_.x*v.x+_.y*v.y,w=x.x*v.x+x.y*v.y,S=0!==w?1/w:1/0,A=2*Math.sqrt(2-2*w),T=w<ms&&m&&y,I=_.x*v.y-_.y*v.x>0;if(T&&g>c){var z=h.dist(m);if(z>2*f){var k=h.sub(h.sub(m)._mult(f/z)._round());this.updateDistance(m,k),this.addCurrentVertex(k,_,0,0,d),m=k}}var E=m&&y,C=E?r:l?"butt":i;if(E&&"round"===C&&(S<o?C="miter":S<=2&&(C="fakeround")),"miter"===C&&S>n&&(C="bevel"),"bevel"===C&&(S>2&&(C="flipbevel"),S<n&&(C="miter")),m&&this.updateDistance(m,h),"miter"===C)x._mult(S),this.addCurrentVertex(h,x,0,0,d);else if("flipbevel"===C){if(S>100)x=v.mult(-1);else{var P=S*_.add(v).mag()/_.sub(v).mag();x._perp()._mult(P*(I?-1:1))}this.addCurrentVertex(h,x,0,0,d),this.addCurrentVertex(h,x.mult(-1),0,0,d)}else if("bevel"===C||"fakeround"===C){var M=-Math.sqrt(S*S-1),D=I?M:0,L=I?0:M;if(m&&this.addCurrentVertex(h,_,D,L,d),"fakeround"===C)for(var B=Math.round(180*A/Math.PI/20),R=1;R<B;R++){var F=R/B;if(.5!==F){var O=F-.5;F+=F*O*(F-1)*((1.0904+b*(b*(3.55645-1.43519*b)-3.2452))*O*O+(.848013+b*(.215638*b-1.06021)))}var V=v.sub(_)._mult(F)._add(_)._unit()._mult(I?-1:1);this.addHalfVertex(h,V.x,V.y,!1,I,0,d)}y&&this.addCurrentVertex(h,v,-D,-L,d)}else if("butt"===C)this.addCurrentVertex(h,x,0,0,d);else if("square"===C){var U=m?1:-1;this.addCurrentVertex(h,x,U,U,d)}else"round"===C&&(m&&(this.addCurrentVertex(h,_,0,0,d),this.addCurrentVertex(h,_,1,1,d,!0)),y&&(this.addCurrentVertex(h,v,-1,-1,d,!0),this.addCurrentVertex(h,v,0,0,d)));if(T&&g<p-1){var N=h.dist(y);if(N>2*f){var j=h.add(y.sub(h)._mult(f/N)._round());this.updateDistance(h,j),this.addCurrentVertex(j,v,0,0,d),h=j}}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,s)}},_s.prototype.addCurrentVertex=function(t,e,r,i,n,o){void 0===o&&(o=!1);var a=e.x+e.y*r,s=e.y-e.x*r,u=-e.x+e.y*i,l=-e.y-e.x*i;this.addHalfVertex(t,a,s,o,!1,r,n),this.addHalfVertex(t,u,l,o,!0,-i,n),this.distance>ys/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,i,n,o))},_s.prototype.addHalfVertex=function(t,e,r,i,n,o,a){var s=t.x,u=t.y,l=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(i?1:0),(u<<1)+(n?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&l)<<2,l>>6);var p=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,p),a.primitiveLength++),n?this.e2=p:this.e1=p},_s.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(ys-1):this.distance},ki("LineBucket",_s,{omit:["layers","patternFeatures"]});var vs=new nn({"line-cap":new Qi(Vt.layout_line["line-cap"]),"line-join":new $i(Vt.layout_line["line-join"]),"line-miter-limit":new Qi(Vt.layout_line["line-miter-limit"]),"line-round-limit":new Qi(Vt.layout_line["line-round-limit"]),"line-sort-key":new $i(Vt.layout_line["line-sort-key"])}),gs={paint:new nn({"line-opacity":new $i(Vt.paint_line["line-opacity"]),"line-color":new $i(Vt.paint_line["line-color"]),"line-translate":new Qi(Vt.paint_line["line-translate"]),"line-translate-anchor":new Qi(Vt.paint_line["line-translate-anchor"]),"line-width":new $i(Vt.paint_line["line-width"]),"line-gap-width":new $i(Vt.paint_line["line-gap-width"]),"line-offset":new $i(Vt.paint_line["line-offset"]),"line-blur":new $i(Vt.paint_line["line-blur"]),"line-dasharray":new en(Vt.paint_line["line-dasharray"]),"line-pattern":new tn(Vt.paint_line["line-pattern"]),"line-gradient":new rn(Vt.paint_line["line-gradient"])}),layout:vs},xs=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new qi(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,i,n){return r=h({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,i,n)},e}($i))(gs.paint.properties["line-width"].specification);xs.useIntegerZoom=!0;var bs=function(t){function e(e){t.call(this,e,gs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=ia(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),this.paint._values["line-floorwidth"]=xs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new _s(t)},e.prototype.queryRadius=function(t){var e=t,r=ws(Mo("line-width",this,e),Mo("line-gap-width",this,e)),i=Mo("line-offset",this,e);return r/2+Math.abs(i)+Do(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,o,a,s){var u=Lo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*ws(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),p=this.paint.get("line-offset").evaluate(e,r);return p&&(i=function(t,e){for(var r=[],i=new n(0,0),o=0;o<t.length;o++){for(var a=t[o],s=[],u=0;u<a.length;u++){var l=a[u-1],p=a[u],c=a[u+1],h=0===u?i:p.sub(l)._unit()._perp(),f=u===a.length-1?i:c.sub(p)._unit()._perp(),d=h._add(f)._unit(),m=d.x*f.x+d.y*f.y;d._mult(1/m),s.push(d._mult(e)._add(p))}r.push(s)}return r}(i,p*s)),function(t,e,r){for(var i=0;i<e.length;i++){var n=e[i];if(t.length>=3)for(var o=0;o<n.length;o++)if(Co(t,n[o]))return!0;if(Ao(t,n,r))return!0}return!1}(u,i,l)},e.prototype.isTileClipped=function(){return!0},e}(on);function ws(t,e){return e>0?e+2*t:t}var Ss=ln([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),As=ln([{name:"a_projected_pos",components:3,type:"Float32"}],4),Ts=(ln([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),ln([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Is=(ln([{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"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),ln([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),zs=ln([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);ln([{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"}]),ln([{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:"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:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"radialTextOffset"}]),ln([{type:"Float32",name:"offsetX"}]),ln([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function ks(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var i=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===i?t=t.toLocaleUpperCase():"lowercase"===i&&(t=t.toLocaleLowerCase()),t}(t.text,e,r)})),t}var Es={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Cs=24,Ps={horizontal:1,vertical:2,horizontalOnly:3};function Ms(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}ki("Anchor",function(t){function e(e,r,i,n){t.call(this,e,r),this.angle=i,void 0!==n&&(this.segment=n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(n));var Ds=256;function Ls(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new qi(t+1))};if("source"===r.kind)return{kind:"source"};for(var i=r.zoomStops,n=r.interpolationType,o=0;o<i.length&&i[o]<=t;)o++;for(var a=o=Math.max(0,o-1);a<i.length&&i[a]<t+1;)a++;a=Math.min(i.length-1,a);var s=i[o],u=i[a];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:u,interpolationType:n}:{kind:"camera",minZoom:s,maxZoom:u,minSize:r.evaluate(new qi(s)),maxSize:r.evaluate(new qi(u)),interpolationType:n}}function Bs(t,e,r){var i=e.uSize,n=e.uSizeT,o=r.lowerSize,a=r.upperSize;return"source"===t.kind?o/Ds:"composite"===t.kind?De(o/Ds,a/Ds,n):i}function Rs(t,e){var r=0,i=0;if("constant"===t.kind)i=t.layoutSize;else if("source"!==t.kind){var n=t.interpolationType,o=t.minZoom,a=t.maxZoom,s=n?l(tr.interpolationFactor(n,e,o,a),0,1):0;"camera"===t.kind?i=De(t.minSize,t.maxSize,s):r=s}return{uSizeT:r,uSize:i}}var Fs=Object.freeze({getSizeData:Ls,evaluateSizeForFeature:Bs,evaluateSizeForZoom:Rs,SIZE_PACK_FACTOR:Ds}),Os=rs.VectorTileFeature.types,Vs=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Us(t,e,r,i,n,o,a,s){t.emplaceBack(e,r,Math.round(32*i),Math.round(32*n),o,a,s?s[0]:0,s?s[1]:0)}function Ns(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}var js=function(t){this.layoutVertexArray=new yn,this.indexArray=new zn,this.programConfigurations=t,this.segments=new Gn,this.dynamicLayoutVertexArray=new _n,this.opacityVertexArray=new vn,this.placedSymbolArray=new Bn};js.prototype.upload=function(t,e,r,i){r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ss.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,As.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Vs,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(t)},js.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},ki("SymbolBuffers",js);var qs=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new Gn,this.collisionVertexArray=new bn};qs.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Ts.members,!0)},qs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},ki("CollisionBuffers",qs);var Zs=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasPaintOverrides=!1;var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Ls(this.zoom,e["text-size"]),this.iconSizeData=Ls(this.zoom,e["icon-size"]);var r=this.layers[0].layout,i=r.get("symbol-sort-key"),n=r.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==n&&void 0!==i.constantOr(1);var o="viewport-y"===n||"auto"===n&&!this.sortFeaturesByKey;this.sortFeaturesByY=o&&(r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement")),"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(t){return Ps[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};Zs.prototype.createArrays=function(){var t=this.layers[0].layout;this.hasPaintOverrides=Hs.hasPaintOverrides(t),this.text=new js(new co(Ss.members,this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new js(new co(Ss.members,this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.collisionBox=new qs(xn,Is.members,kn),this.collisionCircle=new qs(xn,zs.members,zn),this.glyphOffsetArray=new Vn,this.lineVertexArray=new Nn,this.symbolInstances=new Fn},Zs.prototype.calculateGlyphDependencies=function(t,e,r,i,n){for(var o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=!0,(r||i)&&n){var a=Es[t.charAt(o)];a&&(e[a.charCodeAt(0)]=!0)}},Zs.prototype.populate=function(t,e){var r=this.layers[0],i=r.layout,n=i.get("text-font"),o=i.get("text-field"),a=i.get("icon-image"),s=("constant"!==o.value.kind||o.value.value.toString().length>0)&&("constant"!==n.value.kind||n.value.value.length>0),u="constant"!==a.value.kind||a.value.value&&a.value.value.length>0,l=i.get("symbol-sort-key");if(this.features=[],s||u){for(var p=e.iconDependencies,c=e.glyphDependencies,h=new qi(this.zoom),f=0,d=t;f<d.length;f+=1){var m=d[f],y=m.feature,_=m.index,v=m.sourceLayerIndex;if(r._featureFilter(h,y)){var g=void 0;if(s){var x=r.getValueAndResolveTokens("text-field",y);g=ks(x instanceof ce?x:ce.fromString(x),r,y)}var b=void 0;if(u&&(b=r.getValueAndResolveTokens("icon-image",y)),g||b){var w=this.sortFeaturesByKey?l.evaluate(y,{}):void 0,S={text:g,icon:b,index:_,sourceLayerIndex:v,geometry:vo(y),properties:y.properties,type:Os[y.type],sortKey:w};if(void 0!==y.id&&(S.id=y.id),this.features.push(S),b&&(p[b]=!0),g){var A=n.evaluate(y,{}).join(","),T="map"===i.get("text-rotation-alignment")&&"point"!==i.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Ps.vertical)>=0;for(var I=0,z=g.sections;I<z.length;I+=1){var k=z[I],E=Li(g.toString()),C=k.fontStack||A,P=c[C]=c[C]||{};this.calculateGlyphDependencies(k.text,P,T,this.allowVerticalPlacement,E)}}}}}"line"===i.get("symbol-placement")&&(this.features=function(t){var e={},r={},i=[],n=0;function o(e){i.push(t[e]),n++}function a(t,e,n){var o=r[t];return delete r[t],r[e]=o,i[o].geometry[0].pop(),i[o].geometry[0]=i[o].geometry[0].concat(n[0]),o}function s(t,r,n){var o=e[r];return delete e[r],e[t]=o,i[o].geometry[0].shift(),i[o].geometry[0]=n[0].concat(i[o].geometry[0]),o}function u(t,e,r){var i=r?e[0][e[0].length-1]:e[0][0];return t+":"+i.x+":"+i.y}for(var l=0;l<t.length;l++){var p=t[l],c=p.geometry,h=p.text?p.text.toString():null;if(h){var f=u(h,c),d=u(h,c,!0);if(f in r&&d in e&&r[f]!==e[d]){var m=s(f,d,c),y=a(f,d,i[m].geometry);delete e[f],delete r[d],r[u(h,i[y].geometry,!0)]=y,i[m].geometry=null}else f in r?a(f,d,c):d in e?s(f,d,c):(o(l),e[f]=n-1,r[d]=n-1)}else o(l)}return i.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},Zs.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))},Zs.prototype.isEmpty=function(){return 0===this.symbolInstances.length},Zs.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Zs.prototype.upload=function(t){this.uploaded||(this.collisionBox.upload(t),this.collisionCircle.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Zs.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()},Zs.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var i=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),o={},a=t.segment+1;a<e.length;a++)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:i},a<e.length-1&&(i+=e[a+1].dist(e[a]));for(var s=t.segment||0;s>=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=e[s-1].dist(e[s]));for(var u=0;u<e.length;u++){var l=o[u];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},Zs.prototype.addSymbols=function(t,e,r,i,n,o,a,s,u,l){var p=this,c=t.indexArray,h=t.layoutVertexArray,f=t.dynamicLayoutVertexArray,d=t.segments.prepareSegment(4*e.length,t.layoutVertexArray,t.indexArray,o.sortKey),m=this.glyphOffsetArray.length,y=d.vertexLength,_=this.allowVerticalPlacement&&a===Ps.vertical?Math.PI/2:0,v=function(t){var e=t.tl,i=t.tr,n=t.bl,o=t.br,a=t.tex,u=d.vertexLength,l=t.glyphOffset[1];Us(h,s.x,s.y,e.x,l+e.y,a.x,a.y,r),Us(h,s.x,s.y,i.x,l+i.y,a.x+a.w,a.y,r),Us(h,s.x,s.y,n.x,l+n.y,a.x,a.y+a.h,r),Us(h,s.x,s.y,o.x,l+o.y,a.x+a.w,a.y+a.h,r),Ns(f,s,_),c.emplaceBack(u,u+1,u+2),c.emplaceBack(u+1,u+2,u+3),d.vertexLength+=4,d.primitiveLength+=2,p.glyphOffsetArray.emplaceBack(t.glyphOffset[0])};if(o.text&&o.text.sections){var g=o.text.sections;if(this.hasPaintOverrides){for(var x,b=function(e,r){void 0===x||x===e&&!r||t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o,o.index,{},g[x]),x=e},w=0,S=e;w<S.length;w+=1){var A=S[w];b(A.sectionIndex,!1),v(A)}b(x,!0)}else{for(var T=0,I=e;T<I.length;T+=1){v(I[T])}t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o,o.index,{},g[0])}}else{for(var z=0,k=e;z<k.length;z+=1){v(k[z])}t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o,o.index,{})}t.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,y,u,l,s.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],a,0,!1,0)},Zs.prototype._addCollisionDebugVertex=function(t,e,r,i,n,o){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,i,n,Math.round(o.x),Math.round(o.y))},Zs.prototype.addCollisionDebugVertices=function(t,e,r,i,o,a,s,u){var l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),p=l.vertexLength,c=o.layoutVertexArray,h=o.collisionVertexArray,f=s.anchorX,d=s.anchorY;if(this._addCollisionDebugVertex(c,h,a,f,d,new n(t,e)),this._addCollisionDebugVertex(c,h,a,f,d,new n(r,e)),this._addCollisionDebugVertex(c,h,a,f,d,new n(r,i)),this._addCollisionDebugVertex(c,h,a,f,d,new n(t,i)),l.vertexLength+=4,u){var m=o.indexArray;m.emplaceBack(p,p+1,p+2),m.emplaceBack(p,p+2,p+3),l.primitiveLength+=2}else{var y=o.indexArray;y.emplaceBack(p,p+1),y.emplaceBack(p+1,p+2),y.emplaceBack(p+2,p+3),y.emplaceBack(p+3,p),l.primitiveLength+=4}},Zs.prototype.addDebugCollisionBoxes=function(t,e,r){for(var i=t;i<e;i++){var n=this.collisionBoxArray.get(i),o=n.x1,a=n.y1,s=n.x2,u=n.y2,l=n.radius>0;this.addCollisionDebugVertices(o,a,s,u,l?this.collisionCircle:this.collisionBox,n.anchorPoint,r,l)}},Zs.prototype.generateCollisionDebugBuffers=function(){for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e)}},Zs.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,i,n,o,a){for(var s={},u=e;u<r;u++){var l=t.get(u);if(0===l.radius){s.textBox={x1:l.x1,y1:l.y1,x2:l.x2,y2:l.y2,anchorPointX:l.anchorPointX,anchorPointY:l.anchorPointY},s.textFeatureIndex=l.featureIndex;break}s.textCircles||(s.textCircles=[],s.textFeatureIndex=l.featureIndex);s.textCircles.push(l.anchorPointX,l.anchorPointY,l.radius,l.signedDistanceFromAnchor,1)}for(var p=i;p<n;p++){var c=t.get(p);if(0===c.radius){s.verticalTextBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},s.verticalTextFeatureIndex=c.featureIndex;break}}for(var h=o;h<a;h++){var f=t.get(h);if(0===f.radius){s.iconBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},s.iconFeatureIndex=f.featureIndex;break}}return s},Zs.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex))}},Zs.prototype.hasTextData=function(){return this.text.segments.get().length>0},Zs.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Zs.prototype.hasCollisionBoxData=function(){return this.collisionBox.segments.get().length>0},Zs.prototype.hasCollisionCircleData=function(){return this.collisionCircle.segments.get().length>0},Zs.prototype.addIndicesForPlacedTextSymbol=function(t){for(var e=this.text.placedSymbolArray.get(t),r=e.vertexStartIndex+4*e.numGlyphs,i=e.vertexStartIndex;i<r;i+=4)this.text.indexArray.emplaceBack(i,i+1,i+2),this.text.indexArray.emplaceBack(i+1,i+2,i+3)},Zs.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),i=[],n=[],o=[],a=0;a<this.symbolInstances.length;++a){o.push(a);var s=this.symbolInstances.get(a);i.push(0|Math.round(e*s.anchorX+r*s.anchorY)),n.push(s.featureIndex)}return o.sort((function(t,e){return i[t]-i[e]||n[e]-n[t]})),o},Zs.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,i=this.symbolInstanceIndexes;r<i.length;r+=1){var n=i[r],o=this.symbolInstances.get(n);this.featureSortOrder.push(o.featureIndex),[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t,r,i){t>=0&&i.indexOf(t)===r&&e.addIndicesForPlacedTextSymbol(t)})),o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedTextSymbol(o.verticalPlacedTextSymbolIndex);var a=this.icon.placedSymbolArray.get(n);if(a.numGlyphs){var s=a.vertexStartIndex;this.icon.indexArray.emplaceBack(s,s+1,s+2),this.icon.indexArray.emplaceBack(s+1,s+2,s+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},ki("SymbolBucket",Zs,{omit:["layers","collisionBoxArray","features","compareText"]}),Zs.MAX_GLYPHS=65535,Zs.addDynamicAttributes=Ns;var Gs=new nn({"symbol-placement":new Qi(Vt.layout_symbol["symbol-placement"]),"symbol-spacing":new Qi(Vt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Qi(Vt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new $i(Vt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Qi(Vt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Qi(Vt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Qi(Vt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Qi(Vt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Qi(Vt.layout_symbol["icon-rotation-alignment"]),"icon-size":new $i(Vt.layout_symbol["icon-size"]),"icon-text-fit":new Qi(Vt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Qi(Vt.layout_symbol["icon-text-fit-padding"]),"icon-image":new $i(Vt.layout_symbol["icon-image"]),"icon-rotate":new $i(Vt.layout_symbol["icon-rotate"]),"icon-padding":new Qi(Vt.layout_symbol["icon-padding"]),"icon-keep-upright":new Qi(Vt.layout_symbol["icon-keep-upright"]),"icon-offset":new $i(Vt.layout_symbol["icon-offset"]),"icon-anchor":new $i(Vt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Qi(Vt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Qi(Vt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Qi(Vt.layout_symbol["text-rotation-alignment"]),"text-field":new $i(Vt.layout_symbol["text-field"]),"text-font":new $i(Vt.layout_symbol["text-font"]),"text-size":new $i(Vt.layout_symbol["text-size"]),"text-max-width":new $i(Vt.layout_symbol["text-max-width"]),"text-line-height":new Qi(Vt.layout_symbol["text-line-height"]),"text-letter-spacing":new $i(Vt.layout_symbol["text-letter-spacing"]),"text-justify":new $i(Vt.layout_symbol["text-justify"]),"text-radial-offset":new $i(Vt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Qi(Vt.layout_symbol["text-variable-anchor"]),"text-anchor":new $i(Vt.layout_symbol["text-anchor"]),"text-max-angle":new Qi(Vt.layout_symbol["text-max-angle"]),"text-writing-mode":new Qi(Vt.layout_symbol["text-writing-mode"]),"text-rotate":new $i(Vt.layout_symbol["text-rotate"]),"text-padding":new Qi(Vt.layout_symbol["text-padding"]),"text-keep-upright":new Qi(Vt.layout_symbol["text-keep-upright"]),"text-transform":new $i(Vt.layout_symbol["text-transform"]),"text-offset":new $i(Vt.layout_symbol["text-offset"]),"text-allow-overlap":new Qi(Vt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Qi(Vt.layout_symbol["text-ignore-placement"]),"text-optional":new Qi(Vt.layout_symbol["text-optional"])}),Ws={paint:new nn({"icon-opacity":new $i(Vt.paint_symbol["icon-opacity"]),"icon-color":new $i(Vt.paint_symbol["icon-color"]),"icon-halo-color":new $i(Vt.paint_symbol["icon-halo-color"]),"icon-halo-width":new $i(Vt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new $i(Vt.paint_symbol["icon-halo-blur"]),"icon-translate":new Qi(Vt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Qi(Vt.paint_symbol["icon-translate-anchor"]),"text-opacity":new $i(Vt.paint_symbol["text-opacity"]),"text-color":new $i(Vt.paint_symbol["text-color"],{runtimeType:Qt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new $i(Vt.paint_symbol["text-halo-color"]),"text-halo-width":new $i(Vt.paint_symbol["text-halo-width"]),"text-halo-blur":new $i(Vt.paint_symbol["text-halo-blur"]),"text-translate":new Qi(Vt.paint_symbol["text-translate"]),"text-translate-anchor":new Qi(Vt.paint_symbol["text-translate-anchor"])}),layout:Gs},Ks=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Ht,this.defaultValue=t};Ks.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Ks.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Ks.prototype.possibleOutputs=function(){return[void 0]},Ks.prototype.serialize=function(){return null},ki("FormatSectionOverride",Ks,{omit:["defaultValue"]});var Hs=function(t){function e(e){t.call(this,e,Ws)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e){if(t.prototype.recalculate.call(this,e),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var r=this.layout.get("text-writing-mode");if(r){for(var i=[],n=0,o=r;n<o.length;n+=1){var a=o[n];i.indexOf(a)<0&&i.push(a)}this.layout._values["text-writing-mode"]=i}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e){var r=this.layout.get(t).evaluate(e,{}),i=this._unevaluatedLayout._values[t];return i.isDataDriven()||Fr(i.value)?r:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,r){return r in t?String(t[r]):""}))}(e.properties,r)},e.prototype.createBucket=function(t){return new Zs(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,r=Ws.paint.overridableProperties;t<r.length;t+=1){var i=r[t];if(e.hasPaintOverride(this.layout,i)){var n=this.paint.get(i),o=new Ks(n),a=new Rr(o,n.property.specification),s=null;s="constant"===n.value.kind||"source"===n.value.kind?new Vr("source",a):new Ur("composite",a,n.value.zoomStops,n.value._interpolationType),this.paint._values[i]=new Ji(n.property,s,n.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,r,i){return!(!this.layout||r.isDataDriven()||i.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var r=t.get("text-field"),i=Ws.paint.properties[e],n=!1,o=function(t){for(var e=0,r=t;e<r.length;e+=1){var o=r[e];if(i.overrides&&i.overrides.hasOverride(o))return void(n=!0)}};if("constant"===r.value.kind&&r.value.value instanceof ce)o(r.value.value.sections);else if("source"===r.value.kind){var a=function(t){if(!n)if(t instanceof me&&fe(t.value)===re){var e=t.value;o(e.sections)}else t instanceof ge?o(t.sections):t.eachChild(a)},s=r.value;s._styleExpression&&a(s._styleExpression.expression)}return n},e.hasPaintOverrides=function(t){for(var r=0,i=Ws.paint.overridableProperties;r<i.length;r+=1){var n=i[r];if(e.hasPaintOverride(t,n))return!0}return!1},e}(on),Xs={paint:new nn({"background-color":new Qi(Vt.paint_background["background-color"]),"background-pattern":new en(Vt.paint_background["background-pattern"]),"background-opacity":new Qi(Vt.paint_background["background-opacity"])})},Js=function(t){function e(e){t.call(this,e,Xs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(on),Ys={paint:new nn({"raster-opacity":new Qi(Vt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Qi(Vt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Qi(Vt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Qi(Vt.paint_raster["raster-brightness-max"]),"raster-saturation":new Qi(Vt.paint_raster["raster-saturation"]),"raster-contrast":new Qi(Vt.paint_raster["raster-contrast"]),"raster-resampling":new Qi(Vt.paint_raster["raster-resampling"]),"raster-fade-duration":new Qi(Vt.paint_raster["raster-fade-duration"])})},Qs=function(t){function e(e){t.call(this,e,Ys)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(on);var $s=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(on),tu={circle:Ho,heatmap:na,hillshade:aa,fill:Wa,"fill-extrusion":ps,line:bs,symbol:Hs,background:Js,raster:Qs};function eu(t){return"custom"===t.type?new $s(t):new tu[t.type](t)}function ru(t){for(var e=0,r=0,i=0,n=t;i<n.length;i+=1){var o=n[i];e+=o.w*o.h,r=Math.max(r,o.w)}t.sort((function(t,e){return e.h-t.h}));for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,u=0,l=0,p=t;l<p.length;l+=1)for(var c=p[l],h=a.length-1;h>=0;h--){var f=a[h];if(!(c.w>f.w||c.h>f.h)){if(c.x=f.x,c.y=f.y,u=Math.max(u,c.y+c.h),s=Math.max(s,c.x+c.w),c.w===f.w&&c.h===f.h){var d=a.pop();h<a.length&&(a[h]=d)}else c.h===f.h?(f.x+=c.w,f.w-=c.w):c.w===f.w?(f.y+=c.h,f.h-=c.h):(a.push({x:f.x+c.w,y:f.y,w:f.w-c.w,h:c.h}),f.y+=c.h,f.h-=c.h);break}}return{w:s,h:u,fill:e/(s*u)||0}}var iu=function(t,e){var r=e.pixelRatio,i=e.version;this.paddedRect=t,this.pixelRatio=r,this.version=i},nu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};nu.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},nu.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},nu.tlbr.get=function(){return this.tl.concat(this.br)},nu.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(iu.prototype,nu);var ou=function(t,e){var r={},i={};this.haveRenderCallbacks=[];var n=[];this.addImages(t,r,n),this.addImages(e,i,n);var o=ru(n),a=o.w,s=o.h,u=new ea({width:a||1,height:s||1});for(var l in t){var p=t[l],c=r[l].paddedRect;ea.copy(p.data,u,{x:0,y:0},{x:c.x+1,y:c.y+1},p.data)}for(var h in e){var f=e[h],d=i[h].paddedRect,m=d.x+1,y=d.y+1,_=f.data.width,v=f.data.height;ea.copy(f.data,u,{x:0,y:0},{x:m,y:y},f.data),ea.copy(f.data,u,{x:0,y:v-1},{x:m,y:y-1},{width:_,height:1}),ea.copy(f.data,u,{x:0,y:0},{x:m,y:y+v},{width:_,height:1}),ea.copy(f.data,u,{x:_-1,y:0},{x:m-1,y:y},{width:1,height:v}),ea.copy(f.data,u,{x:0,y:0},{x:m+_,y:y},{width:1,height:v})}this.image=u,this.iconPositions=r,this.patternPositions=i};ou.prototype.addImages=function(t,e,r){for(var i in t){var n=t[i],o={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(o),e[i]=new iu(o,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}},ou.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},ou.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var i=t.tl,n=i[0],o=i[1];r.update(e.data,void 0,{x:n,y:o})}},ki("ImagePosition",iu),ki("ImageAtlas",ou);var au=self.HTMLImageElement,su=self.HTMLCanvasElement,uu=self.HTMLVideoElement,lu=self.ImageData,pu=function(t,e,r,i){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,i)};function cu(t){var e=t.userImage;if(e&&e.render&&e.render())return t.data.replace(new Uint8Array(e.data.buffer)),!0;return!1}pu.prototype.update=function(t,e,r){var i=t.width,n=t.height,o=!(this.size&&this.size[0]===i&&this.size[1]===n||r),a=this.context,s=a.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),o)this.size=[i,n],t instanceof au||t instanceof su||t instanceof uu||t instanceof lu?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,i,n,0,this.format,s.UNSIGNED_BYTE,t.data);else{var u=r||{x:0,y:0},l=u.x,p=u.y;t instanceof au||t instanceof su||t instanceof uu||t instanceof lu?s.texSubImage2D(s.TEXTURE_2D,0,l,p,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,l,p,i,n,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},pu.prototype.bind=function(t,e,r){var i=this.context.gl;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),t!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e),this.wrap=e)},pu.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},pu.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var hu=function(t){function e(){t.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new ea({width:1,height:1}),this.dirty=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isLoaded=function(){return this.loaded},e.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e<r.length;e+=1){var i=r[e],n=i.ids,o=i.callback;this._notify(n,o)}this.requestors=[]}},e.prototype.getImage=function(t){return this.images[t]},e.prototype.addImage=function(t,e){this.images[t]=e},e.prototype.updateImage=function(t,e){var r=this.images[t];e.version=r.version+1,this.images[t]=e,this.updatedImages[t]=!0},e.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},e.prototype.listImages=function(){return Object.keys(this.images)},e.prototype.getImages=function(t,e){var r=!0;if(!this.isLoaded())for(var i=0,n=t;i<n.length;i+=1){var o=n[i];this.images[o]||(r=!1)}this.isLoaded()||r?this._notify(t,e):this.requestors.push({ids:t,callback:e})},e.prototype._notify=function(t,e){for(var r={},i=0,n=t;i<n.length;i+=1){var o=n[i];this.images[o]||this.fire(new Rt("styleimagemissing",{id:o}));var a=this.images[o];a?r[o]={data:a.data.clone(),pixelRatio:a.pixelRatio,sdf:a.sdf,version:a.version,hasRenderCallback:Boolean(a.userImage&&a.userImage.render)}:A('Image "'+o+'" 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.')}e(null,r)},e.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},e.prototype.getPattern=function(t){var e=this.patterns[t],r=this.getImage(t);if(!r)return null;if(e&&e.position.version===r.version)return e.position;if(e)e.position.version=r.version;else{var i={w:r.data.width+2,h:r.data.height+2,x:0,y:0},n=new iu(i,r);this.patterns[t]={bin:i,position:n}}return this._updatePatternAtlas(),this.patterns[t].position},e.prototype.bind=function(t){var e=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new pu(t,this.atlasImage,e.RGBA),this.atlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE)},e.prototype._updatePatternAtlas=function(){var t=[];for(var e in this.patterns)t.push(this.patterns[e].bin);var r=ru(t),i=r.w,n=r.h,o=this.atlasImage;for(var a in o.resize({width:i||1,height:n||1}),this.patterns){var s=this.patterns[a].bin,u=s.x+1,l=s.y+1,p=this.images[a].data,c=p.width,h=p.height;ea.copy(p,o,{x:0,y:0},{x:u,y:l},{width:c,height:h}),ea.copy(p,o,{x:0,y:h-1},{x:u,y:l-1},{width:c,height:1}),ea.copy(p,o,{x:0,y:0},{x:u,y:l+h},{width:c,height:1}),ea.copy(p,o,{x:c-1,y:0},{x:u-1,y:l},{width:1,height:h}),ea.copy(p,o,{x:0,y:0},{x:u+c,y:l},{width:1,height:h})}this.dirty=!0},e.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},e.prototype.dispatchRenderCallbacks=function(t){for(var e=0,r=t;e<r.length;e+=1){var i=r[e];if(!this.callbackDispatchedThisFrame[i]){this.callbackDispatchedThisFrame[i]=!0;var n=this.images[i];cu(n)&&this.updateImage(i,n)}}},e}(Ot),fu=function(t,e,r,i,n){var o,a,s=8*n-i-1,u=(1<<s)-1,l=u>>1,p=-7,c=r?n-1:0,h=r?-1:1,f=t[e+c];for(c+=h,o=f&(1<<-p)-1,f>>=-p,p+=s;p>0;o=256*o+t[e+c],c+=h,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=i;p>0;a=256*a+t[e+c],c+=h,p-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,i),o-=l}return(f?-1:1)*a*Math.pow(2,o-i)},du=function(t,e,r,i,n,o){var a,s,u,l=8*o-n-1,p=(1<<l)-1,c=p>>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,d=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=p?(s=0,a=p):a+c>=1?(s=(e*u-1)*Math.pow(2,n),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,n),a=0));n>=8;t[r+f]=255&s,f+=d,s/=256,n-=8);for(a=a<<n|s,l+=n;l>0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*m},mu=yu;function yu(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}yu.Varint=0,yu.Fixed64=1,yu.Bytes=2,yu.Fixed32=5;function _u(t){return t.type===yu.Bytes?t.readVarint()+t.pos:t.pos+1}function vu(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function gu(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=t;n--)r.buf[n+i]=r.buf[n]}function xu(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function bu(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function wu(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Su(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function Au(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Tu(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function Iu(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function zu(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function ku(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function Eu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Cu(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Pu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}yu.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var i=this.readVarint(),n=i>>3,o=this.pos;this.type=7&i,t(n,e,this),this.pos===o&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Eu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Pu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Eu(this.buf,this.pos)+4294967296*Eu(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Eu(this.buf,this.pos)+4294967296*Pu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=fu(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=fu(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,i=this.buf;return e=127&(r=i[this.pos++]),r<128?e:(e|=(127&(r=i[this.pos++]))<<7,r<128?e:(e|=(127&(r=i[this.pos++]))<<14,r<128?e:(e|=(127&(r=i[this.pos++]))<<21,r<128?e:function(t,e,r){var i,n,o=r.buf;if(n=o[r.pos++],i=(112&n)>>4,n<128)return vu(t,i,e);if(n=o[r.pos++],i|=(127&n)<<3,n<128)return vu(t,i,e);if(n=o[r.pos++],i|=(127&n)<<10,n<128)return vu(t,i,e);if(n=o[r.pos++],i|=(127&n)<<17,n<128)return vu(t,i,e);if(n=o[r.pos++],i|=(127&n)<<24,n<128)return vu(t,i,e);if(n=o[r.pos++],i|=(1&n)<<31,n<128)return vu(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=i[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=function(t,e,r){var i="",n=e;for(;n<r;){var o,a,s,u=t[n],l=null,p=u>239?4:u>223?3:u>191?2:1;if(n+p>r)break;1===p?u<128&&(l=u):2===p?128==(192&(o=t[n+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===p?(o=t[n+1],a=t[n+2],128==(192&o)&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===p&&(o=t[n+1],a=t[n+2],s=t[n+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,p=1):l>65535&&(l-=65536,i+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),i+=String.fromCharCode(l),n+=p}return i}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==yu.Bytes)return t.push(this.readVarint(e));var r=_u(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==yu.Bytes)return t.push(this.readSVarint());var e=_u(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==yu.Bytes)return t.push(this.readBoolean());var e=_u(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==yu.Bytes)return t.push(this.readFloat());var e=_u(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==yu.Bytes)return t.push(this.readDouble());var e=_u(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==yu.Bytes)return t.push(this.readFixed32());var e=_u(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==yu.Bytes)return t.push(this.readSFixed32());var e=_u(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==yu.Bytes)return t.push(this.readFixed64());var e=_u(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==yu.Bytes)return t.push(this.readSFixed64());var e=_u(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===yu.Varint)for(;this.buf[this.pos++]>127;);else if(e===yu.Bytes)this.pos=this.readVarint()+this.pos;else if(e===yu.Fixed32)this.pos+=4;else{if(e!==yu.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Cu(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Cu(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Cu(this.buf,-1&t,this.pos),Cu(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Cu(this.buf,-1&t,this.pos),Cu(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,i;t>=0?(r=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,i=i+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(i,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var i,n,o=0;o<e.length;o++){if((i=e.charCodeAt(o))>55295&&i<57344){if(!n){i>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):n=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(t[r++]=239,t[r++]=191,t[r++]=189,n=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&gu(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),du(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),du(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var i=this.pos-r;i>=128&&gu(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,r){this.writeTag(t,yu.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,xu,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,bu,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Au,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,wu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Su,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Tu,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Iu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,zu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,ku,e)},writeBytesField:function(t,e){this.writeTag(t,yu.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,yu.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,yu.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,yu.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,yu.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,yu.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,yu.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,yu.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,yu.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,yu.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Mu=3;function Du(t,e,r){1===t&&r.readMessage(Lu,e)}function Lu(t,e,r){if(3===t){var i=r.readMessage(Bu,{}),n=i.id,o=i.bitmap,a=i.width,s=i.height,u=i.left,l=i.top,p=i.advance;e.push({id:n,bitmap:new ta({width:a+2*Mu,height:s+2*Mu},o),metrics:{width:a,height:s,left:u,top:l,advance:p}})}}function Bu(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}var Ru=Vu,Fu=Vu,Ou=1e20;function Vu(t,e,r,i,n,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=i||.25,this.fontFamily=n||"sans-serif",this.fontWeight=o||"normal",this.radius=r||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,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(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Uu(t,e,r,i,n,o,a){for(var s=0;s<e;s++){for(var u=0;u<r;u++)i[u]=t[u*e+s];for(Nu(i,n,o,a,r),u=0;u<r;u++)t[u*e+s]=n[u]}for(u=0;u<r;u++){for(s=0;s<e;s++)i[s]=t[u*e+s];for(Nu(i,n,o,a,e),s=0;s<e;s++)t[u*e+s]=Math.sqrt(n[s])}}function Nu(t,e,r,i,n){r[0]=0,i[0]=-Ou,i[1]=+Ou;for(var o=1,a=0;o<n;o++){for(var s=(t[o]+o*o-(t[r[a]]+r[a]*r[a]))/(2*o-2*r[a]);s<=i[a];)a--,s=(t[o]+o*o-(t[r[a]]+r[a]*r[a]))/(2*o-2*r[a]);r[++a]=o,i[a]=s,i[a+1]=+Ou}for(o=0,a=0;o<n;o++){for(;i[a+1]<o;)a++;e[o]=(o-r[a])*(o-r[a])+t[r[a]]}}Vu.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),r=new Uint8ClampedArray(this.size*this.size),i=0;i<this.size*this.size;i++){var n=e.data[4*i+3]/255;this.gridOuter[i]=1===n?0:0===n?Ou:Math.pow(Math.max(0,.5-n),2),this.gridInner[i]=1===n?Ou:0===n?0:Math.pow(Math.max(0,n-.5),2)}for(Uu(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),Uu(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),i=0;i<this.size*this.size;i++){var o=this.gridOuter[i]-this.gridInner[i];r[i]=Math.max(0,Math.min(255,Math.round(255-255*(o/this.radius+this.cutoff))))}return r},Ru.default=Fu;var ju=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};ju.prototype.setURL=function(t){this.url=t},ju.prototype.getGlyphs=function(t,e){var r=this,i=[];for(var n in t)for(var o=0,a=t[n];o<a.length;o+=1){var s=a[o];i.push({stack:n,id:s})}c(i,(function(t,e){var i=t.stack,n=t.id,o=r.entries[i];o||(o=r.entries[i]={glyphs:{},requests:{}});var a=o.glyphs[n];if(void 0===a){if(a=r._tinySDF(o,i,n))return o.glyphs[n]=a,void e(null,{stack:i,id:n,glyph:a});var s=Math.floor(n/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else{var u=o.requests[s];u||(u=o.requests[s]=[],ju.loadGlyphRange(i,s,r.url,r.requestManager,(function(t,e){if(e)for(var i in e)r._doesCharSupportLocalGlyph(+i)||(o.glyphs[+i]=e[+i]);for(var n=0,a=u;n<a.length;n+=1){(0,a[n])(t,e)}delete o.requests[s]}))),u.push((function(t,r){t?e(t):r&&e(null,{stack:i,id:n,glyph:r[n]||null})}))}}else e(null,{stack:i,id:n,glyph:a})}),(function(t,r){if(t)e(t);else if(r){for(var i={},n=0,o=r;n<o.length;n+=1){var a=o[n],s=a.stack,u=a.id,l=a.glyph;(i[s]||(i[s]={}))[u]=l&&{id:l.id,bitmap:l.bitmap.clone(),metrics:l.metrics}}e(null,i)}}))},ju.prototype._doesCharSupportLocalGlyph=function(t){return!!this.localIdeographFontFamily&&(Di["CJK Unified Ideographs"](t)||Di["Hangul Syllables"](t)||Di.Hiragana(t)||Di.Katakana(t))},ju.prototype._tinySDF=function(t,e,r){var i=this.localIdeographFontFamily;if(i&&this._doesCharSupportLocalGlyph(r)){var n=t.tinySDF;if(!n){var o="400";/bold/i.test(e)?o="900":/medium/i.test(e)?o="500":/light/i.test(e)&&(o="200"),n=t.tinySDF=new ju.TinySDF(24,3,8,.25,i,o)}return{id:r,bitmap:new ta({width:30,height:30},n.draw(String.fromCharCode(r))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},ju.loadGlyphRange=function(t,e,r,i,n){var o=256*e,a=o+255,s=i.transformRequest(i.normalizeGlyphsURL(r).replace("{fontstack}",t).replace("{range}",o+"-"+a),wt.Glyphs);Et(s,(function(t,e){if(t)n(t);else if(e){for(var r={},i=0,o=function(t){return new mu(t).readFields(Du,[])}(e);i<o.length;i+=1){var a=o[i];r[a.id]=a}n(null,r)}}))},ju.TinySDF=Ru;var qu=function(){this.specification=Vt.light.position};qu.prototype.possiblyEvaluate=function(t,e){return r=t.expression.evaluate(e),i=r[0],n=r[1],o=r[2],n+=90,n*=Math.PI/180,o*=Math.PI/180,{x:i*Math.cos(n)*Math.sin(o),y:i*Math.sin(n)*Math.sin(o),z:i*Math.cos(o)};var r,i,n,o},qu.prototype.interpolate=function(t,e,r){return{x:De(t.x,e.x,r),y:De(t.y,e.y,r),z:De(t.z,e.z,r)}};var Zu=new nn({anchor:new Qi(Vt.light.anchor),position:new qu,color:new Qi(Vt.light.color),intensity:new Qi(Vt.light.intensity)}),Gu=function(t){function e(e){t.call(this),this._transitionable=new Wi(Zu),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getLight=function(){return this._transitionable.serialize()},e.prototype.setLight=function(t,e){if(void 0===e&&(e={}),!this._validate(gi,t,e))for(var r in t){var i=t[r];g(r,"-transition")?this._transitionable.setTransition(r.slice(0,-"-transition".length),i):this._transitionable.setValue(r,i)}},e.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},e.prototype.hasTransition=function(){return this._transitioning.hasTransition()},e.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},e.prototype._validate=function(t,e,r){return(!r||!1!==r.validate)&&wi(this,t.call(vi,h({value:e,style:{glyphs:!0,sprite:!0},styleSpec:Vt})))},e}(Ot),Wu=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}};Wu.prototype.getDash=function(t,e){var r=t.join(",")+String(e);return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},Wu.prototype.addDash=function(t,e){var r=e?7:0,i=2*r+1;if(this.nextRow+i>this.height)return A("LineAtlas out of space"),null;for(var n=0,o=0;o<t.length;o++)n+=t[o];for(var a=this.width/n,s=a/2,u=t.length%2==1,l=-r;l<=r;l++)for(var p=this.nextRow+r+l,c=this.width*p,h=u?-t[t.length-1]:0,f=t[0],d=1,m=0;m<this.width;m++){for(;f<m/a;)h=f,f+=t[d],u&&d===t.length-1&&(f+=t[0]),d++;var y=Math.abs(m-h*a),_=Math.abs(m-f*a),v=Math.min(y,_),g=d%2==1,x=void 0;if(e){var b=r?l/r*(s+1):0;if(g){var w=s-Math.abs(b);x=Math.sqrt(v*v+w*w)}else x=s-Math.sqrt(v*v+b*b)}else x=(g?1:-1)*v;this.data[3+4*(c+m)]=Math.max(0,Math.min(255,x+128))}var S={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:n};return this.nextRow+=i,this.dirty=!0,S},Wu.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.RGBA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,this.width,this.height,0,e.RGBA,e.UNSIGNED_BYTE,this.data))};var Ku=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};Ku.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))};var Hu=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},v(["receive","process"],this),this.invoker=new Ku(this.process),this.target.addEventListener("message",this.receive,!1)};Hu.prototype.send=function(t,e,r,i){var n=this,o=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[o]=r);var a=[];return this.target.postMessage({id:o,type:t,hasCallback:!!r,targetMapId:i,sourceMapId:this.mapId,data:Ci(e,a)},a),{cancel:function(){r&&delete n.callbacks[o],n.target.postMessage({id:o,type:"<cancel>",targetMapId:i,sourceMapId:n.mapId})}}},Hu.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[r];var i=this.cancelCallbacks[r];delete this.cancelCallbacks[r],i&&i()}else this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()},Hu.prototype.process=function(){var t=this;if(this.taskQueue.length){var e=this.taskQueue.shift(),r=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),r)if("<response>"===r.type){var i=this.callbacks[e];delete this.callbacks[e],i&&(r.error?i(Pi(r.error)):i(null,Pi(r.data)))}else{var n=!1,o=r.hasCallback?function(r,i){n=!0,delete t.cancelCallbacks[e];var o=[];t.target.postMessage({id:e,type:"<response>",sourceMapId:t.mapId,error:r?Ci(r):null,data:Ci(i,o)},o)}:function(t){n=!0},a=null,s=Pi(r.data);if(this.parent[r.type])a=this.parent[r.type](r.sourceMapId,s,o);else if(this.parent.getWorkerSource){var u=r.type.split(".");a=this.parent.getWorkerSource(r.sourceMapId,u[0],s.source)[u[1]](s,o)}else o(new Error("Could not find function "+r.type));!n&&a&&a.cancel&&(this.cancelCallbacks[e]=a.cancel)}}},Hu.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)};var Xu=function t(e,r){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=m();for(var i=this.workerPool.acquire(this.id),n=0;n<i.length;n++){var o=i[n],a=new t.Actor(o,r,this.id);a.name="Worker "+n,this.actors.push(a)}};function Ju(t,e,r){var i=2*Math.PI*6378137/256/Math.pow(2,r);return[t*i-2*Math.PI*6378137/2,e*i-2*Math.PI*6378137/2]}Xu.prototype.broadcast=function(t,e,r){r=r||function(){},c(this.actors,(function(r,i){r.send(t,e,i)}),r)},Xu.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},Xu.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},Xu.Actor=Hu;var Yu=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Yu.prototype.setNorthEast=function(t){return this._ne=t instanceof Qu?new Qu(t.lng,t.lat):Qu.convert(t),this},Yu.prototype.setSouthWest=function(t){return this._sw=t instanceof Qu?new Qu(t.lng,t.lat):Qu.convert(t),this},Yu.prototype.extend=function(t){var e,r,i=this._sw,n=this._ne;if(t instanceof Qu)e=t,r=t;else{if(!(t instanceof Yu))return Array.isArray(t)?t.every(Array.isArray)?this.extend(Yu.convert(t)):this.extend(Qu.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return i||n?(i.lng=Math.min(e.lng,i.lng),i.lat=Math.min(e.lat,i.lat),n.lng=Math.max(r.lng,n.lng),n.lat=Math.max(r.lat,n.lat)):(this._sw=new Qu(e.lng,e.lat),this._ne=new Qu(r.lng,r.lat)),this},Yu.prototype.getCenter=function(){return new Qu((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Yu.prototype.getSouthWest=function(){return this._sw},Yu.prototype.getNorthEast=function(){return this._ne},Yu.prototype.getNorthWest=function(){return new Qu(this.getWest(),this.getNorth())},Yu.prototype.getSouthEast=function(){return new Qu(this.getEast(),this.getSouth())},Yu.prototype.getWest=function(){return this._sw.lng},Yu.prototype.getSouth=function(){return this._sw.lat},Yu.prototype.getEast=function(){return this._ne.lng},Yu.prototype.getNorth=function(){return this._ne.lat},Yu.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Yu.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Yu.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Yu.convert=function(t){return!t||t instanceof Yu?t:new Yu(t)};var Qu=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Qu.prototype.wrap=function(){return new Qu(p(this.lng,-180,180),this.lat)},Qu.prototype.toArray=function(){return[this.lng,this.lat]},Qu.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Qu.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Yu(new Qu(this.lng-r,this.lat-e),new Qu(this.lng+r,this.lat+e))},Qu.convert=function(t){if(t instanceof Qu)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Qu(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Qu(Number("lng"in t?t.lng:t.lon),Number(t.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 $u=2*Math.PI*6378137;function tl(t){return $u*Math.cos(t*Math.PI/180)}function el(t){return(180+t)/360}function rl(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function il(t,e){return t/tl(e)}function nl(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var ol=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};ol.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Qu.convert(t);return new ol(el(r.lng),rl(r.lat),il(e,r.lat))},ol.prototype.toLngLat=function(){return new Qu(360*this.x-180,nl(this.y))},ol.prototype.toAltitude=function(){return t=this.z,e=this.y,t*tl(nl(e));var t,e},ol.prototype.meterInMercatorCoordinateUnits=function(){return 1/$u*(t=nl(this.y),1/Math.cos(t*Math.PI/180));var t};var al=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=ll(0,t,e,r)};al.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},al.prototype.url=function(t,e){var r,i,n,o,a,s=(r=this.x,i=this.y,n=this.z,o=Ju(256*r,256*(i=Math.pow(2,n)-i-1),n),a=Ju(256*(r+1),256*(i+1),n),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,r){for(var i,n="",o=t;o>0;o--)n+=(e&(i=1<<o-1)?1:0)+(r&i?2:0);return n}(this.z,this.x,this.y);return t[(this.x+this.y)%t.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("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",u).replace("{bbox-epsg-3857}",s)},al.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new n((t.x*e-this.x)*mo,(t.y*e-this.y)*mo)};var sl=function(t,e){this.wrap=t,this.canonical=e,this.key=ll(t,e.z,e.x,e.y)},ul=function(t,e,r,i,n){this.overscaledZ=t,this.wrap=e,this.canonical=new al(r,+i,+n),this.key=ll(e,t,i,n)};function ll(t,e,r,i){(t*=2)<0&&(t=-1*t-1);var n=1<<e;return 32*(n*n*t+n*i+r)+e}function pl(t,e,r){var i=function(i,n){if(i)return r(i);if(n){var o=f(h(n,t),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);n.vector_layers&&(o.vectorLayers=n.vector_layers,o.vectorLayerIds=o.vectorLayers.map((function(t){return t.id}))),t.url&&(o.tiles=e.canonicalizeTileset(o,t.url)),r(null,o)}};return t.url?kt(e.transformRequest(e.normalizeSourceURL(t.url),wt.Source),i):L.frame((function(){return i(null,t)}))}ul.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},ul.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new ul(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ul(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},ul.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},ul.prototype.children=function(t){if(this.overscaledZ>=t)return[new ul(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,i=2*this.canonical.y;return[new ul(e,this.wrap,e,r,i),new ul(e,this.wrap,e,r+1,i),new ul(e,this.wrap,e,r,i+1),new ul(e,this.wrap,e,r+1,i+1)]},ul.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},ul.prototype.wrapped=function(){return new ul(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},ul.prototype.unwrapTo=function(t){return new ul(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},ul.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},ul.prototype.toUnwrapped=function(){return new sl(this.wrap,this.canonical)},ul.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},ul.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new ol(t.x-this.wrap,t.y))},ki("CanonicalTileID",al),ki("OverscaledTileID",ul,{omit:["posMatrix"]});var cl=function(t,e,r){this.bounds=Yu.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=r||24};cl.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},cl.prototype.contains=function(t){var e=Math.pow(2,t.z),r=Math.floor(el(this.bounds.getWest())*e),i=Math.floor(rl(this.bounds.getNorth())*e),n=Math.ceil(el(this.bounds.getEast())*e),o=Math.ceil(rl(this.bounds.getSouth())*e);return t.x>=r&&t.x<n&&t.y>=i&&t.y<o};var hl=function(t){function e(e,r,i,n){if(t.call(this),this.id=e,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,h(this,f(r,["url","scheme","tileSize"])),this._options=h({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){var t=this;this._loaded=!1,this.fire(new Rt("dataloading",{dataType:"source"})),this._tileJSONRequest=pl(this._options,this.map._requestManager,(function(e,r){t._tileJSONRequest=null,t._loaded=!0,e?t.fire(new Ft(e)):r&&(h(t,r),r.bounds&&(t.tileBounds=new cl(r.bounds,t.minzoom,t.maxzoom)),pt(r.tiles,t.map._requestManager._customAccessToken),ht(r.tiles,t.map._getMapId(),t.map._requestManager._skuToken,t.map._requestManager._customAccessToken),t.fire(new Rt("data",{dataType:"source",sourceDataType:"metadata"})),t.fire(new Rt("data",{dataType:"source",sourceDataType:"content"})))}))},e.prototype.loaded=function(){return this._loaded},e.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},e.prototype.onAdd=function(t){this.map=t,this.load()},e.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},e.prototype.serialize=function(){return h({},this._options)},e.prototype.loadTile=function(t,e){var r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.url,null),i={request:this.map._requestManager.transformRequest(r,wt.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:L.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};function n(r,i){return delete t.request,t.aborted?e(null):r&&404!==r.status?e(r):(i&&i.resourceTiming&&(t.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&t.setExpiryData(i),t.loadVectorData(i,this.map.painter),bt(this.dispatcher),e(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}i.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state?"loading"===t.state?t.reloadCallback=e:t.request=t.actor.send("reloadTile",i,n.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",i,n.bind(this)))},e.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)},e.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)},e.prototype.hasTransition=function(){return!1},e}(Ot),fl=function(t){function e(e,r,i,n){t.call(this),this.id=e,this.dispatcher=i,this.setEventedParent(n),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=h({type:"raster"},r),h(this,f(r,["url","scheme","tileSize"]))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){var t=this;this._loaded=!1,this.fire(new Rt("dataloading",{dataType:"source"})),this._tileJSONRequest=pl(this._options,this.map._requestManager,(function(e,r){t._tileJSONRequest=null,t._loaded=!0,e?t.fire(new Ft(e)):r&&(h(t,r),r.bounds&&(t.tileBounds=new cl(r.bounds,t.minzoom,t.maxzoom)),pt(r.tiles),ht(r.tiles,t.map._getMapId(),t.map._requestManager._skuToken),t.fire(new Rt("data",{dataType:"source",sourceDataType:"metadata"})),t.fire(new Rt("data",{dataType:"source",sourceDataType:"content"})))}))},e.prototype.loaded=function(){return this._loaded},e.prototype.onAdd=function(t){this.map=t,this.load()},e.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},e.prototype.serialize=function(){return h({},this._options)},e.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},e.prototype.loadTile=function(t,e){var r=this,i=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);t.request=Dt(this.map._requestManager.transformRequest(i,wt.Tile),(function(i,n){if(delete t.request,t.aborted)t.state="unloaded",e(null);else if(i)t.state="errored",e(i);else if(n){r.map._refreshExpiredTiles&&t.setExpiryData(n),delete n.cacheControl,delete n.expires;var o=r.map.painter.context,a=o.gl;t.texture=r.map.painter.getTileTexture(n.width),t.texture?t.texture.update(n,{useMipmap:!0}):(t.texture=new pu(o,n,a.RGBA,{useMipmap:!0}),t.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),o.extTextureFilterAnisotropic&&a.texParameterf(a.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax)),t.state="loaded",bt(r.dispatcher),e(null)}}))},e.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},e.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},e.prototype.hasTransition=function(){return!1},e}(Ot),dl=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return A('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');var i=this.dim=e.height;this.stride=this.dim+2,this.data=new Int32Array(this.stride*this.stride);for(var n=e.data,o="terrarium"===r?this._unpackTerrarium:this._unpackMapbox,a=0;a<i;a++)for(var s=0;s<i;s++){var u=4*(a*i+s);this.set(s,a,o(n[u],n[u+1],n[u+2]))}for(var l=0;l<i;l++)this.set(-1,l,this.get(0,l)),this.set(i,l,this.get(i-1,l)),this.set(l,-1,this.get(l,0)),this.set(l,i,this.get(l,i-1));this.set(-1,-1,this.get(0,0)),this.set(i,-1,this.get(i-1,0)),this.set(-1,i,this.get(0,i-1)),this.set(i,i,this.get(i-1,i-1))};dl.prototype.set=function(t,e,r){this.data[this._idx(t,e)]=r+65536},dl.prototype.get=function(t,e){return this.data[this._idx(t,e)]-65536},dl.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},dl.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},dl.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},dl.prototype.getPixels=function(){return new ea({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},dl.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var i=e*this.dim,n=e*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:i=n-1;break;case 1:n=i+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-r*this.dim,l=o;l<a;l++)for(var p=i;p<n;p++)this.set(p,l,t.get(p+s,l+u))},ki("DEMData",dl);var ml=function(t){function e(e,r,i,n){t.call(this,e,r,i,n),this.type="raster-dem",this.maxzoom=22,this._options=h({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},e.prototype.loadTile=function(t,e){var r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);function i(r,i){r&&(t.state="errored",e(r)),i&&(t.dem=i,t.needsHillshadePrepare=!0,t.state="loaded",e(null))}t.request=Dt(this.map._requestManager.transformRequest(r,wt.Tile),function(r,n){if(delete t.request,t.aborted)t.state="unloaded",e(null);else if(r)t.state="errored",e(r);else if(n){this.map._refreshExpiredTiles&&t.setExpiryData(n),delete n.cacheControl,delete n.expires;var o=L.getImageData(n),a={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:o,encoding:this.encoding};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",a,i.bind(this)))}}.bind(this)),t.neighboringTiles=this._getNeighboringTiles(t.tileID)},e.prototype._getNeighboringTiles=function(t){var e=t.canonical,r=Math.pow(2,e.z),i=(e.x-1+r)%r,n=0===e.x?t.wrap-1:t.wrap,o=(e.x+1+r)%r,a=e.x+1===r?t.wrap+1:t.wrap,s={};return s[new ul(t.overscaledZ,n,e.z,i,e.y).key]={backfilled:!1},s[new ul(t.overscaledZ,a,e.z,o,e.y).key]={backfilled:!1},e.y>0&&(s[new ul(t.overscaledZ,n,e.z,i,e.y-1).key]={backfilled:!1},s[new ul(t.overscaledZ,t.wrap,e.z,e.x,e.y-1).key]={backfilled:!1},s[new ul(t.overscaledZ,a,e.z,o,e.y-1).key]={backfilled:!1}),e.y+1<r&&(s[new ul(t.overscaledZ,n,e.z,i,e.y+1).key]={backfilled:!1},s[new ul(t.overscaledZ,t.wrap,e.z,e.x,e.y+1).key]={backfilled:!1},s[new ul(t.overscaledZ,a,e.z,o,e.y+1).key]={backfilled:!1}),s},e.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})},e}(fl),yl=function(t){function e(e,r,i,n){t.call(this),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=i.getActor(),this.setEventedParent(n),this._data=r.data,this._options=h({},r),this._collectResourceTiming=r.collectResourceTiming,this._resourceTiming=[],void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution);var o=mo/this.tileSize;this.workerOptions=h({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*o,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*o,extent:mo,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?Math.min(r.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:mo,radius:(r.clusterRadius||50)*o,log:!1},clusterProperties:r.clusterProperties},r.workerOptions)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){var t=this;this.fire(new Rt("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)t.fire(new Ft(e));else{var r={dataType:"source",sourceDataType:"metadata"};t._collectResourceTiming&&t._resourceTiming&&t._resourceTiming.length>0&&(r.resourceTiming=t._resourceTiming,t._resourceTiming=[]),t.fire(new Rt("data",r))}}))},e.prototype.onAdd=function(t){this.map=t,this.load()},e.prototype.setData=function(t){var e=this;return this._data=t,this.fire(new Rt("dataloading",{dataType:"source"})),this._updateWorkerData((function(t){if(t)e.fire(new Ft(t));else{var r={dataType:"source",sourceDataType:"content"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(r.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new Rt("data",r))}})),this},e.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},e.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},e.prototype.getClusterLeaves=function(t,e,r,i){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},i),this},e.prototype._updateWorkerData=function(t){var e=this;this._loaded=!1;var r=h({},this.workerOptions),i=this._data;"string"==typeof i?(r.request=this.map._requestManager.transformRequest(L.resolveURL(i),wt.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(i),this.actor.send(this.type+".loadData",r,(function(i,n){e._removed||n&&n.abandoned||(e._loaded=!0,n&&n.resourceTiming&&n.resourceTiming[e.id]&&(e._resourceTiming=n.resourceTiming[e.id].slice(0)),e.actor.send(e.type+".coalesce",{source:r.source},null),t(i))}))},e.prototype.loaded=function(){return this._loaded},e.prototype.loadTile=function(t,e){var r=this,i=t.actor?"reloadTile":"loadTile";t.actor=this.actor;var n={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:L.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};t.request=this.actor.send(i,n,(function(n,o){return delete t.request,t.unloadVectorData(),t.aborted?e(null):n?e(n):(t.loadVectorData(o,r.map.painter,"reloadTile"===i),e(null))}))},e.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},e.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},e.prototype.serialize=function(){return h({},this._options,{type:this.type,data:this._data})},e.prototype.hasTransition=function(){return!1},e}(Ot),_l=ln([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),vl=function(t){function e(e,r,i,n){t.call(this),this.id=e,this.dispatcher=i,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t,e){var r=this;this._loaded=!1,this.fire(new Rt("dataloading",{dataType:"source"})),this.url=this.options.url,Dt(this.map._requestManager.transformRequest(this.url,wt.Image),(function(i,n){r._loaded=!0,i?r.fire(new Ft(i)):n&&(r.image=n,t&&(r.coordinates=t),e&&e(),r._finishLoading())}))},e.prototype.loaded=function(){return this._loaded},e.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},e.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new Rt("data",{dataType:"source",sourceDataType:"metadata"})))},e.prototype.onAdd=function(t){this.map=t,this.load()},e.prototype.setCoordinates=function(t){var e=this;this.coordinates=t;var r=t.map(ol.fromLngLat);this.tileID=function(t){for(var e=1/0,r=1/0,i=-1/0,n=-1/0,o=0,a=t;o<a.length;o+=1){var s=a[o];e=Math.min(e,s.x),r=Math.min(r,s.y),i=Math.max(i,s.x),n=Math.max(n,s.y)}var u=i-e,l=n-r,p=Math.max(u,l),c=Math.max(0,Math.floor(-Math.log(p)/Math.LN2)),h=Math.pow(2,c);return new al(c,Math.floor((e+i)/2*h),Math.floor((r+n)/2*h))}(r),this.minzoom=this.maxzoom=this.tileID.z;var i=r.map((function(t){return e.tileID.getTilePoint(t)._round()}));return this._boundsArray=new hn,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,mo,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,mo),this._boundsArray.emplaceBack(i[2].x,i[2].y,mo,mo),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new Rt("data",{dataType:"source",sourceDataType:"content"})),this},e.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var t=this.map.painter.context,e=t.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,_l.members)),this.boundsSegments||(this.boundsSegments=Gn.simpleSegment(0,0,4,2)),this.texture||(this.texture=new pu(t,this.image,e.RGBA),this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[r];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},e.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},e.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},e.prototype.hasTransition=function(){return!1},e}(Ot);var gl=function(t){function e(e,r,i,n){t.call(this,e,r,i,n),this.roundZoom=!0,this.type="video",this.options=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){var t=this;this._loaded=!1;var e=this.options;this.urls=[];for(var r=0,i=e.urls;r<i.length;r+=1){var n=i[r];this.urls.push(this.map._requestManager.transformRequest(n,wt.Source).url)}!function(t,e){var r,i,n=self.document.createElement("video");n.muted=!0,n.onloadstart=function(){e(null,n)};for(var o=0;o<t.length;o++){var a=self.document.createElement("source");r=t[o],i=void 0,(i=self.document.createElement("a")).href=r,(i.protocol!==self.document.location.protocol||i.host!==self.document.location.host)&&(n.crossOrigin="Anonymous"),a.src=t[o],n.appendChild(a)}}(this.urls,(function(e,r){t._loaded=!0,e?t.fire(new Ft(e)):r&&(t.video=r,t.video.loop=!0,t.video.addEventListener("playing",(function(){t.map.triggerRepaint()})),t.map&&t.video.play(),t._finishLoading())}))},e.prototype.pause=function(){this.video&&this.video.pause()},e.prototype.play=function(){this.video&&this.video.play()},e.prototype.seek=function(t){if(this.video){var e=this.video.seekable;t<e.start(0)||t>e.end(0)?this.fire(new Ft(new Ut("Playback for this video can be set only between the "+e.start(0)+" and "+e.end(0)+"-second mark."))):this.video.currentTime=t}},e.prototype.getVideo=function(){return this.video},e.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},e.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var t=this.map.painter.context,e=t.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,_l.members)),this.boundsSegments||(this.boundsSegments=Gn.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE),e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,this.video)):(this.texture=new pu(t,this.video,e.RGBA),this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[r];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},e.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},e.prototype.hasTransition=function(){return this.video&&!this.video.paused},e}(vl),xl=function(t){function e(e,r,i,n){t.call(this,e,r,i,n),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new Ft(new Ut("sources."+e,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new Ft(new Ut("sources."+e,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new Ft(new Ut("sources."+e,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof self.HTMLCanvasElement||this.fire(new Ft(new Ut("sources."+e,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new Ft(new Ut("sources."+e,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof self.HTMLCanvasElement?this.options.canvas:self.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new Ft(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())},e.prototype.getCanvas=function(){return this.canvas},e.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},e.prototype.onRemove=function(){this.pause()},e.prototype.prepare=function(){var t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var e=this.map.painter.context,r=e.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,_l.members)),this.boundsSegments||(this.boundsSegments=Gn.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new pu(e,this.canvas,r.RGBA,{premultiply:!0}),this.tiles){var n=this.tiles[i];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}},e.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},e.prototype.hasTransition=function(){return this._playing},e.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var r=e[t];if(isNaN(r)||r<=0)return!0}return!1},e}(vl),bl={vector:hl,raster:fl,"raster-dem":ml,geojson:yl,video:gl,image:vl,canvas:xl},wl=function(t,e,r,i){var n=new bl[e.type](t,e,r,i);if(n.id!==t)throw new Error("Expected Source id to be "+t+" instead of "+n.id);return v(["load","abort","unload","serialize","prepare"],n),n};function Sl(t,e){var r=Vo([]);return No(r,r,[1,1,0]),jo(r,r,[.5*t.width,.5*t.height,1]),Uo(r,r,t.calculatePosMatrix(e.toUnwrapped()))}function Al(t,e,r,i,n){var o=function(t,e,r){if(t)for(var i=0,n=t;i<n.length;i+=1){var o=e[n[i]];if(o&&o.source===r&&"fill-extrusion"===o.type)return!0}else for(var a in e){var s=e[a];if(s.source===r&&"fill-extrusion"===s.type)return!0}return!1}(i&&i.layers,e,t.id),a=n.maxPitchScaleFactor(),s=t.tilesIn(r,a,o);s.sort(Tl);for(var u=[],l=0,p=s;l<p.length;l+=1){var c=p[l];u.push({wrappedTileID:c.tileID.wrapped().key,queryResults:c.tile.queryRenderedFeatures(e,t._state,c.queryGeometry,c.cameraQueryGeometry,c.scale,i,n,a,Sl(t.transform,c.tileID))})}var h=function(t){for(var e={},r={},i=0,n=t;i<n.length;i+=1){var o=n[i],a=o.queryResults,s=o.wrappedTileID,u=r[s]=r[s]||{};for(var l in a)for(var p=a[l],c=u[l]=u[l]||{},h=e[l]=e[l]||[],f=0,d=p;f<d.length;f+=1){var m=d[f];c[m.featureIndex]||(c[m.featureIndex]=!0,h.push(m))}}return e}(u);for(var f in h)h[f].forEach((function(e){var r=e.feature,i=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=i}));return h}function Tl(t,e){var r=t.tileID,i=e.tileID;return r.overscaledZ-i.overscaledZ||r.canonical.y-i.canonical.y||r.wrap-i.wrap||r.canonical.x-i.canonical.x}var Il=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}};Il.prototype.encode=function(t){return this._stringToNumber[t]},Il.prototype.decode=function(t){return this._numberToString[t]};var zl=function(t,e,r,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=i,this.properties=t.properties,null!=t.id&&(this.id=t.id)},kl={geometry:{configurable:!0}};kl.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},kl.geometry.set=function(t){this._geometry=t},zl.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(zl.prototype,kl);var El=function(){this.state={},this.stateChanges={},this.deletedStates={}};El.prototype.updateState=function(t,e,r){var i=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][i]=this.stateChanges[t][i]||{},h(this.stateChanges[t][i],r),null===this.deletedStates[t])for(var n in this.deletedStates[t]={},this.state[t])n!==i&&(this.deletedStates[t][n]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][i])for(var o in this.deletedStates[t][i]={},this.state[t][i])r[o]||(this.deletedStates[t][i][o]=null);else for(var a in r){this.deletedStates[t]&&this.deletedStates[t][i]&&null===this.deletedStates[t][i][a]&&delete this.deletedStates[t][i][a]}},El.prototype.removeFeatureState=function(t,e,r){if(!(null===this.deletedStates[t])){var i=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e&&e>=0)null!==this.deletedStates[t][i]&&(this.deletedStates[t][i]=this.deletedStates[t][i]||{},this.deletedStates[t][i][r]=null);else if(void 0!==e&&e>=0){if(this.stateChanges[t]&&this.stateChanges[t][i])for(r in this.deletedStates[t][i]={},this.stateChanges[t][i])this.deletedStates[t][i][r]=null;else this.deletedStates[t][i]=null}else this.deletedStates[t]=null}},El.prototype.getState=function(t,e){var r=String(e),i=this.state[t]||{},n=this.stateChanges[t]||{},o=h({},i[r],n[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var a=this.deletedStates[t][e];if(null===a)return{};for(var s in a)delete o[s]}return o},El.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},El.prototype.coalesceChanges=function(t,e){var r={};for(var i in this.stateChanges){this.state[i]=this.state[i]||{};var n={};for(var o in this.stateChanges[i])this.state[i][o]||(this.state[i][o]={}),h(this.state[i][o],this.stateChanges[i][o]),n[o]=this.state[i][o];r[i]=n}for(var a in this.deletedStates){this.state[a]=this.state[a]||{};var s={};if(null===this.deletedStates[a])for(var u in this.state[a])s[u]={},this.state[a][u]={};else for(var l in this.deletedStates[a]){if(null===this.deletedStates[a][l])this.state[a][l]={};else for(var p=0,c=Object.keys(this.deletedStates[a][l]);p<c.length;p+=1){var f=c[p];delete this.state[a][l][f]}s[l]=this.state[a][l]}r[a]=r[a]||{},h(r[a],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(var d in t){t[d].setFeatureState(r,e)}};var Cl=function(t,e,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=e||new Si(mo,16,0),this.grid3D=new Si(mo,16,0),this.featureIndexArray=r||new qn};function Pl(t){for(var e=1/0,r=1/0,i=-1/0,n=-1/0,o=0,a=t;o<a.length;o+=1){var s=a[o];e=Math.min(e,s.x),r=Math.min(r,s.y),i=Math.max(i,s.x),n=Math.max(n,s.y)}return{minX:e,minY:r,maxX:i,maxY:n}}function Ml(t,e){return e-t}Cl.prototype.insert=function(t,e,r,i,n,o){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);for(var s=o?this.grid3D:this.grid,u=0;u<e.length;u++){for(var l=e[u],p=[1/0,1/0,-1/0,-1/0],c=0;c<l.length;c++){var h=l[c];p[0]=Math.min(p[0],h.x),p[1]=Math.min(p[1],h.y),p[2]=Math.max(p[2],h.x),p[3]=Math.max(p[3],h.y)}p[0]<mo&&p[1]<mo&&p[2]>=0&&p[3]>=0&&s.insert(a,p[0],p[1],p[2],p[3])}},Cl.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new rs.VectorTile(new mu(this.rawTileData)).layers,this.sourceLayerCoder=new Il(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Cl.prototype.query=function(t,e,r){var i=this;this.loadVTLayers();for(var o=t.params||{},a=mo/t.tileSize/t.scale,s=Yr(o.filter),u=t.queryGeometry,l=t.queryPadding*a,p=Pl(u),c=this.grid.query(p.minX-l,p.minY-l,p.maxX+l,p.maxY+l),h=Pl(t.cameraQueryGeometry),f=this.grid3D.query(h.minX-l,h.minY-l,h.maxX+l,h.maxY+l,(function(e,r,i,o){return function(t,e,r,i,o){for(var a=0,s=t;a<s.length;a+=1){var u=s[a];if(e<=u.x&&r<=u.y&&i>=u.x&&o>=u.y)return!0}var l=[new n(e,r),new n(e,o),new n(i,o),new n(i,r)];if(t.length>2)for(var p=0,c=l;p<c.length;p+=1){if(Co(t,c[p]))return!0}for(var h=0;h<t.length-1;h++){if(Po(t[h],t[h+1],l))return!0}return!1}(t.cameraQueryGeometry,e-l,r-l,i+l,o+l)})),d=0,m=f;d<m.length;d+=1){var y=m[d];c.push(y)}c.sort(Ml);for(var _,v={},g=function(n){var l=c[n];if(l!==_){_=l;var p=i.featureIndexArray.get(l),h=null;i.loadMatchingFeature(v,p.bucketIndex,p.sourceLayerIndex,p.featureIndex,s,o.layers,e,(function(e,n){h||(h=vo(e));var o={};return e.id&&(o=r.getState(n.sourceLayer||"_geojsonTileLayer",e.id)),n.queryIntersectsFeature(u,e,o,h,i.z,t.transform,a,t.pixelPosMatrix)}))}},x=0;x<c.length;x++)g(x);return v},Cl.prototype.loadMatchingFeature=function(t,e,r,i,n,o,a,s){var u=this.bucketLayerIDs[e];if(!o||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}(o,u)){var l=this.sourceLayerCoder.decode(r),p=this.vtLayers[l].feature(i);if(n(new qi(this.tileID.overscaledZ),p))for(var c=0;c<u.length;c++){var h=u[c];if(!(o&&o.indexOf(h)<0)){var f=a[h];if(f){var d=!s||s(p,f);if(d){var m=new zl(p,this.z,this.x,this.y);m.layer=f.serialize();var y=t[h];void 0===y&&(y=t[h]=[]),y.push({featureIndex:i,feature:m,intersectionZ:d})}}}}}},Cl.prototype.lookupSymbolFeatures=function(t,e,r,i,n,o){var a={};this.loadVTLayers();for(var s=Yr(i),u=0,l=t;u<l.length;u+=1){var p=l[u];this.loadMatchingFeature(a,e,r,p,s,n,o)}return a},Cl.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var i=0,n=r[e];i<n.length;i+=1){if(t===n[i])return!0}return!1},ki("FeatureIndex",Cl,{omit:["rawTileData","sourceLayerCoder"]});var Dl=function(t,e){this.tileID=t,this.uid=m(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.expiredRequestCount=0,this.state="loading"};Dl.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<L.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},Dl.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},Dl.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var i in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var i=function(){var t=o[n],i=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==i.length){t.layers=i,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return i.filter((function(e){return e.id===t}))[0]})));for(var a=0,s=i;a<s.length;a+=1){var u=s[a];r[u.id]=t}}},n=0,o=t;n<o.length;n+=1)i();return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var n=this.buckets[i];if(n instanceof Zs){if(this.hasSymbolBuckets=!0,!r)break;n.justReloaded=!0}}for(var o in this.queryPadding=0,this.buckets){var a=this.buckets[o];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(o).queryRadius(a))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Dn},Dl.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},Dl.prototype.unloadDEMData=function(){this.dem=null,this.neighboringTiles=null,this.state="unloaded"},Dl.prototype.getBucket=function(t){return this.buckets[t.id]},Dl.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t)}var i=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new pu(t,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new pu(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null)},Dl.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},Dl.prototype.queryRenderedFeatures=function(t,e,r,i,n,o,a,s,u){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:i,scale:n,tileSize:this.tileSize,pixelPosMatrix:u,transform:a,params:o,queryPadding:this.queryPadding*s},t,e):{}},Dl.prototype.querySourceFeatures=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData){var r=this.latestFeatureIndex.loadVTLayers(),i=e?e.sourceLayer:"",n=r._geojsonTileLayer||r[i];if(n)for(var o=Yr(e&&e.filter),a=this.tileID.canonical,s=a.z,u=a.x,l=a.y,p={z:s,x:u,y:l},c=0;c<n.length;c++){var h=n.feature(c);if(o(new qi(this.tileID.overscaledZ),h)){var f=new zl(h,s,u,l);f.tile=p,t.push(f)}}}},Dl.prototype.clearMask=function(){this.segments&&(this.segments.destroy(),delete this.segments),this.maskedBoundsBuffer&&(this.maskedBoundsBuffer.destroy(),delete this.maskedBoundsBuffer),this.maskedIndexBuffer&&(this.maskedIndexBuffer.destroy(),delete this.maskedIndexBuffer)},Dl.prototype.setMask=function(t,e){if(!a(this.mask,t)&&(this.mask=t,this.clearMask(),!a(t,{0:!0}))){var r=new hn,i=new zn;this.segments=new Gn,this.segments.prepareSegment(0,r,i);for(var o=Object.keys(t),s=0;s<o.length;s++){var u=t[+o[s]],l=mo>>u.z,p=new n(u.x*l,u.y*l),c=new n(p.x+l,p.y+l),h=this.segments.prepareSegment(4,r,i);r.emplaceBack(p.x,p.y,p.x,p.y),r.emplaceBack(c.x,p.y,c.x,p.y),r.emplaceBack(p.x,c.y,p.x,c.y),r.emplaceBack(c.x,c.y,c.x,c.y);var f=h.vertexLength;i.emplaceBack(f,f+1,f+2),i.emplaceBack(f+1,f+2,f+3),h.vertexLength+=4,h.primitiveLength+=2}this.maskedBoundsBuffer=e.createVertexBuffer(r,_l.members),this.maskedIndexBuffer=e.createIndexBuffer(i)}},Dl.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},Dl.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Dl.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=z(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var i=Date.now(),n=!1;if(this.expirationTime>i)n=!1;else if(e)if(this.expirationTime<e)n=!0;else{var o=this.expirationTime-e;o?this.expirationTime=i+Math.max(o,3e4):n=!0}else n=!0;n?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Dl.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)},Dl.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r=this.latestFeatureIndex.loadVTLayers();for(var i in this.buckets){var n=this.buckets[i],o=n.layers[0].sourceLayer||"_geojsonTileLayer",a=r[o],s=t[o];a&&s&&0!==Object.keys(s).length&&(n.update(s,a,this.imageAtlas&&this.imageAtlas.patternPositions||{}),e&&e.style&&(this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(i).queryRadius(n))))}}},Dl.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},Dl.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<L.now()},Dl.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Dl.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=L.now()+t};var Ll=function(t,e){this.max=t,this.onRemove=e,this.reset()};Ll.prototype.reset=function(){for(var t in this.data)for(var e=0,r=this.data[t];e<r.length;e+=1){var i=r[e];i.timeout&&clearTimeout(i.timeout),this.onRemove(i.value)}return this.data={},this.order=[],this},Ll.prototype.add=function(t,e,r){var i=this,n=t.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);var o={value:e,timeout:void 0};if(void 0!==r&&(o.timeout=setTimeout((function(){i.remove(t,o)}),r)),this.data[n].push(o),this.order.push(n),this.order.length>this.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},Ll.prototype.has=function(t){return t.wrapped().key in this.data},Ll.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},Ll.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},Ll.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},Ll.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,i=void 0===e?0:this.data[r].indexOf(e),n=this.data[r][i];return this.data[r].splice(i,1),n.timeout&&clearTimeout(n.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(n.value),this.order.splice(this.order.indexOf(r),1),this},Ll.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this};var Bl=function(t,e,r){this.context=t;var i=t.gl;this.buffer=i.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};Bl.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Bl.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},Bl.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var Rl={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Fl=function(t,e,r,i){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=i,this.context=t;var n=t.gl;this.buffer=n.createBuffer(),t.bindVertexBuffer.set(this.buffer),n.bufferData(n.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};Fl.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Fl.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},Fl.prototype.enableAttributes=function(t,e){for(var r=0;r<this.attributes.length;r++){var i=this.attributes[r],n=e.attributes[i.name];void 0!==n&&t.enableVertexAttribArray(n)}},Fl.prototype.setVertexAttribPointers=function(t,e,r){for(var i=0;i<this.attributes.length;i++){var n=this.attributes[i],o=e.attributes[n.name];void 0!==o&&t.vertexAttribPointer(o,n.components,t[Rl[n.type]],!1,this.itemSize,n.offset+this.itemSize*(r||0))}},Fl.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var Ol=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};Ol.prototype.get=function(){return this.current},Ol.prototype.set=function(t){},Ol.prototype.getDefault=function(){return this.default},Ol.prototype.setDefault=function(){this.set(this.default)};var Vl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return ue.transparent},e.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},e}(Ol),Ul=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 1},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},e}(Ol),Nl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},e}(Ol),jl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return[!0,!0,!0,!0]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(Ol),ql=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)},e}(Ol),Zl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},e}(Ol),Gl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},e.prototype.set=function(t){var e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},e}(Ol),Wl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},e}(Ol),Kl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}},e}(Ol),Hl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return[0,1]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},e}(Ol),Xl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}},e}(Ol),Jl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.LESS},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},e}(Ol),Yl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}},e}(Ol),Ql=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},e}(Ol),$l=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return ue.transparent},e.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},e}(Ol),tp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.FUNC_ADD},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},e}(Ol),ep=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},e}(Ol),rp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.BACK},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)},e}(Ol),ip=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)},e}(Ol),np=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)},e}(Ol),op=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.TEXTURE0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},e}(Ol),ap=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(Ol),sp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},e}(Ol),up=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(Ol),lp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},e}(Ol),pp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},e}(Ol),cp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},e}(Ol),hp=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},e}(Ol),fp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 4},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},e}(Ol),dp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},e}(Ol),mp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},e}(Ol),yp=function(t){function e(e,r){t.call(this,e),this.context=e,this.parent=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e}(Ol),_p=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setDirty=function(){this.dirty=!0},e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e}(yp),vp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(yp),gp=function(t,e,r){this.context=t,this.width=e,this.height=r;var i=t.gl,n=this.framebuffer=i.createFramebuffer();this.colorAttachment=new _p(t,n),this.depthAttachment=new vp(t,n)};gp.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();e&&t.deleteTexture(e);var r=this.depthAttachment.get();r&&t.deleteRenderbuffer(r),t.deleteFramebuffer(this.framebuffer)};var xp=function(t,e,r){this.func=t,this.mask=e,this.range=r};xp.ReadOnly=!1,xp.ReadWrite=!0,xp.disabled=new xp(519,xp.ReadOnly,[0,1]);var bp=function(t,e,r,i,n,o){this.test=t,this.ref=e,this.mask=r,this.fail=i,this.depthFail=n,this.pass=o};bp.disabled=new bp({func:519,mask:0},0,0,7680,7680,7680);var wp=function(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r};wp.Replace=[1,0],wp.disabled=new wp(wp.Replace,ue.transparent,[!1,!1,!1,!1]),wp.unblended=new wp(wp.Replace,ue.transparent,[!0,!0,!0,!0]),wp.alphaBlended=new wp([1,771],ue.transparent,[!0,!0,!0,!0]);var Sp=function(t,e,r){this.enable=t,this.mode=e,this.frontFace=r};Sp.disabled=new Sp(!1,1029,2305),Sp.backCCW=new Sp(!0,1029,2305);var Ap=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new Vl(this),this.clearDepth=new Ul(this),this.clearStencil=new Nl(this),this.colorMask=new jl(this),this.depthMask=new ql(this),this.stencilMask=new Zl(this),this.stencilFunc=new Gl(this),this.stencilOp=new Wl(this),this.stencilTest=new Kl(this),this.depthRange=new Hl(this),this.depthTest=new Xl(this),this.depthFunc=new Jl(this),this.blend=new Yl(this),this.blendFunc=new Ql(this),this.blendColor=new $l(this),this.blendEquation=new tp(this),this.cullFace=new ep(this),this.cullFaceSide=new rp(this),this.frontFace=new ip(this),this.program=new np(this),this.activeTexture=new op(this),this.viewport=new ap(this),this.bindFramebuffer=new sp(this),this.bindRenderbuffer=new up(this),this.bindTexture=new lp(this),this.bindVertexBuffer=new pp(this),this.bindElementBuffer=new cp(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new hp(this),this.pixelStoreUnpack=new fp(this),this.pixelStoreUnpackPremultiplyAlpha=new dp(this),this.pixelStoreUnpackFlipY=new mp(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&t.getExtension("OES_texture_half_float_linear")};Ap.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()},Ap.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},Ap.prototype.createIndexBuffer=function(t,e){return new Bl(this,t,e)},Ap.prototype.createVertexBuffer=function(t,e,r){return new Fl(this,t,e,r)},Ap.prototype.createRenderbuffer=function(t,e,r){var i=this.gl,n=i.createRenderbuffer();return this.bindRenderbuffer.set(n),i.renderbufferStorage(i.RENDERBUFFER,t,e,r),this.bindRenderbuffer.set(null),n},Ap.prototype.createFramebuffer=function(t,e){return new gp(this,t,e)},Ap.prototype.clear=function(t){var e=t.color,r=t.depth,i=this.gl,n=0;e&&(n|=i.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(n|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),i.clear(n)},Ap.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},Ap.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},Ap.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},Ap.prototype.setColorMode=function(t){a(t.blendFunction,wp.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)},Ap.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Tp=function(t){function e(e,r,i){var n=this;t.call(this),this.id=e,this.dispatcher=i,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(n._sourceLoaded=!0),n._sourceLoaded&&!n._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(n.reload(),n.transform&&n.update(n.transform))})),this.on("error",(function(){n._sourceErrored=!0})),this._source=wl(e,r,i,this),this._tiles={},this._cache=new Ll(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._coveredTiles={},this._state=new El}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},e.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},e.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},e.prototype.getSource=function(){return this._source},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},e.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},e.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},e.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},e.prototype.serialize=function(){return this._source.serialize()},e.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}},e.prototype.getIds=function(){return Object.keys(this._tiles).map(Number).sort(Ip)},e.prototype.getRenderableIds=function(t){var e=this,r=[];for(var i in this._tiles)this._isIdRenderable(+i,t)&&r.push(+i);return t?r.sort((function(t,r){var i=e._tiles[t].tileID,o=e._tiles[r].tileID,a=new n(i.canonical.x,i.canonical.y)._rotate(e.transform.angle),s=new n(o.canonical.x,o.canonical.y)._rotate(e.transform.angle);return i.overscaledZ-o.overscaledZ||s.y-a.y||s.x-a.x})):r.sort(Ip)},e.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},e.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},e.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},e.prototype._reloadTile=function(t,e){var r=this._tiles[t];r&&("loading"!==r.state&&(r.state=e),this._loadTile(r,this._tileLoaded.bind(this,r,t,e)))},e.prototype._tileLoaded=function(t,e,r,i){if(i)return t.state="errored",void(404!==i.status?this._source.fire(new Ft(i,{tile:t})):this.update(this.transform));t.timeAdded=L.now(),"expired"===r&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(e,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new Rt("data",{dataType:"source",tile:t,coord:t.tileID}))},e.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),r=0;r<e.length;r++){var i=e[r];if(t.neighboringTiles&&t.neighboringTiles[i]){var n=this.getTileByID(i);o(t,n),o(n,t)}}function o(t,e){t.needsHillshadePrepare=!0;var r=e.tileID.canonical.x-t.tileID.canonical.x,i=e.tileID.canonical.y-t.tileID.canonical.y,n=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===r&&0===i||Math.abs(i)>1||(Math.abs(r)>1&&(1===Math.abs(r+n)?r+=n:1===Math.abs(r-n)&&(r-=n)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,i),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},e.prototype.getTile=function(t){return this.getTileByID(t.key)},e.prototype.getTileByID=function(t){return this._tiles[t]},e.prototype.getZoom=function(t){return t.zoom+t.scaleZoom(t.tileSize/this._source.tileSize)},e.prototype._retainLoadedChildren=function(t,e,r,i){for(var n in this._tiles){var o=this._tiles[n];if(!(i[n]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>r)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var u=a;u.overscaledZ>e;)if(t[(u=u.scaledTo(u.overscaledZ-1)).key]){i[a.key]=a;break}}}},e.prototype.findLoadedParent=function(t,e){for(var r=t.overscaledZ-1;r>=e;r--){var i=t.scaledTo(r);if(!i)return;var n=String(i.key),o=this._tiles[n];if(o&&o.hasData())return o;if(this._cache.has(i))return this._cache.get(i)}},e.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),i="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(i)},e.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var i={};for(var n in this._tiles){var o=this._tiles[n];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+r),i[o.tileID.key]=o}for(var a in this._tiles=i,this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(var s in this._tiles){var u=this._tiles[s];this._setTileReloadTimer(s,u)}}},e.prototype.update=function(t){var r=this;if(this.transform=t,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(t){return new ul(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)})):(i=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return r._source.hasTile(t)})))):i=[];var n=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(t)),o=Math.max(n-e.maxOverzooming,this._source.minzoom),a=Math.max(n+e.maxUnderzooming,this._source.minzoom),s=this._updateRetainedTiles(i,n);if(zp(this._source.type)){for(var u={},l={},p=0,c=Object.keys(s);p<c.length;p+=1){var h=c[p],f=s[h],d=this._tiles[h];if(d&&!(d.fadeEndTime&&d.fadeEndTime<=L.now())){var m=this.findLoadedParent(f,o);m&&(this._addTile(m.tileID),u[m.tileID.key]=m.tileID),l[h]=f}}for(var y in this._retainLoadedChildren(l,n,a,s),u)s[y]||(this._coveredTiles[y]=!0,s[y]=u[y])}for(var _ in s)this._tiles[_].clearFadeHold();for(var v=0,g=function(t,e){var r=[];for(var i in t)i in e||r.push(i);return r}(this._tiles,s);v<g.length;v+=1){var x=g[v],b=this._tiles[x];b.hasSymbolBuckets&&!b.holdingForFade()?b.setHoldDuration(this.map._fadeDuration):b.hasSymbolBuckets&&!b.symbolFadeFinished()||this._removeTile(x)}}},e.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},e.prototype._updateRetainedTiles=function(t,r){for(var i={},n={},o=Math.max(r-e.maxOverzooming,this._source.minzoom),a=Math.max(r+e.maxUnderzooming,this._source.minzoom),s={},u=0,l=t;u<l.length;u+=1){var p=l[u],c=this._addTile(p);i[p.key]=p,c.hasData()||r<this._source.maxzoom&&(s[p.key]=p)}this._retainLoadedChildren(s,r,a,i);for(var h=0,f=t;h<f.length;h+=1){var d=f[h],m=this._tiles[d.key];if(!m.hasData()){if(r+1>this._source.maxzoom){var y=d.children(this._source.maxzoom)[0],_=this.getTile(y);if(_&&_.hasData()){i[y.key]=y;continue}}else{var v=d.children(this._source.maxzoom);if(i[v[0].key]&&i[v[1].key]&&i[v[2].key]&&i[v[3].key])continue}for(var g=m.wasRequested(),x=d.overscaledZ-1;x>=o;--x){var b=d.scaledTo(x);if(n[b.key])break;if(n[b.key]=!0,!(m=this.getTile(b))&&g&&(m=this._addTile(b)),m&&(i[b.key]=b,g=m.wasRequested(),m.hasData()))break}}}return i},e.prototype._addTile=function(t){var e=this._tiles[t.key];if(e)return e;(e=this._cache.getAndRemove(t))&&(this._setTileReloadTimer(t.key,e),e.tileID=t,this._state.initializeTileState(e,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,e)));var r=Boolean(e);return r||(e=new Dl(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(e,this._tileLoaded.bind(this,e,t.key,e.state))),e?(e.uses++,this._tiles[t.key]=e,r||this._source.fire(new Rt("dataloading",{tile:e,coord:e.tileID,dataType:"source"})),e):null},e.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout((function(){r._reloadTile(t,"expired"),delete r._timers[t]}),i))},e.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},e.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},e.prototype.tilesIn=function(t,e,r){var i=this,n=[],o=this.transform;if(!o)return n;for(var a=r?o.getCameraQueryGeometry(t):t,s=t.map((function(t){return o.pointCoordinate(t)})),u=a.map((function(t){return o.pointCoordinate(t)})),l=this.getIds(),p=1/0,c=1/0,h=-1/0,f=-1/0,d=0,m=u;d<m.length;d+=1){var y=m[d];p=Math.min(p,y.x),c=Math.min(c,y.y),h=Math.max(h,y.x),f=Math.max(f,y.y)}for(var _=function(t){var r=i._tiles[l[t]];if(!r.holdingForFade()){var a=r.tileID,d=Math.pow(2,o.zoom-r.tileID.overscaledZ),m=e*r.queryPadding*mo/r.tileSize/d,y=[a.getTilePoint(new ol(p,c)),a.getTilePoint(new ol(h,f))];if(y[0].x-m<mo&&y[0].y-m<mo&&y[1].x+m>=0&&y[1].y+m>=0){var _=s.map((function(t){return a.getTilePoint(t)})),v=u.map((function(t){return a.getTilePoint(t)}));n.push({tile:r,tileID:a,queryGeometry:_,cameraQueryGeometry:v,scale:d})}}},v=0;v<l.length;v++)_(v);return n},e.prototype.getVisibleCoordinates=function(t){for(var e=this,r=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),i=0,n=r;i<n.length;i+=1){var o=n[i];o.posMatrix=this.transform.calculatePosMatrix(o.toUnwrapped())}return r},e.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(zp(this._source.type))for(var t in this._tiles){var e=this._tiles[t];if(void 0!==e.fadeEndTime&&e.fadeEndTime>=L.now())return!0}return!1},e.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r)},e.prototype.removeFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,r)},e.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},e}(Ot);function Ip(t,e){return t%32-e%32||e-t}function zp(t){return"raster"===t||"image"===t||"video"===t}function kp(){return new self.Worker(id.workerUrl)}Tp.maxOverzooming=10,Tp.maxUnderzooming=3;var Ep=function(){this.active={}};Ep.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Ep.workerCount;)this.workers.push(new kp);return this.active[t]=!0,this.workers.slice()},Ep.prototype.release=function(t){delete this.active[t],0===Object.keys(this.active).length&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)};var Cp,Pp=Math.floor(L.hardwareConcurrency/2);Ep.workerCount=Math.max(Math.min(Pp,6),1);var Mp=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Dp(t,e){var r={};for(var i in t)"ref"!==i&&(r[i]=t[i]);return Mp.forEach((function(t){t in e&&(r[t]=e[t])})),r}function Lp(t){t=t.slice();for(var e=Object.create(null),r=0;r<t.length;r++)e[t[r].id]=t[r];for(var i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=Dp(t[i],e[t[i].ref]));return t}var Bp={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 Rp(t,e,r){r.push({command:Bp.addSource,args:[t,e[t]]})}function Fp(t,e,r){e.push({command:Bp.removeSource,args:[t]}),r[t]=!0}function Op(t,e,r,i){Fp(t,r,i),Rp(t,e,r)}function Vp(t,e,r){var i;for(i in t[r])if(t[r].hasOwnProperty(i)&&"data"!==i&&!a(t[r][i],e[r][i]))return!1;for(i in e[r])if(e[r].hasOwnProperty(i)&&"data"!==i&&!a(t[r][i],e[r][i]))return!1;return!0}function Up(t,e,r,i,n,o){var s;for(s in e=e||{},t=t||{})t.hasOwnProperty(s)&&(a(t[s],e[s])||r.push({command:o,args:[i,s,e[s],n]}));for(s in e)e.hasOwnProperty(s)&&!t.hasOwnProperty(s)&&(a(t[s],e[s])||r.push({command:o,args:[i,s,e[s],n]}))}function Np(t){return t.id}function jp(t,e){return t[e.id]=e,t}function qp(t,e){if(!t)return[{command:Bp.setStyle,args:[e]}];var r=[];try{if(!a(t.version,e.version))return[{command:Bp.setStyle,args:[e]}];a(t.center,e.center)||r.push({command:Bp.setCenter,args:[e.center]}),a(t.zoom,e.zoom)||r.push({command:Bp.setZoom,args:[e.zoom]}),a(t.bearing,e.bearing)||r.push({command:Bp.setBearing,args:[e.bearing]}),a(t.pitch,e.pitch)||r.push({command:Bp.setPitch,args:[e.pitch]}),a(t.sprite,e.sprite)||r.push({command:Bp.setSprite,args:[e.sprite]}),a(t.glyphs,e.glyphs)||r.push({command:Bp.setGlyphs,args:[e.glyphs]}),a(t.transition,e.transition)||r.push({command:Bp.setTransition,args:[e.transition]}),a(t.light,e.light)||r.push({command:Bp.setLight,args:[e.light]});var i={},n=[];!function(t,e,r,i){var n;for(n in e=e||{},t=t||{})t.hasOwnProperty(n)&&(e.hasOwnProperty(n)||Fp(n,r,i));for(n in e)e.hasOwnProperty(n)&&(t.hasOwnProperty(n)?a(t[n],e[n])||("geojson"===t[n].type&&"geojson"===e[n].type&&Vp(t,e,n)?r.push({command:Bp.setGeoJSONSourceData,args:[n,e[n].data]}):Op(n,e,r,i)):Rp(n,e,r))}(t.sources,e.sources,n,i);var o=[];t.layers&&t.layers.forEach((function(t){i[t.source]?r.push({command:Bp.removeLayer,args:[t.id]}):o.push(t)})),r=r.concat(n),function(t,e,r){e=e||[];var i,n,o,s,u,l,p,c=(t=t||[]).map(Np),h=e.map(Np),f=t.reduce(jp,{}),d=e.reduce(jp,{}),m=c.slice(),y=Object.create(null);for(i=0,n=0;i<c.length;i++)o=c[i],d.hasOwnProperty(o)?n++:(r.push({command:Bp.removeLayer,args:[o]}),m.splice(m.indexOf(o,n),1));for(i=0,n=0;i<h.length;i++)o=h[h.length-1-i],m[m.length-1-i]!==o&&(f.hasOwnProperty(o)?(r.push({command:Bp.removeLayer,args:[o]}),m.splice(m.lastIndexOf(o,m.length-n),1)):n++,l=m[m.length-i],r.push({command:Bp.addLayer,args:[d[o],l]}),m.splice(m.length-i,0,o),y[o]=!0);for(i=0;i<h.length;i++)if(s=f[o=h[i]],u=d[o],!y[o]&&!a(s,u))if(a(s.source,u.source)&&a(s["source-layer"],u["source-layer"])&&a(s.type,u.type)){for(p in Up(s.layout,u.layout,r,o,null,Bp.setLayoutProperty),Up(s.paint,u.paint,r,o,null,Bp.setPaintProperty),a(s.filter,u.filter)||r.push({command:Bp.setFilter,args:[o,u.filter]}),a(s.minzoom,u.minzoom)&&a(s.maxzoom,u.maxzoom)||r.push({command:Bp.setLayerZoomRange,args:[o,u.minzoom,u.maxzoom]}),s)s.hasOwnProperty(p)&&"layout"!==p&&"paint"!==p&&"filter"!==p&&"metadata"!==p&&"minzoom"!==p&&"maxzoom"!==p&&(0===p.indexOf("paint.")?Up(s[p],u[p],r,o,p.slice(6),Bp.setPaintProperty):a(s[p],u[p])||r.push({command:Bp.setLayerProperty,args:[o,p,u[p]]}));for(p in u)u.hasOwnProperty(p)&&!s.hasOwnProperty(p)&&"layout"!==p&&"paint"!==p&&"filter"!==p&&"metadata"!==p&&"minzoom"!==p&&"maxzoom"!==p&&(0===p.indexOf("paint.")?Up(s[p],u[p],r,o,p.slice(6),Bp.setPaintProperty):a(s[p],u[p])||r.push({command:Bp.setLayerProperty,args:[o,p,u[p]]}))}else r.push({command:Bp.removeLayer,args:[o]}),l=m[m.lastIndexOf(o)+1],r.push({command:Bp.addLayer,args:[u,l]})}(o,e.layers,r)}catch(t){console.warn("Unable to compute style diff:",t),r=[{command:Bp.setStyle,args:[e]}]}return r}var Zp=function(t,e,r){var i=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var o=0;o<this.xCellCount*this.yCellCount;o++)i.push([]),n.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0};function Gp(t,e,r,i,n){var o=Oo();return e?(jo(o,o,[1/n,1/n,1]),r||qo(o,o,i.angle)):Uo(o,i.labelPlaneMatrix,t),o}function Wp(t,e,r,i,n){if(e){var o=function(t){var e=new Fo(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}(t);return jo(o,o,[n,n,1]),r||qo(o,o,-i.angle),o}return i.glCoordMatrix}function Kp(t,e){var r=[t.x,t.y,0,1];ic(r,r,e);var i=r[3];return{point:new n(r[0]/i,r[1]/i),signedDistanceFromCamera:i}}function Hp(t,e){var r=t[0]/t[3],i=t[1]/t[3];return r>=-e[0]&&r<=e[0]&&i>=-e[1]&&i<=e[1]}function Xp(t,e,r,i,o,a,s,u){var l=i?t.textSizeData:t.iconSizeData,p=Rs(l,r.transform.zoom),c=[256/r.width*2+1,256/r.height*2+1],h=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;h.clear();for(var f=t.lineVertexArray,d=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,m=r.transform.width/r.transform.height,y=!1,_=0;_<d.length;_++){var v=d.get(_);if(v.hidden||v.writingMode===Ps.vertical&&!y)rc(v.numGlyphs,h);else{y=!1;var g=[v.anchorX,v.anchorY,0,1];if(Ko(g,g,e),Hp(g,c)){var x=.5+g[3]/r.transform.cameraToCenterDistance*.5,b=Bs(l,p,v),w=s?b*x:b/x,S=new n(v.anchorX,v.anchorY),A=Kp(S,o).point,T={},I=Qp(v,w,!1,u,e,o,a,t.glyphOffsetArray,f,h,A,S,T,m);y=I.useVertical,(I.notEnoughRoom||y||I.needsFlipping&&Qp(v,w,!0,u,e,o,a,t.glyphOffsetArray,f,h,A,S,T,m).notEnoughRoom)&&rc(v.numGlyphs,h)}else rc(v.numGlyphs,h)}}i?t.text.dynamicLayoutVertexBuffer.updateData(h):t.icon.dynamicLayoutVertexBuffer.updateData(h)}function Jp(t,e,r,i,n,o,a,s,u,l,p,c){var h=s.glyphStartIndex+s.numGlyphs,f=s.lineStartIndex,d=s.lineStartIndex+s.lineLength,m=e.getoffsetX(s.glyphStartIndex),y=e.getoffsetX(h-1),_=tc(t*m,r,i,n,o,a,s.segment,f,d,u,l,p,c);if(!_)return null;var v=tc(t*y,r,i,n,o,a,s.segment,f,d,u,l,p,c);return v?{first:_,last:v}:null}function Yp(t,e,r,i){if(t===Ps.horizontal&&Math.abs(r.y-e.y)>Math.abs(r.x-e.x)*i)return{useVertical:!0};return(t===Ps.vertical?e.y<r.y:e.x>r.x)?{needsFlipping:!0}:null}function Qp(t,e,r,i,o,a,s,u,l,p,c,h,f,d){var m,y=e/24,_=t.lineOffsetX*y,v=t.lineOffsetY*y;if(t.numGlyphs>1){var g=t.glyphStartIndex+t.numGlyphs,x=t.lineStartIndex,b=t.lineStartIndex+t.lineLength,w=Jp(y,u,_,v,r,c,h,t,l,a,f,!1);if(!w)return{notEnoughRoom:!0};var S=Kp(w.first.point,s).point,A=Kp(w.last.point,s).point;if(i&&!r){var T=Yp(t.writingMode,S,A,d);if(T)return T}m=[w.first];for(var I=t.glyphStartIndex+1;I<g-1;I++)m.push(tc(y*u.getoffsetX(I),_,v,r,c,h,t.segment,x,b,l,a,f,!1));m.push(w.last)}else{if(i&&!r){var z=Kp(h,o).point,k=t.lineStartIndex+t.segment+1,E=new n(l.getx(k),l.gety(k)),C=Kp(E,o),P=C.signedDistanceFromCamera>0?C.point:$p(h,E,z,1,o),M=Yp(t.writingMode,z,P,d);if(M)return M}var D=tc(y*u.getoffsetX(t.glyphStartIndex),_,v,r,c,h,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,l,a,f,!1);if(!D)return{notEnoughRoom:!0};m=[D]}for(var L=0,B=m;L<B.length;L+=1){var R=B[L];Ns(p,R.point,R.angle)}return{}}function $p(t,e,r,i,n){var o=Kp(t.add(t.sub(e)._unit()),n).point,a=r.sub(o);return r.add(a._mult(i/a.mag()))}function tc(t,e,r,i,o,a,s,u,l,p,c,h,f){var d=i?t-e:t+e,m=d>0?1:-1,y=0;i&&(m*=-1,y=Math.PI),m<0&&(y+=Math.PI);for(var _=m>0?u+s:u+s+1,v=_,g=o,x=o,b=0,w=0,S=Math.abs(d);b+w<=S;){if((_+=m)<u||_>=l)return null;if(x=g,void 0===(g=h[_])){var A=new n(p.getx(_),p.gety(_)),T=Kp(A,c);if(T.signedDistanceFromCamera>0)g=h[_]=T.point;else{var I=_-m;g=$p(0===b?a:new n(p.getx(I),p.gety(I)),A,x,S-b+1,c)}}b+=w,w=x.dist(g)}var z=(S-b)/w,k=g.sub(x),E=k.mult(z)._add(x);return E._add(k._unit()._perp()._mult(r*m)),{point:E,angle:y+Math.atan2(g.y-x.y,g.x-x.x),tileDistance:f?{prevTileDistance:_-m===v?0:p.gettileUnitDistanceFromAnchor(_-m),lastSegmentViewportDistance:S-b}:null}}Zp.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Zp.prototype.insert=function(t,e,r,i,n){this._forEachCell(e,r,i,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)},Zp.prototype.insertCircle=function(t,e,r,i){this._forEachCell(e-i,r-i,e+i,r+i,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(i)},Zp.prototype._insertBoxCell=function(t,e,r,i,n,o){this.boxCells[n].push(o)},Zp.prototype._insertCircleCell=function(t,e,r,i,n,o){this.circleCells[n].push(o)},Zp.prototype._query=function(t,e,r,i,n,o){if(r<0||t>this.width||i<0||e>this.height)return!n&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=i){if(n)return!0;for(var s=0;s<this.boxKeys.length;s++)a.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var u=0;u<this.circleKeys.length;u++){var l=this.circles[3*u],p=this.circles[3*u+1],c=this.circles[3*u+2];a.push({key:this.circleKeys[u],x1:l-c,y1:p-c,x2:l+c,y2:p+c})}return o?a.filter(o):a}var h={hitTest:n,seenUids:{box:{},circle:{}}};return this._forEachCell(t,e,r,i,this._queryCell,a,h,o),n?a.length>0:a},Zp.prototype._queryCircle=function(t,e,r,i,n){var o=t-r,a=t+r,s=e-r,u=e+r;if(a<0||o>this.width||u<0||s>this.height)return!i&&[];var l=[],p={hitTest:i,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(o,s,a,u,this._queryCellCircle,l,p,n),i?l.length>0:l},Zp.prototype.query=function(t,e,r,i,n){return this._query(t,e,r,i,!1,n)},Zp.prototype.hitTest=function(t,e,r,i,n){return this._query(t,e,r,i,!0,n)},Zp.prototype.hitTestCircle=function(t,e,r,i){return this._queryCircle(t,e,r,!0,i)},Zp.prototype._queryCell=function(t,e,r,i,n,o,a,s){var u=a.seenUids,l=this.boxCells[n];if(null!==l)for(var p=this.bboxes,c=0,h=l;c<h.length;c+=1){var f=h[c];if(!u.box[f]){u.box[f]=!0;var d=4*f;if(t<=p[d+2]&&e<=p[d+3]&&r>=p[d+0]&&i>=p[d+1]&&(!s||s(this.boxKeys[f]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[f],x1:p[d],y1:p[d+1],x2:p[d+2],y2:p[d+3]})}}}var m=this.circleCells[n];if(null!==m)for(var y=this.circles,_=0,v=m;_<v.length;_+=1){var g=v[_];if(!u.circle[g]){u.circle[g]=!0;var x=3*g;if(this._circleAndRectCollide(y[x],y[x+1],y[x+2],t,e,r,i)&&(!s||s(this.circleKeys[g]))){if(a.hitTest)return o.push(!0),!0;var b=y[x],w=y[x+1],S=y[x+2];o.push({key:this.circleKeys[g],x1:b-S,y1:w-S,x2:b+S,y2:w+S})}}}},Zp.prototype._queryCellCircle=function(t,e,r,i,n,o,a,s){var u=a.circle,l=a.seenUids,p=this.boxCells[n];if(null!==p)for(var c=this.bboxes,h=0,f=p;h<f.length;h+=1){var d=f[h];if(!l.box[d]){l.box[d]=!0;var m=4*d;if(this._circleAndRectCollide(u.x,u.y,u.radius,c[m+0],c[m+1],c[m+2],c[m+3])&&(!s||s(this.boxKeys[d])))return o.push(!0),!0}}var y=this.circleCells[n];if(null!==y)for(var _=this.circles,v=0,g=y;v<g.length;v+=1){var x=g[v];if(!l.circle[x]){l.circle[x]=!0;var b=3*x;if(this._circlesCollide(_[b],_[b+1],_[b+2],u.x,u.y,u.radius)&&(!s||s(this.circleKeys[x])))return o.push(!0),!0}}},Zp.prototype._forEachCell=function(t,e,r,i,n,o,a,s){for(var u=this._convertToXCellCoord(t),l=this._convertToYCellCoord(e),p=this._convertToXCellCoord(r),c=this._convertToYCellCoord(i),h=u;h<=p;h++)for(var f=l;f<=c;f++){var d=this.xCellCount*f+h;if(n.call(this,t,e,r,i,d,o,a,s))return}},Zp.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Zp.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Zp.prototype._circlesCollide=function(t,e,r,i,n,o){var a=i-t,s=n-e,u=r+o;return u*u>a*a+s*s},Zp.prototype._circleAndRectCollide=function(t,e,r,i,n,o,a){var s=(o-i)/2,u=Math.abs(t-(i+s));if(u>s+r)return!1;var l=(a-n)/2,p=Math.abs(e-(n+l));if(p>l+r)return!1;if(u<=s||p<=l)return!0;var c=u-s,h=p-l;return c*c+h*h<=r*r};var ec=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function rc(t,e){for(var r=0;r<t;r++){var i=e.length;e.resize(i+4),e.float32.set(ec,3*i)}}function ic(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[4]*n+r[12],t[1]=r[1]*i+r[5]*n+r[13],t[3]=r[3]*i+r[7]*n+r[15],t}var nc=function(t,e,r){void 0===e&&(e=new Zp(t.width+200,t.height+200,25)),void 0===r&&(r=new Zp(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=r,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function oc(t,e,r){t[e+4]=r?1:0}nc.prototype.placeCollisionBox=function(t,e,r,i,n){var o=this.projectAndGetPerspectiveRatio(i,t.anchorPointX,t.anchorPointY),a=r*o.perspectiveRatio,s=t.x1*a+o.point.x,u=t.y1*a+o.point.y,l=t.x2*a+o.point.x,p=t.y2*a+o.point.y;return!this.isInsideGrid(s,u,l,p)||!e&&this.grid.hitTest(s,u,l,p,n)?{box:[],offscreen:!1}:{box:[s,u,l,p],offscreen:this.isOffscreen(s,u,l,p)}},nc.prototype.approximateTileDistance=function(t,e,r,i,n){var o=n?1:i/this.pitchfactor,a=t.lastSegmentViewportDistance*r;return t.prevTileDistance+a+(o-1)*a*Math.abs(Math.sin(e))},nc.prototype.placeCollisionCircles=function(t,e,r,i,o,a,s,u,l,p,c,h,f){var d=[],m=this.projectAnchor(l,o.anchorX,o.anchorY),y=u/24,_=o.lineOffsetX*u,v=o.lineOffsetY*u,g=new n(o.anchorX,o.anchorY),x=Jp(y,s,_,v,!1,Kp(g,p).point,g,o,a,p,{},!0),b=!1,w=!1,S=!0,A=m.perspectiveRatio*i,T=1/(i*r),I=0,z=0;x&&(I=this.approximateTileDistance(x.first.tileDistance,x.first.angle,T,m.cameraDistance,h),z=this.approximateTileDistance(x.last.tileDistance,x.last.angle,T,m.cameraDistance,h));for(var k=0;k<t.length;k+=5){var E=t[k],C=t[k+1],P=t[k+2],M=t[k+3];if(!x||M<-I||M>z)oc(t,k,!1);else{var D=this.projectPoint(l,E,C),L=P*A;if(d.length>0){var B=D.x-d[d.length-4],R=D.y-d[d.length-3];if(L*L*2>B*B+R*R)if(k+8<t.length){var F=t[k+8];if(F>-I&&F<z){oc(t,k,!1);continue}}}var O=k/5;d.push(D.x,D.y,L,O),oc(t,k,!0);var V=D.x-L,U=D.y-L,N=D.x+L,j=D.y+L;if(S=S&&this.isOffscreen(V,U,N,j),w=w||this.isInsideGrid(V,U,N,j),!e&&this.grid.hitTestCircle(D.x,D.y,L,f)){if(!c)return{circles:[],offscreen:!1};b=!0}}}return{circles:b||!w?[]:d,offscreen:S}},nc.prototype.queryRenderedSymbols=function(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var e=[],r=1/0,i=1/0,o=-1/0,a=-1/0,s=0,u=t;s<u.length;s+=1){var l=u[s],p=new n(l.x+100,l.y+100);r=Math.min(r,p.x),i=Math.min(i,p.y),o=Math.max(o,p.x),a=Math.max(a,p.y),e.push(p)}for(var c={},h={},f=0,d=this.grid.query(r,i,o,a).concat(this.ignoredGrid.query(r,i,o,a));f<d.length;f+=1){var m=d[f],y=m.key;if(void 0===c[y.bucketInstanceId]&&(c[y.bucketInstanceId]={}),!c[y.bucketInstanceId][y.featureIndex])bo(e,[new n(m.x1,m.y1),new n(m.x2,m.y1),new n(m.x2,m.y2),new n(m.x1,m.y2)])&&(c[y.bucketInstanceId][y.featureIndex]=!0,void 0===h[y.bucketInstanceId]&&(h[y.bucketInstanceId]=[]),h[y.bucketInstanceId].push(y.featureIndex))}return h},nc.prototype.insertCollisionBox=function(t,e,r,i,n){var o={bucketInstanceId:r,featureIndex:i,collisionGroupID:n};(e?this.ignoredGrid:this.grid).insert(o,t[0],t[1],t[2],t[3])},nc.prototype.insertCollisionCircles=function(t,e,r,i,n){for(var o=e?this.ignoredGrid:this.grid,a={bucketInstanceId:r,featureIndex:i,collisionGroupID:n},s=0;s<t.length;s+=4)o.insertCircle(a,t[s],t[s+1],t[s+2])},nc.prototype.projectAnchor=function(t,e,r){var i=[e,r,0,1];return ic(i,i,t),{perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5,cameraDistance:i[3]}},nc.prototype.projectPoint=function(t,e,r){var i=[e,r,0,1];return ic(i,i,t),new n((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100)},nc.prototype.projectAndGetPerspectiveRatio=function(t,e,r){var i=[e,r,0,1];return ic(i,i,t),{point:new n((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5}},nc.prototype.isOffscreen=function(t,e,r,i){return r<100||t>=this.screenRightBoundary||i<100||e>this.screenBottomBoundary},nc.prototype.isInsideGrid=function(t,e,r,i){return r>=0&&t<this.gridRightBoundary&&i>=0&&e<this.gridBottomBoundary};var ac=t((function(t){t.exports=function(t,e){var r,i,n,o,a,s,u,l;for(r=3&t.length,i=t.length-r,n=e,a=3432918353,s=461845907,l=0;l<i;)u=255&t.charCodeAt(l)|(255&t.charCodeAt(++l))<<8|(255&t.charCodeAt(++l))<<16|(255&t.charCodeAt(++l))<<24,++l,n=27492+(65535&(o=5*(65535&(n=(n^=u=(65535&(u=(u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&t.charCodeAt(l+2))<<16;case 2:u^=(255&t.charCodeAt(l+1))<<8;case 1:n^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(l)))*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295}return n^=t.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0}})),sc=ac,uc=ac,lc=t((function(t){t.exports=function(t,e){for(var r,i=t.length,n=e^i,o=0;i>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),i-=4,++o;switch(i){case 3:n^=(255&t.charCodeAt(o+2))<<16;case 2:n^=(255&t.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(o)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0}}));sc.murmur3=uc,sc.murmur2=lc;var pc=7;function cc(t,e){var r=0,i=0,n=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":i=n-pc;break;case"bottom-right":case"bottom-left":i=-n+pc;break;case"bottom":i=-e+pc;break;case"top":i=e-pc}switch(t){case"top-right":case"bottom-right":r=-n;break;case"top-left":case"bottom-left":r=n;break;case"left":r=e;break;case"right":r=-e}return[r,i]}function hc(t,e,r){return e*(mo/(t.tileSize*Math.pow(2,r-t.tileID.overscaledZ)))}var fc=function(t,e,r,i){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):i&&r?1:0,this.placed=r};fc.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var dc=function(t,e,r,i,n){this.text=new fc(t?t.text:null,e,r,n),this.icon=new fc(t?t.icon:null,e,i,n)};dc.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var mc=function(t,e,r){this.text=t,this.icon=e,this.skipFade=r},yc=function(t,e,r,i,n){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=i,this.tileID=n},_c=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function vc(t,e,r,i,o){var a=Ms(t),s=-(a.horizontalAlign-.5)*e,u=-(a.verticalAlign-.5)*r,l=cc(t,i);return new n(s+l[0]*o,u+l[1]*o)}_c.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};var gc=function(t,e,r,i){this.transform=t.clone(),this.collisionIndex=new nc(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new _c(r),this.prevPlacement=i,i&&(i.prevPlacement=void 0),this.placedOrientations={}};function xc(t,e,r,i,n){t.emplaceBack(e?1:0,r?1:0,i||0,n||0),t.emplaceBack(e?1:0,r?1:0,i||0,n||0),t.emplaceBack(e?1:0,r?1:0,i||0,n||0),t.emplaceBack(e?1:0,r?1:0,i||0,n||0)}gc.prototype.placeLayerTile=function(t,e,r,i){var n=e.getBucket(t),o=e.latestFeatureIndex;if(n&&o&&t.id===n.layerIds[0]){var a=e.collisionBoxArray,s=n.layers[0].layout,u=Math.pow(2,this.transform.zoom-e.tileID.overscaledZ),l=e.tileSize/mo,p=this.transform.calculatePosMatrix(e.tileID.toUnwrapped()),c=Gp(p,"map"===s.get("text-pitch-alignment"),"map"===s.get("text-rotation-alignment"),this.transform,hc(e,1,this.transform.zoom)),h=Gp(p,"map"===s.get("icon-pitch-alignment"),"map"===s.get("icon-rotation-alignment"),this.transform,hc(e,1,this.transform.zoom));this.retainedQueryData[n.bucketInstanceId]=new yc(n.bucketInstanceId,o,n.sourceLayerIndex,n.index,e.tileID),this.placeLayerBucket(n,p,c,h,u,l,r,e.holdingForFade(),i,a)}},gc.prototype.attemptAnchorPlacement=function(t,e,r,i,o,a,s,u,l,p,c,h,f,d,m){var y,_=vc(t,r,i,o,a),v=this.collisionIndex.placeCollisionBox(function(t,e,r,i,o,a){var s=t.x1,u=t.x2,l=t.y1,p=t.y2,c=t.anchorPointX,h=t.anchorPointY,f=new n(e,r);return i&&f._rotate(o?a:-a),{x1:s+f.x,y1:l+f.y,x2:u+f.x,y2:p+f.y,anchorPointX:c,anchorPointY:h}}(e,_.x,_.y,s,u,this.transform.angle),h,l,p,c.predicate);if(v.box.length>0)return this.prevPlacement&&this.prevPlacement.variableOffsets[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID].text&&(y=this.prevPlacement.variableOffsets[f.crossTileID].anchor),this.variableOffsets[f.crossTileID]={radialOffset:o,width:r,height:i,anchor:t,textBoxScale:a,prevAnchor:y},this.markUsedJustification(d,t,f,m),d.allowVerticalPlacement&&(this.markUsedOrientation(d,m,f),this.placedOrientations[f.crossTileID]=m),v},gc.prototype.placeLayerBucket=function(t,e,r,i,n,o,a,s,u,l){var p=this,c=t.layers[0].layout,h=Rs(t.textSizeData,this.transform.zoom),f=c.get("text-optional"),d=c.get("icon-optional"),m=c.get("text-allow-overlap"),y=c.get("icon-allow-overlap"),_=m&&(y||!t.hasIconData()||d),v=y&&(m||!t.hasTextData()||f),g=this.collisionGroups.get(t.sourceID),x="map"===c.get("text-rotation-alignment"),b="map"===c.get("text-pitch-alignment"),w="viewport-y"===c.get("symbol-z-order");!t.collisionArrays&&l&&t.deserializeCollisionBoxes(l);var S=function(i,l){if(!u[i.crossTileID])if(s)p.placements[i.crossTileID]=new mc(!1,!1,!1);else{var y,w=!1,S=!1,A=!0,T={box:null,offscreen:null},I={box:null,offscreen:null},z=null,k=null,E=0,C=0,P=0;l.textFeatureIndex&&(E=l.textFeatureIndex),l.verticalTextFeatureIndex&&(C=l.verticalTextFeatureIndex);var M=l.textBox;if(M){var D=function(e){var r=Ps.horizontal;if(t.allowVerticalPlacement&&!e&&p.prevPlacement){var n=p.prevPlacement.placedOrientations[i.crossTileID];n&&(p.placedOrientations[i.crossTileID]=n,r=n,p.markUsedOrientation(t,r,i))}return r},L=function(e,r){if(t.allowVerticalPlacement&&i.numVerticalGlyphVertices>0&&l.verticalTextBox)for(var n=0,o=t.writingModes;n<o.length;n+=1){if(o[n]===Ps.vertical?(T=r(),I=T):T=e(),T&&T.box&&T.box.length)break}else T=e()};if(c.get("text-variable-anchor")){var B=c.get("text-variable-anchor");if(p.prevPlacement&&p.prevPlacement.variableOffsets[i.crossTileID]){var R=p.prevPlacement.variableOffsets[i.crossTileID];B.indexOf(R.anchor)>0&&(B=B.filter((function(t){return t!==R.anchor}))).unshift(R.anchor)}var F=function(r,n){for(var a=r.x2-r.x1,s=r.y2-r.y1,u=i.textBoxScale,l={box:[],offscreen:!1},c=m?2*B.length:B.length,h=0;h<c;++h){var f=B[h%B.length],d=h>=B.length;if((l=p.attemptAnchorPlacement(f,r,a,s,i.radialTextOffset,u,x,b,o,e,g,d,i,t,n))&&l.box&&l.box.length){w=!0;break}}return l};L((function(){return F(M,Ps.horizontal)}),(function(){var e=l.verticalTextBox,r=T&&T.box&&T.box.length;return t.allowVerticalPlacement&&!r&&i.numVerticalGlyphVertices>0&&e?F(e,Ps.vertical):{box:null,offscreen:null}})),T&&(w=T.box,A=T.offscreen);var O=D(T&&T.box);if(!w&&p.prevPlacement){var V=p.prevPlacement.variableOffsets[i.crossTileID];V&&(p.variableOffsets[i.crossTileID]=V,p.markUsedJustification(t,V.anchor,i,O))}}else{var U=function(r,n){var a=p.collisionIndex.placeCollisionBox(r,c.get("text-allow-overlap"),o,e,g.predicate);return a&&a.box&&a.box.length&&(p.markUsedOrientation(t,n,i),p.placedOrientations[i.crossTileID]=n),a};L((function(){return U(M,Ps.horizontal)}),(function(){var e=l.verticalTextBox;return t.allowVerticalPlacement&&i.numVerticalGlyphVertices>0&&e?U(e,Ps.vertical):{box:null,offscreen:null}})),D(T&&T.box&&T.box.length)}}w=(y=T)&&y.box&&y.box.length>0,A=y&&y.offscreen;var N=l.textCircles;if(N){var j=t.text.placedSymbolArray.get(i.centerJustifiedTextSymbolIndex),q=Bs(t.textSizeData,h,j);z=p.collisionIndex.placeCollisionCircles(N,c.get("text-allow-overlap"),n,o,j,t.lineVertexArray,t.glyphOffsetArray,q,e,r,a,b,g.predicate),w=c.get("text-allow-overlap")||z.circles.length>0,A=A&&z.offscreen}l.iconFeatureIndex&&(P=l.iconFeatureIndex),l.iconBox&&(S=(k=p.collisionIndex.placeCollisionBox(l.iconBox,c.get("icon-allow-overlap"),o,e,g.predicate)).box.length>0,A=A&&k.offscreen);var Z=f||0===i.numHorizontalGlyphVertices&&0===i.numVerticalGlyphVertices,G=d||0===i.numIconVertices;Z||G?G?Z||(S=S&&w):w=S&&w:S=w=S&&w,w&&y&&y.box&&(I&&I.box&&C?p.collisionIndex.insertCollisionBox(y.box,c.get("text-ignore-placement"),t.bucketInstanceId,C,g.ID):p.collisionIndex.insertCollisionBox(y.box,c.get("text-ignore-placement"),t.bucketInstanceId,E,g.ID)),S&&k&&p.collisionIndex.insertCollisionBox(k.box,c.get("icon-ignore-placement"),t.bucketInstanceId,P,g.ID),w&&z&&p.collisionIndex.insertCollisionCircles(z.circles,c.get("text-ignore-placement"),t.bucketInstanceId,E,g.ID),p.placements[i.crossTileID]=new mc(w||_,S||v,A||t.justReloaded),u[i.crossTileID]=!0}};if(w)for(var A=t.getSortedSymbolIndexes(this.transform.angle),T=A.length-1;T>=0;--T){var I=A[T];S(t.symbolInstances.get(I),t.collisionArrays[I])}else for(var z=0;z<t.symbolInstances.length;++z)S(t.symbolInstances.get(z),t.collisionArrays[z]);t.justReloaded=!1},gc.prototype.markUsedJustification=function(t,e,r,i){var n,o={left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex};n=i===Ps.vertical?r.verticalPlacedTextSymbolIndex:o[function(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}(e)];for(var a=0,s=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex];a<s.length;a+=1){var u=s[a];u>=0&&(t.text.placedSymbolArray.get(u).crossTileID=n>=0&&u!==n?0:r.crossTileID)}},gc.prototype.markUsedOrientation=function(t,e,r){for(var i=e===Ps.horizontal||e===Ps.horizontalOnly?e:0,n=e===Ps.vertical?e:0,o=0,a=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];o<a.length;o+=1){var s=a[o];t.text.placedSymbolArray.get(s).placedOrientation=i}r.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=n)},gc.prototype.commit=function(t){this.commitTime=t;var e=this.prevPlacement,r=!1,i=e&&0!==this.fadeDuration?(this.commitTime-e.commitTime)/this.fadeDuration:1,n=e?e.opacities:{},o=e?e.variableOffsets:{},a=e?e.placedOrientations:{};for(var s in this.placements){var u=this.placements[s],l=n[s];l?(this.opacities[s]=new dc(l,i,u.text,u.icon),r=r||u.text!==l.text.placed||u.icon!==l.icon.placed):(this.opacities[s]=new dc(null,i,u.text,u.icon,u.skipFade),r=r||u.text||u.icon)}for(var p in n){var c=n[p];if(!this.opacities[p]){var h=new dc(c,i,!1,!1);h.isHidden()||(this.opacities[p]=h,r=r||c.text.placed||c.icon.placed)}}for(var f in o)this.variableOffsets[f]||!this.opacities[f]||this.opacities[f].isHidden()||(this.variableOffsets[f]=o[f]);for(var d in a)this.placedOrientations[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.placedOrientations[d]=a[d]);r?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},gc.prototype.updateLayerOpacities=function(t,e){for(var r={},i=0,n=e;i<n.length;i+=1){var o=n[i],a=o.getBucket(t);a&&o.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,r,o.collisionBoxArray)}},gc.prototype.updateBucketOpacities=function(t,e,r){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasCollisionBoxData()&&t.collisionBox.collisionVertexArray.clear(),t.hasCollisionCircleData()&&t.collisionCircle.collisionVertexArray.clear();var i=t.layers[0].layout,o=new dc(null,0,!1,!1,!0),a=i.get("text-allow-overlap"),s=i.get("icon-allow-overlap"),u=i.get("text-variable-anchor"),l="map"===i.get("text-rotation-alignment"),p="map"===i.get("text-pitch-alignment"),c=new dc(null,0,a&&(s||!t.hasIconData()||i.get("icon-optional")),s&&(a||!t.hasTextData()||i.get("text-optional")),!0);!t.collisionArrays&&r&&(t.hasCollisionBoxData()||t.hasCollisionCircleData())&&t.deserializeCollisionBoxes(r);for(var h=0;h<t.symbolInstances.length;h++){var f=t.symbolInstances.get(h),d=f.numHorizontalGlyphVertices,m=f.numVerticalGlyphVertices,y=f.crossTileID,_=e[y],v=this.opacities[y];_?v=o:v||(v=c,this.opacities[y]=v),e[y]=!0;var g=d>0||m>0,x=f.numIconVertices>0;if(g){for(var b=kc(v.text),w=(d+m)/4,S=0;S<w;S++)t.text.opacityVertexArray.emplaceBack(b);var A=v.text.isHidden()?1:0,T=this.placedOrientations[f.crossTileID],I=T===Ps.horizontal||T===Ps.horizontalOnly?1:0,z=T===Ps.vertical?1:0;[f.rightJustifiedTextSymbolIndex,f.centerJustifiedTextSymbolIndex,f.leftJustifiedTextSymbolIndex].forEach((function(e){e>=0&&(t.text.placedSymbolArray.get(e).hidden=A||z)})),f.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(f.verticalPlacedTextSymbolIndex).hidden=A||I);var k=this.variableOffsets[f.crossTileID];k&&this.markUsedJustification(t,k.anchor,f,T);var E=this.placedOrientations[f.crossTileID];E&&(this.markUsedJustification(t,"left",f,E),this.markUsedOrientation(t,E,f))}if(x){for(var C=kc(v.icon),P=0;P<f.numIconVertices/4;P++)t.icon.opacityVertexArray.emplaceBack(C);t.icon.placedSymbolArray.get(h).hidden=v.icon.isHidden()}if(t.hasCollisionBoxData()||t.hasCollisionCircleData()){var M=t.collisionArrays[h];if(M){if(M.textBox){var D=new n(0,0),L=!0;if(u){var B=this.variableOffsets[y];B?(D=vc(B.anchor,B.width,B.height,B.radialOffset,B.textBoxScale),l&&D._rotate(p?this.transform.angle:-this.transform.angle)):L=!1}xc(t.collisionBox.collisionVertexArray,v.text.placed,!L,D.x,D.y)}M.iconBox&&xc(t.collisionBox.collisionVertexArray,v.icon.placed,!1);var R=M.textCircles;if(R&&t.hasCollisionCircleData())for(var F=0;F<R.length;F+=5){var O=_||0===R[F+4];xc(t.collisionCircle.collisionVertexArray,v.text.placed,O)}}}}t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasCollisionBoxData()&&t.collisionBox.collisionVertexBuffer&&t.collisionBox.collisionVertexBuffer.updateData(t.collisionBox.collisionVertexArray),t.hasCollisionCircleData()&&t.collisionCircle.collisionVertexBuffer&&t.collisionCircle.collisionVertexBuffer.updateData(t.collisionCircle.collisionVertexArray)},gc.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration},gc.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},gc.prototype.stillRecent=function(t){return this.commitTime+this.fadeDuration>t},gc.prototype.setStale=function(){this.stale=!0};var bc=Math.pow(2,25),wc=Math.pow(2,24),Sc=Math.pow(2,17),Ac=Math.pow(2,16),Tc=Math.pow(2,9),Ic=Math.pow(2,8),zc=Math.pow(2,1);function kc(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*bc+e*wc+r*Sc+e*Ac+r*Tc+e*Ic+r*zc+e}var Ec=function(){this._currentTileIndex=0,this._seenCrossTileIDs={}};Ec.prototype.continuePlacement=function(t,e,r,i,n){for(;this._currentTileIndex<t.length;){var o=t[this._currentTileIndex];if(e.placeLayerTile(i,o,r,this._seenCrossTileIDs),this._currentTileIndex++,n())return!0}};var Cc=function(t,e,r,i,n,o,a){this.placement=new gc(t,n,o,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=i,this._done=!1};Cc.prototype.isDone=function(){return this._done},Cc.prototype.continuePlacement=function(t,e,r){for(var i=this,n=L.now(),o=function(){var t=L.now()-n;return!i._forceFullPlacement&&t>2};this._currentPlacementIndex>=0;){var a=e[t[this._currentPlacementIndex]],s=this.placement.collisionIndex.transform.zoom;if("symbol"===a.type&&(!a.minzoom||a.minzoom<=s)&&(!a.maxzoom||a.maxzoom>s)){if(this._inProgressLayer||(this._inProgressLayer=new Ec),this._inProgressLayer.continuePlacement(r[a.source],this.placement,this._showCollisionBoxes,a,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Cc.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Pc=512/mo/2,Mc=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var i=0;i<e.length;i++){var n=e.get(i),o=n.key;this.indexedSymbolInstances[o]||(this.indexedSymbolInstances[o]=[]),this.indexedSymbolInstances[o].push({crossTileID:n.crossTileID,coord:this.getScaledCoordinates(n,t)})}};Mc.prototype.getScaledCoordinates=function(t,e){var r=e.canonical.z-this.tileID.canonical.z,i=Pc/Math.pow(2,r);return{x:Math.floor((e.canonical.x*mo+t.anchorX)*i),y:Math.floor((e.canonical.y*mo+t.anchorY)*i)}},Mc.prototype.findMatches=function(t,e,r){for(var i=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),n=0;n<t.length;n++){var o=t.get(n);if(!o.crossTileID){var a=this.indexedSymbolInstances[o.key];if(a)for(var s=this.getScaledCoordinates(o,e),u=0,l=a;u<l.length;u+=1){var p=l[u];if(Math.abs(p.coord.x-s.x)<=i&&Math.abs(p.coord.y-s.y)<=i&&!r[p.crossTileID]){r[p.crossTileID]=!0,o.crossTileID=p.crossTileID;break}}}}};var Dc=function(){this.maxCrossTileID=0};Dc.prototype.generate=function(){return++this.maxCrossTileID};var Lc=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Lc.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var r in this.indexes){var i=this.indexes[r],n={};for(var o in i){var a=i[o];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),n[a.tileID.key]=a}this.indexes[r]=n}this.lng=t},Lc.prototype.addBucket=function(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var i=0;i<e.symbolInstances.length;i++){e.symbolInstances.get(i).crossTileID=0}this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var n=this.usedCrossTileIDs[t.overscaledZ];for(var o in this.indexes){var a=this.indexes[o];if(Number(o)>t.overscaledZ)for(var s in a){var u=a[s];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,n)}else{var l=a[t.scaledTo(Number(o)).key];l&&l.findMatches(e.symbolInstances,t,n)}}for(var p=0;p<e.symbolInstances.length;p++){var c=e.symbolInstances.get(p);c.crossTileID||(c.crossTileID=r.generate(),n[c.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Mc(t,e.symbolInstances,e.bucketInstanceId),!0},Lc.prototype.removeBucketCrossTileIDs=function(t,e){for(var r in e.indexedSymbolInstances)for(var i=0,n=e.indexedSymbolInstances[r];i<n.length;i+=1){var o=n[i];delete this.usedCrossTileIDs[t][o.crossTileID]}},Lc.prototype.removeStaleBuckets=function(t){var e=!1;for(var r in this.indexes){var i=this.indexes[r];for(var n in i)t[i[n].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,i[n]),delete i[n],e=!0)}return e};var Bc=function(){this.layerIndexes={},this.crossTileIDs=new Dc,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Bc.prototype.addLayer=function(t,e,r){var i=this.layerIndexes[t.id];void 0===i&&(i=this.layerIndexes[t.id]=new Lc);var n=!1,o={};i.handleWrapJump(r);for(var a=0,s=e;a<s.length;a+=1){var u=s[a],l=u.getBucket(t);l&&t.id===l.layerIds[0]&&(l.bucketInstanceId||(l.bucketInstanceId=++this.maxBucketInstanceId),i.addBucket(u.tileID,l,this.crossTileIDs)&&(n=!0),o[l.bucketInstanceId]=!0)}return i.removeStaleBuckets(o)&&(n=!0),n},Bc.prototype.pruneUnusedLayers=function(t){var e={};for(var r in t.forEach((function(t){e[t]=!0})),this.layerIndexes)e[r]||delete this.layerIndexes[r]};var Rc=function(t,e){return wi(t,e&&e.filter((function(t){return"source.canvas"!==t.identifier})))},Fc=f(Bp,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Oc=f(Bp,["setCenter","setZoom","setBearing","setPitch"]),Vc=function(t){function e(r,i){var n=this;void 0===i&&(i={}),t.call(this),this.map=r,this.dispatcher=new Xu((Cp||(Cp=new Ep),Cp),this),this.imageManager=new hu,this.imageManager.setEventedParent(this),this.glyphManager=new ju(r._requestManager,i.localIdeographFontFamily),this.lineAtlas=new Wu(256,512),this.crossTileSymbolIndex=new Bc,this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new Mi,this._loaded=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",Tt());var o=this;this._rtlTextPluginCallback=e.registerForPluginAvailability((function(t){for(var e in o.dispatcher.broadcast("loadRTLTextPlugin",t.pluginURL,t.completionCallback),o.sourceCaches)o.sourceCaches[e].reload()})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=n.sourceCaches[t.sourceId];if(e){var r=e.getSource();if(r&&r.vectorLayerIds)for(var i in n._layers){var o=n._layers[i];o.source===r.id&&n._validateLayer(o)}}}}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.loadURL=function(t,e){var r=this;void 0===e&&(e={}),this.fire(new Rt("dataloading",{dataType:"style"}));var i="boolean"==typeof e.validate?e.validate:!$(t);t=this.map._requestManager.normalizeStyleURL(t,e.accessToken);var n=this.map._requestManager.transformRequest(t,wt.Style);this._request=kt(n,(function(t,e){r._request=null,t?r.fire(new Ft(t)):e&&r._load(e,i)}))},e.prototype.loadJSON=function(t,e){var r=this;void 0===e&&(e={}),this.fire(new Rt("dataloading",{dataType:"style"})),this._request=L.frame((function(){r._request=null,r._load(t,!1!==e.validate)}))},e.prototype._load=function(t,e){var r=this;if(!e||!Rc(this,vi(t))){for(var i in this._loaded=!0,this.stylesheet=t,t.sources)this.addSource(i,t.sources[i],{validate:!1});t.sprite?this._spriteRequest=function(t,e,r){var i,n,o,a=L.devicePixelRatio>1?"@2x":"",s=kt(e.transformRequest(e.normalizeSpriteURL(t,a,".json"),wt.SpriteJSON),(function(t,e){s=null,o||(o=t,i=e,l())})),u=Dt(e.transformRequest(e.normalizeSpriteURL(t,a,".png"),wt.SpriteImage),(function(t,e){u=null,o||(o=t,n=e,l())}));function l(){if(o)r(o);else if(i&&n){var t=L.getImageData(n),e={};for(var a in i){var s=i[a],u=s.width,l=s.height,p=s.x,c=s.y,h=s.sdf,f=s.pixelRatio,d=new ea({width:u,height:l});ea.copy(t,d,{x:p,y:c},{x:0,y:0},{width:u,height:l}),e[a]={data:d,pixelRatio:f,sdf:h}}r(null,e)}}return{cancel:function(){s&&(s.cancel(),s=null),u&&(u.cancel(),u=null)}}}(t.sprite,this.map._requestManager,(function(t,e){if(r._spriteRequest=null,t)r.fire(new Ft(t));else if(e)for(var i in e)r.imageManager.addImage(i,e[i]);r.imageManager.setLoaded(!0),r.fire(new Rt("data",{dataType:"style"}))})):this.imageManager.setLoaded(!0),this.glyphManager.setURL(t.glyphs);var n=Lp(this.stylesheet.layers);this._order=n.map((function(t){return t.id})),this._layers={};for(var o=0,a=n;o<a.length;o+=1){var s=a[o];(s=eu(s)).setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=s}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Gu(this.stylesheet.light),this.fire(new Rt("data",{dataType:"style"})),this.fire(new Rt("style.load"))}},e.prototype._validateLayer=function(t){var e=this.sourceCaches[t.source];if(e){var r=t.sourceLayer;if(r){var i=e.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(r))&&this.fire(new Ft(new Error('Source layer "'+r+'" does not exist on source "'+i.id+'" as specified by style layer "'+t.id+'"')))}}},e.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},e.prototype._serializeLayers=function(t){for(var e=[],r=0,i=t;r<i.length;r+=1){var n=i[r],o=this._layers[n];"custom"!==o.type&&e.push(o.serialize())}return e},e.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},e.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},e.prototype.update=function(t){if(this._loaded){var e=this._changed;if(this._changed){var r=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(var n in(r.length||i.length)&&this._updateWorkerLayers(r,i),this._updatedSources){var o=this._updatedSources[n];"reload"===o?this._reloadSource(n):"clear"===o&&this._clearSource(n)}for(var a in this._updatedPaintProps)this._layers[a].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}for(var s in this.sourceCaches)this.sourceCaches[s].used=!1;for(var u=0,l=this._order;u<l.length;u+=1){var p=l[u],c=this._layers[p];c.recalculate(t),!c.isHidden(t.zoom)&&c.source&&(this.sourceCaches[c.source].used=!0)}this.light.recalculate(t),this.z=t.zoom,e&&this.fire(new Rt("data",{dataType:"style"}))}},e.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},e.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={}},e.prototype.setState=function(t){var e=this;if(this._checkLoaded(),Rc(this,vi(t)))return!1;(t=w(t)).layers=Lp(t.layers);var r=qp(this.serialize(),t).filter((function(t){return!(t.command in Oc)}));if(0===r.length)return!1;var i=r.filter((function(t){return!(t.command in Fc)}));if(i.length>0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return r.forEach((function(t){"setTransition"!==t.command&&e[t.command].apply(e,t.args)})),this.stylesheet=t,!0},e.prototype.addImage=function(t,e){if(this.getImage(t))return this.fire(new Ft(new Error("An image with this name already exists.")));this.imageManager.addImage(t,e),this.fire(new Rt("data",{dataType:"style"}))},e.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},e.prototype.getImage=function(t){return this.imageManager.getImage(t)},e.prototype.removeImage=function(t){if(!this.getImage(t))return this.fire(new Ft(new Error("No image with this name exists.")));this.imageManager.removeImage(t),this.fire(new Rt("data",{dataType:"style"}))},e.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},e.prototype.addSource=function(t,e,r){var i=this;if(void 0===r&&(r={}),this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!e.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(e).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(e.type)>=0)||!this._validate(vi.source,"sources."+t,e,null,r)){this.map&&this.map._collectResourceTiming&&(e.collectResourceTiming=!0);var n=this.sourceCaches[t]=new Tp(t,e,this.dispatcher);n.style=this,n.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:n.serialize(),sourceId:t}})),n.onAdd(this.map),this._changed=!0}},e.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(var e in this._layers)if(this._layers[e].source===t)return this.fire(new Ft(new Error('Source "'+t+'" cannot be removed while layer "'+e+'" is using it.')));var r=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],r.fire(new Rt("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),r.setEventedParent(null),r.clearTiles(),r.onRemove&&r.onRemove(this.map),this._changed=!0},e.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},e.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},e.prototype.addLayer=function(t,e,r){void 0===r&&(r={}),this._checkLoaded();var i=t.id;if(this.getLayer(i))this.fire(new Ft(new Error('Layer with id "'+i+'" already exists on this map')));else{var n;if("custom"===t.type){if(Rc(this,function(t){var e=[],r=t.id;return void 0===r&&e.push({message:"layers."+r+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+r+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),e}(t)))return;n=eu(t)}else{if("object"==typeof t.source&&(this.addSource(i,t.source),t=h(t=w(t),{source:i})),this._validate(vi.layer,"layers."+i,t,{arrayIndex:-1},r))return;n=eu(t),this._validateLayer(n),n.setEventedParent(this,{layer:{id:i}})}var o=e?this._order.indexOf(e):this._order.length;if(e&&-1===o)this.fire(new Ft(new Error('Layer with id "'+e+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=n,this._removedLayers[i]&&n.source&&"custom"!==n.type){var a=this._removedLayers[i];delete this._removedLayers[i],a.type!==n.type?this._updatedSources[n.source]="clear":(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause())}this._updateLayer(n),n.onAdd&&n.onAdd(this.map)}}},e.prototype.moveLayer=function(t,e){if(this._checkLoaded(),this._changed=!0,this._layers[t]){if(t!==e){var r=this._order.indexOf(t);this._order.splice(r,1);var i=e?this._order.indexOf(e):this._order.length;e&&-1===i?this.fire(new Ft(new Error('Layer with id "'+e+'" does not exist on this map.'))):(this._order.splice(i,0,t),this._layerOrderChanged=!0)}}else this.fire(new Ft(new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")))},e.prototype.removeLayer=function(t){this._checkLoaded();var e=this._layers[t];if(e){e.setEventedParent(null);var r=this._order.indexOf(t);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=e,delete this._layers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],e.onRemove&&e.onRemove(this.map)}else this.fire(new Ft(new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")))},e.prototype.getLayer=function(t){return this._layers[t]},e.prototype.setLayerZoomRange=function(t,e,r){this._checkLoaded();var i=this.getLayer(t);i?i.minzoom===e&&i.maxzoom===r||(null!=e&&(i.minzoom=e),null!=r&&(i.maxzoom=r),this._updateLayer(i)):this.fire(new Ft(new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")))},e.prototype.setFilter=function(t,e,r){void 0===r&&(r={}),this._checkLoaded();var i=this.getLayer(t);if(i){if(!a(i.filter,e))return null==e?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(vi.filter,"layers."+i.id+".filter",e,null,r)||(i.filter=w(e),this._updateLayer(i)))}else this.fire(new Ft(new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")))},e.prototype.getFilter=function(t){return w(this.getLayer(t).filter)},e.prototype.setLayoutProperty=function(t,e,r,i){void 0===i&&(i={}),this._checkLoaded();var n=this.getLayer(t);n?a(n.getLayoutProperty(e),r)||(n.setLayoutProperty(e,r,i),this._updateLayer(n)):this.fire(new Ft(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},e.prototype.getLayoutProperty=function(t,e){var r=this.getLayer(t);if(r)return r.getLayoutProperty(e);this.fire(new Ft(new Error("The layer '"+t+"' does not exist in the map's style.")))},e.prototype.setPaintProperty=function(t,e,r,i){void 0===i&&(i={}),this._checkLoaded();var n=this.getLayer(t);n?a(n.getPaintProperty(e),r)||(n.setPaintProperty(e,r,i)&&this._updateLayer(n),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new Ft(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},e.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},e.prototype.setFeatureState=function(t,e){this._checkLoaded();var r=t.source,i=t.sourceLayer,n=this.sourceCaches[r],o=parseInt(t.id,10);if(void 0!==n){var a=n.getSource().type;"geojson"===a&&i?this.fire(new Ft(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||i?isNaN(o)||o<0?this.fire(new Ft(new Error("The feature id parameter must be provided and non-negative."))):n.setFeatureState(i,o,e):this.fire(new Ft(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new Ft(new Error("The source '"+r+"' does not exist in the map's style.")))},e.prototype.removeFeatureState=function(t,e){this._checkLoaded();var r=t.source,i=this.sourceCaches[r];if(void 0!==i){var n=i.getSource().type,o="vector"===n?t.sourceLayer:void 0,a=parseInt(t.id,10);"vector"!==n||o?void 0!==t.id&&isNaN(a)||a<0?this.fire(new Ft(new Error("The feature id parameter must be non-negative."))):e&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new Ft(new Error("A feature id is requred to remove its specific state property."))):i.removeFeatureState(o,a,e):this.fire(new Ft(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new Ft(new Error("The source '"+r+"' does not exist in the map's style.")))},e.prototype.getFeatureState=function(t){this._checkLoaded();var e=t.source,r=t.sourceLayer,i=this.sourceCaches[e],n=parseInt(t.id,10);if(void 0!==i)if("vector"!==i.getSource().type||r){if(!(isNaN(n)||n<0))return i.getFeatureState(r,n);this.fire(new Ft(new Error("The feature id parameter must be provided and non-negative.")))}else this.fire(new Ft(new Error("The sourceLayer parameter must be provided for vector source types.")));else this.fire(new Ft(new Error("The source '"+e+"' does not exist in the map's style.")))},e.prototype.getTransition=function(){return h({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},e.prototype.serialize=function(){return b({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:x(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},e.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},e.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},i={},n=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(r(a)){i[a]=o;for(var s=0,u=t;s<u.length;s+=1){var l=u[s][a];if(l)for(var p=0,c=l;p<c.length;p+=1){var h=c[p];n.push(h)}}}}n.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var f=[],d=this._order.length-1;d>=0;d--){var m=this._order[d];if(r(m))for(var y=n.length-1;y>=0;y--){var _=n[y].feature;if(i[_.layer.id]<d)break;f.push(_),n.pop()}else for(var v=0,g=t;v<g.length;v+=1){var x=g[v][m];if(x)for(var b=0,w=x;b<w.length;b+=1){var S=w[b];f.push(S.feature)}}}return f},e.prototype.queryRenderedFeatures=function(t,e,r){e&&e.filter&&this._validate(vi.filter,"queryRenderedFeatures.filter",e.filter,null,e);var i={};if(e&&e.layers){if(!Array.isArray(e.layers))return this.fire(new Ft(new Error("parameters.layers must be an Array."))),[];for(var n=0,o=e.layers;n<o.length;n+=1){var a=o[n],s=this._layers[a];if(!s)return this.fire(new Ft(new Error("The layer '"+a+"' does not exist in the map's style and cannot be queried for features."))),[];i[s.source]=!0}}var u=[];for(var l in this.sourceCaches)e.layers&&!i[l]||u.push(Al(this.sourceCaches[l],this._layers,t,e,r));return this.placement&&u.push(function(t,e,r,i,n,o){for(var a={},s=n.queryRenderedSymbols(r),u=[],l=0,p=Object.keys(s).map(Number);l<p.length;l+=1){var c=p[l];u.push(o[c])}u.sort(Tl);for(var h=function(){var e=d[f],r=e.featureIndex.lookupSymbolFeatures(s[e.bucketInstanceId],e.bucketIndex,e.sourceLayerIndex,i.filter,i.layers,t);for(var n in r){var o=a[n]=a[n]||[],u=r[n];u.sort((function(t,r){var i=e.featureSortOrder;if(i){var n=i.indexOf(t.featureIndex);return i.indexOf(r.featureIndex)-n}return r.featureIndex-t.featureIndex}));for(var l=0,p=u;l<p.length;l+=1){var c=p[l];o.push(c)}}},f=0,d=u;f<d.length;f+=1)h();var m=function(r){a[r].forEach((function(i){var n=i.feature,o=t[r],a=e[o.source].getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=a}))};for(var y in a)m(y);return a}(this._layers,this.sourceCaches,t,e,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(u)},e.prototype.querySourceFeatures=function(t,e){e&&e.filter&&this._validate(vi.filter,"querySourceFeatures.filter",e.filter,null,e);var r=this.sourceCaches[t];return r?function(t,e){for(var r=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),i=[],n={},o=0;o<r.length;o++){var a=r[o],s=a.tileID.canonical.key;n[s]||(n[s]=!0,a.querySourceFeatures(i,e))}return i}(r,e):[]},e.prototype.addSourceType=function(t,r,i){return e.getSourceType(t)?i(new Error('A source type called "'+t+'" already exists.')):(e.setSourceType(t,r),r.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:r.workerSourceURL},i):i(null,null))},e.prototype.getLight=function(){return this.light.getLight()},e.prototype.setLight=function(t,e){void 0===e&&(e={}),this._checkLoaded();var r=this.light.getLight(),i=!1;for(var n in t)if(!a(t[n],r[n])){i=!0;break}if(i){var o={now:L.now(),transition:h({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,e),this.light.updateTransitions(o)}},e.prototype._validate=function(t,e,r,i,n){return void 0===n&&(n={}),(!n||!1!==n.validate)&&Rc(this,t.call(vi,h({key:e,style:this.serialize(),value:r,styleSpec:Vt},i)))},e.prototype._remove=function(){for(var t in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),Ni.off("pluginAvailable",this._rtlTextPluginCallback),this.sourceCaches)this.sourceCaches[t].clearTiles();this.dispatcher.remove()},e.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},e.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},e.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},e.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},e.prototype._updatePlacement=function(t,e,r,i){for(var n=!1,o=!1,a={},s=0,u=this._order;s<u.length;s+=1){var l=u[s],p=this._layers[l];if("symbol"===p.type){if(!a[p.source]){var c=this.sourceCaches[p.source];a[p.source]=c.getRenderableIds(!0).map((function(t){return c.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}))}var h=this.crossTileSymbolIndex.addLayer(p,a[p.source],t.center.lng);n=n||h}}this.crossTileSymbolIndex.pruneUnusedLayers(this._order);var f=this._layerOrderChanged||0===r;if((f||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(L.now()))&&(this.pauseablePlacement=new Cc(t,this._order,f,e,r,i,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(L.now()),o=!0),n&&this.pauseablePlacement.placement.setStale()),o||n)for(var d=0,m=this._order;d<m.length;d+=1){var y=m[d],_=this._layers[y];"symbol"===_.type&&this.placement.updateLayerOpacities(_,a[_.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(L.now())},e.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},e.prototype.getImages=function(t,e,r){this.imageManager.getImages(e.icons,r)},e.prototype.getGlyphs=function(t,e,r){this.glyphManager.getGlyphs(e.stacks,r)},e.prototype.getResource=function(t,e,r){return zt(e,r)},e}(Ot);Vc.getSourceType=function(t){return bl[t]},Vc.setSourceType=function(t,e){bl[t]=e},Vc.registerForPluginAvailability=function(t){return Vi?t({pluginURL:Vi,completionCallback:Fi}):Ni.once("pluginAvailable",t),t};var Uc=ln([{name:"a_pos",type:"Int16",components:2}]),Nc=hh("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),jc=hh("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),qc=hh("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}"),Zc=hh("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 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);}"),Gc=hh("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);}"),Wc=hh("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 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;}"),Kc=hh("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","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;}"),Hc=hh("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;}"),Xc=hh("uniform float u_overscale_factor;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;void main() {float alpha=0.5;vec4 color=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {color=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {color*=.2;}float extrude_scale_length=length(v_extrude_scale);float extrude_length=length(v_extrude)*extrude_scale_length;float stroke_width=15.0*extrude_scale_length/u_overscale_factor;float radius=v_radius*extrude_scale_length;float distance_to_edge=abs(extrude_length-radius);float opacity_t=smoothstep(-stroke_width,0.0,-distance_to_edge);gl_FragColor=opacity_t*color;}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;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);highp float padding_factor=1.2;gl_Position.xy+=a_extrude*u_extrude_scale*padding_factor*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;v_radius=abs(a_extrude.y);v_extrude=a_extrude*padding_factor;v_extrude_scale=u_extrude_scale*u_camera_to_center_distance*collision_perspective_ratio;}"),Jc=hh("uniform highp vec4 u_color;void main() {gl_FragColor=u_color;}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Yc=hh("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),Qc=hh("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),$c=hh("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;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec4 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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;}"),th=hh("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec4 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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);}"),eh=hh("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 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;}"),rh=hh("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;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec4 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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\n? a_pos\n: 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;}"),ih=hh("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;return (data.r+data.g*256.0+data.b*256.0*256.0)/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 exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),nh=hh("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;\n#define PI 3.141592653589793\nvoid 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),oh=hh("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat 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);}"),ah=hh("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 float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat 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_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;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);}"),sh=hh("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec4 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x,1.0);float x_b=mod(v_linesofar/pattern_size_b.x,1.0);float y_a=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_a.y+2.0)/2.0)/pattern_size_a.y);float y_b=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_b.y+2.0)/2.0)/pattern_size_b.y);vec2 pos_a=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,vec2(x_a,y_a));vec2 pos_b=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,vec2(x_b,y_b));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nfloat 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);}"),uh=hh("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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat 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);}"),lh=hh("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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),ph=hh("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;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[0],a_size[1],u_size_t)/256.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size[0]/256.0;} else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {size=u_size;} 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);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),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));}"),ch=hh("#define SDF_PX 8.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;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[0],a_size[1],u_size_t)/256.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size[0]/256.0;} else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {size=u_size;} 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);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),0.0,1.0);float gamma_scale=gl_Position.w;vec2 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;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=vec2(tex.x,tex.y);v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}");function hh(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i={};return{fragmentSource:t=t.replace(r,(function(t,e,r,n,o){return i[o]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nvarying "+r+" "+n+" "+o+";\n#else\nuniform "+r+" "+n+" u_"+o+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+o+"\n "+r+" "+n+" "+o+" = u_"+o+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,n,o){var a="float"===n?"vec2":"vec4",s=o.match(/color/)?"color":a;return i[o]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+r+" "+a+" a_"+o+";\nvarying "+r+" "+n+" "+o+";\n#else\nuniform "+r+" "+n+" u_"+o+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = a_"+o+";\n#else\n "+r+" "+n+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = unpack_mix_"+s+"(a_"+o+", u_"+o+"_t);\n#else\n "+r+" "+n+" "+o+" = u_"+o+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+r+" "+a+" a_"+o+";\n#else\nuniform "+r+" "+n+" u_"+o+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+r+" "+n+" "+o+" = a_"+o+";\n#else\n "+r+" "+n+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+r+" "+n+" "+o+" = unpack_mix_"+s+"(a_"+o+", u_"+o+"_t);\n#else\n "+r+" "+n+" "+o+" = u_"+o+";\n#endif\n"}))}}var fh=Object.freeze({prelude:Nc,background:jc,backgroundPattern:qc,circle:Zc,clippingMask:Gc,heatmap:Wc,heatmapTexture:Kc,collisionBox:Hc,collisionCircle:Xc,debug:Jc,fill:Yc,fillOutline:Qc,fillOutlinePattern:$c,fillPattern:th,fillExtrusion:eh,fillExtrusionPattern:rh,hillshadePrepare:ih,hillshade:nh,line:oh,lineGradient:ah,linePattern:sh,lineSDF:uh,raster:lh,symbolIcon:ph,symbolSDF:ch}),dh=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};dh.prototype.bind=function(t,e,r,i,n,o,a,s){this.context=t;for(var u=this.boundPaintVertexBuffers.length!==i.length,l=0;!u&&l<i.length;l++)this.boundPaintVertexBuffers[l]!==i[l]&&(u=!0);var p=!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==r||u||this.boundIndexBuffer!==n||this.boundVertexOffset!==o||this.boundDynamicVertexBuffer!==a||this.boundDynamicVertexBuffer2!==s;!t.extVertexArrayObject||p?this.freshBind(e,r,i,n,o,a,s):(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),n&&n.dynamicDraw&&n.bind(),s&&s.bind())},dh.prototype.freshBind=function(t,e,r,i,n,o,a){var s,u=t.numAttributes,l=this.context,p=l.gl;if(l.extVertexArrayObject)this.vao&&this.destroy(),this.vao=l.extVertexArrayObject.createVertexArrayOES(),l.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=i,this.boundVertexOffset=n,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=a;else{s=l.currentNumAttributes||0;for(var c=u;c<s;c++)p.disableVertexAttribArray(c)}e.enableAttributes(p,t);for(var h=0,f=r;h<f.length;h+=1){f[h].enableAttributes(p,t)}o&&o.enableAttributes(p,t),a&&a.enableAttributes(p,t),e.bind(),e.setVertexAttribPointers(p,t,n);for(var d=0,m=r;d<m.length;d+=1){var y=m[d];y.bind(),y.setVertexAttribPointers(p,t,n)}o&&(o.bind(),o.setVertexAttribPointers(p,t,n)),i&&i.bind(),a&&(a.bind(),a.setVertexAttribPointers(p,t,n)),l.currentNumAttributes=u},dh.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var mh=function(t,e,r,i,n){var o=t.gl;this.program=o.createProgram();var a=r.defines();n&&a.push("#define OVERDRAW_INSPECTOR;");var s=a.concat(Nc.fragmentSource,e.fragmentSource).join("\n"),u=a.concat(Nc.vertexSource,e.vertexSource).join("\n"),l=o.createShader(o.FRAGMENT_SHADER);o.shaderSource(l,s),o.compileShader(l),o.attachShader(this.program,l);var p=o.createShader(o.VERTEX_SHADER);o.shaderSource(p,u),o.compileShader(p),o.attachShader(this.program,p);for(var c=r.layoutAttributes||[],h=0;h<c.length;h++)o.bindAttribLocation(this.program,h,c[h].name);o.linkProgram(this.program),this.numAttributes=o.getProgramParameter(this.program,o.ACTIVE_ATTRIBUTES),this.attributes={};for(var f={},d=0;d<this.numAttributes;d++){var m=o.getActiveAttrib(this.program,d);m&&(this.attributes[m.name]=o.getAttribLocation(this.program,m.name))}for(var y=o.getProgramParameter(this.program,o.ACTIVE_UNIFORMS),_=0;_<y;_++){var v=o.getActiveUniform(this.program,_);v&&(f[v.name]=o.getUniformLocation(this.program,v.name))}this.fixedUniforms=i(t,f),this.binderUniforms=r.getUniforms(t,f)};function yh(t,e,r){var i=1/hc(r,1,e.transform.tileZoom),n=Math.pow(2,r.tileID.overscaledZ),o=r.tileSize*Math.pow(2,e.transform.tileZoom)/n,a=o*(r.tileID.canonical.x+r.tileID.wrap*n),s=o*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[L.devicePixelRatio,i,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}mh.prototype.draw=function(t,e,r,i,n,o,a,s,u,l,p,c,h,f,d,m){var y,_=t.gl;for(var v in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(i),t.setColorMode(n),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[v].set(a[v]);f&&f.setUniforms(t,this.binderUniforms,c,{zoom:h});for(var g=(y={},y[_.LINES]=2,y[_.TRIANGLES]=3,y[_.LINE_STRIP]=1,y)[e],x=0,b=p.get();x<b.length;x+=1){var w=b[x],S=w.vaos||(w.vaos={});(S[s]||(S[s]=new dh)).bind(t,this,u,f?f.getPaintVertexBuffers():[],l,w.vertexOffset,d,m),_.drawElements(e,w.primitiveLength*g,_.UNSIGNED_SHORT,w.primitiveOffset*g*2)}};var _h=function(t,e,r,i){var n=e.style.light,o=n.properties.get("position"),a=[o.x,o.y,o.z],s=function(){var t=new Fo(9);return Fo!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}();"viewport"===n.properties.get("anchor")&&function(t,e){var r=Math.sin(e),i=Math.cos(e);t[0]=i,t[1]=r,t[2]=0,t[3]=-r,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1}(s,-e.transform.angle),function(t,e,r){var i=e[0],n=e[1],o=e[2];t[0]=i*r[0]+n*r[3]+o*r[6],t[1]=i*r[1]+n*r[4]+o*r[7],t[2]=i*r[2]+n*r[5]+o*r[8]}(a,a,s);var u=n.properties.get("color");return{u_matrix:t,u_lightpos:a,u_lightintensity:n.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+r,u_opacity:i}},vh=function(t,e,r,i,n,o,a){return h(_h(t,e,r,i),yh(o,e,a),{u_height_factor:-Math.pow(2,n.overscaledZ)/a.tileSize/8})},gh=function(t){return{u_matrix:t}},xh=function(t,e,r,i){return h(gh(t),yh(r,e,i))},bh=function(t,e){return{u_matrix:t,u_world:e}},wh=function(t,e,r,i,n){return h(xh(t,e,r,i),{u_world:n})},Sh=function(t,e,r,i){var n,o,a=t.transform;if("map"===i.paint.get("circle-pitch-alignment")){var s=hc(r,1,a.zoom);n=!0,o=[s,s]}else n=!1,o=a.pixelsToGLUnits;return{u_camera_to_center_distance:a.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(e.posMatrix,r,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+n,u_device_pixel_ratio:L.devicePixelRatio,u_extrude_scale:o}},Ah=function(t,e){return{u_matrix:new io(t,e.u_matrix),u_camera_to_center_distance:new Yn(t,e.u_camera_to_center_distance),u_pixels_to_tile_units:new Yn(t,e.u_pixels_to_tile_units),u_extrude_scale:new Qn(t,e.u_extrude_scale),u_overscale_factor:new Yn(t,e.u_overscale_factor)}},Th=function(t,e,r){var i=hc(r,1,e.zoom),n=Math.pow(2,e.zoom-r.tileID.overscaledZ),o=r.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:i,u_extrude_scale:[e.pixelsToGLUnits[0]/(i*n),e.pixelsToGLUnits[1]/(i*n)],u_overscale_factor:o}},Ih=function(t,e){return{u_matrix:t,u_color:e}},zh=function(t){return{u_matrix:t}},kh=function(t,e,r,i){return{u_matrix:t,u_extrude_scale:hc(e,1,r),u_intensity:i}},Eh=function(t,e,r,i){var n=Oo();Zo(n,0,t.width,t.height,0,0,1);var o=t.context.gl;return{u_matrix:n,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:r,u_color_ramp:i,u_opacity:e.paint.get("heatmap-opacity")}},Ch=function(t,e,r){var i=r.paint.get("hillshade-shadow-color"),n=r.paint.get("hillshade-highlight-color"),o=r.paint.get("hillshade-accent-color"),a=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(a-=t.transform.angle);var s=!t.options.moving;return{u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),s),u_image:0,u_latrange:Mh(t,e.tileID),u_light:[r.paint.get("hillshade-exaggeration"),a],u_shadow:i,u_highlight:n,u_accent:o}},Ph=function(t,e){var r=t.dem.stride,i=Oo();return Zo(i,0,mo,-mo,0,0,1),No(i,i,[0,-mo,0]),{u_matrix:i,u_image:1,u_dimension:[r,r],u_zoom:t.tileID.overscaledZ,u_maxzoom:e}};function Mh(t,e){var r=Math.pow(2,e.canonical.z),i=e.canonical.y;return[new ol(0,i/r).toLngLat().lat,new ol(0,(i+1)/r).toLngLat().lat]}var Dh=function(t,e,r){var i=t.transform;return{u_matrix:Oh(t,e,r),u_ratio:1/hc(e,1,i.zoom),u_device_pixel_ratio:L.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Lh=function(t,e,r){return h(Dh(t,e,r),{u_image:0})},Bh=function(t,e,r,i){var n=t.transform,o=Fh(e,n);return{u_matrix:Oh(t,e,r),u_texsize:e.imageAtlasTexture.size,u_ratio:1/hc(e,1,n.zoom),u_device_pixel_ratio:L.devicePixelRatio,u_image:0,u_scale:[L.devicePixelRatio,o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}},Rh=function(t,e,r,i,n){var o=t.transform,a=t.lineAtlas,s=Fh(e,o),u="round"===r.layout.get("line-cap"),l=a.getDash(i.from,u),p=a.getDash(i.to,u),c=l.width*n.fromScale,f=p.width*n.toScale;return h(Dh(t,e,r),{u_patternscale_a:[s/c,-l.height/2],u_patternscale_b:[s/f,-p.height/2],u_sdfgamma:a.width/(256*Math.min(c,f)*L.devicePixelRatio)/2,u_image:0,u_tex_y_a:l.y,u_tex_y_b:p.y,u_mix:n.t})};function Fh(t,e){return 1/hc(t,1,e.tileZoom)}function Oh(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Vh=function(t,e,r,i,n){return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.opacity*n.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:n.paint.get("raster-brightness-min"),u_brightness_high:n.paint.get("raster-brightness-max"),u_saturation_factor:(a=n.paint.get("raster-saturation"),a>0?1-1/(1.001-a):-a),u_contrast_factor:(o=n.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:Uh(n.paint.get("raster-hue-rotate"))};var o,a};function Uh(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var Nh=function(t,e,r,i,n,o,a,s,u,l){var p=n.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:p.cameraToCenterDistance,u_pitch:p.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:p.width/p.height,u_fade_change:n.options.fadeDuration?n.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+i,u_texsize:l,u_texture:0}},jh=function(t,e,r,i,n,o,a,s,u,l,p){var c=n.transform;return h(Nh(t,e,r,i,n,o,a,s,u,l),{u_gamma_scale:i?Math.cos(c._pitch)*c.cameraToCenterDistance:1,u_device_pixel_ratio:L.devicePixelRatio,u_is_halo:+p})},qh=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Zh=function(t,e,r,i,n,o){return h(function(t,e,r,i){var n=r.imageManager.getPattern(t.from),o=r.imageManager.getPattern(t.to),a=r.imageManager.getPixelSize(),s=a.width,u=a.height,l=Math.pow(2,i.tileID.overscaledZ),p=i.tileSize*Math.pow(2,r.transform.tileZoom)/l,c=p*(i.tileID.canonical.x+i.tileID.wrap*l),h=p*i.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:n.tl,u_pattern_br_a:n.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,u],u_mix:e.t,u_pattern_size_a:n.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/hc(i,1,r.transform.tileZoom),u_pixel_coord_upper:[c>>16,h>>16],u_pixel_coord_lower:[65535&c,65535&h]}}(i,o,r,n),{u_matrix:t,u_opacity:e})},Gh={fillExtrusion:function(t,e){return{u_matrix:new io(t,e.u_matrix),u_lightpos:new $n(t,e.u_lightpos),u_lightintensity:new Yn(t,e.u_lightintensity),u_lightcolor:new $n(t,e.u_lightcolor),u_vertical_gradient:new Yn(t,e.u_vertical_gradient),u_opacity:new Yn(t,e.u_opacity)}},fillExtrusionPattern:function(t,e){return{u_matrix:new io(t,e.u_matrix),u_lightpos:new $n(t,e.u_lightpos),u_lightintensity:new Yn(t,e.u_lightintensity),u_lightcolor:new $n(t,e.u_lightcolor),u_vertical_gradient:new Yn(t,e.u_vertical_gradient),u_height_factor:new Yn(t,e.u_height_factor),u_image:new Jn(t,e.u_image),u_texsize:new Qn(t,e.u_texsize),u_pixel_coord_upper:new Qn(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new Qn(t,e.u_pixel_coord_lower),u_scale:new to(t,e.u_scale),u_fade:new Yn(t,e.u_fade),u_opacity:new Yn(t,e.u_opacity)}},fill:function(t,e){return{u_matrix:new io(t,e.u_matrix)}},fillPattern:function(t,e){return{u_matrix:new io(t,e.u_matrix),u_image:new Jn(t,e.u_image),u_texsize:new Qn(t,e.u_texsize),u_pixel_coord_upper:new Qn(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new Qn(t,e.u_pixel_coord_lower),u_scale:new to(t,e.u_scale),u_fade:new Yn(t,e.u_fade)}},fillOutline:function(t,e){return{u_matrix:new io(t,e.u_matrix),u_world:new Qn(t,e.u_world)}},fillOutlinePattern:function(t,e){return{u_matrix:new io(t,e.u_matrix),u_world:new Qn(t,e.u_world),u_image:new Jn(t,e.u_image),u_texsize:new Qn(t,e.u_texsize),u_pixel_coord_upper:new Qn(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new Qn(t,e.u_pixel_coord_lower),u_scale:new to(t,e.u_scale),u_fade:new Yn(t,e.u_fade)}},circle:function(t,e){return{u_camera_to_center_distance:new Yn(t,e.u_camera_to_center_distance),u_scale_with_map:new Jn(t,e.u_scale_with_map),u_pitch_with_map:new Jn(t,e.u_pitch_with_map),u_extrude_scale:new Qn(t,e.u_extrude_scale),u_device_pixel_ratio:new Yn(t,e.u_device_pixel_ratio),u_matrix:new io(t,e.u_matrix)}},collisionBox:Ah,collisionCircle:Ah,debug:function(t,e){return{u_color:new eo(t,e.u_color),u_matrix:new io(t,e.u_matrix)}},clippingMask:function(t,e){return{u_matrix:new io(t,e.u_matrix)}},heatmap:function(t,e){return{u_extrude_scale:new Yn(t,e.u_extrude_scale),u_intensity:new Yn(t,e.u_intensity),u_matrix:new io(t,e.u_matrix)}},heatmapTexture:function(t,e){return{u_matrix:new io(t,e.u_matrix),u_world:new Qn(t,e.u_world),u_image:new Jn(t,e.u_image),u_color_ramp:new Jn(t,e.u_color_ramp),u_opacity:new Yn(t,e.u_opacity)}},hillshade:function(t,e){return{u_matrix:new io(t,e.u_matrix),u_image:new Jn(t,e.u_image),u_latrange:new Qn(t,e.u_latrange),u_light:new Qn(t,e.u_light),u_shadow:new eo(t,e.u_shadow),u_highlight:new eo(t,e.u_highlight),u_accent:new eo(t,e.u_accent)}},hillshadePrepare:function(t,e){return{u_matrix:new io(t,e.u_matrix),u_image:new Jn(t,e.u_image),u_dimension:new Qn(t,e.u_dimension),u_zoom:new Yn(t,e.u_zoom),u_maxzoom:new Yn(t,e.u_maxzoom)}},line:function(t,e){return{u_matrix:new io(t,e.u_matrix),u_ratio:new Yn(t,e.u_ratio),u_device_pixel_ratio:new Yn(t,e.u_device_pixel_ratio),u_units_to_pixels:new Qn(t,e.u_units_to_pixels)}},lineGradient:function(t,e){return{u_matrix:new io(t,e.u_matrix),u_ratio:new Yn(t,e.u_ratio),u_device_pixel_ratio:new Yn(t,e.u_device_pixel_ratio),u_units_to_pixels:new Qn(t,e.u_units_to_pixels),u_image:new Jn(t,e.u_image)}},linePattern:function(t,e){return{u_matrix:new io(t,e.u_matrix),u_texsize:new Qn(t,e.u_texsize),u_ratio:new Yn(t,e.u_ratio),u_device_pixel_ratio:new Yn(t,e.u_device_pixel_ratio),u_image:new Jn(t,e.u_image),u_units_to_pixels:new Qn(t,e.u_units_to_pixels),u_scale:new to(t,e.u_scale),u_fade:new Yn(t,e.u_fade)}},lineSDF:function(t,e){return{u_matrix:new io(t,e.u_matrix),u_ratio:new Yn(t,e.u_ratio),u_device_pixel_ratio:new Yn(t,e.u_device_pixel_ratio),u_units_to_pixels:new Qn(t,e.u_units_to_pixels),u_patternscale_a:new Qn(t,e.u_patternscale_a),u_patternscale_b:new Qn(t,e.u_patternscale_b),u_sdfgamma:new Yn(t,e.u_sdfgamma),u_image:new Jn(t,e.u_image),u_tex_y_a:new Yn(t,e.u_tex_y_a),u_tex_y_b:new Yn(t,e.u_tex_y_b),u_mix:new Yn(t,e.u_mix)}},raster:function(t,e){return{u_matrix:new io(t,e.u_matrix),u_tl_parent:new Qn(t,e.u_tl_parent),u_scale_parent:new Yn(t,e.u_scale_parent),u_buffer_scale:new Yn(t,e.u_buffer_scale),u_fade_t:new Yn(t,e.u_fade_t),u_opacity:new Yn(t,e.u_opacity),u_image0:new Jn(t,e.u_image0),u_image1:new Jn(t,e.u_image1),u_brightness_low:new Yn(t,e.u_brightness_low),u_brightness_high:new Yn(t,e.u_brightness_high),u_saturation_factor:new Yn(t,e.u_saturation_factor),u_contrast_factor:new Yn(t,e.u_contrast_factor),u_spin_weights:new $n(t,e.u_spin_weights)}},symbolIcon:function(t,e){return{u_is_size_zoom_constant:new Jn(t,e.u_is_size_zoom_constant),u_is_size_feature_constant:new Jn(t,e.u_is_size_feature_constant),u_size_t:new Yn(t,e.u_size_t),u_size:new Yn(t,e.u_size),u_camera_to_center_distance:new Yn(t,e.u_camera_to_center_distance),u_pitch:new Yn(t,e.u_pitch),u_rotate_symbol:new Jn(t,e.u_rotate_symbol),u_aspect_ratio:new Yn(t,e.u_aspect_ratio),u_fade_change:new Yn(t,e.u_fade_change),u_matrix:new io(t,e.u_matrix),u_label_plane_matrix:new io(t,e.u_label_plane_matrix),u_coord_matrix:new io(t,e.u_coord_matrix),u_is_text:new Yn(t,e.u_is_text),u_pitch_with_map:new Jn(t,e.u_pitch_with_map),u_texsize:new Qn(t,e.u_texsize),u_texture:new Jn(t,e.u_texture)}},symbolSDF:function(t,e){return{u_is_size_zoom_constant:new Jn(t,e.u_is_size_zoom_constant),u_is_size_feature_constant:new Jn(t,e.u_is_size_feature_constant),u_size_t:new Yn(t,e.u_size_t),u_size:new Yn(t,e.u_size),u_camera_to_center_distance:new Yn(t,e.u_camera_to_center_distance),u_pitch:new Yn(t,e.u_pitch),u_rotate_symbol:new Jn(t,e.u_rotate_symbol),u_aspect_ratio:new Yn(t,e.u_aspect_ratio),u_fade_change:new Yn(t,e.u_fade_change),u_matrix:new io(t,e.u_matrix),u_label_plane_matrix:new io(t,e.u_label_plane_matrix),u_coord_matrix:new io(t,e.u_coord_matrix),u_is_text:new Yn(t,e.u_is_text),u_pitch_with_map:new Jn(t,e.u_pitch_with_map),u_texsize:new Qn(t,e.u_texsize),u_texture:new Jn(t,e.u_texture),u_gamma_scale:new Yn(t,e.u_gamma_scale),u_device_pixel_ratio:new Yn(t,e.u_device_pixel_ratio),u_is_halo:new Yn(t,e.u_is_halo)}},background:function(t,e){return{u_matrix:new io(t,e.u_matrix),u_opacity:new Yn(t,e.u_opacity),u_color:new eo(t,e.u_color)}},backgroundPattern:function(t,e){return{u_matrix:new io(t,e.u_matrix),u_opacity:new Yn(t,e.u_opacity),u_image:new Jn(t,e.u_image),u_pattern_tl_a:new Qn(t,e.u_pattern_tl_a),u_pattern_br_a:new Qn(t,e.u_pattern_br_a),u_pattern_tl_b:new Qn(t,e.u_pattern_tl_b),u_pattern_br_b:new Qn(t,e.u_pattern_br_b),u_texsize:new Qn(t,e.u_texsize),u_mix:new Yn(t,e.u_mix),u_pattern_size_a:new Qn(t,e.u_pattern_size_a),u_pattern_size_b:new Qn(t,e.u_pattern_size_b),u_scale_a:new Yn(t,e.u_scale_a),u_scale_b:new Yn(t,e.u_scale_b),u_pixel_coord_upper:new Qn(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new Qn(t,e.u_pixel_coord_lower),u_tile_units_to_pixels:new Yn(t,e.u_tile_units_to_pixels)}}};function Wh(t,e){for(var r=t.sort((function(t,e){return t.tileID.isLessThan(e.tileID)?-1:e.tileID.isLessThan(t.tileID)?1:0})),i=0;i<r.length;i++){var n={},o=r[i],a=r.slice(i+1);Kh(o.tileID.wrapped(),o.tileID,a,new ul(0,o.tileID.wrap+1,0,0,0),n),o.setMask(n,e)}}function Kh(t,e,r,i,n){for(var o=0;o<r.length;o++){var a=r[o];if(i.isLessThan(a.tileID))break;if(e.key===a.tileID.key)return;if(a.tileID.isChildOf(e)){for(var s=e.children(1/0),u=0;u<s.length;u++){Kh(t,s[u],r.slice(o),i,n)}return}}var l=e.overscaledZ-t.overscaledZ,p=new al(l,e.canonical.x-(t.canonical.x<<l),e.canonical.y-(t.canonical.y<<l));n[p.key]=n[p.key]||p}function Hh(t,e,r,i,n){for(var o=t.context,a=o.gl,s=n?t.useProgram("collisionCircle"):t.useProgram("collisionBox"),u=0;u<i.length;u++){var l=i[u],p=e.getTile(l),c=p.getBucket(r);if(c){var h=n?c.collisionCircle:c.collisionBox;h&&s.draw(o,n?a.TRIANGLES:a.LINES,xp.disabled,bp.disabled,t.colorModeForRenderPass(),Sp.disabled,Th(l.posMatrix,t.transform,p),r.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,null,t.transform.zoom,null,null,h.collisionVertexBuffer)}}}var Xh=Vo(new Float32Array(16));function Jh(t,e,r,i,o,a){var s=Ms(t),u=-(s.horizontalAlign-.5)*e,l=-(s.verticalAlign-.5)*r,p=cc(t,i);return new n((u/o+p[0])*a,(l/o+p[1])*a)}function Yh(t,e,r,i,o,a,s,u,l,p){var c=t.text.placedSymbolArray,h=t.text.dynamicLayoutVertexArray;h.clear();for(var f=0;f<c.length;f++){var d=c.get(f),m=t.allowVerticalPlacement&&!d.placedOrientation,y=d.hidden||!d.crossTileID||m?null:i[d.crossTileID];if(y){var _=new n(d.anchorX,d.anchorY),v=Kp(_,r?u:s),g=.5+a.cameraToCenterDistance/v.signedDistanceFromCamera*.5,x=o.evaluateSizeForFeature(t.textSizeData,p,d)*g/Cs;r&&(x*=t.tilePixelRatio/l);for(var b=y.width,w=y.height,S=y.radialOffset,A=y.textBoxScale,T=Jh(y.anchor,b,w,S,A,x),I=r?Kp(_.add(T),s).point:v.point.add(e?T.rotate(-a.angle):T),z=t.allowVerticalPlacement&&d.placedOrientation===Ps.vertical?Math.PI/2:0,k=0;k<d.numGlyphs;k++)Ns(h,I,z)}else rc(d.numGlyphs,h)}t.text.dynamicLayoutVertexBuffer.updateData(h)}function Qh(t){var e=t.text.placedSymbolArray,r=t.text.dynamicLayoutVertexArray;r.clear();for(var i=0;i<e.length;i++){var o=e.get(i);if(o.hidden||!o.placedOrientation)rc(o.numGlyphs,r);else for(var a=new n(o.anchorX,o.anchorY),s=t.allowVerticalPlacement&&o.placedOrientation===Ps.vertical?Math.PI/2:0,u=0;u<o.numGlyphs;u++)Ns(r,a,s)}t.text.dynamicLayoutVertexBuffer.updateData(r)}function $h(t,e,r,i,n,o,a,s,u,l,p,c,h){for(var f,d,m=t.context,y=m.gl,_=t.transform,v="map"===s,g="map"===u,x=v&&"point"!==r.layout.get("symbol-placement"),b=v&&!g&&!x,w=void 0!==r.layout.get("symbol-sort-key").constantOr(1),S=t.depthModeForSublayer(0,xp.ReadOnly),A=r.layout.get("text-variable-anchor"),T=[],I=0,z=i;I<z.length;I+=1){var k=z[I],E=e.getTile(k),C=E.getBucket(r);if(C){var P=n?C.text:C.icon;if(P&&P.segments.get().length){var M=P.programConfigurations.get(r.id),D=n||C.sdfIcons,L=n?C.textSizeData:C.iconSizeData;f||(f=t.useProgram(D?"symbolSDF":"symbolIcon",M),d=Rs(L,_.zoom)),m.activeTexture.set(y.TEXTURE0);var B=void 0,R=void 0,F=void 0;if(n)R=E.glyphAtlasTexture,F=y.LINEAR,B=E.glyphAtlasTexture.size;else{var O=1!==r.layout.get("icon-size").constantOr(0)||C.iconsNeedLinear,V=g||0!==_.pitch;R=E.imageAtlasTexture,F=D||t.options.rotating||t.options.zooming||O||V?y.LINEAR:y.NEAREST,B=E.imageAtlasTexture.size}var U=hc(E,1,t.transform.zoom),N=Gp(k.posMatrix,g,v,t.transform,U),j=Wp(k.posMatrix,g,v,t.transform,U);if(x)Xp(C,k.posMatrix,t,n,N,j,g,l);else if(n&&d&&A){var q=Math.pow(2,_.zoom-E.tileID.overscaledZ);Yh(C,v,g,h,Fs,_,N,k.posMatrix,q,d)}else n&&d&&C.allowVerticalPlacement&&Qh(C);var Z=t.translatePosMatrix(k.posMatrix,E,o,a),G=x||n&&A?Xh:N,W=t.translatePosMatrix(j,E,o,a,!0),K=D&&0!==r.paint.get(n?"text-halo-width":"icon-halo-width").constantOr(1),H={program:f,buffers:P,uniformValues:D?jh(L.kind,d,b,g,t,Z,G,W,n,B,!0):Nh(L.kind,d,b,g,t,Z,G,W,n,B),atlasTexture:R,atlasInterpolation:F,isSDF:D,hasHalo:K};if(w)for(var X=0,J=P.segments.get();X<J.length;X+=1){var Y=J[X];T.push({segments:new Gn([Y]),sortKey:Y.sortKey,state:H})}else T.push({segments:P.segments,sortKey:0,state:H})}}}w&&T.sort((function(t,e){return t.sortKey-e.sortKey}));for(var Q=0,$=T;Q<$.length;Q+=1){var tt=$[Q],et=tt.state;if(et.atlasTexture.bind(et.atlasInterpolation,y.CLAMP_TO_EDGE),et.isSDF){var rt=et.uniformValues;et.hasHalo&&(rt.u_is_halo=1,tf(et.buffers,tt.segments,r,t,et.program,S,p,c,rt)),rt.u_is_halo=0}tf(et.buffers,tt.segments,r,t,et.program,S,p,c,et.uniformValues)}}function tf(t,e,r,i,n,o,a,s,u){var l=i.context,p=l.gl;n.draw(l,p.TRIANGLES,o,a,s,Sp.disabled,u,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,i.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function ef(t,e,r,i,n,o,a){var s,u,l,p,c,h=t.context.gl,f=r.paint.get("fill-pattern"),d=f&&f.constantOr(1),m=r.getCrossfadeParameters();a?(u=d&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=h.LINES):(u=d?"fillPattern":"fill",s=h.TRIANGLES);for(var y=0,_=i;y<_.length;y+=1){var v=_[y],g=e.getTile(v);if(!d||g.patternsLoaded()){var x=g.getBucket(r);if(x){var b=x.programConfigurations.get(r.id),w=t.useProgram(u,b);d&&(t.context.activeTexture.set(h.TEXTURE0),g.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),b.updatePatternPaintBuffers(m));var S=f.constantOr(null);if(S&&g.imageAtlas){var A=g.imageAtlas.patternPositions[S.to],T=g.imageAtlas.patternPositions[S.from];A&&T&&b.setConstantPatternPositions(A,T)}var I=t.translatePosMatrix(v.posMatrix,g,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(a){p=x.indexBuffer2,c=x.segments2;var z=[h.drawingBufferWidth,h.drawingBufferHeight];l="fillOutlinePattern"===u&&d?wh(I,t,m,g,z):bh(I,z)}else p=x.indexBuffer,c=x.segments,l=d?xh(I,t,m,g):gh(I);w.draw(t.context,s,n,t.stencilModeForClipping(v),o,Sp.disabled,l,r.id,x.layoutVertexBuffer,p,c,r.paint,t.transform.zoom,b)}}}}function rf(t,e,r,i,n,o,a){for(var s=t.context,u=s.gl,l=r.paint.get("fill-extrusion-pattern"),p=l.constantOr(1),c=r.getCrossfadeParameters(),h=r.paint.get("fill-extrusion-opacity"),f=0,d=i;f<d.length;f+=1){var m=d[f],y=e.getTile(m),_=y.getBucket(r);if(_){var v=_.programConfigurations.get(r.id),g=t.useProgram(p?"fillExtrusionPattern":"fillExtrusion",v);p&&(t.context.activeTexture.set(u.TEXTURE0),y.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),v.updatePatternPaintBuffers(c));var x=l.constantOr(null);if(x&&y.imageAtlas){var b=y.imageAtlas.patternPositions[x.to],w=y.imageAtlas.patternPositions[x.from];b&&w&&v.setConstantPatternPositions(b,w)}var S=t.translatePosMatrix(m.posMatrix,y,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),A=r.paint.get("fill-extrusion-vertical-gradient"),T=p?vh(S,t,A,h,m,c,y):_h(S,t,A,h);g.draw(s,s.gl.TRIANGLES,n,o,a,Sp.backCCW,T,r.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,r.paint,t.transform.zoom,v)}}}function nf(t,e,r,i,n,o){var a=t.context,s=a.gl,u=e.fbo;if(u){var l=t.useProgram("hillshade");a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,u.colorAttachment.get());var p=Ch(t,e,r);e.maskedBoundsBuffer&&e.maskedIndexBuffer&&e.segments?l.draw(a,s.TRIANGLES,i,n,o,Sp.disabled,p,r.id,e.maskedBoundsBuffer,e.maskedIndexBuffer,e.segments):l.draw(a,s.TRIANGLES,i,n,o,Sp.disabled,p,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}function of(t,e,r,i,n,o,a){var s=t.context,u=s.gl;if(e.dem&&e.dem.data){var l=e.dem.dim,p=e.dem.stride,c=e.dem.getPixels();if(s.activeTexture.set(u.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),e.demTexture=e.demTexture||t.getTileTexture(p),e.demTexture){var h=e.demTexture;h.update(c,{premultiply:!1}),h.bind(u.NEAREST,u.CLAMP_TO_EDGE)}else e.demTexture=new pu(s,c,u.RGBA,{premultiply:!1}),e.demTexture.bind(u.NEAREST,u.CLAMP_TO_EDGE);s.activeTexture.set(u.TEXTURE0);var f=e.fbo;if(!f){var d=new pu(s,{width:l,height:l,data:null},u.RGBA);d.bind(u.LINEAR,u.CLAMP_TO_EDGE),(f=e.fbo=s.createFramebuffer(l,l)).colorAttachment.set(d.texture)}s.bindFramebuffer.set(f.framebuffer),s.viewport.set([0,0,l,l]),t.useProgram("hillshadePrepare").draw(s,u.TRIANGLES,n,o,a,Sp.disabled,Ph(e,i),r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),e.needsHillshadePrepare=!1}}function af(t,e,r,i,n){var o=i.paint.get("raster-fade-duration");if(o>0){var a=L.now(),s=(a-t.timeAdded)/o,u=e?(a-e.timeAdded)/o:-1,p=r.getSource(),c=n.coveringZoomLevel({tileSize:p.tileSize,roundZoom:p.roundZoom}),h=!e||Math.abs(e.tileID.overscaledZ-c)>Math.abs(t.tileID.overscaledZ-c),f=h&&t.refreshedUponExpiration?1:l(h?s:1-u,0,1);return t.refreshedUponExpiration&&s>=1&&(t.refreshedUponExpiration=!1),e?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}function sf(t,e,r){var i=t.context,n=i.gl,o=r.posMatrix,a=t.useProgram("debug"),s=xp.disabled,u=bp.disabled,l=t.colorModeForRenderPass(),p="$debug";a.draw(i,n.LINE_STRIP,s,u,l,Sp.disabled,Ih(o,ue.red),p,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments);for(var c=e.getTileByID(r.key).latestRawTileData,h=c&&c.byteLength||0,f=Math.floor(h/1024),d=e.getTile(r).tileSize,m=512/Math.min(d,512),y=function(t,e,r,i){i=i||1;var n,o,a,s,u,l,p,c,h=[];for(n=0,o=t.length;n<o;n++)if(u=uf[t[n]]){for(c=null,a=0,s=u[1].length;a<s;a+=2)-1===u[1][a]&&-1===u[1][a+1]?c=null:(l=e+u[1][a]*i,p=r-u[1][a+1]*i,c&&h.push(c.x,c.y,l,p),c={x:l,y:p});e+=u[0]*i}return h}(r.toString()+" "+f+"kb",50,200*m,5*m),_=new cn,v=new kn,g=0;g<y.length;g+=2)_.emplaceBack(y[g],y[g+1]),v.emplaceBack(g,g+1);for(var x=i.createVertexBuffer(_,Uc.members),b=i.createIndexBuffer(v),w=Gn.simpleSegment(0,0,_.length/2,_.length/2),S=mo/(Math.pow(2,t.transform.zoom-r.overscaledZ)*d*m),A=[],T=-1;T<=1;T++)for(var I=-1;I<=1&&(0!==T||0!==I);I++)A.push([T,I]);for(var z=0;z<A.length;z++){var k=A[z];a.draw(i,n.LINES,s,u,l,Sp.disabled,Ih(No([],o,[S*k[0],S*k[1],0]),ue.white),p,x,b,w)}a.draw(i,n.LINES,s,u,l,Sp.disabled,Ih(o,ue.black),p,x,b,w)}var uf={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};var lf={symbol:function(t,e,r,i,n){if("translucent"===t.renderPass){var o=bp.disabled,a=t.colorModeForRenderPass();0!==r.paint.get("icon-opacity").constantOr(1)&&$h(t,e,r,i,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),o,a,n),0!==r.paint.get("text-opacity").constantOr(1)&&$h(t,e,r,i,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),o,a,n),e.map.showCollisionBoxes&&function(t,e,r,i){Hh(t,e,r,i,!1),Hh(t,e,r,i,!0)}(t,e,r,i)}},circle:function(t,e,r,i){if("translucent"===t.renderPass){var n=r.paint.get("circle-opacity"),o=r.paint.get("circle-stroke-width"),a=r.paint.get("circle-stroke-opacity"),s=void 0!==r.layout.get("circle-sort-key").constantOr(1);if(0!==n.constantOr(1)||0!==o.constantOr(1)&&0!==a.constantOr(1)){for(var u=t.context,l=u.gl,p=t.depthModeForSublayer(0,xp.ReadOnly),c=bp.disabled,h=t.colorModeForRenderPass(),f=[],d=0;d<i.length;d++){var m=i[d],y=e.getTile(m),_=y.getBucket(r);if(_){var v=_.programConfigurations.get(r.id),g={programConfiguration:v,program:t.useProgram("circle",v),layoutVertexBuffer:_.layoutVertexBuffer,indexBuffer:_.indexBuffer,uniformValues:Sh(t,m,y,r)};if(s)for(var x=0,b=_.segments.get();x<b.length;x+=1){var w=b[x];f.push({segments:new Gn([w]),sortKey:w.sortKey,state:g})}else f.push({segments:_.segments,sortKey:0,state:g})}}s&&f.sort((function(t,e){return t.sortKey-e.sortKey}));for(var S=0,A=f;S<A.length;S+=1){var T=A[S],I=T.state,z=I.programConfiguration,k=I.program,E=I.layoutVertexBuffer,C=I.indexBuffer,P=I.uniformValues,M=T.segments;k.draw(u,l.TRIANGLES,p,c,h,Sp.disabled,P,r.id,E,C,M,r.paint,t.transform.zoom,z)}}}},heatmap:function(t,e,r,i){if(0!==r.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){var n=t.context,o=n.gl,a=t.depthModeForSublayer(0,xp.ReadOnly),s=bp.disabled,u=new wp([o.ONE,o.ONE],ue.transparent,[!0,!0,!0,!0]);!function(t,e,r){var i=t.gl;t.activeTexture.set(i.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var n=r.heatmapFbo;if(n)i.bindTexture(i.TEXTURE_2D,n.colorAttachment.get()),t.bindFramebuffer.set(n.framebuffer);else{var o=i.createTexture();i.bindTexture(i.TEXTURE_2D,o),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),n=r.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4),function t(e,r,i,n){var o=e.gl;o.texImage2D(o.TEXTURE_2D,0,o.RGBA,r.width/4,r.height/4,0,o.RGBA,e.extTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:o.UNSIGNED_BYTE,null);n.colorAttachment.set(i);e.extTextureHalfFloat&&o.checkFramebufferStatus(o.FRAMEBUFFER)!==o.FRAMEBUFFER_COMPLETE&&(e.extTextureHalfFloat=null,n.colorAttachment.setDirty(),t(e,r,i,n))}(t,e,o,n)}}(n,t,r),n.clear({color:ue.transparent});for(var l=0;l<i.length;l++){var p=i[l];if(!e.hasRenderableParent(p)){var c=e.getTile(p),h=c.getBucket(r);if(h){var f=h.programConfigurations.get(r.id),d=t.useProgram("heatmap",f),m=t.transform.zoom;d.draw(n,o.TRIANGLES,a,s,u,Sp.disabled,kh(p.posMatrix,c,m,r.paint.get("heatmap-intensity")),r.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,r.paint,t.transform.zoom,f)}}}n.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,e){var r=t.context,i=r.gl,n=e.heatmapFbo;if(!n)return;r.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,n.colorAttachment.get()),r.activeTexture.set(i.TEXTURE1);var o=e.colorRampTexture;o||(o=e.colorRampTexture=new pu(r,e.colorRamp,i.RGBA));o.bind(i.LINEAR,i.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(r,i.TRIANGLES,xp.disabled,bp.disabled,t.colorModeForRenderPass(),Sp.disabled,Eh(t,e,0,1),e.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,e.paint,t.transform.zoom)}(t,r))},line:function(t,e,r,i){if("translucent"===t.renderPass){var n=r.paint.get("line-opacity"),o=r.paint.get("line-width");if(0!==n.constantOr(1)&&0!==o.constantOr(1)){var a=t.depthModeForSublayer(0,xp.ReadOnly),s=t.colorModeForRenderPass(),u=r.paint.get("line-dasharray"),l=r.paint.get("line-pattern"),p=l.constantOr(1),c=r.paint.get("line-gradient"),h=r.getCrossfadeParameters(),f=u?"lineSDF":p?"linePattern":c?"lineGradient":"line",d=t.context,m=d.gl,y=!0;if(c){d.activeTexture.set(m.TEXTURE0);var _=r.gradientTexture;if(!r.gradient)return;_||(_=r.gradientTexture=new pu(d,r.gradient,m.RGBA)),_.bind(m.LINEAR,m.CLAMP_TO_EDGE)}for(var v=0,g=i;v<g.length;v+=1){var x=g[v],b=e.getTile(x);if(!p||b.patternsLoaded()){var w=b.getBucket(r);if(w){var S=w.programConfigurations.get(r.id),A=t.context.program.get(),T=t.useProgram(f,S),I=y||T.program!==A,z=l.constantOr(null);if(z&&b.imageAtlas){var k=b.imageAtlas.patternPositions[z.to],E=b.imageAtlas.patternPositions[z.from];k&&E&&S.setConstantPatternPositions(k,E)}var C=u?Rh(t,b,r,u,h):p?Bh(t,b,r,h):c?Lh(t,b,r):Dh(t,b,r);u&&(I||t.lineAtlas.dirty)?(d.activeTexture.set(m.TEXTURE0),t.lineAtlas.bind(d)):p&&(d.activeTexture.set(m.TEXTURE0),b.imageAtlasTexture.bind(m.LINEAR,m.CLAMP_TO_EDGE),S.updatePatternPaintBuffers(h)),T.draw(d,m.TRIANGLES,a,t.stencilModeForClipping(x),s,Sp.disabled,C,r.id,w.layoutVertexBuffer,w.indexBuffer,w.segments,r.paint,t.transform.zoom,S),y=!1}}}}}},fill:function(t,e,r,i){var n=r.paint.get("fill-color"),o=r.paint.get("fill-opacity");if(0!==o.constantOr(1)){var a=t.colorModeForRenderPass(),s=r.paint.get("fill-pattern"),u=t.opaquePassEnabledForLayer()&&!s.constantOr(1)&&1===n.constantOr(ue.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(t.renderPass===u){var l=t.depthModeForSublayer(1,"opaque"===t.renderPass?xp.ReadWrite:xp.ReadOnly);ef(t,e,r,i,l,a,!1)}if("translucent"===t.renderPass&&r.paint.get("fill-antialias")){var p=t.depthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,xp.ReadOnly);ef(t,e,r,i,p,a,!0)}}},"fill-extrusion":function(t,e,r,i){var n=r.paint.get("fill-extrusion-opacity");if(0!==n&&"translucent"===t.renderPass){var o=new xp(t.context.gl.LEQUAL,xp.ReadWrite,t.depthRangeFor3D);if(1!==n||r.paint.get("fill-extrusion-pattern").constantOr(1))rf(t,e,r,i,o,bp.disabled,wp.disabled),rf(t,e,r,i,o,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var a=t.colorModeForRenderPass();rf(t,e,r,i,o,bp.disabled,a)}}},hillshade:function(t,e,r,i){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var n=t.context,o=e.getSource().maxzoom,a=t.depthModeForSublayer(0,xp.ReadOnly),s=bp.disabled,u=t.colorModeForRenderPass(),l=0,p=i;l<p.length;l+=1){var c=p[l],h=e.getTile(c);h.needsHillshadePrepare&&"offscreen"===t.renderPass?of(t,h,r,o,a,s,u):"translucent"===t.renderPass&&nf(t,h,r,a,s,u)}n.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,r,i){if("translucent"===t.renderPass&&0!==r.paint.get("raster-opacity"))for(var n=t.context,o=n.gl,a=e.getSource(),s=t.useProgram("raster"),u=bp.disabled,l=t.colorModeForRenderPass(),p=i.length&&i[0].overscaledZ,c=!t.options.moving,h=0,f=i;h<f.length;h+=1){var d=f[h],m=t.depthModeForSublayer(d.overscaledZ-p,1===r.paint.get("raster-opacity")?xp.ReadWrite:xp.ReadOnly,o.LESS),y=e.getTile(d),_=t.transform.calculatePosMatrix(d.toUnwrapped(),c);y.registerFadeDuration(r.paint.get("raster-fade-duration"));var v=e.findLoadedParent(d,0),g=af(y,v,e,r,t.transform),x=void 0,b=void 0,w="nearest"===r.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;n.activeTexture.set(o.TEXTURE0),y.texture.bind(w,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),n.activeTexture.set(o.TEXTURE1),v?(v.texture.bind(w,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),x=Math.pow(2,v.tileID.overscaledZ-y.tileID.overscaledZ),b=[y.tileID.canonical.x*x%1,y.tileID.canonical.y*x%1]):y.texture.bind(w,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);var S=Vh(_,b||[0,0],x||1,g,r);a instanceof vl?s.draw(n,o.TRIANGLES,m,u,l,Sp.disabled,S,r.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):y.maskedBoundsBuffer&&y.maskedIndexBuffer&&y.segments?s.draw(n,o.TRIANGLES,m,u,l,Sp.disabled,S,r.id,y.maskedBoundsBuffer,y.maskedIndexBuffer,y.segments,r.paint,t.transform.zoom):s.draw(n,o.TRIANGLES,m,u,l,Sp.disabled,S,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,r){var i=r.paint.get("background-color"),n=r.paint.get("background-opacity");if(0!==n){var o=t.context,a=o.gl,s=t.transform,u=s.tileSize,l=r.paint.get("background-pattern");if(!t.isPatternMissing(l)){var p=!l&&1===i.a&&1===n&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===p){var c=bp.disabled,h=t.depthModeForSublayer(0,"opaque"===p?xp.ReadWrite:xp.ReadOnly),f=t.colorModeForRenderPass(),d=t.useProgram(l?"backgroundPattern":"background"),m=s.coveringTiles({tileSize:u});l&&(o.activeTexture.set(a.TEXTURE0),t.imageManager.bind(t.context));for(var y=r.getCrossfadeParameters(),_=0,v=m;_<v.length;_+=1){var g=v[_],x=t.transform.calculatePosMatrix(g.toUnwrapped()),b=l?Zh(x,n,t,l,{tileID:g,tileSize:u},y):qh(x,n,i);d.draw(o,a.TRIANGLES,h,c,f,Sp.disabled,b,r.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,r){for(var i=0;i<r.length;i++)sf(t,e,r[i])},custom:function(t,e,r){var i=t.context,n=r.implementation;if("offscreen"===t.renderPass){var o=n.prerender;o&&(t.setCustomLayerDefaults(),i.setColorMode(t.colorModeForRenderPass()),o.call(n,i.gl,t.transform.customLayerMatrix()),i.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),i.setColorMode(t.colorModeForRenderPass()),i.setStencilMode(bp.disabled);var a="3d"===n.renderingMode?new xp(t.context.gl.LEQUAL,xp.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,xp.ReadOnly);i.setDepthMode(a),n.render(i.gl,t.transform.customLayerMatrix()),i.setDirty(),t.setBaseState(),i.bindFramebuffer.set(null)}}},pf=function(t,e){this.context=new Ap(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=Tp.maxUnderzooming+Tp.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.depthRboNeedsClear=!0,this.emptyProgramConfiguration=new po,this.crossTileSymbolIndex=new Bc};function cf(t,e){if(t.y>e.y){var r=t;t=e,e=r}return{x0:t.x,y0:t.y,x1:e.x,y1:e.y,dx:e.x-t.x,dy:e.y-t.y}}function hf(t,e,r,i,n){var o=Math.max(r,Math.floor(e.y0)),a=Math.min(i,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx<e.x1:t.x1-e.dy/t.dy*t.dx<e.x0){var s=t;t=e,e=s}for(var u=t.dx/t.dy,l=e.dx/e.dy,p=t.dx>0,c=e.dx<0,h=o;h<a;h++){var f=u*Math.max(0,Math.min(t.dy,h+p-t.y0))+t.x0,d=l*Math.max(0,Math.min(e.dy,h+c-e.y0))+e.x0;n(Math.floor(d),Math.ceil(f),h)}}function ff(t,e,r,i,n,o){var a,s=cf(t,e),u=cf(e,r),l=cf(r,t);s.dy>u.dy&&(a=s,s=u,u=a),s.dy>l.dy&&(a=s,s=l,l=a),u.dy>l.dy&&(a=u,u=l,l=a),s.dy&&hf(l,s,i,n,o),u.dy&&hf(l,u,i,n,o)}pf.prototype.resize=function(t,e){var r=this.context.gl;if(this.width=t*L.devicePixelRatio,this.height=e*L.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var i=0,n=this.style._order;i<n.length;i+=1){var o=n[i];this.style._layers[o].resize()}this.depthRbo&&(r.deleteRenderbuffer(this.depthRbo),this.depthRbo=null)},pf.prototype.setup=function(){var t=this.context,e=new cn;e.emplaceBack(0,0),e.emplaceBack(mo,0),e.emplaceBack(0,mo),e.emplaceBack(mo,mo),this.tileExtentBuffer=t.createVertexBuffer(e,Uc.members),this.tileExtentSegments=Gn.simpleSegment(0,0,4,2);var r=new cn;r.emplaceBack(0,0),r.emplaceBack(mo,0),r.emplaceBack(0,mo),r.emplaceBack(mo,mo),this.debugBuffer=t.createVertexBuffer(r,Uc.members),this.debugSegments=Gn.simpleSegment(0,0,4,5);var i=new hn;i.emplaceBack(0,0,0,0),i.emplaceBack(mo,0,mo,0),i.emplaceBack(0,mo,0,mo),i.emplaceBack(mo,mo,mo,mo),this.rasterBoundsBuffer=t.createVertexBuffer(i,_l.members),this.rasterBoundsSegments=Gn.simpleSegment(0,0,4,2);var n=new cn;n.emplaceBack(0,0),n.emplaceBack(1,0),n.emplaceBack(0,1),n.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(n,Uc.members),this.viewportSegments=Gn.simpleSegment(0,0,4,2);var o=new En;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(o);var a=new zn;a.emplaceBack(0,1,2),a.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(a);var s=this.context.gl;this.stencilClearMode=new bp({func:s.ALWAYS,mask:0},0,255,s.ZERO,s.ZERO,s.ZERO)},pf.prototype.clearStencil=function(){var t=this.context,e=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var r=Oo();Zo(r,0,this.width,this.height,0,0,1),jo(r,r,[e.drawingBufferWidth,e.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,e.TRIANGLES,xp.disabled,this.stencilClearMode,wp.disabled,Sp.disabled,zh(r),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},pf.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var r=this.context,i=r.gl;this.nextStencilID+e.length>256&&this.clearStencil(),r.setColorMode(wp.disabled),r.setDepthMode(xp.disabled);var n=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o<a.length;o+=1){var s=a[o],u=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;n.draw(r,i.TRIANGLES,xp.disabled,new bp({func:i.ALWAYS,mask:0},u,255,i.KEEP,i.KEEP,i.REPLACE),wp.disabled,Sp.disabled,zh(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},pf.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new bp({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},pf.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new bp({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},pf.prototype.colorModeForRenderPass=function(){var t=this.context.gl;if(this._showOverdrawInspector){return new wp([t.CONSTANT_COLOR,t.ONE],new ue(1/8,1/8,1/8,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?wp.unblended:wp.alphaBlended},pf.prototype.depthModeForSublayer=function(t,e,r){if(!this.opaquePassEnabledForLayer())return xp.disabled;var i=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new xp(r||this.context.gl.LEQUAL,e,[i,i])},pf.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},pf.prototype.render=function(t,e){this.style=t,this.options=e,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(L.now()),this.imageManager.beginFrame();var r=this.style._order,i=this.style.sourceCaches;for(var n in i){var o=i[n];o.used&&o.prepare(this.context)}var a={},s={},u={};for(var l in i){var p=i[l];a[l]=p.getVisibleCoordinates(),s[l]=a[l].slice().reverse(),u[l]=p.getVisibleCoordinates(!0).reverse()}for(var c in i){var h=i[c],f=h.getSource();if("raster"===f.type||"raster-dem"===f.type){for(var d=[],m=0,y=a[c];m<y.length;m+=1){var _=y[m];d.push(h.getTile(_))}Wh(d,this.context)}}this.opaquePassCutoff=1/0;for(var v=0;v<r.length;v++){var g=r[v];if(this.style._layers[g].is3D()){this.opaquePassCutoff=v;break}}this.renderPass="offscreen",this.depthRboNeedsClear=!0;for(var x=0,b=r;x<b.length;x+=1){var w=b[x],S=this.style._layers[w];if(S.hasOffscreenPass()&&!S.isHidden(this.transform.zoom)){var A=s[S.source];("custom"===S.type||A.length)&&this.renderLayer(this,i[S.source],S,A)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:e.showOverdrawInspector?ue.black:ue.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=e.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=r.length-1;this.currentLayer>=0;this.currentLayer--){var T=this.style._layers[r[this.currentLayer]],I=i[T.source],z=a[T.source];this._renderTileClippingMasks(T,z),this.renderLayer(this,I,T,z)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<r.length;this.currentLayer++){var k=this.style._layers[r[this.currentLayer]],E=i[k.source],C=("symbol"===k.type?u:s)[k.source];this._renderTileClippingMasks(k,a[k.source]),this.renderLayer(this,E,k,C)}if(this.options.showTileBoundaries)for(var P in i){lf.debug(this,i[P],a[P]);break}this.context.setDefault()},pf.prototype.setupOffscreenDepthRenderbuffer=function(){var t=this.context;this.depthRbo||(this.depthRbo=t.createRenderbuffer(t.gl.DEPTH_COMPONENT16,this.width,this.height))},pf.prototype.renderLayer=function(t,e,r,i){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||i.length)&&(this.id=r.id,lf[r.type](t,e,r,i,this.style.placement.variableOffsets))},pf.prototype.translatePosMatrix=function(t,e,r,i,n){if(!r[0]&&!r[1])return t;var o=n?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(o){var a=Math.sin(o),s=Math.cos(o);r=[r[0]*s-r[1]*a,r[0]*a+r[1]*s]}var u=[n?r[0]:hc(e,r[0],this.transform.zoom),n?r[1]:hc(e,r[1],this.transform.zoom),0],l=new Float32Array(16);return No(l,t,u),l},pf.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},pf.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},pf.prototype.isPatternMissing=function(t){if(!t)return!1;var e=this.imageManager.getPattern(t.from),r=this.imageManager.getPattern(t.to);return!e||!r},pf.prototype.useProgram=function(t,e){void 0===e&&(e=this.emptyProgramConfiguration),this.cache=this.cache||{};var r=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new mh(this.context,fh[t],e,Gh[t],this._showOverdrawInspector)),this.cache[r]},pf.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()},pf.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)};var df=function(t,e,r){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===r||r,this._minZoom=t||0,this._maxZoom=e||22,this.setMaxBounds(),this.width=0,this.height=0,this._center=new Qu(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={},this._alignedPosMatrixCache={}},mf={minZoom:{configurable:!0},maxZoom:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerPoint:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};df.prototype.clone=function(){var t=new df(this._minZoom,this._maxZoom,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._calcMatrices(),t},mf.minZoom.get=function(){return this._minZoom},mf.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},mf.maxZoom.get=function(){return this._maxZoom},mf.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},mf.renderWorldCopies.get=function(){return this._renderWorldCopies},mf.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},mf.worldSize.get=function(){return this.tileSize*this.scale},mf.centerPoint.get=function(){return this.size._div(2)},mf.size.get=function(){return new n(this.width,this.height)},mf.bearing.get=function(){return-this.angle/Math.PI*180},mf.bearing.set=function(t){var e=-p(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=function(){var t=new Fo(4);return Fo!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}(),function(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);t[0]=i*u+o*s,t[1]=n*u+a*s,t[2]=i*-s+o*u,t[3]=n*-s+a*u}(this.rotationMatrix,this.rotationMatrix,this.angle))},mf.pitch.get=function(){return this._pitch/Math.PI*180},mf.pitch.set=function(t){var e=l(t,0,60)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},mf.fov.get=function(){return this._fov/Math.PI*180},mf.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},mf.zoom.get=function(){return this._zoom},mf.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},mf.center.get=function(){return this._center},mf.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},df.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},df.prototype.getVisibleUnwrappedCoordinates=function(t){var e=[new sl(0,t)];if(this._renderWorldCopies)for(var r=this.pointCoordinate(new n(0,0)),i=this.pointCoordinate(new n(this.width,0)),o=this.pointCoordinate(new n(this.width,this.height)),a=this.pointCoordinate(new n(0,this.height)),s=Math.floor(Math.min(r.x,i.x,o.x,a.x)),u=Math.floor(Math.max(r.x,i.x,o.x,a.x)),l=s-1;l<=u+1;l++)0!==l&&e.push(new sl(l,t));return e},df.prototype.coveringTiles=function(t){var e=this.coveringZoomLevel(t),r=e;if(void 0!==t.minzoom&&e<t.minzoom)return[];void 0!==t.maxzoom&&e>t.maxzoom&&(e=t.maxzoom);var i=ol.fromLngLat(this.center),o=Math.pow(2,e),a=new n(o*i.x-.5,o*i.y-.5);return function(t,e,r,i){void 0===i&&(i=!0);var o=1<<t,a={};function s(e,n,s){var u,l,p;if(s>=0&&s<=o)for(u=e;u<n;u++)0!==(l=Math.floor(u/o))&&!0!==i||(p=new ul(r,l,t,(u%o+o)%o,s),a[p.key]=p)}var u=e.map((function(t){return new n(t.x,t.y)._mult(o)}));return ff(u[0],u[1],u[2],0,o,s),ff(u[2],u[3],u[0],0,o,s),Object.keys(a).map((function(t){return a[t]}))}(e,[this.pointCoordinate(new n(0,0)),this.pointCoordinate(new n(this.width,0)),this.pointCoordinate(new n(this.width,this.height)),this.pointCoordinate(new n(0,this.height))],t.reparseOverscaled?r:e,this._renderWorldCopies).sort((function(t,e){return a.dist(t.canonical)-a.dist(e.canonical)}))},df.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},mf.unmodified.get=function(){return this._unmodified},df.prototype.zoomScale=function(t){return Math.pow(2,t)},df.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},df.prototype.project=function(t){var e=l(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new n(el(t.lng)*this.worldSize,rl(e)*this.worldSize)},df.prototype.unproject=function(t){return new ol(t.x/this.worldSize,t.y/this.worldSize).toLngLat()},mf.point.get=function(){return this.project(this.center)},df.prototype.setLocationAtPoint=function(t,e){var r=this.pointCoordinate(e),i=this.pointCoordinate(this.centerPoint),n=this.locationCoordinate(t),o=new ol(n.x-(r.x-i.x),n.y-(r.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},df.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},df.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},df.prototype.locationCoordinate=function(t){return ol.fromLngLat(t)},df.prototype.coordinateLocation=function(t){return t.toLngLat()},df.prototype.pointCoordinate=function(t){var e=[t.x,t.y,0,1],r=[t.x,t.y,1,1];Ko(e,e,this.pixelMatrixInverse),Ko(r,r,this.pixelMatrixInverse);var i=e[3],n=r[3],o=e[1]/i,a=r[1]/n,s=e[2]/i,u=r[2]/n,l=s===u?0:(0-s)/(u-s);return new ol(De(e[0]/i,r[0]/n,l)/this.worldSize,De(o,a,l)/this.worldSize)},df.prototype.coordinatePoint=function(t){var e=[t.x*this.worldSize,t.y*this.worldSize,0,1];return Ko(e,e,this.pixelMatrix),new n(e[0]/e[3],e[1]/e[3])},df.prototype.getBounds=function(){return(new Yu).extend(this.pointLocation(new n(0,0))).extend(this.pointLocation(new n(this.width,0))).extend(this.pointLocation(new n(this.width,this.height))).extend(this.pointLocation(new n(0,this.height)))},df.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new Yu([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},df.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},df.prototype.calculatePosMatrix=function(t,e){void 0===e&&(e=!1);var r=t.key,i=e?this._alignedPosMatrixCache:this._posMatrixCache;if(i[r])return i[r];var n=t.canonical,o=this.worldSize/this.zoomScale(n.z),a=n.x+Math.pow(2,n.z)*t.wrap,s=Vo(new Float64Array(16));return No(s,s,[a*o,n.y*o,0]),jo(s,s,[o/mo,o/mo,1]),Uo(s,e?this.alignedProjMatrix:this.projMatrix,s),i[r]=new Float32Array(s),i[r]},df.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},df.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,i,o=-90,a=90,s=-180,u=180,l=this.size,p=this._unmodified;if(this.latRange){var c=this.latRange;o=rl(c[1])*this.worldSize,t=(a=rl(c[0])*this.worldSize)-o<l.y?l.y/(a-o):0}if(this.lngRange){var h=this.lngRange;s=el(h[0])*this.worldSize,e=(u=el(h[1])*this.worldSize)-s<l.x?l.x/(u-s):0}var f=this.point,d=Math.max(e||0,t||0);if(d)return this.center=this.unproject(new n(e?(u+s)/2:f.x,t?(a+o)/2:f.y)),this.zoom+=this.scaleZoom(d),this._unmodified=p,void(this._constraining=!1);if(this.latRange){var m=f.y,y=l.y/2;m-y<o&&(i=o+y),m+y>a&&(i=a-y)}if(this.lngRange){var _=f.x,v=l.x/2;_-v<s&&(r=s+v),_+v>u&&(r=u-v)}void 0===r&&void 0===i||(this.center=this.unproject(new n(void 0!==r?r:f.x,void 0!==i?i:f.y))),this._unmodified=p,this._constraining=!1}},df.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var t=this._fov/2,e=Math.PI/2+this._pitch,r=Math.sin(t)*this.cameraToCenterDistance/Math.sin(Math.PI-e-t),i=this.point,n=i.x,o=i.y,a=1.01*(Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance),s=this.height/50,u=new Float64Array(16);!function(t,e,r,i,n){var o,a=1/Math.tan(e/2);t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=n&&n!==1/0?(o=1/(i-n),t[10]=(n+i)*o,t[14]=2*n*i*o):(t[10]=-1,t[14]=-2*i)}(u,this._fov,this.width/this.height,s,a),jo(u,u,[1,-1,1]),No(u,u,[0,0,-this.cameraToCenterDistance]),function(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],p=e[9],c=e[10],h=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*n+l*i,t[5]=a*n+p*i,t[6]=s*n+c*i,t[7]=u*n+h*i,t[8]=l*n-o*i,t[9]=p*n-a*i,t[10]=c*n-s*i,t[11]=h*n-u*i}(u,u,this._pitch),qo(u,u,this.angle),No(u,u,[-n,-o,0]),this.mercatorMatrix=jo([],u,[this.worldSize,this.worldSize,this.worldSize]),jo(u,u,[1,1,il(1,this.center.lat)*this.worldSize,1]),this.projMatrix=u;var l=this.width%2/2,p=this.height%2/2,c=Math.cos(this.angle),h=Math.sin(this.angle),f=n-Math.round(n)+c*l+h*p,d=o-Math.round(o)+c*p+h*l,m=new Float64Array(u);if(No(m,m,[f>.5?f-1:f,d>.5?d-1:d,0]),this.alignedProjMatrix=m,jo(u=Oo(),u,[this.width/2,-this.height/2,1]),No(u,u,[1,-1,0]),this.labelPlaneMatrix=u,jo(u=Oo(),u,[1,-1,1]),No(u,u,[-1,-1,0]),jo(u,u,[2/this.width,2/this.height,1]),this.glCoordMatrix=u,this.pixelMatrix=Uo(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(u=function(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],p=e[8],c=e[9],h=e[10],f=e[11],d=e[12],m=e[13],y=e[14],_=e[15],v=r*s-i*a,g=r*u-n*a,x=r*l-o*a,b=i*u-n*s,w=i*l-o*s,S=n*l-o*u,A=p*m-c*d,T=p*y-h*d,I=p*_-f*d,z=c*y-h*m,k=c*_-f*m,E=h*_-f*y,C=v*E-g*k+x*z+b*I-w*T+S*A;return C?(C=1/C,t[0]=(s*E-u*k+l*z)*C,t[1]=(n*k-i*E-o*z)*C,t[2]=(m*S-y*w+_*b)*C,t[3]=(h*w-c*S-f*b)*C,t[4]=(u*I-a*E-l*T)*C,t[5]=(r*E-n*I+o*T)*C,t[6]=(y*x-d*S-_*g)*C,t[7]=(p*S-h*x+f*g)*C,t[8]=(a*k-s*I+l*A)*C,t[9]=(i*I-r*k-o*A)*C,t[10]=(d*w-m*x+_*v)*C,t[11]=(c*x-p*w-f*v)*C,t[12]=(s*T-a*z-u*A)*C,t[13]=(r*z-i*T+n*A)*C,t[14]=(m*g-d*b-y*v)*C,t[15]=(p*b-c*g+h*v)*C,t):null}(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=u,this._posMatrixCache={},this._alignedPosMatrixCache={}}},df.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new n(0,0)),e=[t.x*this.worldSize,t.y*this.worldSize,0,1];return Ko(e,e,this.pixelMatrix)[3]/this.cameraToCenterDistance},df.prototype.getCameraPoint=function(){var t=this._pitch,e=Math.tan(t)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new n(0,e))},df.prototype.getCameraQueryGeometry=function(t){var e=this.getCameraPoint();if(1===t.length)return[t[0],e];for(var r=e.x,i=e.y,o=e.x,a=e.y,s=0,u=t;s<u.length;s+=1){var l=u[s];r=Math.min(r,l.x),i=Math.min(i,l.y),o=Math.max(o,l.x),a=Math.max(a,l.y)}return[new n(r,i),new n(o,i),new n(o,a),new n(r,a),new n(r,i)]},Object.defineProperties(df.prototype,mf);var yf=function(){var t,e,r,i,n;v(["_onHashChange","_updateHash"],this),this._updateHash=(t=this._updateHashUnthrottled.bind(this),e=300,r=!1,i=null,n=function(){i=null,r&&(t(),i=setTimeout(n,e),r=!1)},function(){return r=!0,i||n(),i})};yf.prototype.addTo=function(t){return this._map=t,self.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},yf.prototype.remove=function(){return self.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},yf.prototype.getHashString=function(t){var e=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,i=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.pow(10,i),o=Math.round(e.lng*n)/n,a=Math.round(e.lat*n)/n,s=this._map.getBearing(),u=this._map.getPitch(),l="";return l+=t?"#/"+o+"/"+a+"/"+r:"#"+r+"/"+a+"/"+o,(s||u)&&(l+="/"+Math.round(10*s)/10),u&&(l+="/"+Math.round(u)),l},yf.prototype._onHashChange=function(){var t=self.location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0),pitch:+(t[4]||0)}),!0)},yf.prototype._updateHashUnthrottled=function(){var t=this.getHashString();try{self.history.replaceState(self.history.state,"",t)}catch(t){}};var _f=function(t){function e(e,r,i,n){void 0===n&&(n={});var o=B.mousePos(r.getCanvasContainer(),i),a=r.unproject(o);t.call(this,e,h({point:o,lngLat:a,originalEvent:i},n)),this._defaultPrevented=!1,this.target=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(Rt),vf=function(t){function e(e,r,i){var o=B.touchPos(r.getCanvasContainer(),i),a=o.map((function(t){return r.unproject(t)})),s=o.reduce((function(t,e,r,i){return t.add(e.div(i.length))}),new n(0,0)),u=r.unproject(s);t.call(this,e,{points:o,point:s,lngLats:a,lngLat:u,originalEvent:i}),this._defaultPrevented=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(Rt),gf=function(t){function e(e,r,i){t.call(this,e,{originalEvent:i}),this._defaultPrevented=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(Rt),xf=function(t){this._map=t,this._el=t.getCanvasContainer(),this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,v(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};xf.prototype.setZoomRate=function(t){this._defaultZoomRate=t},xf.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},xf.prototype.isEnabled=function(){return!!this._enabled},xf.prototype.isActive=function(){return!!this._active},xf.prototype.isZooming=function(){return!!this._zooming},xf.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},xf.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},xf.prototype.onWheel=function(t){if(this.isEnabled()){var e=t.deltaMode===self.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,r=L.now(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==e&&e%4.000244140625==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&(this._lastWheelEvent=t,this._delta-=e,this.isActive()||this._start(t)),t.preventDefault()}},xf.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t)},xf.prototype._start=function(t){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0,this._map.fire(new Rt("movestart",{originalEvent:t})),this._map.fire(new Rt("zoomstart",{originalEvent:t}))),this._finishTimeout&&clearTimeout(this._finishTimeout);var e=B.mousePos(this._el,t);this._around=Qu.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(e)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame))}},xf.prototype._onScrollFrame=function(){var t=this;if(this._frameId=null,this.isActive()){var e=this._map.transform;if(0!==this._delta){var r="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*r)));this._delta<0&&0!==i&&(i=1/i);var n="number"==typeof this._targetZoom?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(n*i))),"wheel"===this._type&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o="number"==typeof this._targetZoom?this._targetZoom:e.zoom,a=this._startZoom,s=this._easing,u=!1;if("wheel"===this._type&&a&&s){var l=Math.min((L.now()-this._lastWheelEventTime)/200,1),p=s(l);e.zoom=De(a,o,p),l<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):u=!0}else e.zoom=o,u=!0;e.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new Rt("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new Rt("zoom",{originalEvent:this._lastWheelEvent})),u&&(this._active=!1,this._finishTimeout=setTimeout((function(){t._zooming=!1,t._map.fire(new Rt("zoomend",{originalEvent:t._lastWheelEvent})),t._map.fire(new Rt("moveend",{originalEvent:t._lastWheelEvent})),delete t._targetZoom}),200))}},xf.prototype._smoothOutEasing=function(t){var e=u;if(this._prevEase){var r=this._prevEase,i=(L.now()-r.start)/r.duration,n=r.easing(i+.01)-r.easing(i),o=.27/Math.sqrt(n*n+1e-4)*.01;e=s(o,Math.sqrt(.0729-o*o),.25,1)}return this._prevEase={start:L.now(),duration:t,easing:e},e};var bf=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1,v(["_onMouseMove","_onMouseUp","_onKeyDown"],this)};bf.prototype.isEnabled=function(){return!!this._enabled},bf.prototype.isActive=function(){return!!this._active},bf.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},bf.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},bf.prototype.onMouseDown=function(t){this.isEnabled()&&t.shiftKey&&0===t.button&&(self.document.addEventListener("mousemove",this._onMouseMove,!1),self.document.addEventListener("keydown",this._onKeyDown,!1),self.document.addEventListener("mouseup",this._onMouseUp,!1),B.disableDrag(),this._startPos=this._lastPos=B.mousePos(this._el,t),this._active=!0)},bf.prototype._onMouseMove=function(t){var e=B.mousePos(this._el,t);if(!(this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)<this._clickTolerance)){var r=this._startPos;this._lastPos=e,this._box||(this._box=B.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var i=Math.min(r.x,e.x),n=Math.max(r.x,e.x),o=Math.min(r.y,e.y),a=Math.max(r.y,e.y);B.setTransform(this._box,"translate("+i+"px,"+o+"px)"),this._box.style.width=n-i+"px",this._box.style.height=a-o+"px"}},bf.prototype._onMouseUp=function(t){if(0===t.button){var e=this._startPos,r=B.mousePos(this._el,t);this._finish(),B.suppressClick(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitScreenCoordinates(e,r,this._map.getBearing(),{linear:!0}).fire(new Rt("boxzoomend",{originalEvent:t}))}},bf.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},bf.prototype._finish=function(){this._active=!1,self.document.removeEventListener("mousemove",this._onMouseMove,!1),self.document.removeEventListener("keydown",this._onKeyDown,!1),self.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(B.remove(this._box),this._box=null),B.enableDrag(),delete this._startPos,delete this._lastPos},bf.prototype._fireEvent=function(t,e){return this._map.fire(new Rt(t,{originalEvent:e}))};var wf=s(0,0,.25,1),Sf=function(t,e){this._map=t,this._el=e.element||t.getCanvasContainer(),this._state="disabled",this._button=e.button||"right",this._bearingSnap=e.bearingSnap||0,this._pitchWithRotate=!1!==e.pitchWithRotate,v(["onMouseDown","_onMouseMove","_onMouseUp","_onBlur","_onDragFrame"],this)};Sf.prototype.isEnabled=function(){return"disabled"!==this._state},Sf.prototype.isActive=function(){return"active"===this._state},Sf.prototype.enable=function(){this.isEnabled()||(this._state="enabled")},Sf.prototype.disable=function(){if(this.isEnabled())switch(this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend"),this._pitchWithRotate&&this._fireEvent("pitchend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},Sf.prototype.onMouseDown=function(t){if("enabled"===this._state){var e="touchstart"===t.type;if(e)this._startTime=Date.now();else if("right"===this._button){if(this._eventButton=B.mouseButton(t),this._eventButton!==(t.ctrlKey?0:2))return}else{if(t.ctrlKey||0!==B.mouseButton(t))return;this._eventButton=0}B.disableDrag(),e?(self.document.addEventListener("touchmove",this._onMouseMove,{capture:!0}),self.document.addEventListener("touchend",this._onMouseUp)):(self.document.addEventListener("mousemove",this._onMouseMove,{capture:!0}),self.document.addEventListener("mouseup",this._onMouseUp)),self.addEventListener("blur",this._onBlur),this._state="pending",this._inertia=[[L.now(),this._map.getBearing()]],this._startPos=this._prevPos=this._lastPos=B.mousePos(this._el,t),this._center=this._map.transform.centerPoint,t.preventDefault()}},Sf.prototype._onMouseMove=function(t){var e=B.mousePos(this._el,t);this._lastPos.equals(e)||(this._lastMoveEvent=t,this._lastPos=e,"pending"===this._state&&(this._state="active",this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},Sf.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t){var e=this._map.transform,r=this._prevPos,i=this._lastPos,n=.8*(r.x-i.x),o=-.5*(r.y-i.y),a=e.bearing-n,s=e.pitch-o,u=this._inertia,l=u[u.length-1];this._drainInertiaBuffer(),u.push([L.now(),this._map._normalizeBearing(a,l[1])]),e.bearing=a,this._pitchWithRotate&&(this._fireEvent("pitch",t),e.pitch=s),this._fireEvent("rotate",t),this._fireEvent("move",t),delete this._lastMoveEvent,this._prevPos=this._lastPos}},Sf.prototype._onMouseUp=function(t){if("touchend"===t.type&&this._startPos===this._lastPos&&Date.now()-this._startTime<300&&this._el.click(),B.mouseButton(t)===this._eventButton)switch(this._state){case"active":this._state="enabled",B.suppressClick(),this._unbind(),this._deactivate(),this._inertialRotate(t);break;case"pending":this._state="enabled",this._unbind()}},Sf.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend",t),this._pitchWithRotate&&this._fireEvent("pitchend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},Sf.prototype._unbind=function(){self.document.removeEventListener("mousemove",this._onMouseMove,{capture:!0}),self.document.removeEventListener("mouseup",this._onMouseUp),self.document.removeEventListener("touchmove",this._onMouseMove,{capture:!0}),self.document.removeEventListener("touchend",this._onMouseUp),self.removeEventListener("blur",this._onBlur),B.enableDrag()},Sf.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._prevPos,delete this._lastPos},Sf.prototype._inertialRotate=function(t){var e=this;this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,i=r.getBearing(),n=this._inertia,o=function(){Math.abs(i)<e._bearingSnap?r.resetNorth({noMoveStart:!0},{originalEvent:t}):e._fireEvent("moveend",t),e._pitchWithRotate&&e._fireEvent("pitchend",t)};if(n.length<2)o();else{var a=n[0],s=n[n.length-1],u=n[n.length-2],l=r._normalizeBearing(i,u[1]),p=s[1]-a[1],c=p<0?-1:1,h=(s[0]-a[0])/1e3;if(0!==p&&0!==h){var f=Math.abs(p*(.25/h));f>180&&(f=180);var d=f/180;l+=c*f*(d/2),Math.abs(r._normalizeBearing(l,0))<this._bearingSnap&&(l=r._normalizeBearing(0,l)),r.rotateTo(l,{duration:1e3*d,easing:wf,noMoveStart:!0},{originalEvent:t})}else o()}},Sf.prototype._fireEvent=function(t,e){return this._map.fire(new Rt(t,e?{originalEvent:e}:{}))},Sf.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=L.now();t.length>0&&e-t[0][0]>160;)t.shift()};var Af=s(0,0,.3,1),Tf=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._state="disabled",this._clickTolerance=e.clickTolerance||1,v(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this)};Tf.prototype.isEnabled=function(){return"disabled"!==this._state},Tf.prototype.isActive=function(){return"active"===this._state},Tf.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled")},Tf.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},Tf.prototype.onMouseDown=function(t){"enabled"===this._state&&(t.ctrlKey||0!==B.mouseButton(t)||(B.addEventListener(self.document,"mousemove",this._onMove,{capture:!0}),B.addEventListener(self.document,"mouseup",this._onMouseUp),this._start(t)))},Tf.prototype.onTouchStart=function(t){"enabled"===this._state&&(t.touches.length>1||(B.addEventListener(self.document,"touchmove",this._onMove,{capture:!0,passive:!1}),B.addEventListener(self.document,"touchend",this._onTouchEnd),this._start(t)))},Tf.prototype._start=function(t){self.addEventListener("blur",this._onBlur),this._state="pending",this._startPos=this._mouseDownPos=this._prevPos=this._lastPos=B.mousePos(this._el,t),this._inertia=[[L.now(),this._startPos]]},Tf.prototype._onMove=function(t){t.preventDefault();var e=B.mousePos(this._el,t);this._lastPos.equals(e)||"pending"===this._state&&e.dist(this._mouseDownPos)<this._clickTolerance||(this._lastMoveEvent=t,this._lastPos=e,this._drainInertiaBuffer(),this._inertia.push([L.now(),this._lastPos]),"pending"===this._state&&(this._state="active",this._fireEvent("dragstart",t),this._fireEvent("movestart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},Tf.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t){var e=this._map.transform;e.setLocationAtPoint(e.pointLocation(this._prevPos),this._lastPos),this._fireEvent("drag",t),this._fireEvent("move",t),this._prevPos=this._lastPos,delete this._lastMoveEvent}},Tf.prototype._onMouseUp=function(t){if(0===B.mouseButton(t))switch(this._state){case"active":this._state="enabled",B.suppressClick(),this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},Tf.prototype._onTouchEnd=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},Tf.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("dragend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},Tf.prototype._unbind=function(){B.removeEventListener(self.document,"touchmove",this._onMove,{capture:!0,passive:!1}),B.removeEventListener(self.document,"touchend",this._onTouchEnd),B.removeEventListener(self.document,"mousemove",this._onMove,{capture:!0}),B.removeEventListener(self.document,"mouseup",this._onMouseUp),B.removeEventListener(self,"blur",this._onBlur)},Tf.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._prevPos,delete this._mouseDownPos,delete this._lastPos},Tf.prototype._inertialPan=function(t){this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=this._inertia;if(e.length<2)this._fireEvent("moveend",t);else{var r=e[e.length-1],i=e[0],n=r[1].sub(i[1]),o=(r[0]-i[0])/1e3;if(0===o||r[1].equals(i[1]))this._fireEvent("moveend",t);else{var a=n.mult(.3/o),s=a.mag();s>1400&&(s=1400,a._unit()._mult(s));var u=s/750,l=a.mult(-u/2);this._map.panBy(l,{duration:1e3*u,easing:Af,noMoveStart:!0},{originalEvent:t})}}},Tf.prototype._fireEvent=function(t,e){return this._map.fire(new Rt(t,e?{originalEvent:e}:{}))},Tf.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=L.now();t.length>0&&e-t[0][0]>160;)t.shift()};var If=function(t){this._map=t,this._el=t.getCanvasContainer(),v(["_onKeyDown"],this)};function zf(t){return t*(2-t)}If.prototype.isEnabled=function(){return!!this._enabled},If.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},If.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},If.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,i=0,n=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),n=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),n=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?i=-1:(o=1,t.preventDefault());break;default:return}var a=this._map,s=a.getZoom(),u={duration:300,delayEndEvents:500,easing:zf,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:a.getBearing()+15*r,pitch:a.getPitch()+10*i,offset:[100*-n,100*-o],center:a.getCenter()};a.easeTo(u,{originalEvent:t})}};var kf=function(t){this._map=t,v(["_onDblClick","_onZoomEnd"],this)};kf.prototype.isEnabled=function(){return!!this._enabled},kf.prototype.isActive=function(){return!!this._active},kf.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},kf.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},kf.prototype.onTouchStart=function(t){var e=this;if(this.isEnabled()&&!(t.points.length>1))if(this._tapped){var r=t.points[0],i=this._tappedPoint;if(i&&i.dist(r)<=30){t.originalEvent.preventDefault();var n=function(){e._tapped&&e._zoom(t),e._map.off("touchcancel",o),e._resetTapped()},o=function(){e._map.off("touchend",n),e._resetTapped()};this._map.once("touchend",n),this._map.once("touchcancel",o)}else this._resetTapped()}else this._tappedPoint=t.points[0],this._tapped=setTimeout((function(){e._tapped=null,e._tappedPoint=null}),300)},kf.prototype._resetTapped=function(){clearTimeout(this._tapped),this._tapped=null,this._tappedPoint=null},kf.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t))},kf.prototype._zoom=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},kf.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)};var Ef=s(0,0,.15,1),Cf=function(t){this._map=t,this._el=t.getCanvasContainer(),v(["_onMove","_onEnd","_onTouchFrame"],this)};Cf.prototype.isEnabled=function(){return!!this._enabled},Cf.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)},Cf.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1)},Cf.prototype.disableRotation=function(){this._rotationDisabled=!0},Cf.prototype.enableRotation=function(){this._rotationDisabled=!1},Cf.prototype.onStart=function(t){if(this.isEnabled()&&2===t.touches.length){var e=B.mousePos(this._el,t.touches[0]),r=B.mousePos(this._el,t.touches[1]),i=e.add(r).div(2);this._startVec=e.sub(r),this._startAround=this._map.transform.pointLocation(i),this._gestureIntent=void 0,this._inertia=[],B.addEventListener(self.document,"touchmove",this._onMove,{passive:!1}),B.addEventListener(self.document,"touchend",this._onEnd)}},Cf.prototype._getTouchEventData=function(t){var e=B.mousePos(this._el,t.touches[0]),r=B.mousePos(this._el,t.touches[1]),i=e.sub(r);return{vec:i,center:e.add(r).div(2),scale:i.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*i.angleWith(this._startVec)/Math.PI}},Cf.prototype._onMove=function(t){if(2===t.touches.length){var e=this._getTouchEventData(t),r=e.vec,i=e.scale,n=e.bearing;if(!this._gestureIntent){var o=this._rotationDisabled&&1!==i||Math.abs(1-i)>.15;Math.abs(n)>10?this._gestureIntent="rotate":o&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new Rt(this._gestureIntent+"start",{originalEvent:t})),this._map.fire(new Rt("movestart",{originalEvent:t})),this._startVec=r)}this._lastTouchEvent=t,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),t.preventDefault()}},Cf.prototype._onTouchFrame=function(){this._frameId=null;var t=this._gestureIntent;if(t){var e=this._map.transform;this._startScale||(this._startScale=e.scale,this._startBearing=e.bearing);var r=this._getTouchEventData(this._lastTouchEvent),i=r.center,n=r.bearing,o=r.scale,a=e.pointLocation(i),s=e.locationPoint(a);"rotate"===t&&(e.bearing=this._startBearing+n),e.zoom=e.scaleZoom(this._startScale*o),e.setLocationAtPoint(this._startAround,s),this._map.fire(new Rt(t,{originalEvent:this._lastTouchEvent})),this._map.fire(new Rt("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([L.now(),o,i])}},Cf.prototype._onEnd=function(t){B.removeEventListener(self.document,"touchmove",this._onMove,{passive:!1}),B.removeEventListener(self.document,"touchend",this._onEnd);var e=this._gestureIntent,r=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,e){this._map.fire(new Rt(e+"end",{originalEvent:t})),this._drainInertiaBuffer();var i=this._inertia,n=this._map;if(i.length<2)n.snapToNorth({},{originalEvent:t});else{var o=i[i.length-1],a=i[0],s=n.transform.scaleZoom(r*o[1]),u=n.transform.scaleZoom(r*a[1]),l=s-u,p=(o[0]-a[0])/1e3,c=o[2];if(0!==p&&s!==u){var h=.15*l/p;Math.abs(h)>2.5&&(h=h>0?2.5:-2.5);var f=1e3*Math.abs(h/(12*.15)),d=s+h*f/2e3;d<0&&(d=0),n.easeTo({zoom:d,duration:f,easing:Ef,around:this._aroundCenter?n.getCenter():n.unproject(c),noMoveStart:!0},{originalEvent:t})}else n.snapToNorth({},{originalEvent:t})}}},Cf.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=L.now();t.length>2&&e-t[0][0]>160;)t.shift()};var Pf={scrollZoom:xf,boxZoom:bf,dragRotate:Sf,dragPan:Tf,keyboard:If,doubleClickZoom:kf,touchZoomRotate:Cf};var Mf=function(t){function e(e,r){t.call(this),this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=r.bearingSnap,v(["_renderFrameCallback"],this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCenter=function(){return new Qu(this.transform.center.lng,this.transform.center.lat)},e.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},e.prototype.panBy=function(t,e,r){return t=n.convert(t).mult(-1),this.panTo(this.transform.center,h({offset:t},e),r)},e.prototype.panTo=function(t,e,r){return this.easeTo(h({center:t},e),r)},e.prototype.getZoom=function(){return this.transform.zoom},e.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},e.prototype.zoomTo=function(t,e,r){return this.easeTo(h({zoom:t},e),r)},e.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},e.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},e.prototype.getBearing=function(){return this.transform.bearing},e.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},e.prototype.rotateTo=function(t,e,r){return this.easeTo(h({bearing:t},e),r)},e.prototype.resetNorth=function(t,e){return this.rotateTo(0,h({duration:1e3},t),e),this},e.prototype.resetNorthPitch=function(t,e){return this.easeTo(h({bearing:0,pitch:0,duration:1e3},t),e),this},e.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},e.prototype.getPitch=function(){return this.transform.pitch},e.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},e.prototype.cameraForBounds=function(t,e){return t=Yu.convert(t),this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),0,e)},e.prototype._cameraForBoxAndBearing=function(t,e,r,i){if("number"==typeof(i=h({padding:{top:0,bottom:0,right:0,left:0},offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){var o=i.padding;i.padding={top:o,bottom:o,right:o,left:o}}if(a(Object.keys(i.padding).sort((function(t,e){return t<e?-1:t>e?1:0})),["bottom","left","right","top"])){var s=this.transform,u=s.project(Qu.convert(t)),l=s.project(Qu.convert(e)),p=u.rotate(-r*Math.PI/180),c=l.rotate(-r*Math.PI/180),f=new n(Math.max(p.x,c.x),Math.max(p.y,c.y)),d=new n(Math.min(p.x,c.x),Math.min(p.y,c.y)),m=f.sub(d),y=(s.width-i.padding.left-i.padding.right)/m.x,_=(s.height-i.padding.top-i.padding.bottom)/m.y;if(!(_<0||y<0)){var v=Math.min(s.scaleZoom(s.scale*Math.min(y,_)),i.maxZoom),g=n.convert(i.offset),x=(i.padding.left-i.padding.right)/2,b=(i.padding.top-i.padding.bottom)/2,w=new n(g.x+x,g.y+b).mult(s.scale/s.zoomScale(v));return{center:s.unproject(u.add(l).div(2).sub(w)),zoom:v,bearing:r}}A("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}else A("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'")},e.prototype.fitBounds=function(t,e,r){return this._fitInternal(this.cameraForBounds(t,e),e,r)},e.prototype.fitScreenCoordinates=function(t,e,r,i,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(n.convert(t)),this.transform.pointLocation(n.convert(e)),r,i),i,o)},e.prototype._fitInternal=function(t,e,r){return t?(e=h(t,e)).linear?this.easeTo(e,r):this.flyTo(e,r):this},e.prototype.jumpTo=function(t,e){this.stop();var r=this.transform,i=!1,n=!1,o=!1;return"zoom"in t&&r.zoom!==+t.zoom&&(i=!0,r.zoom=+t.zoom),void 0!==t.center&&(r.center=Qu.convert(t.center)),"bearing"in t&&r.bearing!==+t.bearing&&(n=!0,r.bearing=+t.bearing),"pitch"in t&&r.pitch!==+t.pitch&&(o=!0,r.pitch=+t.pitch),this.fire(new Rt("movestart",e)).fire(new Rt("move",e)),i&&this.fire(new Rt("zoomstart",e)).fire(new Rt("zoom",e)).fire(new Rt("zoomend",e)),n&&this.fire(new Rt("rotatestart",e)).fire(new Rt("rotate",e)).fire(new Rt("rotateend",e)),o&&this.fire(new Rt("pitchstart",e)).fire(new Rt("pitch",e)).fire(new Rt("pitchend",e)),this.fire(new Rt("moveend",e))},e.prototype.easeTo=function(t,e){var r=this;this.stop(),(!1===(t=h({offset:[0,0],duration:500,easing:u},t)).animate||L.prefersReducedMotion)&&(t.duration=0);var i=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),l="zoom"in t?+t.zoom:o,p="bearing"in t?this._normalizeBearing(t.bearing,a):a,c="pitch"in t?+t.pitch:s,f=i.centerPoint.add(n.convert(t.offset)),d=i.pointLocation(f),m=Qu.convert(t.center||d);this._normalizeCenter(m);var y,_,v=i.project(d),g=i.project(m).sub(v),x=i.zoomScale(l-o);return t.around&&(y=Qu.convert(t.around),_=i.locationPoint(y)),this._zooming=l!==o,this._rotating=a!==p,this._pitching=c!==s,this._prepareEase(e,t.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease((function(t){if(r._zooming&&(i.zoom=De(o,l,t)),r._rotating&&(i.bearing=De(a,p,t)),r._pitching&&(i.pitch=De(s,c,t)),y)i.setLocationAtPoint(y,_);else{var n=i.zoomScale(i.zoom-o),u=l>o?Math.min(2,x):Math.max(.5,x),h=Math.pow(u,1-t),d=i.unproject(v.add(g.mult(t*h)).mult(n));i.setLocationAtPoint(i.renderWorldCopies?d.wrap():d,f)}r._fireMoveEvents(e)}),(function(){t.delayEndEvents?r._easeEndTimeoutID=setTimeout((function(){return r._afterEase(e)}),t.delayEndEvents):r._afterEase(e)}),t),this},e.prototype._prepareEase=function(t,e){this._moving=!0,e||this.fire(new Rt("movestart",t)),this._zooming&&this.fire(new Rt("zoomstart",t)),this._rotating&&this.fire(new Rt("rotatestart",t)),this._pitching&&this.fire(new Rt("pitchstart",t))},e.prototype._fireMoveEvents=function(t){this.fire(new Rt("move",t)),this._zooming&&this.fire(new Rt("zoom",t)),this._rotating&&this.fire(new Rt("rotate",t)),this._pitching&&this.fire(new Rt("pitch",t))},e.prototype._afterEase=function(t){var e=this._zooming,r=this._rotating,i=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,e&&this.fire(new Rt("zoomend",t)),r&&this.fire(new Rt("rotateend",t)),i&&this.fire(new Rt("pitchend",t)),this.fire(new Rt("moveend",t))},e.prototype.flyTo=function(t,e){var r=this;if(L.prefersReducedMotion){var i=f(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,e)}this.stop(),t=h({offset:[0,0],speed:1.2,curve:1.42,easing:u},t);var o=this.transform,a=this.getZoom(),s=this.getBearing(),p=this.getPitch(),c="zoom"in t?l(+t.zoom,o.minZoom,o.maxZoom):a,d="bearing"in t?this._normalizeBearing(t.bearing,s):s,m="pitch"in t?+t.pitch:p,y=o.zoomScale(c-a),_=o.centerPoint.add(n.convert(t.offset)),v=o.pointLocation(_),g=Qu.convert(t.center||v);this._normalizeCenter(g);var x=o.project(v),b=o.project(g).sub(x),w=t.curve,S=Math.max(o.width,o.height),A=S/y,T=b.mag();if("minZoom"in t){var I=l(Math.min(t.minZoom,a,c),o.minZoom,o.maxZoom),z=S/o.zoomScale(I-a);w=Math.sqrt(z/T*2)}var k=w*w;function E(t){var e=(A*A-S*S+(t?-1:1)*k*k*T*T)/(2*(t?A:S)*k*T);return Math.log(Math.sqrt(e*e+1)-e)}function C(t){return(Math.exp(t)-Math.exp(-t))/2}function P(t){return(Math.exp(t)+Math.exp(-t))/2}var M=E(0),D=function(t){return P(M)/P(M+w*t)},B=function(t){return S*((P(M)*(C(e=M+w*t)/P(e))-C(M))/k)/T;var e},R=(E(1)-M)/w;if(Math.abs(T)<1e-6||!isFinite(R)){if(Math.abs(S-A)<1e-6)return this.easeTo(t,e);var F=A<S?-1:1;R=Math.abs(Math.log(A/S))/w,B=function(){return 0},D=function(t){return Math.exp(F*w*t)}}if("duration"in t)t.duration=+t.duration;else{var O="screenSpeed"in t?+t.screenSpeed/w:+t.speed;t.duration=1e3*R/O}return t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==d,this._pitching=m!==p,this._prepareEase(e,!1),this._ease((function(t){var i=t*R,n=1/D(i);o.zoom=1===t?c:a+o.scaleZoom(n),r._rotating&&(o.bearing=De(s,d,t)),r._pitching&&(o.pitch=De(p,m,t));var u=1===t?g:o.unproject(x.add(b.mult(B(i))).mult(n));o.setLocationAtPoint(o.renderWorldCopies?u.wrap():u,_),r._fireMoveEvents(e)}),(function(){return r._afterEase(e)}),t),this},e.prototype.isEasing=function(){return!!this._easeFrameId},e.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var t=this._onEaseEnd;delete this._onEaseEnd,t.call(this)}return this},e.prototype._ease=function(t,e,r){!1===r.animate||0===r.duration?(t(1),e()):(this._easeStart=L.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},e.prototype._renderFrameCallback=function(){var t=Math.min((L.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},e.prototype._normalizeBearing=function(t,e){t=p(t,-180,180);var r=Math.abs(t-e);return Math.abs(t-360-e)<r&&(t-=360),Math.abs(t+360-e)<r&&(t+=360),t},e.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var r=t.lng-e.center.lng;t.lng+=r>180?-360:r<-180?360:0}},e}(Ot),Df=function(t){void 0===t&&(t={}),this.options=t,v(["_updateEditLink","_updateData","_updateCompact"],this)};Df.prototype.getDefaultPosition=function(){return"bottom-right"},Df.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=B.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=B.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&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),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Df.prototype.onRemove=function(){B.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},Df.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var e=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||W.ACCESS_TOKEN}];if(t){var r=e.reduce((function(t,r,i){return r.value&&(t+=r.key+"="+r.value+(i<e.length-1?"&":"")),t}),"?");t.href=W.FEEDBACK_URL+"/"+r+(this._map._hash?this._map._hash.getHashString(!0):""),t.rel="noopener nofollow"}},Df.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},Df.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((function(t){return"string"!=typeof t?"":t}))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var r=this._map.style.sourceCaches;for(var i in r){var n=r[i];if(n.used){var o=n.getSource();o.attribution&&t.indexOf(o.attribution)<0&&t.push(o.attribution)}}t.sort((function(t,e){return t.length-e.length}));var a=(t=t.filter((function(e,r){for(var i=r+1;i<t.length;i++)if(t[i].indexOf(e)>=0)return!1;return!0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Df.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var Lf=function(){v(["_updateLogo"],this),v(["_updateCompact"],this)};Lf.prototype.onAdd=function(t){this._map=t,this._container=B.create("div","mapboxgl-ctrl");var e=B.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label","Mapbox logo"),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Lf.prototype.onRemove=function(){B.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Lf.prototype.getDefaultPosition=function(){return"bottom-left"},Lf.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Lf.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t){if(t[e].getSource().mapbox_logo)return!0}return!1}},Lf.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var Bf=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Bf.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Bf.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,i=e?this._queue.concat(e):this._queue;r<i.length;r+=1){var n=i[r];if(n.id===t)return void(n.cancelled=!0)}},Bf.prototype.run=function(){var t=this._currentlyRunning=this._queue;this._queue=[];for(var e=0,r=t;e<r.length;e+=1){var i=r[e];if(!i.cancelled&&(i.callback(),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Bf.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Rf=self.HTMLImageElement,Ff=self.HTMLElement,Of={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:22,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,clickTolerance:3,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},Vf=function(t){function r(e){var r=this;if(null!=(e=h({},Of,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than minZoom");var i=new df(e.minZoom,e.maxZoom,e.renderWorldCopies);if(t.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new Bf,this._controls=[],this._mapId=m(),this._requestManager=new Q(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=self.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Ff))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),v(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),"undefined"!=typeof self&&(self.addEventListener("online",this._onWindowOnline,!1),self.addEventListener("resize",this._onWindowResize,!1)),function(t,e){var r=t.getCanvasContainer(),i=null,n=!1,o=null;for(var a in Pf)t[a]=new Pf[a](t,e),e.interactive&&e[a]&&t[a].enable(e[a]);B.addEventListener(r,"mouseout",(function(e){t.fire(new _f("mouseout",t,e))})),B.addEventListener(r,"mousedown",(function(i){n=!0,o=B.mousePos(r,i);var a=new _f("mousedown",t,i);if(t.fire(a),a.defaultPrevented)return;e.interactive&&!t.doubleClickZoom.isActive()&&t.stop();t.boxZoom.onMouseDown(i),t.boxZoom.isActive()||t.dragPan.isActive()||t.dragRotate.onMouseDown(i);t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onMouseDown(i)})),B.addEventListener(r,"mouseup",(function(e){var r=t.dragRotate.isActive();i&&!r&&t.fire(new _f("contextmenu",t,i));i=null,n=!1,t.fire(new _f("mouseup",t,e))})),B.addEventListener(r,"mousemove",(function(e){if(t.dragPan.isActive())return;if(t.dragRotate.isActive())return;var i=e.target;for(;i&&i!==r;)i=i.parentNode;if(i!==r)return;t.fire(new _f("mousemove",t,e))})),B.addEventListener(r,"mouseover",(function(e){var i=e.target;for(;i&&i!==r;)i=i.parentNode;if(i!==r)return;t.fire(new _f("mouseover",t,e))})),B.addEventListener(r,"touchstart",(function(r){var i=new vf("touchstart",t,r);if(t.fire(i),i.defaultPrevented)return;e.interactive&&t.stop();t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(r);t.touchZoomRotate.onStart(r),t.doubleClickZoom.onTouchStart(i)}),{passive:!1}),B.addEventListener(r,"touchmove",(function(e){t.fire(new vf("touchmove",t,e))}),{passive:!1}),B.addEventListener(r,"touchend",(function(e){t.fire(new vf("touchend",t,e))})),B.addEventListener(r,"touchcancel",(function(e){t.fire(new vf("touchcancel",t,e))})),B.addEventListener(r,"click",(function(i){var n=B.mousePos(r,i);(!o||n.equals(o)||n.dist(o)<e.clickTolerance)&&t.fire(new _f("click",t,i))})),B.addEventListener(r,"dblclick",(function(e){var r=new _f("dblclick",t,e);if(t.fire(r),r.defaultPrevented)return;t.doubleClickZoom.onDblClick(r)})),B.addEventListener(r,"contextmenu",(function(e){var r=t.dragRotate.isActive();n||r?n&&(i=e):t.fire(new _f("contextmenu",t,e));(t.dragRotate.isEnabled()||t.listens("contextmenu"))&&e.preventDefault()})),B.addEventListener(r,"wheel",(function(r){e.interactive&&t.stop();var i=new gf("wheel",t,r);if(t.fire(i),i.defaultPrevented)return;t.scrollZoom.onWheel(r)}),{passive:!1})}(this,e),this._hash=e.hash&&(new yf).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,h({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Df({customAttribution:e.customAttribution})),this.addControl(new Lf,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(t){r._update("style"===t.dataType),r.fire(new Rt(t.dataType+"data",t))})),this.on("dataloading",(function(t){r.fire(new Rt(t.dataType+"dataloading",t))}))}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var i={showTileBoundaries:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return r.prototype._getMapId=function(){return this._mapId},r.prototype.addControl=function(t,e){if(void 0===e&&t.getDefaultPosition&&(e=t.getDefaultPosition()),void 0===e&&(e="top-right"),!t||!t.onAdd)return this.fire(new Ft(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var r=t.onAdd(this);this._controls.push(t);var i=this._controlPositions[e];return-1!==e.indexOf("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this},r.prototype.removeControl=function(t){if(!t||!t.onRemove)return this.fire(new Ft(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var e=this._controls.indexOf(t);return e>-1&&this._controls.splice(e,1),t.onRemove(this),this},r.prototype.resize=function(t){var e=this._containerDimensions(),r=e[0],i=e[1];return this._resizeCanvas(r,i),this.transform.resize(r,i),this.painter.resize(r,i),this.fire(new Rt("movestart",t)).fire(new Rt("move",t)).fire(new Rt("resize",t)).fire(new Rt("moveend",t)),this},r.prototype.getBounds=function(){return this.transform.getBounds()},r.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},r.prototype.setMaxBounds=function(t){return this.transform.setMaxBounds(Yu.convert(t)),this._update()},r.prototype.setMinZoom=function(t){if((t=null==t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between 0 and the current maxZoom, inclusive")},r.prototype.getMinZoom=function(){return this.transform.minZoom},r.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},r.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},r.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},r.prototype.getMaxZoom=function(){return this.transform.maxZoom},r.prototype.project=function(t){return this.transform.locationPoint(Qu.convert(t))},r.prototype.unproject=function(t){return this.transform.pointLocation(n.convert(t))},r.prototype.isMoving=function(){return this._moving||this.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},r.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isZooming()},r.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},r.prototype.on=function(e,r,i){var n=this;if(void 0===i)return t.prototype.on.call(this,e,r);var o=function(){var t;if("mouseenter"===e||"mouseover"===e){var o=!1;return{layer:r,listener:i,delegates:{mousemove:function(t){var a=n.getLayer(r)?n.queryRenderedFeatures(t.point,{layers:[r]}):[];a.length?o||(o=!0,i.call(n,new _f(e,n,t.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===e||"mouseout"===e){var a=!1;return{layer:r,listener:i,delegates:{mousemove:function(t){(n.getLayer(r)?n.queryRenderedFeatures(t.point,{layers:[r]}):[]).length?a=!0:a&&(a=!1,i.call(n,new _f(e,n,t.originalEvent)))},mouseout:function(t){a&&(a=!1,i.call(n,new _f(e,n,t.originalEvent)))}}}}return{layer:r,listener:i,delegates:(t={},t[e]=function(t){var e=n.getLayer(r)?n.queryRenderedFeatures(t.point,{layers:[r]}):[];e.length&&(t.features=e,i.call(n,t),delete t.features)},t)}}();for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(o),o.delegates)this.on(a,o.delegates[a]);return this},r.prototype.off=function(e,r,i){if(void 0===i)return t.prototype.off.call(this,e,r);if(this._delegatedListeners&&this._delegatedListeners[e])for(var n=this._delegatedListeners[e],o=0;o<n.length;o++){var a=n[o];if(a.layer===r&&a.listener===i){for(var s in a.delegates)this.off(s,a.delegates[s]);return n.splice(o,1),this}}return this},r.prototype.queryRenderedFeatures=function(t,e){if(!this.style)return[];var r;if(void 0!==e||void 0===t||t instanceof n||Array.isArray(t)||(e=t,t=void 0),e=e||{},(t=t||[[0,0],[this.transform.width,this.transform.height]])instanceof n||"number"==typeof t[0])r=[n.convert(t)];else{var i=n.convert(t[0]),o=n.convert(t[1]);r=[i,new n(o.x,i.y),o,new n(i.x,o.y),i]}return this.style.queryRenderedFeatures(r,e,this.transform)},r.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},r.prototype.setStyle=function(t,e){return!1!==(e=h({},{localIdeographFontFamily:this._localIdeographFontFamily},e)).diff&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(t,e))},r.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new Vc(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},r.prototype._diffStyle=function(t,e){var r=this;if("string"==typeof t){var i=this._requestManager.normalizeStyleURL(t),n=this._requestManager.transformRequest(i,wt.Style);kt(n,(function(t,i){t?r.fire(new Ft(t)):i&&r._updateDiff(i,e)}))}else"object"==typeof t&&this._updateDiff(t,e)},r.prototype._updateDiff=function(t,e){try{this.style.setState(t)&&this._update(!0)}catch(r){A("Unable to perform style diff: "+(r.message||r.error||r)+". Rebuilding the style from scratch."),this._updateStyle(t,e)}},r.prototype.getStyle=function(){if(this.style)return this.style.serialize()},r.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():A("There is no style added to the map.")},r.prototype.addSource=function(t,e){return this.style.addSource(t,e),this._update(!0)},r.prototype.isSourceLoaded=function(t){var e=this.style&&this.style.sourceCaches[t];if(void 0!==e)return e.loaded();this.fire(new Ft(new Error("There is no source with ID '"+t+"'")))},r.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var r=t[e]._tiles;for(var i in r){var n=r[i];if("loaded"!==n.state&&"errored"!==n.state)return!1}}return!0},r.prototype.addSourceType=function(t,e,r){return this.style.addSourceType(t,e,r)},r.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},r.prototype.getSource=function(t){return this.style.getSource(t)},r.prototype.addImage=function(t,e,r){void 0===r&&(r={});var i=r.pixelRatio;void 0===i&&(i=1);var n=r.sdf;void 0===n&&(n=!1);if(e instanceof Rf){var o=L.getImageData(e),a=o.width,s=o.height,u=o.data;this.style.addImage(t,{data:new ea({width:a,height:s},u),pixelRatio:i,sdf:n,version:0})}else{if(void 0===e.width||void 0===e.height)return this.fire(new Ft(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var l=e.width,p=e.height,c=e.data,h=e;this.style.addImage(t,{data:new ea({width:l,height:p},new Uint8Array(c)),pixelRatio:i,sdf:n,version:0,userImage:h}),h.onAdd&&h.onAdd(this,t)}},r.prototype.updateImage=function(t,e){var r=this.style.getImage(t);if(!r)return this.fire(new Ft(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var i=e instanceof Rf?L.getImageData(e):e,n=i.width,o=i.height,a=i.data;if(void 0===n||void 0===o)return this.fire(new Ft(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(n!==r.data.width||o!==r.data.height)return this.fire(new Ft(new Error("The width and height of the updated image must be that same as the previous version of the image")));var s=!(e instanceof Rf);r.data.replace(a,s),this.style.updateImage(t,r)},r.prototype.hasImage=function(t){return t?!!this.style.getImage(t):(this.fire(new Ft(new Error("Missing required image id"))),!1)},r.prototype.removeImage=function(t){this.style.removeImage(t)},r.prototype.loadImage=function(t,e){Dt(this._requestManager.transformRequest(t,wt.Image),e)},r.prototype.listImages=function(){return this.style.listImages()},r.prototype.addLayer=function(t,e){return this.style.addLayer(t,e),this._update(!0)},r.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},r.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},r.prototype.getLayer=function(t){return this.style.getLayer(t)},r.prototype.setFilter=function(t,e,r){return void 0===r&&(r={}),this.style.setFilter(t,e,r),this._update(!0)},r.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)},r.prototype.getFilter=function(t){return this.style.getFilter(t)},r.prototype.setPaintProperty=function(t,e,r,i){return void 0===i&&(i={}),this.style.setPaintProperty(t,e,r,i),this._update(!0)},r.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},r.prototype.setLayoutProperty=function(t,e,r,i){return void 0===i&&(i={}),this.style.setLayoutProperty(t,e,r,i),this._update(!0)},r.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},r.prototype.setLight=function(t,e){return void 0===e&&(e={}),this.style.setLight(t,e),this._update(!0)},r.prototype.getLight=function(){return this.style.getLight()},r.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},r.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},r.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},r.prototype.getContainer=function(){return this._container},r.prototype.getCanvasContainer=function(){return this._canvasContainer},r.prototype.getCanvas=function(){return this._canvas},r.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},r.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==self.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&A("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/.")},r.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=B.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=B.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=B.create("canvas","mapboxgl-canvas",e),this._canvas.style.position="absolute",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");var r=this._containerDimensions();this._resizeCanvas(r[0],r[1]);var i=this._controlContainer=B.create("div","mapboxgl-control-container",t),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){n[t]=B.create("div","mapboxgl-ctrl-"+t,i)}))},r.prototype._resizeCanvas=function(t,e){var r=self.devicePixelRatio||1;this._canvas.width=r*t,this._canvas.height=r*e,this._canvas.style.width=t+"px",this._canvas.style.height=e+"px"},r.prototype._setupPainter=function(){var t=h({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._canvas.getContext("webgl",t)||this._canvas.getContext("experimental-webgl",t);r?(this.painter=new pf(r,this.transform),K.testSupport(r)):this.fire(new Ft(new Error("Failed to initialize WebGL")))},r.prototype._contextLost=function(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new Rt("webglcontextlost",{originalEvent:t}))},r.prototype._contextRestored=function(t){this._setupPainter(),this.resize(),this._update(),this.fire(new Rt("webglcontextrestored",{originalEvent:t}))},r.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},r.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},r.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},r.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},r.prototype._render=function(){this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run();var t=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var e=this.transform.zoom,r=L.now();this.style.zoomHistory.update(e,r);var i=new qi(e,{now:r,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),n=i.crossFadingFactor();1===n&&n===this._crossFadingFactor||(t=!0,this._crossFadingFactor=n),this.style.update(i)}return 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}),this.fire(new Rt("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new Rt("load"))),this.style&&(this.style.hasTransitions()||t)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this._sourcesDirty||this._repaint||this._styleDirty||this._placementDirty?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new Rt("idle")),this},r.prototype.remove=function(){this._hash&&this._hash.remove();for(var t=0,e=this._controls;t<e.length;t+=1){e[t].onRemove(this)}this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.setStyle(null),"undefined"!=typeof self&&(self.removeEventListener("resize",this._onWindowResize,!1),self.removeEventListener("online",this._onWindowOnline,!1));var r=this.painter.context.gl.getExtension("WEBGL_lose_context");r&&r.loseContext(),Uf(this._canvasContainer),Uf(this._controlContainer),Uf(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this.fire(new Rt("remove"))},r.prototype.triggerRepaint=function(){var t=this;this.style&&!this._frame&&(this._frame=L.frame((function(){t._frame=null,t._render()})))},r.prototype._onWindowOnline=function(){this._update()},r.prototype._onWindowResize=function(){this._trackResize&&this.resize()._update()},i.showTileBoundaries.get=function(){return!!this._showTileBoundaries},i.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},i.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},i.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},i.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},i.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},i.repaint.get=function(){return!!this._repaint},i.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},i.vertices.get=function(){return!!this._vertices},i.vertices.set=function(t){this._vertices=t,this._update()},r.prototype._setCacheLimits=function(t,e){!function(t,e){dt=t,mt=e}(t,e)},i.version.get=function(){return"1.3.2"},Object.defineProperties(r.prototype,i),r}(Mf);function Uf(t){t.parentNode&&t.parentNode.removeChild(t)}var Nf={showCompass:!0,showZoom:!0,visualizePitch:!1},jf=function(t){var e=this;this.options=h({},Nf,t),this._container=B.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(v(["_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-in","Zoom in",(function(){return e._map.zoomIn()})),this._zoomOutButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-out","Zoom out",(function(){return e._map.zoomOut()}))),this.options.showCompass&&(v(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-compass","Reset bearing to north",(function(){e.options.visualizePitch?e._map.resetNorthPitch():e._map.resetNorth()})),this._compassArrow=B.create("span","mapboxgl-ctrl-compass-arrow",this._compass))};function qf(t,e,r){if(t=new Qu(t.lng,t.lat),e){var i=new Qu(t.lng-360,t.lat),n=new Qu(t.lng+360,t.lat),o=r.locationPoint(t).distSqr(e);r.locationPoint(i).distSqr(e)<o?t=i:r.locationPoint(n).distSqr(e)<o&&(t=n)}for(;Math.abs(t.lng-r.center.lng)>180;){var a=r.locationPoint(t);if(a.x>=0&&a.y>=0&&a.x<=r.width&&a.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t}jf.prototype._updateZoomButtons=function(){var t=this._map.getZoom();t===this._map.getMaxZoom()?this._zoomInButton.classList.add("mapboxgl-ctrl-icon-disabled"):this._zoomInButton.classList.remove("mapboxgl-ctrl-icon-disabled"),t===this._map.getMinZoom()?this._zoomOutButton.classList.add("mapboxgl-ctrl-icon-disabled"):this._zoomOutButton.classList.remove("mapboxgl-ctrl-icon-disabled")},jf.prototype._rotateCompassArrow=function(){var t=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._compassArrow.style.transform=t},jf.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Sf(t,{button:"left",element:this._compass}),B.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),B.addEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.enable()),this._container},jf.prototype.onRemove=function(){B.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),B.removeEventListener(this._compass,"mousedown",this._handler.onMouseDown),B.removeEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.disable(),delete this._handler),delete this._map},jf.prototype._createButton=function(t,e,r){var i=B.create("button",t,this._container);return i.type="button",i.title=e,i.setAttribute("aria-label",e),i.addEventListener("click",r),i};var Zf={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 Gf(t,e,r){var i=t.classList;for(var n in Zf)i.remove("mapboxgl-"+r+"-anchor-"+n);i.add("mapboxgl-"+r+"-anchor-"+e)}var Wf,Kf=function(t){function e(e,r){if(t.call(this),(e instanceof self.HTMLElement||r)&&(e=h({element:e},r)),v(["_update","_onMove","_onUp","_addDragHandler","_onMapClick"],this),this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._draggable=e&&e.draggable||!1,this._state="inactive",e&&e.element)this._element=e.element,this._offset=n.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=B.create("div");var i=B.createNS("http://www.w3.org/2000/svg","svg");i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height","41px"),i.setAttributeNS(null,"width","27px"),i.setAttributeNS(null,"viewBox","0 0 27 41");var o=B.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"stroke","none"),o.setAttributeNS(null,"stroke-width","1"),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"fill-rule","evenodd");var a=B.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"fill-rule","nonzero");var s=B.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"transform","translate(3.0, 29.0)"),s.setAttributeNS(null,"fill","#000000");for(var u=0,l=[{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"}];u<l.length;u+=1){var p=l[u],c=B.createNS("http://www.w3.org/2000/svg","ellipse");c.setAttributeNS(null,"opacity","0.04"),c.setAttributeNS(null,"cx","10.5"),c.setAttributeNS(null,"cy","5.80029008"),c.setAttributeNS(null,"rx",p.rx),c.setAttributeNS(null,"ry",p.ry),s.appendChild(c)}var f=B.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"fill",this._color);var d=B.createNS("http://www.w3.org/2000/svg","path");d.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"),f.appendChild(d);var m=B.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"opacity","0.25"),m.setAttributeNS(null,"fill","#000000");var y=B.createNS("http://www.w3.org/2000/svg","path");y.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"),m.appendChild(y);var _=B.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"transform","translate(6.0, 7.0)"),_.setAttributeNS(null,"fill","#FFFFFF");var g=B.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(8.0, 8.0)");var x=B.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 b=B.createNS("http://www.w3.org/2000/svg","circle");b.setAttributeNS(null,"fill","#FFFFFF"),b.setAttributeNS(null,"cx","5.5"),b.setAttributeNS(null,"cy","5.5"),b.setAttributeNS(null,"r","5.4999962"),g.appendChild(x),g.appendChild(b),a.appendChild(s),a.appendChild(f),a.appendChild(m),a.appendChild(_),a.appendChild(g),i.appendChild(a),this._element.appendChild(i),this._offset=n.convert(e&&e.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(t){t.preventDefault()})),Gf(this._element,this._anchor,"marker"),this._popup=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},e.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),B.remove(this._element),this._popup&&this._popup.remove(),this},e.prototype.getLngLat=function(){return this._lngLat},e.prototype.setLngLat=function(t){return this._lngLat=Qu.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},e.prototype.getElement=function(){return this._element},e.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat)}return this},e.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},e.prototype.getPopup=function(){return this._popup},e.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},e.prototype._update=function(t){this._map&&(this._map.transform.renderWorldCopies&&(this._lngLat=qf(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset),t&&"moveend"!==t.type||(this._pos=this._pos.round()),B.setTransform(this._element,Zf[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px)"))},e.prototype.getOffset=function(){return this._offset},e.prototype.setOffset=function(t){return this._offset=n.convert(t),this._update(),this},e.prototype._onMove=function(t){this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new Rt("dragstart"))),this.fire(new Rt("drag"))},e.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new Rt("dragend")),this._state="inactive"},e.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),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))},e.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(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},e.prototype.isDraggable=function(){return this._draggable},e}(Ot),Hf={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0};var Xf=function(t){function e(e){t.call(this),this.options=h({},Hf,e),v(["_onSuccess","_onError","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.onAdd=function(t){var e;return this._map=t,this._container=B.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),e=this._setupUI,void 0!==Wf?e(Wf):void 0!==self.navigator.permissions?self.navigator.permissions.query({name:"geolocation"}).then((function(t){Wf="denied"!==t.state,e(Wf)})):(Wf=!!self.navigator.geolocation,e(Wf)),this._container},e.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(self.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),B.remove(this._container),this._map=void 0},e.prototype._onSuccess=function(t){if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("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&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new Rt("geolocate",t)),this._finish()},e.prototype._updateCamera=function(t){var e=new Qu(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,i=h({bearing:this._map.getBearing()},this.options.fitBoundsOptions);this._map.fitBounds(e.toBounds(r),i,{geolocateSource:!0})},e.prototype._updateMarker=function(t){t?this._userLocationDotMarker.setLngLat([t.coords.longitude,t.coords.latitude]).addTo(this._map):this._userLocationDotMarker.remove()},e.prototype._onError=function(t){if(this.options.trackUserLocation)if(1===t.code)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"),void 0!==this._geolocationWatchID&&this._clearWatch();else 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")}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new Rt("error",t)),this._finish()},e.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},e.prototype._setupUI=function(t){var e=this;!1!==t?(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=B.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.setAttribute("aria-label","Geolocate"),this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=B.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Kf(this._dotElement),this.options.trackUserLocation&&(this._watchState="OFF")),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(t){t.geolocateSource||"ACTIVE_LOCK"!==e._watchState||(e._watchState="BACKGROUND",e._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),e._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),e.fire(new Rt("trackuserlocationend")))}))):A("Geolocation support is not available, the GeolocateControl will not be visible.")},e.prototype.trigger=function(){if(!this._setup)return A("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 Rt("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":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 Rt("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 Rt("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")}"OFF"===this._watchState&&void 0!==this._geolocationWatchID?this._clearWatch():void 0===this._geolocationWatchID&&(this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._geolocationWatchID=self.navigator.geolocation.watchPosition(this._onSuccess,this._onError,this.options.positionOptions))}else self.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},e.prototype._clearWatch=function(){self.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)},e}(Ot),Jf={maxWidth:100,unit:"metric"},Yf=function(t){this.options=h({},Jf,t),v(["_onMove","setUnit"],this)};function Qf(t,e,r){var i,n,o,a,s,u,l=r&&r.maxWidth||100,p=t._container.clientHeight/2,c=(i=t.unproject([0,p]),n=t.unproject([l,p]),o=Math.PI/180,a=i.lat*o,s=n.lat*o,u=Math.sin(a)*Math.sin(s)+Math.cos(a)*Math.cos(s)*Math.cos((n.lng-i.lng)*o),6371e3*Math.acos(Math.min(u,1)));if(r&&"imperial"===r.unit){var h=3.2808*c;if(h>5280)$f(e,l,h/5280,"mi");else $f(e,l,h,"ft")}else if(r&&"nautical"===r.unit){$f(e,l,c/1852,"nm")}else $f(e,l,c,"m")}function $f(t,e,r,i){var n,o,a,s=(n=r,o=Math.pow(10,(""+Math.floor(n)).length-1),a=(a=n/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a),o*a),u=s/r;"m"===i&&s>=1e3&&(s/=1e3,i="km"),t.style.width=e*u+"px",t.innerHTML=s+i}Yf.prototype.getDefaultPosition=function(){return"bottom-left"},Yf.prototype._onMove=function(){Qf(this._map,this._container,this.options)},Yf.prototype.onAdd=function(t){return this._map=t,this._container=B.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Yf.prototype.onRemove=function(){B.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Yf.prototype.setUnit=function(t){this.options.unit=t,Qf(this._map,this._container,this.options)};var td=function(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof self.HTMLElement?this._container=t.container:A("Full screen control 'container' must be a DOM element.")),v(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in self.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in self.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in self.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in self.document&&(this._fullscreenchange="MSFullscreenChange"),this._className="mapboxgl-ctrl"};td.prototype.onAdd=function(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=B.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",A("This device does not support fullscreen mode.")),this._controlContainer},td.prototype.onRemove=function(){B.remove(this._controlContainer),this._map=null,self.document.removeEventListener(this._fullscreenchange,this._changeIcon)},td.prototype._checkFullscreenSupport=function(){return!!(self.document.fullscreenEnabled||self.document.mozFullScreenEnabled||self.document.msFullscreenEnabled||self.document.webkitFullscreenEnabled)},td.prototype._setupUI=function(){(this._fullscreenButton=B.create("button",this._className+"-icon "+this._className+"-fullscreen",this._controlContainer)).type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),self.document.addEventListener(this._fullscreenchange,this._changeIcon)},td.prototype._updateTitle=function(){var t=this._isFullscreen()?"Exit fullscreen":"Enter fullscreen";this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},td.prototype._isFullscreen=function(){return this._fullscreen},td.prototype._changeIcon=function(){(self.document.fullscreenElement||self.document.mozFullScreenElement||self.document.webkitFullscreenElement||self.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"),this._updateTitle())},td.prototype._onClickFullscreen=function(){this._isFullscreen()?self.document.exitFullscreen?self.document.exitFullscreen():self.document.mozCancelFullScreen?self.document.mozCancelFullScreen():self.document.msExitFullscreen?self.document.msExitFullscreen():self.document.webkitCancelFullScreen&&self.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 ed={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},rd=function(t){function e(e){t.call(this),this.options=h(Object.create(ed),e),v(["_update","_onClickClose","remove"],this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addTo=function(t){var e=this;return this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",(function(t){e._update(t.point)})),this._map.on("mouseup",(function(t){e._update(t.point)})),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 Rt("open")),this},e.prototype.isOpen=function(){return!!this._map},e.prototype.remove=function(){return this._content&&B.remove(this._content),this._container&&(B.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),this._map.off("remove",this.remove),this._map.off("mousemove"),delete this._map),this.fire(new Rt("close")),this},e.prototype.getLngLat=function(){return this._lngLat},e.prototype.setLngLat=function(t){return this._lngLat=Qu.convert(t),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove"),this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},e.prototype.trackPointer=function(){var t=this;return this._trackPointer=!0,this._pos=null,this._map&&(this._map.off("move",this._update),this._map.on("mousemove",(function(e){t._update(e.point)})),this._map.on("drag",(function(e){t._update(e.point)})),this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},e.prototype.getElement=function(){return this._container},e.prototype.setText=function(t){return this.setDOMContent(self.document.createTextNode(t))},e.prototype.setHTML=function(t){var e,r=self.document.createDocumentFragment(),i=self.document.createElement("body");for(i.innerHTML=t;e=i.firstChild;)r.appendChild(e);return this.setDOMContent(r)},e.prototype.getMaxWidth=function(){return this._container.style.maxWidth},e.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},e.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},e.prototype._createContent=function(){this._content&&B.remove(this._content),this._content=B.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=B.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClickClose))},e.prototype._update=function(t){var e=this,r=this._lngLat||this._trackPointer;if(this._map&&r&&this._content&&(this._container||(this._container=B.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=B.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return e._container.classList.add(t)}))),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=qf(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||t)){var i=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat),o=this.options.anchor,a=function t(e){if(e){if("number"==typeof e){var r=Math.round(Math.sqrt(.5*Math.pow(e,2)));return{center:new n(0,0),top:new n(0,e),"top-left":new n(r,r),"top-right":new n(-r,r),bottom:new n(0,-e),"bottom-left":new n(r,-r),"bottom-right":new n(-r,-r),left:new n(e,0),right:new n(-e,0)}}if(e instanceof n||Array.isArray(e)){var i=n.convert(e);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:n.convert(e.center||[0,0]),top:n.convert(e.top||[0,0]),"top-left":n.convert(e["top-left"]||[0,0]),"top-right":n.convert(e["top-right"]||[0,0]),bottom:n.convert(e.bottom||[0,0]),"bottom-left":n.convert(e["bottom-left"]||[0,0]),"bottom-right":n.convert(e["bottom-right"]||[0,0]),left:n.convert(e.left||[0,0]),right:n.convert(e.right||[0,0])}}return t(new n(0,0))}(this.options.offset);if(!o){var s,u=this._container.offsetWidth,l=this._container.offsetHeight;s=i.y+a.bottom.y<l?["top"]:i.y>this._map.transform.height-l?["bottom"]:[],i.x<u/2?s.push("left"):i.x>this._map.transform.width-u/2&&s.push("right"),o=0===s.length?"bottom":s.join("-")}var p=i.add(a[o]).round();B.setTransform(this._container,Zf[o]+" translate("+p.x+"px,"+p.y+"px)"),Gf(this._container,o,"popup")}},e.prototype._onClickClose=function(){this.remove()},e}(Ot);var id={version:"1.3.2",supported:e,setRTLTextPlugin:function(t,e){if(Oi)throw new Error("setRTLTextPlugin cannot be called multiple times.");Oi=!0,Vi=L.resolveURL(t),Fi=function(t){t?(Oi=!1,Vi=null,e&&e(t)):Ui=!0},Ni.fire(new Rt("pluginAvailable",{pluginURL:Vi,completionCallback:Fi}))},Map:Vf,NavigationControl:jf,GeolocateControl:Xf,AttributionControl:Df,ScaleControl:Yf,FullscreenControl:td,Popup:rd,Marker:Kf,Style:Vc,LngLat:Qu,LngLatBounds:Yu,Point:n,MercatorCoordinate:ol,Evented:Ot,config:W,get accessToken(){return W.ACCESS_TOKEN},set accessToken(t){W.ACCESS_TOKEN=t},get baseApiUrl(){return W.API_URL},set baseApiUrl(t){W.API_URL=t},get workerCount(){return Ep.workerCount},set workerCount(t){Ep.workerCount=t},get maxParallelImageRequests(){return W.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){W.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage:function(t){!function(t){var e=self.caches.delete(ft);t&&e.catch(t).then((function(){return t()}))}(t)},workerUrl:""};return id}));
//# sourceMappingURL=mapbox-gl-csp.js.map